1 | /*
|
---|
2 | * Copyright (c) 2017 Jaroslav Jindrak
|
---|
3 | * All rights reserved.
|
---|
4 | *
|
---|
5 | * Redistribution and use in source and binary forms, with or without
|
---|
6 | * modification, are permitted provided that the following conditions
|
---|
7 | * are met:
|
---|
8 | *
|
---|
9 | * - Redistributions of source code must retain the above copyright
|
---|
10 | * notice, this list of conditions and the following disclaimer.
|
---|
11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
12 | * notice, this list of conditions and the following disclaimer in the
|
---|
13 | * documentation and/or other materials provided with the distribution.
|
---|
14 | * - The name of the author may not be used to endorse or promote products
|
---|
15 | * derived from this software without specific prior written permission.
|
---|
16 | *
|
---|
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
27 | */
|
---|
28 |
|
---|
29 | #ifndef LIBCPP_STREAMBUF
|
---|
30 | #define LIBCPP_STREAMBUF
|
---|
31 |
|
---|
32 | #include <ios>
|
---|
33 | #include <iosfwd>
|
---|
34 | #include <locale>
|
---|
35 |
|
---|
36 | namespace std
|
---|
37 | {
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * 27.6.3, class template basic_streambuf:
|
---|
41 | */
|
---|
42 |
|
---|
43 | template<class Char, class Traits = character_traits<Char>>
|
---|
44 | class basic_streambuf
|
---|
45 | {
|
---|
46 | public:
|
---|
47 | using traits_type = Traits;
|
---|
48 | using char_type = Char;
|
---|
49 | using int_type = typename traits_type::int_type;
|
---|
50 | using pos_type = typename traits_type::pos_type;
|
---|
51 | using off_type = typename traits_type::off_type;
|
---|
52 |
|
---|
53 | virtual ~basic_streambuf()
|
---|
54 | {
|
---|
55 | // TODO: implement
|
---|
56 | }
|
---|
57 |
|
---|
58 | /**
|
---|
59 | * 27.6.3.2.1, locales:
|
---|
60 | */
|
---|
61 |
|
---|
62 | locale pubimbue(const locale& loc)
|
---|
63 | {
|
---|
64 | // TODO: implement
|
---|
65 | }
|
---|
66 |
|
---|
67 | locale& getloc() const
|
---|
68 | {
|
---|
69 | // TODO: implement
|
---|
70 | }
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * 27.6.3.2.2, buffer and positioning:
|
---|
74 | */
|
---|
75 |
|
---|
76 | basic_streambuf<Char, Traits>* pubsetbuf(char_type* s, streamsize n)
|
---|
77 | {
|
---|
78 | // TODO: implement
|
---|
79 | }
|
---|
80 |
|
---|
81 | pos_type pubseekoff(off_type off, ios_base::seekdir way,
|
---|
82 | ios_base::openmode which = ios_base::in | ios_base::out)
|
---|
83 | {
|
---|
84 | // TODO: implement
|
---|
85 | }
|
---|
86 |
|
---|
87 | pos_type pubseekpos(pos_type pos, ios_base::openmode which =
|
---|
88 | ios_base::in | ios_base::out)
|
---|
89 | {
|
---|
90 | // TODO: implement
|
---|
91 | }
|
---|
92 |
|
---|
93 | int pubsync()
|
---|
94 | {
|
---|
95 | // TODO: implement
|
---|
96 | }
|
---|
97 |
|
---|
98 | /**
|
---|
99 | * 27.6.3.2.3, get area:
|
---|
100 | */
|
---|
101 |
|
---|
102 | streamsize in_avail()
|
---|
103 | {
|
---|
104 | // TODO: implement
|
---|
105 | }
|
---|
106 |
|
---|
107 | int_type snextc()
|
---|
108 | {
|
---|
109 | // TODO: implement
|
---|
110 | }
|
---|
111 |
|
---|
112 | int_type sbumpc()
|
---|
113 | {
|
---|
114 | // TODO: implement
|
---|
115 | }
|
---|
116 |
|
---|
117 | int_type sgetc()
|
---|
118 | {
|
---|
119 | // TODO: implement
|
---|
120 | }
|
---|
121 |
|
---|
122 | streamsize sgetn(char_type* s, streamsize n)
|
---|
123 | {
|
---|
124 | // TODO: implement
|
---|
125 | }
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * 27.6.2.4, putback:
|
---|
129 | */
|
---|
130 |
|
---|
131 | int_type sputbackc(char_type c)
|
---|
132 | {
|
---|
133 | // TODO: implement
|
---|
134 | }
|
---|
135 |
|
---|
136 | int_type sungetc()
|
---|
137 | {
|
---|
138 | // TODO: implement
|
---|
139 | }
|
---|
140 |
|
---|
141 | /**
|
---|
142 | * 27.6.2.5, put area:
|
---|
143 | */
|
---|
144 |
|
---|
145 | int_type sputc(char_type c)
|
---|
146 | {
|
---|
147 | // TODO: implement
|
---|
148 | }
|
---|
149 |
|
---|
150 | streamsize sputn(const char_type* s, streamsize n)
|
---|
151 | {
|
---|
152 | // TODO: implement
|
---|
153 | }
|
---|
154 |
|
---|
155 | protected:
|
---|
156 | basic_streambuf()
|
---|
157 | {
|
---|
158 | // TODO: implement
|
---|
159 | }
|
---|
160 |
|
---|
161 | basic_streambuf(const basic_streambuf& rhs)
|
---|
162 | {
|
---|
163 | // TODO: implement
|
---|
164 | }
|
---|
165 |
|
---|
166 | basic_strambuf& operator=(const basic_streambuf& rhs)
|
---|
167 | {
|
---|
168 | // TODO: implement
|
---|
169 | }
|
---|
170 |
|
---|
171 | void swap(basic_streambuf& rhs)
|
---|
172 | {
|
---|
173 | // TODO: implement
|
---|
174 | }
|
---|
175 |
|
---|
176 | /**
|
---|
177 | * 27.6.3.3.2, get area:
|
---|
178 | */
|
---|
179 |
|
---|
180 | char_type* eback() const
|
---|
181 | {
|
---|
182 | // TODO: implement
|
---|
183 | }
|
---|
184 |
|
---|
185 | char_type* gptr() const
|
---|
186 | {
|
---|
187 | // TODO: implement
|
---|
188 | }
|
---|
189 |
|
---|
190 | char_type* egptr() const
|
---|
191 | {
|
---|
192 | // TODO: implement
|
---|
193 | }
|
---|
194 |
|
---|
195 | void gbump(int n)
|
---|
196 | {
|
---|
197 | // TODO: implement
|
---|
198 | }
|
---|
199 |
|
---|
200 | void setg(char_type* gbeg, char_type* gnext, char_type* gend)
|
---|
201 | {
|
---|
202 | // TODO: implement
|
---|
203 | }
|
---|
204 |
|
---|
205 | /**
|
---|
206 | * 27.6.3.3.3, put area:
|
---|
207 | */
|
---|
208 |
|
---|
209 | char_type* pbase() const
|
---|
210 | {
|
---|
211 | // TODO: implement
|
---|
212 | }
|
---|
213 |
|
---|
214 | char_type* pptr() const
|
---|
215 | {
|
---|
216 | // TODO: implement
|
---|
217 | }
|
---|
218 |
|
---|
219 | char_type* epptr() const
|
---|
220 | {
|
---|
221 | // TODO: implement
|
---|
222 | }
|
---|
223 |
|
---|
224 | void pbump(int n)
|
---|
225 | {
|
---|
226 | // TODO: implement
|
---|
227 | }
|
---|
228 |
|
---|
229 | void setp(char_type* pbeg, char_type* pend)
|
---|
230 | {
|
---|
231 | // TODO: implement
|
---|
232 | }
|
---|
233 |
|
---|
234 | /**
|
---|
235 | * 27.6.3.4.1, locales:
|
---|
236 | */
|
---|
237 |
|
---|
238 | virtual void imbue(const locale& loc)
|
---|
239 | {
|
---|
240 | // TODO: implement
|
---|
241 | }
|
---|
242 |
|
---|
243 | /**
|
---|
244 | * 27.6.3.4.2, buffer management and positioning:
|
---|
245 | */
|
---|
246 |
|
---|
247 | virtual basic_streambuf<Char, Traits>*
|
---|
248 | setbuf(char_type* s, streamsize n)
|
---|
249 | {
|
---|
250 | // TODO: implement
|
---|
251 | }
|
---|
252 |
|
---|
253 | virtual pos_type seekoff(off_type off, ios_base::seekdir way,
|
---|
254 | ios_base::openmode which = ios_base::in | ops_base::out)
|
---|
255 | {
|
---|
256 | // TODO: implement
|
---|
257 | }
|
---|
258 |
|
---|
259 | virtual pos_type seekpos(pos_type pos, ios_base::openmode which =
|
---|
260 | ios_base::in | ios_base::out)
|
---|
261 | {
|
---|
262 | // TODO: implement
|
---|
263 | }
|
---|
264 |
|
---|
265 | virtual int sync()
|
---|
266 | {
|
---|
267 | // TODO: implement
|
---|
268 | }
|
---|
269 |
|
---|
270 | /**
|
---|
271 | * 27.6.3.4.3, get area:
|
---|
272 | */
|
---|
273 |
|
---|
274 | virtual streamsize showmanyc()
|
---|
275 | {
|
---|
276 | // TODO: implement
|
---|
277 | }
|
---|
278 |
|
---|
279 | virtual streamsize xsgetn(char_type* s, streamsize n)
|
---|
280 | {
|
---|
281 | // TODO: implement
|
---|
282 | }
|
---|
283 |
|
---|
284 | virtual int_type underflow()
|
---|
285 | {
|
---|
286 | // TODO: implement
|
---|
287 | }
|
---|
288 |
|
---|
289 | virtual int_type uflow()
|
---|
290 | {
|
---|
291 | // TODO: implement
|
---|
292 | }
|
---|
293 |
|
---|
294 | /**
|
---|
295 | * 27.6.3.4.4, putback:
|
---|
296 | */
|
---|
297 |
|
---|
298 | virtual int_type pbackfail(int_type c = traits_type::eof())
|
---|
299 | {
|
---|
300 | // TODO: implement
|
---|
301 | }
|
---|
302 |
|
---|
303 | /**
|
---|
304 | * 27.6.3.4.5, put area:
|
---|
305 | */
|
---|
306 |
|
---|
307 | virtual streamsize xsputn(const char_type* s, streamsize n)
|
---|
308 | {
|
---|
309 | // TODO: implement
|
---|
310 | }
|
---|
311 |
|
---|
312 | virtual int_type overflow(int_type c = traits_type::eof())
|
---|
313 | {
|
---|
314 | // TODO: implement
|
---|
315 | }
|
---|
316 |
|
---|
317 | private:
|
---|
318 | // TODO: implement
|
---|
319 | };
|
---|
320 |
|
---|
321 | using streambuf = basic_streambuf<char>;
|
---|
322 | using wstreambuf = basic_streambuf<wchar_t>;
|
---|
323 | }
|
---|
324 |
|
---|
325 | #endif
|
---|