]>
Commit | Line | Data |
---|---|---|
e2a6f233 JS |
1 | % ----------------------------------------------------------------------------- |
2 | % wxInputStream | |
3 | % ----------------------------------------------------------------------------- | |
4 | \section{\class{wxInputStream}}\label{wxinputstream} | |
5 | ||
d984207c RR |
6 | wxInputStream is an abstract base class which may not be used directly. |
7 | ||
e2a6f233 JS |
8 | \wxheading{Derived from} |
9 | ||
10 | \helpref{wxStreamBase}{wxstreambase} | |
11 | ||
954b8ae6 JS |
12 | \wxheading{Include files} |
13 | ||
14 | <wx/stream.h> | |
15 | ||
e2a6f233 JS |
16 | % ----------- |
17 | % ctor & dtor | |
18 | % ----------- | |
19 | \membersection{wxInputStream::wxInputStream} | |
20 | ||
21 | \func{}{wxInputStream}{\void} | |
22 | ||
23 | Creates a dummy input stream. | |
24 | ||
e2a6f233 JS |
25 | \membersection{wxInputStream::\destruct{wxInputStream}} |
26 | ||
27 | \func{}{\destruct{wxInputStream}}{\void} | |
28 | ||
29 | Destructor. | |
30 | ||
e2a6f233 JS |
31 | \membersection{wxInputStream::GetC} |
32 | ||
33 | \func{char}{GetC}{\void} | |
34 | ||
35 | Returns the first character in the input queue and removes it. | |
36 | ||
cd6ce4a9 VZ |
37 | \membersection{wxInputStream::Eof}\label{wxinputstreameof} |
38 | ||
39 | \constfunc{wxInputStream}{Eof}{\void} | |
40 | ||
41 | Returns TRUE if the end of stream has been reached. | |
42 | ||
39b91eca | 43 | \membersection{wxInputStream::LastRead}\label{wxinputstreamlastread} |
40b480c3 JS |
44 | |
45 | \constfunc{size\_t}{LastRead}{\void} | |
46 | ||
47 | Returns the last number of bytes read. | |
48 | ||
49 | \membersection{wxInputStream::Peek} | |
50 | ||
51 | \func{char}{Peek}{\void} | |
52 | ||
53 | Returns the first character in the input queue without removing it. | |
54 | ||
e2a6f233 JS |
55 | \membersection{wxInputStream::Read} |
56 | ||
40b480c3 | 57 | \func{wxInputStream\&}{Read}{\param{void *}{buffer}, \param{size\_t}{ size}} |
e2a6f233 | 58 | |
605d715d | 59 | Reads the specified amount of bytes and stores the data in {\it buffer}. |
e2a6f233 | 60 | |
da3aea64 GL |
61 | \wxheading{Warning} |
62 | ||
63 | The buffer absolutely needs to have at least the specified size. | |
64 | ||
65 | \wxheading{Return value} | |
e2a6f233 JS |
66 | |
67 | This function returns a reference on the current object, so the user can test | |
68 | any states of the stream right away. | |
69 | ||
294e9a7a | 70 | \func{wxInputStream\&}{Read}{\param{wxOutputStream\&}{ stream\_out}} |
e2a6f233 JS |
71 | |
72 | Reads data from the input queue and stores it in the specified output stream. | |
73 | The data is read until an error is raised by one of the two streams. | |
74 | ||
da3aea64 GL |
75 | \wxheading{Return value} |
76 | ||
77 | This function returns a reference on the current object, so the user can test | |
78 | any states of the stream right away. | |
79 | ||
e2a6f233 JS |
80 | \membersection{wxInputStream::SeekI} |
81 | ||
40b480c3 | 82 | \func{off\_t}{SeekI}{\param{off\_t}{ pos}, \param{wxSeekMode}{ mode = wxFromStart}} |
e2a6f233 JS |
83 | |
84 | Changes the stream current position. | |
85 | ||
86 | \membersection{wxInputStream::TellI} | |
87 | ||
40b480c3 | 88 | \constfunc{off\_t}{TellI}{\void} |
e2a6f233 JS |
89 | |
90 | Returns the current stream position. | |
91 | ||
c7d9131a GL |
92 | \membersection{wxInputStream::Ungetch}\label{wxinputstream_ungetch} |
93 | ||
94 | \func{size\_t}{Ungetch}{\param{const char*}{ buffer}, \param{size\_t}{ size}} | |
95 | ||
605d715d | 96 | This function is only useful in {\it read} mode. It is the manager of the "Write-Back" |
c7d9131a GL |
97 | buffer. This buffer acts like a temporary buffer where datas which has to be |
98 | read during the next read IO call are put. This is useful when you get a big | |
99 | block of data which you didn't want to read: you can replace them at the top | |
100 | of the input queue by this way. | |
101 | ||
d984207c RR |
102 | Be very careful about this call in connection with calling SeekI() on the same |
103 | stream. Any call to SeekI() will invalidate any previous call to this method | |
104 | (otherwise you could SeekI() to one position, "unread" a few bytes there, SeekI() | |
105 | to another position and data would be either lost or corrupted). | |
106 | ||
c7d9131a GL |
107 | \wxheading{Return value} |
108 | ||
109 | Returns the amount of bytes saved in the Write-Back buffer. | |
110 | ||
111 | \func{bool}{Ungetch}{\param{char }{c}} | |
112 | ||
113 | This function acts like the previous one except that it takes only one | |
114 | character: it is sometimes shorter to use than the generic function. | |
115 |