Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

RWbistream


-->RWvistream-->RWios-->Rwvios RWbistream -->ios

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/bstream.h>
RWbistream bstr(cin);        // Construct an RWbistream,
                             // using cin's streambuf

Description

Class RWbistream specializes the abstract base class RWvistream to restore variables stored in binary format by RWbostream.

You can think of it as a binary veneer over an associated streambuf. Because the RWbistream retains no information about the state of its associated streambuf, its use can be freely exchanged with other users of the streambuf (such as an istream or ifstream).

RWbistream can be interrogated as to the stream state using member functions good(), bad(), eof(), etc.

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);
RWbistream(istream& str);

Public Operators

virtual RWvistream&
operator>>(char& c);
virtual RWvistream&
operator>>(wchar_t& wc);
virtual RWvistream&
operator>>(double& d);
virtual RWvistream&
operator>>(float& f);
virtual RWvistream&
operator>>(int& i);
virtual RWvistream&
operator>>(long& l);
virtual RWvistream&
operator>>(short& s);
virtual RWvistream&
operator>>(unsigned char& c);
virtual RWvistream&
operator>>(unsigned short& s);
virtual RWvistream&
operator>>(unsigned int& i);
virtual RWvistream&
operator>>(unsigned long& l);
operator void*();

Public Member Functions

virtual int
get();
virtual RWvistream&
get(char& c);
virtual RWvistream&
get(wchar_t& wc);
virtual RWvistream&
get(unsigned char& c);
virtual RWvistream&
get(char* v, size_t N);
virtual RWvistream&
get(wchar_t* v, size_t N);
virtual RWvistream&
get(double* v, size_t N);
virtual RWvistream&
get(float* v, size_t N);
virtual RWvistream&
get(int* v, size_t N);
virtual RWvistream&
get(long* v, size_t N);
virtual RWvistream&
get(short* v, size_t N);
virtual RWvistream&
get(unsigned char* v, size_t N);
virtual RWvistream&
get(unsigned short* v, size_t N);
virtual RWvistream&
get(unsigned int* v, size_t N);
virtual RWvistream&
get(unsigned long* v, size_t N);
virtual RWvistream&
getString(char* s, size_t N);
virtual RWvistream&
getString(wchar_t* ws, size_t N);


Previous fileTop of documentContentsIndexNext file
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.