wxWidgets/docs/latex/wx/tempfilestrm.tex
2007-08-15 13:27:12 +00:00

62 lines
1.9 KiB
TeX

%
% automatically generated by HelpGen $Revision$ from
% wx/wfstream.h at 07/Mar/05 20:45:33
%
\section{\class{wxTempFileOutputStream}}\label{wxtempfileoutputstream}
wxTempFileOutputStream is an output stream based on \helpref{wxTempFile}{wxtempfile}. It
provides a relatively safe way to replace the contents of the
existing file.
\wxheading{Derived from}
\helpref{wxOutputStream}{wxoutputstream}\\
\helpref{wxStreamBase}{wxstreambase}
\wxheading{Include files}
<wx/wfstream.h>
\wxheading{Library}
\helpref{wxBase}{librarieslist}
\wxheading{See also}
\helpref{wxTempFile}{wxtempfile}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxTempFileOutputStream::wxTempFileOutputStream}\label{wxtempfileoutputstreamwxtempfileoutputstream}
\func{}{wxTempFileOutputStream}{\param{const wxString\& }{fileName}}
Associates wxTempFileOutputStream with the file to be replaced and opens it. You should use
\helpref{IsOk}{wxstreambaseisok} to verify if the constructor succeeded.
Call \helpref{Commit()}{wxtempfileoutputstreamcommit} or \helpref{Close()}{wxoutputstreamclose} to
replace the old file and close this one. Calling \helpref{Discard()}{wxtempfileoutputstreamdiscard}
(or allowing the destructor to do it) will discard the changes.
\membersection{wxTempFileOutputStream::Commit}\label{wxtempfileoutputstreamcommit}
\func{bool}{Commit}{\void}
Validate changes: deletes the old file of the given name and renames the new
file to the old name. Returns {\tt true} if both actions succeeded. If {\tt false} is
returned it may unfortunately mean two quite different things: either that
either the old file couldn't be deleted or that the new file couldn't be renamed
to the old name.
\membersection{wxTempFileOutputStream::Discard}\label{wxtempfileoutputstreamdiscard}
\func{void}{Discard}{\void}
Discard changes: the old file contents are not changed, the temporary file is
deleted.