BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balber::BerEncoder Class Reference

#include <balber_berencoder.h>

Detailed Description

This class contains the parameterized encode functions that encode bdlat types to an outgoing stream in BER format.

See balber_berencoder

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

 BerEncoder (const BerEncoderOptions *options=0, bslma::Allocator *basicAllocator=0)
 
 ~BerEncoder ()
 
template<typename TYPE >
int encode (bsl::streambuf *streamBuf, const TYPE &value)
 
template<typename TYPE >
int encode (bsl::ostream &stream, const TYPE &value)
 
template<typename TYPE >
int encodeAny (bsl::streambuf *streamBuf, const TYPE &value)
 
int encodeAny (bsl::streambuf *streamBuf, const bdlar::AnyConstRef &any)
 
template<typename TYPE >
int encodeAny (bsl::ostream &stream, const TYPE &value)
 
int encodeAny (bsl::ostream &stream, const bdlar::AnyConstRef &any)
 
const BerEncoderOptionsoptions () const
 
ErrorSeverity errorSeverity () const
 
bslstl::StringRef loggedMessages () const
 

Friends

struct BerEncoder_encodeProxy
 
class BerEncoder_Visitor
 
class BerEncoder_UniversalElementVisitor
 
class BerEncoder_LevelGuard
 
class BerEncoder_UseArrayLengthHintGuard
 

Member Enumeration Documentation

◆ ErrorSeverity

Enumerator
e_BER_SUCCESS 
e_BER_ERROR 
BDEM_BER_SUCCESS 
BDEM_BER_ERROR 

Constructor & Destructor Documentation

◆ BerEncoder()

balber::BerEncoder::BerEncoder ( const BerEncoderOptions options = 0,
bslma::Allocator basicAllocator = 0 
)

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

◆ ~BerEncoder()

balber::BerEncoder::~BerEncoder ( )

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

Member Function Documentation

◆ encode() [1/2]

template<typename TYPE >
int balber::BerEncoder::encode ( bsl::ostream &  stream,
const TYPE &  value 
)

Encode the specified non-modifiable value to the specified stream. Return 0 on success, and a non-zero value otherwise. If the encoding fails stream will be invalidated.

◆ encode() [2/2]

template<typename TYPE >
int balber::BerEncoder::encode ( bsl::streambuf *  streamBuf,
const TYPE &  value 
)

Encode the specified non-modifiable value to the specified streamBuf. Return 0 on success, and a non-zero value otherwise.

◆ encodeAny() [1/4]

int balber::BerEncoder::encodeAny ( bsl::ostream &  stream,
const bdlar::AnyConstRef any 
)

◆ encodeAny() [2/4]

template<typename TYPE >
int balber::BerEncoder::encodeAny ( bsl::ostream &  stream,
const TYPE &  value 
)
inline

Encode the specified non-modifiable value to the specified stream. Return 0 on success, and a non-zero value otherwise. If the encoding fails stream will be invalidated.

Note
Note that this function behaves identically to encode, but does not instantiate any templates at compile time at the expense of being slightly slower at runtime; see the balber package documentation for more details.

◆ encodeAny() [3/4]

int balber::BerEncoder::encodeAny ( bsl::streambuf *  streamBuf,
const bdlar::AnyConstRef any 
)

◆ encodeAny() [4/4]

template<typename TYPE >
int balber::BerEncoder::encodeAny ( bsl::streambuf *  streamBuf,
const TYPE &  value 
)
inline

Encode the specified non-modifiable value to the specified streamBuf. Return 0 on success, and a non-zero value otherwise.

Note
Note that this function behaves identically to encode, but does not instantiate any templates at compile time at the expense of being slightly slower at runtime; see the balber package documentation for more details.

◆ errorSeverity()

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

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

◆ loggedMessages()

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

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

◆ options()

const BerEncoderOptions * balber::BerEncoder::options ( ) const
inline

Return address of the options.

Friends And Related Symbol Documentation

◆ BerEncoder_encodeProxy

friend struct BerEncoder_encodeProxy
friend

◆ BerEncoder_LevelGuard

friend class BerEncoder_LevelGuard
friend

◆ BerEncoder_UniversalElementVisitor

◆ BerEncoder_UseArrayLengthHintGuard

◆ BerEncoder_Visitor

friend class BerEncoder_Visitor
friend

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