PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PASNString Class Reference

A descendant of PASNObject which is a simple ASN OctetStr type. More...

#include <pasn.h>

Inheritance diagram for PASNString:
Collaboration diagram for PASNString:

Public Member Functions

 PASNString (const PString &str)
 
 PASNString (const BYTE *ptr, int len)
 
 PASNString (const PBYTEArray &buffer, PASNObject::ASNType=String)
 
 PASNString (const PBYTEArray &buffer, PINDEX &ptr, PASNObject::ASNType=String)
 
void PrintOn (ostream &strm) const
 Virtual functions used by the PObject::operator<< function to print the value of the object. More...
 
void Encode (PBYTEArray &buffer)
 Virtual function used to encode the object into ASN format. More...
 
WORD GetEncodedLength ()
 Virtual function used to get the length of object when encoded into ASN format. More...
 
PObjectClone () const
 Virtual function used to duplicate objects. More...
 
PString GetString () const
 Return the value of the object as a PString. More...
 
ASNType GetType () const
 Return a value of type enum ASNType which indicates the type of the object. More...
 
PString GetTypeAsString () const
 Return a string giving the type of the object. More...
 
- Public Member Functions inherited from PASNObject
int GetChoice () const
 Return the descriminator for Choice sequences. More...
 
virtual PASNInt GetInteger () const
 Return the value of the ASN object as a PASNInt. More...
 
virtual PASNUnsigned GetUnsigned () const
 Return the value of the object as a PASNUnsigned. More...
 
virtual const PASNSequenceGetSequence () const
 Return the value of the object as a PString. More...
 
virtual PIPSocket::Address GetIPAddress () const
 Return the value of the object as an IPAddress. More...
 
- Public Member Functions inherited from PObject
__inline unsigned GetTraceContextIdentifier () const
 Get PTRACE context identifier. More...
 
__inline void SetTraceContextIdentifier (unsigned id)
 
__inline void SetTraceContextIdentifier (const PObject &obj)
 
__inline void SetTraceContextIdentifier (const PObject *obj)
 
__inline void CopyTraceContextIdentifier (PObject &obj) const
 
__inline void CopyTraceContextIdentifier (PObject *obj) const
 
virtual ~PObject ()
 
__inline const char * GetClass () const
 
__inline bool IsClass (const char *name) const
 
__inline const PObjectPTraceObjectInstance () const
 
template<class CLS >
CLS * CloneAs () const
 As for Clone() but converts to specified type. More...
 
virtual PINDEX HashFunction () const
 This function yields a hash value required by the PDictionary class. More...
 
virtual Comparison Compare (const PObject &obj) const
 Compare the two objects and return their relative rank. More...
 
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
 Determine the byte wise comparison of two objects. More...
 
bool operator== (const PObject &obj) const
 Compare the two objects. More...
 
bool operator!= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator< (const PObject &obj) const
 Compare the two objects. More...
 
bool operator> (const PObject &obj) const
 Compare the two objects. More...
 
bool operator<= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator>= (const PObject &obj) const
 Compare the two objects. More...
 
virtual void ReadFrom (istream &strm)
 Input the contents of the object from the stream. More...
 

Protected Member Functions

PBoolean Decode (const PBYTEArray &buffer, PINDEX &i, PASNObject::ASNType type)
 
void Encode (PBYTEArray &buffer, PASNObject::ASNType type)
 
- Protected Member Functions inherited from PASNObject
 PASNObject ()
 Create an empty ASN object. More...
 
- Protected Member Functions inherited from PObject
 PObject ()
 Constructor for PObject, made protected so cannot ever create one on its own. More...
 

Protected Attributes

PString value
 
WORD valueLen
 
- Protected Attributes inherited from PObject
unsigned m_traceContextIdentifier
 

Additional Inherited Members

- Public Types inherited from PASNObject
enum  ASNType {
  Integer, String, ObjectID, Sequence,
  Choice, IPAddress, Counter, Gauge,
  TimeTicks, Opaque, NsapAddress, Counter64,
  UInteger32, Null, Unknown, ASNTypeMax
}
 Value returned by the GetType() function to indicate the type of an ASN object. More...
 
- Public Types inherited from PObject
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
 Result of the comparison operation performed by the Compare() function. More...
 
- Static Public Member Functions inherited from PASNObject
static void EncodeASNLength (PBYTEArray &buffer, WORD length)
 Encode an ASN length value. More...
 
static WORD GetASNLengthLength (WORD length)
 Return the length of an encoded ASN length value. More...
 
