# asnper.h

Go to the documentation of this file.

    00001 /*
    00002  * asnper.h
    00003  *
    00004  * Abstract Syntax Notation Encoding Rules classes
    00005  *
    00006  * Portable Windows Library
    00007  *
    00008  */
    00009
    00010 #ifdef P_INCLUDE_PER
    00011
    00012
    00015 class PPER_Stream : public PASN_Stream
    00016 {
    00017     PCLASSINFO(PPER_Stream, PASN_Stream);
    00018   public:
    00019     PPER_Stream(int aligned = true);
    00020     PPER_Stream(const BYTE * buf, PINDEX size, PBoolean aligned = true);
    00021     PPER_Stream(const PBYTEArray & bytes, PBoolean aligned = true);
    00022
    00023     PPER_Stream & operator=(const PBYTEArray & bytes);
    00024
    00025     unsigned GetBitsLeft() const;
    00026
    00027     virtual PBoolean Read(PChannel & chan);
    00028     virtual PBoolean Write(PChannel & chan);
    00029
    00030     virtual PBoolean NullDecode(PASN_Null &);
    00031     virtual void NullEncode(const PASN_Null &);
    00032     virtual PBoolean BooleanDecode(PASN_Boolean &);
    00033     virtual void BooleanEncode(const PASN_Boolean &);
    00034     virtual PBoolean IntegerDecode(PASN_Integer &);
    00035     virtual void IntegerEncode(const PASN_Integer &);
    00036     virtual PBoolean EnumerationDecode(PASN_Enumeration &);
    00037     virtual void EnumerationEncode(const PASN_Enumeration &);
    00038     virtual PBoolean RealDecode(PASN_Real &);
    00039     virtual void RealEncode(const PASN_Real &);
    00040     virtual PBoolean ObjectIdDecode(PASN_ObjectId &);
    00041     virtual void ObjectIdEncode(const PASN_ObjectId &);
    00042     virtual PBoolean BitStringDecode(PASN_BitString &);
    00043     virtual void BitStringEncode(const PASN_BitString &);
    00044     virtual PBoolean OctetStringDecode(PASN_OctetString &);
    00045     virtual void OctetStringEncode(const PASN_OctetString &);
    00046     virtual PBoolean ConstrainedStringDecode(PASN_ConstrainedString &);
    00047     virtual void ConstrainedStringEncode(const PASN_ConstrainedString &);
    00048     virtual PBoolean BMPStringDecode(PASN_BMPString &);
    00049     virtual void BMPStringEncode(const PASN_BMPString &);
    00050     virtual PBoolean ChoiceDecode(PASN_Choice &);
    00051     virtual void ChoiceEncode(const PASN_Choice &);
    00052     virtual PBoolean ArrayDecode(PASN_Array &);
    00053     virtual void ArrayEncode(const PASN_Array &);
    00054     virtual PBoolean SequencePreambleDecode(PASN_Sequence &);
    00055     virtual void SequencePreambleEncode(const PASN_Sequence &);
    00056     virtual PBoolean SequenceKnownDecode(PASN_Sequence &, PINDEX, PASN_Object &);
    00057     virtual void SequenceKnownEncode(const PASN_Sequence &, PINDEX, const PASN_Object &);
    00058     virtual PBoolean SequenceUnknownDecode(PASN_Sequence &);
    00059     virtual void SequenceUnknownEncode(const PASN_Sequence &);
    00060
    00061     PBoolean IsAligned() const { return aligned; }
    00062
    00063     PBoolean SingleBitDecode();
    00064     void SingleBitEncode(PBoolean value);
    00065
    00066     PBoolean MultiBitDecode(unsigned nBits, unsigned & value);
    00067     void MultiBitEncode(unsigned value, unsigned nBits);
    00068
    00069     PBoolean SmallUnsignedDecode(unsigned & value);
    00070     void SmallUnsignedEncode(unsigned value);
    00071
    00072     PBoolean LengthDecode(unsigned lower, unsigned upper, unsigned & len);
    00073     void LengthEncode(unsigned len, unsigned lower, unsigned upper);
    00074
    00075     PBoolean UnsignedDecode(unsigned lower, unsigned upper, unsigned & value);
    00076     void UnsignedEncode(int value, unsigned lower, unsigned upper);
    00077
    00078     void AnyTypeEncode(const PASN_Object * value);
    00079
    00080   protected:
    00081     PBoolean aligned;
    00082 };
    00083
    00084 #endif
    00085
    00086
    00087 // End Of File ///////////////////////////////////////////////////////////////