Quick Links:

bal | bbl | bdl | bsl

Public Member Functions | Friends

bslx::TestOutStream Class Reference

#include <bslx_testoutstream.h>

List of all members.

Public Member Functions

 TestOutStream (int versionSelector, bslma::Allocator *basicAllocator=0)
 TestOutStream (int versionSelector, bsl::size_t initialCapacity, bslma::Allocator *basicAllocator=0)
 ~TestOutStream ()
void invalidate ()
void makeNextInvalid ()
TestOutStreamputLength (int length)
TestOutStreamputVersion (int version)
void reserveCapacity (bsl::size_t newCapacity)
void reset ()
TestOutStreamputInt64 (bsls::Types::Int64 value)
TestOutStreamputUint64 (bsls::Types::Uint64 value)
TestOutStreamputInt56 (bsls::Types::Int64 value)
TestOutStreamputUint56 (bsls::Types::Uint64 value)
TestOutStreamputInt48 (bsls::Types::Int64 value)
TestOutStreamputUint48 (bsls::Types::Uint64 value)
TestOutStreamputInt40 (bsls::Types::Int64 value)
TestOutStreamputUint40 (bsls::Types::Uint64 value)
TestOutStreamputInt32 (int value)
TestOutStreamputUint32 (unsigned int value)
TestOutStreamputInt24 (int value)
TestOutStreamputUint24 (unsigned int value)
TestOutStreamputInt16 (int value)
TestOutStreamputUint16 (unsigned int value)
TestOutStreamputInt8 (int value)
TestOutStreamputUint8 (unsigned int value)
TestOutStreamputFloat64 (double value)
TestOutStreamputFloat32 (float value)
TestOutStreamputString (const bsl::string &value)
TestOutStreamputArrayInt64 (const bsls::Types::Int64 *values, int numValues)
TestOutStreamputArrayUint64 (const bsls::Types::Uint64 *values, int numValues)
TestOutStreamputArrayInt56 (const bsls::Types::Int64 *values, int numValues)
TestOutStreamputArrayUint56 (const bsls::Types::Uint64 *values, int numValues)
TestOutStreamputArrayInt48 (const bsls::Types::Int64 *values, int numValues)
TestOutStreamputArrayUint48 (const bsls::Types::Uint64 *values, int numValues)
TestOutStreamputArrayInt40 (const bsls::Types::Int64 *values, int numValues)
TestOutStreamputArrayUint40 (const bsls::Types::Uint64 *values, int numValues)
TestOutStreamputArrayInt32 (const int *values, int numValues)
TestOutStreamputArrayUint32 (const unsigned int *values, int numValues)
TestOutStreamputArrayInt24 (const int *values, int numValues)
TestOutStreamputArrayUint24 (const unsigned int *values, int numValues)
TestOutStreamputArrayInt16 (const short *values, int numValues)
TestOutStreamputArrayUint16 (const unsigned short *values, int numValues)
TestOutStreamputArrayInt8 (const char *values, int numValues)
TestOutStreamputArrayInt8 (const signed char *values, int numValues)
TestOutStreamputArrayUint8 (const char *values, int numValues)
TestOutStreamputArrayUint8 (const unsigned char *values, int numValues)
TestOutStreamputArrayFloat64 (const double *values, int numValues)
TestOutStreamputArrayFloat32 (const float *values, int numValues)
 operator const void * () const
int bdexVersionSelector () const
const char * data () const
bool isValid () const
bsl::size_t length () const

Friends

bsl::ostream & operator<< (bsl::ostream &, const TestOutStream &)

Detailed Description

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 Component bslx_testoutstream


Constructor & Destructor Documentation

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.

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.

bslx::TestOutStream::~TestOutStream (  ) 

Destroy this object.


Member Function Documentation

void bslx::TestOutStream::invalidate (  ) 

Put this output stream in an invalid state. This function has no effect if this stream is already invalid.

void bslx::TestOutStream::makeNextInvalid (  ) 

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.

TestOutStream& bslx::TestOutStream::putLength ( int  length  ) 

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.

TestOutStream& bslx::TestOutStream::putVersion ( int  version  ) 

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.

void bslx::TestOutStream::reserveCapacity ( bsl::size_t  newCapacity  ) 

Set the internal buffer size of this stream to be at least the specified newCapacity (in bytes).

void bslx::TestOutStream::reset (  ) 

Remove all content in this stream and validate this stream if it is currently invalid.

TestOutStream& bslx::TestOutStream::putInt64 ( bsls::Types::Int64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putUint64 ( bsls::Types::Uint64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putInt56 ( bsls::Types::Int64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putUint56 ( bsls::Types::Uint64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putInt48 ( bsls::Types::Int64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putUint48 ( bsls::Types::Uint64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putInt40 ( bsls::Types::Int64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putUint40 ( bsls::Types::Uint64  value  ) 

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.

TestOutStream& bslx::TestOutStream::putInt32 ( int  value  ) 

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.

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.

TestOutStream& bslx::TestOutStream::putInt24 ( int  value  ) 

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.

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.

TestOutStream& bslx::TestOutStream::putInt16 ( int  value  ) 

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.

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.

TestOutStream& bslx::TestOutStream::putInt8 ( int  value  ) 

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.

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.

TestOutStream& bslx::TestOutStream::putFloat64 ( double  value  ) 

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.

TestOutStream& bslx::TestOutStream::putFloat32 ( float  value  ) 

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.

TestOutStream& bslx::TestOutStream::putString ( const bsl::string value  ) 

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.

TestOutStream& bslx::TestOutStream::putArrayInt64 ( const bsls::Types::Int64 values,
int  numValues 
)

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.

TestOutStream& bslx::TestOutStream::putArrayUint64 ( const bsls::Types::Uint64 values,
int  numValues 
)

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.

TestOutStream& bslx::TestOutStream::putArrayInt56 ( const bsls::Types::Int64 values,
int  numValues 
)

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.

TestOutStream& bslx::TestOutStream::putArrayUint56 ( const bsls::Types::Uint64 values,
int  numValues 
)

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.

TestOutStream& bslx::TestOutStream::putArrayInt48 ( const bsls::Types::Int64 values,
int  numValues 
)

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.

TestOutStream& bslx::TestOutStream::putArrayUint48 ( const bsls::Types::Uint64 values,
int  numValues 
)

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.

TestOutStream& bslx::TestOutStream::putArrayInt40 ( const bsls::Types::Int64 values,
int  numValues 
)

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.

TestOutStream& bslx::TestOutStream::putArrayUint40 ( const bsls::Types::Uint64 values,
int  numValues 
)

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.

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.

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.

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.

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.

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.

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.

TestOutStream& bslx::TestOutStream::putArrayInt8 ( const char *  values,
int  numValues 
)
TestOutStream& bslx::TestOutStream::putArrayInt8 ( const signed 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.

TestOutStream& bslx::TestOutStream::putArrayUint8 ( const char *  values,
int  numValues 
)
TestOutStream& bslx::TestOutStream::putArrayUint8 ( const unsigned 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.

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.

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.

bslx::TestOutStream::operator const void * (  )  const

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.

int bslx::TestOutStream::bdexVersionSelector (  )  const

Return the versionSelector to be used with operator<< for BDEX streaming as per the bslx package-level documentation.

const char* bslx::TestOutStream::data (  )  const

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.

bool bslx::TestOutStream::isValid (  )  const

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.

bsl::size_t bslx::TestOutStream::length (  )  const

Return the number of bytes in this stream.


Friends And Related Function Documentation

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: