1 % -----------------------------------------------------------------------------
3 % -----------------------------------------------------------------------------
4 \section{\class{wxFFileInputStream
}}\label{wxffileinputstream
}
6 This class represents data read in from a file. There are actually
7 two such groups of classes: this one is based on
\helpref{wxFFile
}{wxffile
}
8 whereas
\helpref{wxFileInputStream
}{wxfileinputstream
} is based in
9 the
\helpref{wxFile
}{wxfile
} class.
11 Note that
\helpref{wxFile
}{wxfile
} and
\helpref{wxFFile
}{wxffile
} differ
12 in one aspect, namely when to
report that the end of the file has been
13 reached. This is documented in
\helpref{wxFile::Eof
}{wxfileeof
} and
14 \helpref{wxFFile::Eof
}{wxffileeof
} and the behaviour of the stream
15 classes reflects this difference, i.e. wxFileInputStream will
report
16 wxSTREAM
\_EOF after having read the last byte whereas wxFFileInputStream
17 will
report wxSTREAM
\_EOF after trying to read
{\it past
} the last byte.
18 Related to EOF behavior, note that
\helpref{SeekI()
}{wxinputstreamseeki
}
19 can seek beyond the end of the stream (file) and will thus not return
20 {\it wxInvalidOffset
} for that.
22 \wxheading{Derived from
}
24 \helpref{wxInputStream
}{wxinputstream
}
26 \wxheading{Include files
}
32 \helpref{wxBufferedInputStream
}{wxbufferedinputstream
},
\helpref{wxFFileOutputStream
}{wxffileoutputstream
},
\helpref{wxFileOutputStream
}{wxfileoutputstream
}
37 \latexignore{\rtfignore{\wxheading{Members
}}}
39 \membersection{wxFFileInputStream::wxFFileInputStream
}\label{wxffileinputstreamctor
}
41 \func{}{wxFFileInputStream
}{\param{const wxString\&
}{ filename
},
\param{const wxChar *
}{ mode = "rb"
}}
43 Opens the specified file using its
{\it filename
} name using the specified mode.
45 \func{}{wxFFileInputStream
}{\param{wxFFile\&
}{ file
}}
47 Initializes a file stream in read-only mode using the file I/O object
{\it file
}.
49 \func{}{wxFFileInputStream
}{\param{FILE *
}{ fp
}}
51 Initializes a file stream in read-only mode using the specified file pointer
{\it fp
}.
53 \membersection{wxFFileInputStream::
\destruct{wxFFileInputStream
}}\label{wxffileinputstreamdtor
}
55 \func{}{\destruct{wxFFileInputStream
}}{\void}
59 \membersection{wxFFileInputStream::Ok
}\label{wxffileinputstreamok
}
61 \constfunc{bool
}{Ok
}{\void}
63 Returns true if the stream is initialized and ready.
65 % -----------------------------------------------------------------------------
67 % -----------------------------------------------------------------------------
68 \section{\class{wxFFileOutputStream
}}\label{wxffileoutputstream
}
70 This class represents data written to a file. There are actually
71 two such groups of classes: this one is based on
\helpref{wxFFile
}{wxffile
}
72 whereas
\helpref{wxFileInputStream
}{wxffileinputstream
} is based in
73 the
\helpref{wxFile
}{wxfile
} class.
75 Note that
\helpref{wxFile
}{wxfile
} and
\helpref{wxFFile
}{wxffile
} differ
76 in one aspect, namely when to
report that the end of the file has been
77 reached. This is documented in
\helpref{wxFile::Eof
}{wxfileeof
} and
78 \helpref{wxFFile::Eof
}{wxffileeof
} and the behaviour of the stream
79 classes reflects this difference, i.e. wxFileInputStream will
report
80 wxSTREAM
\_EOF after having read the last byte whereas wxFFileInputStream
81 will
report wxSTREAM
\_EOF after trying to read
{\it past
} the last byte.
82 Related to EOF behavior, note that
\helpref{SeekO()
}{wxoutputstreamseeko
}
83 can seek beyond the end of the stream (file) and will thus not return
84 {\it wxInvalidOffset
} for that.
86 \wxheading{Derived from
}
88 \helpref{wxOutputStream
}{wxoutputstream
}
90 \wxheading{Include files
}
96 \helpref{wxBufferedOutputStream
}{wxbufferedoutputstream
},
\helpref{wxFFileInputStream
}{wxffileinputstream
},
\helpref{wxFileInputStream
}{wxfileinputstream
}
101 \latexignore{\rtfignore{\wxheading{Members
}}}
103 \membersection{wxFFileOutputStream::wxFFileOutputStream
}\label{wxffileoutputstreamctor
}
105 \func{}{wxFFileOutputStream
}{\param{const wxString\&
}{ filename
},
\param{const wxChar *
}{ mode="w+b"
}}
107 Opens the file with the given
{\it filename
} name in the specified mode.
109 \func{}{wxFFileOutputStream
}{\param{wxFFile\&
}{ file
}}
111 Initializes a file stream in write-only mode using the file I/O object
{\it file
}.
113 \func{}{wxFFileOutputStream
}{\param{FILE *
}{ fp
}}
115 Initializes a file stream in write-only mode using the file descriptor
{\it fp
}.
117 \membersection{wxFFileOutputStream::
\destruct{wxFFileOutputStream
}}\label{wxffileoutputstreamdtor
}
119 \func{}{\destruct{wxFFileOutputStream
}}{\void}
123 \membersection{wxFFileOutputStream::Ok
}\label{wxffileoutputstreamok
}
125 \constfunc{bool
}{Ok
}{\void}
127 Returns true if the stream is initialized and ready.
129 % -----------------------------------------------------------------------------
131 % -----------------------------------------------------------------------------
132 \section{\class{wxFFileStream
}}\label{wxffilestream
}
134 \wxheading{Derived from
}
136 \helpref{wxFFileOutputStream
}{wxffileoutputstream
},
\helpref{wxFFileInputStream
}{wxffileinputstream
}
138 \wxheading{Include files
}
144 \helpref{wxStreamBuffer
}{wxstreambuffer
}
146 \latexignore{\rtfignore{\wxheading{Members
}}}
148 \membersection{wxFFileStream::wxFFileStream
}\label{wxffilestreamctor
}
150 \func{}{wxFFileStream
}{\param{const wxString\&
}{ iofileName
}}
152 Initializes a new file stream in read-write mode using the specified
153 {\it iofilename
} name.