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

#include <balber_berdecoder.h>

Public Types

enum  ErrorSeverity { e_BER_SUCCESS = 0x00 , e_BER_ERROR = 0x02 , BDEM_BER_SUCCESS = e_BER_SUCCESS , BDEM_BER_ERROR = e_BER_ERROR }
 

Public Member Functions

 BerDecoder (const BerDecoderOptions *options=0, bslma::Allocator *basicAllocator=0)
 
 ~BerDecoder ()
 
template<typename TYPE >
int decode (bsl::streambuf *streamBuf, TYPE *variable)
 
template<typename TYPE >
int decode (bsl::istream &stream, TYPE *variable)
 
void setNumUnknownElementsSkipped (int value)
 
const BerDecoderOptionsdecoderOptions () const
 Return the address of the BER decoder options.
 
bool maxDepthExceeded () const
 
int numUnknownElementsSkipped () const
 
ErrorSeverity errorSeverity () const
 
bslstl::StringRef loggedMessages () const
 

Friends

class BerDecoder_Node
 

Detailed Description

This class contains the parameterized decode functions that decode data (in BER format) from an incoming stream into bdlat types.

See balber_berdecoder

Member Enumeration Documentation

◆ ErrorSeverity

Enumerator
e_BER_SUCCESS 
e_BER_ERROR 
BDEM_BER_SUCCESS 
BDEM_BER_ERROR 

Constructor & Destructor Documentation

◆ BerDecoder()

balber::BerDecoder::BerDecoder ( const BerDecoderOptions options = 0,
bslma::Allocator basicAllocator = 0 
)

Construct a decoder object. Optionally specify decoder options. If options is 0, BerDecoderOptions() is used. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~BerDecoder()

balber::BerDecoder::~BerDecoder ( )

Destroy this object. This destruction has no effect on objects pointed-to by the pointers provided at construction.

Member Function Documentation

◆ decode() [1/2]

template<typename TYPE >
int balber::BerDecoder::decode ( bsl::istream &  stream,
TYPE *  variable 
)
inline

Decode an object of parameterized TYPE from the specified stream and load the result into the specified modifiable variable. Return 0 on success, and a non-zero value otherwise. If the decoding fails stream will be invalidated.

◆ decode() [2/2]

template<typename TYPE >
int balber::BerDecoder::decode ( bsl::streambuf *  streamBuf,
TYPE *  variable 
)

Decode an object of parameterized TYPE from the specified streamBuf and load the result into the specified variable. Return 0 on success, and a non-zero value otherwise.

◆ decoderOptions()

const BerDecoderOptions * balber::BerDecoder::decoderOptions ( ) const
inline

◆ errorSeverity()

BerDecoder::ErrorSeverity balber::BerDecoder::errorSeverity ( ) const
inline

Return the severity of the most severe log or error message encountered during the last call to the decode method. The severity is reset each time decode is called.

◆ loggedMessages()

bslstl::StringRef balber::BerDecoder::loggedMessages ( ) const
inline

Return a string containing any error or trace messages that were logged during the last call to the decode method. The log is reset each time decode is called.

◆ maxDepthExceeded()

bool balber::BerDecoder::maxDepthExceeded ( ) const
inline

◆ numUnknownElementsSkipped()

int balber::BerDecoder::numUnknownElementsSkipped ( ) const
inline

Return the number of unknown elements that were skipped during the previous decoding operation. Note that unknown elements are skipped only if true == options()->skipUnknownElements().

◆ setNumUnknownElementsSkipped()

void balber::BerDecoder::setNumUnknownElementsSkipped ( int  value)
inline

Set the number of unknown elements skipped by the decoder during the current decoding operation to the specified value. The behavior is undefined unless 0 <= value.

Friends And Related Symbol Documentation

◆ BerDecoder_Node

friend class BerDecoder_Node
friend

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