]>
git.saurik.com Git - wxWidgets.git/blob - interface/wfstream.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxTempFileOutputStream
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxTempFileOutputStream
13 wxTempFileOutputStream is an output stream based on wxTempFile. It
14 provides a relatively safe way to replace the contents of the
22 class wxTempFileOutputStream
: public wxOutputStream
26 Associates wxTempFileOutputStream with the file to be replaced and opens it.
28 wxStreamBase::IsOk to verify if the constructor succeeded.
29 Call Commit() or wxOutputStream::Close to
30 replace the old file and close this one. Calling Discard()
31 (or allowing the destructor to do it) will discard the changes.
33 wxTempFileOutputStream(const wxString
& fileName
);
36 Validate changes: deletes the old file of the given name and renames the new
37 file to the old name. Returns @true if both actions succeeded. If @false is
38 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
45 Discard changes: the old file contents are not changed, the temporary file is
54 @class wxFFileOutputStream
57 This class represents data written to a file. There are actually
58 two such groups of classes: this one is based on wxFFile
59 whereas wxFileInputStream is based in
62 Note that wxOutputStream::SeekO
63 can seek beyond the end of the stream (file) and will thus not return
64 @e wxInvalidOffset for that.
69 @see wxBufferedOutputStream, wxFFileInputStream, wxFileInputStream
71 class wxFFileOutputStream
: public wxOutputStream
76 Initializes a file stream in write-only mode using the file descriptor @e fp.
78 wxFFileOutputStream(const wxString
& filename
,
79 const wxString
& mode
= "wb");
80 wxFFileOutputStream(wxFFile
& file
);
81 wxFFileOutputStream(FILE* fp
);
87 ~wxFFileOutputStream();
90 Returns @true if the stream is initialized and ready.
98 @class wxFileOutputStream
101 This class represents data written to a file. There are actually
102 two such groups of classes: this one is based on wxFile
103 whereas wxFFileInputStream is based in
106 Note that wxOutputStream::SeekO
107 can seek beyond the end of the stream (file) and will thus not return
108 @e wxInvalidOffset for that.
113 @see wxBufferedOutputStream, wxFileInputStream, wxFFileInputStream
115 class wxFileOutputStream
: public wxOutputStream
120 Initializes a file stream in write-only mode using the file descriptor @e fd.
122 wxFileOutputStream(const wxString
& ofileName
);
123 wxFileOutputStream(wxFile
& file
);
124 wxFileOutputStream(int fd
);
130 ~wxFileOutputStream();
133 Returns @true if the stream is initialized and ready.
141 @class wxFileInputStream
142 @wxheader{wfstream.h}
144 This class represents data read in from a file. There are actually
145 two such groups of classes: this one is based on wxFile
146 whereas wxFFileInputStream is based in
149 Note that wxInputStream::SeekI
150 can seek beyond the end of the stream (file) and will thus not return
151 @e wxInvalidOffset for that.
156 @see wxBufferedInputStream, wxFileOutputStream, wxFFileOutputStream
158 class wxFileInputStream
: public wxInputStream
163 Initializes a file stream in read-only mode using the specified file descriptor.
165 wxFileInputStream(const wxString
& ifileName
);
166 wxFileInputStream(wxFile
& file
);
167 wxFileInputStream(int fd
);
173 ~wxFileInputStream();
176 Returns @true if the stream is initialized and ready.
184 @class wxFFileInputStream
185 @wxheader{wfstream.h}
187 This class represents data read in from a file. There are actually
188 two such groups of classes: this one is based on wxFFile
189 whereas wxFileInputStream is based in
192 Note that wxInputStream::SeekI
193 can seek beyond the end of the stream (file) and will thus not return
194 @e wxInvalidOffset for that.
199 @see wxBufferedInputStream, wxFFileOutputStream, wxFileOutputStream
201 class wxFFileInputStream
: public wxInputStream
206 Initializes a file stream in read-only mode using the specified file pointer @e
209 wxFFileInputStream(const wxString
& filename
,
210 const wxString
& mode
= "rb");
211 wxFFileInputStream(wxFFile
& file
);
212 wxFFileInputStream(FILE* fp
);
218 ~wxFFileInputStream();
221 Returns @true if the stream is initialized and ready.
230 @wxheader{wfstream.h}
238 class wxFFileStream
: public wxFFileOutputStream
242 Initializes a new file stream in read-write mode using the specified
245 wxFFileStream(const wxString
& iofileName
, const wxString
& mode
= "w+b");
252 @wxheader{wfstream.h}
260 class wxFileStream
: public wxFileOutputStream
264 Initializes a new file stream in read-write mode using the specified
267 wxFileStream(const wxString
& iofileName
);