PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
asnper.h
Go to the documentation of this file.
1 /*
2 * asnper.h
3 *
4 * Abstract Syntax Notation Encoding Rules classes
5 *
6 * Portable Windows Library
7 *
8 */
9
10 #ifdef P_INCLUDE_PER
11
12
15 class PPER_Stream : public PASN_Stream
16 {
17 PCLASSINFO(PPER_Stream, PASN_Stream);
18 public:
19 PPER_Stream(int aligned = true);
20 PPER_Stream(const BYTE * buf, PINDEX size, PBoolean aligned = true);
21 PPER_Stream(const PBYTEArray & bytes, PBoolean aligned = true);
22
23 PPER_Stream & operator=(const PBYTEArray & bytes);
24
25 unsigned GetBitsLeft() const;
26
27 virtual PBoolean Read(PChannel & chan);
28 virtual PBoolean Write(PChannel & chan);
29
30 virtual PBoolean NullDecode(PASN_Null &);
31 virtual void NullEncode(const PASN_Null &);
32 virtual PBoolean BooleanDecode(PASN_Boolean &);
33 virtual void BooleanEncode(const PASN_Boolean &);
34 virtual PBoolean IntegerDecode(PASN_Integer &);
35 virtual void IntegerEncode(const PASN_Integer &);
36 virtual PBoolean EnumerationDecode(PASN_Enumeration &);
37 virtual void EnumerationEncode(const PASN_Enumeration &);
38 virtual PBoolean RealDecode(PASN_Real &);
39 virtual void RealEncode(const PASN_Real &);
40 virtual PBoolean ObjectIdDecode(PASN_ObjectId &);
41 virtual void ObjectIdEncode(const PASN_ObjectId &);
42 virtual PBoolean BitStringDecode(PASN_BitString &);
43 virtual void BitStringEncode(const PASN_BitString &);
44 virtual PBoolean OctetStringDecode(PASN_OctetString &);
45 virtual void OctetStringEncode(const PASN_OctetString &);
46 virtual PBoolean ConstrainedStringDecode(PASN_ConstrainedString &);
47 virtual void ConstrainedStringEncode(const PASN_ConstrainedString &);
48 virtual PBoolean BMPStringDecode(PASN_BMPString &);
49 virtual void BMPStringEncode(const PASN_BMPString &);
50 virtual PBoolean ChoiceDecode(PASN_Choice &);
51 virtual void ChoiceEncode(const PASN_Choice &);
52 virtual PBoolean ArrayDecode(PASN_Array &);
53 virtual void ArrayEncode(const PASN_Array &);
54 virtual PBoolean SequencePreambleDecode(PASN_Sequence &);
55 virtual void SequencePreambleEncode(const PASN_Sequence &);
56 virtual PBoolean SequenceKnownDecode(PASN_Sequence &, PINDEX, PASN_Object &);
57 virtual void SequenceKnownEncode(const PASN_Sequence &, PINDEX, const PASN_Object &);
58 virtual PBoolean SequenceUnknownDecode(PASN_Sequence &);
59 virtual void SequenceUnknownEncode(const PASN_Sequence &);
60
61 PBoolean IsAligned() const { return aligned; }
62
63 PBoolean SingleBitDecode();
64 void SingleBitEncode(PBoolean value);
65
66 PBoolean MultiBitDecode(unsigned nBits, unsigned & value);
67 void MultiBitEncode(unsigned value, unsigned nBits);
68
69 PBoolean SmallUnsignedDecode(unsigned & value);
70 void SmallUnsignedEncode(unsigned value);
71
72 PBoolean LengthDecode(unsigned lower, unsigned upper, unsigned & len);
73 void LengthEncode(unsigned len, unsigned lower, unsigned upper);
74
75 PBoolean UnsignedDecode(unsigned lower, unsigned upper, unsigned & value);
76 void UnsignedEncode(int value, unsigned lower, unsigned upper);
77
78 void AnyTypeEncode(const PASN_Object * value);
79
80 protected:
81 PBoolean aligned;
82 };
83
84 #endif
85
86
87 // End Of File ///////////////////////////////////////////////////////////////