encode overloads
Synopses
Declared in <balxml_encoder.h>
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.
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>
std::ostream&
encode(
std::ostream& stream,
TYPE const& 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
encode(
std::streambuf* buffer,
TYPE const& object);
Created with MrDocs