1 % -----------------------------------------------------------------------------
3 % -----------------------------------------------------------------------------
4 \section{\class{wxStreamBase
}}\label{wxstreambase
}
6 This class is the base class of most stream related classes in wxWidgets. It must
9 \wxheading{Derived from
}
13 \wxheading{Include files
}
19 \helpref{wxStreamBuffer
}{wxstreambuffer
}
21 % -----------------------------------------------------------------------------
23 % -----------------------------------------------------------------------------
24 \latexignore{\rtfignore{\wxheading{Members
}}}
31 \membersection{wxStreamBase::wxStreamBase
}\label{wxstreambasector
}
33 \func{}{wxStreamBase
}{\void}
35 Creates a dummy stream object. It doesn't do anything.
38 \membersection{wxStreamBase::
\destruct{wxStreamBase
}}\label{wxstreambasedtor
}
40 \func{}{\destruct{wxStreamBase
}}{\void}
45 \membersection{wxStreamBase::GetLength
}\label{wxstreambasegetlength
}
47 \constfunc{wxFileOffset
}{GetLength
}{\void}
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
}.
56 \membersection{wxStreamBase::GetLastError
}\label{wxstreambasegetlasterror
}
58 \constfunc{wxStreamError
}{GetLastError
}{\void}
60 This function returns the last error.
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.
}
71 \membersection{wxStreamBase::GetSize
}\label{wxstreambasegetsize
}
73 \constfunc{size
\_t}{GetSize
}{\void}
75 \helpref{GetLength
}{wxstreambasegetlength
}
77 This function returns the size of the stream. For example, for a file it is the
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.
86 \membersection{wxStreamBase::IsOk
}\label{wxstreambaseisok
}
88 \constfunc{virtual bool
}{IsOk
}{\void}
90 Returns true if no error occurred on the stream.
94 \helpref{GetLastError
}{wxstreambasegetlasterror
}
97 \membersection{wxStreamBase::IsSeekable
}\label{wxstreambaseisseekable
}
99 \constfunc{bool
}{IsSeekable
}{\void}
101 Returns true if the streams supports seeking to arbitrary offsets.
104 \membersection{wxStreamBase::OnSysRead
}\label{wxstreambaseonsysread
}
106 \func{size
\_t}{OnSysRead
}{\param{void*
}{ buffer
},
\param{size
\_t}{ bufsize
}}
108 Internal function. It is called when the stream wants to read data of the
109 specified size. It should return the size that was actually read.
112 \membersection{wxStreamBase::OnSysSeek
}\label{wxstreambaseonsysseek
}
114 \func{off
\_t}{OnSysSeek
}{\param{off
\_t}{ pos
},
\param{wxSeekMode
}{ mode
}}
116 Internal function. It is called when the stream needs to change the
120 \membersection{wxStreamBase::OnSysTell
}\label{wxstreambaseonsystell
}
122 \constfunc{off
\_t}{OnSysTell
}{\void}
124 Internal function. Is is called when the stream needs to know the
128 \membersection{wxStreamBase::OnSysWrite
}\label{wxstreambaseonsyswrite
}
130 \func{size
\_t}{OnSysWrite
}{\param{const void *
}{buffer
},
\param{size
\_t}{ bufsize
}}
132 See
\helpref{OnSysRead
}{wxstreambaseonsysread
}.