msvcp: Add a macro to access the locale field of I/O streams.
[wine.git] / dlls / msvcp60 / ios.c
blob5b7422ab7459f9ca07bcb06340bb4bb44c18a21d
1 /*
2 * Copyright 2011 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include <limits.h>
24 #include <share.h>
25 #include <locale.h>
27 #include "msvcp.h"
28 #include "windef.h"
29 #include "winbase.h"
30 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
33 /* ?_Index@ios_base@std@@0HA */
34 int ios_base_Index = 0;
35 /* ?_Sync@ios_base@std@@0_NA */
36 MSVCP_bool ios_base_Sync = FALSE;
38 typedef struct {
39 streamoff off;
40 __int64 DECLSPEC_ALIGN(8) pos;
41 int state;
42 } fpos_int;
44 static inline const char* debugstr_fpos_int(fpos_int *fpos)
46 return wine_dbg_sprintf("fpos(%s %s %d)", wine_dbgstr_longlong(fpos->off), wine_dbgstr_longlong(fpos->pos), fpos->state);
49 typedef struct {
50 void (__cdecl *pfunc)(ios_base*, streamsize);
51 streamsize arg;
52 } manip_streamsize;
54 typedef struct {
55 void (__cdecl *pfunc)(ios_base*, int);
56 int arg;
57 } manip_int;
59 typedef enum {
60 INITFL_new = 0,
61 INITFL_open = 1,
62 INITFL_close = 2
63 } basic_filebuf__Initfl;
65 typedef struct {
66 basic_streambuf_char base;
67 codecvt_char *cvt;
68 int state0;
69 int state;
70 basic_string_char *str;
71 MSVCP_bool close;
72 locale loc;
73 FILE *file;
74 } basic_filebuf_char;
76 typedef struct {
77 basic_streambuf_wchar base;
78 codecvt_wchar *cvt;
79 int state0;
80 int state;
81 basic_string_char *str;
82 MSVCP_bool close;
83 locale loc;
84 FILE *file;
85 } basic_filebuf_wchar;
87 typedef enum {
88 STRINGBUF_allocated = 1,
89 STRINGBUF_no_write = 2,
90 STRINGBUF_no_read = 4,
91 STRINGBUF_append = 8,
92 STRINGBUF_at_end = 16
93 } basic_stringbuf_state;
95 typedef struct {
96 basic_streambuf_char base;
97 char *pendsave;
98 char *seekhigh;
99 int alsize;
100 int state;
101 char allocator; /* empty struct */
102 } basic_stringbuf_char;
104 typedef struct {
105 basic_streambuf_wchar base;
106 wchar_t *pendsave;
107 wchar_t *seekhigh;
108 int alsize;
109 int state;
110 char allocator; /* empty struct */
111 } basic_stringbuf_wchar;
113 typedef struct {
114 ios_base base;
115 basic_streambuf_char *strbuf;
116 struct _basic_ostream_char *stream;
117 char fillch;
118 } basic_ios_char;
120 typedef struct {
121 ios_base base;
122 basic_streambuf_wchar *strbuf;
123 struct _basic_ostream_wchar *stream;
124 wchar_t fillch;
125 } basic_ios_wchar;
127 typedef struct _basic_ostream_char {
128 const int *vbtable;
129 /* virtual inheritance
130 * basic_ios_char basic_ios;
132 } basic_ostream_char;
134 typedef struct _basic_ostream_wchar {
135 const int *vbtable;
136 /* virtual inheritance
137 * basic_ios_wchar basic_ios;
139 } basic_ostream_wchar;
141 typedef struct {
142 const int *vbtable;
143 streamsize count;
144 /* virtual inheritance
145 * basic_ios_char basic_ios;
147 } basic_istream_char;
149 typedef struct {
150 const int *vbtable;
151 streamsize count;
152 /* virtual inheritance
153 * basic_ios_wchar basic_ios;
155 } basic_istream_wchar;
157 typedef struct {
158 basic_istream_char base1;
159 basic_ostream_char base2;
160 /* virtual inheritance
161 * basic_ios_char basic_ios;
163 } basic_iostream_char;
165 typedef struct {
166 basic_istream_wchar base1;
167 basic_ostream_wchar base2;
168 /* virtual inheritance
169 * basic_ios_wchar basic_ios;
171 } basic_iostream_wchar;
173 typedef struct {
174 basic_ostream_char base;
175 basic_filebuf_char filebuf;
176 /* virtual inheritance
177 * basic_ios_char basic_ios;
179 } basic_ofstream_char;
181 typedef struct {
182 basic_ostream_wchar base;
183 basic_filebuf_wchar filebuf;
184 /* virtual inheritance
185 * basic_ios_wchar basic_ios;
187 } basic_ofstream_wchar;
189 typedef struct {
190 basic_istream_char base;
191 basic_filebuf_char filebuf;
192 /* virtual inheritance
193 * basic_ios_char basic_ios;
195 } basic_ifstream_char;
197 typedef struct {
198 basic_istream_wchar base;
199 basic_filebuf_wchar filebuf;
200 /* virtual inheritance
201 * basic_ios_wchar basic_ios;
203 } basic_ifstream_wchar;
205 typedef struct {
206 basic_iostream_char base;
207 basic_filebuf_char filebuf;
208 /* virtual inheritance
209 * basic_ios_char basic_ios;
211 } basic_fstream_char;
213 typedef struct {
214 basic_iostream_wchar base;
215 basic_filebuf_wchar filebuf;
216 /* virtual inheritance
217 * basic_ios_char basic_ios;
219 } basic_fstream_wchar;
221 typedef struct {
222 basic_ostream_char base;
223 basic_stringbuf_char strbuf;
224 /* virtual inheritance
225 * basic_ios_char basic_ios;
227 } basic_ostringstream_char;
229 typedef struct {
230 basic_ostream_wchar base;
231 basic_stringbuf_wchar strbuf;
232 /* virtual inheritance
233 * basic_ios_wchar basic_ios;
235 } basic_ostringstream_wchar;
237 typedef struct {
238 basic_istream_char base;
239 basic_stringbuf_char strbuf;
240 /* virtual inheritance
241 * basic_ios_char basic_ios;
243 } basic_istringstream_char;
245 typedef struct {
246 basic_istream_wchar base;
247 basic_stringbuf_wchar strbuf;
248 /* virtual inheritance
249 * basic_ios_wchar basic_ios;
251 } basic_istringstream_wchar;
253 typedef struct {
254 basic_iostream_char base;
255 basic_stringbuf_char strbuf;
256 /* virtual inheritance
257 * basic_ios_char basic_ios;
259 } basic_stringstream_char;
261 typedef struct {
262 basic_iostream_wchar base;
263 basic_stringbuf_wchar strbuf;
264 /* virtual inheritance
265 * basic_ios_wchar basic_ios;
267 } basic_stringstream_wchar;
269 typedef enum {
270 STRSTATE_Allocated = 1,
271 STRSTATE_Constant = 2,
272 STRSTATE_Dynamic = 4,
273 STRSTATE_Frozen = 8
274 } strstreambuf__Strstate;
276 typedef struct {
277 basic_streambuf_char base;
278 char *endsave;
279 char *seekhigh;
280 streamsize minsize;
281 int strmode;
282 void* (__cdecl *palloc)(MSVCP_size_t);
283 void (__cdecl *pfree)(void*);
284 } strstreambuf;
286 typedef struct {
287 basic_ostream_char base;
288 strstreambuf buf;
289 /* virtual inheritance
290 * basic_ios_char basic_ios;
292 } ostrstream;
294 typedef struct {
295 basic_istream_char base;
296 strstreambuf buf;
297 /* virtual inheritance
298 * basic_ios_char basic_ios;
300 } istrstream;
302 typedef struct {
303 basic_iostream_char base;
304 strstreambuf buf;
305 /* virtual inheritance
306 * basic_ios_char basic_ios;
308 } strstream;
310 extern const vtable_ptr MSVCP_iosb_vtable;
312 /* ??_7ios_base@std@@6B@ */
313 extern const vtable_ptr MSVCP_ios_base_vtable;
315 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
316 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
318 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
319 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
321 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
322 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
324 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
325 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
327 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
328 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
330 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
331 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
333 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
334 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
336 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
337 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
339 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
340 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
342 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
343 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
345 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
346 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
348 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
349 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
351 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
352 const int basic_ostream_char_vbtable[] = {0, sizeof(basic_ostream_char)};
353 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
354 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
356 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
357 const int basic_ostream_wchar_vbtable[] = {0, sizeof(basic_ostream_wchar)};
358 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
359 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
361 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
362 const int basic_ostream_short_vbtable[] = {0, sizeof(basic_ostream_wchar)};
363 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
364 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
366 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
367 const int basic_istream_char_vbtable[] = {0, sizeof(basic_istream_char)};
368 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
369 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
371 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
372 const int basic_istream_wchar_vbtable[] = {0, sizeof(basic_istream_wchar)};
373 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
374 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
376 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
377 const int basic_istream_short_vbtable[] = {0, sizeof(basic_istream_wchar)};
378 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
379 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
381 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
382 const int basic_iostream_char_vbtable1[] = {0, sizeof(basic_iostream_char)};
383 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
384 const int basic_iostream_char_vbtable2[] = {0, sizeof(basic_iostream_char)-FIELD_OFFSET(basic_iostream_char, base2)};
385 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
386 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
388 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
389 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
390 const int basic_iostream_wchar_vbtable1[] = {0, sizeof(basic_iostream_wchar)};
391 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
392 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
393 const int basic_iostream_wchar_vbtable2[] = {0, sizeof(basic_iostream_wchar)-FIELD_OFFSET(basic_iostream_wchar, base2)};
394 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
395 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
396 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
397 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
399 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
400 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
401 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
402 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
404 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
405 const int basic_ofstream_wchar_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
406 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
407 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
409 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
410 const int basic_ofstream_short_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
411 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
412 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
414 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
415 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
416 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
417 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
419 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
420 const int basic_ifstream_wchar_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
421 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
422 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
424 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
425 const int basic_ifstream_short_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
426 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
427 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
429 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
430 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
431 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
432 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
433 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
434 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
436 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
437 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
438 const int basic_fstream_wchar_vbtable1[] = {0, sizeof(basic_fstream_wchar)};
439 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
440 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
441 const int basic_fstream_wchar_vbtable2[] = {0, sizeof(basic_fstream_wchar)-FIELD_OFFSET(basic_fstream_wchar, base.base2)};
442 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
443 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
444 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
445 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
447 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
448 const int basic_ostringstream_char_vbtable[] = {0, sizeof(basic_ostringstream_char)};
449 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
450 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
452 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
453 const int basic_ostringstream_wchar_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
454 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
455 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
457 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
458 const int basic_ostringstream_short_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
459 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
460 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
462 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
463 const int basic_istringstream_char_vbtable[] = {0, sizeof(basic_istringstream_char)};
464 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
465 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
467 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
468 const int basic_istringstream_wchar_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
469 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
470 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
472 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
473 const int basic_istringstream_short_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
474 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
475 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
477 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
478 const int basic_stringstream_char_vbtable1[] = {0, sizeof(basic_stringstream_char)};
479 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
480 const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_char)-FIELD_OFFSET(basic_stringstream_char, base.base2)};
481 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
482 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
484 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
485 const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
486 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
487 const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
488 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
489 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
491 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
492 const int basic_stringstream_short_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
493 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
494 const int basic_stringstream_short_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
495 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
496 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
498 /* ??_7strstreambuf@std@@6B */
499 extern const vtable_ptr MSVCP_strstreambuf_vtable;
501 static const int ostrstream_vbtable[] = {0, sizeof(ostrstream)};
502 extern const vtable_ptr MSVCP_ostrstream_vtable;
504 static const int istrstream_vbtable[] = {0, sizeof(istrstream)};
506 static const int strstream_vbtable1[] = {0, sizeof(strstream)};
507 static const int strstream_vbtable2[] = {0, sizeof(strstream)-FIELD_OFFSET(strstream, base.base2)};
508 extern const vtable_ptr MSVCP_strstream_vtable;
510 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
511 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
512 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
513 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
514 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
515 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
516 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
517 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
518 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
519 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
520 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
521 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
522 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
523 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
524 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
525 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
526 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
527 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
528 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
529 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
530 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
531 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
532 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
533 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
534 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
535 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
536 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
537 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
538 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
539 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
540 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
541 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
542 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
543 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
544 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
545 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
546 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
547 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
548 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
549 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
550 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
551 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
552 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
553 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
554 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
555 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
556 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
557 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
558 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
559 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
560 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
561 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
562 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
563 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
564 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
565 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
566 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
567 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
568 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
569 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
570 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
571 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
572 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
573 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
574 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
575 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
576 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
577 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
578 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
579 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
580 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
581 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
582 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
583 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
584 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
585 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
586 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
587 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
588 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
589 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
590 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
591 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
592 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
593 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
594 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
595 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
596 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
597 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
598 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
599 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
600 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
601 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
602 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
603 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
604 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
605 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
606 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
607 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
608 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
609 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
610 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
611 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
612 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
613 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
614 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
615 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
616 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
617 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
618 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
619 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
620 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
621 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
622 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
623 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
624 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
625 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
626 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
627 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
628 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
629 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
630 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
631 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
632 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
633 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
634 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
635 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
636 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
637 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
638 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
639 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
640 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
641 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
642 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
643 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
644 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
645 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
646 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
647 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
648 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
649 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
650 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
651 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
652 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
653 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
654 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
655 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
656 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
657 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
658 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
659 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
660 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
661 "?AVostrstream@std@@")
662 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
663 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
664 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
665 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
666 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
667 "?AVstrstream@std@@")
669 #ifndef __GNUC__
670 void __asm_dummy_vtables(void) {
671 #endif
672 __ASM_VTABLE(iosb,
673 VTABLE_ADD_FUNC(iosb_vector_dtor));
674 __ASM_VTABLE(ios_base,
675 VTABLE_ADD_FUNC(ios_base_vector_dtor));
676 __ASM_VTABLE(basic_ios_char,
677 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor));
678 __ASM_VTABLE(basic_ios_wchar,
679 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
680 __ASM_VTABLE(basic_ios_short,
681 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
682 __ASM_VTABLE(basic_streambuf_char,
683 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
684 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
685 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
686 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
687 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
688 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
689 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
690 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
691 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
692 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
693 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
694 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
695 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
696 __ASM_VTABLE(basic_streambuf_wchar,
697 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
698 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
699 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
700 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
701 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
702 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
703 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
704 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
705 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
706 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
707 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
708 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
709 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
710 __ASM_VTABLE(basic_streambuf_short,
711 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
712 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
713 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
714 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
715 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
716 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
717 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
718 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
719 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
720 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
721 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
722 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
723 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
724 __ASM_VTABLE(basic_filebuf_char,
725 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
726 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
727 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
728 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
729 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
730 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
731 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
732 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
733 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
734 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
735 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
736 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
737 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
738 __ASM_VTABLE(basic_filebuf_wchar,
739 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
740 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
741 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
742 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
743 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
744 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
745 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
746 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
747 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
748 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
749 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
750 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
751 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
752 __ASM_VTABLE(basic_filebuf_short,
753 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
754 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
755 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
756 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
757 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
758 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
759 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
760 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
761 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
762 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
763 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
764 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
765 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
766 __ASM_VTABLE(basic_stringbuf_char,
767 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
768 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
769 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
770 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
771 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
772 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
773 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
774 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
775 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
776 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
777 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
778 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
779 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
780 __ASM_VTABLE(basic_stringbuf_wchar,
781 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
782 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
783 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
784 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
785 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
786 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
787 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
788 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
789 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
790 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
791 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
792 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
793 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
794 __ASM_VTABLE(basic_stringbuf_short,
795 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
796 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
797 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
798 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
799 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
800 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
801 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
802 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
803 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
804 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
805 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
806 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
807 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
808 __ASM_VTABLE(basic_ostream_char,
809 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor));
810 __ASM_VTABLE(basic_ostream_wchar,
811 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
812 __ASM_VTABLE(basic_ostream_short,
813 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
814 __ASM_VTABLE(basic_istream_char,
815 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor));
816 __ASM_VTABLE(basic_istream_wchar,
817 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
818 __ASM_VTABLE(basic_istream_short,
819 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
820 __ASM_VTABLE(basic_iostream_char,
821 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor));
822 __ASM_VTABLE(basic_iostream_wchar,
823 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
824 __ASM_VTABLE(basic_iostream_short,
825 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
826 __ASM_VTABLE(basic_ofstream_char,
827 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor));
828 __ASM_VTABLE(basic_ofstream_wchar,
829 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
830 __ASM_VTABLE(basic_ofstream_short,
831 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
832 __ASM_VTABLE(basic_ifstream_char,
833 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor));
834 __ASM_VTABLE(basic_ifstream_wchar,
835 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
836 __ASM_VTABLE(basic_ifstream_short,
837 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
838 __ASM_VTABLE(basic_fstream_char,
839 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor));
840 __ASM_VTABLE(basic_fstream_wchar,
841 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
842 __ASM_VTABLE(basic_fstream_short,
843 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
844 __ASM_VTABLE(basic_ostringstream_char,
845 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor));
846 __ASM_VTABLE(basic_ostringstream_wchar,
847 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
848 __ASM_VTABLE(basic_ostringstream_short,
849 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
850 __ASM_VTABLE(basic_istringstream_char,
851 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor));
852 __ASM_VTABLE(basic_istringstream_wchar,
853 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
854 __ASM_VTABLE(basic_istringstream_short,
855 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
856 __ASM_VTABLE(basic_stringstream_char,
857 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor));
858 __ASM_VTABLE(basic_stringstream_wchar,
859 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
860 __ASM_VTABLE(basic_stringstream_short,
861 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
862 __ASM_VTABLE(strstreambuf,
863 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
864 VTABLE_ADD_FUNC(strstreambuf_overflow)
865 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
866 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
867 VTABLE_ADD_FUNC(strstreambuf_underflow)
868 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
869 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
870 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
871 VTABLE_ADD_FUNC(strstreambuf_seekoff)
872 VTABLE_ADD_FUNC(strstreambuf_seekpos)
873 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
874 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
875 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
876 __ASM_VTABLE(ostrstream,
877 VTABLE_ADD_FUNC(ostrstream_vector_dtor));
878 __ASM_VTABLE(strstream,
879 VTABLE_ADD_FUNC(strstream_vector_dtor));
880 #ifndef __GNUC__
882 #endif
884 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
885 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
886 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
887 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
889 TRACE("(%p %p %p %p)\n", this, first, next, last);
891 this->wbuf = first;
892 this->wpos = next;
893 this->wsize = last-next;
896 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
897 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
898 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
899 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
901 basic_streambuf_char_setp_next(this, first, first, last);
904 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
905 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
906 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
907 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
909 TRACE("(%p %p %p %p)\n", this, first, next, last);
911 this->rbuf = first;
912 this->rpos = next;
913 this->rsize = last-next;
916 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
917 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
918 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
919 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
921 TRACE("(%p)\n", this);
923 this->prbuf = &this->rbuf;
924 this->pwbuf = &this->wbuf;
925 this->prpos = &this->rpos;
926 this->pwpos = &this->wpos;
927 this->prsize = &this->rsize;
928 this->pwsize = &this->wsize;
930 basic_streambuf_char_setp(this, NULL, NULL);
931 basic_streambuf_char_setg(this, NULL, NULL, NULL);
934 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
935 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
936 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
937 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
939 TRACE("(%p %d)\n", this, uninitialized);
940 this->vtable = &MSVCP_basic_streambuf_char_vtable;
941 return this;
944 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
945 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
946 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
947 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
949 TRACE("(%p)\n", this);
951 this->vtable = &MSVCP_basic_streambuf_char_vtable;
952 locale_ctor(IOS_LOCALE(this));
953 basic_streambuf_char__Init_empty(this);
955 return this;
958 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
959 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
960 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
961 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
963 TRACE("(%p)\n", this);
965 locale_dtor(IOS_LOCALE(this));
968 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
969 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
971 TRACE("(%p %x)\n", this, flags);
972 if(flags & 2) {
973 /* we have an array, with the number of elements stored before the first object */
974 INT_PTR i, *ptr = (INT_PTR *)this-1;
976 for(i=*ptr-1; i>=0; i--)
977 basic_streambuf_char_dtor(this+i);
978 MSVCRT_operator_delete(ptr);
979 } else {
980 basic_streambuf_char_dtor(this);
981 if(flags & 1)
982 MSVCRT_operator_delete(this);
985 return this;
988 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
989 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
990 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
991 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
993 TRACE("(%p)\n", this);
994 return *this->prpos ? *this->prsize : 0;
997 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
998 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
999 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1000 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1002 TRACE("(%p)\n", this);
1003 (*this->prsize)++;
1004 (*this->prpos)--;
1005 return *this->prpos;
1008 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1009 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1010 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1011 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1013 TRACE("(%p)\n", this);
1014 (*this->prsize)--;
1015 return (*this->prpos)++;
1018 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1019 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1020 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1021 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1023 TRACE("(%p)\n", this);
1024 (*this->prsize)--;
1025 (*this->prpos)++;
1026 return *this->prpos;
1029 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1030 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1031 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1032 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1034 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1036 this->prbuf = gf;
1037 this->pwbuf = pf;
1038 this->prpos = gn;
1039 this->pwpos = pn;
1040 this->prsize = gc;
1041 this->pwsize = pc;
1044 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1045 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1046 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1047 #if _MSVCP_VER >= 100
1048 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1049 #else
1050 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1051 #endif
1052 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1054 TRACE("(%p)\n", this);
1057 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1058 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1059 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1060 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1062 TRACE("(%p)\n", this);
1063 return *this->pwpos ? *this->pwsize : 0;
1066 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1067 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1068 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1069 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1071 TRACE("(%p)\n", this);
1072 (*this->pwsize)--;
1073 return (*this->pwpos)++;
1076 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1077 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1078 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1079 #if _MSVCP_VER >= 100
1080 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1081 #else
1082 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1083 #endif
1084 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1086 TRACE("(%p)\n", this);
1087 return EOF;
1090 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1091 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1092 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1093 #if _MSVCP_VER >= 100
1094 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1095 #else
1096 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1097 #endif
1098 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1100 int ret;
1102 TRACE("(%p)\n", this);
1104 if(call_basic_streambuf_char_underflow(this)==EOF)
1105 return EOF;
1107 ret = (unsigned char)**this->prpos;
1108 (*this->prsize)--;
1109 (*this->prpos)++;
1110 return ret;
1113 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1114 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1115 #if STREAMSIZE_BITS == 64
1116 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1117 #else
1118 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1119 #endif
1120 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1121 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1122 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1123 #else
1124 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1125 #endif
1126 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1128 streamsize copied, chunk;
1129 int c;
1131 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1133 for(copied=0; copied<count && size;) {
1134 chunk = basic_streambuf_char__Gnavail(this);
1135 if(chunk > count-copied)
1136 chunk = count-copied;
1138 if(chunk > 0) {
1139 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1140 *this->prpos += chunk;
1141 *this->prsize -= chunk;
1142 copied += chunk;
1143 size -= chunk;
1144 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1145 ptr[copied] = c;
1146 copied++;
1147 size--;
1148 }else {
1149 break;
1153 return copied;
1156 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1157 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1158 #if STREAMSIZE_BITS == 64
1159 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1160 #else
1161 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1162 #endif
1163 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1165 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1166 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1169 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1170 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1171 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1172 #if _MSVCP_VER >= 100
1173 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1174 #else
1175 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1176 #endif
1177 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1179 TRACE("(%p)\n", this);
1182 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1183 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1184 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1185 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1187 TRACE("(%p)\n", this);
1188 return *this->prbuf;
1191 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1192 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1193 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1194 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1196 TRACE("(%p)\n", this);
1197 return *this->prpos;
1200 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1201 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1202 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1203 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1205 TRACE("(%p)\n", this);
1206 return *this->prpos+*this->prsize;
1209 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1210 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1211 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1212 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1214 TRACE("(%p)\n", this);
1215 return *this->pwpos+*this->pwsize;
1218 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1219 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1220 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1221 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1223 TRACE("(%p %d)\n", this, off);
1224 *this->prpos += off;
1225 *this->prsize -= off;
1228 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1229 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1230 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1231 #if _MSVCP_VER >= 100
1232 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_char*, const locale*), (this, loc))
1233 #elif _MSVCP_VER >= 80
1234 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_char*, const locale*), (this, loc))
1235 #else
1236 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_char*, const locale*), (this, loc))
1237 #endif
1238 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1240 TRACE("(%p %p)\n", this, loc);
1243 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1244 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1245 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1246 #if _MSVCP_VER >= 100
1247 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 12, int, (basic_streambuf_char*, int), (this, ch))
1248 #else
1249 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, int, (basic_streambuf_char*, int), (this, ch))
1250 #endif
1251 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1253 TRACE("(%p %d)\n", this, ch);
1254 return EOF;
1257 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1258 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1259 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1260 #if _MSVCP_VER >= 100
1261 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*, int), (this, ch))
1262 #else
1263 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, int, (basic_streambuf_char*, int), (this, ch))
1264 #endif
1265 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1267 TRACE("(%p %d)\n", this, ch);
1268 return EOF;
1271 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1272 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1273 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1274 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1276 TRACE("(%p)\n", this);
1277 return *this->pwbuf;
1280 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1281 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1282 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1283 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1285 TRACE("(%p %d)\n", this, off);
1286 *this->pwpos += off;
1287 *this->pwsize -= off;
1290 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1291 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1292 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1293 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1295 TRACE("(%p)\n", this);
1296 return *this->pwpos;
1299 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1300 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1301 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1302 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1304 TRACE("(%p %p)\n", this, loc);
1305 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
1306 call_basic_streambuf_char_imbue(this, loc);
1307 locale_copy_ctor(IOS_LOCALE(this), loc);
1308 return ret;
1311 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1312 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1313 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1314 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1315 #if STREAMOFF_BITS == 64
1316 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1317 #else
1318 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1319 #endif
1320 #if _MSVCP_VER >= 100
1321 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1322 #elif _MSVCP_VER >= 80
1323 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1324 #else
1325 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1326 #endif
1327 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1328 fpos_int *ret, streamoff off, int way, int mode)
1330 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1331 ret->off = -1;
1332 ret->pos = 0;
1333 ret->state = 0;
1334 return ret;
1337 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1338 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1339 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
1340 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
1341 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1342 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1343 #if STREAMOFF_BITS == 64
1344 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1345 #else
1346 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1347 #endif
1348 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1349 fpos_int *ret, streamoff off, int way, int mode)
1351 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1352 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1355 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1356 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1357 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1358 #if _MSVCP_VER >= 100
1359 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 44, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1360 #elif _MSVCP_VER >= 80
1361 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1362 #else
1363 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1364 #endif
1365 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1366 fpos_int *ret, fpos_int pos, int mode)
1368 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1369 ret->off = -1;
1370 ret->pos = 0;
1371 ret->state = 0;
1372 return ret;
1375 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1376 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1377 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1378 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1379 fpos_int *ret, fpos_int pos, int mode)
1381 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1382 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1385 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1386 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1387 #if STREAMSIZE_BITS == 64
1388 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1389 #else
1390 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1391 #endif
1392 #if _MSVCP_VER >= 100
1393 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 48, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1394 #elif _MSVCP_VER >= 80
1395 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1396 #else
1397 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1398 #endif
1399 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1401 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1402 return this;
1405 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1406 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1407 #if STREAMSIZE_BITS == 64
1408 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1409 #else
1410 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1411 #endif
1412 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1414 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1415 return call_basic_streambuf_char_setbuf(this, buf, count);
1418 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1419 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1420 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1421 #if _MSVCP_VER >= 100
1422 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1423 #elif _MSVCP_VER >= 80
1424 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1425 #else
1426 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1427 #endif
1428 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1430 TRACE("(%p)\n", this);
1431 return 0;
1434 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1435 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1436 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1437 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1439 TRACE("(%p)\n", this);
1440 return call_basic_streambuf_char_sync(this);
1443 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1444 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1445 #if STREAMSIZE_BITS == 64
1446 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1447 #else
1448 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1449 #endif
1450 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1452 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1453 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1456 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1457 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1458 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1459 #if _MSVCP_VER >= 100
1460 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1461 #else
1462 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1463 #endif
1464 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1466 TRACE("(%p)\n", this);
1467 return 0;
1470 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1471 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1472 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1473 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1475 streamsize ret;
1477 TRACE("(%p)\n", this);
1479 ret = basic_streambuf_char__Gnavail(this);
1480 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1483 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1484 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1485 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1486 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1488 TRACE("(%p %d)\n", this, ch);
1489 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1490 (*this->prsize)++;
1491 (*this->prpos)--;
1492 return (unsigned char)ch;
1495 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1498 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1499 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1500 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1501 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1503 TRACE("(%p %d)\n", this, ch);
1504 return basic_streambuf_char__Pnavail(this) ?
1505 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1506 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1509 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1510 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1511 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1512 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1514 TRACE("(%p)\n", this);
1515 if(*this->prpos && *this->prpos>*this->prbuf) {
1516 (*this->prsize)++;
1517 (*this->prpos)--;
1518 return (unsigned char)**this->prpos;
1521 return call_basic_streambuf_char_pbackfail(this, EOF);
1524 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1525 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1526 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1527 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1529 TRACE("(%p)\n", this);
1530 if(basic_streambuf_char__Gnavail(this))
1531 basic_streambuf_char__Gninc(this);
1532 else
1533 call_basic_streambuf_char_uflow(this);
1536 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1537 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1538 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1539 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1541 TRACE("(%p)\n", this);
1542 return basic_streambuf_char__Gnavail(this) ?
1543 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1546 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1547 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1548 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1549 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1551 TRACE("(%p)\n", this);
1552 return basic_streambuf_char__Gnavail(this) ?
1553 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1556 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1557 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1558 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1559 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1561 TRACE("(%p)\n", this);
1563 if(basic_streambuf_char__Gnavail(this) > 1)
1564 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1565 return basic_streambuf_char_sbumpc(this)==EOF ?
1566 EOF : basic_streambuf_char_sgetc(this);
1569 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1570 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1571 #if STREAMSIZE_BITS == 64
1572 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1573 #else
1574 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1575 #endif
1576 #if _MSVCP_VER >= 100
1577 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1578 #else
1579 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1580 #endif
1581 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1583 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1584 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1587 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1588 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1589 #if STREAMSIZE_BITS == 64
1590 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1591 #else
1592 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1593 #endif
1594 #if _MSVCP_VER >= 100
1595 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1596 #elif _MSVCP_VER >= 80
1597 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1598 #else
1599 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1600 #endif
1601 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1603 streamsize copied, chunk;
1605 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1607 for(copied=0; copied<count;) {
1608 chunk = basic_streambuf_char__Pnavail(this);
1609 if(chunk > count-copied)
1610 chunk = count-copied;
1612 if(chunk > 0) {
1613 memcpy(*this->pwpos, ptr+copied, chunk);
1614 *this->pwpos += chunk;
1615 *this->pwsize -= chunk;
1616 copied += chunk;
1617 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1618 copied++;
1619 }else {
1620 break;
1624 return copied;
1627 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1628 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1629 #if STREAMSIZE_BITS == 64
1630 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
1631 #else
1632 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1633 #endif
1634 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1636 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1637 return call_basic_streambuf_char_xsputn(this, ptr, count);
1640 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@XZ */
1641 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@XZ */
1642 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1643 locale* __thiscall basic_streambuf_char_getloc(basic_streambuf_char *this, locale *ret)
1645 TRACE("(%p %p)\n", this, ret);
1646 return locale_copy_ctor(ret, IOS_LOCALE(this));
1649 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1650 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1651 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1652 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1653 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1654 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1656 TRACE("(%p %p %p %p)\n", this, first, next, last);
1658 this->wbuf = first;
1659 this->wpos = next;
1660 this->wsize = last-next;
1663 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1664 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1665 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1666 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1667 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1668 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1670 basic_streambuf_wchar_setp_next(this, first, first, last);
1673 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1674 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1675 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1676 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1677 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1678 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1680 TRACE("(%p %p %p %p)\n", this, first, next, last);
1682 this->rbuf = first;
1683 this->rpos = next;
1684 this->rsize = last-next;
1687 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1688 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1689 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1690 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1691 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1692 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1694 TRACE("(%p)\n", this);
1696 this->prbuf = &this->rbuf;
1697 this->pwbuf = &this->wbuf;
1698 this->prpos = &this->rpos;
1699 this->pwpos = &this->wpos;
1700 this->prsize = &this->rsize;
1701 this->pwsize = &this->wsize;
1703 basic_streambuf_wchar_setp(this, NULL, NULL);
1704 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1707 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1708 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1709 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
1710 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1712 TRACE("(%p %d)\n", this, uninitialized);
1713 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1714 return this;
1717 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1718 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1719 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1720 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1722 TRACE("(%p %d)\n", this, uninitialized);
1723 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1724 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1725 return this;
1728 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1729 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1730 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
1731 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1733 TRACE("(%p)\n", this);
1735 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1736 locale_ctor(IOS_LOCALE(this));
1737 basic_streambuf_wchar__Init_empty(this);
1739 return this;
1742 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1743 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1744 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1745 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1747 TRACE("(%p)\n", this);
1748 basic_streambuf_wchar_ctor(this);
1749 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1750 return this;
1753 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1754 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1755 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1756 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1757 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1758 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1760 TRACE("(%p)\n", this);
1762 locale_dtor(IOS_LOCALE(this));
1765 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
1766 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1768 TRACE("(%p %x)\n", this, flags);
1769 if(flags & 2) {
1770 /* we have an array, with the number of elements stored before the first object */
1771 INT_PTR i, *ptr = (INT_PTR *)this-1;
1773 for(i=*ptr-1; i>=0; i--)
1774 basic_streambuf_wchar_dtor(this+i);
1775 MSVCRT_operator_delete(ptr);
1776 } else {
1777 basic_streambuf_wchar_dtor(this);
1778 if(flags & 1)
1779 MSVCRT_operator_delete(this);
1782 return this;
1785 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1786 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1787 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1788 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1789 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
1790 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1792 TRACE("(%p)\n", this);
1793 return *this->prpos ? *this->prsize : 0;
1796 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1797 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1798 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1799 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1800 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1801 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1803 TRACE("(%p)\n", this);
1804 (*this->prsize)++;
1805 (*this->prpos)--;
1806 return *this->prpos;
1809 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1810 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1811 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1812 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1813 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1814 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1816 TRACE("(%p)\n", this);
1817 (*this->prsize)--;
1818 return (*this->prpos)++;
1821 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1822 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1823 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1824 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1825 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
1826 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1828 TRACE("(%p)\n", this);
1829 (*this->prsize)--;
1830 (*this->prpos)++;
1831 return *this->prpos;
1834 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1835 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1836 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1837 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1838 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1839 void __thiscall basic_streambuf_wchar__Init(basic_streambuf_wchar *this, wchar_t **gf, wchar_t **gn, int *gc, wchar_t **pf, wchar_t **pn, int *pc)
1841 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1843 this->prbuf = gf;
1844 this->pwbuf = pf;
1845 this->prpos = gn;
1846 this->pwpos = pn;
1847 this->prsize = gc;
1848 this->pwsize = pc;
1851 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1852 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1853 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1854 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1855 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
1856 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
1858 TRACE("(%p)\n", this);
1861 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1862 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1863 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1864 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1865 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
1866 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
1868 TRACE("(%p)\n", this);
1869 return *this->pwpos ? *this->pwsize : 0;
1872 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1873 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1874 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1875 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1876 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
1877 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
1879 TRACE("(%p)\n", this);
1880 (*this->pwsize)--;
1881 return (*this->pwpos)++;
1884 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1885 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1886 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1887 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1888 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
1889 #if _MSVCP_VER >= 100
1890 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
1891 #else
1892 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
1893 #endif
1894 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
1896 TRACE("(%p)\n", this);
1897 return WEOF;
1900 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1901 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1902 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1903 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1904 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
1905 #if _MSVCP_VER >= 100
1906 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
1907 #else
1908 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
1909 #endif
1910 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
1912 int ret;
1914 TRACE("(%p)\n", this);
1916 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
1917 return WEOF;
1919 ret = **this->prpos;
1920 (*this->prsize)--;
1921 (*this->prpos)++;
1922 return ret;
1925 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
1926 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
1927 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
1928 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
1929 #if STREAMSIZE_BITS == 64
1930 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
1931 #else
1932 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
1933 #endif
1934 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1935 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1936 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1937 #else
1938 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
1939 #endif
1940 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1942 streamsize copied, chunk;
1943 unsigned short c;
1945 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1947 for(copied=0; copied<count && size;) {
1948 chunk = basic_streambuf_wchar__Gnavail(this);
1949 if(chunk > count-copied)
1950 chunk = count-copied;
1952 if(chunk > 0) {
1953 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
1954 *this->prpos += chunk;
1955 *this->prsize -= chunk;
1956 copied += chunk;
1957 size -= chunk*sizeof(wchar_t);
1958 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
1959 ptr[copied] = c;
1960 copied++;
1961 size--;
1962 }else {
1963 break;
1967 return copied;
1970 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
1971 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
1972 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
1973 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
1974 #if STREAMSIZE_BITS == 64
1975 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
1976 #else
1977 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
1978 #endif
1979 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1981 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1982 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
1985 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1986 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1987 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1988 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1989 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
1990 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
1992 TRACE("(%p)\n", this);
1995 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1996 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1997 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1998 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1999 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2000 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2002 TRACE("(%p)\n", this);
2003 return *this->prbuf;
2006 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2007 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2008 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2009 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2010 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2011 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2013 TRACE("(%p)\n", this);
2014 return *this->prpos;
2017 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2018 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2019 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2020 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2021 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2022 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2024 TRACE("(%p)\n", this);
2025 return *this->prpos+*this->prsize;
2028 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2029 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2030 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2031 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2032 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2033 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2035 TRACE("(%p)\n", this);
2036 return *this->pwpos+*this->pwsize;
2039 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2040 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2041 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2042 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2043 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2044 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2046 TRACE("(%p %d)\n", this, off);
2047 *this->prpos += off;
2048 *this->prsize -= off;
2051 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2052 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2053 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2054 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2055 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2056 #if _MSVCP_VER >= 100
2057 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2058 #elif _MSVCP_VER >= 80
2059 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2060 #else
2061 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2062 #endif
2063 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2065 TRACE("(%p %p)\n", this, loc);
2068 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2069 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2070 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2071 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2072 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2073 #if _MSVCP_VER >= 100
2074 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2075 #else
2076 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2077 #endif
2078 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2080 TRACE("(%p %d)\n", this, ch);
2081 return WEOF;
2084 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2085 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2086 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2087 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2088 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2089 #if _MSVCP_VER >= 100
2090 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2091 #else
2092 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2093 #endif
2094 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2096 TRACE("(%p %d)\n", this, ch);
2097 return WEOF;
2100 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2101 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2102 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2103 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2104 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2105 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2107 TRACE("(%p)\n", this);
2108 return *this->pwbuf;
2111 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2112 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2113 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2114 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2115 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2116 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2118 TRACE("(%p %d)\n", this, off);
2119 *this->pwpos += off;
2120 *this->pwsize -= off;
2123 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2124 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2125 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2126 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2127 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2128 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2130 TRACE("(%p)\n", this);
2131 return *this->pwpos;
2134 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2135 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2136 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2137 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2138 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2139 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2141 TRACE("(%p %p)\n", this, loc);
2142 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
2143 call_basic_streambuf_wchar_imbue(this, loc);
2144 locale_copy_ctor(IOS_LOCALE(this), loc);
2145 return ret;
2148 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2149 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
2150 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2151 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2152 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2153 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2154 #if STREAMOFF_BITS == 64
2155 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2156 #else
2157 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2158 #endif
2159 #if _MSVCP_VER >= 100
2160 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2161 #elif _MSVCP_VER >= 80
2162 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2163 #else
2164 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2165 #endif
2166 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2167 fpos_int *ret, streamoff off, int way, int mode)
2169 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2170 ret->off = -1;
2171 ret->pos = 0;
2172 ret->state = 0;
2173 return ret;
2176 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2177 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2178 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2179 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2180 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
2181 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
2182 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2183 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ioos_base@2@H@Z */
2184 #if STREAMOFF_BITS == 64
2185 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2186 #else
2187 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2188 #endif
2189 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2190 fpos_int *ret, streamoff off, int way, int mode)
2192 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2193 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2196 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2197 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2198 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2199 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2200 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2201 #if _MSVCP_VER >= 100
2202 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 44, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2203 #elif _MSVCP_VER >= 80
2204 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2205 #else
2206 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2207 #endif
2208 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2209 fpos_int *ret, fpos_int pos, int mode)
2211 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2212 ret->off = -1;
2213 ret->pos = 0;
2214 ret->state = 0;
2215 return ret;
2218 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2219 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2220 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2221 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2222 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2223 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2224 fpos_int *ret, fpos_int pos, int mode)
2226 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2227 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2230 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2231 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2232 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2233 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2234 #if STREAMSIZE_BITS == 64
2235 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2236 #else
2237 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2238 #endif
2239 #if _MSVCP_VER >= 100
2240 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 48, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2241 #elif _MSVCP_VER >= 80
2242 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2243 #else
2244 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2245 #endif
2246 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2248 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2249 return this;
2252 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2253 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2254 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2255 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2256 #if STREAMSIZE_BITS == 64
2257 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2258 #else
2259 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2260 #endif
2261 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2263 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2264 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2267 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2268 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2269 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2270 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2271 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2272 #if _MSVCP_VER >= 100
2273 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2274 #elif _MSVCP_VER >= 80
2275 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2276 #else
2277 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2278 #endif
2279 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2281 TRACE("(%p)\n", this);
2282 return 0;
2285 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2286 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2287 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2288 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2289 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2290 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2292 TRACE("(%p)\n", this);
2293 return call_basic_streambuf_wchar_sync(this);
2296 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2297 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2298 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2299 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2300 #if STREAMSIZE_BITS == 64
2301 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2302 #else
2303 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2304 #endif
2305 #if _MSVCP_VER >= 100
2306 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2307 #else
2308 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2309 #endif
2310 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2312 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2313 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2316 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2317 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2318 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2319 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2320 #if STREAMSIZE_BITS == 64
2321 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2322 #else
2323 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2324 #endif
2325 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2327 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2328 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2331 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2332 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2333 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2334 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2335 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2336 #if _MSVCP_VER >= 100
2337 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2338 #else
2339 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2340 #endif
2341 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2343 TRACE("(%p)\n", this);
2344 return 0;
2347 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2348 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2349 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2350 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2351 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2352 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2354 streamsize ret;
2356 TRACE("(%p)\n", this);
2358 ret = basic_streambuf_wchar__Gnavail(this);
2359 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2362 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2363 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2364 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2365 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2366 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2367 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2369 TRACE("(%p %d)\n", this, ch);
2370 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2371 (*this->prsize)++;
2372 (*this->prpos)--;
2373 return ch;
2376 return call_basic_streambuf_wchar_pbackfail(this, ch);
2379 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2380 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2381 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2382 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2383 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2384 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2386 TRACE("(%p %d)\n", this, ch);
2387 return basic_streambuf_wchar__Pnavail(this) ?
2388 (*basic_streambuf_wchar__Pninc(this) = ch) :
2389 call_basic_streambuf_wchar_overflow(this, ch);
2392 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2393 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2394 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2395 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2396 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2397 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2399 TRACE("(%p)\n", this);
2400 if(*this->prpos && *this->prpos>*this->prbuf) {
2401 (*this->prsize)++;
2402 (*this->prpos)--;
2403 return **this->prpos;
2406 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2409 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2410 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2411 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2412 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2413 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2414 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2416 TRACE("(%p)\n", this);
2417 if(basic_streambuf_wchar__Gnavail(this))
2418 basic_streambuf_wchar__Gninc(this);
2419 else
2420 call_basic_streambuf_wchar_uflow(this);
2423 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2424 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2425 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2426 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2427 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2428 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2430 TRACE("(%p)\n", this);
2431 return basic_streambuf_wchar__Gnavail(this) ?
2432 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2435 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2436 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2437 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2438 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2439 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2440 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2442 TRACE("(%p)\n", this);
2443 return basic_streambuf_wchar__Gnavail(this) ?
2444 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2447 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2448 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2449 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2450 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2451 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2452 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2454 TRACE("(%p)\n", this);
2456 if(basic_streambuf_wchar__Gnavail(this) > 1)
2457 return *basic_streambuf_wchar__Gnpreinc(this);
2458 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2459 WEOF : basic_streambuf_wchar_sgetc(this);
2462 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2463 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2464 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2465 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2466 #if STREAMSIZE_BITS == 64
2467 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2468 #else
2469 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2470 #endif
2471 #if _MSVCP_VER >= 100
2472 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2473 #elif _MSVCP_VER >= 80
2474 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2475 #else
2476 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2477 #endif
2478 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2480 streamsize copied, chunk;
2482 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2484 for(copied=0; copied<count;) {
2485 chunk = basic_streambuf_wchar__Pnavail(this);
2486 if(chunk > count-copied)
2487 chunk = count-copied;
2489 if(chunk > 0) {
2490 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2491 *this->pwpos += chunk;
2492 *this->pwsize -= chunk;
2493 copied += chunk;
2494 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2495 copied++;
2496 }else {
2497 break;
2501 return copied;
2504 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2505 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2506 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2507 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2508 #if STREAMSIZE_BITS == 64
2509 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2510 #else
2511 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2512 #endif
2513 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2515 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2516 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2519 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2520 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2521 int basic_filebuf_char__Init__Stinit = 0;
2523 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2524 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2525 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2526 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2528 TRACE("(%p %p %d)\n", this, file, which);
2530 this->cvt = NULL;
2531 this->state0 = basic_filebuf_char__Init__Stinit;
2532 this->state = basic_filebuf_char__Init__Stinit;
2533 if(which == INITFL_new)
2534 this->str = NULL;
2535 this->close = (which == INITFL_open);
2536 this->file = file;
2538 basic_streambuf_char__Init_empty(&this->base);
2539 if(file)
2540 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2541 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2544 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
2545 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
2546 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 4)
2547 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this)
2549 TRACE("(%p)\n", this);
2551 this->cvt = codecvt_char_use_facet(IOS_LOCALE(&this->base));
2552 locale__Addfac(&this->loc, &this->cvt->base.facet, codecvt_char_id.id, LC_CTYPE);
2553 if(codecvt_base_always_noconv(&this->cvt->base)) {
2554 this->cvt = NULL;
2555 }else {
2556 this->str = MSVCRT_operator_new(sizeof(basic_string_char));
2557 MSVCP_basic_string_char_ctor(this->str);
2561 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2562 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2563 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2564 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2566 basic_filebuf_char *ret = this;
2568 TRACE("(%p)\n", this);
2570 if(!this->file || fclose(this->file))
2571 return NULL;
2573 basic_filebuf_char__Init(this, NULL, INITFL_close);
2574 return ret;
2577 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2578 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2579 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2580 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2582 TRACE("(%p %p)\n", this, file);
2584 basic_streambuf_char_ctor(&this->base);
2585 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2587 locale_ctor(&this->loc);
2588 basic_filebuf_char__Init(this, file, INITFL_new);
2589 return this;
2592 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2593 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2594 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2595 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2597 return basic_filebuf_char_ctor_file(this, NULL);
2600 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2601 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2602 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2603 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2605 TRACE("(%p %d)\n", this, uninitialized);
2607 basic_streambuf_char_ctor_uninitialized(&this->base, 0);
2608 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2609 locale_ctor(&this->loc);
2610 return this;
2613 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2614 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2615 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2616 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2618 TRACE("(%p)\n", this);
2620 if(this->close)
2621 basic_filebuf_char_close(this);
2622 if(this->str) {
2623 MSVCP_basic_string_char_dtor(this->str);
2624 MSVCRT_operator_delete(this->str);
2626 locale_dtor(&this->loc);
2627 basic_streambuf_char_dtor(&this->base);
2630 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
2631 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2633 TRACE("(%p %x)\n", this, flags);
2634 if(flags & 2) {
2635 /* we have an array, with the number of elements stored before the first object */
2636 INT_PTR i, *ptr = (INT_PTR *)this-1;
2638 for(i=*ptr-1; i>=0; i--)
2639 basic_filebuf_char_dtor(this+i);
2640 MSVCRT_operator_delete(ptr);
2641 } else {
2642 basic_filebuf_char_dtor(this);
2643 if(flags & 1)
2644 MSVCRT_operator_delete(this);
2647 return this;
2650 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2651 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2652 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2653 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2655 TRACE("(%p)\n", this);
2656 return this->file != NULL;
2659 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
2660 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
2661 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
2663 static const wchar_t rW[] = {'r',0};
2664 static const struct {
2665 int mode;
2666 const wchar_t str[4];
2667 const wchar_t str_bin[4];
2668 } str_mode[] = {
2669 {OPENMODE_out, {'w',0}, {'w','b',0}},
2670 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
2671 {OPENMODE_app, {'a',0}, {'a','b',0}},
2672 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
2673 {OPENMODE_in, {'r',0}, {'r','b',0}},
2674 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
2675 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
2676 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
2677 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
2680 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2681 size_t mode_idx;
2682 FILE *f = NULL;
2684 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
2686 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
2687 if(str_mode[mode_idx].mode == real_mode)
2688 break;
2689 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
2690 return NULL;
2692 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
2693 return NULL;
2694 else if(f)
2695 fclose(f);
2697 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2698 && (f = _wfopen(name, rW))) {
2699 fclose(f);
2700 return NULL;
2703 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2704 : str_mode[mode_idx].str, prot);
2705 if(!f)
2706 return NULL;
2708 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2709 fclose(f);
2710 return NULL;
2713 return f;
2716 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
2717 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
2718 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
2720 wchar_t nameW[FILENAME_MAX];
2722 TRACE("(%s %d %d)\n", name, mode, prot);
2724 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2725 return NULL;
2726 return _Fiopen_wchar(nameW, mode, prot);
2729 /* ?__Fiopen@std@@YAPAU_iobuf@@PBDH@Z */
2730 /* ?__Fiopen@std@@YAPEAU_iobuf@@PEBDH@Z */
2731 FILE* __cdecl ___Fiopen(const char *name, int mode)
2733 TRACE("(%p %d)\n", name, mode);
2734 return _Fiopen(name, mode, _SH_DENYNO);
2737 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2738 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2739 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2740 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2741 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
2742 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2744 FILE *f = NULL;
2746 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2748 if(basic_filebuf_char_is_open(this))
2749 return NULL;
2751 if(!(f = _Fiopen_wchar(name, mode, prot)))
2752 return NULL;
2754 basic_filebuf_char__Init(this, f, INITFL_open);
2755 basic_filebuf_char__Initcvt(this);
2756 return this;
2759 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2760 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2761 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
2762 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2764 wchar_t nameW[FILENAME_MAX];
2766 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
2768 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2769 return NULL;
2770 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
2773 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDF@Z */
2774 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDF@Z */
2775 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
2776 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
2778 TRACE("(%p %p %d)\n", this, name, mode);
2779 return basic_filebuf_char_open(this, name, mode, _SH_DENYNO);
2782 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDH@Z */
2783 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDH@Z */
2784 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
2785 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
2786 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
2787 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
2789 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
2792 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2793 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2794 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
2795 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
2797 char *ptr, ch = c, *to_next;
2798 const char *from_next;
2799 int ret;
2802 TRACE("(%p %d)\n", this, c);
2804 if(!basic_filebuf_char_is_open(this))
2805 return EOF;
2806 if(c == EOF)
2807 return !c;
2809 if(!this->cvt)
2810 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2812 from_next = &ch;
2813 MSVCP_basic_string_char_clear(this->str);
2814 MSVCP_basic_string_char_append_len_ch(this->str, 8, '\0');
2815 ptr = this->str->ptr;
2816 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1, &from_next,
2817 ptr, ptr+MSVCP_basic_string_char_length(this->str), &to_next);
2819 switch(ret) {
2820 case CODECVT_partial:
2821 if(from_next == &ch)
2822 return EOF;
2823 case CODECVT_ok:
2824 if(!fwrite(ptr, to_next-ptr, 1, this->file))
2825 return EOF;
2826 return c;
2827 case CODECVT_noconv:
2828 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2829 default:
2830 return EOF;
2834 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2835 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2836 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
2837 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
2839 TRACE("(%p %d)\n", this, c);
2841 if(!basic_filebuf_char_is_open(this))
2842 return EOF;
2844 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
2845 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
2846 basic_streambuf_char__Gndec(&this->base);
2847 return c==EOF ? !c : c;
2848 }else if(c == EOF) {
2849 return EOF;
2850 }else if(!this->cvt) {
2851 return ungetc(c, this->file);
2852 }else if(MSVCP_basic_string_char_length(this->str)) {
2853 char *b, *e, *cur;
2855 e = this->str->ptr;
2856 b = e+this->str->size-1;
2857 for(cur = b; cur>=e; cur--) {
2858 if(ungetc(*cur, this->file) == EOF) {
2859 for(; cur<=b; cur++)
2860 fgetc(this->file);
2861 return EOF;
2864 MSVCP_basic_string_char_clear(this->str);
2865 this->state = this->state0;
2866 return c;
2869 return EOF;
2872 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2873 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2874 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
2875 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
2877 char ch, *to_next;
2878 const char *buf_next;
2879 int c;
2881 TRACE("(%p)\n", this);
2883 if(!basic_filebuf_char_is_open(this))
2884 return EOF;
2886 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2887 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
2889 c = fgetc(this->file);
2890 if(!this->cvt || c==EOF)
2891 return c;
2893 MSVCP_basic_string_char_clear(this->str);
2894 this->state0 = this->state;
2895 while(1) {
2896 MSVCP_basic_string_char_append_ch(this->str, c);
2897 this->state = this->state0;
2899 switch(codecvt_char_in(this->cvt, &this->state, this->str->ptr,
2900 this->str->ptr+this->str->size, &buf_next, &ch, &ch+1, &to_next)) {
2901 case CODECVT_partial:
2902 break;
2903 case CODECVT_noconv:
2904 return (unsigned char)this->str->ptr[0];
2905 case CODECVT_ok:
2906 return (unsigned char)ch;
2907 default:
2908 return EOF;
2911 c = fgetc(this->file);
2912 if(c == EOF)
2913 return EOF;
2917 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2918 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2919 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
2920 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
2922 int ret;
2924 TRACE("(%p)\n", this);
2926 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2927 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
2929 ret = call_basic_streambuf_char_uflow(&this->base);
2930 if(ret != EOF)
2931 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
2932 return ret;
2935 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2936 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
2937 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2938 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2939 #if STREAMOFF_BITS == 64
2940 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
2941 #else
2942 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
2943 #endif
2944 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
2945 fpos_int *ret, streamoff off, int way, int mode)
2947 fpos_t pos;
2949 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
2951 if(!basic_filebuf_char_is_open(this) || fseek(this->file, off, way)) {
2952 ret->off = -1;
2953 ret->pos = 0;
2954 ret->state = 0;
2955 return ret;
2958 fgetpos(this->file, &pos);
2959 ret->off = 0;
2960 ret->pos = pos;
2961 ret->state = this->state;
2962 return ret;
2965 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2966 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2967 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
2968 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
2969 fpos_int *ret, fpos_int pos, int mode)
2971 fpos_t fpos;
2973 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
2975 if(!basic_filebuf_char_is_open(this) || fseek(this->file, (LONG)pos.pos, SEEK_SET)
2976 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
2977 ret->off = -1;
2978 ret->pos = 0;
2979 ret->state = 0;
2980 return ret;
2983 fgetpos(this->file, &fpos);
2984 ret->off = 0;
2985 ret->pos = fpos;
2986 ret->state = this->state;
2987 return ret;
2990 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
2991 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
2992 #if STREAMSIZE_BITS == 64
2993 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
2994 #else
2995 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
2996 #endif
2997 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
2999 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3001 if(!basic_filebuf_char_is_open(this))
3002 return NULL;
3004 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3005 return NULL;
3007 basic_filebuf_char__Init(this, this->file, INITFL_open);
3008 return &this->base;
3011 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3012 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3013 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3014 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3016 TRACE("(%p)\n", this);
3018 if(!basic_filebuf_char_is_open(this))
3019 return 0;
3021 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3022 return 0;
3023 return fflush(this->file);
3026 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3027 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3028 int basic_filebuf_wchar__Init__Stinit = 0;
3030 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3031 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3032 int basic_filebuf_short__Init__Stinit = 0;
3034 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3035 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3036 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3037 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3039 TRACE("(%p %p %d)\n", this, file, which);
3041 this->cvt = NULL;
3042 this->state0 = basic_filebuf_short__Init__Stinit;
3043 this->state = basic_filebuf_short__Init__Stinit;
3044 if(which == INITFL_new)
3045 this->str = NULL;
3046 this->close = (which == INITFL_open);
3047 this->file = file;
3049 basic_streambuf_wchar__Init_empty(&this->base);
3052 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3053 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3054 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3055 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3057 TRACE("(%p %p %d)\n", this, file, which);
3059 this->cvt = NULL;
3060 this->state0 = basic_filebuf_short__Init__Stinit;
3061 this->state = basic_filebuf_short__Init__Stinit;
3062 if(which == INITFL_new)
3063 this->str = NULL;
3064 this->close = (which == INITFL_open);
3065 this->file = file;
3067 basic_streambuf_wchar__Init_empty(&this->base);
3070 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
3071 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
3072 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 4)
3073 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this)
3075 TRACE("(%p)\n", this);
3077 this->cvt = codecvt_short_use_facet(IOS_LOCALE(&this->base));
3078 locale__Addfac(&this->loc, &this->cvt->base.facet, codecvt_short_id.id, LC_CTYPE);
3079 if(codecvt_base_always_noconv(&this->cvt->base)) {
3080 this->cvt = NULL;
3081 }else {
3082 this->str = MSVCRT_operator_new(sizeof(basic_string_char));
3083 MSVCP_basic_string_char_ctor(this->str);
3087 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3088 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3089 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3090 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3091 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3092 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3094 basic_filebuf_wchar *ret = this;
3096 TRACE("(%p)\n", this);
3098 if(!this->file || fclose(this->file))
3099 return NULL;
3101 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3102 return ret;
3105 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3106 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3107 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3108 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3110 TRACE("(%p %p)\n", this, file);
3112 basic_streambuf_wchar_ctor(&this->base);
3113 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3115 locale_ctor(&this->loc);
3116 basic_filebuf_wchar__Init(this, file, INITFL_new);
3117 return this;
3120 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3121 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3122 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3123 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3125 TRACE("(%p %p)\n", this, file);
3127 basic_streambuf_short_ctor(&this->base);
3128 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3130 locale_ctor(&this->loc);
3131 basic_filebuf_short__Init(this, file, INITFL_new);
3132 return this;
3135 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3136 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3137 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3138 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3140 return basic_filebuf_wchar_ctor_file(this, NULL);
3143 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3144 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3145 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3146 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3148 return basic_filebuf_short_ctor_file(this, NULL);
3151 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3152 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3153 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3154 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3156 TRACE("(%p %d)\n", this, uninitialized);
3158 basic_streambuf_short_ctor_uninitialized(&this->base, 0);
3159 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3160 locale_ctor(&this->loc);
3161 return this;
3164 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3165 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3166 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3167 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3168 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3169 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3171 TRACE("(%p)\n", this);
3173 if(this->close)
3174 basic_filebuf_wchar_close(this);
3175 if(this->str) {
3176 MSVCP_basic_string_char_dtor(this->str);
3177 MSVCRT_operator_delete(this->str);
3179 locale_dtor(&this->loc);
3180 basic_streambuf_wchar_dtor(&this->base);
3183 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3184 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3186 TRACE("(%p %x)\n", this, flags);
3187 if(flags & 2) {
3188 /* we have an array, with the number of elements stored before the first object */
3189 INT_PTR i, *ptr = (INT_PTR *)this-1;
3191 for(i=*ptr-1; i>=0; i--)
3192 basic_filebuf_wchar_dtor(this+i);
3193 MSVCRT_operator_delete(ptr);
3194 } else {
3195 basic_filebuf_wchar_dtor(this);
3196 if(flags & 1)
3197 MSVCRT_operator_delete(this);
3200 return this;
3203 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3204 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3205 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3206 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3207 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3208 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3210 TRACE("(%p)\n", this);
3211 return this->file != NULL;
3214 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3215 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3216 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3217 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3218 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3219 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3221 FILE *f = NULL;
3223 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3225 if(basic_filebuf_wchar_is_open(this))
3226 return NULL;
3228 if(!(f = _Fiopen_wchar(name, mode, prot)))
3229 return NULL;
3231 basic_filebuf_wchar__Init(this, f, INITFL_open);
3232 basic_filebuf_wchar__Initcvt(this);
3233 return this;
3236 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3237 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3238 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3239 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3241 wchar_t nameW[FILENAME_MAX];
3243 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3245 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3246 return NULL;
3247 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3250 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
3251 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
3252 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
3253 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
3255 TRACE("(%p %p %d)\n", this, name, mode);
3256 return basic_filebuf_wchar_open(this, name, mode, _SH_DENYNO);
3259 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
3260 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
3261 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3262 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, int mode)
3264 TRACE("(%p %p %d)\n", this, name, mode);
3265 return basic_filebuf_wchar_open(this, name, mode, _SH_DENYNO);
3268 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3269 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3270 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3271 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3272 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3273 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3275 char *ptr, *to_next;
3276 wchar_t ch = c;
3277 const wchar_t *from_next;
3278 unsigned short ret;
3281 TRACE("(%p %d)\n", this, c);
3283 if(!basic_filebuf_wchar_is_open(this))
3284 return WEOF;
3285 if(c == WEOF)
3286 return !c;
3288 if(!this->cvt)
3289 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3291 from_next = &ch;
3292 MSVCP_basic_string_char_clear(this->str);
3293 MSVCP_basic_string_char_append_len_ch(this->str, 8, '\0');
3294 ptr = this->str->ptr;
3295 ret = codecvt_wchar_out(this->cvt, &this->state, &ch, &ch+1, &from_next,
3296 ptr, ptr+MSVCP_basic_string_char_length(this->str), &to_next);
3298 switch(ret) {
3299 case CODECVT_partial:
3300 if(from_next == &ch)
3301 return WEOF;
3302 /* fall through */
3303 case CODECVT_ok:
3304 if(!fwrite(ptr, to_next-ptr, 1, this->file))
3305 return WEOF;
3306 return c;
3307 case CODECVT_noconv:
3308 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3309 default:
3310 return WEOF;
3314 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3315 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3316 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3317 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3318 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3319 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3321 TRACE("(%p %d)\n", this, c);
3323 if(!basic_filebuf_wchar_is_open(this))
3324 return WEOF;
3326 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3327 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3328 basic_streambuf_wchar__Gndec(&this->base);
3329 return c==WEOF ? !c : c;
3330 }else if(c == WEOF) {
3331 return WEOF;
3332 }else if(!this->cvt) {
3333 return ungetwc(c, this->file);
3334 }else if(MSVCP_basic_string_char_length(this->str)) {
3335 char *b, *e, *cur;
3337 e = this->str->ptr;
3338 b = e+this->str->size-1;
3339 for(cur = b; cur>=e; cur--) {
3340 if(ungetc(*cur, this->file) == EOF) {
3341 for(; cur<=b; cur++)
3342 fgetc(this->file);
3343 return WEOF;
3346 MSVCP_basic_string_char_clear(this->str);
3347 this->state = this->state0;
3348 return c;
3351 return WEOF;
3354 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3355 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3356 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3357 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3358 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
3359 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
3361 wchar_t ch, *to_next;
3362 const char *buf_next;
3363 int c;
3365 TRACE("(%p)\n", this);
3367 if(!basic_filebuf_wchar_is_open(this))
3368 return WEOF;
3370 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3371 return *basic_streambuf_wchar__Gninc(&this->base);
3373 if(!this->cvt)
3374 return fgetwc(this->file);
3376 MSVCP_basic_string_char_clear(this->str);
3377 this->state0 = this->state;
3378 while(1) {
3379 if((c = fgetc(this->file)) == EOF)
3380 return WEOF;
3381 MSVCP_basic_string_char_append_ch(this->str, c);
3382 this->state = this->state0;
3384 switch(codecvt_wchar_in(this->cvt, &this->state, this->str->ptr,
3385 this->str->ptr+this->str->size, &buf_next, &ch, &ch+1, &to_next)) {
3386 case CODECVT_partial:
3387 break;
3388 case CODECVT_noconv:
3389 if(this->str->size < sizeof(unsigned short)/sizeof(char))
3390 break;
3391 return *(unsigned short*)this->str->ptr;
3392 case CODECVT_ok:
3393 return (unsigned short)ch;
3394 default:
3395 return WEOF;
3400 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3401 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3402 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3403 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3404 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
3405 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
3407 unsigned short ret;
3409 TRACE("(%p)\n", this);
3411 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3412 return *basic_streambuf_wchar_gptr(&this->base);
3414 ret = call_basic_streambuf_wchar_uflow(&this->base);
3415 if(ret != WEOF)
3416 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
3417 return ret;
3420 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3421 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3422 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3423 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3424 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3425 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3426 #if STREAMOFF_BITS == 64
3427 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
3428 #else
3429 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
3430 #endif
3431 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
3432 fpos_int *ret, streamoff off, int way, int mode)
3434 fpos_t pos;
3436 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3438 if(!basic_filebuf_wchar_is_open(this) || fseek(this->file, off, way)) {
3439 ret->off = -1;
3440 ret->pos = 0;
3441 ret->state = 0;
3442 return ret;
3445 fgetpos(this->file, &pos);
3446 ret->off = 0;
3447 ret->pos = pos;
3448 ret->state = this->state;
3449 return ret;
3452 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3453 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3454 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3455 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3456 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
3457 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
3458 fpos_int *ret, fpos_int pos, int mode)
3460 fpos_t fpos;
3462 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3464 if(!basic_filebuf_wchar_is_open(this) || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3465 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3466 ret->off = -1;
3467 ret->pos = 0;
3468 ret->state = 0;
3469 return ret;
3472 fgetpos(this->file, &fpos);
3473 ret->off = 0;
3474 ret->pos = fpos;
3475 ret->state = this->state;
3476 return ret;
3479 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
3480 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
3481 #if STREAMSIZE_BITS == 64
3482 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
3483 #else
3484 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
3485 #endif
3486 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3488 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3490 if(!basic_filebuf_wchar_is_open(this))
3491 return NULL;
3493 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3494 return NULL;
3496 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
3497 return &this->base;
3500 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
3501 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
3502 #if STREAMSIZE_BITS == 64
3503 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
3504 #else
3505 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
3506 #endif
3507 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3509 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3511 if(!basic_filebuf_wchar_is_open(this))
3512 return NULL;
3514 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3515 return NULL;
3517 basic_filebuf_short__Init(this, this->file, INITFL_open);
3518 return &this->base;
3521 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
3522 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
3523 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
3524 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
3525 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
3526 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
3528 TRACE("(%p)\n", this);
3530 if(!basic_filebuf_wchar_is_open(this))
3531 return 0;
3533 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3534 return 0;
3535 return fflush(this->file);
3538 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3539 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3540 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3541 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3542 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
3543 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
3545 int state = 0;
3547 if(!(mode & OPENMODE_in))
3548 state |= STRINGBUF_no_read;
3550 if(!(mode & OPENMODE_out))
3551 state |= STRINGBUF_no_write;
3553 if(mode & OPENMODE_ate)
3554 state |= STRINGBUF_at_end;
3556 if(mode & OPENMODE_app)
3557 state |= STRINGBUF_append;
3559 return state;
3562 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
3563 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
3564 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
3565 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
3567 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
3569 basic_streambuf_char__Init_empty(&this->base);
3571 this->state = state;
3572 this->seekhigh = NULL;
3574 if(count && str) {
3575 char *buf = MSVCRT_operator_new(count);
3576 if(!buf) {
3577 ERR("Out of memory\n");
3578 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3581 memcpy(buf, str, count);
3582 this->seekhigh = buf + count;
3584 this->state |= STRINGBUF_allocated;
3586 if(!(state & STRINGBUF_no_read))
3587 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
3589 if(!(state & STRINGBUF_no_write)) {
3590 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3592 if(!basic_streambuf_char_gptr(&this->base))
3593 basic_streambuf_char_setg(&this->base, buf, 0, buf);
3598 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
3599 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
3600 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
3601 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
3602 const basic_string_char *str, IOSB_openmode mode)
3604 TRACE("(%p %p %d)\n", this, str, mode);
3606 basic_streambuf_char_ctor(&this->base);
3607 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3609 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
3610 str->size, basic_stringbuf_char__Getstate(this, mode));
3611 return this;
3614 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
3615 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
3616 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
3617 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
3618 basic_stringbuf_char *this, IOSB_openmode mode)
3620 TRACE("(%p %d)\n", this, mode);
3622 basic_streambuf_char_ctor(&this->base);
3623 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3625 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
3626 return this;
3629 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
3630 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
3631 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
3632 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
3634 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
3637 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
3638 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
3639 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
3640 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
3642 TRACE("(%p)\n", this);
3644 if(this->state & STRINGBUF_allocated) {
3645 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
3646 this->seekhigh = NULL;
3647 this->state &= ~STRINGBUF_allocated;
3650 basic_streambuf_char__Init_empty(&this->base);
3653 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
3654 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
3655 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
3656 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
3658 TRACE("(%p)\n", this);
3660 basic_stringbuf_char__Tidy(this);
3661 basic_streambuf_char_dtor(&this->base);
3664 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
3665 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
3667 TRACE("(%p %x)\n", this, flags);
3669 if(flags & 2) {
3670 /* we have an array, with the number of elements stored before the first object */
3671 INT_PTR i, *ptr = (INT_PTR *) this - 1;
3673 for (i = *ptr - 1; i >= 0; i--)
3674 basic_stringbuf_char_dtor(this+i);
3676 MSVCRT_operator_delete(ptr);
3677 }else {
3678 basic_stringbuf_char_dtor(this);
3680 if(flags & 1)
3681 MSVCRT_operator_delete(this);
3684 return this;
3687 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
3688 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
3689 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
3690 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
3692 MSVCP_size_t oldsize, size;
3693 char *ptr, *buf;
3695 TRACE("(%p %x)\n", this, meta);
3697 if(meta == EOF)
3698 return !EOF;
3699 if(this->state & STRINGBUF_no_write)
3700 return EOF;
3702 ptr = basic_streambuf_char_pptr(&this->base);
3703 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
3704 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
3705 this->seekhigh, basic_streambuf_char_epptr(&this->base));
3707 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
3708 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
3710 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
3711 size = oldsize|0xf;
3712 size += size/2;
3713 buf = MSVCRT_operator_new(size);
3714 if(!buf) {
3715 ERR("Out of memory\n");
3716 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3719 if(!oldsize) {
3720 this->seekhigh = buf;
3721 basic_streambuf_char_setp(&this->base, buf, buf+size);
3722 if(this->state & STRINGBUF_no_read)
3723 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
3724 else
3725 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
3727 this->state |= STRINGBUF_allocated;
3728 }else {
3729 ptr = basic_streambuf_char_eback(&this->base);
3730 memcpy(buf, ptr, oldsize);
3732 this->seekhigh = buf+(this->seekhigh-ptr);
3733 basic_streambuf_char_setp_next(&this->base, buf,
3734 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
3735 if(this->state & STRINGBUF_no_read)
3736 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
3737 else
3738 basic_streambuf_char_setg(&this->base, buf,
3739 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
3740 basic_streambuf_char_pptr(&this->base)+1);
3742 MSVCRT_operator_delete(ptr);
3745 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
3748 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
3749 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
3750 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
3751 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
3753 char *cur;
3755 TRACE("(%p %x)\n", this, c);
3757 cur = basic_streambuf_char_gptr(&this->base);
3758 if(!cur || cur==basic_streambuf_char_eback(&this->base)
3759 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
3760 return EOF;
3762 if(c != EOF)
3763 cur[-1] = c;
3764 basic_streambuf_char_gbump(&this->base, -1);
3765 return c==EOF ? !EOF : c;
3768 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
3769 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
3770 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
3771 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
3773 char *ptr, *cur;
3775 TRACE("(%p)\n", this);
3777 cur = basic_streambuf_char_gptr(&this->base);
3778 if(!cur || this->state&STRINGBUF_no_read)
3779 return EOF;
3781 ptr = basic_streambuf_char_pptr(&this->base);
3782 if(this->seekhigh < ptr)
3783 this->seekhigh = ptr;
3785 ptr = basic_streambuf_char_egptr(&this->base);
3786 if(this->seekhigh > ptr)
3787 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
3789 if(cur < this->seekhigh)
3790 return (unsigned char)*cur;
3791 return EOF;
3794 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3795 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3796 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3797 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3798 #if STREAMOFF_BITS == 64
3799 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
3800 #else
3801 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
3802 #endif
3803 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
3804 fpos_int *ret, streamoff off, int way, int mode)
3806 char *beg, *cur_r, *cur_w;
3808 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3810 cur_w = basic_streambuf_char_pptr(&this->base);
3811 if(cur_w > this->seekhigh)
3812 this->seekhigh = cur_w;
3814 ret->off = 0;
3815 ret->pos = 0;
3816 ret->state = 0;
3818 beg = basic_streambuf_char_eback(&this->base);
3819 cur_r = basic_streambuf_char_gptr(&this->base);
3820 if((mode & OPENMODE_in) && cur_r) {
3821 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
3822 off += cur_r-beg;
3823 else if(way == SEEKDIR_end)
3824 off += this->seekhigh-beg;
3825 else if(way != SEEKDIR_beg)
3826 off = -1;
3828 if(off<0 || off>this->seekhigh-beg) {
3829 off = -1;
3830 }else {
3831 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
3832 if((mode & OPENMODE_out) && cur_w) {
3833 basic_streambuf_char_setp_next(&this->base, beg,
3834 basic_streambuf_char_gptr(&this->base),
3835 basic_streambuf_char_epptr(&this->base));
3838 }else if((mode & OPENMODE_out) && cur_w) {
3839 if(way == SEEKDIR_cur)
3840 off += cur_w-beg;
3841 else if(way == SEEKDIR_end)
3842 off += this->seekhigh-beg;
3843 else if(way != SEEKDIR_beg)
3844 off = -1;
3846 if(off<0 || off>this->seekhigh-beg)
3847 off = -1;
3848 else
3849 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
3850 }else {
3851 off = -1;
3854 ret->off = off;
3855 return ret;
3858 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3859 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3860 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
3861 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
3862 fpos_int *ret, fpos_int pos, int mode)
3864 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3866 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
3867 *ret = pos;
3868 return ret;
3871 return basic_stringbuf_char_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
3874 /* ?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
3875 /* ?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
3876 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
3877 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
3879 TRACE("(%p %p)\n", this, str);
3881 basic_stringbuf_char__Tidy(this);
3882 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
3885 /* ?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3886 /* ?str@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3887 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
3888 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
3890 char *ptr;
3892 TRACE("(%p)\n", this);
3894 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
3895 char *pptr;
3897 ptr = basic_streambuf_char_pbase(&this->base);
3898 pptr = basic_streambuf_char_pptr(&this->base);
3900 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
3903 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
3904 ptr = basic_streambuf_char_eback(&this->base);
3905 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
3908 return MSVCP_basic_string_char_ctor(ret);
3911 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
3912 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
3913 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
3914 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
3915 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
3916 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
3917 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
3918 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
3920 int state = 0;
3922 if(!(mode & OPENMODE_in))
3923 state |= STRINGBUF_no_read;
3925 if(!(mode & OPENMODE_out))
3926 state |= STRINGBUF_no_write;
3928 if(mode & OPENMODE_ate)
3929 state |= STRINGBUF_at_end;
3931 if(mode & OPENMODE_app)
3932 state |= STRINGBUF_append;
3934 return state;
3937 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
3938 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
3939 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
3940 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
3941 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
3942 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
3944 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
3946 basic_streambuf_wchar__Init_empty(&this->base);
3948 this->state = state;
3949 this->seekhigh = NULL;
3951 if(count && str) {
3952 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
3953 if(!buf) {
3954 ERR("Out of memory\n");
3955 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3958 memcpy(buf, str, count*sizeof(wchar_t));
3959 this->seekhigh = buf + count;
3961 this->state |= STRINGBUF_allocated;
3963 if(!(state & STRINGBUF_no_read))
3964 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
3966 if(!(state & STRINGBUF_no_write)) {
3967 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3969 if(!basic_streambuf_wchar_gptr(&this->base))
3970 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
3975 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
3976 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
3977 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
3978 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
3979 const basic_string_wchar *str, IOSB_openmode mode)
3981 TRACE("(%p %p %d)\n", this, str, mode);
3983 basic_streambuf_wchar_ctor(&this->base);
3984 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
3986 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
3987 str->size, basic_stringbuf_wchar__Getstate(this, mode));
3988 return this;
3991 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
3992 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@AEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
3993 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
3994 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
3995 const basic_string_wchar *str, IOSB_openmode mode)
3997 basic_stringbuf_wchar_ctor_str(this, str, mode);
3998 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
3999 return this;
4002 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4003 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4004 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4005 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4006 basic_stringbuf_wchar *this, IOSB_openmode mode)
4008 TRACE("(%p %d)\n", this, mode);
4010 basic_streambuf_wchar_ctor(&this->base);
4011 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4013 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4014 return this;
4017 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4018 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4019 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4020 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4021 basic_stringbuf_wchar *this, IOSB_openmode mode)
4023 basic_stringbuf_wchar_ctor_mode(this, mode);
4024 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4025 return this;
4028 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4029 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4030 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4031 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4033 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4036 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4037 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4038 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4039 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4041 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4044 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4045 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4046 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4047 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4048 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4049 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4051 TRACE("(%p)\n", this);
4053 if(this->state & STRINGBUF_allocated) {
4054 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4055 this->seekhigh = NULL;
4056 this->state &= ~STRINGBUF_allocated;
4059 basic_streambuf_wchar__Init_empty(&this->base);
4062 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4063 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4064 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4065 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4066 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4067 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4069 TRACE("(%p)\n", this);
4071 basic_stringbuf_wchar__Tidy(this);
4072 basic_streambuf_wchar_dtor(&this->base);
4075 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4076 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4078 TRACE("(%p %x)\n", this, flags);
4080 if(flags & 2) {
4081 /* we have an array, with the number of elements stored before the first object */
4082 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4084 for (i = *ptr - 1; i >= 0; i--)
4085 basic_stringbuf_wchar_dtor(this+i);
4087 MSVCRT_operator_delete(ptr);
4088 }else {
4089 basic_stringbuf_wchar_dtor(this);
4091 if(flags & 1)
4092 MSVCRT_operator_delete(this);
4095 return this;
4098 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4099 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4100 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4101 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4102 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4103 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4105 MSVCP_size_t oldsize, size;
4106 wchar_t *ptr, *buf;
4108 TRACE("(%p %x)\n", this, meta);
4110 if(meta == WEOF)
4111 return !WEOF;
4112 if(this->state & STRINGBUF_no_write)
4113 return WEOF;
4115 ptr = basic_streambuf_wchar_pptr(&this->base);
4116 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4117 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4118 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4120 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4121 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4123 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4124 size = oldsize|0xf;
4125 size += size/2;
4126 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4127 if(!buf) {
4128 ERR("Out of memory\n");
4129 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4132 if(!oldsize) {
4133 this->seekhigh = buf;
4134 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4135 if(this->state & STRINGBUF_no_read)
4136 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4137 else
4138 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4140 this->state |= STRINGBUF_allocated;
4141 }else {
4142 ptr = basic_streambuf_wchar_eback(&this->base);
4143 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4145 this->seekhigh = buf+(this->seekhigh-ptr);
4146 basic_streambuf_wchar_setp_next(&this->base, buf,
4147 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4148 if(this->state & STRINGBUF_no_read)
4149 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4150 else
4151 basic_streambuf_wchar_setg(&this->base, buf,
4152 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4153 basic_streambuf_wchar_pptr(&this->base)+1);
4155 MSVCRT_operator_delete(ptr);
4158 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4161 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4162 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4163 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4164 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4165 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4166 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4168 wchar_t *cur;
4170 TRACE("(%p %x)\n", this, c);
4172 cur = basic_streambuf_wchar_gptr(&this->base);
4173 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4174 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4175 return WEOF;
4177 if(c != WEOF)
4178 cur[-1] = c;
4179 basic_streambuf_wchar_gbump(&this->base, -1);
4180 return c==WEOF ? !WEOF : c;
4183 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4184 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4185 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4186 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4187 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4188 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4190 wchar_t *ptr, *cur;
4192 TRACE("(%p)\n", this);
4194 cur = basic_streambuf_wchar_gptr(&this->base);
4195 if(!cur || this->state&STRINGBUF_no_read)
4196 return WEOF;
4198 ptr = basic_streambuf_wchar_pptr(&this->base);
4199 if(this->seekhigh < ptr)
4200 this->seekhigh = ptr;
4202 ptr = basic_streambuf_wchar_egptr(&this->base);
4203 if(this->seekhigh > ptr)
4204 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4206 if(cur < this->seekhigh)
4207 return *cur;
4208 return WEOF;
4211 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4212 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4213 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4214 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4215 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4216 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4217 #if STREAMOFF_BITS == 64
4218 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4219 #else
4220 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4221 #endif
4222 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4223 fpos_int *ret, streamoff off, int way, int mode)
4225 wchar_t *beg, *cur_r, *cur_w;
4227 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4229 cur_w = basic_streambuf_wchar_pptr(&this->base);
4230 if(cur_w > this->seekhigh)
4231 this->seekhigh = cur_w;
4233 ret->off = 0;
4234 ret->pos = 0;
4235 ret->state = 0;
4237 beg = basic_streambuf_wchar_eback(&this->base);
4238 cur_r = basic_streambuf_wchar_gptr(&this->base);
4239 if((mode & OPENMODE_in) && cur_r) {
4240 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4241 off += cur_r-beg;
4242 else if(way == SEEKDIR_end)
4243 off += this->seekhigh-beg;
4244 else if(way != SEEKDIR_beg)
4245 off = -1;
4247 if(off<0 || off>this->seekhigh-beg) {
4248 off = -1;
4249 }else {
4250 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4251 if((mode & OPENMODE_out) && cur_w) {
4252 basic_streambuf_wchar_setp_next(&this->base, beg,
4253 basic_streambuf_wchar_gptr(&this->base),
4254 basic_streambuf_wchar_epptr(&this->base));
4257 }else if((mode & OPENMODE_out) && cur_w) {
4258 if(way == SEEKDIR_cur)
4259 off += cur_w-beg;
4260 else if(way == SEEKDIR_end)
4261 off += this->seekhigh-beg;
4262 else if(way != SEEKDIR_beg)
4263 off = -1;
4265 if(off<0 || off>this->seekhigh-beg)
4266 off = -1;
4267 else
4268 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4269 }else {
4270 off = -1;
4273 ret->off = off;
4274 return ret;
4277 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4278 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4279 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4280 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4281 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4282 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4283 fpos_int *ret, fpos_int pos, int mode)
4285 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4287 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4288 *ret = pos;
4289 return ret;
4292 return basic_stringbuf_wchar_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
4295 /* ?str@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
4296 /* ?str@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
4297 /* ?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
4298 /* ?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
4299 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4300 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4302 TRACE("(%p %p)\n", this, str);
4304 basic_stringbuf_wchar__Tidy(this);
4305 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
4308 /* ?str@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4309 /* ?str@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4310 /* ?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4311 /* ?str@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4312 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
4313 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
4315 wchar_t *ptr;
4317 TRACE("(%p)\n", this);
4319 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
4320 wchar_t *pptr;
4322 ptr = basic_streambuf_wchar_pbase(&this->base);
4323 pptr = basic_streambuf_wchar_pptr(&this->base);
4325 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4328 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
4329 ptr = basic_streambuf_wchar_eback(&this->base);
4330 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
4333 return MSVCP_basic_string_wchar_ctor(ret);
4336 /* ??0ios_base@std@@IAE@XZ */
4337 /* ??0ios_base@std@@IEAA@XZ */
4338 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
4339 ios_base* __thiscall ios_base_ctor(ios_base *this)
4341 TRACE("(%p)\n", this);
4342 this->vtable = &MSVCP_ios_base_vtable;
4343 locale_ctor_uninitialized(IOS_LOCALE(this), 0);
4344 return this;
4347 /* ??0ios_base@std@@QAE@ABV01@@Z */
4348 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
4349 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
4350 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
4352 TRACE("(%p %p)\n", this, copy);
4353 *this = *copy;
4354 this->vtable = &MSVCP_ios_base_vtable;
4355 return this;
4358 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
4359 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
4360 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
4361 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
4363 IOS_BASE_fnarray *cur;
4365 TRACE("(%p %x)\n", this, event);
4367 for(cur=this->calls; cur; cur=cur->next)
4368 cur->event_handler(event, this, cur->index);
4371 /* ?_Tidy@ios_base@std@@AAAXXZ */
4372 /* ?_Tidy@ios_base@std@@AEAAXXZ */
4373 void __cdecl ios_base_Tidy(ios_base *this)
4375 IOS_BASE_iosarray *arr_cur, *arr_next;
4376 IOS_BASE_fnarray *event_cur, *event_next;
4378 TRACE("(%p)\n", this);
4380 ios_base_Callfns(this, EVENT_erase_event);
4382 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
4383 arr_next = arr_cur->next;
4384 MSVCRT_operator_delete(arr_cur);
4386 this->arr = NULL;
4388 for(event_cur=this->calls; event_cur; event_cur=event_next) {
4389 event_next = event_cur->next;
4390 MSVCRT_operator_delete(event_cur);
4392 this->calls = NULL;
4395 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
4396 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
4397 void __cdecl ios_base_Ios_base_dtor(ios_base *obj)
4399 TRACE("(%p)\n", obj);
4400 locale_dtor(IOS_LOCALE(obj));
4401 ios_base_Tidy(obj);
4404 /* ??1ios_base@std@@UAE@XZ */
4405 /* ??1ios_base@std@@UEAA@XZ */
4406 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
4407 void __thiscall ios_base_dtor(ios_base *this)
4409 ios_base_Ios_base_dtor(this);
4412 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
4413 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
4415 TRACE("(%p %x)\n", this, flags);
4416 if(flags & 2) {
4417 /* we have an array, with the number of elements stored before the first object */
4418 INT_PTR i, *ptr = (INT_PTR *)this-1;
4420 for(i=*ptr-1; i>=0; i--)
4421 ios_base_dtor(this+i);
4422 MSVCRT_operator_delete(ptr);
4423 } else {
4424 ios_base_dtor(this);
4425 if(flags & 1)
4426 MSVCRT_operator_delete(this);
4429 return this;
4432 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
4433 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
4435 TRACE("(%p %x)\n", this, flags);
4436 if(flags & 2) {
4437 INT_PTR *ptr = (INT_PTR *)this-1;
4438 MSVCRT_operator_delete(ptr);
4439 } else {
4440 if(flags & 1)
4441 MSVCRT_operator_delete(this);
4444 return this;
4447 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
4448 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
4449 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
4450 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
4452 IOS_BASE_iosarray *p;
4454 TRACE("(%p %d)\n", this, index);
4456 for(p=this->arr; p; p=p->next) {
4457 if(p->index == index)
4458 return p;
4461 for(p=this->arr; p; p=p->next) {
4462 if(!p->long_val && !p->ptr_val) {
4463 p->index = index;
4464 return p;
4468 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
4469 p->next = this->arr;
4470 p->index = index;
4471 p->long_val = 0;
4472 p->ptr_val = NULL;
4473 this->arr = p;
4474 return p;
4477 /* ?iword@ios_base@std@@QAEAAJH@Z */
4478 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
4479 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
4480 LONG* __thiscall ios_base_iword(ios_base *this, int index)
4482 TRACE("(%p %d)\n", this, index);
4483 return &ios_base_Findarr(this, index)->long_val;
4486 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
4487 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
4488 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
4489 void** __thiscall ios_base_pword(ios_base *this, int index)
4491 TRACE("(%p %d)\n", this, index);
4492 return &ios_base_Findarr(this, index)->ptr_val;
4495 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
4496 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
4497 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
4498 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
4500 IOS_BASE_fnarray *event;
4502 TRACE("(%p %p %d)\n", this, callback, index);
4504 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
4505 event->next = this->calls;
4506 event->index = index;
4507 event->event_handler = callback;
4508 this->calls = event;
4511 /* ?clear@ios_base@std@@QAEXH_N@Z */
4512 /* ?clear@ios_base@std@@QEAAXH_N@Z */
4513 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
4514 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4516 TRACE("(%p %x %x)\n", this, state, reraise);
4518 this->state = state & IOSTATE_mask;
4519 if(!(this->state & this->except))
4520 return;
4522 if(reraise)
4523 throw_exception(EXCEPTION_RERAISE, NULL);
4524 else if(this->state & this->except & IOSTATE_eofbit)
4525 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
4526 else if(this->state & this->except & IOSTATE_failbit)
4527 throw_exception(EXCEPTION_FAILURE, "failbit is set");
4528 else if(this->state & this->except & IOSTATE_badbit)
4529 throw_exception(EXCEPTION_FAILURE, "badbit is set");
4530 else if(this->state & this->except & IOSTATE__Hardfail)
4531 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
4534 /* ?clear@ios_base@std@@QAEXH@Z */
4535 /* ?clear@ios_base@std@@QEAAXH@Z */
4536 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
4537 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
4539 ios_base_clear_reraise(this, state, FALSE);
4542 /* ?clear@ios_base@std@@QAEXI@Z */
4543 /* ?clear@ios_base@std@@QEAAXI@Z */
4544 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
4545 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
4547 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
4550 /* ?exceptions@ios_base@std@@QAEXH@Z */
4551 /* ?exceptions@ios_base@std@@QEAAXH@Z */
4552 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
4553 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
4555 TRACE("(%p %x)\n", this, state);
4556 this->except = state & IOSTATE_mask;
4557 ios_base_clear(this, this->state);
4560 /* ?exceptions@ios_base@std@@QAEXI@Z */
4561 /* ?exceptions@ios_base@std@@QEAAXI@Z */
4562 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
4563 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
4565 TRACE("(%p %x)\n", this, state);
4566 ios_base_exceptions_set(this, state);
4569 /* ?exceptions@ios_base@std@@QBEHXZ */
4570 /* ?exceptions@ios_base@std@@QEBAHXZ */
4571 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
4572 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
4574 TRACE("(%p)\n", this);
4575 return this->except;
4578 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
4579 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
4580 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
4581 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
4583 TRACE("(%p %p)\n", this, rhs);
4585 if(this != rhs) {
4586 IOS_BASE_iosarray *arr_cur;
4587 IOS_BASE_fnarray *event_cur;
4589 ios_base_Tidy(this);
4591 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
4592 if(arr_cur->long_val)
4593 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
4594 if(arr_cur->ptr_val)
4595 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
4597 this->stdstr = rhs->stdstr;
4598 this->fmtfl = rhs->fmtfl;
4599 this->prec = rhs->prec;
4600 this->wide = rhs->wide;
4601 locale_operator_assign(IOS_LOCALE(this), IOS_LOCALE(rhs));
4603 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
4604 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
4606 ios_base_Callfns(this, EVENT_copyfmt_event);
4607 ios_base_exceptions_set(this, rhs->except);
4610 return this;
4613 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
4614 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
4615 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
4616 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
4618 TRACE("(%p %p)\n", this, right);
4620 if(this != right) {
4621 this->state = right->state;
4622 ios_base_copyfmt(this, right);
4625 return this;
4628 /* ?fail@ios_base@std@@QBE_NXZ */
4629 /* ?fail@ios_base@std@@QEBA_NXZ */
4630 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
4631 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
4633 TRACE("(%p)\n", this);
4634 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
4637 /* ??7ios_base@std@@QBE_NXZ */
4638 /* ??7ios_base@std@@QEBA_NXZ */
4639 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
4640 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
4642 TRACE("(%p)\n", this);
4643 return ios_base_fail(this);
4646 /* ??Bios_base@std@@QBEPAXXZ */
4647 /* ??Bios_base@std@@QEBAPEAXXZ */
4648 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
4649 void* __thiscall ios_base_op_fail(const ios_base *this)
4651 TRACE("(%p)\n", this);
4652 return ios_base_fail(this) ? NULL : (void*)this;
4655 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
4656 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
4657 void __cdecl ios_base_Addstd(ios_base *add)
4659 FIXME("(%p) stub\n", add);
4662 /* ?_Index_func@ios_base@std@@CAAAHXZ */
4663 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
4664 int* __cdecl ios_base_Index_func(void)
4666 TRACE("\n");
4667 return &ios_base_Index;
4670 /* ?_Init@ios_base@std@@IAEXXZ */
4671 /* ?_Init@ios_base@std@@IEAAXXZ */
4672 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
4673 void __thiscall ios_base__Init(ios_base *this)
4675 TRACE("(%p)\n", this);
4677 this->stdstr = 0;
4678 this->state = this->except = IOSTATE_goodbit;
4679 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
4680 this->prec = 6;
4681 this->wide = 0;
4682 this->arr = NULL;
4683 this->calls = NULL;
4684 locale_ctor(IOS_LOCALE(this));
4687 /* ?bad@ios_base@std@@QBE_NXZ */
4688 /* ?bad@ios_base@std@@QEBA_NXZ */
4689 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
4690 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
4692 TRACE("(%p)\n", this);
4693 return (this->state & IOSTATE_badbit) != 0;
4696 /* ?eof@ios_base@std@@QBE_NXZ */
4697 /* ?eof@ios_base@std@@QEBA_NXZ */
4698 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
4699 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
4701 TRACE("(%p)\n", this);
4702 return (this->state & IOSTATE_eofbit) != 0;
4705 /* ?flags@ios_base@std@@QAEHH@Z */
4706 /* ?flags@ios_base@std@@QEAAHH@Z */
4707 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
4708 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
4710 IOSB_fmtflags ret = this->fmtfl;
4712 TRACE("(%p %x)\n", this, flags);
4714 this->fmtfl = flags & FMTFLAG_mask;
4715 return ret;
4718 /* ?flags@ios_base@std@@QBEHXZ */
4719 /* ?flags@ios_base@std@@QEBAHXZ */
4720 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
4721 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
4723 TRACE("(%p)\n", this);
4724 return this->fmtfl;
4727 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
4728 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
4729 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
4730 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
4732 TRACE("(%p)\n", this);
4733 return locale_copy_ctor(ret, IOS_LOCALE(this));
4736 /* ?good@ios_base@std@@QBE_NXZ */
4737 /* ?good@ios_base@std@@QEBA_NXZ */
4738 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
4739 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
4741 TRACE("(%p)\n", this);
4742 return this->state == IOSTATE_goodbit;
4745 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
4746 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
4747 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
4748 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
4750 TRACE("(%p %p)\n", this, loc);
4751 *ret = *IOS_LOCALE(this);
4752 locale_copy_ctor(IOS_LOCALE(this), loc);
4753 return ret;
4756 /* ?precision@ios_base@std@@QAEHH@Z */
4757 /* ?precision@ios_base@std@@QEAA_J_J@Z */
4758 #if STREAMSIZE_BITS == 64
4759 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
4760 #else
4761 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
4762 #endif
4763 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
4765 streamsize ret = this->prec;
4767 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
4769 this->prec = precision;
4770 return ret;
4773 /* ?precision@ios_base@std@@QBEHXZ */
4774 /* ?precision@ios_base@std@@QEBA_JXZ */
4775 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
4776 streamsize __thiscall ios_base_precision_get(const ios_base *this)
4778 TRACE("(%p)\n", this);
4779 return this->prec;
4782 /* ?rdstate@ios_base@std@@QBEHXZ */
4783 /* ?rdstate@ios_base@std@@QEBAHXZ */
4784 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
4785 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
4787 TRACE("(%p)\n", this);
4788 return this->state;
4791 /* ?setf@ios_base@std@@QAEHHH@Z */
4792 /* ?setf@ios_base@std@@QEAAHHH@Z */
4793 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
4794 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
4796 IOSB_fmtflags ret = this->fmtfl;
4798 TRACE("(%p %x %x)\n", this, flags, mask);
4800 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
4801 return ret;
4804 /* ?setf@ios_base@std@@QAEHH@Z */
4805 /* ?setf@ios_base@std@@QEAAHH@Z */
4806 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
4807 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
4809 IOSB_fmtflags ret = this->fmtfl;
4811 TRACE("(%p %x)\n", this, flags);
4813 this->fmtfl |= flags & FMTFLAG_mask;
4814 return ret;
4817 /* ?setstate@ios_base@std@@QAEXH_N@Z */
4818 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
4819 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
4820 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4822 TRACE("(%p %x %x)\n", this, state, reraise);
4824 if(state != IOSTATE_goodbit)
4825 ios_base_clear_reraise(this, this->state | state, reraise);
4828 /* ?setstate@ios_base@std@@QAEXH@Z */
4829 /* ?setstate@ios_base@std@@QEAAXH@Z */
4830 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
4831 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
4833 ios_base_setstate_reraise(this, state, FALSE);
4836 /* ?setstate@ios_base@std@@QAEXI@Z */
4837 /* ?setstate@ios_base@std@@QEAAXI@Z */
4838 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
4839 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
4841 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
4844 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
4845 MSVCP_bool __cdecl ios_base_sync_with_stdio(MSVCP_bool sync)
4847 _Lockit lock;
4848 MSVCP_bool ret;
4850 TRACE("(%x)\n", sync);
4852 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
4853 ret = ios_base_Sync;
4854 ios_base_Sync = sync;
4855 _Lockit_dtor(&lock);
4856 return ret;
4859 /* ?unsetf@ios_base@std@@QAEXH@Z */
4860 /* ?unsetf@ios_base@std@@QEAAXH@Z */
4861 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
4862 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
4864 TRACE("(%p %x)\n", this, flags);
4865 this->fmtfl &= ~flags;
4868 /* ?width@ios_base@std@@QAEHH@Z */
4869 /* ?width@ios_base@std@@QEAA_J_J@Z */
4870 #if STREAMSIZE_BITS == 64
4871 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
4872 #else
4873 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
4874 #endif
4875 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
4877 streamsize ret = this->wide;
4879 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
4881 this->wide = width;
4882 return ret;
4885 /* ?width@ios_base@std@@QBEHXZ */
4886 /* ?width@ios_base@std@@QEBA_JXZ */
4887 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
4888 streamsize __thiscall ios_base_width_get(ios_base *this)
4890 TRACE("(%p)\n", this);
4891 return this->wide;
4894 /* ?xalloc@ios_base@std@@SAHXZ */
4895 int __cdecl ios_base_xalloc(void)
4897 _Lockit lock;
4898 int ret;
4900 TRACE("\n");
4902 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
4903 ret = ios_base_Index++;
4904 _Lockit_dtor(&lock);
4905 return ret;
4908 /* ?swap@ios_base@std@@QAEXAAV12@@Z */
4909 /* ?swap@ios_base@std@@QEAAXAEAV12@@Z */
4910 DEFINE_THISCALL_WRAPPER(ios_base_swap, 8)
4911 void __thiscall ios_base_swap(ios_base *this, ios_base *r)
4913 ios_base tmp;
4915 TRACE("(%p %p)\n", this, r);
4917 if(this == r)
4918 return;
4920 tmp = *this;
4921 *this = *r;
4922 this->vtable = tmp.vtable;
4923 tmp.vtable = r->vtable;
4924 *r = tmp;
4927 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
4928 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
4929 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
4930 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
4932 TRACE("(%p)\n", this);
4934 ios_base_ctor(&this->base);
4935 this->base.vtable = &MSVCP_basic_ios_char_vtable;
4936 return this;
4939 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
4940 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
4941 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
4942 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
4944 TRACE("(%p %p %x)\n", this, streambuf, isstd);
4945 ios_base__Init(&this->base);
4946 this->strbuf = streambuf;
4947 this->stream = NULL;
4948 this->fillch = ' ';
4950 if(!streambuf)
4951 ios_base_setstate(&this->base, IOSTATE_badbit);
4953 if(isstd)
4954 FIXME("standard streams not handled yet\n");
4957 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4958 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4959 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
4960 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
4962 TRACE("(%p %p)\n", this, strbuf);
4964 basic_ios_char_ctor(this);
4965 basic_ios_char_init(this, strbuf, FALSE);
4966 return this;
4969 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
4970 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
4971 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
4972 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
4974 TRACE("(%p)\n", this);
4975 ios_base_dtor(&this->base);
4978 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
4979 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
4981 TRACE("(%p %x)\n", this, flags);
4982 if(flags & 2) {
4983 /* we have an array, with the number of elements stored before the first object */
4984 INT_PTR i, *ptr = (INT_PTR *)this-1;
4986 for(i=*ptr-1; i>=0; i--)
4987 basic_ios_char_dtor(this+i);
4988 MSVCRT_operator_delete(ptr);
4989 } else {
4990 basic_ios_char_dtor(this);
4991 if(flags & 1)
4992 MSVCRT_operator_delete(this);
4995 return this;
4998 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
4999 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5000 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5001 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5003 TRACE("(%p %x %x)\n", this, state, reraise);
5004 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5007 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5008 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5009 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5010 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5012 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5015 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5016 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5017 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5018 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5020 TRACE("(%p %p)\n", this, copy);
5021 if(this == copy)
5022 return this;
5024 this->stream = copy->stream;
5025 this->fillch = copy->fillch;
5026 ios_base_copyfmt(&this->base, &copy->base);
5027 return this;
5030 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5031 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5032 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5033 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5035 char ret = this->fillch;
5037 TRACE("(%p %c)\n", this, fill);
5039 this->fillch = fill;
5040 return ret;
5043 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5044 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5045 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5046 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5048 TRACE("(%p)\n", this);
5049 return this->fillch;
5052 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5053 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5054 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5055 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5057 TRACE("(%p %p %p)\n", this, ret, loc);
5059 if(this->strbuf) {
5060 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5061 locale_dtor(ret);
5064 return ios_base_imbue(&this->base, ret, loc);
5067 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5068 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5069 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5070 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5072 TRACE("(%p %c %c)\n", this, ch, def);
5073 return ctype_char_narrow_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5076 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5077 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5078 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5079 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5081 basic_streambuf_char *ret = this->strbuf;
5083 TRACE("(%p %p)\n", this, streambuf);
5085 this->strbuf = streambuf;
5086 basic_ios_char_clear(this, IOSTATE_goodbit);
5087 return ret;
5090 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5091 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5092 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5093 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5095 TRACE("(%p)\n", this);
5096 return this->strbuf;
5099 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5100 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5101 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5102 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5104 TRACE("(%p %x %x)\n", this, state, reraise);
5106 if(state != IOSTATE_goodbit)
5107 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5110 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5111 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5112 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5113 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5115 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5118 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5119 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5120 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5121 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5123 basic_ostream_char *ret = this->stream;
5125 TRACE("(%p %p)\n", this, ostream);
5127 this->stream = ostream;
5128 return ret;
5131 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5132 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5133 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5134 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5136 TRACE("(%p)\n", this);
5137 return this->stream;
5140 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5141 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5142 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5143 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5145 TRACE("(%p %c)\n", this, ch);
5146 return ctype_char_widen_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch);
5150 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5151 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5152 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5153 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5155 TRACE("(%p)\n", this);
5157 ios_base_ctor(&this->base);
5158 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5159 return this;
5162 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5163 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5164 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5165 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5167 basic_ios_wchar_ctor(this);
5168 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5169 return this;
5172 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5173 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5174 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5175 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5176 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5177 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
5179 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5180 ios_base__Init(&this->base);
5181 this->strbuf = streambuf;
5182 this->stream = NULL;
5183 this->fillch = ' ';
5185 if(!streambuf)
5186 ios_base_setstate(&this->base, IOSTATE_badbit);
5188 if(isstd)
5189 FIXME("standard streams not handled yet\n");
5192 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5193 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5194 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
5195 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5197 TRACE("(%p %p)\n", this, strbuf);
5199 basic_ios_wchar_ctor(this);
5200 basic_ios_wchar_init(this, strbuf, FALSE);
5201 return this;
5204 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5205 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5206 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
5207 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5209 basic_ios_wchar_ctor_streambuf(this, strbuf);
5210 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5211 return this;
5214 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
5215 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
5216 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
5217 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
5218 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
5219 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
5221 TRACE("(%p)\n", this);
5222 ios_base_dtor(&this->base);
5225 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5226 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5228 TRACE("(%p %x)\n", this, flags);
5229 if(flags & 2) {
5230 /* we have an array, with the number of elements stored before the first object */
5231 INT_PTR i, *ptr = (INT_PTR *)this-1;
5233 for(i=*ptr-1; i>=0; i--)
5234 basic_ios_wchar_dtor(this+i);
5235 MSVCRT_operator_delete(ptr);
5236 } else {
5237 basic_ios_wchar_dtor(this);
5238 if(flags & 1)
5239 MSVCRT_operator_delete(this);
5242 return this;
5245 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5246 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5247 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5248 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5249 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5250 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5252 TRACE("(%p %x %x)\n", this, state, reraise);
5253 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5256 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5257 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5258 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5259 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5260 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
5261 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
5263 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
5266 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
5267 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5268 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
5269 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5270 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
5271 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
5273 TRACE("(%p %p)\n", this, copy);
5274 if(this == copy)
5275 return this;
5277 this->stream = copy->stream;
5278 this->fillch = copy->fillch;
5279 ios_base_copyfmt(&this->base, &copy->base);
5280 return this;
5283 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
5284 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
5285 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
5286 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
5287 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
5288 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
5290 wchar_t ret = this->fillch;
5292 TRACE("(%p %c)\n", this, fill);
5294 this->fillch = fill;
5295 return ret;
5298 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
5299 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
5300 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
5301 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
5302 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
5303 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
5305 TRACE("(%p)\n", this);
5306 return this->fillch;
5309 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5310 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5311 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5312 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5313 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
5314 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
5316 TRACE("(%p %p %p)\n", this, ret, loc);
5318 if(this->strbuf) {
5319 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
5320 locale_dtor(ret);
5323 return ios_base_imbue(&this->base, ret, loc);
5326 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
5327 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
5328 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
5329 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
5330 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
5331 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
5333 TRACE("(%p %c %c)\n", this, ch, def);
5334 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5337 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5338 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5339 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
5340 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5341 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
5342 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
5344 basic_streambuf_wchar *ret = this->strbuf;
5346 TRACE("(%p %p)\n", this, streambuf);
5348 this->strbuf = streambuf;
5349 basic_ios_wchar_clear(this, IOSTATE_goodbit);
5350 return ret;
5353 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5354 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5355 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5356 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5357 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
5358 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
5360 TRACE("(%p)\n", this);
5361 return this->strbuf;
5364 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5365 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5366 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5367 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5368 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
5369 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5371 TRACE("(%p %x %x)\n", this, state, reraise);
5373 if(state != IOSTATE_goodbit)
5374 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
5377 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5378 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5379 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5380 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5381 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
5382 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
5384 basic_ios_wchar_setstate_reraise(this, state, FALSE);
5387 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5388 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5389 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
5390 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5391 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
5392 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
5394 basic_ostream_wchar *ret = this->stream;
5396 TRACE("(%p %p)\n", this, ostream);
5398 this->stream = ostream;
5399 return ret;
5402 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5403 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5404 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5405 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5406 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
5407 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
5409 TRACE("(%p)\n", this);
5410 return this->stream;
5413 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
5414 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
5415 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
5416 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
5417 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
5418 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
5420 TRACE("(%p %c)\n", this, ch);
5421 return ctype_wchar_widen_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch);
5424 /* Caution: basic_ostream uses virtual inheritance.
5425 * All constructors have additional parameter that says if base class should be initialized.
5426 * Base class needs to be accessed using vbtable.
5428 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
5430 return (basic_ios_char*)((char*)this+this->vbtable[1]);
5433 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
5435 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
5438 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
5440 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
5443 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
5444 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
5445 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 20)
5446 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
5447 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool init, MSVCP_bool virt_init)
5449 basic_ios_char *base;
5451 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, init, virt_init);
5453 if(virt_init) {
5454 this->vbtable = basic_ostream_char_vbtable;
5455 base = basic_ostream_char_get_basic_ios(this);
5456 basic_ios_char_ctor(base);
5457 }else {
5458 base = basic_ostream_char_get_basic_ios(this);
5461 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5462 if(init)
5463 basic_ios_char_init(base, strbuf, isstd);
5464 return this;
5467 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
5468 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
5469 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 12)
5470 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
5471 int uninitialized, MSVCP_bool virt_init)
5473 basic_ios_char *base;
5475 TRACE("(%p %d)\n", this, uninitialized);
5477 if(virt_init) {
5478 this->vbtable = basic_ostream_char_vbtable;
5479 base = basic_ostream_char_get_basic_ios(this);
5480 basic_ios_char_ctor(base);
5481 }else {
5482 base = basic_ostream_char_get_basic_ios(this);
5485 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5486 ios_base_Addstd(&base->base);
5487 return this;
5490 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5491 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5492 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
5493 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
5495 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5497 /* don't destroy virtual base here */
5498 TRACE("(%p)\n", this);
5501 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5502 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5503 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
5504 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
5506 TRACE("(%p)\n", this);
5507 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
5508 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
5511 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
5512 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5514 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5516 TRACE("(%p %x)\n", this, flags);
5518 if(flags & 2) {
5519 /* we have an array, with the number of elements stored before the first object */
5520 INT_PTR i, *ptr = (INT_PTR *)this-1;
5522 for(i=*ptr-1; i>=0; i--)
5523 basic_ostream_char_vbase_dtor(this+i);
5524 MSVCRT_operator_delete(ptr);
5525 } else {
5526 basic_ostream_char_vbase_dtor(this);
5527 if(flags & 1)
5528 MSVCRT_operator_delete(this);
5531 return this;
5534 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
5535 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
5536 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
5537 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
5539 /* this function is not matching C++ specification */
5540 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5542 TRACE("(%p)\n", this);
5544 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
5545 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
5546 basic_ios_char_setstate(base, IOSTATE_badbit);
5547 return this;
5550 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5551 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5552 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
5554 return basic_ostream_char_flush(ostream);
5557 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5558 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5559 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
5560 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
5562 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5564 TRACE("(%p)\n", this);
5566 if(base->base.fmtfl & FMTFLAG_unitbuf)
5567 basic_ostream_char_flush(this);
5570 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5571 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5572 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
5573 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
5575 TRACE("(%p)\n", this);
5576 basic_ostream_char__Osfx(this);
5579 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
5581 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5583 if(basic_ios_char_rdbuf_get(base))
5584 call_basic_streambuf_char__Lock(base->strbuf);
5586 if(ios_base_good(&base->base) && base->stream)
5587 basic_ostream_char_flush(base->stream);
5589 return ios_base_good(&base->base);
5592 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
5594 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5596 if(ios_base_good(&base->base) && !__uncaught_exception())
5597 basic_ostream_char_osfx(ostr);
5599 if(basic_ios_char_rdbuf_get(base))
5600 call_basic_streambuf_char__Unlock(base->strbuf);
5603 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
5604 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
5605 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
5606 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
5608 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5610 TRACE("(%p)\n", this);
5612 if(ios_base_good(&base->base) && base->stream)
5613 basic_ostream_char_flush(base->stream);
5614 return ios_base_good(&base->base);
5617 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
5618 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
5619 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
5620 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
5622 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5624 TRACE("(%p %c)\n", this, ch);
5626 if(!basic_ostream_char_sentry_create(this)
5627 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
5628 basic_ostream_char_sentry_destroy(this);
5629 basic_ios_char_setstate(base, IOSTATE_badbit);
5630 return this;
5633 basic_ostream_char_sentry_destroy(this);
5634 return this;
5637 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
5638 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
5639 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
5640 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
5642 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5644 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
5646 if(!ios_base_fail(&base->base)) {
5647 fpos_int seek;
5649 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
5650 &seek, pos, OPENMODE_out);
5651 if(seek.off==-1 && seek.pos==0 && seek.state==0)
5652 basic_ios_char_setstate(base, IOSTATE_failbit);
5654 return this;
5657 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
5658 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
5659 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
5660 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
5662 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5664 TRACE("(%p)\n", this);
5666 if(!ios_base_fail(&base->base)) {
5667 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
5668 ret, 0, SEEKDIR_cur, OPENMODE_out);
5669 }else {
5670 ret->off = -1;
5671 ret->pos = 0;
5672 ret->state = 0;
5674 return ret;
5677 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
5678 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
5679 #if STREAMSIZE_BITS == 64
5680 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
5681 #else
5682 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
5683 #endif
5684 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
5686 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5688 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
5690 if(!basic_ostream_char_sentry_create(this)
5691 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
5692 basic_ostream_char_sentry_destroy(this);
5693 basic_ios_char_setstate(base, IOSTATE_badbit);
5694 return this;
5697 basic_ostream_char_sentry_destroy(this);
5698 return this;
5701 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
5702 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
5703 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
5704 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
5706 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5707 int state = IOSTATE_goodbit;
5709 TRACE("(%p %d)\n", this, val);
5711 if(basic_ostream_char_sentry_create(this)) {
5712 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5713 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5714 ostreambuf_iterator_char dest;
5716 memset(&dest, 0, sizeof(dest));
5717 dest.strbuf = strbuf;
5718 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
5719 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
5720 ? (LONG)((unsigned short)val) : (LONG)val);
5722 basic_ostream_char_sentry_destroy(this);
5724 basic_ios_char_setstate(base, state);
5725 return this;
5728 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
5729 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
5730 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
5731 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
5733 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5734 int state = IOSTATE_goodbit;
5736 TRACE("(%p %u)\n", this, val);
5738 if(basic_ostream_char_sentry_create(this)) {
5739 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5740 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5741 ostreambuf_iterator_char dest;
5743 memset(&dest, 0, sizeof(dest));
5744 dest.strbuf = strbuf;
5745 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5747 basic_ostream_char_sentry_destroy(this);
5749 basic_ios_char_setstate(base, state);
5750 return this;
5753 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
5754 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
5755 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
5756 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
5757 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
5758 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
5760 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5761 int state = IOSTATE_goodbit;
5763 TRACE("(%p %d)\n", this, val);
5765 if(basic_ostream_char_sentry_create(this)) {
5766 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5767 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5768 ostreambuf_iterator_char dest;
5770 memset(&dest, 0, sizeof(dest));
5771 dest.strbuf = strbuf;
5772 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5774 basic_ostream_char_sentry_destroy(this);
5776 basic_ios_char_setstate(base, state);
5777 return this;
5780 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
5781 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
5782 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
5783 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
5784 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
5785 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
5787 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5788 int state = IOSTATE_goodbit;
5790 TRACE("(%p %u)\n", this, val);
5792 if(basic_ostream_char_sentry_create(this)) {
5793 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5794 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5795 ostreambuf_iterator_char dest;
5797 memset(&dest, 0, sizeof(dest));
5798 dest.strbuf = strbuf;
5799 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5801 basic_ostream_char_sentry_destroy(this);
5803 basic_ios_char_setstate(base, state);
5804 return this;
5807 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
5808 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
5809 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
5810 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
5812 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5813 int state = IOSTATE_goodbit;
5815 TRACE("(%p %f)\n", this, val);
5817 if(basic_ostream_char_sentry_create(this)) {
5818 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5819 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5820 ostreambuf_iterator_char dest;
5822 memset(&dest, 0, sizeof(dest));
5823 dest.strbuf = strbuf;
5824 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5826 basic_ostream_char_sentry_destroy(this);
5828 basic_ios_char_setstate(base, state);
5829 return this;
5832 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
5833 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
5834 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
5835 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
5837 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5838 int state = IOSTATE_goodbit;
5840 TRACE("(%p %lf)\n", this, val);
5842 if(basic_ostream_char_sentry_create(this)) {
5843 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5844 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5845 ostreambuf_iterator_char dest;
5847 memset(&dest, 0, sizeof(dest));
5848 dest.strbuf = strbuf;
5849 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5851 basic_ostream_char_sentry_destroy(this);
5853 basic_ios_char_setstate(base, state);
5854 return this;
5857 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
5858 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
5859 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
5860 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
5862 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5863 int state = IOSTATE_goodbit;
5865 TRACE("(%p %lf)\n", this, val);
5867 if(basic_ostream_char_sentry_create(this)) {
5868 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5869 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5870 ostreambuf_iterator_char dest;
5872 memset(&dest, 0, sizeof(dest));
5873 dest.strbuf = strbuf;
5874 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5876 basic_ostream_char_sentry_destroy(this);
5878 basic_ios_char_setstate(base, state);
5879 return this;
5882 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5883 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5884 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
5885 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
5887 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5888 IOSB_iostate state = IOSTATE_badbit;
5889 int c = '\n';
5891 TRACE("(%p %p)\n", this, val);
5893 if(basic_ostream_char_sentry_create(this)) {
5894 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
5895 c = basic_streambuf_char_snextc(val)) {
5896 state = IOSTATE_goodbit;
5898 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
5899 state = IOSTATE_badbit;
5900 break;
5903 }else {
5904 state = IOSTATE_badbit;
5906 basic_ostream_char_sentry_destroy(this);
5908 ios_base_width_set(&base->base, 0);
5909 basic_ios_char_setstate(base, state);
5910 return this;
5913 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
5914 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
5915 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
5916 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
5918 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5919 int state = IOSTATE_goodbit;
5921 TRACE("(%p %p)\n", this, val);
5923 if(basic_ostream_char_sentry_create(this)) {
5924 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5925 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5926 ostreambuf_iterator_char dest;
5928 memset(&dest, 0, sizeof(dest));
5929 dest.strbuf = strbuf;
5930 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5932 basic_ostream_char_sentry_destroy(this);
5934 basic_ios_char_setstate(base, state);
5935 return this;
5938 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
5939 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
5940 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
5941 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
5943 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5944 int state = IOSTATE_goodbit;
5946 TRACE("(%p)\n", this);
5948 if(basic_ostream_char_sentry_create(this)) {
5949 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5950 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5951 ostreambuf_iterator_char dest;
5953 memset(&dest, 0, sizeof(dest));
5954 dest.strbuf = strbuf;
5955 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5957 basic_ostream_char_sentry_destroy(this);
5959 basic_ios_char_setstate(base, state);
5960 return this;
5963 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
5964 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
5965 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
5966 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
5968 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5969 int state = IOSTATE_goodbit;
5971 TRACE("(%p)\n", this);
5973 if(basic_ostream_char_sentry_create(this)) {
5974 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5975 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
5976 ostreambuf_iterator_char dest;
5978 memset(&dest, 0, sizeof(dest));
5979 dest.strbuf = strbuf;
5980 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5982 basic_ostream_char_sentry_destroy(this);
5984 basic_ios_char_setstate(base, state);
5985 return this;
5988 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
5989 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
5990 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
5991 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
5993 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5994 int state = IOSTATE_goodbit;
5996 TRACE("(%p %x)\n", this, val);
5998 if(basic_ostream_char_sentry_create(this)) {
5999 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6000 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6001 ostreambuf_iterator_char dest;
6003 memset(&dest, 0, sizeof(dest));
6004 dest.strbuf = strbuf;
6005 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6007 basic_ostream_char_sentry_destroy(this);
6009 basic_ios_char_setstate(base, state);
6010 return this;
6013 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6014 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6015 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6017 TRACE("(%p)\n", ostr);
6019 basic_ostream_char_put(ostr, 0);
6020 return ostr;
6023 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6024 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6025 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6027 TRACE("(%p)\n", ostr);
6029 basic_ostream_char_put(ostr, '\n');
6030 basic_ostream_char_flush(ostr);
6031 return ostr;
6034 /* ??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
6035 /* ??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
6036 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6038 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6039 IOSB_iostate state = IOSTATE_goodbit;
6041 TRACE("(%p %p)\n", ostr, str);
6043 if(basic_ostream_char_sentry_create(ostr)) {
6044 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6045 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6047 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6048 for(; pad!=0; pad--) {
6049 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6050 state = IOSTATE_badbit;
6051 break;
6056 if(state == IOSTATE_goodbit) {
6057 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6058 state = IOSTATE_badbit;
6061 if(state == IOSTATE_goodbit) {
6062 for(; pad!=0; pad--) {
6063 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6064 state = IOSTATE_badbit;
6065 break;
6070 base->base.wide = 0;
6071 }else {
6072 state = IOSTATE_badbit;
6074 basic_ostream_char_sentry_destroy(ostr);
6076 basic_ios_char_setstate(base, state);
6077 return ostr;
6080 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6081 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6082 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6083 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6084 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6085 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6086 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6088 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6089 IOSB_iostate state = IOSTATE_goodbit;
6091 TRACE("(%p %d)\n", ostr, ch);
6093 if(basic_ostream_char_sentry_create(ostr)) {
6094 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6096 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6097 for(; pad!=0; pad--) {
6098 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6099 state = IOSTATE_badbit;
6100 break;
6105 if(state == IOSTATE_goodbit) {
6106 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6107 state = IOSTATE_badbit;
6110 if(state == IOSTATE_goodbit) {
6111 for(; pad!=0; pad--) {
6112 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6113 state = IOSTATE_badbit;
6114 break;
6119 base->base.wide = 0;
6120 }else {
6121 state = IOSTATE_badbit;
6123 basic_ostream_char_sentry_destroy(ostr);
6125 basic_ios_char_setstate(base, state);
6126 return ostr;
6129 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6130 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6131 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6132 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6133 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
6134 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
6135 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
6137 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6138 IOSB_iostate state = IOSTATE_goodbit;
6140 TRACE("(%p %s)\n", ostr, str);
6142 if(basic_ostream_char_sentry_create(ostr)) {
6143 MSVCP_size_t len = strlen(str);
6144 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6146 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6147 for(; pad!=0; pad--) {
6148 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6149 state = IOSTATE_badbit;
6150 break;
6155 if(state == IOSTATE_goodbit) {
6156 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
6157 state = IOSTATE_badbit;
6160 if(state == IOSTATE_goodbit) {
6161 for(; pad!=0; pad--) {
6162 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6163 state = IOSTATE_badbit;
6164 break;
6169 base->base.wide = 0;
6170 }else {
6171 state = IOSTATE_badbit;
6173 basic_ostream_char_sentry_destroy(ostr);
6175 basic_ios_char_setstate(base, state);
6176 return ostr;
6179 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6180 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6181 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
6182 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
6183 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
6185 TRACE("(%p %p)\n", this, pfunc);
6186 pfunc(this);
6187 return this;
6190 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
6191 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
6192 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
6193 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
6194 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
6196 TRACE("(%p %p)\n", this, pfunc);
6197 pfunc(basic_ostream_char_get_basic_ios(this));
6198 return this;
6201 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6202 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6203 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
6204 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
6205 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
6207 TRACE("(%p %p)\n", this, pfunc);
6208 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
6209 return this;
6212 /* Caution: basic_ostream uses virtual inheritance. */
6213 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
6215 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
6218 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
6220 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
6223 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
6225 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
6228 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
6229 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
6230 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 20)
6231 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
6232 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool init, MSVCP_bool virt_init)
6234 basic_ios_wchar *base;
6236 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6238 if(virt_init) {
6239 this->vbtable = basic_ostream_wchar_vbtable;
6240 base = basic_ostream_wchar_get_basic_ios(this);
6241 basic_ios_wchar_ctor(base);
6242 }else {
6243 base = basic_ostream_wchar_get_basic_ios(this);
6246 base->base.vtable = &MSVCP_basic_ostream_short_vtable;
6247 if(init)
6248 basic_ios_wchar_init(base, strbuf, isstd);
6249 return this;
6252 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
6253 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
6254 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 12)
6255 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
6256 int uninitialized, MSVCP_bool virt_init)
6258 basic_ios_wchar *base;
6260 TRACE("(%p %d)\n", this, uninitialized);
6262 if(virt_init) {
6263 this->vbtable = basic_ostream_wchar_vbtable;
6264 base = basic_ostream_wchar_get_basic_ios(this);
6265 basic_ios_wchar_ctor(base);
6266 }else {
6267 base = basic_ostream_wchar_get_basic_ios(this);
6270 base->base.vtable = &MSVCP_basic_ostream_short_vtable;
6271 ios_base_Addstd(&base->base);
6272 return this;
6275 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6276 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6277 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
6278 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6279 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
6280 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
6282 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6284 /* don't destroy virtual base here */
6285 TRACE("(%p)\n", this);
6288 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6289 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6290 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6291 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6292 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
6293 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
6295 TRACE("(%p)\n", this);
6296 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
6297 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
6300 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
6301 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
6303 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6305 TRACE("(%p %x)\n", this, flags);
6307 if(flags & 2) {
6308 /* we have an array, with the number of elements stored before the first object */
6309 INT_PTR i, *ptr = (INT_PTR *)this-1;
6311 for(i=*ptr-1; i>=0; i--)
6312 basic_ostream_wchar_vbase_dtor(this+i);
6313 MSVCRT_operator_delete(ptr);
6314 } else {
6315 basic_ostream_wchar_vbase_dtor(this);
6316 if(flags & 1)
6317 MSVCRT_operator_delete(this);
6320 return this;
6323 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
6324 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
6325 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
6326 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
6327 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
6328 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
6330 /* this function is not matching C++ specification */
6331 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6333 TRACE("(%p)\n", this);
6335 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
6336 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
6337 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6338 return this;
6341 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6342 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6343 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6344 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6345 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
6347 return basic_ostream_wchar_flush(ostream);
6350 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6351 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6352 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6353 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6354 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
6355 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
6357 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6359 TRACE("(%p)\n", this);
6361 if(base->base.fmtfl & FMTFLAG_unitbuf)
6362 basic_ostream_wchar_flush(this);
6365 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6366 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6367 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6368 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6369 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
6370 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
6372 TRACE("(%p)\n", this);
6373 basic_ostream_wchar__Osfx(this);
6376 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
6378 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6380 if(basic_ios_wchar_rdbuf_get(base))
6381 basic_streambuf_wchar__Lock(base->strbuf);
6383 if(ios_base_good(&base->base) && base->stream)
6384 basic_ostream_wchar_flush(base->stream);
6386 return ios_base_good(&base->base);
6389 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
6391 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6393 if(ios_base_good(&base->base) && !__uncaught_exception())
6394 basic_ostream_wchar_osfx(ostr);
6396 if(basic_ios_wchar_rdbuf_get(base))
6397 basic_streambuf_wchar__Unlock(base->strbuf);
6400 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
6401 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
6402 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
6403 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
6404 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
6405 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
6407 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6409 TRACE("(%p)\n", this);
6411 if(ios_base_good(&base->base) && base->stream)
6412 basic_ostream_wchar_flush(base->stream);
6413 return ios_base_good(&base->base);
6416 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
6417 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
6418 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
6419 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
6420 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
6421 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
6423 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6425 TRACE("(%p %c)\n", this, ch);
6427 if(!basic_ostream_wchar_sentry_create(this)
6428 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
6429 basic_ostream_wchar_sentry_destroy(this);
6430 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6431 return this;
6434 basic_ostream_wchar_sentry_destroy(this);
6435 return this;
6438 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6439 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6440 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6441 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6442 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
6443 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_int pos)
6445 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6447 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6449 if(!ios_base_fail(&base->base)) {
6450 fpos_int seek;
6452 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
6453 &seek, pos, OPENMODE_out);
6454 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6455 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6457 return this;
6460 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6461 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6462 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6463 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6464 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
6465 fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_int *ret)
6467 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6469 TRACE("(%p)\n", this);
6471 if(!ios_base_fail(&base->base)) {
6472 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6473 ret, 0, SEEKDIR_cur, OPENMODE_out);
6474 }else {
6475 ret->off = -1;
6476 ret->pos = 0;
6477 ret->state = 0;
6479 return ret;
6482 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
6483 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
6484 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
6485 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
6486 #if STREAMSIZE_BITS == 64
6487 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
6488 #else
6489 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
6490 #endif
6491 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
6493 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6495 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
6497 if(!basic_ostream_wchar_sentry_create(this)
6498 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
6499 basic_ostream_wchar_sentry_destroy(this);
6500 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6501 return this;
6504 basic_ostream_wchar_sentry_destroy(this);
6505 return this;
6508 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
6510 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6511 int state = IOSTATE_goodbit;
6513 TRACE("(%p %d)\n", this, val);
6515 if(basic_ostream_wchar_sentry_create(this)) {
6516 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6517 ostreambuf_iterator_wchar dest;
6519 memset(&dest, 0, sizeof(dest));
6520 dest.strbuf = strbuf;
6521 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
6522 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6523 ? (LONG)((unsigned short)val) : (LONG)val);
6525 basic_ostream_wchar_sentry_destroy(this);
6527 basic_ios_wchar_setstate(base, state);
6528 return this;
6531 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
6532 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
6533 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
6534 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
6536 return basic_ostream_print_short(this, val, num_put_short_use_facet(
6537 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6540 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
6542 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6543 int state = IOSTATE_goodbit;
6545 TRACE("(%p %d)\n", this, val);
6547 if(basic_ostream_wchar_sentry_create(this)) {
6548 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6549 ostreambuf_iterator_wchar dest;
6551 memset(&dest, 0, sizeof(dest));
6552 dest.strbuf = strbuf;
6553 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6555 basic_ostream_wchar_sentry_destroy(this);
6557 basic_ios_wchar_setstate(base, state);
6558 return this;
6561 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
6562 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
6563 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
6564 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
6566 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
6567 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6570 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
6572 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6573 int state = IOSTATE_goodbit;
6575 TRACE("(%p %d)\n", this, val);
6577 if(basic_ostream_wchar_sentry_create(this)) {
6578 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6579 ostreambuf_iterator_wchar dest;
6581 memset(&dest, 0, sizeof(dest));
6582 dest.strbuf = strbuf;
6583 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6585 basic_ostream_wchar_sentry_destroy(this);
6587 basic_ios_wchar_setstate(base, state);
6588 return this;
6591 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
6592 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
6593 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
6594 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
6595 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
6596 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
6598 return basic_ostream_print_int(this, val, num_put_short_use_facet(
6599 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6602 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
6604 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6605 int state = IOSTATE_goodbit;
6607 TRACE("(%p %u)\n", this, val);
6609 if(basic_ostream_wchar_sentry_create(this)) {
6610 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6611 ostreambuf_iterator_wchar dest;
6613 memset(&dest, 0, sizeof(dest));
6614 dest.strbuf = strbuf;
6615 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6617 basic_ostream_wchar_sentry_destroy(this);
6619 basic_ios_wchar_setstate(base, state);
6620 return this;
6623 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
6624 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
6625 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
6626 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
6627 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
6628 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
6630 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
6631 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6634 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
6636 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6637 int state = IOSTATE_goodbit;
6639 TRACE("(%p %f)\n", this, val);
6641 if(basic_ostream_wchar_sentry_create(this)) {
6642 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6643 ostreambuf_iterator_wchar dest;
6645 memset(&dest, 0, sizeof(dest));
6646 dest.strbuf = strbuf;
6647 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6649 basic_ostream_wchar_sentry_destroy(this);
6651 basic_ios_wchar_setstate(base, state);
6652 return this;
6655 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
6656 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
6657 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
6658 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
6660 return basic_ostream_print_float(this, val, num_put_short_use_facet(
6661 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6664 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
6666 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6667 int state = IOSTATE_goodbit;
6669 TRACE("(%p %lf)\n", this, val);
6671 if(basic_ostream_wchar_sentry_create(this)) {
6672 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6673 ostreambuf_iterator_wchar dest;
6675 memset(&dest, 0, sizeof(dest));
6676 dest.strbuf = strbuf;
6677 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6679 basic_ostream_wchar_sentry_destroy(this);
6681 basic_ios_wchar_setstate(base, state);
6682 return this;
6685 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
6686 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
6687 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
6688 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
6690 return basic_ostream_print_double(this, val, num_put_short_use_facet(
6691 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6694 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
6696 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6697 int state = IOSTATE_goodbit;
6699 TRACE("(%p %lf)\n", this, val);
6701 if(basic_ostream_wchar_sentry_create(this)) {
6702 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6703 ostreambuf_iterator_wchar dest;
6705 memset(&dest, 0, sizeof(dest));
6706 dest.strbuf = strbuf;
6707 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6709 basic_ostream_wchar_sentry_destroy(this);
6711 basic_ios_wchar_setstate(base, state);
6712 return this;
6715 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
6716 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
6717 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
6718 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
6720 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
6721 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6724 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6725 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6726 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6727 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6728 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
6729 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
6731 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6732 IOSB_iostate state = IOSTATE_badbit;
6733 unsigned short c = '\n';
6735 TRACE("(%p %p)\n", this, val);
6737 if(basic_ostream_wchar_sentry_create(this)) {
6738 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
6739 c = basic_streambuf_wchar_snextc(val)) {
6740 state = IOSTATE_goodbit;
6742 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
6743 state = IOSTATE_badbit;
6744 break;
6747 }else {
6748 state = IOSTATE_badbit;
6750 basic_ostream_wchar_sentry_destroy(this);
6752 ios_base_width_set(&base->base, 0);
6753 basic_ios_wchar_setstate(base, state);
6754 return this;
6757 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
6759 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6760 int state = IOSTATE_goodbit;
6762 TRACE("(%p %p)\n", this, val);
6764 if(basic_ostream_wchar_sentry_create(this)) {
6765 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6766 ostreambuf_iterator_wchar dest;
6768 memset(&dest, 0, sizeof(dest));
6769 dest.strbuf = strbuf;
6770 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6772 basic_ostream_wchar_sentry_destroy(this);
6774 basic_ios_wchar_setstate(base, state);
6775 return this;
6778 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
6779 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
6780 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
6781 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
6783 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
6784 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6787 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
6789 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6790 int state = IOSTATE_goodbit;
6792 TRACE("(%p)\n", this);
6794 if(basic_ostream_wchar_sentry_create(this)) {
6795 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6796 ostreambuf_iterator_wchar dest;
6798 memset(&dest, 0, sizeof(dest));
6799 dest.strbuf = strbuf;
6800 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6802 basic_ostream_wchar_sentry_destroy(this);
6804 basic_ios_wchar_setstate(base, state);
6805 return this;
6808 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
6809 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
6810 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
6811 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
6813 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
6814 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6817 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
6819 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6820 int state = IOSTATE_goodbit;
6822 TRACE("(%p)\n", this);
6824 if(basic_ostream_wchar_sentry_create(this)) {
6825 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6826 ostreambuf_iterator_wchar dest;
6828 memset(&dest, 0, sizeof(dest));
6829 dest.strbuf = strbuf;
6830 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6832 basic_ostream_wchar_sentry_destroy(this);
6834 basic_ios_wchar_setstate(base, state);
6835 return this;
6838 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
6839 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
6840 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
6841 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
6843 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
6844 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6847 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
6849 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6850 int state = IOSTATE_goodbit;
6852 TRACE("(%p %x)\n", this, val);
6854 if(basic_ostream_wchar_sentry_create(this)) {
6855 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6856 ostreambuf_iterator_wchar dest;
6858 memset(&dest, 0, sizeof(dest));
6859 dest.strbuf = strbuf;
6860 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6862 basic_ostream_wchar_sentry_destroy(this);
6864 basic_ios_wchar_setstate(base, state);
6865 return this;
6868 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
6869 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
6870 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
6871 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
6873 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
6874 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
6877 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6878 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6879 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6880 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6881 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
6883 TRACE("(%p)\n", ostr);
6885 basic_ostream_wchar_put(ostr, 0);
6886 return ostr;
6889 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6890 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6891 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6892 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6893 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
6895 TRACE("(%p)\n", ostr);
6897 basic_ostream_wchar_put(ostr, '\n');
6898 basic_ostream_wchar_flush(ostr);
6899 return ostr;
6902 /* ??$?6_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
6903 /* ??$?6_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
6904 /* ??$?6GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
6905 /* ??$?6GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@AEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
6906 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
6908 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6909 IOSB_iostate state = IOSTATE_goodbit;
6911 TRACE("(%p %p)\n", ostr, str);
6913 if(basic_ostream_wchar_sentry_create(ostr)) {
6914 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
6915 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6917 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6918 for(; pad!=0; pad--) {
6919 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6920 state = IOSTATE_badbit;
6921 break;
6926 if(state == IOSTATE_goodbit) {
6927 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
6928 state = IOSTATE_badbit;
6931 if(state == IOSTATE_goodbit) {
6932 for(; pad!=0; pad--) {
6933 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6934 state = IOSTATE_badbit;
6935 break;
6940 base->base.wide = 0;
6941 }else {
6942 state = IOSTATE_badbit;
6944 basic_ostream_wchar_sentry_destroy(ostr);
6946 basic_ios_wchar_setstate(base, state);
6947 return ostr;
6950 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
6951 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
6952 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
6953 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
6954 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
6956 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6957 IOSB_iostate state = IOSTATE_goodbit;
6959 TRACE("(%p %d)\n", ostr, ch);
6961 if(basic_ostream_wchar_sentry_create(ostr)) {
6962 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6964 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6965 for(; pad!=0; pad--) {
6966 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6967 state = IOSTATE_badbit;
6968 break;
6973 if(state == IOSTATE_goodbit) {
6974 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
6975 state = IOSTATE_badbit;
6978 if(state == IOSTATE_goodbit) {
6979 for(; pad!=0; pad--) {
6980 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6981 state = IOSTATE_badbit;
6982 break;
6987 base->base.wide = 0;
6988 }else {
6989 state = IOSTATE_badbit;
6991 basic_ostream_wchar_sentry_destroy(ostr);
6993 basic_ios_wchar_setstate(base, state);
6994 return ostr;
6997 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
6998 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
6999 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
7000 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
7001 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
7003 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7004 IOSB_iostate state = IOSTATE_goodbit;
7006 TRACE("(%p %s)\n", ostr, debugstr_w(str));
7008 if(basic_ostream_wchar_sentry_create(ostr)) {
7009 MSVCP_size_t len = wcslen(str);
7010 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7012 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7013 for(; pad!=0; pad--) {
7014 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7015 state = IOSTATE_badbit;
7016 break;
7021 if(state == IOSTATE_goodbit) {
7022 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
7023 state = IOSTATE_badbit;
7026 if(state == IOSTATE_goodbit) {
7027 for(; pad!=0; pad--) {
7028 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7029 state = IOSTATE_badbit;
7030 break;
7035 base->base.wide = 0;
7036 }else {
7037 state = IOSTATE_badbit;
7039 basic_ostream_wchar_sentry_destroy(ostr);
7041 basic_ios_wchar_setstate(base, state);
7042 return ostr;
7045 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7046 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7047 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7048 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7049 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
7050 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
7051 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
7053 TRACE("(%p %p)\n", this, pfunc);
7054 pfunc(this);
7055 return this;
7058 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
7059 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
7060 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
7061 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
7062 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
7063 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
7064 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
7066 TRACE("(%p %p)\n", this, pfunc);
7067 pfunc(basic_ostream_wchar_get_basic_ios(this));
7068 return this;
7071 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7072 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7073 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7074 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7075 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
7076 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
7077 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
7079 TRACE("(%p %p)\n", this, pfunc);
7080 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
7081 return this;
7084 /* Caution: basic_istream uses virtual inheritance. */
7085 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
7087 return (basic_ios_char*)((char*)this+this->vbtable[1]);
7090 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
7092 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
7095 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
7097 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
7100 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7101 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7102 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
7103 basic_istream_char* __thiscall basic_istream_char_ctor_init(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
7105 basic_ios_char *base;
7107 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
7109 if(virt_init) {
7110 this->vbtable = basic_istream_char_vbtable;
7111 base = basic_istream_char_get_basic_ios(this);
7112 basic_ios_char_ctor(base);
7113 }else {
7114 base = basic_istream_char_get_basic_ios(this);
7117 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7118 this->count = 0;
7119 if(!noinit)
7120 basic_ios_char_init(base, strbuf, isstd);
7121 return this;
7124 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7125 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7126 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
7127 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7129 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
7132 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
7133 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
7134 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
7135 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
7137 basic_ios_char *base;
7139 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
7141 if(virt_init) {
7142 this->vbtable = basic_istream_char_vbtable;
7143 base = basic_istream_char_get_basic_ios(this);
7144 basic_ios_char_ctor(base);
7145 }else {
7146 base = basic_istream_char_get_basic_ios(this);
7149 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7150 ios_base_Addstd(&base->base);
7151 return this;
7154 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
7155 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
7156 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
7157 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
7159 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7161 /* don't destroy virtual base here */
7162 TRACE("(%p)\n", this);
7165 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7166 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7167 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
7168 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
7170 TRACE("(%p)\n", this);
7171 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
7172 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
7175 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
7176 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
7178 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7180 TRACE("(%p %x)\n", this, flags);
7182 if(flags & 2) {
7183 /* we have an array, with the number of elements stored before the first object */
7184 INT_PTR i, *ptr = (INT_PTR *)this-1;
7186 for(i=*ptr-1; i>=0; i--)
7187 basic_istream_char_vbase_dtor(this+i);
7188 MSVCRT_operator_delete(ptr);
7189 } else {
7190 basic_istream_char_vbase_dtor(this);
7191 if(flags & 1)
7192 MSVCRT_operator_delete(this);
7195 return this;
7198 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7199 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7200 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
7201 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
7203 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7205 TRACE("(%p %d)\n", this, noskip);
7207 if(ios_base_good(&base->base)) {
7208 if(basic_ios_char_tie_get(base))
7209 basic_ostream_char_flush(basic_ios_char_tie_get(base));
7211 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
7212 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7213 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
7214 int ch;
7216 for(ch = basic_streambuf_char_sgetc(strbuf); ;
7217 ch = basic_streambuf_char_snextc(strbuf)) {
7218 if(ch==EOF || !ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
7219 break;
7224 if(!ios_base_good(&base->base)) {
7225 basic_ios_char_setstate(base, IOSTATE_failbit);
7226 return FALSE;
7229 return TRUE;
7232 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7233 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7234 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
7235 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
7237 return basic_istream_char__Ipfx(this, noskip);
7240 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7241 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7242 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
7243 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
7245 TRACE("(%p)\n", this);
7248 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
7250 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7252 if(basic_ios_char_rdbuf_get(base))
7253 call_basic_streambuf_char__Lock(base->strbuf);
7255 return basic_istream_char_ipfx(istr, noskip);
7258 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
7260 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7262 if(basic_ios_char_rdbuf_get(base))
7263 call_basic_streambuf_char__Unlock(base->strbuf);
7266 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
7267 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
7268 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
7269 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
7270 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
7271 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
7273 TRACE("(%p)\n", this);
7274 return this->count;
7277 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7278 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7279 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
7280 int __thiscall basic_istream_char_get(basic_istream_char *this)
7282 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7283 int ret;
7285 TRACE("(%p)\n", this);
7287 this->count = 0;
7289 if(!basic_istream_char_sentry_create(this, TRUE)) {
7290 basic_istream_char_sentry_destroy(this);
7291 return EOF;
7294 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
7295 basic_istream_char_sentry_destroy(this);
7296 if(ret == EOF)
7297 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
7298 else
7299 this->count++;
7301 return ret;
7304 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
7305 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
7306 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
7307 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
7309 int ret;
7311 TRACE("(%p %p)\n", this, ch);
7313 ret = basic_istream_char_get(this);
7314 if(ret != EOF)
7315 *ch = (char)ret;
7316 return this;
7319 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7320 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7321 #if STREAMSIZE_BITS == 64
7322 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
7323 #else
7324 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
7325 #endif
7326 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7328 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7329 int ch = delim;
7331 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
7333 this->count = 0;
7335 if(basic_istream_char_sentry_create(this, TRUE)) {
7336 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7338 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
7339 ch = basic_streambuf_char_snextc(strbuf)) {
7340 if(ch==EOF || ch==delim)
7341 break;
7343 *str++ = ch;
7344 this->count++;
7345 count--;
7348 basic_istream_char_sentry_destroy(this);
7350 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7351 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7352 if(count > 0)
7353 *str = 0;
7354 return this;
7357 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7358 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7359 #if STREAMSIZE_BITS == 64
7360 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
7361 #else
7362 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
7363 #endif
7364 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
7366 return basic_istream_char_get_str_delim(this, str, count, '\n');
7369 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7370 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7371 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
7372 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
7374 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7375 int ch = delim;
7377 TRACE("(%p %p %c)\n", this, strbuf, delim);
7379 this->count = 0;
7381 if(basic_istream_char_sentry_create(this, TRUE)) {
7382 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
7384 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
7385 ch = basic_streambuf_char_snextc(strbuf_read)) {
7386 if(ch==EOF || ch==delim)
7387 break;
7389 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
7390 break;
7391 this->count++;
7394 basic_istream_char_sentry_destroy(this);
7396 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7397 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7398 return this;
7401 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7402 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7403 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
7404 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
7406 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
7409 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7410 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7411 #if STREAMSIZE_BITS == 64
7412 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
7413 #else
7414 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
7415 #endif
7416 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7418 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7419 int ch = (unsigned char)delim;
7421 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
7423 this->count = 0;
7425 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
7426 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7428 while(count > 1) {
7429 ch = basic_streambuf_char_sbumpc(strbuf);
7431 if(ch==EOF || ch==(unsigned char)delim)
7432 break;
7434 *str++ = ch;
7435 this->count++;
7436 count--;
7439 if(ch == (unsigned char)delim)
7440 this->count++;
7441 else if(ch != EOF) {
7442 ch = basic_streambuf_char_sgetc(strbuf);
7444 if(ch == (unsigned char)delim) {
7445 basic_streambuf_char__Gninc(strbuf);
7446 this->count++;
7450 basic_istream_char_sentry_destroy(this);
7452 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
7453 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
7454 if(count > 0)
7455 *str = 0;
7456 return this;
7459 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7460 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7461 #if STREAMSIZE_BITS == 64
7462 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
7463 #else
7464 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
7465 #endif
7466 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
7468 return basic_istream_char_getline_delim(this, str, count, '\n');
7471 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
7472 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
7473 #if STREAMSIZE_BITS == 64
7474 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
7475 #else
7476 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
7477 #endif
7478 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
7480 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7481 int ch = (unsigned char)delim;
7482 unsigned int state;
7484 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
7486 this->count = 0;
7488 if(basic_istream_char_sentry_create(this, TRUE)) {
7489 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7490 state = IOSTATE_goodbit;
7492 while(count > 0) {
7493 ch = basic_streambuf_char_sbumpc(strbuf);
7495 if(ch==EOF) {
7496 state = IOSTATE_eofbit;
7497 break;
7500 if(ch==(unsigned char)delim)
7501 break;
7503 this->count++;
7504 if(count != INT_MAX)
7505 count--;
7507 }else
7508 state = IOSTATE_failbit;
7509 basic_istream_char_sentry_destroy(this);
7511 basic_ios_char_setstate(base, state);
7512 return this;
7515 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
7516 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
7517 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
7519 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
7520 int ch = '\n';
7522 TRACE("(%p)\n", istream);
7524 if(basic_istream_char_sentry_create(istream, TRUE)) {
7525 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7526 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(strbuf));
7528 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
7529 ch = basic_streambuf_char_snextc(strbuf)) {
7530 if(ch == EOF)
7531 break;
7534 basic_istream_char_sentry_destroy(istream);
7536 if(ch == EOF)
7537 basic_ios_char_setstate(base, IOSTATE_eofbit);
7538 return istream;
7541 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7542 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7543 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
7544 int __thiscall basic_istream_char_peek(basic_istream_char *this)
7546 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7547 int ret = EOF;
7549 TRACE("(%p)\n", this);
7551 this->count = 0;
7553 if(basic_istream_char_sentry_create(this, TRUE))
7554 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
7555 basic_istream_char_sentry_destroy(this);
7557 if (ret == EOF)
7558 basic_ios_char_setstate(base, IOSTATE_eofbit);
7560 return ret;
7563 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
7564 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
7565 #if STREAMSIZE_BITS == 64
7566 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
7567 #else
7568 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
7569 #endif
7570 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
7572 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7573 IOSB_iostate state = IOSTATE_goodbit;
7575 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
7577 if(basic_istream_char_sentry_create(this, TRUE)) {
7578 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7580 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
7581 if(this->count != count)
7582 state |= IOSTATE_failbit | IOSTATE_eofbit;
7583 }else {
7584 this->count = 0;
7586 basic_istream_char_sentry_destroy(this);
7588 basic_ios_char_setstate(base, state);
7589 return this;
7592 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7593 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7594 #if STREAMSIZE_BITS == 64
7595 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
7596 #else
7597 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
7598 #endif
7599 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
7601 return basic_istream_char__Read_s(this, str, -1, count);
7604 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
7605 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
7606 #if STREAMSIZE_BITS == 64
7607 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
7608 #else
7609 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
7610 #endif
7611 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
7613 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7614 IOSB_iostate state = IOSTATE_goodbit;
7616 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
7618 this->count = 0;
7620 if(basic_istream_char_sentry_create(this, TRUE)) {
7621 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
7622 if(avail > count)
7623 avail = count;
7625 if(avail == -1)
7626 state |= IOSTATE_eofbit;
7627 else if(avail > 0)
7628 basic_istream_char__Read_s(this, str, size, avail);
7629 }else {
7630 state |= IOSTATE_failbit;
7632 basic_istream_char_sentry_destroy(this);
7634 basic_ios_char_setstate(base, state);
7635 return this->count;
7638 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
7639 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
7640 #if STREAMSIZE_BITS == 64
7641 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
7642 #else
7643 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
7644 #endif
7645 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
7647 return basic_istream_char__Readsome_s(this, str, count, count);
7650 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
7651 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
7652 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
7653 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
7655 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7656 IOSB_iostate state = IOSTATE_goodbit;
7658 TRACE("(%p %c)\n", this, ch);
7660 this->count = 0;
7662 if(basic_istream_char_sentry_create(this, TRUE)) {
7663 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7665 if(!ios_base_good(&base->base))
7666 state |= IOSTATE_failbit;
7667 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
7668 state |= IOSTATE_badbit;
7670 basic_istream_char_sentry_destroy(this);
7672 basic_ios_char_setstate(base, state);
7673 return this;
7676 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
7677 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
7678 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
7679 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
7681 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7682 IOSB_iostate state = IOSTATE_goodbit;
7684 TRACE("(%p)\n", this);
7686 this->count = 0;
7688 if(basic_istream_char_sentry_create(this, TRUE)) {
7689 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7691 if(!ios_base_good(&base->base))
7692 state |= IOSTATE_failbit;
7693 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
7694 state |= IOSTATE_badbit;
7696 basic_istream_char_sentry_destroy(this);
7698 basic_ios_char_setstate(base, state);
7699 return this;
7702 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7703 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7704 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
7705 int __thiscall basic_istream_char_sync(basic_istream_char *this)
7707 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7708 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7710 TRACE("(%p)\n", this);
7712 if(!strbuf)
7713 return -1;
7715 if(basic_istream_char_sentry_create(this, TRUE)) {
7716 if(basic_streambuf_char_pubsync(strbuf) != -1) {
7717 basic_istream_char_sentry_destroy(this);
7718 return 0;
7721 basic_istream_char_sentry_destroy(this);
7723 basic_ios_char_setstate(base, IOSTATE_badbit);
7724 return -1;
7727 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7728 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7729 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
7730 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
7732 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7734 TRACE("(%p %p)\n", this, ret);
7736 if(ios_base_fail(&base->base)) {
7737 ret->off = -1;
7738 ret->pos = 0;
7739 ret->state = 0;
7740 return ret;
7743 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
7744 ret, 0, SEEKDIR_cur, OPENMODE_in);
7746 if(ret->off==-1 && ret->pos==0 && ret->state==0)
7747 basic_ios_char_setstate(base, IOSTATE_failbit);
7749 return ret;
7752 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
7753 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
7754 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
7755 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
7756 #if STREAMOFF_BITS == 64
7757 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
7758 #else
7759 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
7760 #endif
7761 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
7763 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7765 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
7767 if(!ios_base_fail(&base->base)) {
7768 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7769 fpos_int ret;
7771 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
7774 return this;
7777 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7778 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7779 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
7780 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
7782 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7784 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
7786 if(!ios_base_fail(&base->base)) {
7787 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7788 fpos_int ret;
7790 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
7793 return this;
7796 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
7797 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
7798 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
7799 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
7801 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7802 int state = IOSTATE_goodbit;
7804 TRACE("(%p %p)\n", this, v);
7806 if(basic_istream_char_sentry_create(this, FALSE)) {
7807 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7808 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7809 istreambuf_iterator_char first={0}, last={0};
7810 LONG tmp;
7812 first.strbuf = strbuf;
7813 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
7815 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
7816 *v = tmp;
7817 else
7818 state |= IOSTATE_failbit;
7820 basic_istream_char_sentry_destroy(this);
7822 basic_ios_char_setstate(base, state);
7823 return this;
7826 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
7827 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
7828 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
7829 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
7831 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7832 int state = IOSTATE_goodbit;
7834 TRACE("(%p %p)\n", this, v);
7836 if(basic_istream_char_sentry_create(this, FALSE)) {
7837 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7838 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7839 istreambuf_iterator_char first={0}, last={0};
7841 first.strbuf = strbuf;
7842 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
7844 basic_istream_char_sentry_destroy(this);
7846 basic_ios_char_setstate(base, state);
7847 return this;
7850 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
7851 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
7852 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
7853 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
7855 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7856 int state = IOSTATE_goodbit;
7858 TRACE("(%p %p)\n", this, v);
7860 if(basic_istream_char_sentry_create(this, FALSE)) {
7861 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7862 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7863 istreambuf_iterator_char first={0}, last={0};
7865 first.strbuf = strbuf;
7866 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
7868 basic_istream_char_sentry_destroy(this);
7870 basic_ios_char_setstate(base, state);
7871 return this;
7874 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
7875 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
7876 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
7877 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
7879 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7880 int state = IOSTATE_goodbit;
7882 TRACE("(%p %p)\n", this, v);
7884 if(basic_istream_char_sentry_create(this, FALSE)) {
7885 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7886 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7887 istreambuf_iterator_char first={0}, last={0};
7889 first.strbuf = strbuf;
7890 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
7892 basic_istream_char_sentry_destroy(this);
7894 basic_ios_char_setstate(base, state);
7895 return this;
7898 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
7899 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
7900 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
7901 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
7903 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7904 int state = IOSTATE_goodbit;
7906 TRACE("(%p %p)\n", this, v);
7908 if(basic_istream_char_sentry_create(this, FALSE)) {
7909 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7910 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7911 istreambuf_iterator_char first={0}, last={0};
7913 first.strbuf = strbuf;
7914 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
7916 basic_istream_char_sentry_destroy(this);
7918 basic_ios_char_setstate(base, state);
7919 return this;
7922 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
7923 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
7924 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
7925 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
7927 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7928 int state = IOSTATE_goodbit;
7930 TRACE("(%p %p)\n", this, v);
7932 if(basic_istream_char_sentry_create(this, FALSE)) {
7933 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7934 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7935 istreambuf_iterator_char first={0}, last={0};
7937 first.strbuf = strbuf;
7938 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
7940 basic_istream_char_sentry_destroy(this);
7942 basic_ios_char_setstate(base, state);
7943 return this;
7946 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
7947 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
7948 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
7949 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
7951 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7952 int state = IOSTATE_goodbit;
7954 TRACE("(%p %p)\n", this, v);
7956 if(basic_istream_char_sentry_create(this, FALSE)) {
7957 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7958 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7959 istreambuf_iterator_char first={0}, last={0};
7961 first.strbuf = strbuf;
7962 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
7964 basic_istream_char_sentry_destroy(this);
7966 basic_ios_char_setstate(base, state);
7967 return this;
7970 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
7971 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
7972 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
7973 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
7975 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7976 int state = IOSTATE_goodbit;
7978 TRACE("(%p %p)\n", this, v);
7980 if(basic_istream_char_sentry_create(this, FALSE)) {
7981 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7982 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
7983 istreambuf_iterator_char first={0}, last={0};
7985 first.strbuf = strbuf;
7986 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
7988 basic_istream_char_sentry_destroy(this);
7990 basic_ios_char_setstate(base, state);
7991 return this;
7994 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
7995 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
7996 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
7997 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
7999 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8000 int state = IOSTATE_goodbit;
8002 TRACE("(%p %p)\n", this, v);
8004 if(basic_istream_char_sentry_create(this, FALSE)) {
8005 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8006 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8007 istreambuf_iterator_char first={0}, last={0};
8009 first.strbuf = strbuf;
8010 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
8012 basic_istream_char_sentry_destroy(this);
8014 basic_ios_char_setstate(base, state);
8015 return this;
8018 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
8019 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
8020 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
8021 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
8023 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8024 int state = IOSTATE_goodbit;
8026 TRACE("(%p %p)\n", this, v);
8028 if(basic_istream_char_sentry_create(this, FALSE)) {
8029 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8030 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8031 istreambuf_iterator_char first={0}, last={0};
8033 first.strbuf = strbuf;
8034 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
8036 basic_istream_char_sentry_destroy(this);
8038 basic_ios_char_setstate(base, state);
8039 return this;
8042 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
8043 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
8044 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
8045 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
8047 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8048 int state = IOSTATE_goodbit;
8050 TRACE("(%p %p)\n", this, v);
8052 if(basic_istream_char_sentry_create(this, FALSE)) {
8053 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8054 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8055 istreambuf_iterator_char first={0}, last={0};
8057 first.strbuf = strbuf;
8058 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
8060 basic_istream_char_sentry_destroy(this);
8062 basic_ios_char_setstate(base, state);
8063 return this;
8066 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
8067 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
8068 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
8069 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
8071 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8072 int state = IOSTATE_goodbit;
8074 TRACE("(%p %p)\n", this, v);
8076 if(basic_istream_char_sentry_create(this, FALSE)) {
8077 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8078 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8079 istreambuf_iterator_char first={0}, last={0};
8081 first.strbuf = strbuf;
8082 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
8084 basic_istream_char_sentry_destroy(this);
8086 basic_ios_char_setstate(base, state);
8087 return this;
8090 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
8091 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
8092 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
8093 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
8095 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8096 int state = IOSTATE_goodbit;
8098 TRACE("(%p %p)\n", this, v);
8100 if(basic_istream_char_sentry_create(this, FALSE)) {
8101 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8102 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8103 istreambuf_iterator_char first={0}, last={0};
8105 first.strbuf = strbuf;
8106 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
8108 basic_istream_char_sentry_destroy(this);
8110 basic_ios_char_setstate(base, state);
8111 return this;
8114 /* ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@D@Z */
8115 /* ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@D@Z */
8116 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
8117 basic_istream_char *istream, basic_string_char *str, char delim)
8119 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8120 IOSB_iostate state = IOSTATE_goodbit;
8121 int c = (unsigned char)delim;
8123 TRACE("(%p %p %c)\n", istream, str, delim);
8125 MSVCP_basic_string_char_clear(str);
8126 if(basic_istream_char_sentry_create(istream, TRUE)) {
8127 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8129 c = basic_streambuf_char_sgetc(strbuf);
8130 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
8131 MSVCP_basic_string_char_append_ch(str, c);
8132 if(c==EOF) state |= IOSTATE_eofbit;
8133 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
8135 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
8137 basic_istream_char_sentry_destroy(istream);
8139 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
8140 return istream;
8143 /* ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
8144 /* ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
8145 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
8146 basic_istream_char *istream, basic_string_char *str)
8148 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
8151 /* ??$?5DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
8152 /* ??$?5DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
8153 basic_istream_char* __cdecl basic_istream_char_read_bstr(
8154 basic_istream_char *istream, basic_string_char *str)
8156 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8157 IOSB_iostate state = IOSTATE_failbit;
8158 int c = '\n';
8160 TRACE("(%p %p)\n", istream, str);
8162 if(basic_istream_char_sentry_create(istream, FALSE)) {
8163 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8164 MSVCP_size_t count = ios_base_width_get(&base->base);
8166 if(!count)
8167 count = -1;
8169 MSVCP_basic_string_char_clear(str);
8171 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8172 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8173 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8174 state = IOSTATE_goodbit;
8175 MSVCP_basic_string_char_append_ch(str, c);
8178 basic_istream_char_sentry_destroy(istream);
8180 ios_base_width_set(&base->base, 0);
8181 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8182 return istream;
8185 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
8186 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
8187 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
8188 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
8189 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
8190 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
8191 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
8193 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8194 IOSB_iostate state = IOSTATE_failbit;
8195 int c = '\n';
8197 TRACE("(%p %p)\n", istream, str);
8199 if(basic_istream_char_sentry_create(istream, FALSE)) {
8200 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8201 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
8203 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8204 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8205 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8206 state = IOSTATE_goodbit;
8207 *str++ = c;
8210 basic_istream_char_sentry_destroy(istream);
8212 *str = 0;
8213 ios_base_width_set(&base->base, 0);
8214 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8215 return istream;
8218 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
8219 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
8220 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
8221 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
8222 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
8223 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
8224 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
8226 IOSB_iostate state = IOSTATE_failbit;
8227 int c = 0;
8229 TRACE("(%p %p)\n", istream, ch);
8231 if(basic_istream_char_sentry_create(istream, FALSE)) {
8232 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
8233 basic_istream_char_get_basic_ios(istream)));
8234 if(c != EOF) {
8235 state = IOSTATE_goodbit;
8236 *ch = c;
8239 basic_istream_char_sentry_destroy(istream);
8241 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
8242 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8243 return istream;
8246 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8247 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8248 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
8249 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
8250 basic_istream_char *this, basic_streambuf_char *streambuf)
8252 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8253 IOSB_iostate state = IOSTATE_failbit;
8254 int c = '\n';
8256 TRACE("(%p %p)\n", this, streambuf);
8258 if(basic_istream_char_sentry_create(this, FALSE)) {
8259 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
8260 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
8261 state = IOSTATE_goodbit;
8262 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
8263 break;
8266 basic_istream_char_sentry_destroy(this);
8268 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8269 return this;
8272 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8273 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8274 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
8275 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
8276 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
8278 TRACE("(%p %p)\n", this, pfunc);
8279 pfunc(this);
8280 return this;
8283 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
8284 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
8285 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
8286 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
8287 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
8289 TRACE("(%p %p)\n", this, pfunc);
8290 pfunc(basic_istream_char_get_basic_ios(this));
8291 return this;
8294 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8295 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8296 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
8297 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
8298 ios_base* (__cdecl *pfunc)(ios_base*))
8300 TRACE("(%p %p)\n", this, pfunc);
8301 pfunc(&basic_istream_char_get_basic_ios(this)->base);
8302 return this;
8305 /* Caution: basic_istream uses virtual inheritance. */
8306 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
8308 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
8311 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
8313 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
8316 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
8318 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
8321 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
8322 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
8323 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
8324 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
8325 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
8327 basic_ios_wchar *base;
8329 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
8331 if(virt_init) {
8332 this->vbtable = basic_istream_wchar_vbtable;
8333 base = basic_istream_wchar_get_basic_ios(this);
8334 basic_ios_wchar_ctor(base);
8335 }else {
8336 base = basic_istream_wchar_get_basic_ios(this);
8339 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
8340 this->count = 0;
8341 if(!noinit)
8342 basic_ios_wchar_init(base, strbuf, isstd);
8343 return this;
8346 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
8347 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
8348 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
8349 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
8350 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
8352 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
8353 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8354 return this;
8357 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8358 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8359 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
8360 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
8361 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8363 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8366 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8367 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8368 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
8369 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
8370 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8372 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8375 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8376 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8377 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
8378 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
8379 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8381 basic_ios_wchar *base;
8383 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
8385 if(virt_init) {
8386 this->vbtable = basic_istream_wchar_vbtable;
8387 base = basic_istream_wchar_get_basic_ios(this);
8388 basic_ios_wchar_ctor(base);
8389 }else {
8390 base = basic_istream_wchar_get_basic_ios(this);
8393 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
8394 ios_base_Addstd(&base->base);
8395 return this;
8398 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8399 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8400 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
8401 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
8402 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8404 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
8405 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8406 return this;
8409 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
8410 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
8411 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
8412 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
8413 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
8414 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
8416 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8418 /* don't destroy virtual base here */
8419 TRACE("(%p)\n", this);
8422 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
8423 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
8424 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
8425 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
8426 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
8427 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
8429 TRACE("(%p)\n", this);
8430 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
8431 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
8434 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
8435 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
8437 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8439 TRACE("(%p %x)\n", this, flags);
8441 if(flags & 2) {
8442 /* we have an array, with the number of elements stored before the first object */
8443 INT_PTR i, *ptr = (INT_PTR *)this-1;
8445 for(i=*ptr-1; i>=0; i--)
8446 basic_istream_wchar_vbase_dtor(this+i);
8447 MSVCRT_operator_delete(ptr);
8448 } else {
8449 basic_istream_wchar_vbase_dtor(this);
8450 if(flags & 1)
8451 MSVCRT_operator_delete(this);
8454 return this;
8457 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
8458 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
8459 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
8460 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
8461 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
8462 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
8464 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8466 TRACE("(%p %d)\n", this, noskip);
8468 if(ios_base_good(&base->base)) {
8469 if(basic_ios_wchar_tie_get(base))
8470 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
8472 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
8473 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8474 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(base->strbuf));
8475 int ch;
8477 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
8478 ch = basic_streambuf_wchar_snextc(strbuf)) {
8479 if(ch==WEOF || !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
8480 break;
8485 if(!ios_base_good(&base->base)) {
8486 basic_ios_wchar_setstate(base, IOSTATE_failbit);
8487 return FALSE;
8489 return TRUE;
8492 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
8493 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
8494 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
8495 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
8496 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
8497 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
8499 return basic_istream_wchar__Ipfx(this, noskip);
8502 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
8503 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
8504 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
8505 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
8506 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
8507 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
8509 TRACE("(%p)\n", this);
8512 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
8514 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
8516 if(basic_ios_wchar_rdbuf_get(base))
8517 basic_streambuf_wchar__Lock(base->strbuf);
8519 return basic_istream_wchar_ipfx(istr, noskip);
8522 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
8524 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
8526 if(basic_ios_wchar_rdbuf_get(base))
8527 basic_streambuf_wchar__Unlock(base->strbuf);
8530 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
8531 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
8532 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
8533 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
8534 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
8535 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
8536 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
8537 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
8538 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
8539 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
8541 TRACE("(%p)\n", this);
8542 return this->count;
8545 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
8546 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
8547 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
8548 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
8549 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
8550 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
8552 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8553 int ret;
8555 TRACE("(%p)\n", this);
8557 this->count = 0;
8559 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
8560 basic_istream_wchar_sentry_destroy(this);
8561 return WEOF;
8564 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
8565 basic_istream_wchar_sentry_destroy(this);
8566 if(ret == WEOF)
8567 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
8568 else
8569 this->count++;
8571 return ret;
8574 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
8575 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
8576 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
8577 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
8578 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
8579 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
8581 unsigned short ret;
8583 TRACE("(%p %p)\n", this, ch);
8585 ret = basic_istream_wchar_get(this);
8586 if(ret != WEOF)
8587 *ch = (wchar_t)ret;
8588 return this;
8591 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
8592 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
8593 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
8594 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
8595 #if STREAMSIZE_BITS == 64
8596 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
8597 #else
8598 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
8599 #endif
8600 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
8602 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8603 unsigned short ch = delim;
8605 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
8607 this->count = 0;
8609 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8610 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8612 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
8613 ch = basic_streambuf_wchar_snextc(strbuf)) {
8614 if(ch==WEOF || ch==delim)
8615 break;
8617 *str++ = ch;
8618 this->count++;
8619 count--;
8622 basic_istream_wchar_sentry_destroy(this);
8624 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8625 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8626 if(count > 0)
8627 *str = 0;
8628 return this;
8631 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8632 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8633 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8634 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8635 #if STREAMSIZE_BITS == 64
8636 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
8637 #else
8638 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
8639 #endif
8640 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
8642 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
8645 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
8646 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
8647 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
8648 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
8649 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
8650 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
8652 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8653 unsigned short ch = delim;
8655 TRACE("(%p %p %c)\n", this, strbuf, delim);
8657 this->count = 0;
8659 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8660 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
8662 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
8663 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
8664 if(ch==WEOF || ch==delim)
8665 break;
8667 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
8668 break;
8669 this->count++;
8672 basic_istream_wchar_sentry_destroy(this);
8674 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8675 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8676 return this;
8679 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
8680 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
8681 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
8682 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
8683 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
8684 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
8686 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
8689 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
8690 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
8691 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
8692 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
8693 #if STREAMSIZE_BITS == 64
8694 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
8695 #else
8696 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
8697 #endif
8698 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
8700 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8701 unsigned short ch = delim;
8703 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
8705 this->count = 0;
8707 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
8708 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8710 while(count > 1) {
8711 ch = basic_streambuf_wchar_sbumpc(strbuf);
8713 if(ch==WEOF || ch==delim)
8714 break;
8716 *str++ = ch;
8717 this->count++;
8718 count--;
8721 if(ch == delim)
8722 this->count++;
8723 else if(ch != WEOF) {
8724 ch = basic_streambuf_wchar_sgetc(strbuf);
8726 if(ch == delim) {
8727 basic_streambuf_wchar__Gninc(strbuf);
8728 this->count++;
8732 basic_istream_wchar_sentry_destroy(this);
8734 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8735 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8736 if(count > 0)
8737 *str = 0;
8738 return this;
8741 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8742 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8743 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8744 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8745 #if STREAMSIZE_BITS == 64
8746 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
8747 #else
8748 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
8749 #endif
8750 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
8752 return basic_istream_wchar_getline_delim(this, str, count, '\n');
8755 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
8756 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
8757 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
8758 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
8759 #if STREAMSIZE_BITS == 64
8760 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
8761 #else
8762 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
8763 #endif
8764 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
8766 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8767 unsigned short ch = delim;
8768 unsigned int state;
8770 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8772 this->count = 0;
8774 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8775 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8776 state = IOSTATE_goodbit;
8778 while(count > 0) {
8779 ch = basic_streambuf_wchar_sbumpc(strbuf);
8781 if(ch==WEOF) {
8782 state = IOSTATE_eofbit;
8783 break;
8786 if(ch==delim)
8787 break;
8789 this->count++;
8790 if(count != INT_MAX)
8791 count--;
8793 }else
8794 state = IOSTATE_failbit;
8795 basic_istream_wchar_sentry_destroy(this);
8797 basic_ios_wchar_setstate(base, state);
8798 return this;
8801 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
8802 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
8803 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
8804 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
8805 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
8807 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
8808 unsigned short ch = '\n';
8810 TRACE("(%p)\n", istream);
8812 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
8813 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8814 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(strbuf));
8816 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
8817 ch = basic_streambuf_wchar_snextc(strbuf)) {
8818 if(ch == WEOF)
8819 break;
8822 basic_istream_wchar_sentry_destroy(istream);
8824 if(ch == WEOF)
8825 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
8826 return istream;
8829 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
8830 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
8831 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
8832 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
8833 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
8834 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
8836 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8837 unsigned short ret = WEOF;
8839 TRACE("(%p)\n", this);
8841 this->count = 0;
8843 if(basic_istream_wchar_sentry_create(this, TRUE))
8844 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
8845 basic_istream_wchar_sentry_destroy(this);
8847 if (ret == WEOF)
8848 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
8850 return ret;
8853 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
8854 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
8855 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
8856 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
8857 #if STREAMSIZE_BITS == 64
8858 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
8859 #else
8860 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
8861 #endif
8862 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
8864 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8865 IOSB_iostate state = IOSTATE_goodbit;
8867 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8869 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8870 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8872 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
8873 if(this->count != count)
8874 state |= IOSTATE_failbit | IOSTATE_eofbit;
8875 }else {
8876 this->count = 0;
8878 basic_istream_wchar_sentry_destroy(this);
8880 basic_ios_wchar_setstate(base, state);
8881 return this;
8884 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8885 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8886 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8887 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8888 #if STREAMSIZE_BITS == 64
8889 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
8890 #else
8891 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
8892 #endif
8893 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
8895 return basic_istream_wchar__Read_s(this, str, -1, count);
8898 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
8899 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
8900 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
8901 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
8902 #if STREAMSIZE_BITS == 64
8903 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
8904 #else
8905 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
8906 #endif
8907 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
8909 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8910 IOSB_iostate state = IOSTATE_goodbit;
8912 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8914 this->count = 0;
8916 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8917 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
8918 if(avail > count)
8919 avail = count;
8921 if(avail == -1)
8922 state |= IOSTATE_eofbit;
8923 else if(avail > 0)
8924 basic_istream_wchar__Read_s(this, str, size, avail);
8925 }else {
8926 state |= IOSTATE_failbit;
8928 basic_istream_wchar_sentry_destroy(this);
8930 basic_ios_wchar_setstate(base, state);
8931 return this->count;
8934 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
8935 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
8936 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
8937 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
8938 #if STREAMSIZE_BITS == 64
8939 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
8940 #else
8941 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
8942 #endif
8943 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
8945 return basic_istream_wchar__Readsome_s(this, str, count, count);
8948 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
8949 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
8950 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
8951 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
8952 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
8953 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
8955 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8956 IOSB_iostate state = IOSTATE_goodbit;
8958 TRACE("(%p %c)\n", this, ch);
8960 this->count = 0;
8962 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8963 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8965 if(!ios_base_good(&base->base))
8966 state |= IOSTATE_failbit;
8967 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
8968 state |= IOSTATE_badbit;
8970 basic_istream_wchar_sentry_destroy(this);
8972 basic_ios_wchar_setstate(base, state);
8973 return this;
8976 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
8977 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
8978 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
8979 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
8980 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
8981 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
8983 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8984 IOSB_iostate state = IOSTATE_goodbit;
8986 TRACE("(%p)\n", this);
8988 this->count = 0;
8990 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8991 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8993 if(!ios_base_good(&base->base))
8994 state |= IOSTATE_failbit;
8995 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
8996 state |= IOSTATE_badbit;
8998 basic_istream_wchar_sentry_destroy(this);
9000 basic_ios_wchar_setstate(base, state);
9001 return this;
9004 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
9005 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
9006 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
9007 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
9008 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
9009 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
9011 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9012 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9014 TRACE("(%p)\n", this);
9016 if(!strbuf)
9017 return -1;
9019 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9020 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
9021 basic_istream_wchar_sentry_destroy(this);
9022 return 0;
9025 basic_istream_wchar_sentry_destroy(this);
9027 basic_ios_wchar_setstate(base, IOSTATE_badbit);
9028 return -1;
9031 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9032 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9033 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9034 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9035 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
9036 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
9038 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9040 TRACE("(%p %p)\n", this, ret);
9042 if(ios_base_fail(&base->base)) {
9043 ret->off = -1;
9044 ret->pos = 0;
9045 ret->state = 0;
9046 return ret;
9049 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
9050 ret, 0, SEEKDIR_cur, OPENMODE_in);
9051 if(ret->off==-1 && ret->pos==0 && ret->state==0)
9052 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9054 return ret;
9057 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
9058 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
9059 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
9060 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
9061 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
9062 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
9063 #if STREAMOFF_BITS == 64
9064 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
9065 #else
9066 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
9067 #endif
9068 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
9070 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9072 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
9074 if(!ios_base_fail(&base->base)) {
9075 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9076 fpos_int ret;
9078 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
9081 return this;
9084 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9085 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9086 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9087 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9088 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
9089 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
9091 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9093 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
9095 if(!ios_base_fail(&base->base)) {
9096 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9097 fpos_int ret;
9099 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
9102 return this;
9105 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
9107 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9108 int state = IOSTATE_goodbit;
9110 TRACE("(%p %p)\n", this, v);
9112 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9113 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9114 istreambuf_iterator_wchar first={0}, last={0};
9115 LONG tmp;
9117 first.strbuf = strbuf;
9118 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
9120 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
9121 *v = tmp;
9122 else
9123 state |= IOSTATE_failbit;
9125 basic_istream_wchar_sentry_destroy(this);
9127 basic_ios_wchar_setstate(base, state);
9128 return this;
9131 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
9132 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
9133 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
9134 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
9136 return basic_istream_read_short(this, v, num_get_short_use_facet(
9137 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9140 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
9142 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9143 int state = IOSTATE_goodbit;
9145 TRACE("(%p %p)\n", this, v);
9147 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9148 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9149 istreambuf_iterator_wchar first={0}, last={0};
9151 first.strbuf = strbuf;
9152 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9154 basic_istream_wchar_sentry_destroy(this);
9156 basic_ios_wchar_setstate(base, state);
9157 return this;
9160 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
9161 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
9162 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
9163 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
9165 return basic_istream_read_int(this, v, num_get_short_use_facet(
9166 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9169 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
9171 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9172 int state = IOSTATE_goodbit;
9174 TRACE("(%p %p)\n", this, v);
9176 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9177 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9178 istreambuf_iterator_wchar first={0}, last={0};
9180 first.strbuf = strbuf;
9181 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
9183 basic_istream_wchar_sentry_destroy(this);
9185 basic_ios_wchar_setstate(base, state);
9186 return this;
9189 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
9190 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
9191 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
9192 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
9194 return basic_istream_read_uint(this, v, num_get_short_use_facet(
9195 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9198 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
9200 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9201 int state = IOSTATE_goodbit;
9203 TRACE("(%p %p)\n", this, v);
9205 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9206 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9207 istreambuf_iterator_wchar first={0}, last={0};
9209 first.strbuf = strbuf;
9210 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9212 basic_istream_wchar_sentry_destroy(this);
9214 basic_ios_wchar_setstate(base, state);
9215 return this;
9218 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
9219 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
9220 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
9221 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
9223 return basic_istream_read_long(this, v, num_get_short_use_facet(
9224 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9227 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
9229 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9230 int state = IOSTATE_goodbit;
9232 TRACE("(%p %p)\n", this, v);
9234 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9235 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9236 istreambuf_iterator_wchar first={0}, last={0};
9238 first.strbuf = strbuf;
9239 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
9241 basic_istream_wchar_sentry_destroy(this);
9243 basic_ios_wchar_setstate(base, state);
9244 return this;
9247 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
9248 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
9249 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
9250 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
9252 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
9253 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9256 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
9258 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9259 int state = IOSTATE_goodbit;
9261 TRACE("(%p %p)\n", this, v);
9263 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9264 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9265 istreambuf_iterator_wchar first={0}, last={0};
9267 first.strbuf = strbuf;
9268 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
9270 basic_istream_wchar_sentry_destroy(this);
9272 basic_ios_wchar_setstate(base, state);
9273 return this;
9276 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
9277 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
9278 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
9279 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
9281 return basic_istream_read_float(this, v, num_get_short_use_facet(
9282 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9285 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
9287 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9288 int state = IOSTATE_goodbit;
9290 TRACE("(%p %p)\n", this, v);
9292 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9293 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9294 istreambuf_iterator_wchar first={0}, last={0};
9296 first.strbuf = strbuf;
9297 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
9299 basic_istream_wchar_sentry_destroy(this);
9301 basic_ios_wchar_setstate(base, state);
9302 return this;
9305 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
9306 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
9307 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
9308 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
9310 return basic_istream_read_double(this, v, num_get_short_use_facet(
9311 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9314 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
9316 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9317 int state = IOSTATE_goodbit;
9319 TRACE("(%p %p)\n", this, v);
9321 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9322 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9323 istreambuf_iterator_wchar first={0}, last={0};
9325 first.strbuf = strbuf;
9326 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
9328 basic_istream_wchar_sentry_destroy(this);
9330 basic_ios_wchar_setstate(base, state);
9331 return this;
9334 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
9335 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
9336 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
9337 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
9339 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
9340 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9343 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
9345 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9346 int state = IOSTATE_goodbit;
9348 TRACE("(%p %p)\n", this, v);
9350 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9351 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9352 istreambuf_iterator_wchar first={0}, last={0};
9354 first.strbuf = strbuf;
9355 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
9357 basic_istream_wchar_sentry_destroy(this);
9359 basic_ios_wchar_setstate(base, state);
9360 return this;
9363 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
9364 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
9365 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
9366 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
9368 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
9369 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9372 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
9374 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9375 int state = IOSTATE_goodbit;
9377 TRACE("(%p %p)\n", this, v);
9379 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9380 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9381 istreambuf_iterator_wchar first={0}, last={0};
9383 first.strbuf = strbuf;
9384 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
9386 basic_istream_wchar_sentry_destroy(this);
9388 basic_ios_wchar_setstate(base, state);
9389 return this;
9392 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
9393 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
9394 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
9395 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
9397 return basic_istream_read_int64(this, v, num_get_short_use_facet(
9398 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9401 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
9403 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9404 int state = IOSTATE_goodbit;
9406 TRACE("(%p %p)\n", this, v);
9408 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9409 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9410 istreambuf_iterator_wchar first={0}, last={0};
9412 first.strbuf = strbuf;
9413 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
9415 basic_istream_wchar_sentry_destroy(this);
9417 basic_ios_wchar_setstate(base, state);
9418 return this;
9421 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
9422 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
9423 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
9424 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
9426 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
9427 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9430 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
9432 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9433 int state = IOSTATE_goodbit;
9435 TRACE("(%p %p)\n", this, v);
9437 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9438 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9439 istreambuf_iterator_wchar first={0}, last={0};
9441 first.strbuf = strbuf;
9442 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
9444 basic_istream_wchar_sentry_destroy(this);
9446 basic_ios_wchar_setstate(base, state);
9447 return this;
9450 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
9451 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
9452 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
9453 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
9455 return basic_istream_read_bool(this, v, num_get_short_use_facet(
9456 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9459 /* ??$getline@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@_W@Z */
9460 /* ??$getline@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@_W@Z */
9461 /* ??$getline@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@G@Z */
9462 /* ??$getline@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@G@Z */
9463 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
9464 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
9466 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9467 IOSB_iostate state = IOSTATE_goodbit;
9468 int c = delim;
9470 TRACE("(%p %p %c)\n", istream, str, delim);
9472 MSVCP_basic_string_wchar_clear(str);
9473 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
9474 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9476 c = basic_streambuf_wchar_sgetc(strbuf);
9477 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
9478 MSVCP_basic_string_wchar_append_ch(str, c);
9479 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
9480 else if(c==WEOF) state |= IOSTATE_eofbit;
9482 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
9484 basic_istream_wchar_sentry_destroy(istream);
9486 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
9487 return istream;
9490 /* ??$getline@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
9491 /* ??$getline@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
9492 /* ??$getline@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
9493 /* ??$getline@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
9494 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
9495 basic_istream_wchar *istream, basic_string_wchar *str)
9497 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
9500 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
9501 basic_string_wchar *str, const ctype_wchar *ctype)
9503 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9504 IOSB_iostate state = IOSTATE_failbit;
9505 int c = '\n';
9507 TRACE("(%p %p)\n", istream, str);
9509 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9510 MSVCP_size_t count = ios_base_width_get(&base->base);
9512 if(!count)
9513 count = -1;
9515 MSVCP_basic_string_wchar_clear(str);
9517 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9518 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9519 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
9520 state = IOSTATE_goodbit;
9521 MSVCP_basic_string_wchar_append_ch(str, c);
9524 basic_istream_wchar_sentry_destroy(istream);
9526 ios_base_width_set(&base->base, 0);
9527 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9528 return istream;
9531 /* ??$?5_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
9532 /* ??$?5_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
9533 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
9534 basic_istream_wchar *istream, basic_string_wchar *str)
9536 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
9537 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
9540 /* ??$?5GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
9541 /* ??$?5GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
9542 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
9543 basic_istream_wchar *istream, basic_string_wchar *str)
9545 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
9546 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
9549 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
9551 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9552 IOSB_iostate state = IOSTATE_failbit;
9553 unsigned short c = '\n';
9555 TRACE("(%p %p)\n", istream, str);
9557 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9558 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
9560 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9561 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9562 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
9563 state = IOSTATE_goodbit;
9564 *str++ = c;
9567 basic_istream_wchar_sentry_destroy(istream);
9569 *str = 0;
9570 ios_base_width_set(&base->base, 0);
9571 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9572 return istream;
9575 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
9576 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
9577 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
9579 return basic_istream_read_str(istream, str, ctype_short_use_facet(
9580 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
9583 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
9584 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
9585 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
9586 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
9587 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
9589 IOSB_iostate state = IOSTATE_failbit;
9590 unsigned short c = 0;
9592 TRACE("(%p %p)\n", istream, ch);
9594 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9595 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
9596 basic_istream_wchar_get_basic_ios(istream)));
9597 if(c != WEOF) {
9598 state = IOSTATE_goodbit;
9599 *ch = c;
9602 basic_istream_wchar_sentry_destroy(istream);
9604 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
9605 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9606 return istream;
9609 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9610 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9611 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9612 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9613 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
9614 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
9615 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
9617 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9618 IOSB_iostate state = IOSTATE_failbit;
9619 unsigned short c = '\n';
9621 TRACE("(%p %p)\n", this, streambuf);
9623 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9624 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
9625 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
9626 state = IOSTATE_goodbit;
9627 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
9628 break;
9631 basic_istream_wchar_sentry_destroy(this);
9633 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9634 return this;
9637 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9638 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9639 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9640 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9641 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
9642 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
9643 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
9645 TRACE("(%p %p)\n", this, pfunc);
9646 pfunc(this);
9647 return this;
9650 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
9651 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
9652 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
9653 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
9654 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
9655 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
9656 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
9658 TRACE("(%p %p)\n", this, pfunc);
9659 pfunc(basic_istream_wchar_get_basic_ios(this));
9660 return this;
9663 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9664 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9665 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9666 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9667 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
9668 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
9669 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
9671 TRACE("(%p %p)\n", this, pfunc);
9672 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
9673 return this;
9676 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
9678 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
9681 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
9683 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
9686 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9687 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9688 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
9689 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
9691 basic_ios_char *basic_ios;
9693 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
9695 if(virt_init) {
9696 this->base1.vbtable = basic_iostream_char_vbtable1;
9697 this->base2.vbtable = basic_iostream_char_vbtable2;
9698 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
9699 basic_ios_char_ctor(basic_ios);
9700 }else {
9701 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
9704 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
9706 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
9707 basic_ostream_char_ctor(&this->base2, NULL, FALSE, FALSE, FALSE);
9708 return this;
9711 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
9712 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
9713 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
9714 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
9716 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
9718 TRACE("(%p)\n", this);
9719 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
9720 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
9723 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9724 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9725 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
9726 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
9728 TRACE("(%p)\n", this);
9729 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
9730 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
9733 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
9734 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
9736 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
9738 TRACE("(%p %x)\n", this, flags);
9740 if(flags & 2) {
9741 /* we have an array, with the number of elements stored before the first object */
9742 INT_PTR i, *ptr = (INT_PTR *)this-1;
9744 for(i=*ptr-1; i>=0; i--)
9745 basic_iostream_char_vbase_dtor(this+i);
9746 MSVCRT_operator_delete(ptr);
9747 } else {
9748 basic_iostream_char_vbase_dtor(this);
9749 if(flags & 1)
9750 MSVCRT_operator_delete(this);
9753 return this;
9756 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
9758 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
9761 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9763 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
9766 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9767 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9768 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
9769 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
9770 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
9772 basic_ios_wchar *basic_ios;
9774 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
9776 if(virt_init) {
9777 this->base1.vbtable = basic_iostream_wchar_vbtable1;
9778 this->base2.vbtable = basic_iostream_wchar_vbtable2;
9779 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
9780 basic_ios_wchar_ctor(basic_ios);
9781 }else {
9782 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
9785 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
9786 basic_ostream_short_ctor(&this->base2, NULL, FALSE, FALSE, FALSE);
9788 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
9789 return this;
9792 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9793 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9794 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
9795 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
9796 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
9798 basic_iostream_wchar_ctor(this, strbuf, virt_init);
9799 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
9800 return this;
9803 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9804 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9805 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9806 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9807 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
9808 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
9810 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
9812 TRACE("(%p)\n", this);
9813 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
9814 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
9817 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9818 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9819 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9820 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9821 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
9822 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
9824 TRACE("(%p)\n", this);
9825 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
9826 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
9829 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
9830 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9832 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
9834 TRACE("(%p %x)\n", this, flags);
9836 if(flags & 2) {
9837 /* we have an array, with the number of elements stored before the first object */
9838 INT_PTR i, *ptr = (INT_PTR *)this-1;
9840 for(i=*ptr-1; i>=0; i--)
9841 basic_iostream_wchar_vbase_dtor(this+i);
9842 MSVCRT_operator_delete(ptr);
9843 } else {
9844 basic_iostream_wchar_vbase_dtor(this);
9845 if(flags & 1)
9846 MSVCRT_operator_delete(this);
9849 return this;
9852 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
9854 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
9857 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
9859 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
9862 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
9863 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
9864 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
9865 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
9867 basic_ios_char *basic_ios;
9869 TRACE("(%p %d)\n", this, virt_init);
9871 if(virt_init) {
9872 this->base.vbtable = basic_ofstream_char_vbtable;
9873 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9874 basic_ios_char_ctor(basic_ios);
9875 }else {
9876 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9879 basic_filebuf_char_ctor(&this->filebuf);
9880 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
9881 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
9882 return this;
9885 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
9886 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
9887 static basic_ofstream_char* basic_ofstream_char_ctor_file(
9888 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
9890 basic_ios_char *basic_ios;
9892 TRACE("(%p %p %d)\n", this, file, virt_init);
9894 if(virt_init) {
9895 this->base.vbtable = basic_ofstream_char_vbtable;
9896 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9897 basic_ios_char_ctor(basic_ios);
9898 }else {
9899 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9902 basic_filebuf_char_ctor_file(&this->filebuf, file);
9903 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
9904 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
9905 return this;
9908 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
9909 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
9910 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_copy_ctor, 12)
9911 basic_ofstream_char* __thiscall basic_ofstream_char_copy_ctor(basic_ofstream_char *this,
9912 basic_ofstream_char *copy, MSVCP_bool virt_init)
9914 TRACE("(%p %p %d)\n", this, copy, virt_init);
9915 return basic_ofstream_char_ctor_file(this, copy->filebuf.file, virt_init);
9918 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
9919 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
9920 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 16)
9921 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
9922 const char *name, int mode, MSVCP_bool virt_init)
9924 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
9926 basic_ofstream_char_ctor(this, virt_init);
9928 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
9929 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9930 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
9932 return this;
9935 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
9936 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
9937 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
9938 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
9940 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
9942 TRACE("(%p)\n", this);
9944 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
9945 basic_filebuf_char_dtor(&this->filebuf);
9948 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9949 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9950 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
9951 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
9953 TRACE("(%p)\n", this);
9955 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
9956 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
9959 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
9960 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
9962 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
9964 TRACE("(%p %x)\n", this, flags);
9966 if(flags & 2) {
9967 /* we have an array, with the number of elements stored before the first object */
9968 INT_PTR i, *ptr = (INT_PTR *)this-1;
9970 for(i=*ptr-1; i>=0; i--)
9971 basic_ofstream_char_vbase_dtor(this+i);
9972 MSVCRT_operator_delete(ptr);
9973 } else {
9974 basic_ofstream_char_vbase_dtor(this);
9975 if(flags & 1)
9976 MSVCRT_operator_delete(this);
9979 return this;
9982 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9983 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9984 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
9985 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
9987 TRACE("(%p)\n", this);
9989 if(!basic_filebuf_char_close(&this->filebuf)) {
9990 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9991 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
9995 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
9996 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
9997 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
9998 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
10000 TRACE("(%p)\n", this);
10001 return basic_filebuf_char_is_open(&this->filebuf);
10004 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
10005 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
10006 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 12)
10007 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
10008 const char *name, int mode)
10010 TRACE("(%p %s %d)\n", this, name, mode);
10012 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
10013 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10014 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10018 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
10019 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
10020 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
10021 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
10022 const char *name, short mode)
10024 basic_ofstream_char_open(this, name, mode);
10027 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10028 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10029 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
10030 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
10032 TRACE("(%p)\n", this);
10033 return (basic_filebuf_char*)&this->filebuf;
10036 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
10038 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
10041 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10043 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
10046 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10047 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10048 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
10049 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10051 basic_ios_wchar *basic_ios;
10053 TRACE("(%p %d)\n", this, virt_init);
10055 if(virt_init) {
10056 this->base.vbtable = basic_ofstream_wchar_vbtable;
10057 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10058 basic_ios_wchar_ctor(basic_ios);
10059 }else {
10060 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10063 basic_filebuf_wchar_ctor(&this->filebuf);
10064 basic_ostream_short_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
10065 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
10066 return this;
10069 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10070 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10071 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
10072 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10074 basic_ofstream_wchar_ctor(this, virt_init);
10075 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10076 return this;
10079 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10080 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10081 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
10082 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
10083 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10085 basic_ios_wchar *basic_ios;
10087 TRACE("(%p %p %d)\n", this, file, virt_init);
10089 if(virt_init) {
10090 this->base.vbtable = basic_ofstream_wchar_vbtable;
10091 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10092 basic_ios_wchar_ctor(basic_ios);
10093 }else {
10094 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10097 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10098 basic_ostream_short_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
10099 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
10100 return this;
10103 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10104 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10105 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
10106 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
10107 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10109 basic_ofstream_wchar_ctor_file(this, file, virt_init);
10110 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10111 return this;
10114 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
10115 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
10116 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_copy_ctor, 12)
10117 basic_ofstream_wchar* __thiscall basic_ofstream_short_copy_ctor(basic_ofstream_wchar *this,
10118 basic_ofstream_wchar *copy, MSVCP_bool virt_init)
10120 TRACE("(%p %p %d)\n", this, copy, virt_init);
10121 return basic_ofstream_short_ctor_file(this, copy->filebuf.file, virt_init);
10124 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
10125 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
10126 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 16)
10127 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
10128 const char *name, int mode, MSVCP_bool virt_init)
10130 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10132 basic_ofstream_short_ctor(this, virt_init);
10134 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
10135 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10136 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10138 return this;
10141 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10142 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10143 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10144 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10145 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
10146 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
10148 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
10150 TRACE("(%p)\n", this);
10152 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
10153 basic_filebuf_wchar_dtor(&this->filebuf);
10156 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10157 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10158 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10159 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10160 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
10161 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
10163 TRACE("(%p)\n", this);
10165 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
10166 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
10169 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
10170 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10172 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
10174 TRACE("(%p %x)\n", this, flags);
10176 if(flags & 2) {
10177 /* we have an array, with the number of elements stored before the first object */
10178 INT_PTR i, *ptr = (INT_PTR *)this-1;
10180 for(i=*ptr-1; i>=0; i--)
10181 basic_ofstream_wchar_vbase_dtor(this+i);
10182 MSVCRT_operator_delete(ptr);
10183 } else {
10184 basic_ofstream_wchar_vbase_dtor(this);
10185 if(flags & 1)
10186 MSVCRT_operator_delete(this);
10189 return this;
10192 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10193 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10194 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10195 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10196 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
10197 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
10199 TRACE("(%p)\n", this);
10201 if(!basic_filebuf_wchar_close(&this->filebuf)) {
10202 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10203 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10207 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
10208 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
10209 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
10210 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
10211 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
10212 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
10214 TRACE("(%p)\n", this);
10215 return basic_filebuf_wchar_is_open(&this->filebuf);
10218 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
10219 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
10220 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 12)
10221 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
10222 const char *name, int mode)
10224 TRACE("(%p %s %d)\n", this, name, mode);
10226 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
10227 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10228 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10232 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
10233 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
10234 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
10235 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
10236 const char *name, int mode)
10238 basic_ofstream_wchar_open(this, name, mode);
10241 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10242 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10243 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10244 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10245 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
10246 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
10248 TRACE("(%p)\n", this);
10249 return (basic_filebuf_wchar*)&this->filebuf;
10252 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
10254 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
10257 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
10259 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
10262 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10263 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10264 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
10265 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
10267 basic_ios_char *basic_ios;
10269 TRACE("(%p %d)\n", this, virt_init);
10271 if(virt_init) {
10272 this->base.vbtable = basic_ifstream_char_vbtable;
10273 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10274 basic_ios_char_ctor(basic_ios);
10275 }else {
10276 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10279 basic_filebuf_char_ctor(&this->filebuf);
10280 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10281 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
10282 return this;
10285 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10286 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10287 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
10288 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
10289 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
10291 basic_ios_char *basic_ios;
10293 TRACE("(%p %p %d)\n", this, file, virt_init);
10295 if(virt_init) {
10296 this->base.vbtable = basic_ifstream_char_vbtable;
10297 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10298 basic_ios_char_ctor(basic_ios);
10299 }else {
10300 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10303 basic_filebuf_char_ctor_file(&this->filebuf, file);
10304 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10305 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
10306 return this;
10309 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
10310 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
10311 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_copy_ctor, 12)
10312 basic_ifstream_char* __thiscall basic_ifstream_char_copy_ctor(basic_ifstream_char *this,
10313 const basic_ifstream_char *copy, MSVCP_bool virt_init)
10315 TRACE("(%p %p %d)\n", this, copy, virt_init);
10316 return basic_ifstream_char_ctor_file(this, copy->filebuf.file, virt_init);
10319 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
10320 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
10321 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 16)
10322 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
10323 const char *name, int mode, MSVCP_bool virt_init)
10325 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10327 basic_ifstream_char_ctor(this, virt_init);
10329 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
10330 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10331 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10333 return this;
10336 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10337 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10338 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
10339 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
10341 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
10343 TRACE("(%p)\n", this);
10345 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
10346 basic_filebuf_char_dtor(&this->filebuf);
10349 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10350 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10351 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
10352 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
10354 TRACE("(%p)\n", this);
10356 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
10357 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
10360 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
10361 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10363 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
10365 TRACE("(%p %x)\n", this, flags);
10367 if(flags & 2) {
10368 /* we have an array, with the number of elements stored before the first object */
10369 INT_PTR i, *ptr = (INT_PTR *)this-1;
10371 for(i=*ptr-1; i>=0; i--)
10372 basic_ifstream_char_vbase_dtor(this+i);
10373 MSVCRT_operator_delete(ptr);
10374 } else {
10375 basic_ifstream_char_vbase_dtor(this);
10376 if(flags & 1)
10377 MSVCRT_operator_delete(this);
10380 return this;
10383 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10384 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10385 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
10386 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
10388 TRACE("(%p)\n", this);
10390 if(!basic_filebuf_char_close(&this->filebuf)) {
10391 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10392 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10396 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10397 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10398 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
10399 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
10401 TRACE("(%p)\n", this);
10402 return basic_filebuf_char_is_open(&this->filebuf);
10405 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
10406 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
10407 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 12)
10408 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
10409 const char *name, int mode)
10411 TRACE("(%p %s %d)\n", this, name, mode);
10413 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
10414 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10415 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10419 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
10420 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
10421 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
10422 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
10423 const char *name, short mode)
10425 basic_ifstream_char_open(this, name, mode);
10428 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10429 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10430 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
10431 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
10433 TRACE("(%p)\n", this);
10434 return (basic_filebuf_char*)&this->filebuf;
10437 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
10439 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
10442 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10444 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
10447 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10448 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10449 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
10450 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
10452 basic_ios_wchar *basic_ios;
10454 TRACE("(%p %d)\n", this, virt_init);
10456 if(virt_init) {
10457 this->base.vbtable = basic_ifstream_wchar_vbtable;
10458 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10459 basic_ios_wchar_ctor(basic_ios);
10460 }else {
10461 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10464 basic_filebuf_wchar_ctor(&this->filebuf);
10465 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10466 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
10467 return this;
10470 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10471 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10472 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
10473 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
10475 basic_ifstream_wchar_ctor(this, virt_init);
10476 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10477 return this;
10480 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10481 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10482 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
10483 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
10484 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10486 basic_ios_wchar *basic_ios;
10488 TRACE("(%p %p %d)\n", this, file, virt_init);
10490 if(virt_init) {
10491 this->base.vbtable = basic_ifstream_wchar_vbtable;
10492 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10493 basic_ios_wchar_ctor(basic_ios);
10494 }else {
10495 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10498 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10499 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10500 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
10501 return this;
10504 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10505 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10506 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
10507 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
10508 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10510 basic_ifstream_wchar_ctor_file(this, file, virt_init);
10511 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10512 return this;
10515 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
10516 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
10517 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_copy_ctor, 12)
10518 basic_ifstream_wchar* __thiscall basic_ifstream_short_copy_ctor(basic_ifstream_wchar *this,
10519 basic_ifstream_wchar *copy, MSVCP_bool virt_init)
10521 TRACE("(%p %p %d)\n", this, copy, virt_init);
10522 return basic_ifstream_short_ctor_file(this, copy->filebuf.file, virt_init);
10525 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
10526 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
10527 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 16)
10528 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
10529 const char *name, int mode, MSVCP_bool virt_init)
10531 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10533 basic_ifstream_short_ctor(this, virt_init);
10535 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
10536 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10537 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10539 return this;
10542 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10543 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10544 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10545 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10546 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
10547 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
10549 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
10551 TRACE("(%p)\n", this);
10553 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
10554 basic_filebuf_wchar_dtor(&this->filebuf);
10557 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10558 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10559 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10560 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10561 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
10562 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
10564 TRACE("(%p)\n", this);
10566 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
10567 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
10570 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
10571 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10573 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
10575 TRACE("(%p %x)\n", this, flags);
10577 if(flags & 2) {
10578 /* we have an array, with the number of elements stored before the first object */
10579 INT_PTR i, *ptr = (INT_PTR *)this-1;
10581 for(i=*ptr-1; i>=0; i--)
10582 basic_ifstream_wchar_vbase_dtor(this+i);
10583 MSVCRT_operator_delete(ptr);
10584 } else {
10585 basic_ifstream_wchar_vbase_dtor(this);
10586 if(flags & 1)
10587 MSVCRT_operator_delete(this);
10590 return this;
10593 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10594 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10595 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10596 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10597 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
10598 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
10600 TRACE("(%p)\n", this);
10602 if(!basic_filebuf_wchar_close(&this->filebuf)) {
10603 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10604 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10608 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
10609 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
10610 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
10611 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
10612 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
10613 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
10615 TRACE("(%p)\n", this);
10616 return basic_filebuf_wchar_is_open(&this->filebuf);
10619 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
10620 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
10621 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 12)
10622 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
10623 const char *name, int mode)
10625 TRACE("(%p %s %d)\n", this, name, mode);
10627 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
10628 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10629 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10633 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
10634 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
10635 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
10636 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
10637 const char *name, short mode)
10639 basic_ifstream_wchar_open(this, name, mode);
10642 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10643 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10644 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10645 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10646 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
10647 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
10649 TRACE("(%p)\n", this);
10650 return (basic_filebuf_wchar*)&this->filebuf;
10653 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
10655 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
10658 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
10660 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
10663 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10664 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10665 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
10666 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
10668 basic_ios_char *basic_ios;
10670 TRACE("(%p %d)\n", this, virt_init);
10672 if(virt_init) {
10673 this->base.base1.vbtable = basic_fstream_char_vbtable1;
10674 this->base.base2.vbtable = basic_fstream_char_vbtable2;
10675 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10676 basic_ios_char_ctor(basic_ios);
10677 }else {
10678 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10681 basic_filebuf_char_ctor(&this->filebuf);
10682 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
10683 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
10684 return this;
10687 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10688 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10689 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
10690 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
10691 FILE *file, MSVCP_bool virt_init)
10693 basic_ios_char *basic_ios;
10695 TRACE("(%p %p %d)\n", this, file, virt_init);
10697 if(virt_init) {
10698 this->base.base1.vbtable = basic_fstream_char_vbtable1;
10699 this->base.base2.vbtable = basic_fstream_char_vbtable2;
10700 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10701 basic_ios_char_ctor(basic_ios);
10702 }else {
10703 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10706 basic_filebuf_char_ctor_file(&this->filebuf, file);
10707 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
10708 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
10709 return this;
10712 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
10713 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
10714 DEFINE_THISCALL_WRAPPER(basic_fstream_char_copy_ctor, 12)
10715 basic_fstream_char* __thiscall basic_fstream_char_copy_ctor(basic_fstream_char *this,
10716 basic_fstream_char *copy, MSVCP_bool virt_init)
10718 TRACE("(%p %p %d)\n", this, copy, virt_init);
10719 return basic_fstream_char_ctor_file(this, copy->filebuf.file, virt_init);
10722 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
10723 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
10724 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 16)
10725 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
10726 const char *name, int mode, MSVCP_bool virt_init)
10728 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10730 basic_fstream_char_ctor(this, virt_init);
10732 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
10733 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10734 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10736 return this;
10739 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10740 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10741 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
10742 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
10744 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
10746 TRACE("(%p)\n", this);
10748 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
10749 basic_filebuf_char_dtor(&this->filebuf);
10752 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10753 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10754 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
10755 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
10757 TRACE("(%p)\n", this);
10759 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
10760 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
10763 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
10764 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10766 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
10768 TRACE("(%p %x)\n", this, flags);
10770 if(flags & 2) {
10771 /* we have an array, with the number of elements stored before the first object */
10772 INT_PTR i, *ptr = (INT_PTR *)this-1;
10774 for(i=*ptr-1; i>=0; i--)
10775 basic_fstream_char_vbase_dtor(this+i);
10776 MSVCRT_operator_delete(ptr);
10777 } else {
10778 basic_fstream_char_vbase_dtor(this);
10779 if(flags & 1)
10780 MSVCRT_operator_delete(this);
10783 return this;
10786 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10787 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10788 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
10789 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
10791 TRACE("(%p)\n", this);
10793 if(!basic_filebuf_char_close(&this->filebuf)) {
10794 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10795 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10799 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10800 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10801 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
10802 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
10804 TRACE("(%p)\n", this);
10805 return basic_filebuf_char_is_open(&this->filebuf);
10808 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
10809 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
10810 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 12)
10811 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
10812 const char *name, int mode)
10814 TRACE("(%p %s %d)\n", this, name, mode);
10816 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
10817 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10818 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10822 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
10823 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
10824 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
10825 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
10826 const char *name, int mode)
10828 basic_fstream_char_open(this, name, mode);
10831 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10832 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10833 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
10834 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
10836 TRACE("(%p)\n", this);
10837 return (basic_filebuf_char*)&this->filebuf;
10840 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
10842 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
10845 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10847 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
10850 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10851 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10852 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
10853 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
10855 basic_ios_wchar *basic_ios;
10857 TRACE("(%p %d)\n", this, virt_init);
10859 if(virt_init) {
10860 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
10861 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
10862 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10863 basic_ios_wchar_ctor(basic_ios);
10864 }else {
10865 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10868 basic_filebuf_wchar_ctor(&this->filebuf);
10869 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
10870 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
10871 return this;
10874 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10875 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10876 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
10877 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
10879 basic_fstream_wchar_ctor(this, virt_init);
10880 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
10881 return this;
10884 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10885 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10886 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
10887 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
10888 FILE *file, MSVCP_bool virt_init)
10890 basic_ios_wchar *basic_ios;
10892 TRACE("(%p %p %d)\n", this, file, virt_init);
10894 if(virt_init) {
10895 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
10896 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
10897 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10898 basic_ios_wchar_ctor(basic_ios);
10899 }else {
10900 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10903 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10904 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
10905 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
10906 return this;
10909 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10910 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10911 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
10912 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
10913 FILE *file, MSVCP_bool virt_init)
10915 basic_fstream_wchar_ctor_file(this, file, virt_init);
10916 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
10917 return this;
10920 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
10921 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
10922 DEFINE_THISCALL_WRAPPER(basic_fstream_short_copy_ctor, 12)
10923 basic_fstream_wchar* __thiscall basic_fstream_short_copy_ctor(basic_fstream_wchar *this,
10924 basic_fstream_wchar *copy, MSVCP_bool virt_init)
10926 TRACE("(%p %p %d)\n", this, copy, virt_init);
10927 return basic_fstream_short_ctor_file(this, copy->filebuf.file, virt_init);
10930 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
10931 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
10932 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 16)
10933 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
10934 const char *name, int mode, MSVCP_bool virt_init)
10936 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10938 basic_fstream_short_ctor(this, virt_init);
10940 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
10941 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10942 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10944 return this;
10947 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10948 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10949 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10950 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10951 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
10952 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
10954 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
10956 TRACE("(%p)\n", this);
10958 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
10959 basic_filebuf_wchar_dtor(&this->filebuf);
10962 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10963 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10964 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10965 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10966 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
10967 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
10969 TRACE("(%p)\n", this);
10971 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
10972 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
10975 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
10976 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10978 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
10980 TRACE("(%p %x)\n", this, flags);
10982 if(flags & 2) {
10983 /* we have an array, with the number of elements stored before the first object */
10984 INT_PTR i, *ptr = (INT_PTR *)this-1;
10986 for(i=*ptr-1; i>=0; i--)
10987 basic_fstream_wchar_vbase_dtor(this+i);
10988 MSVCRT_operator_delete(ptr);
10989 } else {
10990 basic_fstream_wchar_vbase_dtor(this);
10991 if(flags & 1)
10992 MSVCRT_operator_delete(this);
10995 return this;
10998 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10999 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11000 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11001 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11002 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
11003 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
11005 TRACE("(%p)\n", this);
11007 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11008 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11009 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11013 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11014 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11015 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11016 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11017 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
11018 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
11020 TRACE("(%p)\n", this);
11021 return basic_filebuf_wchar_is_open(&this->filebuf);
11024 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
11025 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
11026 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 12)
11027 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
11028 const char *name, int mode)
11030 TRACE("(%p %s %d)\n", this, name, mode);
11032 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
11033 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11034 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11038 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
11039 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
11040 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
11041 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
11042 const char *name, int mode)
11044 basic_fstream_wchar_open(this, name, mode);
11047 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11048 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11049 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11050 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11051 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
11052 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
11054 TRACE("(%p)\n", this);
11055 return (basic_filebuf_wchar*)&this->filebuf;
11058 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
11060 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
11063 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
11065 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
11068 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
11069 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
11070 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
11071 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
11072 const basic_string_char *str, int mode, MSVCP_bool virt_init)
11074 basic_ios_char *basic_ios;
11076 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11078 if(virt_init) {
11079 this->base.vbtable = basic_ostringstream_char_vbtable;
11080 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11081 basic_ios_char_ctor(basic_ios);
11082 }else {
11083 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11086 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
11087 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
11088 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
11089 return this;
11092 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
11093 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
11094 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
11095 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
11096 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
11098 basic_ios_char *basic_ios;
11100 TRACE("(%p %d %d)\n", this, mode, virt_init);
11102 if(virt_init) {
11103 this->base.vbtable = basic_ostringstream_char_vbtable;
11104 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11105 basic_ios_char_ctor(basic_ios);
11106 }else {
11107 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11110 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
11111 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
11112 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
11113 return this;
11116 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11117 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11118 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
11119 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
11120 basic_ostringstream_char *this)
11122 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
11125 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
11126 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
11127 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
11128 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
11130 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
11132 TRACE("(%p)\n", this);
11134 basic_stringbuf_char_dtor(&this->strbuf);
11135 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
11138 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11139 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11140 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
11141 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
11143 TRACE("(%p)\n", this);
11145 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
11146 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
11149 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
11150 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11152 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
11154 TRACE("(%p %x)\n", this, flags);
11156 if(flags & 2) {
11157 /* we have an array, with the number of elements stored before the first object */
11158 INT_PTR i, *ptr = (INT_PTR *)this-1;
11160 for(i=*ptr-1; i>=0; i--)
11161 basic_ostringstream_char_vbase_dtor(this+i);
11162 MSVCRT_operator_delete(ptr);
11163 } else {
11164 basic_ostringstream_char_vbase_dtor(this);
11165 if(flags & 1)
11166 MSVCRT_operator_delete(this);
11169 return this;
11172 /* ?rdbuf@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPAV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11173 /* ?rdbuf@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEAV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11174 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
11175 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
11177 TRACE("(%p)\n", this);
11178 return (basic_stringbuf_char*)&this->strbuf;
11181 /* ?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
11182 /* ?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
11183 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
11184 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
11186 TRACE("(%p %p)\n", this, str);
11187 basic_stringbuf_char_str_set(&this->strbuf, str);
11190 /* ?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11191 /* ?str@?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11192 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
11193 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
11195 TRACE("(%p %p)\n", this, ret);
11196 return basic_stringbuf_char_str_get(&this->strbuf, ret);
11199 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
11201 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
11204 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11206 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
11209 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
11210 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
11211 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
11212 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
11213 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11215 basic_ios_wchar *basic_ios;
11217 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11219 if(virt_init) {
11220 this->base.vbtable = basic_ostringstream_wchar_vbtable;
11221 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11222 basic_ios_wchar_ctor(basic_ios);
11223 }else {
11224 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11227 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
11228 basic_ostream_short_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
11229 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
11230 return this;
11233 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
11234 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@AEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
11235 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
11236 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
11237 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11239 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
11240 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
11241 return this;
11244 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
11245 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
11246 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
11247 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
11248 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
11250 basic_ios_wchar *basic_ios;
11252 TRACE("(%p %d %d)\n", this, mode, virt_init);
11254 if(virt_init) {
11255 this->base.vbtable = basic_ostringstream_wchar_vbtable;
11256 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11257 basic_ios_wchar_ctor(basic_ios);
11258 }else {
11259 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11262 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
11263 basic_ostream_short_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
11264 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
11265 return this;
11268 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
11269 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
11270 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
11271 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
11272 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
11274 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
11275 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
11276 return this;
11279 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11280 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11281 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
11282 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
11283 basic_ostringstream_wchar *this)
11285 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
11288 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
11289 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
11290 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
11291 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
11292 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
11293 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
11295 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
11297 TRACE("(%p)\n", this);
11299 basic_stringbuf_wchar_dtor(&this->strbuf);
11300 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11303 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
11304 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
11305 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11306 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11307 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
11308 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
11310 TRACE("(%p)\n", this);
11312 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
11313 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
11316 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
11317 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11319 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
11321 TRACE("(%p %x)\n", this, flags);
11323 if(flags & 2) {
11324 /* we have an array, with the number of elements stored before the first object */
11325 INT_PTR i, *ptr = (INT_PTR *)this-1;
11327 for(i=*ptr-1; i>=0; i--)
11328 basic_ostringstream_wchar_vbase_dtor(this+i);
11329 MSVCRT_operator_delete(ptr);
11330 } else {
11331 basic_ostringstream_wchar_vbase_dtor(this);
11332 if(flags & 1)
11333 MSVCRT_operator_delete(this);
11336 return this;
11339 /* ?rdbuf@?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11340 /* ?rdbuf@?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11341 /* ?rdbuf@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPAV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11342 /* ?rdbuf@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEAV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11343 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
11344 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
11346 TRACE("(%p)\n", this);
11347 return (basic_stringbuf_wchar*)&this->strbuf;
11350 /* ?str@?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
11351 /* ?str@?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
11352 /* ?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
11353 /* ?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
11354 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
11355 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
11357 TRACE("(%p %p)\n", this, str);
11358 basic_stringbuf_wchar_str_set(&this->strbuf, str);
11361 /* ?str@?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11362 /* ?str@?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11363 /* ?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11364 /* ?str@?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11365 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
11366 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
11368 TRACE("(%p %p)\n", this, ret);
11369 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
11372 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
11374 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
11377 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
11379 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
11382 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
11383 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
11384 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
11385 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
11386 const basic_string_char *str, int mode, MSVCP_bool virt_init)
11388 basic_ios_char *basic_ios;
11390 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11392 if(virt_init) {
11393 this->base.vbtable = basic_istringstream_char_vbtable;
11394 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11395 basic_ios_char_ctor(basic_ios);
11396 }else {
11397 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11400 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
11401 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11402 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
11403 return this;
11406 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
11407 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
11408 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
11409 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
11410 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
11412 basic_ios_char *basic_ios;
11414 TRACE("(%p %d %d)\n", this, mode, virt_init);
11416 if(virt_init) {
11417 this->base.vbtable = basic_istringstream_char_vbtable;
11418 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11419 basic_ios_char_ctor(basic_ios);
11420 }else {
11421 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11424 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
11425 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11426 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
11427 return this;
11430 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11431 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11432 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
11433 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
11434 basic_istringstream_char *this)
11436 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
11439 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
11440 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
11441 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
11442 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
11444 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
11446 TRACE("(%p)\n", this);
11448 basic_stringbuf_char_dtor(&this->strbuf);
11449 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11452 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11453 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11454 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
11455 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
11457 TRACE("(%p)\n", this);
11459 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
11460 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11463 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
11464 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11466 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
11468 TRACE("(%p %x)\n", this, flags);
11470 if(flags & 2) {
11471 /* we have an array, with the number of elements stored before the first object */
11472 INT_PTR i, *ptr = (INT_PTR *)this-1;
11474 for(i=*ptr-1; i>=0; i--)
11475 basic_istringstream_char_vbase_dtor(this+i);
11476 MSVCRT_operator_delete(ptr);
11477 } else {
11478 basic_istringstream_char_vbase_dtor(this);
11479 if(flags & 1)
11480 MSVCRT_operator_delete(this);
11483 return this;
11486 /* ?rdbuf@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPAV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11487 /* ?rdbuf@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEAV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11488 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
11489 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
11491 TRACE("(%p)\n", this);
11492 return (basic_stringbuf_char*)&this->strbuf;
11495 /* ?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
11496 /* ?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
11497 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
11498 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
11500 TRACE("(%p %p)\n", this, str);
11501 basic_stringbuf_char_str_set(&this->strbuf, str);
11504 /* ?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11505 /* ?str@?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11506 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
11507 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
11509 TRACE("(%p %p)\n", this, ret);
11510 return basic_stringbuf_char_str_get(&this->strbuf, ret);
11513 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
11515 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
11518 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11520 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
11523 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
11524 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
11525 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
11526 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
11527 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11529 basic_ios_wchar *basic_ios;
11531 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11533 if(virt_init) {
11534 this->base.vbtable = basic_istringstream_wchar_vbtable;
11535 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11536 basic_ios_wchar_ctor(basic_ios);
11537 }else {
11538 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11541 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
11542 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11543 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
11544 return this;
11547 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
11548 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@AEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
11549 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
11550 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
11551 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11553 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
11554 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
11555 return this;
11558 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
11559 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
11560 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
11561 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
11562 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
11564 basic_ios_wchar *basic_ios;
11566 TRACE("(%p %d %d)\n", this, mode, virt_init);
11568 if(virt_init) {
11569 this->base.vbtable = basic_istringstream_wchar_vbtable;
11570 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11571 basic_ios_wchar_ctor(basic_ios);
11572 }else {
11573 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11576 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
11577 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11578 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
11579 return this;
11582 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
11583 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
11584 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
11585 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
11586 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
11588 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
11589 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
11590 return this;
11593 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11594 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11595 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
11596 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
11597 basic_istringstream_wchar *this)
11599 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
11602 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
11603 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
11604 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
11605 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
11606 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
11607 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
11609 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
11611 TRACE("(%p)\n", this);
11613 basic_stringbuf_wchar_dtor(&this->strbuf);
11614 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
11617 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
11618 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
11619 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11620 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11621 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
11622 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
11624 TRACE("(%p)\n", this);
11626 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
11627 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
11630 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
11631 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11633 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
11635 TRACE("(%p %x)\n", this, flags);
11637 if(flags & 2) {
11638 /* we have an array, with the number of elements stored before the first object */
11639 INT_PTR i, *ptr = (INT_PTR *)this-1;
11641 for(i=*ptr-1; i>=0; i--)
11642 basic_istringstream_wchar_vbase_dtor(this+i);
11643 MSVCRT_operator_delete(ptr);
11644 } else {
11645 basic_istringstream_wchar_vbase_dtor(this);
11646 if(flags & 1)
11647 MSVCRT_operator_delete(this);
11650 return this;
11653 /* ?rdbuf@?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11654 /* ?rdbuf@?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11655 /* ?rdbuf@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPAV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11656 /* ?rdbuf@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEAV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11657 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
11658 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
11660 TRACE("(%p)\n", this);
11661 return (basic_stringbuf_wchar*)&this->strbuf;
11664 /* ?str@?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
11665 /* ?str@?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
11666 /* ?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
11667 /* ?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
11668 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
11669 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
11671 TRACE("(%p %p)\n", this, str);
11672 basic_stringbuf_wchar_str_set(&this->strbuf, str);
11675 /* ?str@?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11676 /* ?str@?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11677 /* ?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11678 /* ?str@?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11679 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
11680 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
11682 TRACE("(%p %p)\n", this, ret);
11683 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
11686 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
11688 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
11691 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
11693 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
11696 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
11697 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@H@Z */
11698 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
11699 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
11700 const basic_string_char *str, int mode, MSVCP_bool virt_init)
11702 basic_ios_char *basic_ios;
11704 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11706 if(virt_init) {
11707 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
11708 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
11709 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11710 basic_ios_char_ctor(basic_ios);
11711 }else {
11712 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11715 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
11716 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
11717 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
11718 return this;
11721 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
11722 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
11723 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
11724 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
11725 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
11727 basic_ios_char *basic_ios;
11729 TRACE("(%p %d %d)\n", this, mode, virt_init);
11731 if(virt_init) {
11732 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
11733 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
11734 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11735 basic_ios_char_ctor(basic_ios);
11736 }else {
11737 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11740 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
11741 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
11742 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
11743 return this;
11746 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11747 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11748 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
11749 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
11750 basic_stringstream_char *this)
11752 return basic_stringstream_char_ctor_mode(
11753 this, OPENMODE_out|OPENMODE_in, TRUE);
11756 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
11757 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
11758 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
11759 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
11761 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
11763 TRACE("(%p)\n", this);
11765 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
11766 basic_stringbuf_char_dtor(&this->strbuf);
11769 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11770 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11771 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
11772 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
11774 TRACE("(%p)\n", this);
11776 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
11777 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
11780 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
11781 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11783 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
11785 TRACE("(%p %x)\n", this, flags);
11787 if(flags & 2) {
11788 /* we have an array, with the number of elements stored before the first object */
11789 INT_PTR i, *ptr = (INT_PTR *)this-1;
11791 for(i=*ptr-1; i>=0; i--)
11792 basic_stringstream_char_vbase_dtor(this+i);
11793 MSVCRT_operator_delete(ptr);
11794 } else {
11795 basic_stringstream_char_vbase_dtor(this);
11796 if(flags & 1)
11797 MSVCRT_operator_delete(this);
11800 return this;
11803 /* ?rdbuf@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPAV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11804 /* ?rdbuf@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEAV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11805 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
11806 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
11808 TRACE("(%p)\n", this);
11809 return (basic_stringbuf_char*)&this->strbuf;
11812 /* ?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
11813 /* ?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
11814 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
11815 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
11817 TRACE("(%p %p)\n", this, str);
11818 basic_stringbuf_char_str_set(&this->strbuf, str);
11821 /* ?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11822 /* ?str@?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11823 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
11824 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
11826 TRACE("(%p %p)\n", this, ret);
11827 return basic_stringbuf_char_str_get(&this->strbuf, ret);
11830 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
11832 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
11835 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11837 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
11840 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
11841 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
11842 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
11843 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
11844 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11846 basic_ios_wchar *basic_ios;
11848 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11850 if(virt_init) {
11851 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
11852 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
11853 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11854 basic_ios_wchar_ctor(basic_ios);
11855 }else {
11856 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11859 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
11860 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
11861 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
11862 return this;
11865 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
11866 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@AEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@1@H@Z */
11867 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
11868 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
11869 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11871 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
11872 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
11873 return this;
11876 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
11877 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
11878 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
11879 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
11880 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
11882 basic_ios_wchar *basic_ios;
11884 TRACE("(%p %d %d)\n", this, mode, virt_init);
11886 if(virt_init) {
11887 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
11888 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
11889 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11890 basic_ios_wchar_ctor(basic_ios);
11891 }else {
11892 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11895 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
11896 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
11897 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
11898 return this;
11901 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
11902 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
11903 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
11904 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
11905 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
11907 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
11908 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
11909 return this;
11912 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11913 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11914 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
11915 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
11916 basic_stringstream_wchar *this)
11918 return basic_stringstream_short_ctor_mode(
11919 this, OPENMODE_out|OPENMODE_in, TRUE);
11922 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
11923 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
11924 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
11925 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
11926 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
11927 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
11929 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
11931 TRACE("(%p)\n", this);
11933 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
11934 basic_stringbuf_wchar_dtor(&this->strbuf);
11937 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
11938 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
11939 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11940 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11941 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
11942 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
11944 TRACE("(%p)\n", this);
11946 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
11947 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
11950 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
11951 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11953 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
11955 TRACE("(%p %x)\n", this, flags);
11957 if(flags & 2) {
11958 /* we have an array, with the number of elements stored before the first object */
11959 INT_PTR i, *ptr = (INT_PTR *)this-1;
11961 for(i=*ptr-1; i>=0; i--)
11962 basic_stringstream_wchar_vbase_dtor(this+i);
11963 MSVCRT_operator_delete(ptr);
11964 } else {
11965 basic_stringstream_wchar_vbase_dtor(this);
11966 if(flags & 1)
11967 MSVCRT_operator_delete(this);
11970 return this;
11973 /* ?rdbuf@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11974 /* ?rdbuf@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11975 /* ?rdbuf@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPAV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11976 /* ?rdbuf@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEAV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11977 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
11978 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
11980 TRACE("(%p)\n", this);
11981 return (basic_stringbuf_wchar*)&this->strbuf;
11984 /* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
11985 /* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
11986 /* ?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
11987 /* ?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@@Z */
11988 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
11989 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
11991 TRACE("(%p %p)\n", this, str);
11992 basic_stringbuf_wchar_str_set(&this->strbuf, str);
11995 /* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11996 /* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
11997 /* ?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11998 /* ?str@?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
11999 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
12000 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
12002 TRACE("(%p %p)\n", this, ret);
12003 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12006 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
12007 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
12008 #if STREAMSIZE_BITS == 64
12009 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
12010 #else
12011 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
12012 #endif
12013 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
12015 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
12017 this->minsize = 32;
12018 this->endsave = NULL;
12019 this->strmode = mode;
12020 this->palloc = NULL;
12021 this->pfree = NULL;
12023 if(!g) {
12024 this->strmode |= STRSTATE_Dynamic;
12025 if(len > this->minsize)
12026 this->minsize = len;
12027 this->seekhigh = NULL;
12028 return;
12031 if(len < 0)
12032 len = INT_MAX;
12033 else if(!len)
12034 len = strlen(g);
12036 this->seekhigh = g+len;
12037 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
12038 if(p)
12039 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
12042 /* ??0strstreambuf@std@@QAE@PACH0@Z */
12043 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
12044 /* ??0strstreambuf@std@@QAE@PADH0@Z */
12045 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
12046 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
12047 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
12048 #if STREAMSIZE_BITS == 64
12049 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
12050 #else
12051 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
12052 #endif
12053 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
12055 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
12057 basic_streambuf_char_ctor(&this->base);
12058 this->base.vtable = &MSVCP_strstreambuf_vtable;
12060 strstreambuf__Init(this, len, g, p, 0);
12061 return this;
12064 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
12065 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
12066 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
12067 void __thiscall strstreambuf__Tidy(strstreambuf *this)
12069 TRACE("(%p)\n", this);
12071 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
12072 if(this->pfree)
12073 this->pfree(basic_streambuf_char_eback(&this->base));
12074 else
12075 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
12078 this->endsave = NULL;
12079 this->seekhigh = NULL;
12080 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
12081 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
12082 basic_streambuf_char_setp(&this->base, NULL, NULL);
12085 /* ??1strstreambuf@std@@UAE@XZ */
12086 /* ??1strstreambuf@std@@UEAA@XZ */
12087 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
12088 void __thiscall strstreambuf_dtor(strstreambuf *this)
12090 TRACE("(%p)\n", this);
12092 strstreambuf__Tidy(this);
12093 basic_streambuf_char_dtor(&this->base);
12096 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
12097 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
12099 TRACE("(%p %x)\n", this, flags);
12100 if(flags & 2) {
12101 /* we have an array, with the number of elements stored before the first object */
12102 INT_PTR i, *ptr = (INT_PTR *)this-1;
12104 for(i=*ptr-1; i>=0; i--)
12105 strstreambuf_dtor(this+i);
12106 MSVCRT_operator_delete(ptr);
12107 } else {
12108 strstreambuf_dtor(this);
12109 if(flags & 1)
12110 MSVCRT_operator_delete(this);
12113 return this;
12116 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
12117 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
12118 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
12119 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
12121 TRACE("(%p %d)\n", this, freeze);
12123 if(!freeze == !(this->strmode & STRSTATE_Frozen))
12124 return;
12126 if(freeze) {
12127 this->strmode |= STRSTATE_Frozen;
12128 this->endsave = basic_streambuf_char_epptr(&this->base);
12129 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
12130 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
12131 }else {
12132 this->strmode &= ~STRSTATE_Frozen;
12133 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
12134 basic_streambuf_char_pptr(&this->base), this->endsave);
12138 /* ?overflow@strstreambuf@std@@MAEHH@Z */
12139 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
12140 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
12141 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
12143 MSVCP_size_t old_size, size;
12144 char *ptr, *buf;
12146 TRACE("(%p %d)\n", this, c);
12148 if(c == EOF)
12149 return !EOF;
12151 if(this->strmode & STRSTATE_Frozen)
12152 return EOF;
12154 ptr = basic_streambuf_char_pptr(&this->base);
12155 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
12156 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
12158 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
12159 return EOF;
12161 ptr = basic_streambuf_char_eback(&this->base);
12162 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
12164 size = old_size + old_size/2;
12165 if(size < this->minsize)
12166 size = this->minsize;
12168 if(this->palloc)
12169 buf = this->palloc(size);
12170 else
12171 buf = MSVCRT_operator_new(size);
12172 if(!buf)
12173 return EOF;
12175 memcpy(buf, ptr, old_size);
12176 if(this->strmode & STRSTATE_Allocated) {
12177 if(this->pfree)
12178 this->pfree(ptr);
12179 else
12180 MSVCRT_operator_delete(ptr);
12183 this->strmode |= STRSTATE_Allocated;
12184 if(!old_size) {
12185 this->seekhigh = buf;
12186 basic_streambuf_char_setp(&this->base, buf, buf+size);
12187 basic_streambuf_char_setg(&this->base, buf, buf, buf);
12188 }else {
12189 this->seekhigh = this->seekhigh-ptr+buf;
12190 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
12191 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
12192 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
12193 basic_streambuf_char_pptr(&this->base));
12196 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
12199 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
12200 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
12201 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
12202 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
12204 char *ptr = basic_streambuf_char_gptr(&this->base);
12206 TRACE("(%p %d)\n", this, c);
12208 if(ptr<=basic_streambuf_char_eback(&this->base)
12209 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
12210 return EOF;
12212 basic_streambuf_char_gbump(&this->base, -1);
12213 if(c == EOF)
12214 return !EOF;
12215 if(this->strmode & STRSTATE_Constant)
12216 return (unsigned char)c;
12218 return (unsigned char)(ptr[0] = c);
12221 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
12222 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
12223 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
12224 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
12225 #if STREAMOFF_BITS == 64
12226 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
12227 #else
12228 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
12229 #endif
12230 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
12232 char *eback = basic_streambuf_char_eback(&this->base);
12233 char *pptr = basic_streambuf_char_pptr(&this->base);
12234 char *gptr = basic_streambuf_char_gptr(&this->base);
12236 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
12238 ret->off = 0;
12239 ret->state = 0;
12241 if(pptr > this->seekhigh)
12242 this->seekhigh = pptr;
12244 if((mode & OPENMODE_in) && gptr) {
12245 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
12246 off += gptr-eback;
12247 else if(way == SEEKDIR_end)
12248 off += this->seekhigh-eback;
12249 else if(way != SEEKDIR_beg)
12250 off = -1;
12252 if(off<0 || off>this->seekhigh-eback) {
12253 off = -1;
12254 }else {
12255 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
12256 if((mode & OPENMODE_out) && pptr) {
12257 basic_streambuf_char_setp_next(&this->base, eback,
12258 gptr, basic_streambuf_char_epptr(&this->base));
12261 }else if((mode & OPENMODE_out) && pptr) {
12262 if(way == SEEKDIR_cur)
12263 off += pptr-eback;
12264 else if(way == SEEKDIR_end)
12265 off += this->seekhigh-eback;
12266 else if(way != SEEKDIR_beg)
12267 off = -1;
12269 if(off<0 || off>this->seekhigh-eback)
12270 off = -1;
12271 else
12272 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
12273 }else {
12274 off = -1;
12277 ret->pos = off;
12278 return ret;
12281 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
12282 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
12283 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
12284 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
12286 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
12288 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
12289 *ret = pos;
12290 return ret;
12293 return strstreambuf_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
12296 /* ?underflow@strstreambuf@std@@MAEHXZ */
12297 /* ?underflow@strstreambuf@std@@MEAAHXZ */
12298 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
12299 int __thiscall strstreambuf_underflow(strstreambuf *this)
12301 char *gptr = basic_streambuf_char_gptr(&this->base);
12302 char *pptr;
12304 TRACE("(%p)\n", this);
12306 if(!gptr)
12307 return EOF;
12309 if(gptr < basic_streambuf_char_egptr(&this->base))
12310 return (unsigned char)(*gptr);
12312 pptr = basic_streambuf_char_gptr(&this->base);
12313 if(pptr > this->seekhigh)
12314 this->seekhigh = pptr;
12316 if(this->seekhigh <= gptr)
12317 return EOF;
12319 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
12320 gptr, this->seekhigh);
12321 return (unsigned char)(*gptr);
12324 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
12326 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
12329 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
12331 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
12334 /* ??0ostrstream@std@@QAE@PADHH@Z */
12335 #if STREAMSIZE_BITS == 64
12336 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
12337 #else
12338 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
12339 #endif
12340 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
12342 basic_ios_char *basic_ios;
12344 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
12346 if(virt_init) {
12347 this->base.vbtable = ostrstream_vbtable;
12348 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12349 basic_ios_char_ctor(basic_ios);
12350 }else {
12351 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12354 strstreambuf_ctor_get_put(&this->buf, buf, size,
12355 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
12356 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, TRUE, FALSE);
12357 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
12358 return this;
12361 /* ??1ostrstream@std@@UAE@XZ */
12362 /* ??1ostrstream@std@@UEAA@XZ */
12363 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
12364 void __thiscall ostrstream_dtor(basic_ios_char *base)
12366 ostrstream *this = ostrstream_from_basic_ios(base);
12368 TRACE("(%p)\n", this);
12370 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
12371 strstreambuf_dtor(&this->buf);
12374 static void ostrstream_vbase_dtor(ostrstream *this)
12376 TRACE("(%p)\n", this);
12378 ostrstream_dtor(ostrstream_to_basic_ios(this));
12379 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
12382 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
12383 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
12385 ostrstream *this = ostrstream_from_basic_ios(base);
12387 TRACE("(%p %x)\n", this, flags);
12389 if(flags & 2) {
12390 /* we have an array, with the number of elements stored before the first object */
12391 INT_PTR i, *ptr = (INT_PTR *)this-1;
12393 for(i=*ptr-1; i>=0; i--)
12394 ostrstream_vbase_dtor(this+i);
12395 MSVCRT_operator_delete(ptr);
12396 } else {
12397 ostrstream_vbase_dtor(this);
12398 if(flags & 1)
12399 MSVCRT_operator_delete(this);
12402 return this;
12405 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
12407 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
12410 /* ??1istrstream@std@@UAE@XZ */
12411 /* ??1istrstream@std@@UEAA@XZ */
12412 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
12413 void __thiscall istrstream_dtor(basic_ios_char *base)
12415 istrstream *this = istrstream_from_basic_ios(base);
12417 TRACE("(%p)\n", this);
12419 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
12420 strstreambuf_dtor(&this->buf);
12423 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
12425 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
12428 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
12430 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
12433 /* ??0strstream@std@@QAE@PADHH@Z */
12434 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
12435 #if STREAMSIZE_BITS == 64
12436 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
12437 #else
12438 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
12439 #endif
12440 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
12442 basic_ios_char *basic_ios;
12444 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
12446 if(virt_init) {
12447 this->base.base1.vbtable = strstream_vbtable1;
12448 this->base.base2.vbtable = strstream_vbtable2;
12449 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12450 basic_ios_char_ctor(basic_ios);
12451 }else {
12452 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12455 strstreambuf_ctor_get_put(&this->buf, buf, size,
12456 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
12457 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
12458 basic_ios->base.vtable = &MSVCP_strstream_vtable;
12459 return this;
12462 /* ??1strstream@std@@UAE@XZ */
12463 /* ??1strstream@std@@UEAA@XZ */
12464 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
12465 void __thiscall strstream_dtor(basic_ios_char *base)
12467 strstream *this = strstream_from_basic_ios(base);
12469 TRACE("(%p)\n", this);
12471 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12472 strstreambuf_dtor(&this->buf);
12475 static void strstream_vbase_dtor(strstream *this)
12477 TRACE("(%p)\n", this);
12479 strstream_dtor(strstream_to_basic_ios(this));
12480 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
12483 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
12484 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
12486 strstream *this = strstream_from_basic_ios(base);
12488 TRACE("(%p %x)\n", this, flags);
12490 if(flags & 2) {
12491 /* we have an array, with the number of elements stored before the first object */
12492 INT_PTR i, *ptr = (INT_PTR *)this-1;
12494 for(i=*ptr-1; i>=0; i--)
12495 strstream_vbase_dtor(this+i);
12496 MSVCRT_operator_delete(ptr);
12497 } else {
12498 strstream_vbase_dtor(this);
12499 if(flags & 1)
12500 MSVCRT_operator_delete(this);
12503 return this;
12506 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
12508 ios_base_precision_set(base, prec);
12511 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
12512 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
12513 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
12515 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
12517 ret->pfunc = setprecision_func;
12518 ret->arg = prec;
12519 return ret;
12522 static void __cdecl setw_func(ios_base *base, streamsize width)
12524 ios_base_width_set(base, width);
12527 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
12528 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
12529 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
12531 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
12533 ret->pfunc = setw_func;
12534 ret->arg = width;
12535 return ret;
12538 static void __cdecl resetioflags_func(ios_base *base, int mask)
12540 ios_base_setf_mask(base, 0, mask);
12543 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
12544 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
12546 TRACE("(%p %d)\n", ret, mask);
12548 ret->pfunc = resetioflags_func;
12549 ret->arg = mask;
12550 return ret;
12553 static void __cdecl setiosflags_func(ios_base *base, int mask)
12555 ios_base_setf_mask(base, FMTFLAG_mask, mask);
12558 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
12559 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
12561 TRACE("(%p %d)\n", ret, mask);
12563 ret->pfunc = setiosflags_func;
12564 ret->arg = mask;
12565 return ret;
12568 static void __cdecl setbase_func(ios_base *base, int set_base)
12570 if(set_base == 10)
12571 set_base = FMTFLAG_dec;
12572 else if(set_base == 8)
12573 set_base = FMTFLAG_oct;
12574 else if(set_base == 16)
12575 set_base = FMTFLAG_hex;
12576 else
12577 set_base = 0;
12579 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
12582 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
12583 manip_int* __cdecl setbase(manip_int *ret, int base)
12585 TRACE("(%p %d)\n", ret, base);
12587 ret->pfunc = setbase_func;
12588 ret->arg = base;
12589 return ret;
12592 static basic_filebuf_char filebuf_char_stdin;
12593 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
12594 struct {
12595 basic_istream_char obj;
12596 basic_ios_char vbase;
12597 } cin = { { 0 } };
12598 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
12599 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
12600 basic_istream_char *_Ptr_cin = &cin.obj;
12602 static basic_filebuf_wchar filebuf_short_stdin;
12603 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
12604 struct {
12605 basic_istream_wchar obj;
12606 basic_ios_wchar vbase;
12607 } ucin = { { 0 } };
12608 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
12609 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
12610 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
12612 static basic_filebuf_wchar filebuf_wchar_stdin;
12613 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
12614 struct {
12615 basic_istream_wchar obj;
12616 basic_ios_wchar vbase;
12617 } wcin = { { 0 } };
12618 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
12619 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
12620 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
12622 static basic_filebuf_char filebuf_char_stdout;
12623 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12624 struct {
12625 basic_ostream_char obj;
12626 basic_ios_char vbase;
12627 } cout = { { 0 } };
12628 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12629 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
12630 basic_ostream_char *_Ptr_cout = &cout.obj;
12632 static basic_filebuf_wchar filebuf_short_stdout;
12633 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12634 struct {
12635 basic_ostream_wchar obj;
12636 basic_ios_wchar vbase;
12637 } ucout = { { 0 } };
12638 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12639 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
12640 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
12642 static basic_filebuf_wchar filebuf_wchar_stdout;
12643 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12644 struct {
12645 basic_ostream_wchar obj;
12646 basic_ios_wchar vbase;
12647 } wcout = { { 0 } };
12648 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12649 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
12650 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
12652 static basic_filebuf_char filebuf_char_stderr;
12653 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12654 struct {
12655 basic_ostream_char obj;
12656 basic_ios_char vbase;
12657 } cerr = { { 0 } };
12658 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12659 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
12660 basic_ostream_char *_Ptr_cerr = &cerr.obj;
12662 static basic_filebuf_wchar filebuf_short_stderr;
12663 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12664 struct {
12665 basic_ostream_wchar obj;
12666 basic_ios_wchar vbase;
12667 } ucerr = { { 0 } };
12668 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12669 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
12670 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
12672 static basic_filebuf_wchar filebuf_wchar_stderr;
12673 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12674 struct {
12675 basic_ostream_wchar obj;
12676 basic_ios_wchar vbase;
12677 } wcerr = { { 0 } };
12678 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12679 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
12680 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
12682 static basic_filebuf_char filebuf_char_log;
12683 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12684 struct {
12685 basic_ostream_char obj;
12686 basic_ios_char vbase;
12687 } clog = { { 0 } };
12688 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12689 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
12690 basic_ostream_char *_Ptr_clog = &clog.obj;
12692 static basic_filebuf_wchar filebuf_short_log;
12693 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12694 struct {
12695 basic_ostream_wchar obj;
12696 basic_ios_wchar vbase;
12697 } uclog = { { 0 } };
12698 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12699 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
12700 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
12702 static basic_filebuf_wchar filebuf_wchar_log;
12703 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12704 struct {
12705 basic_ostream_wchar obj;
12706 basic_ios_wchar vbase;
12707 } wclog = { { 0 } };
12708 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12709 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
12710 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
12712 /* ?_Init_cnt@Init@ios_base@std@@0HA */
12713 int ios_base_Init__Init_cnt = -1;
12715 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
12716 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
12717 void __cdecl ios_base_Init__Init_ctor(void *this)
12719 TRACE("(%p)\n", this);
12721 if(ios_base_Init__Init_cnt < 0)
12722 ios_base_Init__Init_cnt = 1;
12723 else
12724 ios_base_Init__Init_cnt++;
12727 /* ??0Init@ios_base@std@@QAE@XZ */
12728 /* ??0Init@ios_base@std@@QEAA@XZ */
12729 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
12730 void* __thiscall ios_base_Init_ctor(void *this)
12732 ios_base_Init__Init_ctor(this);
12733 return this;
12736 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
12737 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
12738 void __cdecl ios_base_Init__Init_dtor(void *this)
12740 TRACE("(%p)\n", this);
12742 ios_base_Init__Init_cnt--;
12743 if(!ios_base_Init__Init_cnt) {
12744 basic_ostream_char_flush(&cout.obj);
12745 basic_ostream_char_flush(&cerr.obj);
12746 basic_ostream_char_flush(&clog.obj);
12750 /* ??1Init@ios_base@std@@QAE@XZ */
12751 /* ??1Init@ios_base@std@@QEAA@XZ */
12752 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
12753 void __thiscall ios_base_Init_dtor(void *this)
12755 ios_base_Init__Init_dtor(this);
12758 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
12759 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
12760 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
12761 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
12763 TRACE("(%p %p)\n", this, rhs);
12764 return this;
12767 /* ?_Init_cnt@_Winit@std@@0HA */
12768 int _Winit__Init_cnt = -1;
12770 /* ??0_Winit@std@@QAE@XZ */
12771 /* ??0_Winit@std@@QEAA@XZ */
12772 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
12773 void* __thiscall _Winit_ctor(void *this)
12775 TRACE("(%p)\n", this);
12777 if(_Winit__Init_cnt < 0)
12778 _Winit__Init_cnt = 1;
12779 else
12780 _Winit__Init_cnt++;
12782 return this;
12785 /* ??1_Winit@std@@QAE@XZ */
12786 /* ??1_Winit@std@@QAE@XZ */
12787 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
12788 void __thiscall _Winit_dtor(void *this)
12790 TRACE("(%p)\n", this);
12792 _Winit__Init_cnt--;
12793 if(!_Winit__Init_cnt) {
12794 basic_ostream_wchar_flush(&wcout.obj);
12795 basic_ostream_wchar_flush(&wcerr.obj);
12796 basic_ostream_wchar_flush(&wclog.obj);
12800 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
12801 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
12802 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
12803 void* __thiscall _Winit_op_assign(void *this, void *rhs)
12805 TRACE("(%p %p)\n", this, rhs);
12806 return this;
12809 void init_io(void *base)
12811 #ifdef __x86_64__
12812 init_iosb_rtti(base);
12813 init_ios_base_rtti(base);
12814 init_basic_ios_char_rtti(base);
12815 init_basic_ios_wchar_rtti(base);
12816 init_basic_ios_short_rtti(base);
12817 init_basic_streambuf_char_rtti(base);
12818 init_basic_streambuf_wchar_rtti(base);
12819 init_basic_streambuf_short_rtti(base);
12820 init_basic_filebuf_char_rtti(base);
12821 init_basic_filebuf_wchar_rtti(base);
12822 init_basic_filebuf_short_rtti(base);
12823 init_basic_stringbuf_char_rtti(base);
12824 init_basic_stringbuf_wchar_rtti(base);
12825 init_basic_stringbuf_short_rtti(base);
12826 init_basic_ostream_char_rtti(base);
12827 init_basic_ostream_wchar_rtti(base);
12828 init_basic_ostream_short_rtti(base);
12829 init_basic_istream_char_rtti(base);
12830 init_basic_istream_wchar_rtti(base);
12831 init_basic_istream_short_rtti(base);
12832 init_basic_iostream_char_rtti(base);
12833 init_basic_iostream_wchar_rtti(base);
12834 init_basic_iostream_short_rtti(base);
12835 init_basic_ofstream_char_rtti(base);
12836 init_basic_ofstream_wchar_rtti(base);
12837 init_basic_ofstream_short_rtti(base);
12838 init_basic_ifstream_char_rtti(base);
12839 init_basic_ifstream_wchar_rtti(base);
12840 init_basic_ifstream_short_rtti(base);
12841 init_basic_fstream_char_rtti(base);
12842 init_basic_fstream_wchar_rtti(base);
12843 init_basic_fstream_short_rtti(base);
12844 init_basic_ostringstream_char_rtti(base);
12845 init_basic_ostringstream_wchar_rtti(base);
12846 init_basic_ostringstream_short_rtti(base);
12847 init_basic_istringstream_char_rtti(base);
12848 init_basic_istringstream_wchar_rtti(base);
12849 init_basic_istringstream_short_rtti(base);
12850 init_basic_stringstream_char_rtti(base);
12851 init_basic_stringstream_wchar_rtti(base);
12852 init_basic_stringstream_short_rtti(base);
12853 init_strstreambuf_rtti(base);
12854 init_strstream_rtti(base);
12855 init_ostrstream_rtti(base);
12856 #endif
12858 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
12859 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
12861 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
12862 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
12864 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
12865 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
12867 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
12868 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
12870 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
12871 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
12873 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
12874 basic_ostream_short_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
12876 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
12877 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
12879 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
12880 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
12882 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
12883 basic_ostream_short_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
12885 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
12886 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE, TRUE);
12888 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
12889 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE, TRUE);
12891 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
12892 basic_ostream_short_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE, TRUE);
12895 void free_io(void)
12897 basic_istream_char_vbase_dtor(&cin.obj);
12898 basic_filebuf_char_dtor(&filebuf_char_stdin);
12900 basic_istream_wchar_vbase_dtor(&ucin.obj);
12901 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
12903 basic_istream_wchar_vbase_dtor(&wcin.obj);
12904 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
12906 basic_ostream_char_vbase_dtor(&cout.obj);
12907 basic_filebuf_char_dtor(&filebuf_char_stdout);
12909 basic_ostream_wchar_vbase_dtor(&ucout.obj);
12910 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
12912 basic_ostream_wchar_vbase_dtor(&wcout.obj);
12913 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
12915 basic_ostream_char_vbase_dtor(&cerr.obj);
12916 basic_filebuf_char_dtor(&filebuf_char_stderr);
12918 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
12919 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
12921 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
12922 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
12924 basic_ostream_char_vbase_dtor(&clog.obj);
12925 basic_filebuf_char_dtor(&filebuf_char_log);
12927 basic_ostream_wchar_vbase_dtor(&uclog.obj);
12928 basic_filebuf_wchar_dtor(&filebuf_short_log);
12930 basic_ostream_wchar_vbase_dtor(&wclog.obj);
12931 basic_filebuf_wchar_dtor(&filebuf_wchar_log);