#include <balxml_encoder.h>
List of all members.
Detailed Description
This class
contains the parameterized encode
functions that encode bdlat
types in XML format.
See Component balxml_encoder
Constructor & Destructor Documentation
balxml::Encoder::Encoder |
( |
const EncoderOptions * |
options, |
|
|
bsl::ostream * |
errorStream = 0 , |
|
|
bsl::ostream * |
warningStream = 0 , |
|
|
bslma::Allocator * |
basicAllocator = 0 | |
|
) |
| | |
Construct a encoder object using the specified options
. Errors and warnings will be rendered to the optionally specified errorStream
and warningStream
respectively.
balxml::Encoder::~Encoder |
( |
|
) |
|
Destroy this object. This destruction has no effect on objects pointed-to by the pointers provided at construction.
Member Function Documentation
template<class TYPE >
int balxml::Encoder::encode |
( |
bsl::streambuf * |
buffer, |
|
|
const TYPE & |
object | |
|
) |
| | |
Encode the specified non-modifiable object
to the specified buffer
. Return 0 on success, and a non-zero value otherwise. Note that the encoder will use encoder options, error and warning streams specified at the construction time.
template<class TYPE >
int balxml::Encoder::encodeToStream |
( |
bsl::ostream & |
stream, |
|
|
const TYPE & |
object | |
|
) |
| | |
Encode the specified non-modifiable object
to the specified stream
. Return 0 on success, and a non-zero value otherwise. Note that the encoder will use encoder options, error and warning streams specified at the construction time.
template<class TYPE >
bsl::ostream& balxml::Encoder::encode |
( |
bsl::ostream & |
stream, |
|
|
const TYPE & |
object | |
|
) |
| | |
Encode the specified non-modifiable object
to the specified stream
. Return a reference to stream
. If an encoding error is detected, stream.fail()
will be true on return. Note that the encoder will use encoder options, error and warning streams specified at the construction time. IMPORTANT: The use of stream.fail()
to communicate errors to the caller has two consequences: 1) if stream
is the same as the errorStream
passed to the constructor, then the error message may be suppressed (because of the output/error stream becoming invalidated) and 2) it is important to call stream.clear()
after testing the stream state. To avoid these issues, we recommend that you use use encodeToStream
, above, instead of this version of encode
.
template<class TYPE >
int balxml::Encoder::encode |
( |
Formatter & |
formatter, |
|
|
const TYPE & |
object | |
|
) |
| | |
Encode the specified non-modifiable object
to the specified formatter
. Return 0 on success, and a non-zero value otherwise. Note that encoder will use encoder options, error and warning streams specified at the construction time.
Return the encoder options.
bool balxml::Encoder::isCompact |
( |
|
) |
const |
bsl::ostream* balxml::Encoder::errorStream |
( |
|
) |
const |
Return pointer to the error stream.
bsl::ostream* balxml::Encoder::warningStream |
( |
|
) |
const |
Return pointer to the warning stream.
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.
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.
Friends And Related Function Documentation
The documentation for this class was generated from the following file: