]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/strmbase.tex
Bug 1099143 and more occurences of the same set vs. get mistakes.
[wxWidgets.git] / docs / latex / wx / strmbase.tex
1 % -----------------------------------------------------------------------------
2 % wxStreamBase
3 % -----------------------------------------------------------------------------
4 \section{\class{wxStreamBase}}\label{wxstreambase}
5
6 This class is the base class of most stream related classes in wxWidgets. It must
7 not be used directly.
8
9 \wxheading{Derived from}
10
11 None
12
13 \wxheading{Include files}
14
15 <wx/stream.h>
16
17 \wxheading{See also}
18
19 \helpref{wxStreamBuffer}{wxstreambuffer}
20
21 % -----------------------------------------------------------------------------
22 % Members
23 % -----------------------------------------------------------------------------
24 \latexignore{\rtfignore{\wxheading{Members}}}
25
26 % -----------
27 % ctor & dtor
28 % -----------
29
30
31 \membersection{wxStreamBase::wxStreamBase}\label{wxstreambasector}
32
33 \func{}{wxStreamBase}{\void}
34
35 Creates a dummy stream object. It doesn't do anything.
36
37
38 \membersection{wxStreamBase::\destruct{wxStreamBase}}\label{wxstreambasedtor}
39
40 \func{}{\destruct{wxStreamBase}}{\void}
41
42 Destructor.
43
44
45 \membersection{wxStreamBase::GetLength}\label{wxstreambasegetlength}
46
47 \constfunc{wxFileOffset}{GetLength}{\void}
48
49 Returns the length of the stream in bytes. If the length cannot be determined
50 (this is always the case for socket streams for example), returns
51 \texttt{wxInvalidOffset}.
52
53 \newsince{2.5.4}
54
55
56 \membersection{wxStreamBase::GetLastError}\label{wxstreambasegetlasterror}
57
58 \constfunc{wxStreamError}{GetLastError}{\void}
59
60 This function returns the last error.
61
62 \twocolwidtha{5cm}
63 \begin{twocollist}\itemsep=0pt
64 \twocolitem{{\bf wxSTREAM\_NO\_ERROR}}{No error occurred.}
65 \twocolitem{{\bf wxSTREAM\_EOF}}{An End-Of-File occurred.}
66 \twocolitem{{\bf wxSTREAM\_WRITE\_ERROR}}{A generic error occurred on the last write call.}
67 \twocolitem{{\bf wxSTREAM\_READ\_ERROR}}{A generic error occurred on the last read call.}
68 \end{twocollist}
69
70
71 \membersection{wxStreamBase::GetSize}\label{wxstreambasegetsize}
72
73 \constfunc{size\_t}{GetSize}{\void}
74
75 \helpref{GetLength}{wxstreambasegetlength}
76
77 This function returns the size of the stream. For example, for a file it is the
78 size of the file.
79
80 \wxheading{Warning}
81
82 There are streams which do not have size by definition, such as socket streams.
83 In that cases, GetSize returns $0$ so you should always test its return value.
84
85
86 \membersection{wxStreamBase::IsOk}\label{wxstreambaseisok}
87
88 \constfunc{wxStreamError}{IsOk}{\void}
89
90 Returns true if no error occurred on the stream.
91
92 \wxheading{See also}
93
94 \helpref{GetLastError}{wxstreambasegetlasterror}
95
96
97 \membersection{wxStreamBase::OnSysRead}\label{wxstreambaseonsysread}
98
99 \func{size\_t}{OnSysRead}{\param{void*}{ buffer}, \param{size\_t}{ bufsize}}
100
101 Internal function. It is called when the stream wants to read data of the
102 specified size. It should return the size that was actually read.
103
104
105 \membersection{wxStreamBase::OnSysSeek}\label{wxstreambaseonsysseek}
106
107 \func{off\_t}{OnSysSeek}{\param{off\_t}{ pos}, \param{wxSeekMode}{ mode}}
108
109 Internal function. It is called when the stream needs to change the
110 current position.
111
112
113 \membersection{wxStreamBase::OnSysTell}\label{wxstreambaseonsystell}
114
115 \constfunc{off\_t}{OnSysTell}{\void}
116
117 Internal function. Is is called when the stream needs to know the
118 real position.
119
120
121 \membersection{wxStreamBase::OnSysWrite}\label{wxstreambaseonsyswrite}
122
123 \func{size\_t}{OnSysWrite}{\param{void *}{buffer}, \param{size\_t}{ bufsize}}
124
125 See \helpref{OnSysRead}{wxstreambaseonsysread}.
126
127