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, which contains functions fopen(), fread(), fwrite(), and so on. Class RWFile 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 to open it using a binary mode. This is particularly important under MS-DOS; otherwise, bytes that match a newline are expanded to (carriage return, line feed).

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();

NOTE:Do not use this function to alter the state of the file!
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);


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.