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.

Synopsis

Declared in <balber_berdecoder.h>

class BerDecoder_Node;

Member Functions

Name

Description

BerDecoder_Node [constructor]

Constructors

~BerDecoder_Node [destructor]

Destroy this decoder node.

fieldName

Return field name for this node.

formattingMode

Return formatting mode for this node.

hasMore

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

length

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

logError

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()

Function call operators

parent

Return the address of the parent node.

print

Print the content of node to the specified stream out. depth is the value d_decoder‐>currentDepth assumed after node was created.

printStack

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

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

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

Load the node body content into the specified variable. Return 0 on success, and a non‐zero value otherwise.

readVectorUnsignedChar

Load the node body content into the specified variable. Return 0 on success, and a non‐zero value otherwise.

setFieldName

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

setFormattingMode

Set formatting mode specified by formattingMode.

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

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

tagClass

Return the BER tag class for this node.

tagNumber

Return the BER tag number for this node.

tagType

Return the BER tag type for this node.

Created with MrDocs