Quick Links:

bal | bbl | bdl | bsl

Classes | Public Types | Public Member Functions | Friends

balber::BerDecoder Class Reference

#include <balber_berdecoder.h>

List of all members.

Classes

class  MemOutStream

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


Member Enumeration Documentation

Enumerator:
e_BER_SUCCESS 
e_BER_ERROR 
BDEM_BER_SUCCESS 
BDEM_BER_ERROR 

Constructor & Destructor Documentation

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.

balber::BerDecoder::~BerDecoder (  ) 

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


Member Function Documentation

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.

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

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.

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

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.

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

Return the address of the BER decoder options.

bool balber::BerDecoder::maxDepthExceeded (  )  const

Return true if the maximum depth level is exceeded and false otherwise.

int balber::BerDecoder::numUnknownElementsSkipped (  )  const

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

ErrorSeverity balber::BerDecoder::errorSeverity (  )  const

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.

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

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.


Friends And Related Function Documentation

friend class BerDecoder_Node [friend]

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