Tools.h++ Class Reference

Table Of Contents
Persistence
None
Example
See RWbostream for an example of how the file "data.dat" might be created.
#include <rw/bstream.h>
#include <fstream.h>
main(){
ifstream fstr("data.dat"); // Open an input file
RWbistream bstr(fstr); // Construct RWbistream from it
int i;
float f;
double d;
bstr >> i; // Restore an int that was stored in binary
bstr >> f >> d; // Restore a float & double
}
Public Constructors
RWbistream(streambuf* s);
Construct an RWbistream from the streambuf s. For DOS, this streambuf must have been
opened in binary mode.
RWbistream(istream& str);
Construct an RWbistream using the streambuf associated with the istream str. For DOS,
the streambuf must have been opened in binary mode. This can be done by specifying
ios::binary as part of the second argument to the constructor for and ifstream. Using the
example above, the line to create the ifstream would read, ifstream fstr("data.dat", ios::in
| ios::binary); where the "|" is the binary OR operator.
Public Operators
virtual RWvistream&
operator>>(char& c);
Redefined from class RWvistream. Get the next char from the input stream and store it in
c.
virtual RWvistream&