ASN1BEREncodeStream Class Reference
[C++ classes for streaming BER encoding.]

#include <ASN1BEREncodeStream.h>

List of all members.

Public Member Functions

 ASN1BEREncodeStream (OSRTOutputStreamIF &os)
 ASN1BEREncodeStream (OSRTOutputStreamIF *pos, OSBOOL bOwnStream=TRUE)
virtual void * getAppInfo ()
virtual OSRTCtxtPtr getContext ()
virtual OSCTXT * getCtxtPtr ()
virtual char * getErrorInfo ()
virtual char * getErrorInfo (char *pBuf, size_t &bufSize)
virtual int getStatus () const
virtual void printErrorInfo ()
virtual void resetErrorInfo ()
virtual void setAppInfo (void *pAppInfo)
virtual void setDiag (OSBOOL value=TRUE)
virtual int close ()
virtual int flush ()
virtual OSBOOL isOpened ()
virtual long write (const OSOCTET *pdata, size_t size)
ASN1BEREncodeStreamoperator<< (ASN1CType &val)
int encodeBMPStr (const Asn116BitCharString &val, ASN1TagType tagging=ASN1EXPL)
int encodeBigInt (const char *pval, ASN1TagType tagging=ASN1EXPL)
int encodeBigIntNchars (const char *pval, size_t nchars, ASN1TagType tagging=ASN1EXPL)
int encodeBitStr (const OSOCTET *pbits, OSUINT32 numbits, ASN1TagType tagging=ASN1EXPL)
int encodeBitStr (const ASN1DynBitStr &val, ASN1TagType tagging=ASN1EXPL)
int encodeBool (OSBOOL val, ASN1TagType tagging=ASN1EXPL)
int encodeCharStr (const char *pval, ASN1TagType tagging=ASN1EXPL, ASN1TAG tag=0)
int encodeEnum (OSINT32 val, ASN1TagType tagging=ASN1EXPL)
int encodeEoc ()
int encodeIndefLen ()
int encodeInt (OSINT32 val, ASN1TagType tagging=ASN1EXPL)
int encodeInt8 (OSINT8 val, ASN1TagType tagging=ASN1EXPL)
int encodeInt16 (OSINT16 val, ASN1TagType tagging=ASN1EXPL)
int encodeInt64 (OSINT64 val, ASN1TagType tagging=ASN1EXPL)
int encodeLen (size_t len)
int encodeNull (ASN1TagType tagging=ASN1EXPL)
int encodeObj (ASN1CType &val)
int encodeObjId (const ASN1OBJID &val, ASN1TagType tagging=ASN1EXPL)
int encodeObjId64 (const ASN1OID64 &val, ASN1TagType tagging=ASN1EXPL)
int encodeOctStr (const OSOCTET *pocts, OSUINT32 numocts, ASN1TagType tagging=ASN1EXPL)
int encodeOctStr (const ASN1DynOctStr &val, ASN1TagType tagging=ASN1EXPL)
int encodeReal (OSREAL val, ASN1TagType tagging=ASN1EXPL)
int encodeRelativeOID (const ASN1OBJID &val, ASN1TagType tagging=ASN1EXPL)
int encodeTag (ASN1TAG tag)
int encodeTagAndIndefLen (ASN1TAG tag)
int encodeTagAndLen (ASN1TAG tag, OSINT32 len)
int encodeUInt (OSUINT32 val, ASN1TagType tagging=ASN1EXPL)
int encodeUInt8 (OSUINT8 val, ASN1TagType tagging=ASN1EXPL)
int encodeUInt16 (OSUINT16 val, ASN1TagType tagging=ASN1EXPL)
int encodeUInt64 (OSUINT64 val, ASN1TagType tagging=ASN1EXPL)
int encodeUnivStr (const Asn132BitCharString &val, ASN1TagType tagging=ASN1EXPL)
OSBOOL isA (Type bufferType)

Protected Attributes

OSRTOutputStreamIF * mpStream
OSBOOL mbOwnStream

Detailed Description

This class is a base class for other ASN.1 BER output stream's classes. It is derived from the ASN1Stream base class. It contains variables and methods specific to streaming encoding of BER messages.


Constructor & Destructor Documentation

ASN1BEREncodeStream::ASN1BEREncodeStream ( OSRTOutputStreamIF &  os  ) 

