Open-RJ C/C++ User's Journal Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

Stream insertion shim function templates


Stream insertion shims

These functions are stream insertion shims for allowing the ORJStringA, ORJRC and ORJ_PARSE_ERROR types to be used with stream instances, a la the IOStreams.

For example:


 ORJRecord *record = . . . ;

 std::cout << record->fields[0] << std::end; // Prints the value of the 0th field in the record

 ORJRC rc = ORJ_RC_INVALIDINDEX;

 std::cout << rc << std::end; // Prints "An invalid index was specified"

 ORJ_PARSE_ERROR pe = ORJ_PARSE_UNFINISHEDLINE;

 std::cout << pe << std::end; // Prints "The last line in the database was not terminated by a line-feed"

 


template<class S>
S & openrj::operator<< (S &stm, ORJStringA const &s)
 Inserts an ORJStringA instance into a stream.
template<class S>
S & openrj::operator<< (S &stm, ORJRC rc)
 Inserts an ORJRC instance into a stream.
template<class S>
S & openrj::operator<< (S &stm, ORJ_PARSE_ERROR pe)
 Inserts an ORJ_PARSE_ERROR instance into a stream.

Functions

template<class S>
S & openrj::cpp::operator<< (S &s, Field const &field)
 Stream insertion shim for a Field instance.
template<class S>
S & openrj::stl::operator<< (S &s, field const &field)
 Stream insertion shim for a field instance.


Function Documentation

S& openrj::stl::operator<< ( S &  s,
field const &  field 
) [inline]

Stream insertion shim for a field instance.

S& openrj::cpp::operator<< ( S &  s,
Field const &  field 
) [inline]

Stream insertion shim for a Field instance.

S& openrj::operator<< ( S &  stm,
ORJ_PARSE_ERROR  pe 
) [inline]

Inserts an ORJ_PARSE_ERROR instance into a stream.

Note:
stm may be of any type that supports an insertion operator taking char const*

S& openrj::operator<< ( S &  stm,
ORJRC  rc 
) [inline]

Inserts an ORJRC instance into a stream.

Note:
stm may be of any type that supports an insertion operator taking char const*

S& openrj::operator<< ( S &  stm,
ORJStringA const &  s 
) [inline]

Inserts an ORJStringA instance into a stream.

Note:
stm may be of any type that supports a write(char const *str, size_t len); method


Open-RJ Library documentation © Synesis Software Pty Ltd, 2004-2005