X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07b732709364e538ab7ccc49d8f2643d9d28b49d..a8cb1d29e7fe349142d8d6be9fc9afe986340611:/docs/latex/wx/stream.tex

diff --git a/docs/latex/wx/stream.tex b/docs/latex/wx/stream.tex
index 641609234a..981e244af3 100644
--- a/docs/latex/wx/stream.tex
+++ b/docs/latex/wx/stream.tex
@@ -4,6 +4,10 @@
 
 None
 
+\wxheading{Include files}
+
+<wx/stream.h>
+
 \wxheading{See also}
 
 \helpref{wxStreamBase}{wxstreambase}
@@ -16,7 +20,7 @@ None
 % -----------
 % ctor & dtor
 % -----------
-\membersection{wxStreamBuffer::wxStreamBuffer}
+\membersection{wxStreamBuffer::wxStreamBuffer}\label{wxstreambufconst}
 
 \func{}{wxStreamBuffer}{\param{wxStreamBase\&}{ stream}, \param{BufMode}{ mode}}
 
@@ -43,17 +47,25 @@ to a stream. \it{mode} specifies the type of the buffer (read, write, read\_writ
 work only on memory buffers but it is still compatible with the rest of the
 wxStream classes. You can write, read to this special stream and it will
 grow (if it is allowed by the user) its internal buffer. Briefly, it has all
-functionnalities of a ``normal'' stream.
+functionality of a ``normal'' stream.
 
 \wxheading{Warning}
 
 The "read\_write" mode may not work: it isn't completely finished.
+You can create "memory" streams by this way:
 
-\wxheading{See also}
+\begin{verbatim}
+  wxStreamBuffer *sb = new wxStreamBuffer(wxStreamBuffer::read)
+  wxInputStream *input = new wxInputStream(sb);
+
+  sb->Fixed(FALSE); // It can change the size of the buffer.
 
-\helpref{wxStreamBuffer:SetBufferIO}{wxstreambufsetbufferio}
+  // input is now a read-only memory stream.
+\end{verbatim}
+
+But you should take care when destroying the stream buffer yourself.
 
-\func{}{wxStreamBuffer}{\param{const wxStreamBuffer &}{buffer}}
+\func{}{wxStreamBuffer}{\param{const wxStreamBuffer\&}{buffer}}
 
 Constructor. It initializes the stream buffer with the data of the specified
 stream buffer. The new stream buffer is nearly exactly the same as the
@@ -68,6 +80,10 @@ segmentation violation if the parent is destroyed and the children continues
 operating. It is advised to use this feature only in very local area of the
 program.
 
+\wxheading{See also}
+
+\helpref{wxStreamBuffer:SetBufferIO}{wxstreambuffersetbufferio}
+
 \membersection{wxStreamBuffer::\destruct{wxStreamBuffer}}
 
 \func{}{wxStreamBuffer}{\destruct{wxStreamBuffer}}
@@ -80,7 +96,7 @@ The "Write-Back" buffer is freed.
 % -----------
 % Filtered IO
 % -----------
-\membersection{wxStreamBuffer::Read}\label{wxstreambufread}
+\membersection{wxStreamBuffer::Read}\label{wxstreambufferread}
 
 \func{size\_t}{Read}{\param{void *}{buffer}, \param{size\_t }{size}}
 
@@ -98,14 +114,14 @@ It returns the real read size. If returned size is different of the specified
 
 \wxheading{See also}
 
-\helpref{wxStreamBuffer::WriteBack}{wxstreambufwriteback}
+\helpref{wxStreamBuffer::Write}{wxstreambufferwrite}
 
 \func{size\_t}{Read}{\param{wxStreamBuffer *}{buffer}}
 
 Reads a \it{buffer}. The function returns when \it{buffer} is full or
 when there aren't datas anymore in the current buffer.
 
-\membersection{wxStreamBuffer::Write}
+\membersection{wxStreamBuffer::Write}\label{wxstreambufferwrite}
 
 \func{size\_t}{Write}{\param{const void *}{buffer}, \param{size\_t }{size}}
 
@@ -114,26 +130,7 @@ are cached in a buffer before being sent in one block to the stream.
 
 \func{size\_t}{Write}{\param{wxStreamBuffer *}{buffer}}
 
-See \helpref{Read}{wxstreambufreadbuf}
-
-\membersection{wxStreamBuffer::WriteBack}\label{wxstreambufwriteback}
-
-\func{size\_t}{WriteBack}{\param{const char*}{ buffer}, \param{size\_t}{ size}}
-
-This function is only useful in \it{read} mode. It is the manager of the "Write-Back"
-buffer. This buffer acts like a temporary buffer where datas which has to be 
-read during the next read IO call are put. This is useful when you get a big
-block of data which you didn't want to read: you can replace them at the top
-of the input queue by this way.
-
-\wxheading{Return value}
-
-Returns the amount of bytes saved in the Write-Back buffer.
-
-\func{size\_t}{WriteBack}{\param{char }{c}}
-
-This function acts like the previous one except that it takes only one
-character: it is sometimes shorter to use than the generic function.
+See \helpref{Read}{wxstreambufferread}.
 
 \membersection{wxStreamBuffer::GetChar}
 
@@ -147,7 +144,7 @@ You aren't directly notified if an error occured during the IO call.
 
 \wxheading{See also}
 
-\helpref{wxStreamBuffer::Read}{wxstreambufread}
+\helpref{wxStreamBuffer::Read}{wxstreambufferread}
 
 \membersection{wxStreamBuffer::PutChar}
 
@@ -161,7 +158,7 @@ You aren't directly notified if an error occured during the IO call.
 
 \wxheading{See also}
 
-\helpref{wxStreamBuffer::Read}{wxstreambufwrite}
+\helpref{wxStreamBuffer::Read}{wxstreambufferwrite}
 
 \membersection{wxStreamBuffer::Tell}
 
@@ -206,16 +203,45 @@ the beginning of the stream. Otherwise, it returns wxInvalidOffset.
 
 Resets to the initial state variables concerning the buffer.
 
-\membersection{wxStreamBuffer::SetBufferIO}\label{wxstreambufsetbufferio}
+\membersection{wxStreamBuffer::SetBufferIO}\label{wxstreambuffersetbufferio}
 
 \func{void}{SetBufferIO}{\param{char*}{ buffer\_start}, \param{char*}{ buffer\_end}}
 
 Specifies which pointers to use for stream buffering. You need to pass a pointer on the
-start of the buffer end and another on the end.
+start of the buffer end and another on the end. The object will use this buffer
+to cache stream data. It may be used also as a source/destination buffer when
+you create an empty stream buffer (See \helpref{wxStreamBuffer::wxStreamBuffer}{wxstreambufconst}).
+
+\wxheading{Remarks}
+
+When you use this function, you'll have to destroy the IO buffers yourself
+after the stream buffer is destroyed or don't use it anymore.
+In the case you use it with an empty buffer, the stream buffer will not grow
+it when it is full.
+
+\wxheading{See also}
+
+\helpref{wxStreamBuffer constructor}{wxstreambufconst}\\
+\helpref{wxStreamBuffer::Fixed}{wxstreambufferfixed}\\
+\helpref{wxStreamBuffer::Flushable}{wxstreambufferflushable}
 
 \func{void}{SetBufferIO}{\param{size\_t}{ bufsize}}
 
-Changes the size of the current IO buffer.
+Destroys or invalidates the previous IO buffer and allocates a new one of the
+specified size.
+
+\wxheading{Warning}
+
+All previous pointers aren't valid anymore.
+
+\wxheading{Remark}
+
+The created IO buffer is growable by the object.
+
+\wxheading{See also}
+
+\helpref{wxStreamBuffer::Fixed}{wxstreambufferfixed}\\
+\helpref{wxStreamBuffer::Flushable}{wxstreambufferflushable}
 
 \membersection{wxStreamBuffer::GetBufferStart}
 
@@ -239,13 +265,18 @@ Returns a pointer on the current position of the stream buffer.
 
 \constfunc{off\_t}{GetIntPosition}{\void}
 
-Returns the current position in the stream buffer.
+Returns the current position (counted in bytes) in the stream buffer.
 
 \membersection{wxStreamBuffer::SetIntPosition}
 
 \func{void}{SetIntPosition}{\void}
 
-Sets the current position in the stream buffer.
+Sets the current position (in bytes) in the stream buffer.
+
+\wxheading{Warning}
+
+Since it is a very low-level function, there is no check on the position:
+specify an invalid position can induce unexpected results.
 
 \membersection{wxStreamBuffer::GetLastAccess}
 
@@ -253,15 +284,19 @@ Sets the current position in the stream buffer.
 
 Returns the amount of bytes read during the last IO call to the parent stream.
 
-\membersection{wxStreamBuffer::Fixed}
+\membersection{wxStreamBuffer::Fixed}\label{wxstreambufferfixed}
 
 \func{void}{Fixed}{\param{bool}{ fixed}}
 
 Toggles the fixed flag. Usually this flag is toggled at the same time as 
-\it{flushable}. This flag allows (when it is FALSE) or forbids (when it is TRUE)
-the stream buffer to resize dynamically the IO buffer.
+\it{flushable}. This flag allows (when it has the FALSE value) or forbids
+(when it has the TRUE value) the stream buffer to resize dynamically the IO buffer.
+
+\wxheading{See also}
+
+\helpref{wxStreamBuffer::SetBufferIO}{wxstreambuffersetbufferio}
 
-\membersection{wxStreamBuffer::Flushable}
+\membersection{wxStreamBuffer::Flushable}\label{wxstreambufferflushable}
 
 \func{void}{Flushable}{\param{bool}{ flushable}}
 
