]>
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. It
13 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.
27 wxStreamBase::IsOk to verify if the constructor succeeded.
28 Call Commit() or wxOutputStream::Close to
29 replace the old file and close this one. Calling Discard()
30 (or allowing the destructor to do it) will discard the changes.
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. If @false is
37 returned it may unfortunately mean two quite different things: either that
38 either the old file couldn't be deleted or that the new file couldn't be renamed
44 Discard changes: the old file contents are not changed, the temporary file is
53 @class wxFFileOutputStream
55 This class represents data written to a file. There are actually
56 two such groups of classes: this one is based on wxFFile
57 whereas wxFileInputStream is based in
60 Note that wxOutputStream::SeekO
61 can seek beyond the end of the stream (file) and will thus not return
62 @e wxInvalidOffset for that.
67 @see wxBufferedOutputStream, wxFFileInputStream, wxFileInputStream
69 class wxFFileOutputStream
: public wxOutputStream
74 Initializes a file stream in write-only mode using the file descriptor @e fp.
76 wxFFileOutputStream(const wxString
& filename
,
77 const wxString
& mode
= "wb");
78 wxFFileOutputStream(wxFFile
& file
);
79 wxFFileOutputStream(FILE* fp
);
85 ~wxFFileOutputStream();
88 Returns @true if the stream is initialized and ready.
96 @class wxFileOutputStream
98 This class represents data written to a file. There are actually
99 two such groups of classes: this one is based on wxFile
100 whereas wxFFileInputStream is based in
103 Note that wxOutputStream::SeekO
104 can seek beyond the end of the stream (file) and will thus not return
105 @e wxInvalidOffset for that.
110 @see wxBufferedOutputStream, wxFileInputStream, wxFFileInputStream
112 class wxFileOutputStream
: public wxOutputStream
117 Initializes a file stream in write-only mode using the file descriptor @e fd.
119 wxFileOutputStream(const wxString
& ofileName
);
120 wxFileOutputStream(wxFile
& file
);
121 wxFileOutputStream(int fd
);
127 ~wxFileOutputStream();
130 Returns @true if the stream is initialized and ready.
138 @class wxFileInputStream
140 This class represents data read in from a file. There are actually
141 two such groups of classes: this one is based on wxFile
142 whereas wxFFileInputStream is based in
145 Note that wxInputStream::SeekI
146 can seek beyond the end of the stream (file) and will thus not return
147 @e wxInvalidOffset for that.
152 @see wxBufferedInputStream, wxFileOutputStream, wxFFileOutputStream
154 class wxFileInputStream
: public wxInputStream
159 Initializes a file stream in read-only mode using the specified file descriptor.
161 wxFileInputStream(const wxString
& ifileName
);
162 wxFileInputStream(wxFile
& file
);
163 wxFileInputStream(int fd
);
169 ~wxFileInputStream();
172 Returns @true if the stream is initialized and ready.
180 @class wxFFileInputStream
182 This class represents data read in from a file. There are actually
183 two such groups of classes: this one is based on wxFFile
184 whereas wxFileInputStream is based in
187 Note that wxInputStream::SeekI
188 can seek beyond the end of the stream (file) and will thus not return
189 @e wxInvalidOffset for that.
194 @see wxBufferedInputStream, wxFFileOutputStream, wxFileOutputStream
196 class wxFFileInputStream
: public wxInputStream
201 Initializes a file stream in read-only mode using the specified file pointer @e
204 wxFFileInputStream(const wxString
& filename
,
205 const wxString
& mode
= "rb");
206 wxFFileInputStream(wxFFile
& file
);
207 wxFFileInputStream(FILE* fp
);
213 ~wxFFileInputStream();
216 Returns @true if the stream is initialized and ready.
232 class wxFFileStream
: public wxFFileOutputStream
236 Initializes a new file stream in read-write mode using the specified
239 wxFFileStream(const wxString
& iofileName
, const wxString
& mode
= "w+b");
253 class wxFileStream
: public wxFileOutputStream
257 Initializes a new file stream in read-write mode using the specified
260 wxFileStream(const wxString
& iofileName
);