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{wxBase
}{librarieslist
}
23 \helpref{wxStreamBuffer
}{wxstreambuffer
}
25 % -----------------------------------------------------------------------------
27 % -----------------------------------------------------------------------------
28 \latexignore{\rtfignore{\wxheading{Members
}}}
35 \membersection{wxStreamBase::wxStreamBase
}\label{wxstreambasector
}
37 \func{}{wxStreamBase
}{\void}
39 Creates a dummy stream object. It doesn't do anything.
42 \membersection{wxStreamBase::
\destruct{wxStreamBase
}}\label{wxstreambasedtor
}
44 \func{}{\destruct{wxStreamBase
}}{\void}
49 \membersection{wxStreamBase::GetLength
}\label{wxstreambasegetlength
}
51 \constfunc{wxFileOffset
}{GetLength
}{\void}
53 Returns the length of the stream in bytes. If the length cannot be determined
54 (this is always the case for socket streams for example), returns
55 \texttt{wxInvalidOffset
}.
60 \membersection{wxStreamBase::GetLastError
}\label{wxstreambasegetlasterror
}
62 \constfunc{wxStreamError
}{GetLastError
}{\void}
64 This function returns the last error.
67 \begin{twocollist
}\itemsep=
0pt
68 \twocolitem{{\bf wxSTREAM
\_NO\_ERROR}}{No error occurred.
}
69 \twocolitem{{\bf wxSTREAM
\_EOF}}{An End-Of-File occurred.
}
70 \twocolitem{{\bf wxSTREAM
\_WRITE\_ERROR}}{A generic error occurred on the last write call.
}
71 \twocolitem{{\bf wxSTREAM
\_READ\_ERROR}}{A generic error occurred on the last read call.
}
75 \membersection{wxStreamBase::GetSize
}\label{wxstreambasegetsize
}
77 \constfunc{size
\_t}{GetSize
}{\void}
79 \helpref{GetLength
}{wxstreambasegetlength
}
81 This function returns the size of the stream. For example, for a file it is the
86 There are streams which do not have size by definition, such as socket streams.
87 In that cases, GetSize returns $
0$ so you should always test its return value.
90 \membersection{wxStreamBase::IsOk
}\label{wxstreambaseisok
}
92 \constfunc{virtual bool
}{IsOk
}{\void}
94 Returns true if no error occurred on the stream.
98 \helpref{GetLastError
}{wxstreambasegetlasterror
}
101 \membersection{wxStreamBase::IsSeekable
}\label{wxstreambaseisseekable
}
103 \constfunc{bool
}{IsSeekable
}{\void}
105 Returns true if the streams supports seeking to arbitrary offsets.
108 \membersection{wxStreamBase::OnSysRead
}\label{wxstreambaseonsysread
}
110 \func{size
\_t}{OnSysRead
}{\param{void*
}{ buffer
},
\param{size
\_t}{ bufsize
}}
112 Internal function. It is called when the stream wants to read data of the
113 specified size. It should return the size that was actually read.
116 \membersection{wxStreamBase::OnSysSeek
}\label{wxstreambaseonsysseek
}
118 \func{off
\_t}{OnSysSeek
}{\param{off
\_t}{ pos
},
\param{wxSeekMode
}{ mode
}}
120 Internal function. It is called when the stream needs to change the
124 \membersection{wxStreamBase::OnSysTell
}\label{wxstreambaseonsystell
}
126 \constfunc{off
\_t}{OnSysTell
}{\void}
128 Internal function. Is is called when the stream needs to know the
132 \membersection{wxStreamBase::OnSysWrite
}\label{wxstreambaseonsyswrite
}
134 \func{size
\_t}{OnSysWrite
}{\param{const void *
}{buffer
},
\param{size
\_t}{ bufsize
}}
136 See
\helpref{OnSysRead
}{wxstreambaseonsysread
}.