Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

RWFile

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

Synopsis

#include <rw/rwfile.h>

RWFile f("filename");

Description

Class RWFile encapsulates binary file operations using the Standard C stream library (functions fopen(), fread(), fwrite(), etc.). This class is based on class PFile of the Interviews Class Library (1987, Stanford University). The member function names begin with upper case letters in order to maintain compatibility with class PFile .

Because this class is intended to encapsulate binary operations, it is important that it be opened using a binary mode. This is particularly important under MS-DOS -- otherwise bytes that happen to match a newline will be expanded to (carriage return, line feed).

If a function expects an RWFile to exist, your code should always check isValid() prior to calling that function. Failure to do so may cause a runtime error. For example:

Persistence

Public Constructors

RWFile(const char* filename, const char* mode = 0);
~RWFile();

Public Member Functions

const char*
Access();
void
ClearErr();
RWoffset
CurOffset();
RWBoolean
Eof();
RWBoolean
Erase();
RWBoolean
Error();
RWBoolean
Exists();
RWBoolean
Flush();
const char*
GetName();
FILE*
GetStream();
RWBoolean
IsEmpty();
RWBoolean
isValid() const;
RWBoolean
Read(char& c);
RWBoolean
Read(wchar_t& wc);
RWBoolean
Read(short& i);
RWBoolean
Read(int& i);
RWBoolean
Read(long& i);
RWBoolean
Read(unsigned char& c);
RWBoolean
Read(unsigned short& i);
RWBoolean
Read(unsigned int& i);
RWBoolean
Read(unsigned long& i);
RWBoolean
Read(float& f);
RWBoolean
Read(double& d);
RWBoolean
Read(char* i,          size_t count);
RWBoolean
Read(wchar_t* i,       size_t count);
RWBoolean
Read(short* i,         size_t count);
RWBoolean
Read(int* i,           size_t count);
RWBoolean
Read(long* i,          size_t count);
RWBoolean
Read(unsigned char* i, size_t count);
RWBoolean
Read(unsigned short* i,size_t count);
RWBoolean
Read(unsigned int* i,  size_t count);
RWBoolean
Read(unsigned long* i, size_t count);
RWBoolean
Read(float* i,         size_t count);
RWBoolean
Read(double* i,        size_t count);
RWBoolean
Read(char* string);
RWBoolean
SeekTo(RWoffset offset);
RWBoolean
SeekToBegin();
RWBoolean
SeekToEnd();
RWBoolean
Write(char i);
RWBoolean
Write(wchar_t i);
RWBoolean
Write(short i);
RWBoolean
Write(int i);
RWBoolean
Write(long i);
RWBoolean
Write(unsigned char i);
RWBoolean
Write(unsigned short i);
RWBoolean
Write(unsigned int i);
RWBoolean
Write(unsigned long i);
RWBoolean
Write(float f);
RWBoolean
Write(double d);
RWBoolean
Write(const char* i,          size_t count);
RWBoolean
Write(const wchar_t* i,       size_t count);
RWBoolean
Write(const short* i,         size_t count);
RWBoolean
Write(const int* i,           size_t count);
RWBoolean
Write(const long* i,          size_t count);
RWBoolean
Write(const unsigned char* i, size_t count);
RWBoolean
Write(const unsigned short* i,size_t count);
RWBoolean
Write(const unsigned int* i,  size_t count);
RWBoolean
Write(const unsigned long* i, size_t count);
RWBoolean
Write(const float* i,         size_t count);
RWBoolean
Write(const double* i,        size_t count);
RWBoolean
Write(const char* string);

Static Public Member Functions

static RWBoolean
Exists(const char* filename, int mode = F_OK);

Related Global Operators

RWFile&
operator<<(RWFile&,     const RWCString& str);
RWFile&
operator<<(RWFile&,     const RWDate& date);
RWFile&
operator<<(RWFile&,     const RWInteger& x);
RWFile&
operator<<(RWFile&,     const RWTime& t);
RWFile&
operator>>(RWFile&,     RWTime& t);
RWFile&
operator>>(RWFile&,     RWCString& str);
RWFile&
operator>>(RWFile&,     RWDate& date);
RWFile&
operator>>(RWFile&, RWInteger& x);
RWFile&
operator<<(RWFile& strm, const RWTPtrDeque<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrDlist<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrHashMap<K,T,H,EQ>& coll);
RWFile&
operator<<(RWFile& strm, 
        const RWTPtrHashMultiMap<K,T,H,EQ>& coll);
operator<<(RWFile& strm, 
       const RWTPtrHashMultiSet<T,H,EQ>& coll); 
RWFile&
operator<<(RWFile& strm, 
       const RWTPtrHashSet<T,H,EQ>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrMap<K,T,C>& coll);
RWFile&
operator<<(RWFile& strm, 
       const RWTPtrMultiMap<K,T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrMultiSet<T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrOrderedVector<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSet<T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSlist<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSortedDlist<T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSortedVector<T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValDeque<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValDlist<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValHashMap<T,H,EQ>& coll);
RWFile&
operator<<(RWFile& strm, 
           const RWTValHashMultiMap<K,T,H,EQ>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValHashSet<T,H,EQ>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValMap<K,T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValMultiMap<K,T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValMultiSet<T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValOrderedVector<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValSet<T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValSlist<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValSortedDlist<T,C>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValSortedVector& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrDeque<T>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrDlist<T>& coll); 
RWFile&
operator>>(RWFile& strm, RWTPtrHashMap<K,T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, 
        RWTPtrHashMultiMap<K,T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, 
        RWTPtrHashMultiSet<T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrHashSet<T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrMap<K,T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiMap<K,T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiSet<T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrOrderedVector<T>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrSet<T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrSlist<T>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrSortedDlist<T,C>& coll); 
RWFile&
operator>>(RWFile& strm, RWTPtrSortedVector<T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTValDeque<T>& coll);
RWFile&
operator>>(RWFile& strm, RWTValDlist<T>& coll);
RWFile&
operator>>(RWFile& strm, RWTValHashMap<T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiMap<K,T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiSet<T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, RWTValHashSet<T,H,EQ>& coll);
RWFile&
operator>>(RWFile& strm, RWTValMap<K,T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTValMultiMap<K,T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTValMultiSet<T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTValOrderedVector<T>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSet<T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSlist<T>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSortedDlist<T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSortedVector<T,C>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrDeque<T>*& p); 
RWFile&
operator>>(RWFile& strm, RWTPtrDlist<T>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrHashMap<K,T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, 
        RWTPtrHashMultiMap<K,T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, 
         RWTPtrHashMultiSet<T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrHashSet<T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrMap<K,T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiMap<K,T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiSet<T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrOrderedVector<T>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSet<T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSlist<T>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSortedDlist<T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSortedVector<T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTValDeque<T>*& p);
RWFile&
operator>>(RWFile& strm, RWTValDlist<T>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashMap<T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiMap<K,T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiSet<T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashSet<T,H,EQ>*& p);
RWFile&
operator>>(RWFile& strm, RWTValMap<K,T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTValMultiMap<K,T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTValMultiSet<T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTValOrderedVector<T>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSet<T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSlist<T>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSortedDlist<T,C>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSortedVector<T,C>*& p);


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