]>
git.saurik.com Git - wxWidgets.git/blob - interface/wfstream.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxTempFileOutputStream class
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
23 class wxTempFileOutputStream
: public wxOutputStream
27 Associates wxTempFileOutputStream with the file to be replaced and opens it.
29 wxStreamBase::IsOk to verify if the constructor succeeded.
31 Call Commit() or wxOutputStream::Close to
32 replace the old file and close this one. Calling Discard()
33 (or allowing the destructor to do it) will discard the changes.
35 wxTempFileOutputStream(const wxString
& fileName
);
38 Validate changes: deletes the old file of the given name and renames the new
39 file to the old name. Returns @true if both actions succeeded. If @false is
40 returned it may unfortunately mean two quite different things: either that
41 either the old file couldn't be deleted or that the new file couldn't be renamed
47 Discard changes: the old file contents are not changed, the temporary file is
55 @class wxFFileOutputStream
58 This class represents data written to a file. There are actually
59 two such groups of classes: this one is based on wxFFile
60 whereas wxFileInputStream is based in
63 Note that wxOutputStream::SeekO
64 can seek beyond the end of the stream (file) and will thus not return
65 @e wxInvalidOffset for that.
71 wxBufferedOutputStream, wxFFileInputStream, wxFileInputStream
73 class wxFFileOutputStream
: public wxOutputStream
78 Initializes a file stream in write-only mode using the file descriptor @e fp.
80 wxFFileOutputStream(const wxString
& filename
,
81 const wxString
& mode
="w+b");
82 wxFFileOutputStream(wxFFile
& file
);
83 wxFFileOutputStream(FILE * fp
);
89 ~wxFFileOutputStream();
92 Returns @true if the stream is initialized and ready.
94 #define bool IsOk() /* implementation is private */
99 @class wxFileOutputStream
100 @wxheader{wfstream.h}
102 This class represents data written to a file. There are actually
103 two such groups of classes: this one is based on wxFile
104 whereas wxFFileInputStream is based in
107 Note that wxOutputStream::SeekO
108 can seek beyond the end of the stream (file) and will thus not return
109 @e wxInvalidOffset for that.
115 wxBufferedOutputStream, wxFileInputStream, wxFFileInputStream
117 class wxFileOutputStream
: public wxOutputStream
122 Initializes a file stream in write-only mode using the file descriptor @e fd.
124 wxFileOutputStream(const wxString
& ofileName
);
125 wxFileOutputStream(wxFile
& file
);
126 wxFileOutputStream(int fd
);
132 ~wxFileOutputStream();
135 Returns @true if the stream is initialized and ready.
137 #define bool IsOk() /* implementation is private */
142 @class wxFileInputStream
143 @wxheader{wfstream.h}
145 This class represents data read in from a file. There are actually
146 two such groups of classes: this one is based on wxFile
147 whereas wxFFileInputStream is based in
150 Note that wxInputStream::SeekI
151 can seek beyond the end of the stream (file) and will thus not return
152 @e wxInvalidOffset for that.
158 wxBufferedInputStream, wxFileOutputStream, wxFFileOutputStream
160 class wxFileInputStream
: public wxInputStream
165 Initializes a file stream in read-only mode using the specified file descriptor.
167 wxFileInputStream(const wxString
& ifileName
);
168 wxFileInputStream(wxFile
& file
);
169 wxFileInputStream(int fd
);
175 ~wxFileInputStream();
178 Returns @true if the stream is initialized and ready.
180 #define bool IsOk() /* implementation is private */
185 @class wxFFileInputStream
186 @wxheader{wfstream.h}
188 This class represents data read in from a file. There are actually
189 two such groups of classes: this one is based on wxFFile
190 whereas wxFileInputStream is based in
193 Note that wxInputStream::SeekI
194 can seek beyond the end of the stream (file) and will thus not return
195 @e wxInvalidOffset for that.
201 wxBufferedInputStream, wxFFileOutputStream, wxFileOutputStream
203 class wxFFileInputStream
: public wxInputStream
208 Initializes a file stream in read-only mode using the specified file pointer @e
211 wxFFileInputStream(const wxString
& filename
,
212 const wxString
& mode
= "rb");
213 wxFFileInputStream(wxFFile
& file
);
214 wxFFileInputStream(FILE * fp
);
220 ~wxFFileInputStream();
223 Returns @true if the stream is initialized and ready.
225 #define bool IsOk() /* implementation is private */
231 @wxheader{wfstream.h}
240 class wxFFileStream
: public wxFFileOutputStream
244 Initializes a new file stream in read-write mode using the specified
247 wxFFileStream(const wxString
& iofileName
);
253 @wxheader{wfstream.h}
262 class wxFileStream
: public wxFileOutputStream
266 Initializes a new file stream in read-write mode using the specified
269 wxFileStream(const wxString
& iofileName
);