A default constructor. Use getStatus() method to determine has error occured during the initialization or not.


Member Function Documentation

virtual int ASN1BEREncodeStream::close (  )  [inline, virtual]

Closes the input or output stream and releases any system resources associated with the stream. For output streams this function also flushes all internal buffers to the stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamClose
int ASN1BEREncodeStream::encodeBigInt ( const char *  pval,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 INTEGER type. In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits).

Parameters:
*pval A pointer to a character string containing the value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmBigInt
int ASN1BEREncodeStream::encodeBigIntNchars ( const char *  pval,
size_t  nchars,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 INTEGER type. In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits).

Parameters:
*pval A pointer to a character string containing the value to be encoded.
nchars Number of characters from pval to encode.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmBigInt
int ASN1BEREncodeStream::encodeBitStr ( const ASN1DynBitStr &  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 BIT STRING type.

Parameters:
val A reference to the ASN1DynBitStr structure containing a bit data and number of bits to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmBitStr
int ASN1BEREncodeStream::encodeBitStr ( const OSOCTET *  pbits,
OSUINT32  numbits,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 BIT STRING type.

Parameters:
pbits A pointer to an OCTET string containing the bit data to be encoded. This string contains bytes having the actual bit settings as they are to be encoded in the message.
numbits The number of bits within the bit string to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmBitStr
int ASN1BEREncodeStream::encodeBMPStr ( const Asn116BitCharString &  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 BMPString type that is based on a 16-bit character sets.

Parameters:
val A reference to a structure representing a 16-bit character string to be encoded. This structure contains a character count element and a pointer to an array of 16-bit character elements represented as 16-bit short integers.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmBMPStr
int ASN1BEREncodeStream::encodeBool ( OSBOOL  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 BOOLEAN type.

Parameters:
val A BOOLEAN value to be encoded. A BOOLEAN is defined as a single OCTET whose value is 0 for FALSE and any other value for TRUE.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmBool
int ASN1BEREncodeStream::encodeCharStr ( const char *  pval,
ASN1TagType  tagging = ASN1EXPL,
ASN1TAG  tag = 0 
)

This method encodes a variable of the ASN.1 character string type.

Parameters:
pval A pointer to a null-terminated C character string to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmCharStr
int ASN1BEREncodeStream::encodeEnum ( OSINT32  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 ENUMERATED type. The enumerated encoding is identical to that of an integer. The compiler adds additional checks to the generated code to ensure the value is within the given set.

Parameters:
val An integer containing the enumerated value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmEnum
int ASN1BEREncodeStream::encodeEoc (  ) 

This method encodes end-of-contents octets (EOC) into the stream. EOC is two zero octets (it is documented in the X.690 standard). This method must be called when the encoding of the complex type with indefinite length is finishing.

Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmEOC, berEncStrmTagAndIndefLen,
int ASN1BEREncodeStream::encodeIndefLen (  ) 

This method is used to encode the indefinite length indicator. This can be used to manually create an indefinite length wrapper around long or constructed records.

Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmWriteOctet
int ASN1BEREncodeStream::encodeInt ( OSINT32  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 INTEGER type.

Parameters:
val A 32-bit INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmInt
int ASN1BEREncodeStream::encodeInt16 ( OSINT16  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a 16-bit variable of the ASN.1 INTEGER type.

Parameters:
val A 16-bit INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmInt16
int ASN1BEREncodeStream::encodeInt64 ( OSINT64  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a 64-bit variable of the ASN.1 INTEGER type.

Parameters:
val A 64-bit INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmInt64
int ASN1BEREncodeStream::encodeInt8 ( OSINT8  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes an 8-bit variable of the ASN.1 INTEGER type.

Parameters:
val An 8-bit INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmInt8
int ASN1BEREncodeStream::encodeLen ( size_t  len  ) 

This method is used to encode a length in BER format.

Parameters:
len The length of the contents field.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmLength
int ASN1BEREncodeStream::encodeNull ( ASN1TagType  tagging = ASN1EXPL  ) 

This method encodes a variable of the ASN.1 NULL type.

Parameters:
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmRelativeOID
int ASN1BEREncodeStream::encodeObj ( ASN1CType &  val  ) 

This method encodes an ASN.1 constructed object to the stream.

Parameters:
val A reference to an object to be encoded.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
int ASN1BEREncodeStream::encodeObjId ( const ASN1OBJID &  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 OBJECT IDENTIFIER type.

Parameters:
val A reference to an object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array to hold the subidentifier values.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmObjId
int ASN1BEREncodeStream::encodeObjId64 ( const ASN1OID64 &  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 OBJECT IDENTIFIER type using 64-bit subidentifiers.

Parameters:
val A reference to a 64-bit object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array of 64-bit unsigned integers to hold the subidentifier values.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmObjId64
int ASN1BEREncodeStream::encodeOctStr ( const ASN1DynOctStr &  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 OCTET STRING type.

Parameters:
val A reference to the ASN1DynOctStr structure containing an octet data and number of octets to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmOctStr
int ASN1BEREncodeStream::encodeOctStr ( const OSOCTET *  pocts,
OSUINT32  numocts,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 OCTET STRING type.

Parameters:
pocts A pointer to an OCTET STRING containing the octet data to be encoded.
numocts The number of octets (bytes) within the OCTET STRING to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmOctStr
int ASN1BEREncodeStream::encodeReal ( OSREAL  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the REAL data type. It provides support for the plus-infinity and minus-infinity special real values. Use the rtxGetPlusInfinity or rtxGetMinusInfinity functions to get these special values.

Parameters:
val An OSREAL data type. This is defined to be the C double type. Special real values plus and minus infinity are encoded by using the rtxGetPlusInfinity and rtxGetMinusInfinity functions to set the real value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmReal
int ASN1BEREncodeStream::encodeRelativeOID ( const ASN1OBJID &  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 RELATIVE-OID type.

Parameters:
val A reference to an object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array to hold the subidentifier values.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmRelativeOID
int ASN1BEREncodeStream::encodeTag ( ASN1TAG  tag  ) 

This method is used to encode the ASN.1 tag field that preface each block of message data. The ASN1C compiler generates calls to this function to handle the encoding of user-defined tags within an ASN.1 specification.

Parameters:
tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmTag
int ASN1BEREncodeStream::encodeTagAndIndefLen ( ASN1TAG  tag  ) 

This method is used to encode a tag value and an indefinite length. This can be used to manually create an indefinite length wrapper around long or constructed records.

Parameters:
tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmTagAndIndefLen
int ASN1BEREncodeStream::encodeTagAndLen ( ASN1TAG  tag,
OSINT32  len 
)

This method is used to encode the ASN.1 tag and length fields that preface each block of message data.

Parameters:
tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
len The length of the contents field. This parameter can be used to specify the actual length, or the special constant 'ASN_K_INDEFLEN' can be used to specify that an indefinite length specification should be encoded.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmTagAndLen
int ASN1BEREncodeStream::encodeUInt ( OSUINT32  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes an unsigned variable of the ASN.1 INTEGER type.

Parameters:
val An unsigned INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmUInt
int ASN1BEREncodeStream::encodeUInt16 ( OSUINT16  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a 16-bit unsigned variable of the ASN.1 INTEGER type.

Parameters:
val A 16-bit unsigned INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmUInt16
int ASN1BEREncodeStream::encodeUInt64 ( OSUINT64  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a 64-bit unsigned variable of the ASN.1 INTEGER type.

Parameters:
val A 64-bit unsigned INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmUInt64
int ASN1BEREncodeStream::encodeUInt8 ( OSUINT8  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes an 8-bit unsigned variable of the ASN.1 INTEGER type.

Parameters:
val An 8-bit unsigned INTEGER value to be encoded.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmUInt8
int ASN1BEREncodeStream::encodeUnivStr ( const Asn132BitCharString &  val,
ASN1TagType  tagging = ASN1EXPL 
)

This method encodes a variable of the ASN.1 UniversalString type that is based on a 32-bit character sets.

Parameters:
val A reference to a structure representing a 32-bit character string to be encoded. This structure contains a character count element and a pointer to an array of 32-bit character elements represented as 32-bit unsigned integers.
tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
See also:
berEncStrmUnivStr
virtual int ASN1BEREncodeStream::flush (  )  [inline, virtual]

Flushes the buffered data to the stream.

Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
See also:
rtxStreamFlush
virtual void* ASN1BEREncodeStream::getAppInfo (  )  [inline, virtual]

Returns a pointer to application-specific information block

virtual OSRTCtxtPtr ASN1BEREncodeStream::getContext (  )  [inline, virtual]

The getContext method returns the underlying context smart-pointer object.

Returns:
Context smart pointer object.
virtual OSCTXT* ASN1BEREncodeStream::getCtxtPtr (  )  [inline, virtual]

The getCtxtPtr method returns the underlying C runtime context. This context can be used in calls to C runtime functions.

Returns:
The pointer to C runtime context.
virtual char* ASN1BEREncodeStream::getErrorInfo ( char *  pBuf,
size_t &  bufSize 
) [inline, virtual]

Returns error text in a memory buffer. If buffer pointer is specified in parameters (not NULL) then error text will be copied in the passed buffer. Otherwise, this method allocates memory using the 'operator new []' function. The calling routine is responsible to free the memory by using 'operator delete []'.

Parameters:
pBuf A pointer to a destination buffer to obtain the error text. If NULL, dynamic buffer will be allocated.
bufSize A reference to buffer size. If pBuf is NULL it will receive the size of allocated dynamic buffer.
Returns:
A pointer to a buffer with error text. If pBuf is not NULL, the return pointer will be equal to it. Otherwise, returns newly allocated buffer with error text. NULL, if error occured.
virtual char* ASN1BEREncodeStream::getErrorInfo (  )  [inline, virtual]

Returns error text in a dynamic memory buffer. Buffer will be allocated by 'operator new []'. The calling routine is responsible to free the memory by using 'operator delete []'.

Returns:
A pointer to a newly allocated buffer with error text.
virtual int ASN1BEREncodeStream::getStatus (  )  const [inline, virtual]

This method returns the completion status of previous operation. It can be used to check completion status of constructors or methods, which do not return completion status. If error occurs, use printErrorInfo method to print out the error's description and stack trace. Method resetError can be used to reset error to continue operations after recovering from the error.

Returns:
Runtime status code:
  • 0 (0) = success,
  • negative return value is error.
OSBOOL ASN1BEREncodeStream::isA ( Type  bufferType  ) 

This method matches an enumerated identifier defined in the base class. One identifier is declared for each of the derived classes.

Parameters:
bufferType Enumerated identifier specifying a derived class. This type is defined as a public access type in the ASN1MessageBufferIF base interface. Possible values are: BEREncode, BERDecode, PEREncode, PERDecode, XEREncode, XERDecode, XMLEncode, XMLDecode, Stream.
Returns:
Boolean result of the match operation. True if this is the class corresponding to the identifier argument.
virtual OSBOOL ASN1BEREncodeStream::isOpened (  )  [inline, virtual]

Checks, is the stream opened or not.

Returns:
TRUE, if the stream is opened, FALSE otherwise.
See also:
rtxStreamIsOpened
ASN1BEREncodeStream& ASN1BEREncodeStream::operator<< ( ASN1CType &  val  ) 

Encodes an ASN.1 constructed object to the stream. Use getStatus() method to determine has error occured during the operation or not.

Parameters:
val A reference to an object to be encoded.
Returns:
reference to this class to perform sequential encoding.
virtual void ASN1BEREncodeStream::printErrorInfo (  )  [inline, virtual]

The printErrorInfo method prints information on errors contained within the context.

virtual void ASN1BEREncodeStream::resetErrorInfo (  )  [inline, virtual]

The resetErrorInfo method resets information on errors contained within the context.

virtual void ASN1BEREncodeStream::setAppInfo ( void *  pAppInfo  )  [inline, virtual]

Sets the application-specific information block.

virtual void ASN1BEREncodeStream::setDiag ( OSBOOL  value = TRUE  )  [inline, virtual]

The setDiag method will turn diagnostic tracing on or off.

Parameters:
value - Boolean value (default = TRUE = on)
virtual long ASN1BEREncodeStream::write ( const OSOCTET *  pdata,
size_t  size 
) [inline, virtual]

Write data to the stream. This method writes the given number of octets from the given array to the output stream.

Parameters:
pdata Pointer to the data to be written.
size The number of octets to write.
Returns:
The total number of octets written into the stream, or negative value with error code if any error is occurred.
See also:
rtxStreamWrite

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