Made wxGTK dataobj.cpp compile; removed flashing from wxGLCanvas samples;
[wxWidgets.git] / docs / latex / wx / stream.tex
1 \section{\class{wxStreamBuffer}}\label{wxstreambuf}
2
3 \wxheading{Derived from}
4
5 None
6
7 \wxheading{See also}
8
9 \helpref{wxStreamBase}{wxstreambase}
10
11 % ---------------------------------------------------------------------------
12 % Members
13 % ---------------------------------------------------------------------------
14 \latexignore{\rtfignore{\wxheading{Members}}}
15
16 % -----------
17 % ctor & dtor
18 % -----------
19 \membersection{wxStreamBuffer::wxStreamBuffer}
20
21 \func{}{wxStreamBuffer}{\param{wxStreamBase\&}{ stream}, \param{BufMode}{ mode}}
22
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.
26
27 \membersection{wxStreamBuffer::wxStreamBuffer}
28
29 \func{}{wxStreamBuffer}{\param{BufMode}{ mode}}
30
31 Constructor, creates a new empty stream buffer which won't flush any datas
32 to a stream. \it{mode} specifies the type of the buffer (read, write, read\_write).
33
34 \membersection{wxStreamBuffer::wxStreamBuffer}
35
36 \func{}{wxStreamBuffer}{\param{const wxStreamBase\&}{ buffer}}
37
38 Constructor, creates a new stream buffer from the specified stream \it{buffer}.
39
40 \membersection{wxStreamBuffer::\destruct{wxStreamBuffer}}
41
42 \func{}{\destruct{wxStreamBuffer}}
43
44 Destructor, destroys the stream buffer.
45
46 % -----------
47 % Filtered IO
48 % -----------
49 \membersection{wxStreamBuffer::Read}\label{wxstreambufread}
50
51 \func{size\_t}{Read}{\param{void *}{buffer}, \param{size\_t }{size}}
52
53 Reads a block of the specified \it{size} and stores datas in \it{buffer}.
54
55 \wxheading{Return value}
56
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{GetError}{wxstreambasegeterror}.
60
61 \membersection{wxStreamBuffer::Read}\label{wxstreambufreadbuf}
62
63 \func{size\_t}{Read}{\param{wxStreamBuffer *}{buffer}}
64
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.
67
68 \membersection{wxStreamBuffer::Write}
69
70 \func{size\_t}{Write}{\param{const void *}{buffer}, \param{size\_t }{size}}
71
72 Writes a block of the specified \it{size} using datas of \it{buffer}.
73
74 \membersection{wxStreamBuffer::Write}
75
76 \func{size\_t}{Write}{\param{wxStreamBuffer *}{buffer}}
77
78 See \helpref{Read}{wxstreambufreadbuf}
79
80 \membersection{wxStreamBuffer::WriteBack}
81
82 \func{size\_t}{WriteBack}{\param{const char*}{ buffer}, \param{size\_t}{ size}}
83
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.
87
88 \membersection{wxStreamBuffer::WriteBack}
89
90 \func{size\_t}{WriteBack}{\param{char }{c}}
91
92 As for the previous function, it puts the specified byte in the input queue of the
93 stream buffer.
94
95 \membersection{wxStreamBuffer::GetChar}
96
97 \func{char}{GetChar}{\void}
98
99 Gets a single char from the stream buffer.
100
101 \membersection{wxStreamBuffer::PutChar}
102
103 \func{void}{PutChar}{\param{char }{c}}
104
105 Puts a single char to the stream buffer.
106
107 \membersection{wxStreamBuffer::Tell}
108
109 \constfunc{off\_t}{Tell}{\void}
110
111 Gets the current position in the \it{stream}.
112
113 \membersection{wxStreamBuffer::Seek}
114
115 \func{off\_t}{Seek}{\param{off\_t }{pos}, \param{wxSeekMode }{mode}}
116
117 Changes the current position. (TODO)
118
119 % --------------
120 % Buffer control
121 % --------------
122 \membersection{wxStreamBuffer::ResetBuffer}
123
124 \func{void}{ResetBuffer}{\void}
125
126 Frees all internal buffers and resets to initial state all variables.
127
128 \membersection{wxStreamBuffer::SetBufferIO}
129
130 \func{void}{SetBufferIO}{\param{char*}{ buffer\_start}, \param{char*}{ buffer\_end}}
131
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.
134
135 \membersection{wxStreamBuffer::SetBufferIO}
136
137 \func{void}{SetBufferIO}{\param{size\_t}{ bufsize}}
138
139 Changes the size of the current IO buffer.
140
141 \membersection{wxStreamBuffer::GetBufferStart}
142
143 \constfunc{char *}{GetBufferStart}{\void}
144
145 Returns a pointer on the start of the stream buffer.
146
147 \membersection{wxStreamBuffer::GetBufferEnd}
148
149 \constfunc{char *}{GetBufferEnd}{\void}
150
151 Returns a pointer on the end of the stream buffer.
152
153 \membersection{wxStreamBuffer::GetBufferPos}
154
155 \constfunc{char *}{GetBufferPos}{\void}
156
157 Returns a pointer on the current position of the stream buffer.
158
159 \membersection{wxStreamBuffer::GetIntPosition}
160
161 \constfunc{off\_t}{GetIntPosition}{\void}
162
163 Returns the current position in the stream buffer.
164
165 \membersection{wxStreamBuffer::SetIntPosition}
166
167 \func{void}{SetIntPosition}{\void}
168
169 Sets the current position in the stream buffer.
170
171 \membersection{wxStreamBuffer::GetLastAccess}
172
173 \constfunc{size\_t}{GetLastAccess}{\void}
174
175 Returns the amount of bytes read during the last IO call to the parent stream.
176
177 \membersection{wxStreamBuffer::Fixed}
178
179 \func{void}{Fixed}{\param{bool}{ fixed}}
180
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.
184
185 \membersection{wxStreamBuffer::Flushable}
186
187 \func{void}{Flushable}{\param{bool}{ flushable}}
188
189 Toggles the flushable flag. If \it{flushable} is disabled, no datas are sent
190 to the parent stream.
191
192 \membersection{wxStreamBuffer::FlushBuffer}
193
194 \func{bool}{FlushBuffer}{\void}
195
196 Flushes the IO buffer.
197
198 \membersection{wxStreamBuffer::FillBuffer}
199
200 \func{bool}{FillBuffer}{\void}
201
202 Fill the IO buffer.
203
204 \membersection{wxStreamBuffer::GetDataLeft}
205
206 \func{size\_t}{GetDataLeft}{\void}
207
208 Returns the amount of available datas in the buffer.
209
210 % --------------
211 % Administration
212 % --------------
213 \membersection{wxStreamBuffer::Stream}
214
215 \func{wxStreamBase*}{Stream}{\void}
216
217 Returns the stream parent of the stream buffer.
218