BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balber::BerDecoder_Node Class Reference

#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_Nodeparent () 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.
 

Detailed Description

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.

See balber_berdecoder

Constructor & Destructor Documentation

◆ BerDecoder_Node() [1/2]

balber::BerDecoder_Node::BerDecoder_Node ( BerDecoder decoder)
inline

◆ BerDecoder_Node() [2/2]

template<typename TYPE >
balber::BerDecoder_Node::BerDecoder_Node ( BerDecoder decoder,
const TYPE *  variable 
)

◆ ~BerDecoder_Node()

balber::BerDecoder_Node::~BerDecoder_Node ( )
inline

Member Function Documentation

◆ fieldName()

const char * balber::BerDecoder_Node::fieldName ( ) const
inline

◆ formattingMode()

int balber::BerDecoder_Node::formattingMode ( ) const
inline

◆ hasMore()

bool balber::BerDecoder_Node::hasMore ( )
inline

Return true if current node has more embedded elements and return false otherwise.

◆ length()

int balber::BerDecoder_Node::length ( ) const
inline

◆ logError()

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.

◆ operator()() [1/3]

template<typename TYPE >
int balber::BerDecoder_Node::operator() ( TYPE *  object)
inline

◆ operator()() [2/3]

template<typename TYPE , typename ANY_CATEGORY >
int balber::BerDecoder_Node::operator() ( TYPE *  object,
ANY_CATEGORY  category 
)
inline

◆ operator()() [3/3]

template<typename TYPE >
int balber::BerDecoder_Node::operator() ( TYPE *  object,
bslmf::Nil   
)
inline

◆ parent()

BerDecoder_Node * balber::BerDecoder_Node::parent ( ) const
inline

◆ print()

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.

◆ printStack()

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.

◆ readTagHeader()

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.

◆ readTagTrailer()

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.

◆ readVectorChar()

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.

◆ readVectorUnsignedChar()

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.

◆ setFieldName()

void balber::BerDecoder_Node::setFieldName ( const char *  name)
inline

Set object field name associated with this node to the specified name.

◆ setFormattingMode()

void balber::BerDecoder_Node::setFormattingMode ( int  formattingMode)
inline

◆ skipField()

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.

◆ startPos()

int balber::BerDecoder_Node::startPos ( ) const

◆ tagClass()

BerConstants::TagClass balber::BerDecoder_Node::tagClass ( ) const
inline

◆ tagNumber()

int balber::BerDecoder_Node::tagNumber ( ) const
inline

◆ tagType()

BerConstants::TagType balber::BerDecoder_Node::tagType ( ) const
inline

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