1 \section{\class{wxStreamBuffer
}}\label{wxstreambuffer
}
3 \wxheading{Derived from
}
9 \helpref{wxStreamBase
}{wxstreambase
}
11 % ---------------------------------------------------------------------------
13 % ---------------------------------------------------------------------------
14 \latexignore{\rtfignore{\wxheading{Members
}}}
19 \membersection{wxStreamBuffer::wxStreamBuffer
}
21 \func{}{wxStreamBuffer
}{\param{wxStreamBase\&
}{ stream
},
\param{BufMode
}{ mode
}}
23 Constructor, creates a new stream buffer using
\it{stream
} as a parent stream
24 and
\it{mode
} as the IO mode.
\it{mode
} can be: wxStreamBuffer::read,
25 wxStreamBuffer::write, wxStreamBuffer::read
\_write.
27 \membersection{wxStreamBuffer::wxStreamBuffer
}
29 \func{}{wxStreamBuffer
}{\param{BufMode
}{ mode
}}
31 Constructor, creates a new empty stream buffer which won't flush any data
32 to a stream.
\it{mode
} specifies the type of the buffer (read, write, read
\_write).
34 \membersection{wxStreamBuffer::wxStreamBuffer
}
36 \func{}{wxStreamBuffer
}{\param{const wxStreamBase\&
}{ buffer
}}
38 Constructor, creates a new stream buffer from the specified stream
\it{buffer
}.
40 \membersection{wxStreamBuffer::
\destruct{wxStreamBuffer
}}
42 \func{}{wxStreamBuffer
}{\destruct{wxStreamBuffer
}}
44 Destructor, destroys the stream buffer.
49 \membersection{wxStreamBuffer::Read
}\label{wxstreambufread
}
51 \func{size
\_t}{Read
}{\param{void *
}{buffer
},
\param{size
\_t }{size
}}
53 Reads a block of the specified
\it{size
} and stores datas in
\it{buffer
}.
55 \wxheading{Return value
}
57 It returns the real read size. If returned size is different of the specified
58 \it{size
}, an error occured and should be tested using
59 \helpref{LastError
}{wxstreambaselasterror
}.
61 \membersection{wxStreamBuffer::Read
}\label{wxstreambufreadbuf
}
63 \func{size
\_t}{Read
}{\param{wxStreamBuffer *
}{buffer
}}
65 Reads a
\it{buffer
}. The function returns when
\it{buffer
} is full or
66 when there aren't datas anymore in the current buffer.
68 \membersection{wxStreamBuffer::Write
}
70 \func{size
\_t}{Write
}{\param{const void *
}{buffer
},
\param{size
\_t }{size
}}
72 Writes a block of the specified
\it{size
} using datas of
\it{buffer
}.
74 \membersection{wxStreamBuffer::Write
}
76 \func{size
\_t}{Write
}{\param{wxStreamBuffer *
}{buffer
}}
78 See
\helpref{Read
}{wxstreambufreadbuf
}
80 \membersection{wxStreamBuffer::WriteBack
}
82 \func{size
\_t}{WriteBack
}{\param{const char*
}{ buffer
},
\param{size
\_t}{ size
}}
84 This function is only useful in ``read'' mode. It puts the specified
\it{buffer
}
85 in the input queue of the stream buf. By this way, the next
86 \helpref{Read
}{wxstreambufread
} call will first use these datas.
88 \membersection{wxStreamBuffer::WriteBack
}
90 \func{size
\_t}{WriteBack
}{\param{char
}{c
}}
92 As for the previous function, it puts the specified byte in the input queue of the
95 \membersection{wxStreamBuffer::GetChar
}
97 \func{char
}{GetChar
}{\void}
99 Gets a single char from the stream buffer.
101 \membersection{wxStreamBuffer::PutChar
}
103 \func{void
}{PutChar
}{\param{char
}{c
}}
105 Puts a single char to the stream buffer.
107 \membersection{wxStreamBuffer::Tell
}
109 \constfunc{off
\_t}{Tell
}{\void}
111 Gets the current position in the
\it{stream
}.
113 \membersection{wxStreamBuffer::Seek
}\label{wxstreambufferseek
}
115 \func{off
\_t}{Seek
}{\param{off
\_t }{pos
},
\param{wxSeekMode
}{mode
}}
117 Changes the current position. (TODO)
122 \membersection{wxStreamBuffer::ResetBuffer
}
124 \func{void
}{ResetBuffer
}{\void}
126 Frees all internal buffers and resets to initial state all variables.
128 \membersection{wxStreamBuffer::SetBufferIO
}
130 \func{void
}{SetBufferIO
}{\param{char*
}{ buffer
\_start},
\param{char*
}{ buffer
\_end}}
132 Specifies which pointers to use for stream buffering. You need to pass a pointer on the
133 start of the buffer end and another on the end.
135 \membersection{wxStreamBuffer::SetBufferIO
}
137 \func{void
}{SetBufferIO
}{\param{size
\_t}{ bufsize
}}
139 Changes the size of the current IO buffer.
141 \membersection{wxStreamBuffer::GetBufferStart
}
143 \constfunc{char *
}{GetBufferStart
}{\void}
145 Returns a pointer on the start of the stream buffer.
147 \membersection{wxStreamBuffer::GetBufferEnd
}
149 \constfunc{char *
}{GetBufferEnd
}{\void}
151 Returns a pointer on the end of the stream buffer.
153 \membersection{wxStreamBuffer::GetBufferPos
}
155 \constfunc{char *
}{GetBufferPos
}{\void}
157 Returns a pointer on the current position of the stream buffer.
159 \membersection{wxStreamBuffer::GetIntPosition
}
161 \constfunc{off
\_t}{GetIntPosition
}{\void}
163 Returns the current position in the stream buffer.
165 \membersection{wxStreamBuffer::SetIntPosition
}
167 \func{void
}{SetIntPosition
}{\void}
169 Sets the current position in the stream buffer.
171 \membersection{wxStreamBuffer::GetLastAccess
}
173 \constfunc{size
\_t}{GetLastAccess
}{\void}
175 Returns the amount of bytes read during the last IO call to the parent stream.
177 \membersection{wxStreamBuffer::Fixed
}
179 \func{void
}{Fixed
}{\param{bool
}{ fixed
}}
181 Toggles the fixed flag. Usually this flag is toggled at the same time as
182 \it{flushable
}. This flag allows (when it is FALSE) or forbids (when it is TRUE)
183 the stream buffer to resize dynamically the IO buffer.
185 \membersection{wxStreamBuffer::Flushable
}
187 \func{void
}{Flushable
}{\param{bool
}{ flushable
}}
189 Toggles the flushable flag. If
\it{flushable
} is disabled, no datas are sent
190 to the parent stream.
192 \membersection{wxStreamBuffer::FlushBuffer
}
194 \func{bool
}{FlushBuffer
}{\void}
196 Flushes the IO buffer.
198 \membersection{wxStreamBuffer::FillBuffer
}
200 \func{bool
}{FillBuffer
}{\void}
204 \membersection{wxStreamBuffer::GetDataLeft
}
206 \func{size
\_t}{GetDataLeft
}{\void}
208 Returns the amount of available datas in the buffer.
213 \membersection{wxStreamBuffer::Stream
}
215 \func{wxStreamBase*
}{Stream
}{\void}
217 Returns the stream parent of the stream buffer.