Fixed crash opportunity under some conditions
[pwlib.git] / include / ptclib / asnxer.h
blob2c3eb541339148c9f13abc693f36f03c75db175d
1 /*
2 * asnxer.h
4 * Abstract Syntax Notation Encoding Rules classes
6 * Portable Windows Library
8 */
10 #ifdef P_INCLUDE_XER
12 /** Class for ASN XML Encoding Rules stream.
14 class PXER_Stream : public PASN_Stream
16 PCLASSINFO(PXER_Stream, PASN_Stream);
17 public:
18 PXER_Stream(PXMLElement * elem);
19 PXER_Stream(PXMLElement * elem, const PBYTEArray & bytes);
20 PXER_Stream(PXMLElement * elem, const BYTE * buf, PINDEX size);
22 virtual BOOL Read(PChannel & chan);
23 virtual BOOL Write(PChannel & chan);
25 virtual BOOL NullDecode(PASN_Null &);
26 virtual void NullEncode(const PASN_Null &);
27 virtual BOOL BooleanDecode(PASN_Boolean &);
28 virtual void BooleanEncode(const PASN_Boolean &);
29 virtual BOOL IntegerDecode(PASN_Integer &);
30 virtual void IntegerEncode(const PASN_Integer &);
31 virtual BOOL EnumerationDecode(PASN_Enumeration &);
32 virtual void EnumerationEncode(const PASN_Enumeration &);
33 virtual BOOL RealDecode(PASN_Real &);
34 virtual void RealEncode(const PASN_Real &);
35 virtual BOOL ObjectIdDecode(PASN_ObjectId &);
36 virtual void ObjectIdEncode(const PASN_ObjectId &);
37 virtual BOOL BitStringDecode(PASN_BitString &);
38 virtual void BitStringEncode(const PASN_BitString &);
39 virtual BOOL OctetStringDecode(PASN_OctetString &);
40 virtual void OctetStringEncode(const PASN_OctetString &);
41 virtual BOOL ConstrainedStringDecode(PASN_ConstrainedString &);
42 virtual void ConstrainedStringEncode(const PASN_ConstrainedString &);
43 virtual BOOL BMPStringDecode(PASN_BMPString &);
44 virtual void BMPStringEncode(const PASN_BMPString &);
45 virtual BOOL ChoiceDecode(PASN_Choice &);
46 virtual void ChoiceEncode(const PASN_Choice &);
47 virtual BOOL ArrayDecode(PASN_Array &);
48 virtual void ArrayEncode(const PASN_Array &);
49 virtual BOOL SequencePreambleDecode(PASN_Sequence &);
50 virtual void SequencePreambleEncode(const PASN_Sequence &);
51 virtual BOOL SequenceKnownDecode(PASN_Sequence &, PINDEX, PASN_Object &);
52 virtual void SequenceKnownEncode(const PASN_Sequence &, PINDEX, const PASN_Object &);
53 virtual BOOL SequenceUnknownDecode(PASN_Sequence &);
54 virtual void SequenceUnknownEncode(const PASN_Sequence &);
56 PXMLElement * GetCurrentElement() { return position; }
57 PXMLElement * SetCurrentElement(PXMLElement * elem) { return position = elem; }
59 protected:
60 PXMLElement * position;
63 #endif