Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWeistream

Module:  Essential Tools Module   Group:  Virtual Stream Classes


... std::ios RWeistreamRWbistream ... ...RWvistreamRWvios

Local Index

Members

Synopsis

#include <rw/estream.h>
RWeistream estr(cin);           // Construct an RWeistream,
                                // using cin's streambuf

Description

Class RWeistream specializes the base class RWbistream to restore values previously stored by RWeostream. Please note, RWeostream must be opened before RWeistream, or the application will not function properly.

The endian streams, RWeistream and RWeostream, offer an efficient compromise between the portable streams (RWpistream, RWpostream) and the binary streams (RWbistream, RWbostream). By compensating for differences in big-endian vs. little-endian formats, as well as sizes of the various integral types, the endian streams offer portability without incurring the stream-size overhead of translating values into a series of printable characters. For example, data stored in little-endian format by an RWeostream object in a DOS program can be retrieved by an RWeistream object on any of several machines, regardless of its native endian format or the sizes of its integral types. Endian streams will work properly when shared among a group of platforms that:

As with the portable streams, care must be taken when storing or retrieving variables of type char. Endian stream methods treat chars as numbers except where the method description explicitly states that the char is being treated, instead, as a character. See the entry for RWpostream for an example of this distinction. Data stored in an integral type on one platform may be too large to fit into that type on a receiving platform. If so, the RWeistream's failbit will be set.

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

Persistence

None.

Example

See RWeostream for an example of how the file "data.dat" might be created.

Program output:

Public Constructors

RWeistream(streambuf* s);
RWeistream(istream& str);

Public Member Functions

virtual int
get();
virtual RWvistream&
get(char& c);
virtual RWvistream&
get(unsigned char& c);
virtual RWvistream&
get(char* v, size_t N);
virtual RWvistream&
get(unsigned char* v, size_t N);
virtual RWvistream&
get(wchar_t& wc);
virtual RWvistream&
get(wchar_t* v, size_t N);
virtual RWvistream&
get(double* v, size_t N);
virtual RWvistream&
get(long 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(long long* v, size_t N);
virtual RWvistream&
get(short* 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&
get(unsigned long long* v, size_t N);
virtual RWvistream&
getString(char* s, size_t N);
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>>(long 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);
virtual RWvistream&
operator>>(unsigned long long& l);
RWeostream::Endian
streamEndian();
size_t
streamSizeofInt();
size_t
streamSizeofLong();
size_t
streamSizeofShort();
size_t
streamSizeofSizeT();
size_t
streamSizeofWchar();


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.