Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

balber::BerDecoder_Node Class Reference

#include <balber_berdecoder.h>

List of all members.

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)
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
BerConstants::TagClass tagClass () const
BerConstants::TagType tagType () const
int tagNumber () const
int formattingMode () const
const char * fieldName () const
int length () const
int startPos () const

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 Component balber_berdecoder


Constructor & Destructor Documentation

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

Member Function Documentation

template<typename TYPE >
int balber::BerDecoder_Node::operator() ( TYPE *  object,
bslmf::Nil   
)
template<typename TYPE , typename ANY_CATEGORY >
int balber::BerDecoder_Node::operator() ( TYPE *  object,
ANY_CATEGORY  category 
)
template<typename TYPE >
int balber::BerDecoder_Node::operator() ( TYPE *  object  ) 
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.

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

Set formatting mode specified by formattingMode.

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

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

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.

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.

bool balber::BerDecoder_Node::hasMore (  ) 

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

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::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.

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

Return the address of the parent node.

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

Return the BER tag class for this node.

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

Return the BER tag type for this node.

int balber::BerDecoder_Node::tagNumber (  )  const

Return the BER tag number for this node.

int balber::BerDecoder_Node::formattingMode (  )  const

Return formatting mode for this node.

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

Return field name for this node.

int balber::BerDecoder_Node::length (  )  const

Return expected length of the body or -1 when the length is indefinite.

int balber::BerDecoder_Node::startPos (  )  const

Return the position of node tag from the beginning of input stream.


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