1 % -----------------------------------------------------------------------------
3 % -----------------------------------------------------------------------------
4 \section{\class{wxInputStream
}}\label{wxinputstream
}
6 wxInputStream is an abstract base class which may not be used directly.
8 \wxheading{Derived from
}
10 \helpref{wxStreamBase
}{wxstreambase
}
12 \wxheading{Include files
}
16 \latexignore{\rtfignore{\wxheading{Members
}}}
21 \membersection{wxInputStream::wxInputStream
}
23 \func{}{wxInputStream
}{\void}
25 Creates a dummy input stream.
27 \membersection{wxInputStream::
\destruct{wxInputStream
}}
29 \func{}{\destruct{wxInputStream
}}{\void}
33 \membersection{wxInputStream::GetC
}
35 \func{char
}{GetC
}{\void}
37 Returns the first character in the input queue and removes it,
38 blocking until it appears if necessary.
42 If EOF, return value is undefined and LastRead() will return
0 and not
1.
44 \membersection{wxInputStream::Eof
}\label{wxinputstreameof
}
46 \constfunc{wxInputStream
}{Eof
}{\void}
48 Returns true if the end of stream has been reached.
52 This cannot be really implemented for all streams and CanRead() is more
55 \membersection{wxInputStream::LastRead
}\label{wxinputstreamlastread
}
57 \constfunc{size
\_t}{LastRead
}{\void}
59 Returns the last number of bytes read.
61 \membersection{wxInputStream::Peek
}
63 \func{char
}{Peek
}{\void}
65 Returns the first character in the input queue without removing it.
69 Blocks until something appears in the stream if necessary, if nothing
70 ever does (i.e. EOF) LastRead() will return
0 (and the return value is
71 undefined), otherwise LastRead() returns
1.
73 \membersection{wxInputStream::Read
}
75 \func{wxInputStream\&
}{Read
}{\param{void *
}{buffer
},
\param{size
\_t}{ size
}}
77 Reads the specified amount of bytes and stores the data in
{\it buffer
}.
81 The buffer absolutely needs to have at least the specified size.
83 \wxheading{Return value
}
85 This function returns a reference on the current object, so the user can test
86 any states of the stream right away.
88 \func{wxInputStream\&
}{Read
}{\param{wxOutputStream\&
}{ stream
\_out}}
90 Reads data from the input queue and stores it in the specified output stream.
91 The data is read until an error is raised by one of the two streams.
93 \wxheading{Return value
}
95 This function returns a reference on the current object, so the user can test
96 any states of the stream right away.
98 \membersection{wxInputStream::SeekI
}\label{wxinputstreamseeki
}
100 \func{off
\_t}{SeekI
}{\param{off
\_t}{ pos
},
\param{wxSeekMode
}{ mode = wxFromStart
}}
102 Changes the stream current position.
104 \wxheading{Parameters
}
106 \docparam{pos
}{Offset to seek to.
}
108 \docparam{mode
}{One of
{\bf wxFromStart
},
{\bf wxFromEnd
},
{\bf wxFromCurrent
}.
}
110 \wxheading{Return value
}
112 The new stream position or wxInvalidOffset on error.
114 \membersection{wxInputStream::TellI
}
116 \constfunc{off
\_t}{TellI
}{\void}
118 Returns the current stream position.
120 \membersection{wxInputStream::Ungetch
}\label{wxinputstreamungetch
}
122 \func{size
\_t}{Ungetch
}{\param{const char*
}{ buffer
},
\param{size
\_t}{ size
}}
124 This function is only useful in
{\it read
} mode. It is the manager of the "Write-Back"
125 buffer. This buffer acts like a temporary buffer where data which has to be
126 read during the next read IO call are put. This is useful when you get a big
127 block of data which you didn't want to read: you can replace them at the top
128 of the input queue by this way.
130 Be very careful about this call in connection with calling SeekI() on the same
131 stream. Any call to SeekI() will invalidate any previous call to this method
132 (otherwise you could SeekI() to one position, "unread" a few bytes there, SeekI()
133 to another position and data would be either lost or corrupted).
135 \wxheading{Return value
}
137 Returns the amount of bytes saved in the Write-Back buffer.
139 \func{bool
}{Ungetch
}{\param{char
}{c
}}
141 This function acts like the previous one except that it takes only one
142 character: it is sometimes shorter to use than the generic function.