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