#include <bslx_testoutstream.h>
|
| TestOutStream (int versionSelector, bslma::Allocator *basicAllocator=0) |
|
| TestOutStream (int versionSelector, bsl::size_t initialCapacity, bslma::Allocator *basicAllocator=0) |
|
| ~TestOutStream () |
| Destroy this object.
|
|
void | invalidate () |
|
void | makeNextInvalid () |
|
TestOutStream & | putLength (int length) |
|
TestOutStream & | putVersion (int version) |
|
void | reserveCapacity (bsl::size_t newCapacity) |
|
void | reset () |
|
TestOutStream & | putInt64 (bsls::Types::Int64 value) |
|
TestOutStream & | putUint64 (bsls::Types::Uint64 value) |
|
TestOutStream & | putInt56 (bsls::Types::Int64 value) |
|
TestOutStream & | putUint56 (bsls::Types::Uint64 value) |
|
TestOutStream & | putInt48 (bsls::Types::Int64 value) |
|
TestOutStream & | putUint48 (bsls::Types::Uint64 value) |
|
TestOutStream & | putInt40 (bsls::Types::Int64 value) |
|
TestOutStream & | putUint40 (bsls::Types::Uint64 value) |
|
TestOutStream & | putInt32 (int value) |
|
TestOutStream & | putUint32 (unsigned int value) |
|
TestOutStream & | putInt24 (int value) |
|
TestOutStream & | putUint24 (unsigned int value) |
|
TestOutStream & | putInt16 (int value) |
|
TestOutStream & | putUint16 (unsigned int value) |
|
TestOutStream & | putInt8 (int value) |
|
TestOutStream & | putUint8 (unsigned int value) |
|
TestOutStream & | putFloat64 (double value) |
|
TestOutStream & | putFloat32 (float value) |
|
TestOutStream & | putString (const bsl::string &value) |
|
TestOutStream & | putArrayInt64 (const bsls::Types::Int64 *values, int numValues) |
|
TestOutStream & | putArrayUint64 (const bsls::Types::Uint64 *values, int numValues) |
|
TestOutStream & | putArrayInt56 (const bsls::Types::Int64 *values, int numValues) |
|
TestOutStream & | putArrayUint56 (const bsls::Types::Uint64 *values, int numValues) |
|
TestOutStream & | putArrayInt48 (const bsls::Types::Int64 *values, int numValues) |
|
TestOutStream & | putArrayUint48 (const bsls::Types::Uint64 *values, int numValues) |
|
TestOutStream & | putArrayInt40 (const bsls::Types::Int64 *values, int numValues) |
|
TestOutStream & | putArrayUint40 (const bsls::Types::Uint64 *values, int numValues) |
|
TestOutStream & | putArrayInt32 (const int *values, int numValues) |
|
TestOutStream & | putArrayUint32 (const unsigned int *values, int numValues) |
|
TestOutStream & | putArrayInt24 (const int *values, int numValues) |
|
TestOutStream & | putArrayUint24 (const unsigned int *values, int numValues) |
|
TestOutStream & | putArrayInt16 (const short *values, int numValues) |
|
TestOutStream & | putArrayUint16 (const unsigned short *values, int numValues) |
|
TestOutStream & | putArrayInt8 (const char *values, int numValues) |
|
TestOutStream & | putArrayInt8 (const signed char *values, int numValues) |
|
TestOutStream & | putArrayUint8 (const char *values, int numValues) |
|
TestOutStream & | putArrayUint8 (const unsigned char *values, int numValues) |
|
TestOutStream & | putArrayFloat64 (const double *values, int numValues) |
|
TestOutStream & | putArrayFloat32 (const float *values, int numValues) |
|
| operator const void * () const |
|
int | bdexVersionSelector () const |
|
const char * | data () const |
|
bool | isValid () const |
|
bsl::size_t | length () const |
| Return the number of bytes in this stream.
|
|
This class implements output methods to externalize fundamental types and their associated type identification data. It stores the accumulated result in network byte order. See the bslx
package-level documentation for the definition of the BDEX OutStream
protocol.
See bslx_testoutstream
◆ TestOutStream() [1/2]
bslx::TestOutStream::TestOutStream |
( |
int |
versionSelector, |
|
|
bslma::Allocator * |
basicAllocator = 0 |
|
) |
| |
|
explicit |
Create an empty output byte stream that will use the specified (compile-time-defined) versionSelector
as needed (see {Versioning}). Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used. Note that the versionSelector
is expected to be formatted as "YYYYMMDD", a date representation.
◆ TestOutStream() [2/2]
bslx::TestOutStream::TestOutStream |
( |
int |
versionSelector, |
|
|
bsl::size_t |
initialCapacity, |
|
|
bslma::Allocator * |
basicAllocator = 0 |
|
) |
| |
Create an empty output byte stream having an initial buffer capacity of at least the specified initialCapacity
(in bytes) and that will use the specified (compile-time-defined) versionSelector
as needed (see {Versioning}). Optionally specify a basicAllocator
used to supply memory. If basicAllocator
is 0, the currently installed default allocator is used. Note that the versionSelector
is expected to be formatted as "YYYYMMDD", a date representation.
◆ ~TestOutStream()
bslx::TestOutStream::~TestOutStream |
( |
| ) |
|
◆ bdexVersionSelector()
int bslx::TestOutStream::bdexVersionSelector |
( |
| ) |
const |
|
inline |
Return the versionSelector
to be used with operator<<
for BDEX streaming as per the bslx
package-level documentation.
◆ data()
const char * bslx::TestOutStream::data |
( |
| ) |
const |
|
inline |
Return the address of the contiguous, non-modifiable internal memory buffer of this stream. The address will remain valid as long as this array is not destroyed or modified (i.e., the current capacity is not exceeded). The behavior of accessing elements outside the range [ data() .. data() + (length() - 1) ]
is undefined.
◆ invalidate()
void bslx::TestOutStream::invalidate |
( |
| ) |
|
|
inline |
Put this output stream in an invalid state. This function has no effect if this stream is already invalid.
◆ isValid()
bool bslx::TestOutStream::isValid |
( |
| ) |
const |
|
inline |
Return true
if this stream is valid, and false
otherwise. An invalid stream is a stream for which an output operation was detected to have failed or invalidate
was called.
◆ length()
bsl::size_t bslx::TestOutStream::length |
( |
| ) |
const |
|
inline |
◆ makeNextInvalid()
void bslx::TestOutStream::makeNextInvalid |
( |
| ) |
|
|
inline |
Make the next output operation externalize the invalid data indicator, as opposed to the actual type indicator, to this output stream; the data associated with the next output operation is still externalized. Note that the invalid data indicator can be detected by a corresponding TestInStream
object.
◆ operator const void *()
bslx::TestOutStream::operator const void * |
( |
| ) |
const |
|
inline |
Return a non-zero value if this stream is valid, and 0 otherwise. An invalid stream is a stream for which an output operation was detected to have failed or invalidate
was called.
◆ putArrayFloat32()
TestOutStream & bslx::TestOutStream::putArrayFloat32 |
( |
const float * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a four-byte single-precision floating-point number, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive four-byte IEEE single-precision floating-point numbers (in network byte order) comprised of the most-significant four bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents. Note that for non-conforming platforms, this operation may be lossy.
◆ putArrayFloat64()
TestOutStream & bslx::TestOutStream::putArrayFloat64 |
( |
const double * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for an eight-byte double-precision floating-point number, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive eight-byte IEEE double-precision floating-point numbers (in network byte order) comprised of the most-significant eight bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents. Note that for non-conforming platforms, this operation may be lossy.
◆ putArrayInt16()
TestOutStream & bslx::TestOutStream::putArrayInt16 |
( |
const short * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a two-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive two-byte, two's complement integers (in network byte order) comprised of the least-significant two bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt24()
TestOutStream & bslx::TestOutStream::putArrayInt24 |
( |
const int * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a three-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive three-byte, two's complement integers (in network byte order) comprised of the least-significant three bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt32()
TestOutStream & bslx::TestOutStream::putArrayInt32 |
( |
const int * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a four-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive four-byte, two's complement integers (in network byte order) comprised of the least-significant four bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt40()
Write to this stream the one-byte type indicator for a five-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive five-byte, two's complement integers (in network byte order) comprised of the least-significant five bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt48()
Write to this stream the one-byte type indicator for a six-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive six-byte, two's complement integers (in network byte order) comprised of the least-significant six bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt56()
Write to this stream the one-byte type indicator for a seven-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive seven-byte, two's complement integers (in network byte order) comprised of the least-significant seven bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt64()
Write to this stream the one-byte type indicator for an eight-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive eight-byte, two's complement integers (in network byte order) comprised of the least-significant eight bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt8() [1/2]
TestOutStream & bslx::TestOutStream::putArrayInt8 |
( |
const char * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a one-byte integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive one-byte, two's complement integers comprised of the least-significant one byte of each of the numValues
leading entries in the specified values
, and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayInt8() [2/2]
TestOutStream & bslx::TestOutStream::putArrayInt8 |
( |
const signed char * |
values, |
|
|
int |
numValues |
|
) |
| |
◆ putArrayUint16()
TestOutStream & bslx::TestOutStream::putArrayUint16 |
( |
const unsigned short * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a two-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive two-byte, two's complement unsigned integers (in network byte order) comprised of the least-significant two bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint24()
TestOutStream & bslx::TestOutStream::putArrayUint24 |
( |
const unsigned int * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a three-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive three-byte, two's complement unsigned integers (in network byte order) comprised of the least-significant three bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint32()
TestOutStream & bslx::TestOutStream::putArrayUint32 |
( |
const unsigned int * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a four-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive four-byte, two's complement unsigned integers (in network byte order) comprised of the least-significant four bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint40()
Write to this stream the one-byte type indicator for a five-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive five-byte, two's complement unsigned integers (in network byte order) comprised of the least-significant five bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint48()
Write to this stream the one-byte type indicator for a six-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive six-byte, two's complement unsigned integers (in network byte order) comprised of the least-significant six bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint56()
Write to this stream the one-byte type indicator for a seven-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive seven-byte, two's complement unsigned integers (in network byte order) comprised of the least-significant seven bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint64()
Write to this stream the one-byte type indicator for an eight-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive eight-byte, two's complement unsigned integers (in network byte order) comprised of the least-significant eight bytes of each of the numValues
leading entries in the specified values
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint8() [1/2]
TestOutStream & bslx::TestOutStream::putArrayUint8 |
( |
const char * |
values, |
|
|
int |
numValues |
|
) |
| |
Write to this stream the one-byte type indicator for a one-byte unsigned integer, the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified numValues
(in host byte order), and the consecutive one-byte, two's complement unsigned integers comprised of the least-significant one byte of each of the numValues
leading entries in the specified values
, and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= numValues
and values
has sufficient contents.
◆ putArrayUint8() [2/2]
TestOutStream & bslx::TestOutStream::putArrayUint8 |
( |
const unsigned char * |
values, |
|
|
int |
numValues |
|
) |
| |
◆ putFloat32()
Write to this stream the one-byte type indicator for a four-byte single-precision floating-point number and the four-byte IEEE single-precision floating-point number (in network byte order) comprised of the most-significant four bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. Note that for non-conforming platforms, this operation may be lossy.
◆ putFloat64()
Write to this stream the one-byte type indicator for an eight-byte double-precision floating-point number and the eight-byte IEEE double-precision floating-point number (in network byte order) comprised of the most-significant eight bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. Note that for non-conforming platforms, this operation may be lossy.
◆ putInt16()
Write to this stream the one-byte type indicator for a two-byte integer and the two-byte, two's complement integer (in network byte order) comprised of the least-significant two bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putInt24()
Write to this stream the one-byte type indicator for a three-byte integer and the three-byte, two's complement integer (in network byte order) comprised of the least-significant three bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putInt32()
Write to this stream the one-byte type indicator for a four-byte integer and the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putInt40()
Write to this stream the one-byte type indicator for a five-byte integer and the five-byte, two's complement integer (in network byte order) comprised of the least-significant five bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putInt48()
Write to this stream the one-byte type indicator for a six-byte integer and the six-byte, two's complement integer (in network byte order) comprised of the least-significant six bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putInt56()
Write to this stream the one-byte type indicator for a seven-byte integer and the seven-byte, two's complement integer (in network byte order) comprised of the least-significant seven bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putInt64()
Write to this stream the one-byte type indicator for an eight-byte integer and the eight-byte, two's complement integer (in network byte order) comprised of the least-significant eight bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putInt8()
Write to this stream the one-byte type indicator for a one-byte integer and the one-byte, two's complement integer comprised of the least-significant one byte of the specified value
, and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putLength()
If the specified length
is less than 128, write to this stream the one-byte type indicator for a one-byte integer and the one-byte integer comprised of the least-significant one byte of the length
; otherwise, write to this stream the one-byte type indicator for a four-byte integer and the four-byte, two's complement integer (in network byte order) comprised of the least-significant four bytes of the length
(in host byte order) with the most-significant bit set. Return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless 0 <= length
.
◆ putString()
Write to this stream the one-byte type indicator for a length (see putLength
), the length of the specified value
(see putLength
), the one-byte type indicator for an array of one-byte unsigned integers, and an array of one-byte, two's complement unsigned integers comprised of the least-significant one byte of each character in the value
, and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint16()
TestOutStream & bslx::TestOutStream::putUint16 |
( |
unsigned int |
value | ) |
|
Write to this stream the one-byte type indicator for a two-byte unsigned integer and the two-byte, two's complement unsigned integer (in network byte order) comprised of the least-significant two bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint24()
TestOutStream & bslx::TestOutStream::putUint24 |
( |
unsigned int |
value | ) |
|
Write to this stream the one-byte type indicator for a three-byte unsigned integer and the three-byte, two's complement unsigned integer (in network byte order) comprised of the least-significant three bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint32()
TestOutStream & bslx::TestOutStream::putUint32 |
( |
unsigned int |
value | ) |
|
Write to this stream the one-byte type indicator for a four-byte unsigned integer and the four-byte, two's complement unsigned integer (in network byte order) comprised of the least-significant four bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint40()
Write to this stream the one-byte type indicator for a five-byte unsigned integer and the five-byte, two's complement unsigned integer (in network byte order) comprised of the least-significant five bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint48()
Write to this stream the one-byte type indicator for a six-byte unsigned integer and the six-byte, two's complement unsigned integer (in network byte order) comprised of the least-significant six bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint56()
Write to this stream the one-byte type indicator for a seven-byte unsigned integer and the seven-byte, two's complement unsigned integer (in network byte order) comprised of the least-significant seven bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint64()
Write to this stream the one-byte type indicator for an eight-byte unsigned integer and the eight-byte, two's complement unsigned integer (in network byte order) comprised of the least-significant eight bytes of the specified value
(in host byte order), and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putUint8()
TestOutStream & bslx::TestOutStream::putUint8 |
( |
unsigned int |
value | ) |
|
Write to this stream the one-byte type indicator for a one-byte unsigned integer and the one-byte, two's complement unsigned integer comprised of the least-significant one byte of the specified value
, and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ putVersion()
Write to this stream the one-byte type indicator for a one-byte unsigned integer and the one-byte, two's complement unsigned integer comprised of the least-significant one byte of the specified version
, and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If the next output operation has been set to be marked invalid (see makeNextInvalid
), reset this marking and emit the invalid indicator instead of the type indicator.
◆ reserveCapacity()
void bslx::TestOutStream::reserveCapacity |
( |
bsl::size_t |
newCapacity | ) |
|
|
inline |
Set the internal buffer size of this stream to be at least the specified newCapacity
(in bytes).
◆ reset()
void bslx::TestOutStream::reset |
( |
| ) |
|
|
inline |
Remove all content in this stream and validate this stream if it is currently invalid.
◆ operator<<
bsl::ostream & operator<< |
( |
bsl::ostream & |
, |
|
|
const TestOutStream & |
|
|
) |
| |
|
friend |
Write the specified object
to the specified output stream
in some reasonable (multi-line) format, and return a reference to stream
.
The documentation for this class was generated from the following file: