BDE 4.14.0 Production release
|
#include <balber_berdecoder.h>
Public Member Functions | |
BerDecoder_Node (BerDecoder *decoder) | |
template<typename TYPE > | |
BerDecoder_Node (BerDecoder *decoder, const TYPE *variable) | |
~BerDecoder_Node () | |
template<typename TYPE > | |
int | operator() (TYPE *object, bslmf::Nil) |
template<typename TYPE , typename ANY_CATEGORY > | |
int | operator() (TYPE *object, ANY_CATEGORY category) |
template<typename TYPE > | |
int | operator() (TYPE *object) |
void | print (bsl::ostream &out, int depth, int spacePerLevel=0, const char *prefixText=0) const |
void | printStack (bsl::ostream &out) const |
void | setFormattingMode (int formattingMode) |
Set formatting mode specified by formattingMode . | |
void | setFieldName (const char *name) |
int | logError (const char *msg) |
int | readTagHeader () |
int | readTagTrailer () |
bool | hasMore () |
int | skipField () |
int | readVectorChar (bsl::vector< char > *variable) |
int | readVectorUnsignedChar (bsl::vector< unsigned char > *variable) |
BerDecoder_Node * | parent () const |
Return the address of the parent node. | |
BerConstants::TagClass | tagClass () const |
Return the BER tag class for this node. | |
BerConstants::TagType | tagType () const |
Return the BER tag type for this node. | |
int | tagNumber () const |
Return the BER tag number for this node. | |
int | formattingMode () const |
Return formatting mode for this node. | |
const char * | fieldName () const |
Return field name for this node. | |
int | length () const |
int | startPos () const |
Return the position of node tag from the beginning of input stream. | |
This class provides current context for BER decoding process and represents a node for BER element. The BER element consists of element tag, length field, body field and optional end of tag. The class also provides various methods to read the different parts of BER element such as tag header (tag itself and length fields), body for any type of data, and optional tag trailer.
|
inline |
balber::BerDecoder_Node::BerDecoder_Node | ( | BerDecoder * | decoder, |
const TYPE * | variable | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
Return true
if current node has more embedded elements and return false
otherwise.
|
inline |
int balber::BerDecoder_Node::logError | ( | const char * | msg | ) |
Set the node severity to e_BER_ERROR
, print the error message specified by msg
to the decoder's log, print the stack of nodes to the decoder's log, and return a non-zero value.
|
inline |
|
inline |
|
inline |
|
inline |
void balber::BerDecoder_Node::print | ( | bsl::ostream & | out, |
int | depth, | ||
int | spacePerLevel = 0 , |
||
const char * | prefixText = 0 |
||
) | const |
Print the content of node to the specified stream out
. depth
is the value d_decoder->currentDepth
assumed after node was created.
void balber::BerDecoder_Node::printStack | ( | bsl::ostream & | out | ) | const |
Print the chain of nodes to the specified out
stream, starting from this node and iterating to the parent node, then its parent, etc.
int balber::BerDecoder_Node::readTagHeader | ( | ) |
Read the node tag field containing tag class, tag type and tag number, and the node length field. Return zero on success, and a non-zero value otherwise.
int balber::BerDecoder_Node::readTagTrailer | ( | ) |
Read the node end-of-octets field, if such exists, so the stream will be positioned at the start of next node. Return zero on success and a non-zero value otherwise.
int balber::BerDecoder_Node::readVectorChar | ( | bsl::vector< char > * | variable | ) |
Load the node body content into the specified variable
. Return 0 on success, and a non-zero value otherwise.
int balber::BerDecoder_Node::readVectorUnsignedChar | ( | bsl::vector< unsigned char > * | variable | ) |
Load the node body content into the specified variable
. Return 0 on success, and a non-zero value otherwise.
|
inline |
Set object field name associated with this node to the specified name
.
|
inline |
int balber::BerDecoder_Node::skipField | ( | ) |
Skip the field body. The identifier octet and length have already been extracted. Return zero on success, and a non-zero value otherwise. Note that method must be called when input stream is positioned at the first byte of the body field.
int balber::BerDecoder_Node::startPos | ( | ) | const |
|
inline |
|
inline |
|
inline |