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