#include <streamWriter.h>
Public Member Functions | |
StreamWriter (ostream &out) | |
StreamWriter (ostream *out) | |
StreamWriter (const StreamWriter ©) | |
void | operator= (const StreamWriter ©) |
~StreamWriter () | |
ostream * | get_ostream () const |
Returns the stream in use. | |
void | add_bool (bool value) |
Adds a boolean value to the stream. | |
void | add_int8 (PN_int8 value) |
Adds a signed 8-bit integer to the stream. | |
void | add_uint8 (PN_uint8 value) |
Adds an unsigned 8-bit integer to the stream. | |
void | add_int16 (PN_int16 value) |
Adds a signed 16-bit integer to the stream. | |
void | add_int32 (PN_int32 value) |
Adds a signed 32-bit integer to the stream. | |
void | add_int64 (PN_int64 value) |
Adds a signed 64-bit integer to the stream. | |
void | add_uint16 (PN_uint16 value) |
Adds an unsigned 16-bit integer to the stream. | |
void | add_uint32 (PN_uint32 value) |
Adds an unsigned 32-bit integer to the stream. | |
void | add_uint64 (PN_uint64 value) |
Adds an unsigned 64-bit integer to the stream. | |
void | add_float32 (float value) |
Adds a 32-bit single-precision floating-point number to the stream. | |
void | add_float64 (PN_float64 value) |
Adds a 64-bit floating-point number to the stream. | |
void | add_be_int16 (PN_int16 value) |
Adds a signed 16-bit big-endian integer to the streamWriter. | |
void | add_be_int32 (PN_int32 value) |
Adds a signed 32-bit big-endian integer to the streamWriter. | |
void | add_be_int64 (PN_int64 value) |
Adds a signed 64-bit big-endian integer to the streamWriter. | |
void | add_be_uint16 (PN_uint16 value) |
Adds an unsigned 16-bit big-endian integer to the streamWriter. | |
void | add_be_uint32 (PN_uint32 value) |
Adds an unsigned 32-bit big-endian integer to the streamWriter. | |
void | add_be_uint64 (PN_uint64 value) |
Adds an unsigned 64-bit big-endian integer to the streamWriter. | |
void | add_be_float32 (float value) |
Adds a 32-bit single-precision big-endian floating-point number to the stream. | |
void | add_be_float64 (PN_float64 value) |
Adds a 64-bit big-endian floating-point number to the streamWriter. | |
void | add_string (const string &str) |
Adds a variable-length string to the stream. | |
void | add_z_string (string str) |
Adds a variable-length string to the stream, as a NULL-terminated string. | |
void | add_fixed_string (const string &str, size_t size) |
Adds a fixed-length string to the stream. | |
void | pad_bytes (size_t size) |
Adds the indicated number of zero bytes to the stream. | |
void | append_data (const void *data, size_t size) |
Appends some more raw data to the end of the streamWriter. | |
void | append_data (const string &data) |
Appends some more raw data to the end of the streamWriter. | |
Private Attributes | |
ostream * | _out |
Its interface is very similar to Datagram by design; it's primarily intended as a convenience to eliminate the overhead of writing bytes to a Datagram and then writing the Datagram to a stream.
Definition at line 48 of file streamWriter.h.
|
Definition at line 32 of file streamWriter.I. References INLINE. |
|
Definition at line 46 of file streamWriter.I. References INLINE. |
|
Definition at line 59 of file streamWriter.I. References _out. |
|
Definition at line 84 of file streamWriter.I. References add_uint8(), and INLINE. |
|
Adds a 32-bit single-precision big-endian floating-point number to the stream. Since this kind of float is not necessarily portable across different architectures, special care is required. Definition at line 372 of file streamWriter.I. References _out. |
|
Adds a 64-bit big-endian floating-point number to the streamWriter.
Definition at line 392 of file streamWriter.I. |
|
Adds a signed 16-bit big-endian integer to the streamWriter.
Definition at line 272 of file streamWriter.I. References append_data(), ReversedNumericData::get_data(), and INLINE. |
|
Adds a signed 32-bit big-endian integer to the streamWriter.
Definition at line 288 of file streamWriter.I. References append_data(), ReversedNumericData::get_data(), and nassertv. |
|
Adds a signed 64-bit big-endian integer to the streamWriter.
Definition at line 304 of file streamWriter.I. References append_data(), and ReversedNumericData::get_data(). |
|
Adds an unsigned 16-bit big-endian integer to the streamWriter.
Definition at line 320 of file streamWriter.I. |
|
Adds an unsigned 32-bit big-endian integer to the streamWriter.
Definition at line 336 of file streamWriter.I. References size_t. |
|
Adds an unsigned 64-bit big-endian integer to the streamWriter.
Definition at line 352 of file streamWriter.I. References append_data(), INLINE, and pad_bytes(). |
|
Adds a boolean value to the stream.
Definition at line 109 of file streamWriter.I. |
|
Adds a fixed-length string to the stream. If the string given is less than the requested size, this will pad the string out with zeroes; if it is greater than the requested size, this will silently truncate the string. Definition at line 457 of file streamWriter.I. |
|
Adds a 32-bit single-precision floating-point number to the stream. Since this kind of float is not necessarily portable across different architectures, special care is required. Definition at line 238 of file streamWriter.I. References append_data(), and ReversedNumericData::get_data(). |
|
Adds a 64-bit floating-point number to the stream.
Definition at line 256 of file streamWriter.I. References append_data(), ReversedNumericData::get_data(), and INLINE. |
|
Adds a signed 16-bit integer to the stream.
Definition at line 148 of file streamWriter.I. References append_data(), NativeNumericData::get_data(), and INLINE. |
|
Adds a signed 32-bit integer to the stream.
Definition at line 162 of file streamWriter.I. References append_data(), and NativeNumericData::get_data(). |
|
Adds a signed 64-bit integer to the stream.
Definition at line 176 of file streamWriter.I. |
|
Adds a signed 8-bit integer to the stream.
Definition at line 122 of file streamWriter.I. References append_data(), NativeNumericData::get_data(), and INLINE. |
|
Adds a variable-length string to the stream. This actually adds a count followed by n bytes. Definition at line 408 of file streamWriter.I. |
|
Adds an unsigned 16-bit integer to the stream.
Definition at line 190 of file streamWriter.I. |
|
Adds an unsigned 32-bit integer to the stream.
Definition at line 204 of file streamWriter.I. |
|
Adds an unsigned 64-bit integer to the stream.
Definition at line 218 of file streamWriter.I. References append_data(), ReversedNumericData::get_data(), and INLINE. |
|
Adds an unsigned 8-bit integer to the stream.
Definition at line 135 of file streamWriter.I. References append_data(), NativeNumericData::get_data(), and INLINE. Referenced by ~StreamWriter(). |
|
Adds a variable-length string to the stream, as a NULL-terminated string.
Definition at line 430 of file streamWriter.I. |
|
Appends some more raw data to the end of the streamWriter.
Definition at line 493 of file streamWriter.I. |
|
Appends some more raw data to the end of the streamWriter.
Definition at line 478 of file streamWriter.I. Referenced by add_be_int16(), add_be_int32(), add_be_int64(), add_be_uint64(), add_float32(), add_float64(), add_int16(), add_int32(), add_int8(), add_uint64(), add_uint8(), and get_ostream(). |
|
Returns the stream in use.
Definition at line 96 of file streamWriter.I. References append_data(), and INLINE. |
|
Definition at line 72 of file streamWriter.I. |
|
Adds the indicated number of zero bytes to the stream.
Definition at line 35 of file streamWriter.cxx. Referenced by add_be_uint64(). |
|
Definition at line 92 of file streamWriter.h. Referenced by add_be_float32(), operator=(), and StreamWriter(). |