SourcePro® 2024.1 |
SourcePro® API Reference Guide |
Specializes the abstract base class RWvostream to store variables in a portable (printable) US-ASCII format. More...
#include <rw/pstream.h>
Public Member Functions | |
RWpostream (std::ostream &str) | |
RWpostream (std::streambuf *sb) | |
virtual | ~RWpostream () |
virtual int | bad () |
virtual void | clear (int v=0) |
virtual int | eof () |
virtual int | fail () |
virtual RWvostream & | flush () |
virtual int | good () |
int | precision () const |
int | precision (int p) |
virtual RWvostream & | put (bool b) |
virtual RWvostream & | put (char c) |
virtual RWvostream & | put (const bool *v, size_t n) |
virtual RWvostream & | put (const char *v, size_t n) |
virtual RWvostream & | put (const double *v, size_t n) |
virtual RWvostream & | put (const float *v, size_t n) |
virtual RWvostream & | put (const int *v, size_t n) |
virtual RWvostream & | put (const long *v, size_t n) |
virtual RWvostream & | put (const long double *v, size_t n) |
virtual RWvostream & | put (const long long *v, size_t n) |
virtual RWvostream & | put (const short *v, size_t n) |
virtual RWvostream & | put (const signed char *v, size_t n) |
virtual RWvostream & | put (const unsigned char *v, size_t n) |
virtual RWvostream & | put (const unsigned int *v, size_t n) |
virtual RWvostream & | put (const unsigned long *v, size_t n) |
virtual RWvostream & | put (const unsigned long long *v, size_t n) |
virtual RWvostream & | put (const unsigned short *v, size_t n) |
virtual RWvostream & | put (const wchar_t *v, size_t n) |
virtual RWvostream & | put (double d) |
virtual RWvostream & | put (float f) |
virtual RWvostream & | put (int i) |
virtual RWvostream & | put (long double d) |
virtual RWvostream & | put (long i) |
virtual RWvostream & | put (long long i) |
virtual RWvostream & | put (short i) |
virtual RWvostream & | put (signed char c) |
virtual RWvostream & | put (unsigned char c) |
virtual RWvostream & | put (unsigned int i) |
virtual RWvostream & | put (unsigned long i) |
virtual RWvostream & | put (unsigned long long i) |
virtual RWvostream & | put (unsigned short i) |
virtual RWvostream & | put (wchar_t wc) |
virtual RWvostream & | putChar (char c) |
virtual RWvostream & | putChar (signed char c) |
virtual RWvostream & | putChar (unsigned char c) |
virtual RWvostream & | putChar (wchar_t wc) |
virtual RWvostream & | putChars (const char *s, size_t n) |
virtual RWvostream & | putSizeT (size_t sz) |
virtual RWvostream & | putString (const char *s, size_t n) |
virtual int | rdstate () |
std::ostream & | std () |
const std::ostream & | std () const |
Public Member Functions inherited from RWvostream | |
virtual | ~RWvostream () |
unsigned | version () const |
void | version (unsigned v) |
Public Member Functions inherited from RWvios | |
operator void * () | |
Class RWpostream specializes the abstract base class RWvostream to store variables in a portable (printable) US-ASCII format. The results can be restored by using its counterpart RWpistream.
You can think of RWpistream and RWpostream as a US-ASCII veneer over an associated std::streambuf. They are responsible for formatting variables and escaping characters such that the results can be interchanged between any machines. As such, they are slower than their binary counterparts RWbistream and RWbostream, which are more machine dependent. Because RWpistream and RWpostream retain no information about the state of their associated std::streambuf, their use can be freely exchanged with other users of the std::streambuf (such as std::istream or std::ifstream).
The goal of class RWpostream and RWpistream is to store variables using nothing but printable US-ASCII characters. Hence, nonprintable characters must be converted into an external representation where they can be recognized. Furthermore, other characters may be merely bit values (a bit image, for example), having nothing to do with characters as symbols. For example,
The expression pstr << c
treats c
as a symbol for a newline, an unprintable character. The expression pstr.put(c)
treats c
as the literal number "10".
RWpostream can be interrogated as to the stream state using member functions good(), bad(), eof(), precision(), and so forth.
RWpostream::RWpostream | ( | std::ostream & | str | ) |
Initializes an RWpostream from the std::streambuf associated with the std::ostream str.
RWpostream::RWpostream | ( | std::streambuf * | sb | ) |
Initializes an RWpostream from the std::streambuf sb.
|
virtual |
Empty Destructor.
|
inlinevirtual |
Returns a nonzero integer if the bad bit has been set. Normally this indicates that a severe error has occurred from which recovery is probably impossible.
Implements RWvostream.
|
inlinevirtual |
Sets the current error state to v. If v is zero, then this clears the error state.
Implements RWvostream.
|
inlinevirtual |
Returns a nonzero integer if an EOF
is encountered.
Implements RWvostream.
|
inlinevirtual |
Returns a nonzero integer if the failed or bad bit has been set. Normally, this indicates that some storage or retrieval has failed, but that the stream is still in a usable state.
Implements RWvostream.
|
virtual |
Sends the contents of the stream buffer to output immediately.
Implements RWvostream.
|
inlinevirtual |
Returns a nonzero integer if no error bits have been set.
Implements RWvostream.
|
inline |
Returns the currently set precision used for writing float
and double
data. At construction, the precision is set to RW_DEFAULT_PRECISION.
|
inline |
Changes the precision used for writing float
and double
data. Returns the previously set precision. At construction, the precision is set to RW_DEFAULT_PRECISION.
|
virtual |
Stores the bool
b to the output stream.
Implements RWvostream.
|
virtual |
Stores the char
c to the output stream, preserving its value using a portable format. This member only preserves US-ASCII numerical codes, not the corresponding character symbol.
Implements RWvostream.
|
virtual |
Stores the vector of n bool
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n char
starting at v to the output stream. The characters should be treated as literal numbers (i.e., not as a character string).
Implements RWvostream.
|
virtual |
Stores the vector of n double
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n float
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n int
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n long
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n long double
starting at v to the output stream.
long double
type. Implements RWvostream.
|
virtual |
Stores the vector of n long long
starting at v to the output stream.
long long
type. Implements RWvostream.
|
virtual |
Stores the vector of n short
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n signed char
starting at v to the output stream. The characters should be treated as literal numbers (i.e., not as a character string).
Implements RWvostream.
|
virtual |
Stores the vector of n unsigned char
starting at v to the output stream. The characters should be treated as literal numbers (i.e., not as a character string).
Implements RWvostream.
|
virtual |
Stores the vector of n unsigned int
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n unsigned long
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n unsigned long long
starting at v to the output stream.
unsigned long long
type. Implements RWvostream.
|
virtual |
Stores the vector of n unsigned short
starting at v to the output stream.
Implements RWvostream.
|
virtual |
Stores the vector of n wchar_t
starting at v to the output stream. The characters should be treated as literal numbers (i.e., not as a character string).
Implements RWvostream.
|
virtual |
Stores the double
d to the output stream.
Implements RWvostream.
|
virtual |
Stores the float
f to the output stream.
Implements RWvostream.
|
virtual |
Stores the int
i to the output stream.
Implements RWvostream.
|
virtual |
Stores the long double
d to the output stream.
long double
type. Implements RWvostream.
|
virtual |
Stores the long
i to the output stream.
Implements RWvostream.
|
virtual |
Stores the long long
i to the output stream.
long long
type. Implements RWvostream.
|
virtual |
Stores the short
i to the output stream.
Implements RWvostream.
|
virtual |
Stores the signed char
c to the output stream, preserving its value.
Implements RWvostream.
|
virtual |
Stores the unsigned char
c to the output stream, preserving its value.
Implements RWvostream.
|
virtual |
Stores the unsigned int
i to the output stream.
Implements RWvostream.
|
virtual |
Stores the unsigned long
i to the output stream.
Implements RWvostream.
|
virtual |
Stores the unsigned long long
i to the output stream.
unsigned long long
type. Implements RWvostream.
|
virtual |
Stores the unsigned short
i to the output stream.
Implements RWvostream.
|
virtual |
Stores the wchar_t
wc to the output stream, preserving its value.
Implements RWvostream.
|
virtual |
Stores the char
c to the output stream, preserving its meaning. c is treated as a character.
Implements RWvostream.
|
virtual |
Stores the signed char
c to the output stream, preserving its meaning. c is treated as a character.
Implements RWvostream.
|
virtual |
Stores the unsigned char
c to the output stream, preserving its meaning. c is treated as a character.
Implements RWvostream.
|
virtual |
Stores the wchar_t
wc to the output stream, preserving its value. wc is treated as a character.
Implements RWvostream.
|
virtual |
Stores n char
starting at s to the output stream.
Reimplemented from RWvostream.
|
virtual |
Stores the size_t
sz to the output stream.
Implements RWvostream.
|
virtual |
Stores the character string, including embedded nulls, starting at s to the output stream.
Implements RWvostream.
|
inlinevirtual |
Returns the current error state.
Implements RWvostream.
std::ostream & RWpostream::std | ( | ) |
Returns a reference to the underlying C++ Standard Library output stream.
|
inline |
Returns a reference to the underlying C++ Standard Library output stream.
|
related |
Default decimal digits of precision.
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |