|
|
 |
 |
|
#include <ASN1XEROutputStream.h>
Inheritance diagram for ASN1XEROutputStream:
List of all members.
Detailed Description
This class is a base class for other ASN.1 XER output stream's classes. It is derived from the ASN1Stream base class. It contains variables and methods specific to streaming encoding of XER messages.
|
Public Member Functions |
| ASN1XEROutputStream & | operator<< (ASN1CType &val) |
| int | encodeStartElement (const char *elemName, const char *attributes=0) |
| int | encodeEndElement (const char *elemName) |
| int | encodeEmptyElement (const char *elemName, const char *attributes=0) |
| int | encodeBMPStr (const Asn116BitCharString &val, const char *elemName) |
| int | encodeBigInt (const char *pval, const char *elemName) |
| int | encodeBitStr (const ASN1OCTET *pbits, ASN1UINT numbits, const char *elemName, ASN1StrType outputType) |
| int | encodeBitStr (const ASN1DynBitStr &val, const char *elemName, ASN1StrType outputType) |
| int | encodeBool (ASN1BOOL val, const char *elemName) |
| int | encodeCharStr (const char *pval, const char *elemName) |
| int | encodeInt (ASN1INT val, const char *elemName) |
| int | encodeInt64 (ASN1INT64 val, const char *elemName) |
| int | encodeNull (const char *elemName) |
| int | encodeObj (ASN1CType &val) |
| int | encodeObjId (const ASN1OBJID &val, const char *elemName) |
| int | encodeObjId64 (const ASN1OID64 &val, const char *elemName) |
| int | encodeOctStr (const ASN1OCTET *pocts, ASN1UINT numocts, const char *elemName) |
| int | encodeOctStr (const ASN1DynOctStr &val, const char *elemName) |
| int | encodeReal (ASN1REAL val, const char *elemName) |
| int | encodeRelativeOID (const ASN1OBJID &val, const char *elemName) |
| int | encodeUInt (ASN1UINT val, const char *elemName) |
| int | encodeUInt64 (ASN1UINT64 val, const char *elemName) |
| int | encodeUnivStr (const Asn132BitCharString &val, const char *elemName) |
Protected Member Functions |
| | ASN1XEROutputStream () |
Constructor & Destructor Documentation
| ASN1XEROutputStream::ASN1XEROutputStream |
( |
|
) |
[inline, protected] |
|
|
|
A default constructor. Use getStatus() method to determine has error occured during the initialization or not. |
Member Function Documentation
| int ASN1XEROutputStream::encodeBigInt |
( |
const char * |
pval, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeBitStr |
( |
const ASN1DynBitStr & |
val, |
|
|
const char * |
elemName, |
|
|
ASN1StrType |
outputType |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
| outputType | An enumerated type whose value is set to either 'ASN1BIN' (for binary format) or 'ASN1HEX' (for hexadecimal format). |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeBitStr |
( |
const ASN1OCTET * |
pbits, |
|
|
ASN1UINT |
numbits, |
|
|
const char * |
elemName, |
|
|
ASN1StrType |
outputType |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
| outputType | An enumerated type whose value is set to either 'ASN1BIN' (for binary format) or 'ASN1HEX' (for hexadecimal format). |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeBMPStr |
( |
const Asn116BitCharString & |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeBool |
( |
ASN1BOOL |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeCharStr |
( |
const char * |
pval, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeEmptyElement |
( |
const char * |
elemName, |
|
|
const char * |
attributes = 0 |
|
) |
|
|
|
|
This method encodes an empty element.
- Parameters:
-
| elemName | A pointer to the element's name. |
| attributes | A pointer to attributes. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeEndElement |
( |
const char * |
elemName |
) |
|
|
|
|
This method encodes an end element tag.
- Parameters:
-
| elemName | A pointer to the element's name. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeInt |
( |
ASN1INT |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
This method encodes a variable of the ASN.1 INTEGER type.
- Parameters:
-
| val | A 32-bit INTEGER value to be encoded. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeInt64 |
( |
ASN1INT64 |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
This method encodes a 64-bit variable of the ASN.1 INTEGER type.
- Parameters:
-
| val | A 64-bit INTEGER value to be encoded. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeNull |
( |
const char * |
elemName |
) |
|
|
|
|
This method encodes a variable of the ASN.1 NULL type.
- Parameters:
-
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::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 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeObjId |
( |
const ASN1OBJID & |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeObjId64 |
( |
const ASN1OID64 & |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeOctStr |
( |
const ASN1DynOctStr & |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeOctStr |
( |
const ASN1OCTET * |
pocts, |
|
|
ASN1UINT |
numocts, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeReal |
( |
ASN1REAL |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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 rtGetPlusInfinity or rtGetMinusInfinity functions to get these special values.
- Parameters:
-
| val | An ASN1REAL data type. This is defined to be the C double type. Special real values plus and minus infinity are encoded by using the rtGetPlusInfinity and rtGetMinusInfinity functions to set the real value to be encoded. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeRelativeOID |
( |
const ASN1OBJID & |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeStartElement |
( |
const char * |
elemName, |
|
|
const char * |
attributes = 0 |
|
) |
|
|
|
|
This method encodes a start element tag.
- Parameters:
-
| elemName | A pointer to the element's name. |
| attributes | A pointer to attributes. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeUInt |
( |
ASN1UINT |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
This method encodes an unsigned variable of the ASN.1 INTEGER type.
- Parameters:
-
| val | An unsigned INTEGER value to be encoded. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeUInt64 |
( |
ASN1UINT64 |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
| int ASN1XEROutputStream::encodeUnivStr |
( |
const Asn132BitCharString & |
val, |
|
|
const char * |
elemName |
|
) |
|
|
|
|
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. |
| elemName | A pointer to the element's name. It can be NULL, no tag will be encoded in this case. |
- Returns:
- Completion status of operation:
- 0 (ASN_OK) = success,
- negative return value is error.
|
|
|
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.
|
The documentation for this class was generated from the following file:
|
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.
|
This file was last modified on
8 Sep 2005. ASN1C XER Runtime, ASN1C v5.8x |
|