asnper.h
Go to the documentation of this file.
/*
* asnper.h
*
* Abstract Syntax Notation Encoding Rules classes
*
* Portable Windows Library
*
*/
#ifdef P_INCLUDE_PER
class PPER_Stream : public PASN_Stream
{
PCLASSINFO(PPER_Stream, PASN_Stream);
public:
PPER_Stream(int aligned = true);
PPER_Stream(const BYTE * buf, PINDEX size, PBoolean aligned = true);
PPER_Stream(const PBYTEArray & bytes, PBoolean aligned = true);
PPER_Stream & operator=(const PBYTEArray & bytes);
unsigned GetBitsLeft() const;
virtual PBoolean Read(PChannel & chan);
virtual PBoolean Write(PChannel & chan);
virtual PBoolean NullDecode(PASN_Null &);
virtual void NullEncode(const PASN_Null &);
virtual PBoolean BooleanDecode(PASN_Boolean &);
virtual void BooleanEncode(const PASN_Boolean &);
virtual PBoolean IntegerDecode(PASN_Integer &);
virtual void IntegerEncode(const PASN_Integer &);
virtual PBoolean EnumerationDecode(PASN_Enumeration &);
virtual void EnumerationEncode(const PASN_Enumeration &);
virtual PBoolean RealDecode(PASN_Real &);
virtual void RealEncode(const PASN_Real &);
virtual PBoolean ObjectIdDecode(PASN_ObjectId &);
virtual void ObjectIdEncode(const PASN_ObjectId &);
virtual PBoolean BitStringDecode(PASN_BitString &);
virtual void BitStringEncode(const PASN_BitString &);
virtual PBoolean OctetStringDecode(PASN_OctetString &);
virtual void OctetStringEncode(const PASN_OctetString &);
virtual PBoolean ConstrainedStringDecode(PASN_ConstrainedString &);
virtual void ConstrainedStringEncode(const PASN_ConstrainedString &);
virtual PBoolean BMPStringDecode(PASN_BMPString &);
virtual void BMPStringEncode(const PASN_BMPString &);
virtual PBoolean ChoiceDecode(PASN_Choice &);
virtual void ChoiceEncode(const PASN_Choice &);
virtual PBoolean ArrayDecode(PASN_Array &);
virtual void ArrayEncode(const PASN_Array &);
virtual PBoolean SequencePreambleDecode(PASN_Sequence &);
virtual void SequencePreambleEncode(const PASN_Sequence &);
virtual PBoolean SequenceKnownDecode(PASN_Sequence &, PINDEX, PASN_Object &);
virtual void SequenceKnownEncode(const PASN_Sequence &, PINDEX, const PASN_Object &);
virtual PBoolean SequenceUnknownDecode(PASN_Sequence &);
virtual void SequenceUnknownEncode(const PASN_Sequence &);
PBoolean IsAligned() const { return aligned; }
PBoolean SingleBitDecode();
void SingleBitEncode(PBoolean value);
PBoolean MultiBitDecode(unsigned nBits, unsigned & value);
void MultiBitEncode(unsigned value, unsigned nBits);
PBoolean SmallUnsignedDecode(unsigned & value);
void SmallUnsignedEncode(unsigned value);
PBoolean LengthDecode(unsigned lower, unsigned upper, unsigned & len);
void LengthEncode(unsigned len, unsigned lower, unsigned upper);
PBoolean UnsignedDecode(unsigned lower, unsigned upper, unsigned & value);
void UnsignedEncode(int value, unsigned lower, unsigned upper);
void AnyTypeEncode(const PASN_Object * value);
protected:
PBoolean aligned;
};
#endif
// End Of File ///////////////////////////////////////////////////////////////
PASN_Stream::NullEncode
virtual void NullEncode(const PASN_Null &)=0
PASN_Stream::OctetStringEncode
virtual void OctetStringEncode(const PASN_OctetString &)=0
PASN_Boolean
Class for ASN Boolean type.
Definition: asner.h:206
PASN_Stream::ArrayEncode
virtual void ArrayEncode(const PASN_Array &)=0
PASN_Stream::ObjectIdDecode
virtual PBoolean ObjectIdDecode(PASN_ObjectId &)=0
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PASN_Stream::RealEncode
virtual void RealEncode(const PASN_Real &)=0
PASN_Stream::SequenceKnownEncode
virtual void SequenceKnownEncode(const PASN_Sequence &, PINDEX, const PASN_Object &)=0
PASN_Stream::ConstrainedStringEncode
virtual void ConstrainedStringEncode(const PASN_ConstrainedString &)=0
PASN_Stream::NullDecode
virtual PBoolean NullDecode(PASN_Null &)=0
PASN_Stream::SequenceUnknownDecode
virtual PBoolean SequenceUnknownDecode(PASN_Sequence &)=0
PContainer::operator=
PContainer & operator=(const PContainer &cont)
Assign one container reference to another.
PASN_Stream
Base class for ASN decoder/encoder stream.
Definition: asner.h:919
PASN_Stream::SequenceUnknownEncode
virtual void SequenceUnknownEncode(const PASN_Sequence &)=0
PASN_Stream::BooleanDecode
virtual PBoolean BooleanDecode(PASN_Boolean &)=0
PASN_Stream::SequencePreambleDecode
virtual PBoolean SequencePreambleDecode(PASN_Sequence &)=0
PASN_Stream::BitStringDecode
virtual PBoolean BitStringDecode(PASN_BitString &)=0
PASN_Stream::OctetStringDecode
virtual PBoolean OctetStringDecode(PASN_OctetString &)=0
PASN_Stream::ConstrainedStringDecode
virtual PBoolean ConstrainedStringDecode(PASN_ConstrainedString &)=0
PASN_ConstrainedString
Base class for ASN String types.
Definition: asner.h:510
PBoolean
BOOL PBoolean
Definition: object.h:102
PASN_BMPString
Class for ASN BMP (16 bit) String type.
Definition: asner.h:579
PBYTEArray
Array of unsigned characters.
Definition: array.h:670
PASN_Sequence
Class for ASN Sequence type.
Definition: asner.h:787
PASN_Stream::ObjectIdEncode
virtual void ObjectIdEncode(const PASN_ObjectId &)=0
PASN_Stream::EnumerationEncode
virtual void EnumerationEncode(const PASN_Enumeration &)=0
PASN_Stream::BMPStringDecode
virtual PBoolean BMPStringDecode(PASN_BMPString &)=0
PASN_Stream::RealDecode
virtual PBoolean RealDecode(PASN_Real &)=0
PChannel
Abstract class defining I/O channel semantics.
Definition: channel.h:107
PASN_Stream::IntegerEncode
virtual void IntegerEncode(const PASN_Integer &)=0
PASN_Stream::ChoiceDecode
virtual PBoolean ChoiceDecode(PASN_Choice &)=0
PASN_Stream::Write
virtual PBoolean Write(PChannel &chan)=0
PASN_Stream::EnumerationDecode
virtual PBoolean EnumerationDecode(PASN_Enumeration &)=0
PASN_Stream::ArrayDecode
virtual PBoolean ArrayDecode(PASN_Array &)=0
PASN_Enumeration
Class for ASN Enumerated type.
Definition: asner.h:274
PASN_Stream::BitStringEncode
virtual void BitStringEncode(const PASN_BitString &)=0
PASN_Choice
Class for ASN Choice type.
Definition: asner.h:677
PASN_Stream::SequenceKnownDecode
virtual PBoolean SequenceKnownDecode(PASN_Sequence &, PINDEX, PASN_Object &)=0
PASN_Stream::BMPStringEncode
virtual void BMPStringEncode(const PASN_BMPString &)=0
PASN_Stream::IntegerDecode
virtual PBoolean IntegerDecode(PASN_Integer &)=0
PASN_Stream::ChoiceEncode
virtual void ChoiceEncode(const PASN_Choice &)=0
PASN_Null
Class for ASN Null type.
Definition: asner.h:186
PASN_Real
Class for ASN floating point type.
Definition: asner.h:329
PASN_OctetString
Class for ASN Octet String type.
Definition: asner.h:458
PASN_Integer
Class for ASN Integer type.
Definition: asner.h:234
PASN_Stream::BooleanEncode
virtual void BooleanEncode(const PASN_Boolean &)=0
PASN_ObjectId
Class for ASN Object Identifier type.
Definition: asner.h:357
PASN_Array
Class for ASN Array type.
Definition: asner.h:880
PASN_BitString
Class for ASN Bit String type.
Definition: asner.h:404
PASN_Stream::SequencePreambleEncode
virtual void SequencePreambleEncode(const PASN_Sequence &)=0
PASN_Stream::Read
virtual PBoolean Read(PChannel &chan)=0
PASN_Object
Base class for ASN encoding/decoding.
Definition: asner.h:59