]>
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 VZ |
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} | |
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 | ||
e2a6f233 JS |
97 | \membersection{wxStreamBase::OnSysRead}\label{wxstreambaseonsysread} |
98 | ||
40b480c3 | 99 | \func{size\_t}{OnSysRead}{\param{void*}{ buffer}, \param{size\_t}{ bufsize}} |
e2a6f233 | 100 | |
7468b994 | 101 | Internal function. It is called when the stream wants to read data of the |
e2a6f233 JS |
102 | specified size. It should return the size that was actually read. |
103 | ||
588066b7 | 104 | |
15d83f72 | 105 | \membersection{wxStreamBase::OnSysSeek}\label{wxstreambaseonsysseek} |
e2a6f233 | 106 | |
40b480c3 | 107 | \func{off\_t}{OnSysSeek}{\param{off\_t}{ pos}, \param{wxSeekMode}{ mode}} |
e2a6f233 | 108 | |
7468b994 RR |
109 | Internal function. It is called when the stream needs to change the |
110 | current position. | |
e2a6f233 | 111 | |
588066b7 | 112 | |
15d83f72 | 113 | \membersection{wxStreamBase::OnSysTell}\label{wxstreambaseonsystell} |
e2a6f233 | 114 | |
40b480c3 | 115 | \constfunc{off\_t}{OnSysTell}{\void} |
e2a6f233 | 116 | |
7468b994 RR |
117 | Internal function. Is is called when the stream needs to know the |
118 | real position. | |
e2a6f233 | 119 | |
588066b7 | 120 | |
15d83f72 | 121 | \membersection{wxStreamBase::OnSysWrite}\label{wxstreambaseonsyswrite} |
40b480c3 JS |
122 | |
123 | \func{size\_t}{OnSysWrite}{\param{void *}{buffer}, \param{size\_t}{ bufsize}} | |
124 | ||
125 | See \helpref{OnSysRead}{wxstreambaseonsysread}. | |
126 | ||
40b480c3 | 127 |