ASN1PERDecodeBuffer Class Reference
[PER Message Buffer Classes]
#include <asn1PerCppTypes.h>
Public Member Functions | |
ASN1PERDecodeBuffer (OSBOOL aligned) | |
ASN1PERDecodeBuffer (const OSOCTET *pMsgBuf, size_t msgBufLen, OSBOOL aligned) | |
ASN1PERDecodeBuffer (const OSOCTET *pMsgBuf, size_t msgBufLen, OSBOOL aligned, OSRTContext *pContext) | |
EXTPERMETHOD | ASN1PERDecodeBuffer (OSRTInputStream &istream, OSBOOL aligned) |
EXTPERMETHOD | ASN1PERDecodeBuffer (const char *filePath, OSBOOL aligned) |
int | byteAlign () |
virtual OSBOOL | isA (Type bufferType) |
EXTPERMETHOD int | peekByte (OSOCTET &ub) |
EXTPERMETHOD int | readBinaryFile (const char *filePath) |
EXTPERMETHOD int | readBytes (OSOCTET *buffer, size_t bufsize, size_t nbytes) |
Detailed Description
The ASN1PERDecodeBuffer class is derived from the ASN1PERMessageBuffer base class. It contains variables and methods specific to decoding ASN.1 PER messages. It is used to manage the input buffer containing the ASN.1 message to be decoded. This class has 3 overloaded constructors.
Constructor & Destructor Documentation
ASN1PERDecodeBuffer::ASN1PERDecodeBuffer | ( | OSBOOL | aligned | ) | [inline] |
This is a default constructor. Use getStatus() method to determine has error occured during the initialization or not.
- Parameters:
-
aligned Flag indicating if the message was encoded using aligned (TRUE)* or unaligned (FALSE) encoding.
ASN1PERDecodeBuffer::ASN1PERDecodeBuffer | ( | const OSOCTET * | pMsgBuf, | |
size_t | msgBufLen, | |||
OSBOOL | aligned | |||
) | [inline] |
This constructor is used to describe the message to be decoded. Use getStatus() method to determine has error occured during the initialization or not.
- Parameters:
-
pMsgBuf A pointer to the message to be decoded. msgBufLen Length of the message buffer. aligned Flag indicating if the message was encoded using aligned (TRUE) * or unaligned (FALSE) encoding.
ASN1PERDecodeBuffer::ASN1PERDecodeBuffer | ( | const OSOCTET * | pMsgBuf, | |
size_t | msgBufLen, | |||
OSBOOL | aligned, | |||
OSRTContext * | pContext | |||
) | [inline] |
This constructor is used to describe the message to be decoded. Use getStatus() method to determine has error occured during the initialization or not.
- Parameters:
-
pMsgBuf A pointer to the message to be decoded. msgBufLen Length of the message buffer. aligned Flag indicating if the message was encoded using aligned (TRUE) * or unaligned (FALSE) encoding. pContext A pointer to an OSRTContext structure created by the user.
EXTPERMETHOD ASN1PERDecodeBuffer::ASN1PERDecodeBuffer | ( | OSRTInputStream & | istream, | |
OSBOOL | aligned | |||
) |
This version of the ASN1PERDecodeBuffer constructor takes a reference to an input stream object and an aligned flag argument (stream decoding version).
- Parameters:
-
istream A reference to an input stream object. aligned Flag indicating if aligned (TRUE) or unaligned (FALSE) encoding should be done.
EXTPERMETHOD ASN1PERDecodeBuffer::ASN1PERDecodeBuffer | ( | const char * | filePath, | |
OSBOOL | aligned | |||
) |
This constructor takes a pointer to the path of a file containing a binary PER message to be decoded.
- Parameters:
-
filePath Complete file path and name of file to read. aligned Flag indicating if the message was encoded using aligned (TRUE) * or unaligned (FALSE) encoding.
Member Function Documentation
int ASN1PERDecodeBuffer::byteAlign | ( | ) | [inline] |
This method aligns the input buffer or stream to the next octet boundary.
- Returns:
- Status of operation: 0 = success, negative value if error occurred.
References pd_byte_align().
virtual OSBOOL ASN1PERDecodeBuffer::isA | ( | Type | bufferType | ) | [inline, virtual] |
This method checks the type of the message buffer.
- Parameters:
-
bufferType Enumerated identifier specifying a derived class. The only possible value for this class is PERDecode.
- Returns:
- Boolean result of the match operation. True if this is the class corresponding to the identifier argument.
EXTPERMETHOD int ASN1PERDecodeBuffer::peekByte | ( | OSOCTET & | ub | ) |
This method is used to peek at the next available byte in the decode buffer/stream without advancing the cursor.
- Parameters:
-
ub Single byte buffer to receive peeked byte.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
EXTPERMETHOD int ASN1PERDecodeBuffer::readBinaryFile | ( | const char * | filePath | ) |
This method reads the file into the buffer to decode.
- Parameters:
-
filePath The zero-terminated string containing the path to the file.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
EXTPERMETHOD int ASN1PERDecodeBuffer::readBytes | ( | OSOCTET * | buffer, | |
size_t | bufsize, | |||
size_t | nbytes | |||
) |
This method is used to read the given number of bytes from the underlying buffer/stream into the given buffer.
- Parameters:
-
buffer Buffer into which data should be read. bufsize Size of the buffer nbytes Number of bytes to read. Must be <= bufsize.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
The documentation for this class was generated from the following file: