]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/outptstr.tex
patch 1306473
[wxWidgets.git] / docs / latex / wx / outptstr.tex
index 02da47fd2dd3d6d29769df398f31b7681e23ae8d..1c61a7c606455d6b8a72d333df5029d2984a41a4 100644 (file)
@@ -13,102 +13,97 @@ wxOutputStream is an abstract base class which may not be used directly.
 
 <wx/stream.h>
 
+\latexignore{\rtfignore{\wxheading{Members}}}
+
 % -----------
 % ctor & dtor
 % -----------
-\membersection{wxOutputStream::wxOutputStream}
+
+\membersection{wxOutputStream::wxOutputStream}\label{wxoutputstreamctor}
 
 \func{}{wxOutputStream}{\void}
 
 Creates a dummy wxOutputStream object.
 
-\membersection{wxOutputStream::\destruct{wxOutputStream}}
+
+\membersection{wxOutputStream::\destruct{wxOutputStream}}\label{wxoutputstreamdtor}
 
 \func{}{\destruct{wxOutputStream}}{\void}
 
 Destructor.
 
-\membersection{wxOutputStream::LastWrite}
 
-\constfunc{size\_t}{LastWrite}{\void}
+\membersection{wxOutputStream::Close}\label{wxoutputstreamclose}
 
-Returns the number of bytes written during the last Write().
+\func{bool}{Close}{\void}
 
-\membersection{wxOutputStream::PutC}
+Closes the stream, returning {\tt false} if an error occurs. The
+stream is closed implicitly in the destructor if Close() is not
+called explicitly.
 
-\func{void}{PutC}{\param{char}{ c}}
+If this stream wraps another stream or some other resource such
+as a file, then the underlying resource is closed too if it is owned
+by this stream, or left open otherwise.
 
-Puts the specified character in the output queue and increments the
-stream position.
 
-\membersection{wxOutputStream::SeekO}
+\membersection{wxOutputStream::LastWrite}\label{wxoutputstreamlastwrite}
 
-\func{off\_t}{SeekO}{\param{off\_t}{ pos}, \param{wxSeekMode}{ mode}}
+\constfunc{size\_t}{LastWrite}{\void}
 
-Changes the stream current position.
+Returns the number of bytes written during the last 
+\helpref{Write()}{wxoutputstreamwrite}. It may return $0$ even if there is no
+error on the stream if it is only temporarily impossible to write to it.
 
-\membersection{wxOutputStream::TellO}
 
-\constfunc{off\_t}{TellO}{\void}
+\membersection{wxOutputStream::PutC}\label{wxoutputstreamputc}
 
-Returns the current stream position.
+\func{void}{PutC}{\param{char}{ c}}
 
-\membersection{wxOutputStream::Write}
+Puts the specified character in the output queue and increments the
+stream position.
 
-\func{wxOutputStream\&}{Write}{\param{const void *}{buffer}, \param{size\_t}{ size}}
 
-Writes the specified amount of bytes using the data of {\it buffer}. 
-{\it WARNING!} The buffer absolutely needs to have at least the specified size.
+\membersection{wxOutputStream::SeekO}\label{wxoutputstreamseeko}
 
-This function returns a reference on the current object, so the user can test
-any states of the stream right away.
+\func{off\_t}{SeekO}{\param{off\_t}{ pos}, \param{wxSeekMode}{ mode = wxFromStart}}
 
-\func{wxOutputStream\&}{Write}{\param{wxInputStream\&}{ stream\_in}}
+Changes the stream current position.
 
-Reads data from the specified input stream and stores them 
-in the current stream. The data is read until an error is raised
-by one of the two streams.
+\wxheading{Parameters}
 
-% -----------------------------------------------------------------------------
-% wxCountingOutputStream
-% -----------------------------------------------------------------------------
-\section{\class{wxCountingOutputStream}}\label{wxcountingoutputstream}
+\docparam{pos}{Offset to seek to.}
 
-wxCountingOutputStream is specialized output stream which does not write any data anyway,
-instead it counts how many bytes would get written if this were a normal stream. This
-can sometimes be useful or required if some data gets serialized to a stream or compressed
-by using stream compression and thus the final size of the stream cannot be known other
-than pretending to write the stream. One case where the resulting size would have to be
-known is if the data has to be written to a piece of memory and the memory has to be
-allocated before writing to it (which is probably always the case when writing to a 
-memory stream).
+\docparam{mode}{One of {\bf wxFromStart}, {\bf wxFromEnd}, {\bf wxFromCurrent}.}
 
-\wxheading{Derived from}
+\wxheading{Return value}
 
-\helpref{wxOutputStream}{wxstreambase}
-\helpref{wxStreamBase}{wxstreambase}
+The new stream position or wxInvalidOffset on error.
 
-\wxheading{Include files}
 
-<wx/stream.h>
+\membersection{wxOutputStream::TellO}\label{wxoutputstreamtello}
 
-% -----------
-% ctor & dtor
-% -----------
-\membersection{wxCountingOutputStream::wxCountingOutputStream}
+\constfunc{off\_t}{TellO}{\void}
 
-\func{}{wxCountingOutputStream}{\void}
+Returns the current stream position.
 
-Creates a wxCountingOutputStream object.
 
-\membersection{wxCountingOutputStream::\destruct{wxCountingOutputStream}}
+\membersection{wxOutputStream::Write}\label{wxoutputstreamwrite}
 
-\func{}{\destruct{wxCountingOutputStream}}{\void}
+\func{wxOutputStream\&}{Write}{\param{const void *}{buffer}, \param{size\_t}{ size}}
 
-Destructor.
+Writes up to the specified amount of bytes using the data of {\it buffer}. Note
+that not all data can always be written so you must check the number of bytes
+really written to the stream using \helpref{LastWrite()}{wxoutputstreamlastwrite} 
+when this function returns. In some cases (for example a write end of a pipe
+which is currently full) it is even possible that there is no errors and zero
+bytes have been written.
+
+This function returns a reference on the current object, so the user can test
+any states of the stream right away.
 
-\membersection{wxCountingOutputStream::GetSize}
+\func{wxOutputStream\&}{Write}{\param{wxInputStream\&}{ stream\_in}}
 
-\constfunc{size\_t}{GetSize}{\void}
+Reads data from the specified input stream and stores them 
+in the current stream. The data is read until an error is raised
+by one of the two streams.
 
-Returns the current size of the stream.