]>
Commit | Line | Data |
---|---|---|
e2a6f233 JS |
1 | % ----------------------------------------------------------------------------- |
2 | % wxStreamBase | |
3 | % ----------------------------------------------------------------------------- | |
4 | \section{\class{wxStreamBase}}\label{wxstreambase} | |
5 | ||
fc2171bd | 6 | This class is the base class of most stream related classes in wxWidgets. It must |
7468b994 RR |
7 | not be used directly. |
8 | ||
e2a6f233 JS |
9 | \wxheading{Derived from} |
10 | ||
11 | None | |
12 | ||
954b8ae6 JS |
13 | \wxheading{Include files} |
14 | ||
15 | <wx/stream.h> | |
16 | ||
e2a6f233 JS |
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 | ||
588066b7 | 30 | |
15d83f72 | 31 | \membersection{wxStreamBase::wxStreamBase}\label{wxstreambasector} |
e2a6f233 JS |
32 | |
33 | \func{}{wxStreamBase}{\void} | |
34 | ||
da3aea64 | 35 | Creates a dummy stream object. It doesn't do anything. |
e2a6f233 | 36 | |
588066b7 | 37 | |
15d83f72 | 38 | \membersection{wxStreamBase::\destruct{wxStreamBase}}\label{wxstreambasedtor} |
e2a6f233 JS |
39 | |
40 | \func{}{\destruct{wxStreamBase}}{\void} | |
41 | ||
42 | Destructor. | |
43 | ||
cd6ce4a9 | 44 | |
588066b7 | 45 | \membersection{wxStreamBase::GetLength}\label{wxstreambasegetlength} |
cd6ce4a9 | 46 | |
588066b7 | 47 | \constfunc{wxFileOffset}{GetLength}{\void} |
cd6ce4a9 | 48 | |
588066b7 | 49 | Returns the length of the stream in bytes. If the length cannot be determined |
dceb1c09 | 50 | (this is always the case for socket streams for example), returns |
588066b7 VZ |
51 | \texttt{wxInvalidOffset}. |
52 | ||
53 | \newsince{2.5.4} | |
cd6ce4a9 | 54 | |
cd6ce4a9 | 55 | |
b919fd47 | 56 | \membersection{wxStreamBase::GetLastError}\label{wxstreambasegetlasterror} |
e2a6f233 | 57 | |
b919fd47 | 58 | \constfunc{wxStreamError}{GetLastError}{\void} |
e2a6f233 JS |
59 | |
60 | This function returns the last error. | |
fa482912 | 61 | |
07b73270 GL |
62 | \twocolwidtha{5cm} |
63 | \begin{twocollist}\itemsep=0pt | |
f6bcfd97 BP |
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.} | |
07b73270 | 68 | \end{twocollist} |
e2a6f233 | 69 | |
588066b7 VZ |
70 | |
71 | \membersection{wxStreamBase::GetSize}\label{wxstreambasegetsize} | |
72 | ||
73 | \constfunc{size\_t}{GetSize}{\void} | |
74 | ||
348f211c | 75 | \helpref{GetLength}{wxstreambasegetlength} |
588066b7 VZ |
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 | ||
9a75ba66 | 88 | \constfunc{bool}{IsOk}{\void} |
588066b7 VZ |
89 | |
90 | Returns true if no error occurred on the stream. | |
91 | ||
92 | \wxheading{See also} | |
93 | ||
94 | \helpref{GetLastError}{wxstreambasegetlasterror} | |
95 | ||
96 | ||
3c70014d MW |
97 | \membersection{wxStreamBase::IsSeekable}\label{wxstreambaseisok} |
98 | ||
99 | \constfunc{bool}{IsSeekable}{\void} | |
100 | ||
101 | Returns true if the streams supports seeking to arbitrary offsets. | |
102 | ||
103 | ||
e2a6f233 JS |
104 | \membersection{wxStreamBase::OnSysRead}\label{wxstreambaseonsysread} |
105 | ||
40b480c3 | 106 | \func{size\_t}{OnSysRead}{\param{void*}{ buffer}, \param{size\_t}{ bufsize}} |
e2a6f233 | 107 | |
7468b994 | 108 | Internal function. It is called when the stream wants to read data of the |
e2a6f233 JS |
109 | specified size. It should return the size that was actually read. |
110 | ||
588066b7 | 111 | |
15d83f72 | 112 | \membersection{wxStreamBase::OnSysSeek}\label{wxstreambaseonsysseek} |
e2a6f233 | 113 | |
40b480c3 | 114 | \func{off\_t}{OnSysSeek}{\param{off\_t}{ pos}, \param{wxSeekMode}{ mode}} |
e2a6f233 | 115 | |
7468b994 RR |
116 | Internal function. It is called when the stream needs to change the |
117 | current position. | |
e2a6f233 | 118 | |
588066b7 | 119 | |
15d83f72 | 120 | \membersection{wxStreamBase::OnSysTell}\label{wxstreambaseonsystell} |
e2a6f233 | 121 | |
40b480c3 | 122 | \constfunc{off\_t}{OnSysTell}{\void} |
e2a6f233 | 123 | |
7468b994 RR |
124 | Internal function. Is is called when the stream needs to know the |
125 | real position. | |
e2a6f233 | 126 | |
588066b7 | 127 | |
15d83f72 | 128 | \membersection{wxStreamBase::OnSysWrite}\label{wxstreambaseonsyswrite} |
40b480c3 JS |
129 | |
130 | \func{size\_t}{OnSysWrite}{\param{void *}{buffer}, \param{size\_t}{ bufsize}} | |
131 | ||
132 | See \helpref{OnSysRead}{wxstreambaseonsysread}. | |
133 |