Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide

RWFile

Module:  Essential Tools Module   Group:  File System


Does not inherit

Local Index

Members

Non-Members

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

None

Public Constructors

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

Public Destructor

~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(long long& i);
RWBoolean
Read(unsigned char& c);
RWBoolean
Read(unsigned short& i);
RWBoolean
Read(unsigned int& i);
RWBoolean
Read(unsigned long& i);
RWBoolean
Read(unsigned long long& i);
RWBoolean
Read(float& f);
RWBoolean
Read(double& d);
RWBoolean
Read(long 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(long 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(unsigned long long* i, size_t count);
RWBoolean
Read(float* i, size_t count);
RWBoolean
Read(double* i, size_t count);
Read(long 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(long long i);
RWBoolean
Write(unsigned char i);
RWBoolean
Write(unsigned short i);
RWBoolean
Write(unsigned int i);
RWBoolean
Write(unsigned long i);
RWBoolean
Write(unsigned long long i);
RWBoolean
Write(float f);
RWBoolean
Write(double d);
RWBoolean
Write(long 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 long 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 unsigned long long* i, size_t count);
RWBoolean
Write(const float* i, size_t count);
RWBoolean
Write(const double* i, size_t count);
Write(const long 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,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrDlist<T,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrHashMap<K,T,H,EQ,A>&
           coll);
RWFile&
operator<<(RWFile& strm, 
           const RWTPtrHashMultiMap<K,T,H,EQ,A>& coll);
operator<<(RWFile& strm, 
           const RWTPtrHashMultiSet<T,H,EQ,A>& coll); 
RWFile&
operator<<(RWFile& strm, 
           const RWTPtrHashSet<T,H,EQ,A>  & coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrMap<K,T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, 
           const RWTPtrMultiMap<K,T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrMultiSet<T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrOrderedVector<T,A> &
           coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSet<T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSlist<T,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSortedDlist<T,C,A>&
           coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrSortedVector<T,C,A> &
           coll);
RWFile&
operator<<(RWFile& strm, const RWTValDeque<T,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValDlist<T,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValHashMap<K,T,H,EQ,A>&
           coll);
RWFile&
operator<<(RWFile& strm, 
           const RWTValHashMultiMap<K,T,H,EQ,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValHashSet<T,H,EQ,A>&
           coll);
RWFile&
operator<<(RWFile& strm, const RWTValMap<K,T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValMultiMap<K,T,C,A>&
           coll);
RWFile&
operator<<(RWFile& strm, const RWTValMultiSet<T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValOrderedVector<T,A>&
           coll);
RWFile&
operator<<(RWFile& strm, const RWTValSet<T,C,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValSlist<T,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTValSortedDlist<T,C,A>&
           coll);
RWFile&
operator<<(RWFile& strm, const RWTValSortedVector& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrDeque<T,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrDlist<T,A>& coll); 
RWFile&
operator>>(RWFile& strm, RWTPtrHashMap<K,T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, 
           RWTPtrHashMultiMap<K,T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, 
           RWTPtrHashMultiSet<T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrHashSet<T,H,EQ,A>  & coll);
RWFile&
operator>>(RWFile& strm, RWTPtrMap<K,T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiMap<K,T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiSet<T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrOrderedVector<T,A> & coll);
RWFile&
operator>>(RWFile& strm, RWTPtrSet<T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrSlist<T,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrSortedDlist<T,C,A>& coll); 
RWFile&
operator>>(RWFile& strm, RWTPtrSortedVector<T,C,A> & coll);
RWFile&
operator>>(RWFile& strm, RWTValDeque<T,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValDlist<T,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValHashMap<K,T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiMap<K,T,H,EQ,A>&
           coll);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiSet<T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValHashSet<T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValMap<K,T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValMultiMap<K,T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValMultiSet<T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValOrderedVector<T,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSet<T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSlist<T,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSortedDlist<T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTValSortedVector<T,C,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrDeque<T,A>*& p); 
RWFile&
operator>>(RWFile& strm, RWTPtrDlist<T,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrHashMap<K,T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, 
           RWTPtrHashMultiMap<K,T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, 
           RWTPtrHashMultiSet<T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrHashSet<T,H,EQ,A>  *& p);
RWFile&
operator>>(RWFile& strm, RWTPtrMap<K,T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiMap<K,T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrMultiSet<T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrOrderedVector<T,A> *& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSet<T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSlist<T,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSortedDlist<T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrSortedVector<T,C,A> *& p);
RWFile&
operator>>(RWFile& strm, RWTValDeque<T,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValDlist<T,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashMap<K,T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiMap<K,T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashMultiSet<T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValHashSet<T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValMap<K,T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValMultiMap<K,T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValMultiSet<T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValOrderedVector<T,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSet<T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSlist<T,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSortedDlist<T,C,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTValSortedVector<T,C,A>*& p);


Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, 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.