static PBoolean DecodeASNLength (const PBYTEArray &buffer, PINDEX &ptr, WORD &len)
 Decode an ASN length in the buffer at the given ptr. More...
 
static void EncodeASNSequenceStart (PBYTEArray &buffer, BYTE type, WORD length)
 Encode a sequence header into the buffer at the specified offset. More...
 
static WORD GetASNSequenceStartLength (WORD length)
 Return the encoded length of a sequence if it has the specified length. More...
 
static void EncodeASNHeader (PBYTEArray &buffer, PASNObject::ASNType type, WORD length)
 Encode an ASN object header into the buffer. More...
 
static WORD GetASNHeaderLength (WORD length)
 Return the length of an ASN object header if the object is the specified length. More...
 
static void EncodeASNInteger (PBYTEArray &buffer, PASNInt data, PASNObject::ASNType type)
 
static void EncodeASNUnsigned (PBYTEArray &buffer, PASNUnsigned data, PASNObject::ASNType type)
 
static WORD GetASNIntegerLength (PASNInt data)
 
static WORD GetASNUnsignedLength (PASNUnsigned data)
 
static PBoolean DecodeASNInteger (const PBYTEArray &buffer, PINDEX &ptr, PASNInt &value, ASNType type=Integer)
 
static PBoolean DecodeASNUnsigned (const PBYTEArray &buffer, PINDEX &ptr, PASNUnsigned &value, ASNType type=TimeTicks)
 
- Static Public Member Functions inherited from PObject
static __inline void CopyTraceContextIdentifier (PObject &to, const PObject &from)
 
static __inline void CopyTraceContextIdentifier (PObject &to, const PObject *from)
 
static __inline void CopyTraceContextIdentifier (PObject *to, const PObject &from)
 
static __inline void CopyTraceContextIdentifier (PObject *to, const PObject *from)
 
static __inline const char * Class ()
 
static __inline const PObjectPTraceObjectInstance (const char *)
 
static __inline const PObjectPTraceObjectInstance (const PObject *obj)
 
template<typename T >
static Comparison Compare2 (T v1, T v2)
 Compare two types, returning Comparison type. More...
 
static Comparison InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
 Internal function caled from CompareObjectMemoryDirect() More...
 
- Static Protected Attributes inherited from PASNObject
static BYTE ASNTypeToType [ASNTypeMax]
 Table to map enum ASNType values to ASN identifiers. More...
 

Detailed Description

A descendant of PASNObject which is a simple ASN OctetStr type.

Constructor & Destructor Documentation

PASNString::PASNString ( const PString str)
PASNString::PASNString ( const BYTE *  ptr,
int  len 
)
PASNString::PASNString ( const PBYTEArray buffer,
PASNObject::ASNType  = String 
)
PASNString::PASNString ( const PBYTEArray buffer,
PINDEX &  ptr,
PASNObject::ASNType  = String 
)

Member Function Documentation

PObject* PASNString::Clone ( ) const
virtual

Virtual function used to duplicate objects.

Reimplemented from PASNObject.

Reimplemented in PASNIPAddress.

PBoolean PASNString::Decode ( const PBYTEArray buffer,
PINDEX &  i,
PASNObject::ASNType  type 
)
protected
void PASNString::Encode ( PBYTEArray buffer)
inlinevirtual

Virtual function used to encode the object into ASN format.

Reimplemented from PASNObject.

Reimplemented in PASNIPAddress.

References PASNObject::String.

Referenced by PASNIPAddress::Encode().

void PASNString::Encode ( PBYTEArray buffer,
PASNObject::ASNType  type 
)
protected
WORD PASNString::GetEncodedLength ( )
virtual

Virtual function used to get the length of object when encoded into ASN format.

Reimplemented from PASNObject.

PString PASNString::GetString ( ) const
virtual

Return the value of the object as a PString.

This function can be use for all ASN object types

Reimplemented from PASNObject.

Reimplemented in PASNIPAddress.

ASNType PASNString::GetType ( ) const
virtual

Return a value of type enum ASNType which indicates the type of the object.

Reimplemented from PASNObject.

Reimplemented in PASNIPAddress.

PString PASNString::GetTypeAsString ( ) const
virtual

Return a string giving the type of the object.

Reimplemented from PASNObject.

Reimplemented in PASNIPAddress.

void PASNString::PrintOn ( ostream &  strm) const
virtual

Virtual functions used by the PObject::operator<< function to print the value of the object.

Reimplemented from PASNObject.

Member Data Documentation

PString PASNString::value
protected
WORD PASNString::valueLen
protected

The documentation for this class was generated from the following file: