]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/wfstream.h
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     interface of wxTempFileOutputStream 
   4 // Author:      wxWidgets team 
   6 // Licence:     wxWindows license 
   7 ///////////////////////////////////////////////////////////////////////////// 
  10     @class wxTempFileOutputStream 
  12     wxTempFileOutputStream is an output stream based on wxTempFile. 
  13     It provides a relatively safe way to replace the contents of the 
  21 class wxTempFileOutputStream 
: public wxOutputStream
 
  25         Associates wxTempFileOutputStream with the file to be replaced and opens it. 
  26         You should use wxStreamBase::IsOk() to verify if the constructor succeeded. 
  28         Call Commit() or wxOutputStream::Close() to replace the old file and close 
  29         this one. Calling Discard() (or allowing the destructor to do it) will 
  32     wxTempFileOutputStream(const wxString
& fileName
); 
  35         Validate changes: deletes the old file of the given name and renames the new 
  36         file to the old name. Returns @true if both actions succeeded. 
  38         If @false is returned it may unfortunately mean two quite different things: either that 
  39         either the old file couldn't be deleted or that the new file couldn't be renamed 
  42     virtual bool Commit(); 
  45         Discard changes: the old file contents are not changed, the temporary file is 
  48     virtual void Discard(); 
  54     @class wxFFileOutputStream 
  56     This class represents data written to a file. 
  57     There are actually two such groups of classes: this one is based on wxFFile 
  58     whereas wxFileInputStream is based in the wxFile class. 
  60     Note that wxOutputStream::SeekO() can seek beyond the end of the stream 
  61     (file) and will thus not return ::wxInvalidOffset for that. 
  66     @see wxBufferedOutputStream, wxFFileInputStream, wxFileInputStream 
  68 class wxFFileOutputStream 
: public wxOutputStream
 
  72         Initializes a file stream in write-only mode using the file descriptor @e fp. 
  74     wxFFileOutputStream(const wxString
& filename
, 
  75                         const wxString
& mode 
= "wb"); 
  78         Initializes a file stream in write-only mode using the file I/O object file. 
  80     wxFFileOutputStream(wxFFile
& file
); 
  83         Initializes a file stream in write-only mode using the file descriptor fp. 
  85     wxFFileOutputStream(FILE* fp
); 
  90     virtual ~wxFFileOutputStream(); 
  93         Returns @true if the stream is initialized and ready. 
 101     @class wxFileOutputStream 
 103     This class represents data written to a file. 
 104     There are actually two such groups of classes: this one is based on wxFile 
 105     whereas wxFFileInputStream is based in the wxFFile class. 
 107     Note that wxOutputStream::SeekO() can seek beyond the end of the stream 
 108     (file) and will thus not return ::wxInvalidOffset for that. 
 113     @see wxBufferedOutputStream, wxFileInputStream, wxFFileInputStream 
 115 class wxFileOutputStream 
: public wxOutputStream
 
 119         Creates a new file with ofilename name and initializes the stream in write-only mode. 
 121     wxFileOutputStream(const wxString
& ofileName
); 
 124         Initializes a file stream in write-only mode using the file I/O object file. 
 126     wxFileOutputStream(wxFile
& file
); 
 129         Initializes a file stream in write-only mode using the file descriptor @e fd. 
 131     wxFileOutputStream(int fd
); 
 136     virtual ~wxFileOutputStream(); 
 139         Returns @true if the stream is initialized and ready. 
 147     @class wxFileInputStream 
 149     This class represents data read in from a file. 
 150     There are actually two such groups of classes: this one is based on wxFile 
 151     whereas wxFFileInputStream is based in the wxFFile class. 
 153     Note that wxInputStream::SeekI() can seek beyond the end of the stream (file) 
 154     and will thus not return ::wxInvalidOffset for that. 
 159     @see wxBufferedInputStream, wxFileOutputStream, wxFFileOutputStream 
 161 class wxFileInputStream 
: public wxInputStream
 
 165         Opens the specified file using its ifilename name in read-only mode. 
 167     wxFileInputStream(const wxString
& ifileName
); 
 170         Initializes a file stream in read-only mode using the file I/O object file. 
 172     wxFileInputStream(wxFile
& file
); 
 175         Initializes a file stream in read-only mode using the specified file descriptor. 
 177     wxFileInputStream(int fd
); 
 182     virtual ~wxFileInputStream(); 
 185         Returns @true if the stream is initialized and ready. 
 193     @class wxFFileInputStream 
 195     This class represents data read in from a file. 
 196     There are actually two such groups of classes: this one is based on wxFFile 
 197     whereas wxFileInputStream is based in the wxFile class. 
 199     Note that wxInputStream::SeekI() can seek beyond the end of the stream (file) 
 200     and will thus not return ::wxInvalidOffset for that. 
 205     @see wxBufferedInputStream, wxFFileOutputStream, wxFileOutputStream 
 207 class wxFFileInputStream 
: public wxInputStream
 
 211         Opens the specified file using its filename name using the specified mode. 
 213     wxFFileInputStream(const wxString
& filename
, 
 214                        const wxString
& mode 
= "rb"); 
 217         Initializes a file stream in read-only mode using the file I/O object file. 
 219     wxFFileInputStream(wxFFile
& file
); 
 222         Initializes a file stream in read-only mode using the specified file pointer @a fp. 
 224     wxFFileInputStream(FILE* fp
); 
 229     virtual ~wxFFileInputStream(); 
 232         Returns @true if the stream is initialized and ready. 
 242     @todo describe this class. 
 249 class wxFFileStream 
: public wxFFileOutputStream
 
 253         Initializes a new file stream in read-write mode using the specified 
 256     wxFFileStream(const wxString
& iofileName
, const wxString
& mode 
= "w+b"); 
 264     @todo describe this class. 
 271 class wxFileStream 
: public wxFileOutputStream
 
 275         Initializes a new file stream in read-write mode using the specified 
 278     wxFileStream(const wxString
& iofileName
);