riched20/tests: Fix editor tests compilation with __WINESRC__ defined.
[wine/wine-gecko.git] / dlls / msvcp80 / ios.c
blob9cdaf1dee908d574eafb5ecb8abfbb0bcc8a0375
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>
26 #include "msvcp.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
32 /* ?_Index@ios_base@std@@0HA */
33 int ios_base_Index = 0;
34 /* ?_Sync@ios_base@std@@0_NA */
35 MSVCP_bool ios_base_Sync = FALSE;
37 typedef struct {
38 streamoff off;
39 __int64 DECLSPEC_ALIGN(8) pos;
40 int state;
41 } fpos_int;
43 static inline const char* debugstr_fpos_int(fpos_int *fpos)
45 return wine_dbg_sprintf("fpos(%ld %s %d)", fpos->off, wine_dbgstr_longlong(fpos->pos), fpos->state);
48 typedef struct {
49 void (__cdecl *pfunc)(ios_base*, streamsize);
50 streamsize arg;
51 } manip_streamsize;
53 typedef struct {
54 void (__cdecl *pfunc)(ios_base*, int);
55 int arg;
56 } manip_int;
58 typedef enum {
59 INITFL_new = 0,
60 INITFL_open = 1,
61 INITFL_close = 2
62 } basic_filebuf__Initfl;
64 typedef struct {
65 basic_streambuf_char base;
66 codecvt_char *cvt;
67 char putback;
68 MSVCP_bool wrotesome;
69 int state;
70 MSVCP_bool close;
71 FILE *file;
72 } basic_filebuf_char;
74 typedef struct {
75 basic_streambuf_wchar base;
76 codecvt_wchar *cvt;
77 wchar_t putback;
78 MSVCP_bool wrotesome;
79 int state;
80 MSVCP_bool close;
81 FILE *file;
82 } basic_filebuf_wchar;
84 typedef enum {
85 STRINGBUF_allocated = 1,
86 STRINGBUF_no_write = 2,
87 STRINGBUF_no_read = 4,
88 STRINGBUF_append = 8,
89 STRINGBUF_at_end = 16
90 } basic_stringbuf_state;
92 typedef struct {
93 basic_streambuf_char base;
94 char *seekhigh;
95 int state;
96 char allocator; /* empty struct */
97 } basic_stringbuf_char;
99 typedef struct {
100 basic_streambuf_wchar base;
101 wchar_t *seekhigh;
102 int state;
103 char allocator; /* empty struct */
104 } basic_stringbuf_wchar;
106 typedef struct {
107 ios_base base;
108 basic_streambuf_char *strbuf;
109 struct _basic_ostream_char *stream;
110 char fillch;
111 } basic_ios_char;
113 typedef struct {
114 ios_base base;
115 basic_streambuf_wchar *strbuf;
116 struct _basic_ostream_wchar *stream;
117 wchar_t fillch;
118 } basic_ios_wchar;
120 typedef struct _basic_ostream_char {
121 const int *vbtable;
122 /* virtual inheritance
123 * basic_ios_char basic_ios;
125 } basic_ostream_char;
127 typedef struct _basic_ostream_wchar {
128 const int *vbtable;
129 /* virtual inheritance
130 * basic_ios_wchar basic_ios;
132 } basic_ostream_wchar;
134 typedef struct {
135 const int *vbtable;
136 streamsize count;
137 /* virtual inheritance
138 * basic_ios_char basic_ios;
140 } basic_istream_char;
142 typedef struct {
143 const int *vbtable;
144 streamsize count;
145 /* virtual inheritance
146 * basic_ios_wchar basic_ios;
148 } basic_istream_wchar;
150 typedef struct {
151 basic_istream_char base1;
152 basic_ostream_char base2;
153 /* virtual inheritance
154 * basic_ios_char basic_ios;
156 } basic_iostream_char;
158 typedef struct {
159 basic_istream_wchar base1;
160 basic_ostream_wchar base2;
161 /* virtual inheritance
162 * basic_ios_wchar basic_ios;
164 } basic_iostream_wchar;
166 typedef struct {
167 basic_ostream_char base;
168 basic_filebuf_char filebuf;
169 /* virtual inheritance
170 * basic_ios_char basic_ios;
172 } basic_ofstream_char;
174 typedef struct {
175 basic_ostream_wchar base;
176 basic_filebuf_wchar filebuf;
177 /* virtual inheritance
178 * basic_ios_wchar basic_ios;
180 } basic_ofstream_wchar;
182 typedef struct {
183 basic_istream_char base;
184 basic_filebuf_char filebuf;
185 /* virtual inheritance
186 * basic_ios_char basic_ios;
188 } basic_ifstream_char;
190 typedef struct {
191 basic_istream_wchar base;
192 basic_filebuf_wchar filebuf;
193 /* virtual inheritance
194 * basic_ios_wchar basic_ios;
196 } basic_ifstream_wchar;
198 typedef struct {
199 basic_iostream_char base;
200 basic_filebuf_char filebuf;
201 /* virtual inheritance
202 * basic_ios_char basic_ios;
204 } basic_fstream_char;
206 typedef struct {
207 basic_iostream_wchar base;
208 basic_filebuf_wchar filebuf;
209 /* virtual inheritance
210 * basic_ios_char basic_ios;
212 } basic_fstream_wchar;
214 typedef struct {
215 basic_ostream_char base;
216 basic_stringbuf_char strbuf;
217 /* virtual inheritance
218 * basic_ios_char basic_ios;
220 } basic_ostringstream_char;
222 typedef struct {
223 basic_ostream_wchar base;
224 basic_stringbuf_wchar strbuf;
225 /* virtual inheritance
226 * basic_ios_wchar basic_ios;
228 } basic_ostringstream_wchar;
230 typedef struct {
231 basic_istream_char base;
232 basic_stringbuf_char strbuf;
233 /* virtual inheritance
234 * basic_ios_char basic_ios;
236 } basic_istringstream_char;
238 typedef struct {
239 basic_istream_wchar base;
240 basic_stringbuf_wchar strbuf;
241 /* virtual inheritance
242 * basic_ios_wchar basic_ios;
244 } basic_istringstream_wchar;
246 typedef struct {
247 basic_iostream_char base;
248 basic_stringbuf_char strbuf;
249 /* virtual inheritance
250 * basic_ios_char basic_ios;
252 } basic_stringstream_char;
254 typedef struct {
255 basic_iostream_wchar base;
256 basic_stringbuf_wchar strbuf;
257 /* virtual inheritance
258 * basic_ios_wchar basic_ios;
260 } basic_stringstream_wchar;
262 typedef enum {
263 STRSTATE_Allocated = 1,
264 STRSTATE_Constant = 2,
265 STRSTATE_Dynamic = 4,
266 STRSTATE_Frozen = 8
267 } strstreambuf__Strstate;
269 typedef struct {
270 basic_streambuf_char base;
271 streamsize minsize;
272 char *endsave;
273 char *seekhigh;
274 int strmode;
275 void* (__cdecl *palloc)(MSVCP_size_t);
276 void (__cdecl *pfree)(void*);
277 } strstreambuf;
279 extern const vtable_ptr MSVCP_iosb_vtable;
281 /* ??_7ios_base@std@@6B@ */
282 extern const vtable_ptr MSVCP_ios_base_vtable;
284 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
285 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
287 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
288 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
290 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
291 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
293 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
294 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
296 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
297 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
299 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
300 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
302 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
303 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
305 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
306 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
308 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
309 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
311 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
312 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
314 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
315 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
317 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
318 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
320 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
321 const int basic_ostream_char_vbtable[] = {0, sizeof(basic_ostream_char)};
322 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
323 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
325 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
326 const int basic_ostream_wchar_vbtable[] = {0, sizeof(basic_ostream_wchar)};
327 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
328 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
330 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
331 const int basic_ostream_short_vbtable[] = {0, sizeof(basic_ostream_wchar)};
332 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
333 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
335 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
336 const int basic_istream_char_vbtable[] = {0, sizeof(basic_istream_char)};
337 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
338 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
340 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
341 const int basic_istream_wchar_vbtable[] = {0, sizeof(basic_istream_wchar)};
342 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
343 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
345 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
346 const int basic_istream_short_vbtable[] = {0, sizeof(basic_istream_wchar)};
347 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
348 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
350 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
351 const int basic_iostream_char_vbtable1[] = {0, sizeof(basic_iostream_char)};
352 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
353 const int basic_iostream_char_vbtable2[] = {0, sizeof(basic_iostream_char)-FIELD_OFFSET(basic_iostream_char, base2)};
354 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
355 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
357 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
358 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
359 const int basic_iostream_wchar_vbtable1[] = {0, sizeof(basic_iostream_wchar)};
360 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
361 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
362 const int basic_iostream_wchar_vbtable2[] = {0, sizeof(basic_iostream_wchar)-FIELD_OFFSET(basic_iostream_wchar, base2)};
363 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
364 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
365 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
366 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
368 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
369 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
370 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
371 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
373 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
374 const int basic_ofstream_wchar_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
375 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
376 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
378 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
379 const int basic_ofstream_short_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
380 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
381 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
383 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
384 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
385 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
386 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
388 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
389 const int basic_ifstream_wchar_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
390 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
391 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
393 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
394 const int basic_ifstream_short_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
395 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
396 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
398 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
399 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
400 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
401 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
402 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
403 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
405 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
406 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
407 const int basic_fstream_wchar_vbtable1[] = {0, sizeof(basic_fstream_wchar)};
408 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
409 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
410 const int basic_fstream_wchar_vbtable2[] = {0, sizeof(basic_fstream_wchar)-FIELD_OFFSET(basic_fstream_wchar, base.base2)};
411 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
412 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
413 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
414 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
416 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
417 const int basic_ostringstream_char_vbtable[] = {0, sizeof(basic_ostringstream_char)};
418 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
419 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
421 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
422 const int basic_ostringstream_wchar_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
423 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
424 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
426 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
427 const int basic_ostringstream_short_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
428 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
429 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
431 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
432 const int basic_istringstream_char_vbtable[] = {0, sizeof(basic_istringstream_char)};
433 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
434 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
436 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
437 const int basic_istringstream_wchar_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
438 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
439 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
441 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
442 const int basic_istringstream_short_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
443 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
444 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
446 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
447 const int basic_stringstream_char_vbtable1[] = {0, sizeof(basic_stringstream_char)};
448 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
449 const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_char)-FIELD_OFFSET(basic_stringstream_char, base.base2)};
450 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
451 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
453 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
454 const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
455 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
456 const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
457 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
458 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
460 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
461 const int basic_stringstream_short_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
462 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
463 const int basic_stringstream_short_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
464 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
465 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
467 /* ??_7strstreambuf@std@@6B */
468 extern const vtable_ptr MSVCP_strstreambuf_vtable;
470 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
471 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
472 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
473 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
474 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
475 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
476 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
477 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
478 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
479 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
480 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
481 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
482 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
483 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
484 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
485 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
486 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
487 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
488 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
489 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
490 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
491 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
492 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
493 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
494 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
495 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
496 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
497 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
498 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
499 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
500 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
501 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
502 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
503 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
504 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
505 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
506 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
507 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
508 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
509 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
510 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
511 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
512 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
513 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
514 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
515 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
516 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
517 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
518 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
519 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
520 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
521 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
522 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
523 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
524 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
525 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
526 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
527 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
528 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
529 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
530 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
531 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
532 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
533 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
534 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
535 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
536 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
537 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
538 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
539 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
540 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
541 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
542 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
543 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
544 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
545 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
546 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
547 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
548 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
549 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
550 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
551 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
552 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
553 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
554 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
555 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
556 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
557 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
558 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
559 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
560 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
561 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
562 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
563 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
564 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
565 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
566 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
567 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
568 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
569 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
570 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
571 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
572 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
573 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
574 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
575 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
576 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
577 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
578 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
579 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
580 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
581 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
582 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
583 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
584 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
585 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
586 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
587 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
588 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
589 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
590 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
591 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
592 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
593 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
594 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
595 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
596 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
597 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
598 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
599 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
600 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
601 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
602 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
603 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
604 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
605 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
606 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
607 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
608 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
609 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
610 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
611 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
612 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
613 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
614 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
615 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
616 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
617 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
619 #ifndef __GNUC__
620 void __asm_dummy_vtables(void) {
621 #endif
622 __ASM_VTABLE(iosb,
623 VTABLE_ADD_FUNC(iosb_vector_dtor));
624 __ASM_VTABLE(ios_base,
625 VTABLE_ADD_FUNC(ios_base_vector_dtor));
626 __ASM_VTABLE(basic_ios_char,
627 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor));
628 __ASM_VTABLE(basic_ios_wchar,
629 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
630 __ASM_VTABLE(basic_ios_short,
631 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
632 __ASM_VTABLE(basic_streambuf_char,
633 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
634 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
635 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
636 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
637 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
638 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
639 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
640 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
641 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
642 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
643 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
644 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
645 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
646 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
647 __ASM_VTABLE(basic_streambuf_wchar,
648 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
649 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
650 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
651 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
652 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
653 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
654 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
655 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
656 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
657 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
658 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
659 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
660 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
661 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
662 __ASM_VTABLE(basic_streambuf_short,
663 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
664 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
665 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
666 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
667 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
668 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
669 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
670 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
671 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
672 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
673 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
674 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
675 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
676 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
677 __ASM_VTABLE(basic_filebuf_char,
678 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
679 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
680 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
681 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
682 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
683 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
684 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
685 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
686 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
687 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
688 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
689 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
690 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
691 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
692 __ASM_VTABLE(basic_filebuf_wchar,
693 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
694 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
695 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
696 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
697 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
698 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
699 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
700 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
701 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
702 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
703 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
704 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
705 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
706 VTABLE_ADD_FUNC(basic_filebuf_wchar_imbue));
707 __ASM_VTABLE(basic_filebuf_short,
708 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
709 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
710 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
711 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
712 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
713 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
714 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
715 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
716 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
717 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
718 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
719 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
720 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
721 VTABLE_ADD_FUNC(basic_filebuf_short_imbue));
722 __ASM_VTABLE(basic_stringbuf_char,
723 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
724 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
725 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
726 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
727 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
728 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
729 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
730 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
731 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
732 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
733 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
734 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
735 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
736 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
737 __ASM_VTABLE(basic_stringbuf_wchar,
738 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
739 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
740 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
741 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
742 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
743 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
744 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
745 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
746 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
747 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
748 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
749 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
750 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
751 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
752 __ASM_VTABLE(basic_stringbuf_short,
753 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
754 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
755 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
756 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
757 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
758 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
759 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
760 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
761 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
762 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
763 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
764 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
765 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
766 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
767 __ASM_VTABLE(basic_ostream_char,
768 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor));
769 __ASM_VTABLE(basic_ostream_wchar,
770 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
771 __ASM_VTABLE(basic_ostream_short,
772 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
773 __ASM_VTABLE(basic_istream_char,
774 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor));
775 __ASM_VTABLE(basic_istream_wchar,
776 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
777 __ASM_VTABLE(basic_istream_short,
778 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
779 __ASM_VTABLE(basic_iostream_char,
780 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor));
781 __ASM_VTABLE(basic_iostream_wchar,
782 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
783 __ASM_VTABLE(basic_iostream_short,
784 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
785 __ASM_VTABLE(basic_ofstream_char,
786 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor));
787 __ASM_VTABLE(basic_ofstream_wchar,
788 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
789 __ASM_VTABLE(basic_ofstream_short,
790 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
791 __ASM_VTABLE(basic_ifstream_char,
792 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor));
793 __ASM_VTABLE(basic_ifstream_wchar,
794 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
795 __ASM_VTABLE(basic_ifstream_short,
796 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
797 __ASM_VTABLE(basic_fstream_char,
798 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor));
799 __ASM_VTABLE(basic_fstream_wchar,
800 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
801 __ASM_VTABLE(basic_fstream_short,
802 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
803 __ASM_VTABLE(basic_ostringstream_char,
804 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor));
805 __ASM_VTABLE(basic_ostringstream_wchar,
806 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
807 __ASM_VTABLE(basic_ostringstream_short,
808 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
809 __ASM_VTABLE(basic_istringstream_char,
810 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor));
811 __ASM_VTABLE(basic_istringstream_wchar,
812 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
813 __ASM_VTABLE(basic_istringstream_short,
814 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
815 __ASM_VTABLE(basic_stringstream_char,
816 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor));
817 __ASM_VTABLE(basic_stringstream_wchar,
818 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
819 __ASM_VTABLE(basic_stringstream_short,
820 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
821 __ASM_VTABLE(strstreambuf,
822 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
823 VTABLE_ADD_FUNC(strstreambuf_overflow)
824 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
825 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
826 VTABLE_ADD_FUNC(strstreambuf_underflow)
827 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
828 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
829 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
830 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
831 VTABLE_ADD_FUNC(strstreambuf_seekoff)
832 VTABLE_ADD_FUNC(strstreambuf_seekpos)
833 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
834 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
835 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
836 #ifndef __GNUC__
838 #endif
840 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
841 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
842 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
843 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
845 TRACE("(%p %p %p %p)\n", this, first, next, last);
847 this->wbuf = first;
848 this->wpos = next;
849 this->wsize = last-next;
852 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
853 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
854 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
855 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
857 basic_streambuf_char_setp_next(this, first, first, last);
860 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
861 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
862 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
863 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
865 TRACE("(%p %p %p %p)\n", this, first, next, last);
867 this->rbuf = first;
868 this->rpos = next;
869 this->rsize = last-next;
872 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
873 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
874 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
875 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
877 TRACE("(%p)\n", this);
879 this->prbuf = &this->rbuf;
880 this->pwbuf = &this->wbuf;
881 this->prpos = &this->rpos;
882 this->pwpos = &this->wpos;
883 this->prsize = &this->rsize;
884 this->pwsize = &this->wsize;
886 basic_streambuf_char_setp(this, NULL, NULL);
887 basic_streambuf_char_setg(this, NULL, NULL, NULL);
890 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
891 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
892 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
893 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
895 TRACE("(%p %d)\n", this, uninitialized);
896 this->vtable = &MSVCP_basic_streambuf_char_vtable;
897 mutex_ctor(&this->lock);
898 return this;
901 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
902 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
903 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
904 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
906 TRACE("(%p)\n", this);
908 this->vtable = &MSVCP_basic_streambuf_char_vtable;
909 mutex_ctor(&this->lock);
910 this->loc = MSVCRT_operator_new(sizeof(locale));
911 locale_ctor(this->loc);
912 basic_streambuf_char__Init_empty(this);
914 return this;
917 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
918 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
919 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
920 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
922 TRACE("(%p)\n", this);
924 mutex_dtor(&this->lock);
925 locale_dtor(this->loc);
926 MSVCRT_operator_delete(this->loc);
929 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
930 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
932 TRACE("(%p %x)\n", this, flags);
933 if(flags & 2) {
934 /* we have an array, with the number of elements stored before the first object */
935 INT_PTR i, *ptr = (INT_PTR *)this-1;
937 for(i=*ptr-1; i>=0; i--)
938 basic_streambuf_char_dtor(this+i);
939 MSVCRT_operator_delete(ptr);
940 } else {
941 basic_streambuf_char_dtor(this);
942 if(flags & 1)
943 MSVCRT_operator_delete(this);
946 return this;
949 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
950 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
951 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
952 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
954 TRACE("(%p)\n", this);
955 return *this->prpos ? *this->prsize : 0;
958 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
959 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
960 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
961 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
963 TRACE("(%p)\n", this);
964 (*this->prsize)++;
965 (*this->prpos)--;
966 return *this->prpos;
969 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
970 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
971 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
972 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
974 TRACE("(%p)\n", this);
975 (*this->prsize)--;
976 return (*this->prpos)++;
979 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
980 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
981 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
982 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
984 TRACE("(%p)\n", this);
985 (*this->prsize)--;
986 (*this->prpos)++;
987 return *this->prpos;
990 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
991 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
992 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
993 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
995 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
997 this->prbuf = gf;
998 this->pwbuf = pf;
999 this->prpos = gn;
1000 this->pwpos = pn;
1001 this->prsize = gc;
1002 this->pwsize = pc;
1005 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1006 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1007 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1008 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1010 TRACE("(%p)\n", this);
1011 mutex_lock(&this->lock);
1014 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1015 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1016 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1017 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1019 TRACE("(%p)\n", this);
1020 return *this->pwpos ? *this->pwsize : 0;
1023 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1024 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1025 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1026 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1028 TRACE("(%p)\n", this);
1029 (*this->pwsize)--;
1030 return (*this->pwpos)++;
1033 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1034 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1035 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1036 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, \
1037 int, (basic_streambuf_char*), (this))
1038 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1040 TRACE("(%p)\n", this);
1041 return EOF;
1044 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1045 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1046 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1047 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, \
1048 int, (basic_streambuf_char*), (this))
1049 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1051 int ret;
1053 TRACE("(%p)\n", this);
1055 if(call_basic_streambuf_char_underflow(this)==EOF)
1056 return EOF;
1058 ret = (unsigned char)**this->prpos;
1059 (*this->prsize)--;
1060 (*this->prpos)++;
1061 return ret;
1064 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1065 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1066 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1067 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1068 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1069 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1071 streamsize copied, chunk;
1072 int c;
1074 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1076 for(copied=0; copied<count && size;) {
1077 chunk = basic_streambuf_char__Gnavail(this);
1078 if(chunk > count-copied)
1079 chunk = count-copied;
1081 if(chunk > 0) {
1082 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1083 *this->prpos += chunk;
1084 *this->prsize -= chunk;
1085 copied += chunk;
1086 size -= chunk;
1087 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1088 ptr[copied] = c;
1089 copied++;
1090 size--;
1091 }else {
1092 break;
1096 return copied;
1099 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1100 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1101 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1102 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1104 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1105 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1108 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1109 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1110 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1111 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1113 TRACE("(%p)\n", this);
1114 mutex_unlock(&this->lock);
1117 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1118 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1119 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1120 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1122 TRACE("(%p)\n", this);
1123 return *this->prbuf;
1126 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1127 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1128 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1129 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1131 TRACE("(%p)\n", this);
1132 return *this->prpos;
1135 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1136 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1137 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1138 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1140 TRACE("(%p)\n", this);
1141 return *this->prpos+*this->prsize;
1144 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1145 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1146 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1147 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1149 TRACE("(%p)\n", this);
1150 return *this->pwpos+*this->pwsize;
1153 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1154 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1155 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1156 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1158 TRACE("(%p %d)\n", this, off);
1159 *this->prpos += off;
1160 *this->prsize -= off;
1163 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1164 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1165 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1166 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
1168 TRACE("(%p)\n", this);
1169 return locale_copy_ctor(ret, this->loc);
1172 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1173 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1174 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1175 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, \
1176 void, (basic_streambuf_char*, const locale*), (this, loc))
1177 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1179 TRACE("(%p %p)\n", this, loc);
1182 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1183 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1184 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1185 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, \
1186 int, (basic_streambuf_char*, int), (this, ch))
1187 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1189 TRACE("(%p %d)\n", this, ch);
1190 return EOF;
1193 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1194 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1195 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1196 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, \
1197 int, (basic_streambuf_char*, int), (this, ch))
1198 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1200 TRACE("(%p %d)\n", this, ch);
1201 return EOF;
1204 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1205 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1206 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1207 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1209 TRACE("(%p)\n", this);
1210 return *this->pwbuf;
1213 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1214 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1215 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1216 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1218 TRACE("(%p %d)\n", this, off);
1219 *this->pwpos += off;
1220 *this->pwsize -= off;
1223 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1224 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1225 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1226 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1228 TRACE("(%p)\n", this);
1229 return *this->pwpos;
1232 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1233 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1234 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1235 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1237 TRACE("(%p %p)\n", this, loc);
1238 memcpy(ret, this->loc, sizeof(locale));
1239 call_basic_streambuf_char_imbue(this, loc);
1240 locale_copy_ctor(this->loc, loc);
1241 return ret;
1244 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1245 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1246 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1247 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, \
1248 fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1249 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1250 fpos_int *ret, streamoff off, int way, int mode)
1252 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1253 ret->off = -1;
1254 ret->pos = 0;
1255 ret->state = 0;
1256 return ret;
1259 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1260 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1261 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1262 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1263 fpos_int *ret, streamoff off, int way, int mode)
1265 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1266 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1269 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1270 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1271 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1272 fpos_int* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1273 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
1275 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1276 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1279 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1280 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1281 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1282 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, \
1283 fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1284 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1285 fpos_int *ret, fpos_int pos, int mode)
1287 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1288 ret->off = -1;
1289 ret->pos = 0;
1290 ret->state = 0;
1291 return ret;
1294 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1295 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1296 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1297 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1298 fpos_int *ret, fpos_int pos, int mode)
1300 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1301 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1304 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1305 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1306 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1307 fpos_int* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1308 fpos_int *ret, fpos_int pos, unsigned int mode)
1310 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1311 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1314 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1315 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1316 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1317 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, \
1318 basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1319 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1321 TRACE("(%p %p %ld)\n", this, buf, count);
1322 return this;
1325 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1326 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1327 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1328 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1330 TRACE("(%p %p %ld)\n", this, buf, count);
1331 return call_basic_streambuf_char_setbuf(this, buf, count);
1334 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1335 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1336 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1337 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, \
1338 int, (basic_streambuf_char*), (this))
1339 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1341 TRACE("(%p)\n", this);
1342 return 0;
1345 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1346 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1347 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1348 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1350 TRACE("(%p)\n", this);
1351 return call_basic_streambuf_char_sync(this);
1354 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1355 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1356 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1357 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1359 TRACE("(%p %p %ld)\n", this, ptr, count);
1360 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1363 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1364 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1365 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1366 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, \
1367 streamsize, (basic_streambuf_char*), (this))
1368 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1370 TRACE("(%p)\n", this);
1371 return 0;
1374 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1375 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1376 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1377 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1379 streamsize ret;
1381 TRACE("(%p)\n", this);
1383 ret = basic_streambuf_char__Gnavail(this);
1384 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1387 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1388 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1389 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1390 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1392 TRACE("(%p %d)\n", this, ch);
1393 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1394 (*this->prsize)++;
1395 (*this->prpos)--;
1396 return (unsigned char)ch;
1399 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1402 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1403 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1404 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1405 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1407 TRACE("(%p %d)\n", this, ch);
1408 return basic_streambuf_char__Pnavail(this) ?
1409 (*basic_streambuf_char__Pninc(this) = ch) :
1410 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1413 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1414 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1415 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1416 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1418 TRACE("(%p)\n", this);
1419 if(*this->prpos && *this->prpos>*this->prbuf) {
1420 (*this->prsize)++;
1421 (*this->prpos)--;
1422 return (unsigned char)**this->prpos;
1425 return call_basic_streambuf_char_pbackfail(this, EOF);
1428 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1429 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1430 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1431 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1433 TRACE("(%p)\n", this);
1434 if(basic_streambuf_char__Gnavail(this))
1435 basic_streambuf_char__Gninc(this);
1436 else
1437 call_basic_streambuf_char_uflow(this);
1440 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1441 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1442 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1443 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1445 TRACE("(%p)\n", this);
1446 return basic_streambuf_char__Gnavail(this) ?
1447 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1450 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1451 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1452 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1453 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1455 TRACE("(%p)\n", this);
1456 return basic_streambuf_char__Gnavail(this) ?
1457 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1460 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1461 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1462 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1463 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1465 TRACE("(%p)\n", this);
1467 if(basic_streambuf_char__Gnavail(this) > 1)
1468 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1469 return basic_streambuf_char_sbumpc(this)==EOF ?
1470 EOF : basic_streambuf_char_sgetc(this);
1473 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1474 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1475 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1476 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, \
1477 streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1478 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1480 TRACE("(%p %p %ld)\n", this, ptr, count);
1481 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1484 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1485 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1486 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1487 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, \
1488 streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1489 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1491 streamsize copied, chunk;
1493 TRACE("(%p %p %ld)\n", this, ptr, count);
1495 for(copied=0; copied<count;) {
1496 chunk = basic_streambuf_char__Pnavail(this);
1497 if(chunk > count-copied)
1498 chunk = count-copied;
1500 if(chunk > 0) {
1501 memcpy(*this->pwpos, ptr+copied, chunk);
1502 *this->pwpos += chunk;
1503 *this->pwsize -= chunk;
1504 copied += chunk;
1505 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1506 copied++;
1507 }else {
1508 break;
1512 return copied;
1515 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1516 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1517 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1518 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1520 TRACE("(%p %p %ld)\n", this, ptr, count);
1521 return call_basic_streambuf_char_xsputn(this, ptr, count);
1524 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1525 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1526 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1527 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1528 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1529 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1531 TRACE("(%p %p %p %p)\n", this, first, next, last);
1533 this->wbuf = first;
1534 this->wpos = next;
1535 this->wsize = last-next;
1538 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1539 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1540 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1541 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1542 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1543 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1545 basic_streambuf_wchar_setp_next(this, first, first, last);
1548 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1549 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1550 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1551 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1552 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1553 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1555 TRACE("(%p %p %p %p)\n", this, first, next, last);
1557 this->rbuf = first;
1558 this->rpos = next;
1559 this->rsize = last-next;
1562 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1563 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1564 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1565 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1566 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1567 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1569 TRACE("(%p)\n", this);
1571 this->prbuf = &this->rbuf;
1572 this->pwbuf = &this->wbuf;
1573 this->prpos = &this->rpos;
1574 this->pwpos = &this->wpos;
1575 this->prsize = &this->rsize;
1576 this->pwsize = &this->wsize;
1578 basic_streambuf_wchar_setp(this, NULL, NULL);
1579 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1582 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1583 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1584 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
1585 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1587 TRACE("(%p %d)\n", this, uninitialized);
1588 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1589 mutex_ctor(&this->lock);
1590 return this;
1593 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1594 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1595 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1596 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1598 TRACE("(%p %d)\n", this, uninitialized);
1599 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1600 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1601 return this;
1604 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1605 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1606 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
1607 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1609 TRACE("(%p)\n", this);
1611 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1612 mutex_ctor(&this->lock);
1613 this->loc = MSVCRT_operator_new(sizeof(locale));
1614 locale_ctor(this->loc);
1615 basic_streambuf_wchar__Init_empty(this);
1617 return this;
1620 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1621 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1622 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1623 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1625 TRACE("(%p)\n", this);
1626 basic_streambuf_wchar_ctor(this);
1627 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1628 return this;
1631 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1632 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1633 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1634 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1635 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1636 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1638 TRACE("(%p)\n", this);
1640 mutex_dtor(&this->lock);
1641 locale_dtor(this->loc);
1642 MSVCRT_operator_delete(this->loc);
1645 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
1646 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1648 TRACE("(%p %x)\n", this, flags);
1649 if(flags & 2) {
1650 /* we have an array, with the number of elements stored before the first object */
1651 INT_PTR i, *ptr = (INT_PTR *)this-1;
1653 for(i=*ptr-1; i>=0; i--)
1654 basic_streambuf_wchar_dtor(this+i);
1655 MSVCRT_operator_delete(ptr);
1656 } else {
1657 basic_streambuf_wchar_dtor(this);
1658 if(flags & 1)
1659 MSVCRT_operator_delete(this);
1662 return this;
1665 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1666 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1667 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1668 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1669 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
1670 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1672 TRACE("(%p)\n", this);
1673 return *this->prpos ? *this->prsize : 0;
1676 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1677 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1678 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1679 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1680 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1681 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1683 TRACE("(%p)\n", this);
1684 (*this->prsize)++;
1685 (*this->prpos)--;
1686 return *this->prpos;
1689 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1690 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1691 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1692 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1693 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1694 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1696 TRACE("(%p)\n", this);
1697 (*this->prsize)--;
1698 return (*this->prpos)++;
1701 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1702 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1703 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1704 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1705 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
1706 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1708 TRACE("(%p)\n", this);
1709 (*this->prsize)--;
1710 (*this->prpos)++;
1711 return *this->prpos;
1714 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1715 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1716 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1717 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1718 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1719 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)
1721 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1723 this->prbuf = gf;
1724 this->pwbuf = pf;
1725 this->prpos = gn;
1726 this->pwpos = pn;
1727 this->prsize = gc;
1728 this->pwsize = pc;
1731 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1732 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1733 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1734 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1735 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
1736 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
1738 TRACE("(%p)\n", this);
1739 mutex_lock(&this->lock);
1742 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1743 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1744 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1745 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1746 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
1747 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
1749 TRACE("(%p)\n", this);
1750 return *this->pwpos ? *this->pwsize : 0;
1753 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1754 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1755 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1756 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1757 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
1758 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
1760 TRACE("(%p)\n", this);
1761 (*this->pwsize)--;
1762 return (*this->pwpos)++;
1765 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1766 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1767 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1768 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1769 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
1770 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, \
1771 unsigned short, (basic_streambuf_wchar*), (this))
1772 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
1774 TRACE("(%p)\n", this);
1775 return WEOF;
1778 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1779 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1780 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1781 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1782 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
1783 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, \
1784 unsigned short, (basic_streambuf_wchar*), (this))
1785 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
1787 int ret;
1789 TRACE("(%p)\n", this);
1791 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
1792 return WEOF;
1794 ret = **this->prpos;
1795 (*this->prsize)--;
1796 (*this->prpos)++;
1797 return ret;
1800 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
1801 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
1802 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
1803 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
1804 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
1805 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1806 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1807 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1809 streamsize copied, chunk;
1810 unsigned short c;
1812 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1814 for(copied=0; copied<count && size;) {
1815 chunk = basic_streambuf_wchar__Gnavail(this);
1816 if(chunk > count-copied)
1817 chunk = count-copied;
1819 if(chunk > 0) {
1820 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
1821 *this->prpos += chunk;
1822 *this->prsize -= chunk;
1823 copied += chunk;
1824 size -= chunk*sizeof(wchar_t);
1825 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
1826 ptr[copied] = c;
1827 copied++;
1828 size--;
1829 }else {
1830 break;
1834 return copied;
1837 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
1838 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
1839 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
1840 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
1841 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
1842 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1844 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1845 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
1848 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1849 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1850 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1851 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1852 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
1853 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
1855 TRACE("(%p)\n", this);
1856 mutex_unlock(&this->lock);
1859 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1860 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1861 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1862 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1863 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
1864 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
1866 TRACE("(%p)\n", this);
1867 return *this->prbuf;
1870 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1871 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1872 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1873 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1874 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
1875 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
1877 TRACE("(%p)\n", this);
1878 return *this->prpos;
1881 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1882 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1883 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1884 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1885 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
1886 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
1888 TRACE("(%p)\n", this);
1889 return *this->prpos+*this->prsize;
1892 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1893 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1894 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1895 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1896 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
1897 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
1899 TRACE("(%p)\n", this);
1900 return *this->pwpos+*this->pwsize;
1903 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
1904 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
1905 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
1906 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
1907 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
1908 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
1910 TRACE("(%p %d)\n", this, off);
1911 *this->prpos += off;
1912 *this->prsize -= off;
1915 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
1916 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
1917 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
1918 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
1919 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
1920 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
1922 TRACE("(%p)\n", this);
1923 return locale_copy_ctor(ret, this->loc);
1926 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
1927 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
1928 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
1929 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
1930 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
1931 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, \
1932 void, (basic_streambuf_wchar*, const locale*), (this, loc))
1933 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
1935 TRACE("(%p %p)\n", this, loc);
1938 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
1939 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
1940 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
1941 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
1942 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
1943 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, \
1944 unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
1945 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
1947 TRACE("(%p %d)\n", this, ch);
1948 return WEOF;
1951 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
1952 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
1953 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
1954 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
1955 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
1956 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, \
1957 unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
1958 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
1960 TRACE("(%p %d)\n", this, ch);
1961 return WEOF;
1964 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1965 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1966 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1967 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1968 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
1969 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
1971 TRACE("(%p)\n", this);
1972 return *this->pwbuf;
1975 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
1976 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
1977 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
1978 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
1979 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
1980 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
1982 TRACE("(%p %d)\n", this, off);
1983 *this->pwpos += off;
1984 *this->pwsize -= off;
1987 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1988 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1989 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1990 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1991 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
1992 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
1994 TRACE("(%p)\n", this);
1995 return *this->pwpos;
1998 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1999 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2000 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2001 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2002 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2003 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2005 TRACE("(%p %p)\n", this, loc);
2006 memcpy(ret, this->loc, sizeof(locale));
2007 call_basic_streambuf_wchar_imbue(this, loc);
2008 locale_copy_ctor(this->loc, loc);
2009 return ret;
2012 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2013 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2014 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2015 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2016 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2017 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, \
2018 fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2019 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2020 fpos_int *ret, streamoff off, int way, int mode)
2022 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
2023 ret->off = -1;
2024 ret->pos = 0;
2025 ret->state = 0;
2026 return ret;
2029 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2030 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2031 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2032 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2033 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2034 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2035 fpos_int *ret, streamoff off, int way, int mode)
2037 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
2038 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2041 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2042 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2043 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2044 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2045 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2046 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2047 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
2049 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
2050 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2053 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2054 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2055 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2056 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2057 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2058 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, \
2059 fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2060 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2061 fpos_int *ret, fpos_int pos, int mode)
2063 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2064 ret->off = -1;
2065 ret->pos = 0;
2066 ret->state = 0;
2067 return ret;
2070 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2071 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2072 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2073 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2074 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2075 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2076 fpos_int *ret, fpos_int pos, int mode)
2078 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2079 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2082 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2083 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2084 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2085 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2086 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2087 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2088 fpos_int *ret, fpos_int pos, unsigned int mode)
2090 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2091 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2094 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2095 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2096 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2097 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2098 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2099 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, \
2100 basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2101 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2103 TRACE("(%p %p %ld)\n", this, buf, count);
2104 return this;
2107 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2108 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2109 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2110 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2111 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2112 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2114 TRACE("(%p %p %ld)\n", this, buf, count);
2115 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2118 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2119 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2120 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2121 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2122 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2123 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, \
2124 int, (basic_streambuf_wchar*), (this))
2125 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2127 TRACE("(%p)\n", this);
2128 return 0;
2131 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2132 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2133 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2134 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2135 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2136 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2138 TRACE("(%p)\n", this);
2139 return call_basic_streambuf_wchar_sync(this);
2142 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2143 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2144 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2145 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2146 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2147 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2149 TRACE("(%p %p %ld)\n", this, ptr, count);
2150 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2153 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2154 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2155 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2156 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2157 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2158 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, \
2159 streamsize, (basic_streambuf_wchar*), (this))
2160 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2162 TRACE("(%p)\n", this);
2163 return 0;
2166 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2167 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2168 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2169 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2170 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2171 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2173 streamsize ret;
2175 TRACE("(%p)\n", this);
2177 ret = basic_streambuf_wchar__Gnavail(this);
2178 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2181 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2182 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2183 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2184 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2185 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2186 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2188 TRACE("(%p %d)\n", this, ch);
2189 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2190 (*this->prsize)++;
2191 (*this->prpos)--;
2192 return ch;
2195 return call_basic_streambuf_wchar_pbackfail(this, ch);
2198 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2199 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2200 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2201 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2202 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2203 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2205 TRACE("(%p %d)\n", this, ch);
2206 return basic_streambuf_wchar__Pnavail(this) ?
2207 (*basic_streambuf_wchar__Pninc(this) = ch) :
2208 call_basic_streambuf_wchar_overflow(this, ch);
2211 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2212 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2213 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2214 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2215 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2216 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2218 TRACE("(%p)\n", this);
2219 if(*this->prpos && *this->prpos>*this->prbuf) {
2220 (*this->prsize)++;
2221 (*this->prpos)--;
2222 return **this->prpos;
2225 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2228 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2229 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2230 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2231 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2232 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2233 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2235 TRACE("(%p)\n", this);
2236 if(basic_streambuf_wchar__Gnavail(this))
2237 basic_streambuf_wchar__Gninc(this);
2238 else
2239 call_basic_streambuf_wchar_uflow(this);
2242 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2243 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2244 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2245 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2246 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2247 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2249 TRACE("(%p)\n", this);
2250 return basic_streambuf_wchar__Gnavail(this) ?
2251 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2254 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2255 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2256 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2257 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2258 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2259 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2261 TRACE("(%p)\n", this);
2262 return basic_streambuf_wchar__Gnavail(this) ?
2263 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2266 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2267 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2268 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2269 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2270 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2271 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2273 TRACE("(%p)\n", this);
2275 if(basic_streambuf_wchar__Gnavail(this) > 1)
2276 return *basic_streambuf_wchar__Gnpreinc(this);
2277 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2278 WEOF : basic_streambuf_wchar_sgetc(this);
2281 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2282 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2283 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2284 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2285 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2286 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, \
2287 streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2288 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2290 TRACE("(%p %p %ld)\n", this, ptr, count);
2291 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2294 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2295 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2296 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2297 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2298 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2299 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, \
2300 streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2301 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2303 streamsize copied, chunk;
2305 TRACE("(%p %p %ld)\n", this, ptr, count);
2307 for(copied=0; copied<count;) {
2308 chunk = basic_streambuf_wchar__Pnavail(this);
2309 if(chunk > count-copied)
2310 chunk = count-copied;
2312 if(chunk > 0) {
2313 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2314 *this->pwpos += chunk;
2315 *this->pwsize -= chunk;
2316 copied += chunk;
2317 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2318 copied++;
2319 }else {
2320 break;
2324 return copied;
2327 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2328 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2329 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2330 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2331 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2332 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2334 TRACE("(%p %p %ld)\n", this, ptr, count);
2335 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2338 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2339 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2340 int basic_filebuf_char__Init__Stinit = 0;
2342 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2343 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2344 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2345 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2347 TRACE("(%p %p %d)\n", this, file, which);
2349 this->cvt = NULL;
2350 this->wrotesome = FALSE;
2351 this->state = basic_filebuf_char__Init__Stinit;
2352 this->close = (which == INITFL_open);
2353 this->file = file;
2355 basic_streambuf_char__Init_empty(&this->base);
2356 if(file)
2357 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2358 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2361 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
2362 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
2363 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 8)
2364 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this, codecvt_char *cvt)
2366 TRACE("(%p %p)\n", this, cvt);
2368 if(codecvt_base_always_noconv(&cvt->base)) {
2369 this->cvt = NULL;
2370 }else {
2371 basic_streambuf_char__Init_empty(&this->base);
2372 this->cvt = cvt;
2376 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
2377 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
2378 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Endwrite, 4)
2379 MSVCP_bool __thiscall basic_filebuf_char__Endwrite(basic_filebuf_char *this)
2381 TRACE("(%p)\n", this);
2383 if(!this->wrotesome || !this->cvt)
2384 return TRUE;
2387 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2388 return FALSE;
2390 while(1) {
2391 /* TODO: check if we need a dynamic buffer here */
2392 char buf[128];
2393 char *next;
2394 int ret;
2396 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
2397 switch(ret) {
2398 case CODECVT_ok:
2399 this->wrotesome = FALSE;
2400 /* fall through */
2401 case CODECVT_partial:
2402 if(!fwrite(buf, next-buf, 1, this->file))
2403 return FALSE;
2404 if(this->wrotesome)
2405 break;
2406 /* fall through */
2407 case CODECVT_noconv:
2408 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2409 return FALSE;
2410 return TRUE;
2411 default:
2412 return FALSE;
2417 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2418 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2419 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2420 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2422 basic_filebuf_char *ret = this;
2424 TRACE("(%p)\n", this);
2426 if(!this->file)
2427 return NULL;
2429 /* TODO: handle exceptions */
2430 if(!basic_filebuf_char__Endwrite(this))
2431 ret = NULL;
2432 if(fclose(this->file))
2433 ret = NULL;
2435 basic_filebuf_char__Init(this, NULL, INITFL_close);
2436 return ret;
2439 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2440 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2441 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2442 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2444 TRACE("(%p %p)\n", this, file);
2446 basic_streambuf_char_ctor(&this->base);
2447 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2449 basic_filebuf_char__Init(this, file, INITFL_new);
2450 return this;
2453 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2454 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2455 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2456 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2458 return basic_filebuf_char_ctor_file(this, NULL);
2461 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2462 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2463 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2464 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2466 TRACE("(%p %d)\n", this, uninitialized);
2468 basic_streambuf_char_ctor(&this->base);
2469 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2470 return this;
2473 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2474 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2475 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2476 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2478 TRACE("(%p)\n", this);
2480 if(this->close)
2481 basic_filebuf_char_close(this);
2482 basic_streambuf_char_dtor(&this->base);
2485 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
2486 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2488 TRACE("(%p %x)\n", this, flags);
2489 if(flags & 2) {
2490 /* we have an array, with the number of elements stored before the first object */
2491 INT_PTR i, *ptr = (INT_PTR *)this-1;
2493 for(i=*ptr-1; i>=0; i--)
2494 basic_filebuf_char_dtor(this+i);
2495 MSVCRT_operator_delete(ptr);
2496 } else {
2497 basic_filebuf_char_dtor(this);
2498 if(flags & 1)
2499 MSVCRT_operator_delete(this);
2502 return this;
2505 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2506 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2507 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2508 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2510 TRACE("(%p)\n", this);
2511 return this->file != NULL;
2514 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
2515 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
2516 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
2518 static const wchar_t rW[] = {'r',0};
2519 static const struct {
2520 int mode;
2521 const wchar_t str[4];
2522 const wchar_t str_bin[4];
2523 } str_mode[] = {
2524 {OPENMODE_out, {'w',0}, {'w','b',0}},
2525 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
2526 {OPENMODE_app, {'a',0}, {'a','b',0}},
2527 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
2528 {OPENMODE_in, {'r',0}, {'r','b',0}},
2529 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
2530 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
2531 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
2532 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
2535 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2536 unsigned int mode_idx;
2537 FILE *f = NULL;
2539 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
2541 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
2542 if(str_mode[mode_idx].mode == real_mode)
2543 break;
2544 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
2545 return NULL;
2547 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
2548 return NULL;
2549 else if(f)
2550 fclose(f);
2552 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2553 && (f = _wfopen(name, rW))) {
2554 fclose(f);
2555 return NULL;
2558 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2559 : str_mode[mode_idx].str, prot);
2560 if(!f)
2561 return NULL;
2563 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2564 fclose(f);
2565 return NULL;
2568 return f;
2571 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
2572 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
2573 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
2575 wchar_t nameW[FILENAME_MAX];
2577 TRACE("(%s %d %d)\n", name, mode, prot);
2579 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2580 return NULL;
2581 return _Fiopen_wchar(nameW, mode, prot);
2584 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2585 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2586 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2587 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2588 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
2589 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2591 FILE *f = NULL;
2593 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2595 if(basic_filebuf_char_is_open(this))
2596 return NULL;
2598 if(!(f = _Fiopen_wchar(name, mode, prot)))
2599 return NULL;
2601 basic_filebuf_char__Init(this, f, INITFL_open);
2602 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(this->base.loc));
2603 return this;
2606 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
2607 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
2608 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
2609 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
2610 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
2611 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
2613 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
2616 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2617 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2618 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
2619 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2621 wchar_t nameW[FILENAME_MAX];
2623 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
2625 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2626 return NULL;
2627 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
2630 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
2631 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
2632 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
2633 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
2635 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
2638 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2639 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2640 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
2641 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
2643 char buf[8], *dyn_buf;
2644 char ch = c, *to_next;
2645 const char *from_next;
2646 int ret, max_size;
2649 TRACE("(%p %d)\n", this, c);
2651 if(!basic_filebuf_char_is_open(this))
2652 return EOF;
2653 if(c == EOF)
2654 return !c;
2656 if(!this->cvt)
2657 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2659 from_next = &ch;
2660 do {
2661 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
2662 &from_next, buf, buf+sizeof(buf), &to_next);
2664 switch(ret) {
2665 case CODECVT_partial:
2666 if(to_next == buf)
2667 break;
2668 /* fall through */
2669 case CODECVT_ok:
2670 if(!fwrite(buf, to_next-buf, 1, this->file))
2671 return EOF;
2672 if(ret == CODECVT_partial)
2673 continue;
2674 return c;
2675 case CODECVT_noconv:
2676 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2677 default:
2678 return EOF;
2681 break;
2682 } while(1);
2684 max_size = codecvt_base_max_length(&this->cvt->base);
2685 dyn_buf = malloc(max_size);
2686 if(!dyn_buf)
2687 return EOF;
2689 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
2690 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
2692 switch(ret) {
2693 case CODECVT_ok:
2694 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
2695 free(dyn_buf);
2696 return ret ? c : EOF;
2697 case CODECVT_partial:
2698 ERR("buffer should be big enough to store all output\n");
2699 /* fall through */
2700 default:
2701 free(dyn_buf);
2702 return EOF;
2706 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2707 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2708 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
2709 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
2711 TRACE("(%p %d)\n", this, c);
2713 if(!basic_filebuf_char_is_open(this))
2714 return EOF;
2716 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
2717 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
2718 basic_streambuf_char__Gndec(&this->base);
2719 return c==EOF ? !c : c;
2720 }else if(c!=EOF && !this->cvt) {
2721 return ungetc(c, this->file);
2724 return EOF;
2727 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2728 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2729 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
2730 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
2732 char ch, buf[128], *to_next;
2733 const char *buf_next;
2734 int c, i;
2736 TRACE("(%p)\n", this);
2738 if(!basic_filebuf_char_is_open(this))
2739 return EOF;
2741 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2742 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
2744 c = fgetc(this->file);
2745 if(!this->cvt || c==EOF)
2746 return c;
2748 buf_next = buf;
2749 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
2750 buf[i] = c;
2752 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
2753 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
2754 case CODECVT_partial:
2755 case CODECVT_ok:
2756 if(to_next == &ch) {
2757 c = fgetc(this->file);
2758 if(c == EOF)
2759 return EOF;
2760 continue;
2763 for(i--; i>=buf_next-buf; i--)
2764 ungetc(buf[i], this->file);
2765 return ch;
2766 case CODECVT_noconv:
2767 return (unsigned char)buf[0];
2768 default:
2769 return EOF;
2773 FIXME("buffer is too small\n");
2774 return EOF;
2777 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2778 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2779 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
2780 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
2782 int ret;
2784 TRACE("(%p)\n", this);
2786 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2787 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
2789 ret = call_basic_streambuf_char_uflow(&this->base);
2790 if(ret != EOF)
2791 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
2792 return ret;
2795 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2796 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2797 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
2798 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
2799 fpos_int *ret, streamoff off, int way, int mode)
2801 fpos_t pos;
2803 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
2805 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
2806 || fseek(this->file, off, way)) {
2807 ret->off = -1;
2808 ret->pos = 0;
2809 ret->state = 0;
2810 return ret;
2813 fgetpos(this->file, &pos);
2814 ret->off = 0;
2815 ret->pos = pos;
2816 ret->state = this->state;
2817 return ret;
2820 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2821 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2822 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
2823 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
2824 fpos_int *ret, fpos_int pos, int mode)
2826 fpos_t fpos;
2828 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
2830 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
2831 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
2832 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
2833 ret->off = -1;
2834 ret->pos = 0;
2835 ret->state = 0;
2836 return ret;
2839 fgetpos(this->file, &fpos);
2840 ret->off = 0;
2841 ret->pos = fpos;
2842 ret->state = this->state;
2843 return ret;
2846 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
2847 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
2848 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
2849 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
2851 TRACE("(%p %p %ld)\n", this, buf, count);
2853 if(!basic_filebuf_char_is_open(this))
2854 return NULL;
2856 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
2857 return NULL;
2859 basic_filebuf_char__Init(this, this->file, INITFL_open);
2860 return &this->base;
2863 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2864 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2865 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
2866 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
2868 TRACE("(%p)\n", this);
2870 if(!basic_filebuf_char_is_open(this))
2871 return 0;
2873 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2874 return 0;
2875 return fflush(this->file);
2878 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
2879 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
2880 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
2881 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
2883 TRACE("(%p %p)\n", this, loc);
2884 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(loc));
2887 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2888 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2889 int basic_filebuf_wchar__Init__Stinit = 0;
2891 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2892 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2893 int basic_filebuf_short__Init__Stinit = 0;
2895 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2896 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2897 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
2898 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
2900 TRACE("(%p %p %d)\n", this, file, which);
2902 this->cvt = NULL;
2903 this->wrotesome = FALSE;
2904 this->state = basic_filebuf_wchar__Init__Stinit;
2905 this->close = (which == INITFL_open);
2906 this->file = file;
2908 basic_streambuf_wchar__Init_empty(&this->base);
2911 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2912 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2913 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
2914 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
2916 TRACE("(%p %p %d)\n", this, file, which);
2918 this->cvt = NULL;
2919 this->wrotesome = FALSE;
2920 this->state = basic_filebuf_short__Init__Stinit;
2921 this->close = (which == INITFL_open);
2922 this->file = file;
2924 basic_streambuf_wchar__Init_empty(&this->base);
2927 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
2928 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
2929 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
2930 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
2931 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 8)
2932 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
2934 TRACE("(%p %p)\n", this, cvt);
2936 if(codecvt_base_always_noconv(&cvt->base)) {
2937 this->cvt = NULL;
2938 }else {
2939 basic_streambuf_wchar__Init_empty(&this->base);
2940 this->cvt = cvt;
2944 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAE_NXZ */
2945 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAA_NXZ */
2946 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAE_NXZ */
2947 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAA_NXZ */
2948 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Endwrite, 4)
2949 MSVCP_bool __thiscall basic_filebuf_wchar__Endwrite(basic_filebuf_wchar *this)
2951 TRACE("(%p)\n", this);
2953 if(!this->wrotesome || !this->cvt)
2954 return TRUE;
2956 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
2957 return FALSE;
2959 while(1) {
2960 /* TODO: check if we need a dynamic buffer here */
2961 char buf[128];
2962 char *next;
2963 int ret;
2965 ret = codecvt_wchar_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
2966 switch(ret) {
2967 case CODECVT_ok:
2968 this->wrotesome = FALSE;
2969 /* fall through */
2970 case CODECVT_partial:
2971 if(!fwrite(buf, next-buf, 1, this->file))
2972 return FALSE;
2973 if(this->wrotesome)
2974 break;
2975 /* fall through */
2976 case CODECVT_noconv:
2977 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
2978 return FALSE;
2979 return TRUE;
2980 default:
2981 return FALSE;
2986 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
2987 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
2988 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
2989 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
2990 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
2991 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
2993 basic_filebuf_wchar *ret = this;
2995 TRACE("(%p)\n", this);
2997 if(!this->file)
2998 return NULL;
3000 /* TODO: handle exceptions */
3001 if(!basic_filebuf_wchar__Endwrite(this))
3002 ret = NULL;
3003 if(fclose(this->file))
3004 ret = NULL;
3006 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3007 return ret;
3010 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3011 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3012 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3013 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3015 TRACE("(%p %p)\n", this, file);
3017 basic_streambuf_wchar_ctor(&this->base);
3018 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3020 basic_filebuf_wchar__Init(this, file, INITFL_new);
3021 return this;
3024 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3025 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3026 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3027 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3029 TRACE("(%p %p)\n", this, file);
3031 basic_streambuf_short_ctor(&this->base);
3032 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3034 basic_filebuf_short__Init(this, file, INITFL_new);
3035 return this;
3038 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3039 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3040 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3041 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3043 return basic_filebuf_wchar_ctor_file(this, NULL);
3046 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3047 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3048 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3049 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3051 return basic_filebuf_short_ctor_file(this, NULL);
3054 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3055 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3056 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3057 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3059 TRACE("(%p %d)\n", this, uninitialized);
3061 basic_streambuf_wchar_ctor(&this->base);
3062 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3063 return this;
3066 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3067 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3068 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3069 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3071 TRACE("(%p %d)\n", this, uninitialized);
3073 basic_streambuf_short_ctor(&this->base);
3074 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3075 return this;
3078 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3079 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3080 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3081 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3082 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3083 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3085 TRACE("(%p)\n", this);
3087 if(this->close)
3088 basic_filebuf_wchar_close(this);
3089 basic_streambuf_wchar_dtor(&this->base);
3092 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3093 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3095 TRACE("(%p %x)\n", this, flags);
3096 if(flags & 2) {
3097 /* we have an array, with the number of elements stored before the first object */
3098 INT_PTR i, *ptr = (INT_PTR *)this-1;
3100 for(i=*ptr-1; i>=0; i--)
3101 basic_filebuf_wchar_dtor(this+i);
3102 MSVCRT_operator_delete(ptr);
3103 } else {
3104 basic_filebuf_wchar_dtor(this);
3105 if(flags & 1)
3106 MSVCRT_operator_delete(this);
3109 return this;
3112 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3113 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3114 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3115 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3116 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3117 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3119 TRACE("(%p)\n", this);
3120 return this->file != NULL;
3123 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3124 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3125 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3126 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3127 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3128 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3130 FILE *f = NULL;
3132 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3134 if(basic_filebuf_wchar_is_open(this))
3135 return NULL;
3137 if(!(f = _Fiopen_wchar(name, mode, prot)))
3138 return NULL;
3140 basic_filebuf_wchar__Init(this, f, INITFL_open);
3141 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(this->base.loc));
3142 return this;
3145 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3146 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3147 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3148 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3149 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3150 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3152 FILE *f = NULL;
3154 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3156 if(basic_filebuf_wchar_is_open(this))
3157 return NULL;
3159 if(!(f = _Fiopen_wchar(name, mode, prot)))
3160 return NULL;
3162 basic_filebuf_short__Init(this, f, INITFL_open);
3163 basic_filebuf_wchar__Initcvt(this, codecvt_short_use_facet(this->base.loc));
3164 return this;
3167 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3168 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3169 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3170 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3171 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3172 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3174 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3177 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3178 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3179 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3180 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3181 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3182 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3184 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3187 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3188 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3189 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3190 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3192 wchar_t nameW[FILENAME_MAX];
3194 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3196 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3197 return NULL;
3198 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3201 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3202 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3203 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3204 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3206 wchar_t nameW[FILENAME_MAX];
3208 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3210 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3211 return NULL;
3212 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3215 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3216 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3217 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3218 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3220 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3223 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3224 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3225 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3226 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3228 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3231 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3232 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3233 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3234 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3235 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3236 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3238 char buf[8], *dyn_buf, *to_next;
3239 wchar_t ch = c;
3240 const wchar_t *from_next;
3241 int max_size;
3242 unsigned short ret;
3245 TRACE("(%p %d)\n", this, c);
3247 if(!basic_filebuf_wchar_is_open(this))
3248 return WEOF;
3249 if(c == WEOF)
3250 return !c;
3252 if(!this->cvt)
3253 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3255 from_next = &ch;
3256 do {
3257 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3258 &from_next, buf, buf+sizeof(buf), &to_next);
3260 switch(ret) {
3261 case CODECVT_partial:
3262 if(to_next == buf)
3263 break;
3264 /* fall through */
3265 case CODECVT_ok:
3266 if(!fwrite(buf, to_next-buf, 1, this->file))
3267 return WEOF;
3268 if(ret == CODECVT_partial)
3269 continue;
3270 return c;
3271 case CODECVT_noconv:
3272 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3273 default:
3274 return WEOF;
3277 break;
3278 } while(1);
3280 max_size = codecvt_base_max_length(&this->cvt->base);
3281 dyn_buf = malloc(max_size);
3282 if(!dyn_buf)
3283 return WEOF;
3285 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3286 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3288 switch(ret) {
3289 case CODECVT_ok:
3290 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3291 free(dyn_buf);
3292 return ret ? c : WEOF;
3293 case CODECVT_partial:
3294 ERR("buffer should be big enough to store all output\n");
3295 /* fall through */
3296 default:
3297 free(dyn_buf);
3298 return WEOF;
3302 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3303 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3304 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3305 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3306 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3307 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3309 TRACE("(%p %d)\n", this, c);
3311 if(!basic_filebuf_wchar_is_open(this))
3312 return WEOF;
3314 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3315 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3316 basic_streambuf_wchar__Gndec(&this->base);
3317 return c==WEOF ? !c : c;
3318 }else if(c!=WEOF && !this->cvt) {
3319 return ungetwc(c, this->file);
3320 }else if(c!=WEOF && basic_streambuf_wchar_gptr(&this->base)!=&this->putback) {
3321 this->putback = c;
3322 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback, &this->putback+1);
3323 return c;
3326 return WEOF;
3329 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3330 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3331 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3332 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3333 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
3334 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
3336 wchar_t ch, *to_next;
3337 char buf[128];
3338 const char *buf_next;
3339 int c, i;
3341 TRACE("(%p)\n", this);
3343 if(!basic_filebuf_wchar_is_open(this))
3344 return WEOF;
3346 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3347 return *basic_streambuf_wchar__Gninc(&this->base);
3349 if(!this->cvt)
3350 return fgetwc(this->file);
3352 buf_next = buf;
3353 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3354 if((c = fgetc(this->file)) == EOF)
3355 return WEOF;
3356 buf[i] = c;
3358 switch(codecvt_wchar_in(this->cvt, &this->state, buf_next,
3359 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3360 case CODECVT_partial:
3361 case CODECVT_ok:
3362 if(to_next == &ch)
3363 continue;
3365 for(i--; i>=buf_next-buf; i--)
3366 ungetc(buf[i], this->file);
3367 return ch;
3368 case CODECVT_noconv:
3369 if(i+1 < sizeof(wchar_t))
3370 continue;
3372 memcpy(&ch, buf, sizeof(wchar_t));
3373 return ch;
3374 default:
3375 return WEOF;
3379 FIXME("buffer is too small\n");
3380 return WEOF;
3383 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3384 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3385 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3386 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3387 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
3388 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
3390 unsigned short ret;
3392 TRACE("(%p)\n", this);
3394 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3395 return *basic_streambuf_wchar_gptr(&this->base);
3397 ret = call_basic_streambuf_wchar_uflow(&this->base);
3398 if(ret != WEOF)
3399 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
3400 return ret;
3403 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3404 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3405 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3406 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3407 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
3408 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
3409 fpos_int *ret, streamoff off, int way, int mode)
3411 fpos_t pos;
3413 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
3415 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback) {
3416 if(way == SEEKDIR_cur)
3417 off -= sizeof(wchar_t);
3419 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3422 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3423 || fseek(this->file, off, way)) {
3424 ret->off = -1;
3425 ret->pos = 0;
3426 ret->state = 0;
3427 return ret;
3430 fgetpos(this->file, &pos);
3431 ret->off = 0;
3432 ret->pos = pos;
3433 ret->state = this->state;
3434 return ret;
3437 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3438 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3439 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3440 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3441 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
3442 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
3443 fpos_int *ret, fpos_int pos, int mode)
3445 fpos_t fpos;
3447 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3449 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3450 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3451 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3452 ret->off = -1;
3453 ret->pos = 0;
3454 ret->state = 0;
3455 return ret;
3458 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback)
3459 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3461 fgetpos(this->file, &fpos);
3462 ret->off = 0;
3463 ret->pos = fpos;
3464 ret->state = this->state;
3465 return ret;
3468 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
3469 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
3470 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
3471 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3473 TRACE("(%p %p %ld)\n", this, buf, count);
3475 if(!basic_filebuf_wchar_is_open(this))
3476 return NULL;
3478 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3479 return NULL;
3481 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
3482 return &this->base;
3485 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
3486 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
3487 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
3488 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3490 TRACE("(%p %p %ld)\n", this, buf, count);
3492 if(!basic_filebuf_wchar_is_open(this))
3493 return NULL;
3495 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3496 return NULL;
3498 basic_filebuf_short__Init(this, this->file, INITFL_open);
3499 return &this->base;
3502 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
3503 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
3504 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
3505 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
3506 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
3507 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
3509 TRACE("(%p)\n", this);
3511 if(!basic_filebuf_wchar_is_open(this))
3512 return 0;
3514 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3515 return 0;
3516 return fflush(this->file);
3519 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
3520 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
3521 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
3522 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
3524 TRACE("(%p %p)\n", this, loc);
3525 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(loc));
3528 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
3529 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
3530 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
3531 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
3533 TRACE("(%p %p)\n", this, loc);
3534 basic_filebuf_wchar__Initcvt(this, codecvt_short_use_facet(loc));
3537 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3538 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3539 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
3540 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
3542 int state = 0;
3544 if(!(mode & OPENMODE_in))
3545 state |= STRINGBUF_no_read;
3547 if(!(mode & OPENMODE_out))
3548 state |= STRINGBUF_no_write;
3550 if(mode & OPENMODE_ate)
3551 state |= STRINGBUF_at_end;
3553 if(mode & OPENMODE_app)
3554 state |= STRINGBUF_append;
3556 return state;
3559 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
3560 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
3561 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
3562 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
3564 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
3566 basic_streambuf_char__Init_empty(&this->base);
3568 this->state = state;
3569 this->seekhigh = NULL;
3571 if(count && str) {
3572 char *buf = MSVCRT_operator_new(count);
3573 if(!buf) {
3574 ERR("Out of memory\n");
3575 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3578 memcpy(buf, str, count);
3579 this->seekhigh = buf + count;
3581 this->state |= STRINGBUF_allocated;
3583 if(!(state & STRINGBUF_no_read))
3584 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
3586 if(!(state & STRINGBUF_no_write)) {
3587 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3589 if(!basic_streambuf_char_gptr(&this->base))
3590 basic_streambuf_char_setg(&this->base, buf, 0, buf);
3595 /* ??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 */
3596 /* ??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 */
3597 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
3598 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
3599 const basic_string_char *str, IOSB_openmode mode)
3601 TRACE("(%p %p %d)\n", this, str, mode);
3603 basic_streambuf_char_ctor(&this->base);
3604 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3606 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
3607 str->size, basic_stringbuf_char__Getstate(this, mode));
3608 return this;
3611 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
3612 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
3613 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
3614 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
3615 basic_stringbuf_char *this, IOSB_openmode mode)
3617 TRACE("(%p %d)\n", this, mode);
3619 basic_streambuf_char_ctor(&this->base);
3620 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3622 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
3623 return this;
3626 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
3627 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
3628 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
3629 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
3631 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
3634 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
3635 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
3636 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
3637 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
3639 TRACE("(%p)\n", this);
3641 if(this->state & STRINGBUF_allocated) {
3642 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
3643 this->seekhigh = NULL;
3644 this->state &= ~STRINGBUF_allocated;
3647 basic_streambuf_char__Init_empty(&this->base);
3650 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
3651 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
3652 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
3653 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
3655 TRACE("(%p)\n", this);
3657 basic_stringbuf_char__Tidy(this);
3658 basic_streambuf_char_dtor(&this->base);
3661 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
3662 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
3664 TRACE("(%p %x)\n", this, flags);
3666 if(flags & 2) {
3667 /* we have an array, with the number of elements stored before the first object */
3668 INT_PTR i, *ptr = (INT_PTR *) this - 1;
3670 for (i = *ptr - 1; i >= 0; i--)
3671 basic_stringbuf_char_dtor(this+i);
3673 MSVCRT_operator_delete(ptr);
3674 }else {
3675 basic_stringbuf_char_dtor(this);
3677 if(flags & 1)
3678 MSVCRT_operator_delete(this);
3681 return this;
3684 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
3685 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
3686 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
3687 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
3689 MSVCP_size_t oldsize, size;
3690 char *ptr, *buf;
3692 TRACE("(%p %x)\n", this, meta);
3694 if(meta == EOF)
3695 return !EOF;
3696 if(this->state & STRINGBUF_no_write)
3697 return EOF;
3699 ptr = basic_streambuf_char_pptr(&this->base);
3700 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
3701 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
3702 this->seekhigh, basic_streambuf_char_epptr(&this->base));
3704 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
3705 return (*basic_streambuf_char__Pninc(&this->base) = meta);
3707 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
3708 size = oldsize|0xf;
3709 size += size/2;
3710 buf = MSVCRT_operator_new(size);
3711 if(!buf) {
3712 ERR("Out of memory\n");
3713 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3716 if(!oldsize) {
3717 this->seekhigh = buf;
3718 basic_streambuf_char_setp(&this->base, buf, buf+size);
3719 if(this->state & STRINGBUF_no_read)
3720 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
3721 else
3722 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
3724 this->state |= STRINGBUF_allocated;
3725 }else {
3726 ptr = basic_streambuf_char_eback(&this->base);
3727 memcpy(buf, ptr, oldsize);
3729 this->seekhigh = buf+(this->seekhigh-ptr);
3730 basic_streambuf_char_setp_next(&this->base, buf,
3731 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
3732 if(this->state & STRINGBUF_no_read)
3733 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
3734 else
3735 basic_streambuf_char_setg(&this->base, buf,
3736 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
3737 basic_streambuf_char_pptr(&this->base)+1);
3739 MSVCRT_operator_delete(ptr);
3742 return (*basic_streambuf_char__Pninc(&this->base) = meta);
3745 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
3746 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
3747 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
3748 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
3750 char *cur;
3752 TRACE("(%p %x)\n", this, c);
3754 cur = basic_streambuf_char_gptr(&this->base);
3755 if(!cur || cur==basic_streambuf_char_eback(&this->base)
3756 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
3757 return EOF;
3759 if(c != EOF)
3760 cur[-1] = c;
3761 basic_streambuf_char_gbump(&this->base, -1);
3762 return c==EOF ? !EOF : c;
3765 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
3766 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
3767 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
3768 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
3770 char *ptr, *cur;
3772 TRACE("(%p)\n", this);
3774 cur = basic_streambuf_char_gptr(&this->base);
3775 if(!cur || this->state&STRINGBUF_no_read)
3776 return EOF;
3778 ptr = basic_streambuf_char_pptr(&this->base);
3779 if(this->seekhigh < ptr)
3780 this->seekhigh = ptr;
3782 ptr = basic_streambuf_char_egptr(&this->base);
3783 if(this->seekhigh > ptr)
3784 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
3786 if(cur < this->seekhigh)
3787 return (unsigned char)*cur;
3788 return EOF;
3791 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3792 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3793 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
3794 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
3795 fpos_int *ret, streamoff off, int way, int mode)
3797 char *beg, *cur_r, *cur_w;
3799 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
3801 cur_w = basic_streambuf_char_pptr(&this->base);
3802 if(cur_w > this->seekhigh)
3803 this->seekhigh = cur_w;
3805 ret->off = 0;
3806 ret->pos = 0;
3807 ret->state = 0;
3809 beg = basic_streambuf_char_eback(&this->base);
3810 cur_r = basic_streambuf_char_gptr(&this->base);
3811 if((mode & OPENMODE_in) && cur_r) {
3812 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
3813 off += cur_r-beg;
3814 else if(way == SEEKDIR_end)
3815 off += this->seekhigh-beg;
3816 else if(way != SEEKDIR_beg)
3817 off = -1;
3819 if(off<0 || off>this->seekhigh-beg) {
3820 off = -1;
3821 }else {
3822 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
3823 if((mode & OPENMODE_out) && cur_w) {
3824 basic_streambuf_char_setp_next(&this->base, beg,
3825 basic_streambuf_char_gptr(&this->base),
3826 basic_streambuf_char_epptr(&this->base));
3829 }else if((mode & OPENMODE_out) && cur_w) {
3830 if(way == SEEKDIR_cur)
3831 off += cur_w-beg;
3832 else if(way == SEEKDIR_end)
3833 off += this->seekhigh-beg;
3834 else if(way != SEEKDIR_beg)
3835 off = -1;
3837 if(off<0 || off>this->seekhigh-beg)
3838 off = -1;
3839 else
3840 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
3841 }else {
3842 off = -1;
3845 ret->off = off;
3846 return ret;
3849 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3850 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3851 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
3852 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
3853 fpos_int *ret, fpos_int pos, int mode)
3855 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3857 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
3858 *ret = pos;
3859 return ret;
3862 return basic_stringbuf_char_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
3865 /* ?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 */
3866 /* ?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 */
3867 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
3868 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
3870 TRACE("(%p %p)\n", this, str);
3872 basic_stringbuf_char__Tidy(this);
3873 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
3876 /* ?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 */
3877 /* ?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 */
3878 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
3879 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
3881 char *ptr;
3883 TRACE("(%p)\n", this);
3885 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
3886 char *pptr;
3888 ptr = basic_streambuf_char_pbase(&this->base);
3889 pptr = basic_streambuf_char_pptr(&this->base);
3891 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
3894 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
3895 ptr = basic_streambuf_char_eback(&this->base);
3896 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
3899 return MSVCP_basic_string_char_ctor(ret);
3902 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
3903 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
3904 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
3905 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
3906 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
3907 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
3909 int state = 0;
3911 if(!(mode & OPENMODE_in))
3912 state |= STRINGBUF_no_read;
3914 if(!(mode & OPENMODE_out))
3915 state |= STRINGBUF_no_write;
3917 if(mode & OPENMODE_ate)
3918 state |= STRINGBUF_at_end;
3920 if(mode & OPENMODE_app)
3921 state |= STRINGBUF_append;
3923 return state;
3926 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
3927 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
3928 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
3929 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
3930 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
3931 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
3933 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
3935 basic_streambuf_wchar__Init_empty(&this->base);
3937 this->state = state;
3938 this->seekhigh = NULL;
3940 if(count && str) {
3941 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
3942 if(!buf) {
3943 ERR("Out of memory\n");
3944 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3947 memcpy(buf, str, count*sizeof(wchar_t));
3948 this->seekhigh = buf + count;
3950 this->state |= STRINGBUF_allocated;
3952 if(!(state & STRINGBUF_no_read))
3953 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
3955 if(!(state & STRINGBUF_no_write)) {
3956 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3958 if(!basic_streambuf_wchar_gptr(&this->base))
3959 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
3964 /* ??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 */
3965 /* ??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 */
3966 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
3967 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
3968 const basic_string_wchar *str, IOSB_openmode mode)
3970 TRACE("(%p %p %d)\n", this, str, mode);
3972 basic_streambuf_wchar_ctor(&this->base);
3973 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
3975 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
3976 str->size, basic_stringbuf_wchar__Getstate(this, mode));
3977 return this;
3980 /* ??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 */
3981 /* ??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 */
3982 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
3983 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
3984 const basic_string_wchar *str, IOSB_openmode mode)
3986 basic_stringbuf_wchar_ctor_str(this, str, mode);
3987 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
3988 return this;
3991 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
3992 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
3993 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
3994 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
3995 basic_stringbuf_wchar *this, IOSB_openmode mode)
3997 TRACE("(%p %d)\n", this, mode);
3999 basic_streambuf_wchar_ctor(&this->base);
4000 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4002 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4003 return this;
4006 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4007 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4008 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4009 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4010 basic_stringbuf_wchar *this, IOSB_openmode mode)
4012 basic_stringbuf_wchar_ctor_mode(this, mode);
4013 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4014 return this;
4017 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4018 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4019 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4020 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4022 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4025 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4026 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4027 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4028 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4030 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4033 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4034 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4035 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4036 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4037 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4038 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4040 TRACE("(%p)\n", this);
4042 if(this->state & STRINGBUF_allocated) {
4043 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4044 this->seekhigh = NULL;
4045 this->state &= ~STRINGBUF_allocated;
4048 basic_streambuf_wchar__Init_empty(&this->base);
4051 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4052 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4053 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4054 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4055 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4056 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4058 TRACE("(%p)\n", this);
4060 basic_stringbuf_wchar__Tidy(this);
4061 basic_streambuf_wchar_dtor(&this->base);
4064 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4065 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4067 TRACE("(%p %x)\n", this, flags);
4069 if(flags & 2) {
4070 /* we have an array, with the number of elements stored before the first object */
4071 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4073 for (i = *ptr - 1; i >= 0; i--)
4074 basic_stringbuf_wchar_dtor(this+i);
4076 MSVCRT_operator_delete(ptr);
4077 }else {
4078 basic_stringbuf_wchar_dtor(this);
4080 if(flags & 1)
4081 MSVCRT_operator_delete(this);
4084 return this;
4087 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4088 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4089 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4090 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4091 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4092 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4094 MSVCP_size_t oldsize, size;
4095 wchar_t *ptr, *buf;
4097 TRACE("(%p %x)\n", this, meta);
4099 if(meta == WEOF)
4100 return !WEOF;
4101 if(this->state & STRINGBUF_no_write)
4102 return WEOF;
4104 ptr = basic_streambuf_wchar_pptr(&this->base);
4105 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4106 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4107 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4109 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4110 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4112 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4113 size = oldsize|0xf;
4114 size += size/2;
4115 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4116 if(!buf) {
4117 ERR("Out of memory\n");
4118 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4121 if(!oldsize) {
4122 this->seekhigh = buf;
4123 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4124 if(this->state & STRINGBUF_no_read)
4125 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4126 else
4127 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4129 this->state |= STRINGBUF_allocated;
4130 }else {
4131 ptr = basic_streambuf_wchar_eback(&this->base);
4132 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4134 this->seekhigh = buf+(this->seekhigh-ptr);
4135 basic_streambuf_wchar_setp_next(&this->base, buf,
4136 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4137 if(this->state & STRINGBUF_no_read)
4138 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4139 else
4140 basic_streambuf_wchar_setg(&this->base, buf,
4141 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4142 basic_streambuf_wchar_pptr(&this->base)+1);
4144 MSVCRT_operator_delete(ptr);
4147 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4150 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4151 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4152 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4153 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4154 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4155 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4157 wchar_t *cur;
4159 TRACE("(%p %x)\n", this, c);
4161 cur = basic_streambuf_wchar_gptr(&this->base);
4162 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4163 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4164 return WEOF;
4166 if(c != WEOF)
4167 cur[-1] = c;
4168 basic_streambuf_wchar_gbump(&this->base, -1);
4169 return c==WEOF ? !WEOF : c;
4172 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4173 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4174 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4175 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4176 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4177 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4179 wchar_t *ptr, *cur;
4181 TRACE("(%p)\n", this);
4183 cur = basic_streambuf_wchar_gptr(&this->base);
4184 if(!cur || this->state&STRINGBUF_no_read)
4185 return WEOF;
4187 ptr = basic_streambuf_wchar_pptr(&this->base);
4188 if(this->seekhigh < ptr)
4189 this->seekhigh = ptr;
4191 ptr = basic_streambuf_wchar_egptr(&this->base);
4192 if(this->seekhigh > ptr)
4193 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4195 if(cur < this->seekhigh)
4196 return *cur;
4197 return WEOF;
4200 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4201 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4202 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4203 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4204 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4205 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4206 fpos_int *ret, streamoff off, int way, int mode)
4208 wchar_t *beg, *cur_r, *cur_w;
4210 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
4212 cur_w = basic_streambuf_wchar_pptr(&this->base);
4213 if(cur_w > this->seekhigh)
4214 this->seekhigh = cur_w;
4216 ret->off = 0;
4217 ret->pos = 0;
4218 ret->state = 0;
4220 beg = basic_streambuf_wchar_eback(&this->base);
4221 cur_r = basic_streambuf_wchar_gptr(&this->base);
4222 if((mode & OPENMODE_in) && cur_r) {
4223 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4224 off += cur_r-beg;
4225 else if(way == SEEKDIR_end)
4226 off += this->seekhigh-beg;
4227 else if(way != SEEKDIR_beg)
4228 off = -1;
4230 if(off<0 || off>this->seekhigh-beg) {
4231 off = -1;
4232 }else {
4233 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4234 if((mode & OPENMODE_out) && cur_w) {
4235 basic_streambuf_wchar_setp_next(&this->base, beg,
4236 basic_streambuf_wchar_gptr(&this->base),
4237 basic_streambuf_wchar_epptr(&this->base));
4240 }else if((mode & OPENMODE_out) && cur_w) {
4241 if(way == SEEKDIR_cur)
4242 off += cur_w-beg;
4243 else if(way == SEEKDIR_end)
4244 off += this->seekhigh-beg;
4245 else if(way != SEEKDIR_beg)
4246 off = -1;
4248 if(off<0 || off>this->seekhigh-beg)
4249 off = -1;
4250 else
4251 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4252 }else {
4253 off = -1;
4256 ret->off = off;
4257 return ret;
4260 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4261 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4262 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4263 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4264 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4265 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4266 fpos_int *ret, fpos_int pos, int mode)
4268 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4270 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4271 *ret = pos;
4272 return ret;
4275 return basic_stringbuf_wchar_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
4278 /* ?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 */
4279 /* ?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 */
4280 /* ?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 */
4281 /* ?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 */
4282 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4283 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4285 TRACE("(%p %p)\n", this, str);
4287 basic_stringbuf_wchar__Tidy(this);
4288 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
4291 /* ?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 */
4292 /* ?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 */
4293 /* ?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 */
4294 /* ?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 */
4295 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
4296 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
4298 wchar_t *ptr;
4300 TRACE("(%p)\n", this);
4302 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
4303 wchar_t *pptr;
4305 ptr = basic_streambuf_wchar_pbase(&this->base);
4306 pptr = basic_streambuf_wchar_pptr(&this->base);
4308 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4311 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
4312 ptr = basic_streambuf_wchar_eback(&this->base);
4313 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
4316 return MSVCP_basic_string_wchar_ctor(ret);
4319 /* ??0ios_base@std@@IAE@XZ */
4320 /* ??0ios_base@std@@IEAA@XZ */
4321 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
4322 ios_base* __thiscall ios_base_ctor(ios_base *this)
4324 TRACE("(%p)\n", this);
4325 this->vtable = &MSVCP_ios_base_vtable;
4326 return this;
4329 /* ??0ios_base@std@@QAE@ABV01@@Z */
4330 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
4331 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
4332 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
4334 TRACE("(%p %p)\n", this, copy);
4335 *this = *copy;
4336 this->vtable = &MSVCP_ios_base_vtable;
4337 return this;
4340 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
4341 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
4342 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
4343 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
4345 IOS_BASE_fnarray *cur;
4347 TRACE("(%p %x)\n", this, event);
4349 for(cur=this->calls; cur; cur=cur->next)
4350 cur->event_handler(event, this, cur->index);
4353 /* ?_Tidy@ios_base@std@@AAAXXZ */
4354 /* ?_Tidy@ios_base@std@@AEAAXXZ */
4355 void CDECL ios_base_Tidy(ios_base *this)
4357 IOS_BASE_iosarray *arr_cur, *arr_next;
4358 IOS_BASE_fnarray *event_cur, *event_next;
4360 TRACE("(%p)\n", this);
4362 ios_base_Callfns(this, EVENT_erase_event);
4364 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
4365 arr_next = arr_cur->next;
4366 MSVCRT_operator_delete(arr_cur);
4368 this->arr = NULL;
4370 for(event_cur=this->calls; event_cur; event_cur=event_next) {
4371 event_next = event_cur->next;
4372 MSVCRT_operator_delete(event_cur);
4374 this->calls = NULL;
4377 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
4378 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
4379 void CDECL ios_base_Ios_base_dtor(ios_base *obj)
4381 TRACE("(%p)\n", obj);
4382 if(obj->loc) {
4383 locale_dtor(obj->loc);
4384 MSVCRT_operator_delete(obj->loc);
4386 ios_base_Tidy(obj);
4389 /* ??1ios_base@std@@UAE@XZ */
4390 /* ??1ios_base@std@@UEAA@XZ */
4391 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
4392 void __thiscall ios_base_dtor(ios_base *this)
4394 ios_base_Ios_base_dtor(this);
4397 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
4398 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
4400 TRACE("(%p %x)\n", this, flags);
4401 if(flags & 2) {
4402 /* we have an array, with the number of elements stored before the first object */
4403 INT_PTR i, *ptr = (INT_PTR *)this-1;
4405 for(i=*ptr-1; i>=0; i--)
4406 ios_base_dtor(this+i);
4407 MSVCRT_operator_delete(ptr);
4408 } else {
4409 ios_base_dtor(this);
4410 if(flags & 1)
4411 MSVCRT_operator_delete(this);
4414 return this;
4417 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
4418 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
4420 TRACE("(%p %x)\n", this, flags);
4421 if(flags & 2) {
4422 INT_PTR *ptr = (INT_PTR *)this-1;
4423 MSVCRT_operator_delete(ptr);
4424 } else {
4425 if(flags & 1)
4426 MSVCRT_operator_delete(this);
4429 return this;
4432 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
4433 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
4434 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
4435 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
4437 IOS_BASE_iosarray *p;
4439 TRACE("(%p %d)\n", this, index);
4441 for(p=this->arr; p; p=p->next) {
4442 if(p->index == index)
4443 return p;
4446 for(p=this->arr; p; p=p->next) {
4447 if(!p->long_val && !p->ptr_val) {
4448 p->index = index;
4449 return p;
4453 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
4454 p->next = this->arr;
4455 p->index = index;
4456 p->long_val = 0;
4457 p->ptr_val = NULL;
4458 this->arr = p;
4459 return p;
4462 /* ?iword@ios_base@std@@QAEAAJH@Z */
4463 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
4464 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
4465 LONG* __thiscall ios_base_iword(ios_base *this, int index)
4467 TRACE("(%p %d)\n", this, index);
4468 return &ios_base_Findarr(this, index)->long_val;
4471 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
4472 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
4473 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
4474 void** __thiscall ios_base_pword(ios_base *this, int index)
4476 TRACE("(%p %d)\n", this, index);
4477 return &ios_base_Findarr(this, index)->ptr_val;
4480 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
4481 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
4482 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
4483 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
4485 IOS_BASE_fnarray *event;
4487 TRACE("(%p %p %d)\n", this, callback, index);
4489 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
4490 event->next = this->calls;
4491 event->index = index;
4492 event->event_handler = callback;
4493 this->calls = event;
4496 /* ?clear@ios_base@std@@QAEXH_N@Z */
4497 /* ?clear@ios_base@std@@QEAAXH_N@Z */
4498 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
4499 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4501 TRACE("(%p %x %x)\n", this, state, reraise);
4503 this->state = state & IOSTATE_mask;
4504 if(!(this->state & this->except))
4505 return;
4507 if(reraise)
4508 throw_exception(EXCEPTION_RERAISE, NULL);
4509 else if(this->state & this->except & IOSTATE_eofbit)
4510 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
4511 else if(this->state & this->except & IOSTATE_failbit)
4512 throw_exception(EXCEPTION_FAILURE, "failbit is set");
4513 else if(this->state & this->except & IOSTATE_badbit)
4514 throw_exception(EXCEPTION_FAILURE, "badbit is set");
4515 else if(this->state & this->except & IOSTATE__Hardfail)
4516 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
4519 /* ?clear@ios_base@std@@QAEXH@Z */
4520 /* ?clear@ios_base@std@@QEAAXH@Z */
4521 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
4522 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
4524 ios_base_clear_reraise(this, state, FALSE);
4527 /* ?clear@ios_base@std@@QAEXI@Z */
4528 /* ?clear@ios_base@std@@QEAAXI@Z */
4529 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
4530 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
4532 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
4535 /* ?exceptions@ios_base@std@@QAEXH@Z */
4536 /* ?exceptions@ios_base@std@@QEAAXH@Z */
4537 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
4538 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
4540 TRACE("(%p %x)\n", this, state);
4541 this->except = state & IOSTATE_mask;
4542 ios_base_clear(this, this->state);
4545 /* ?exceptions@ios_base@std@@QAEXI@Z */
4546 /* ?exceptions@ios_base@std@@QEAAXI@Z */
4547 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
4548 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
4550 TRACE("(%p %x)\n", this, state);
4551 ios_base_exceptions_set(this, state);
4554 /* ?exceptions@ios_base@std@@QBEHXZ */
4555 /* ?exceptions@ios_base@std@@QEBAHXZ */
4556 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
4557 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
4559 TRACE("(%p)\n", this);
4560 return this->except;
4563 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
4564 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
4565 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
4566 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
4568 TRACE("(%p %p)\n", this, rhs);
4570 if(this != rhs) {
4571 IOS_BASE_iosarray *arr_cur;
4572 IOS_BASE_fnarray *event_cur;
4574 ios_base_Tidy(this);
4576 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
4577 if(arr_cur->long_val)
4578 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
4579 if(arr_cur->ptr_val)
4580 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
4582 this->stdstr = rhs->stdstr;
4583 this->fmtfl = rhs->fmtfl;
4584 this->prec = rhs->prec;
4585 this->wide = rhs->wide;
4586 locale_operator_assign(this->loc, rhs->loc);
4588 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
4589 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
4591 ios_base_Callfns(this, EVENT_copyfmt_event);
4592 ios_base_exceptions_set(this, rhs->except);
4595 return this;
4598 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
4599 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
4600 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
4601 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
4603 TRACE("(%p %p)\n", this, right);
4605 if(this != right) {
4606 this->state = right->state;
4607 ios_base_copyfmt(this, right);
4610 return this;
4613 /* ?fail@ios_base@std@@QBE_NXZ */
4614 /* ?fail@ios_base@std@@QEBA_NXZ */
4615 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
4616 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
4618 TRACE("(%p)\n", this);
4619 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
4622 /* ??7ios_base@std@@QBE_NXZ */
4623 /* ??7ios_base@std@@QEBA_NXZ */
4624 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
4625 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
4627 TRACE("(%p)\n", this);
4628 return ios_base_fail(this);
4631 /* ??Bios_base@std@@QBEPAXXZ */
4632 /* ??Bios_base@std@@QEBAPEAXXZ */
4633 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
4634 void* __thiscall ios_base_op_fail(const ios_base *this)
4636 TRACE("(%p)\n", this);
4637 return ios_base_fail(this) ? NULL : (void*)this;
4640 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
4641 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
4642 void CDECL ios_base_Addstd(ios_base *add)
4644 FIXME("(%p) stub\n", add);
4647 /* ?_Index_func@ios_base@std@@CAAAHXZ */
4648 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
4649 int* CDECL ios_base_Index_func(void)
4651 TRACE("\n");
4652 return &ios_base_Index;
4655 /* ?_Init@ios_base@std@@IAEXXZ */
4656 /* ?_Init@ios_base@std@@IEAAXXZ */
4657 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
4658 void __thiscall ios_base__Init(ios_base *this)
4660 TRACE("(%p)\n", this);
4662 this->stdstr = 0;
4663 this->state = this->except = IOSTATE_goodbit;
4664 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
4665 this->prec = 6;
4666 this->wide = 0;
4667 this->arr = NULL;
4668 this->calls = NULL;
4669 this->loc = MSVCRT_operator_new(sizeof(locale));
4670 locale_ctor(this->loc);
4673 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
4674 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
4675 MSVCP_bool* CDECL ios_base_Sync_func(void)
4677 TRACE("\n");
4678 return &ios_base_Sync;
4681 /* ?bad@ios_base@std@@QBE_NXZ */
4682 /* ?bad@ios_base@std@@QEBA_NXZ */
4683 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
4684 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
4686 TRACE("(%p)\n", this);
4687 return (this->state & IOSTATE_badbit) != 0;
4690 /* ?eof@ios_base@std@@QBE_NXZ */
4691 /* ?eof@ios_base@std@@QEBA_NXZ */
4692 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
4693 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
4695 TRACE("(%p)\n", this);
4696 return (this->state & IOSTATE_eofbit) != 0;
4699 /* ?flags@ios_base@std@@QAEHH@Z */
4700 /* ?flags@ios_base@std@@QEAAHH@Z */
4701 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
4702 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
4704 IOSB_fmtflags ret = this->fmtfl;
4706 TRACE("(%p %x)\n", this, flags);
4708 this->fmtfl = flags & FMTFLAG_mask;
4709 return ret;
4712 /* ?flags@ios_base@std@@QBEHXZ */
4713 /* ?flags@ios_base@std@@QEBAHXZ */
4714 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
4715 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
4717 TRACE("(%p)\n", this);
4718 return this->fmtfl;
4721 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
4722 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
4723 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
4724 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
4726 TRACE("(%p)\n", this);
4727 return locale_copy_ctor(ret, this->loc);
4730 /* ?good@ios_base@std@@QBE_NXZ */
4731 /* ?good@ios_base@std@@QEBA_NXZ */
4732 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
4733 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
4735 TRACE("(%p)\n", this);
4736 return this->state == IOSTATE_goodbit;
4739 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
4740 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
4741 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
4742 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
4744 TRACE("(%p %p)\n", this, loc);
4745 *ret = *this->loc;
4746 locale_copy_ctor(this->loc, loc);
4747 return ret;
4750 /* ?precision@ios_base@std@@QAEHH@Z */
4751 /* ?precision@ios_base@std@@QEAA_J_J@Z */
4752 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
4753 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
4755 streamsize ret = this->prec;
4757 TRACE("(%p %ld)\n", this, precision);
4759 this->prec = precision;
4760 return ret;
4763 /* ?precision@ios_base@std@@QBEHXZ */
4764 /* ?precision@ios_base@std@@QEBA_JXZ */
4765 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
4766 streamsize __thiscall ios_base_precision_get(const ios_base *this)
4768 TRACE("(%p)\n", this);
4769 return this->prec;
4772 /* ?rdstate@ios_base@std@@QBEHXZ */
4773 /* ?rdstate@ios_base@std@@QEBAHXZ */
4774 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
4775 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
4777 TRACE("(%p)\n", this);
4778 return this->state;
4781 /* ?setf@ios_base@std@@QAEHHH@Z */
4782 /* ?setf@ios_base@std@@QEAAHHH@Z */
4783 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
4784 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
4786 IOSB_fmtflags ret = this->fmtfl;
4788 TRACE("(%p %x %x)\n", this, flags, mask);
4790 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
4791 return ret;
4794 /* ?setf@ios_base@std@@QAEHH@Z */
4795 /* ?setf@ios_base@std@@QEAAHH@Z */
4796 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
4797 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
4799 return ios_base_setf_mask(this, flags, ~0);
4802 /* ?setstate@ios_base@std@@QAEXH_N@Z */
4803 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
4804 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
4805 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4807 TRACE("(%p %x %x)\n", this, state, reraise);
4809 if(state != IOSTATE_goodbit)
4810 ios_base_clear_reraise(this, this->state | state, reraise);
4813 /* ?setstate@ios_base@std@@QAEXH@Z */
4814 /* ?setstate@ios_base@std@@QEAAXH@Z */
4815 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
4816 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
4818 ios_base_setstate_reraise(this, state, FALSE);
4821 /* ?setstate@ios_base@std@@QAEXI@Z */
4822 /* ?setstate@ios_base@std@@QEAAXI@Z */
4823 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
4824 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
4826 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
4829 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
4830 MSVCP_bool CDECL ios_base_sync_with_stdio(MSVCP_bool sync)
4832 _Lockit lock;
4833 MSVCP_bool ret;
4835 TRACE("(%x)\n", sync);
4837 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
4838 ret = ios_base_Sync;
4839 ios_base_Sync = sync;
4840 _Lockit_dtor(&lock);
4841 return ret;
4844 /* ?unsetf@ios_base@std@@QAEXH@Z */
4845 /* ?unsetf@ios_base@std@@QEAAXH@Z */
4846 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
4847 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
4849 TRACE("(%p %x)\n", this, flags);
4850 this->fmtfl &= ~flags;
4853 /* ?width@ios_base@std@@QAEHH@Z */
4854 /* ?width@ios_base@std@@QEAA_J_J@Z */
4855 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
4856 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
4858 streamsize ret = this->wide;
4860 TRACE("(%p %ld)\n", this, width);
4862 this->wide = width;
4863 return ret;
4866 /* ?width@ios_base@std@@QBEHXZ */
4867 /* ?width@ios_base@std@@QEBA_JXZ */
4868 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
4869 streamsize __thiscall ios_base_width_get(ios_base *this)
4871 TRACE("(%p)\n", this);
4872 return this->wide;
4875 /* ?xalloc@ios_base@std@@SAHXZ */
4876 int CDECL ios_base_xalloc(void)
4878 _Lockit lock;
4879 int ret;
4881 TRACE("\n");
4883 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
4884 ret = ios_base_Index++;
4885 _Lockit_dtor(&lock);
4886 return ret;
4889 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
4890 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
4891 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
4892 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
4894 TRACE("(%p)\n", this);
4896 ios_base_ctor(&this->base);
4897 this->base.vtable = &MSVCP_basic_ios_char_vtable;
4898 return this;
4901 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
4902 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
4903 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
4904 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
4906 TRACE("(%p %p %x)\n", this, streambuf, isstd);
4907 ios_base__Init(&this->base);
4908 this->strbuf = streambuf;
4909 this->stream = NULL;
4910 this->fillch = ' ';
4912 if(!streambuf)
4913 ios_base_setstate(&this->base, IOSTATE_badbit);
4915 if(isstd)
4916 FIXME("standard streams not handled yet\n");
4919 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4920 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4921 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
4922 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
4924 TRACE("(%p %p)\n", this, strbuf);
4926 basic_ios_char_ctor(this);
4927 basic_ios_char_init(this, strbuf, FALSE);
4928 return this;
4931 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
4932 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
4933 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
4934 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
4936 TRACE("(%p)\n", this);
4937 ios_base_dtor(&this->base);
4940 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
4941 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
4943 TRACE("(%p %x)\n", this, flags);
4944 if(flags & 2) {
4945 /* we have an array, with the number of elements stored before the first object */
4946 INT_PTR i, *ptr = (INT_PTR *)this-1;
4948 for(i=*ptr-1; i>=0; i--)
4949 basic_ios_char_dtor(this+i);
4950 MSVCRT_operator_delete(ptr);
4951 } else {
4952 basic_ios_char_dtor(this);
4953 if(flags & 1)
4954 MSVCRT_operator_delete(this);
4957 return this;
4960 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
4961 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
4962 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
4963 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
4965 TRACE("(%p %x %x)\n", this, state, reraise);
4966 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
4969 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
4970 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
4971 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
4972 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
4974 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
4977 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
4978 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
4979 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
4980 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
4982 TRACE("(%p %p)\n", this, copy);
4983 if(this == copy)
4984 return this;
4986 this->stream = copy->stream;
4987 this->fillch = copy->fillch;
4988 ios_base_copyfmt(&this->base, &copy->base);
4989 return this;
4992 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
4993 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
4994 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
4995 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
4997 char ret = this->fillch;
4999 TRACE("(%p %c)\n", this, fill);
5001 this->fillch = fill;
5002 return ret;
5005 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5006 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5007 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5008 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5010 TRACE("(%p)\n", this);
5011 return this->fillch;
5014 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5015 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5016 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5017 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5019 TRACE("(%p %p %p)\n", this, ret, loc);
5021 if(this->strbuf) {
5022 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5023 locale_dtor(ret);
5026 return ios_base_imbue(&this->base, ret, loc);
5029 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5030 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5031 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5032 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5034 TRACE("(%p %c %c)\n", this, ch, def);
5035 return ctype_char_narrow_ch(ctype_char_use_facet(this->strbuf->loc), ch, def);
5038 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5039 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5040 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5041 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5043 basic_streambuf_char *ret = this->strbuf;
5045 TRACE("(%p %p)\n", this, streambuf);
5047 this->strbuf = streambuf;
5048 basic_ios_char_clear(this, IOSTATE_goodbit);
5049 return ret;
5052 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5053 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5054 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5055 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5057 TRACE("(%p)\n", this);
5058 return this->strbuf;
5061 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5062 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5063 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5064 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5066 TRACE("(%p %x %x)\n", this, state, reraise);
5068 if(state != IOSTATE_goodbit)
5069 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5072 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5073 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5074 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5075 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5077 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5080 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5081 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5082 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5083 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5085 basic_ostream_char *ret = this->stream;
5087 TRACE("(%p %p)\n", this, ostream);
5089 this->stream = ostream;
5090 return ret;
5093 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5094 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5095 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5096 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5098 TRACE("(%p)\n", this);
5099 return this->stream;
5102 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5103 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5104 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5105 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5107 TRACE("(%p %c)\n", this, ch);
5108 return ctype_char_widen_ch(ctype_char_use_facet(this->strbuf->loc), ch);
5112 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5113 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5114 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5115 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5117 TRACE("(%p)\n", this);
5119 ios_base_ctor(&this->base);
5120 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5121 return this;
5124 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5125 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5126 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5127 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5129 basic_ios_wchar_ctor(this);
5130 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5131 return this;
5134 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5135 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5136 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5137 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5138 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5139 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
5141 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5142 ios_base__Init(&this->base);
5143 this->strbuf = streambuf;
5144 this->stream = NULL;
5145 this->fillch = ' ';
5147 if(!streambuf)
5148 ios_base_setstate(&this->base, IOSTATE_badbit);
5150 if(isstd)
5151 FIXME("standard streams not handled yet\n");
5154 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5155 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5156 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
5157 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5159 TRACE("(%p %p)\n", this, strbuf);
5161 basic_ios_wchar_ctor(this);
5162 basic_ios_wchar_init(this, strbuf, FALSE);
5163 return this;
5166 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5167 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5168 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
5169 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5171 basic_ios_wchar_ctor_streambuf(this, strbuf);
5172 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5173 return this;
5176 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
5177 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
5178 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
5179 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
5180 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
5181 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
5183 TRACE("(%p)\n", this);
5184 ios_base_dtor(&this->base);
5187 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5188 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5190 TRACE("(%p %x)\n", this, flags);
5191 if(flags & 2) {
5192 /* we have an array, with the number of elements stored before the first object */
5193 INT_PTR i, *ptr = (INT_PTR *)this-1;
5195 for(i=*ptr-1; i>=0; i--)
5196 basic_ios_wchar_dtor(this+i);
5197 MSVCRT_operator_delete(ptr);
5198 } else {
5199 basic_ios_wchar_dtor(this);
5200 if(flags & 1)
5201 MSVCRT_operator_delete(this);
5204 return this;
5207 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5208 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5209 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5210 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5211 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5212 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5214 TRACE("(%p %x %x)\n", this, state, reraise);
5215 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5218 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5219 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5220 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5221 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5222 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
5223 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
5225 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
5228 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
5229 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5230 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
5231 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5232 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
5233 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
5235 TRACE("(%p %p)\n", this, copy);
5236 if(this == copy)
5237 return this;
5239 this->stream = copy->stream;
5240 this->fillch = copy->fillch;
5241 ios_base_copyfmt(&this->base, &copy->base);
5242 return this;
5245 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
5246 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
5247 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
5248 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
5249 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
5250 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
5252 wchar_t ret = this->fillch;
5254 TRACE("(%p %c)\n", this, fill);
5256 this->fillch = fill;
5257 return ret;
5260 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
5261 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
5262 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
5263 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
5264 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
5265 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
5267 TRACE("(%p)\n", this);
5268 return this->fillch;
5271 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5272 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5273 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5274 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5275 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
5276 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
5278 TRACE("(%p %p %p)\n", this, ret, loc);
5280 if(this->strbuf) {
5281 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
5282 locale_dtor(ret);
5285 return ios_base_imbue(&this->base, ret, loc);
5288 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
5289 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
5290 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
5291 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
5292 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
5293 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
5295 TRACE("(%p %c %c)\n", this, ch, def);
5296 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(this->strbuf->loc), ch, def);
5299 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5300 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5301 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
5302 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5303 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
5304 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
5306 basic_streambuf_wchar *ret = this->strbuf;
5308 TRACE("(%p %p)\n", this, streambuf);
5310 this->strbuf = streambuf;
5311 basic_ios_wchar_clear(this, IOSTATE_goodbit);
5312 return ret;
5315 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5316 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5317 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5318 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5319 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
5320 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
5322 TRACE("(%p)\n", this);
5323 return this->strbuf;
5326 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5327 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5328 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5329 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5330 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
5331 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5333 TRACE("(%p %x %x)\n", this, state, reraise);
5335 if(state != IOSTATE_goodbit)
5336 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
5339 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5340 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5341 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5342 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5343 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
5344 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
5346 basic_ios_wchar_setstate_reraise(this, state, FALSE);
5349 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5350 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5351 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
5352 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5353 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
5354 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
5356 basic_ostream_wchar *ret = this->stream;
5358 TRACE("(%p %p)\n", this, ostream);
5360 this->stream = ostream;
5361 return ret;
5364 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5365 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5366 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5367 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5368 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
5369 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
5371 TRACE("(%p)\n", this);
5372 return this->stream;
5375 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
5376 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
5377 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
5378 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
5379 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
5380 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
5382 TRACE("(%p %c)\n", this, ch);
5383 return ctype_wchar_widen_ch(ctype_wchar_use_facet(this->strbuf->loc), ch);
5386 /* Caution: basic_ostream uses virtual inheritance.
5387 * All constructors have additional parameter that says if base class should be initialized.
5388 * Base class needs to be accessed using vbtable.
5390 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
5392 return (basic_ios_char*)((char*)this+this->vbtable[1]);
5395 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
5397 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
5400 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
5402 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
5405 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5406 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5407 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 16)
5408 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
5409 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
5411 basic_ios_char *base;
5413 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
5415 if(virt_init) {
5416 this->vbtable = basic_ostream_char_vbtable;
5417 base = basic_ostream_char_get_basic_ios(this);
5418 basic_ios_char_ctor(base);
5419 }else {
5420 base = basic_ostream_char_get_basic_ios(this);
5423 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5424 basic_ios_char_init(base, strbuf, isstd);
5425 return this;
5428 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
5429 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
5430 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 16)
5431 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
5432 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
5434 basic_ios_char *base;
5436 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
5438 if(virt_init) {
5439 this->vbtable = basic_ostream_char_vbtable;
5440 base = basic_ostream_char_get_basic_ios(this);
5441 basic_ios_char_ctor(base);
5442 }else {
5443 base = basic_ostream_char_get_basic_ios(this);
5446 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5447 if(addstd)
5448 ios_base_Addstd(&base->base);
5449 return this;
5452 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5453 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5454 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
5455 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
5457 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5459 /* don't destroy virtual base here */
5460 TRACE("(%p)\n", this);
5463 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5464 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5465 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
5466 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
5468 TRACE("(%p)\n", this);
5469 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
5470 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
5473 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
5474 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5476 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5478 TRACE("(%p %x)\n", this, flags);
5480 if(flags & 2) {
5481 /* we have an array, with the number of elements stored before the first object */
5482 INT_PTR i, *ptr = (INT_PTR *)this-1;
5484 for(i=*ptr-1; i>=0; i--)
5485 basic_ostream_char_vbase_dtor(this+i);
5486 MSVCRT_operator_delete(ptr);
5487 } else {
5488 basic_ostream_char_vbase_dtor(this);
5489 if(flags & 1)
5490 MSVCRT_operator_delete(this);
5493 return this;
5496 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
5497 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
5498 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
5499 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
5501 /* this function is not matching C++ specification */
5502 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5504 TRACE("(%p)\n", this);
5506 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
5507 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
5508 basic_ios_char_setstate(base, IOSTATE_badbit);
5509 return this;
5512 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5513 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5514 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
5516 return basic_ostream_char_flush(ostream);
5519 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5520 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5521 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
5522 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
5524 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5526 TRACE("(%p)\n", this);
5528 if(base->base.fmtfl & FMTFLAG_unitbuf)
5529 basic_ostream_char_flush(this);
5532 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5533 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5534 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
5535 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
5537 TRACE("(%p)\n", this);
5538 basic_ostream_char__Osfx(this);
5541 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
5543 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5545 if(basic_ios_char_rdbuf_get(base))
5546 basic_streambuf_char__Lock(base->strbuf);
5548 if(ios_base_good(&base->base) && base->stream)
5549 basic_ostream_char_flush(base->stream);
5551 return ios_base_good(&base->base);
5554 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
5556 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5558 if(ios_base_good(&base->base) && !__uncaught_exception())
5559 basic_ostream_char_osfx(ostr);
5561 if(basic_ios_char_rdbuf_get(base))
5562 basic_streambuf_char__Unlock(base->strbuf);
5565 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
5566 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
5567 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
5568 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
5570 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5572 TRACE("(%p)\n", this);
5574 if(ios_base_good(&base->base) && base->stream)
5575 basic_ostream_char_flush(base->stream);
5576 return ios_base_good(&base->base);
5579 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
5580 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
5581 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
5582 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
5584 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5586 TRACE("(%p %c)\n", this, ch);
5588 if(!basic_ostream_char_sentry_create(this)
5589 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
5590 basic_ostream_char_sentry_destroy(this);
5591 basic_ios_char_setstate(base, IOSTATE_badbit);
5592 return this;
5595 basic_ostream_char_sentry_destroy(this);
5596 return this;
5599 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
5600 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
5601 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
5602 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
5604 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5606 TRACE("(%p %ld %d)\n", this, off, way);
5608 if(!ios_base_fail(&base->base)) {
5609 fpos_int seek;
5611 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
5612 &seek, off, way, OPENMODE_out);
5613 if(seek.off==-1 && seek.pos==0 && seek.state==0)
5614 basic_ios_char_setstate(base, IOSTATE_failbit);
5616 return this;
5619 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
5620 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
5621 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
5622 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
5624 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5626 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
5628 if(!ios_base_fail(&base->base)) {
5629 fpos_int seek;
5631 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
5632 &seek, pos, OPENMODE_out);
5633 if(seek.off==-1 && seek.pos==0 && seek.state==0)
5634 basic_ios_char_setstate(base, IOSTATE_failbit);
5636 return this;
5639 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
5640 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
5641 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
5642 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
5644 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5646 TRACE("(%p)\n", this);
5648 if(!ios_base_fail(&base->base)) {
5649 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
5650 ret, 0, SEEKDIR_cur, OPENMODE_out);
5651 }else {
5652 ret->off = -1;
5653 ret->pos = 0;
5654 ret->state = 0;
5656 return ret;
5659 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
5660 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
5661 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
5662 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
5664 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5666 TRACE("(%p %s %ld)\n", this, debugstr_a(str), count);
5668 if(!basic_ostream_char_sentry_create(this)
5669 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
5670 basic_ostream_char_sentry_destroy(this);
5671 basic_ios_char_setstate(base, IOSTATE_badbit);
5672 return this;
5675 basic_ostream_char_sentry_destroy(this);
5676 return this;
5679 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
5680 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
5681 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
5682 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
5684 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5685 int state = IOSTATE_goodbit;
5687 TRACE("(%p %d)\n", this, val);
5689 if(basic_ostream_char_sentry_create(this)) {
5690 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5691 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5692 ostreambuf_iterator_char dest = {0, strbuf};
5694 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
5695 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
5696 ? (LONG)((unsigned short)val) : (LONG)val);
5698 basic_ostream_char_sentry_destroy(this);
5700 basic_ios_char_setstate(base, state);
5701 return this;
5704 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
5705 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
5706 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
5707 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
5709 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5710 int state = IOSTATE_goodbit;
5712 TRACE("(%p %u)\n", this, val);
5714 if(basic_ostream_char_sentry_create(this)) {
5715 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5716 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5717 ostreambuf_iterator_char dest = {0, strbuf};
5719 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5721 basic_ostream_char_sentry_destroy(this);
5723 basic_ios_char_setstate(base, state);
5724 return this;
5727 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
5728 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
5729 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
5730 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
5731 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
5732 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
5734 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5735 int state = IOSTATE_goodbit;
5737 TRACE("(%p %d)\n", this, val);
5739 if(basic_ostream_char_sentry_create(this)) {
5740 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5741 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5742 ostreambuf_iterator_char dest = {0, strbuf};
5744 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5746 basic_ostream_char_sentry_destroy(this);
5748 basic_ios_char_setstate(base, state);
5749 return this;
5752 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
5753 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
5754 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
5755 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
5756 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
5757 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
5759 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5760 int state = IOSTATE_goodbit;
5762 TRACE("(%p %u)\n", this, val);
5764 if(basic_ostream_char_sentry_create(this)) {
5765 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5766 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5767 ostreambuf_iterator_char dest = {0, strbuf};
5769 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5771 basic_ostream_char_sentry_destroy(this);
5773 basic_ios_char_setstate(base, state);
5774 return this;
5777 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
5778 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
5779 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
5780 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
5782 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5783 int state = IOSTATE_goodbit;
5785 TRACE("(%p %f)\n", this, val);
5787 if(basic_ostream_char_sentry_create(this)) {
5788 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5789 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5790 ostreambuf_iterator_char dest = {0, strbuf};
5792 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5794 basic_ostream_char_sentry_destroy(this);
5796 basic_ios_char_setstate(base, state);
5797 return this;
5800 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
5801 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
5802 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
5803 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
5805 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5806 int state = IOSTATE_goodbit;
5808 TRACE("(%p %lf)\n", this, val);
5810 if(basic_ostream_char_sentry_create(this)) {
5811 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5812 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5813 ostreambuf_iterator_char dest = {0, strbuf};
5815 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5817 basic_ostream_char_sentry_destroy(this);
5819 basic_ios_char_setstate(base, state);
5820 return this;
5823 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
5824 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
5825 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
5826 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
5828 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5829 int state = IOSTATE_goodbit;
5831 TRACE("(%p %lf)\n", this, val);
5833 if(basic_ostream_char_sentry_create(this)) {
5834 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5835 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5836 ostreambuf_iterator_char dest = {0, strbuf};
5838 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5840 basic_ostream_char_sentry_destroy(this);
5842 basic_ios_char_setstate(base, state);
5843 return this;
5846 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5847 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5848 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
5849 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
5851 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5852 IOSB_iostate state = IOSTATE_badbit;
5853 int c = '\n';
5855 TRACE("(%p %p)\n", this, val);
5857 if(basic_ostream_char_sentry_create(this)) {
5858 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
5859 c = basic_streambuf_char_snextc(val)) {
5860 state = IOSTATE_goodbit;
5862 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
5863 state = IOSTATE_badbit;
5864 break;
5867 }else {
5868 state = IOSTATE_badbit;
5870 basic_ostream_char_sentry_destroy(this);
5872 ios_base_width_set(&base->base, 0);
5873 basic_ios_char_setstate(base, state);
5874 return this;
5877 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
5878 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
5879 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
5880 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
5882 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5883 int state = IOSTATE_goodbit;
5885 TRACE("(%p %p)\n", this, val);
5887 if(basic_ostream_char_sentry_create(this)) {
5888 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5889 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5890 ostreambuf_iterator_char dest = {0, strbuf};
5892 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5894 basic_ostream_char_sentry_destroy(this);
5896 basic_ios_char_setstate(base, state);
5897 return this;
5900 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
5901 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
5902 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
5903 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
5905 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5906 int state = IOSTATE_goodbit;
5908 TRACE("(%p)\n", this);
5910 if(basic_ostream_char_sentry_create(this)) {
5911 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5912 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5913 ostreambuf_iterator_char dest = {0, strbuf};
5915 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5917 basic_ostream_char_sentry_destroy(this);
5919 basic_ios_char_setstate(base, state);
5920 return this;
5923 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
5924 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
5925 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
5926 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
5928 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5929 int state = IOSTATE_goodbit;
5931 TRACE("(%p)\n", this);
5933 if(basic_ostream_char_sentry_create(this)) {
5934 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5935 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5936 ostreambuf_iterator_char dest = {0, strbuf};
5938 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5940 basic_ostream_char_sentry_destroy(this);
5942 basic_ios_char_setstate(base, state);
5943 return this;
5946 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
5947 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
5948 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
5949 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
5951 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5952 int state = IOSTATE_goodbit;
5954 TRACE("(%p %x)\n", this, val);
5956 if(basic_ostream_char_sentry_create(this)) {
5957 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5958 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5959 ostreambuf_iterator_char dest = {0, strbuf};
5961 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5963 basic_ostream_char_sentry_destroy(this);
5965 basic_ios_char_setstate(base, state);
5966 return this;
5969 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5970 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5971 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
5973 TRACE("(%p)\n", ostr);
5975 basic_ostream_char_put(ostr, 0);
5976 return ostr;
5979 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5980 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5981 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
5983 TRACE("(%p)\n", ostr);
5985 basic_ostream_char_put(ostr, '\n');
5986 basic_ostream_char_flush(ostr);
5987 return ostr;
5990 /* $?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 */
5991 /* ??$?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 */
5992 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
5994 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5995 IOSB_iostate state = IOSTATE_goodbit;
5997 TRACE("(%p %p)\n", ostr, str);
5999 if(basic_ostream_char_sentry_create(ostr)) {
6000 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6001 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6003 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6004 for(; pad!=0; pad--) {
6005 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6006 state = IOSTATE_badbit;
6007 break;
6012 if(state == IOSTATE_goodbit) {
6013 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6014 state = IOSTATE_badbit;
6017 if(state == IOSTATE_goodbit) {
6018 for(; pad!=0; pad--) {
6019 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6020 state = IOSTATE_badbit;
6021 break;
6026 base->base.wide = 0;
6027 }else {
6028 state = IOSTATE_badbit;
6030 basic_ostream_char_sentry_destroy(ostr);
6032 basic_ios_char_setstate(base, state);
6033 return ostr;
6036 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6037 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6038 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6039 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6040 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6041 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6042 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6044 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6045 IOSB_iostate state = IOSTATE_goodbit;
6047 TRACE("(%p %d)\n", ostr, ch);
6049 if(basic_ostream_char_sentry_create(ostr)) {
6050 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6052 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6053 for(; pad!=0; pad--) {
6054 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6055 state = IOSTATE_badbit;
6056 break;
6061 if(state == IOSTATE_goodbit) {
6062 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6063 state = IOSTATE_badbit;
6066 if(state == IOSTATE_goodbit) {
6067 for(; pad!=0; pad--) {
6068 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6069 state = IOSTATE_badbit;
6070 break;
6075 base->base.wide = 0;
6076 }else {
6077 state = IOSTATE_badbit;
6079 basic_ostream_char_sentry_destroy(ostr);
6081 basic_ios_char_setstate(base, state);
6082 return ostr;
6085 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6086 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6087 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6088 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6089 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
6090 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
6091 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
6093 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6094 IOSB_iostate state = IOSTATE_goodbit;
6096 TRACE("(%p %s)\n", ostr, str);
6098 if(basic_ostream_char_sentry_create(ostr)) {
6099 MSVCP_size_t len = strlen(str);
6100 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6102 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6103 for(; pad!=0; pad--) {
6104 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6105 state = IOSTATE_badbit;
6106 break;
6111 if(state == IOSTATE_goodbit) {
6112 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
6113 state = IOSTATE_badbit;
6116 if(state == IOSTATE_goodbit) {
6117 for(; pad!=0; pad--) {
6118 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6119 state = IOSTATE_badbit;
6120 break;
6125 base->base.wide = 0;
6126 }else {
6127 state = IOSTATE_badbit;
6129 basic_ostream_char_sentry_destroy(ostr);
6131 basic_ios_char_setstate(base, state);
6132 return ostr;
6135 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6136 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6137 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
6138 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
6139 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
6141 TRACE("(%p %p)\n", this, pfunc);
6142 pfunc(this);
6143 return this;
6146 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
6147 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
6148 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
6149 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
6150 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
6152 TRACE("(%p %p)\n", this, pfunc);
6153 pfunc(basic_ostream_char_get_basic_ios(this));
6154 return this;
6157 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6158 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6159 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
6160 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
6161 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
6163 TRACE("(%p %p)\n", this, pfunc);
6164 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
6165 return this;
6168 /* Caution: basic_ostream uses virtual inheritance. */
6169 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
6171 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
6174 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
6176 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
6179 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
6181 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
6184 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
6185 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
6186 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor, 16)
6187 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor(basic_ostream_wchar *this,
6188 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6190 basic_ios_wchar *base;
6192 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6194 if(virt_init) {
6195 this->vbtable = basic_ostream_wchar_vbtable;
6196 base = basic_ostream_wchar_get_basic_ios(this);
6197 basic_ios_wchar_ctor(base);
6198 }else {
6199 base = basic_ostream_wchar_get_basic_ios(this);
6202 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
6203 basic_ios_wchar_init(base, strbuf, isstd);
6204 return this;
6207 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
6208 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
6209 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 16)
6210 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
6211 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6213 basic_ostream_wchar_ctor(this, strbuf, isstd, virt_init);
6214 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
6215 return this;
6218 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6219 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6220 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor_uninitialized, 16)
6221 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor_uninitialized(basic_ostream_wchar *this,
6222 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6224 basic_ios_wchar *base;
6226 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
6228 if(virt_init) {
6229 this->vbtable = basic_ostream_wchar_vbtable;
6230 base = basic_ostream_wchar_get_basic_ios(this);
6231 basic_ios_wchar_ctor(base);
6232 }else {
6233 base = basic_ostream_wchar_get_basic_ios(this);
6236 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
6237 if(addstd)
6238 ios_base_Addstd(&base->base);
6239 return this;
6242 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6243 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6244 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 16)
6245 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
6246 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6248 basic_ostream_wchar_ctor_uninitialized(this, uninitialized, addstd, virt_init);
6249 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
6250 return this;
6253 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6254 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6255 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
6256 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6257 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
6258 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
6260 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6262 /* don't destroy virtual base here */
6263 TRACE("(%p)\n", this);
6266 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6267 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6268 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6269 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6270 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
6271 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
6273 TRACE("(%p)\n", this);
6274 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
6275 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
6278 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
6279 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
6281 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6283 TRACE("(%p %x)\n", this, flags);
6285 if(flags & 2) {
6286 /* we have an array, with the number of elements stored before the first object */
6287 INT_PTR i, *ptr = (INT_PTR *)this-1;
6289 for(i=*ptr-1; i>=0; i--)
6290 basic_ostream_wchar_vbase_dtor(this+i);
6291 MSVCRT_operator_delete(ptr);
6292 } else {
6293 basic_ostream_wchar_vbase_dtor(this);
6294 if(flags & 1)
6295 MSVCRT_operator_delete(this);
6298 return this;
6301 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
6302 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
6303 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
6304 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
6305 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
6306 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
6308 /* this function is not matching C++ specification */
6309 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6311 TRACE("(%p)\n", this);
6313 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
6314 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
6315 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6316 return this;
6319 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6320 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6321 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6322 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6323 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
6325 return basic_ostream_wchar_flush(ostream);
6328 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6329 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6330 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6331 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6332 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
6333 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
6335 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6337 TRACE("(%p)\n", this);
6339 if(base->base.fmtfl & FMTFLAG_unitbuf)
6340 basic_ostream_wchar_flush(this);
6343 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6344 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6345 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6346 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6347 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
6348 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
6350 TRACE("(%p)\n", this);
6351 basic_ostream_wchar__Osfx(this);
6354 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
6356 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6358 if(basic_ios_wchar_rdbuf_get(base))
6359 basic_streambuf_wchar__Lock(base->strbuf);
6361 if(ios_base_good(&base->base) && base->stream)
6362 basic_ostream_wchar_flush(base->stream);
6364 return ios_base_good(&base->base);
6367 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
6369 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6371 if(ios_base_good(&base->base) && !__uncaught_exception())
6372 basic_ostream_wchar_osfx(ostr);
6374 if(basic_ios_wchar_rdbuf_get(base))
6375 basic_streambuf_wchar__Unlock(base->strbuf);
6378 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
6379 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
6380 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
6381 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
6382 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
6383 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
6385 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6387 TRACE("(%p)\n", this);
6389 if(ios_base_good(&base->base) && base->stream)
6390 basic_ostream_wchar_flush(base->stream);
6391 return ios_base_good(&base->base);
6394 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
6395 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
6396 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
6397 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
6398 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
6399 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
6401 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6403 TRACE("(%p %c)\n", this, ch);
6405 if(!basic_ostream_wchar_sentry_create(this)
6406 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
6407 basic_ostream_wchar_sentry_destroy(this);
6408 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6409 return this;
6412 basic_ostream_wchar_sentry_destroy(this);
6413 return this;
6416 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
6417 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
6418 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
6419 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
6420 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
6421 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
6423 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6425 TRACE("(%p %ld %d)\n", this, off, way);
6427 if(!ios_base_fail(&base->base)) {
6428 fpos_int seek;
6430 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6431 &seek, off, way, OPENMODE_out);
6432 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6433 basic_ios_wchar_setstate(base, IOSTATE_failbit);
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 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
6487 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
6489 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6491 TRACE("(%p %s %ld)\n", this, debugstr_w(str), count);
6493 if(!basic_ostream_wchar_sentry_create(this)
6494 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
6495 basic_ostream_wchar_sentry_destroy(this);
6496 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6497 return this;
6500 basic_ostream_wchar_sentry_destroy(this);
6501 return this;
6504 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
6506 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6507 int state = IOSTATE_goodbit;
6509 TRACE("(%p %d)\n", this, val);
6511 if(basic_ostream_wchar_sentry_create(this)) {
6512 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6513 ostreambuf_iterator_wchar dest = {0, strbuf};
6515 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
6516 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6517 ? (LONG)((unsigned short)val) : (LONG)val);
6519 basic_ostream_wchar_sentry_destroy(this);
6521 basic_ios_wchar_setstate(base, state);
6522 return this;
6525 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
6526 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
6527 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
6528 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
6530 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
6531 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6534 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
6535 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
6536 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
6537 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
6539 return basic_ostream_print_short(this, val, num_put_short_use_facet(
6540 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6543 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
6545 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6546 int state = IOSTATE_goodbit;
6548 TRACE("(%p %d)\n", this, val);
6550 if(basic_ostream_wchar_sentry_create(this)) {
6551 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6552 ostreambuf_iterator_wchar dest = {0, strbuf};
6554 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6556 basic_ostream_wchar_sentry_destroy(this);
6558 basic_ios_wchar_setstate(base, state);
6559 return this;
6562 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
6563 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
6564 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
6565 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
6567 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
6568 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6571 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
6572 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
6573 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
6574 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
6576 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
6577 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6580 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
6582 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6583 int state = IOSTATE_goodbit;
6585 TRACE("(%p %d)\n", this, val);
6587 if(basic_ostream_wchar_sentry_create(this)) {
6588 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6589 ostreambuf_iterator_wchar dest = {0, strbuf};
6591 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6593 basic_ostream_wchar_sentry_destroy(this);
6595 basic_ios_wchar_setstate(base, state);
6596 return this;
6599 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
6600 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
6601 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
6602 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
6603 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
6604 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
6606 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
6607 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6610 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
6611 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
6612 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
6613 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
6614 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
6615 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
6617 return basic_ostream_print_int(this, val, num_put_short_use_facet(
6618 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6621 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
6623 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6624 int state = IOSTATE_goodbit;
6626 TRACE("(%p %u)\n", this, val);
6628 if(basic_ostream_wchar_sentry_create(this)) {
6629 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6630 ostreambuf_iterator_wchar dest = {0, strbuf};
6632 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6634 basic_ostream_wchar_sentry_destroy(this);
6636 basic_ios_wchar_setstate(base, state);
6637 return this;
6640 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
6641 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
6642 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
6643 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
6644 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
6645 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
6647 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
6648 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6651 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
6652 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
6653 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
6654 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
6655 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
6656 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
6658 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
6659 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6662 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
6664 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6665 int state = IOSTATE_goodbit;
6667 TRACE("(%p %f)\n", this, val);
6669 if(basic_ostream_wchar_sentry_create(this)) {
6670 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6671 ostreambuf_iterator_wchar dest = {0, strbuf};
6673 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6675 basic_ostream_wchar_sentry_destroy(this);
6677 basic_ios_wchar_setstate(base, state);
6678 return this;
6681 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
6682 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
6683 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
6684 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
6686 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
6687 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6690 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
6691 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
6692 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
6693 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
6695 return basic_ostream_print_float(this, val, num_put_short_use_facet(
6696 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6699 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
6701 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6702 int state = IOSTATE_goodbit;
6704 TRACE("(%p %lf)\n", this, val);
6706 if(basic_ostream_wchar_sentry_create(this)) {
6707 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6708 ostreambuf_iterator_wchar dest = {0, strbuf};
6710 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6712 basic_ostream_wchar_sentry_destroy(this);
6714 basic_ios_wchar_setstate(base, state);
6715 return this;
6718 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
6719 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
6720 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
6721 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
6723 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
6724 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6727 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
6728 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
6729 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
6730 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
6732 return basic_ostream_print_double(this, val, num_put_short_use_facet(
6733 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6736 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
6738 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6739 int state = IOSTATE_goodbit;
6741 TRACE("(%p %lf)\n", this, val);
6743 if(basic_ostream_wchar_sentry_create(this)) {
6744 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6745 ostreambuf_iterator_wchar dest = {0, strbuf};
6747 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6749 basic_ostream_wchar_sentry_destroy(this);
6751 basic_ios_wchar_setstate(base, state);
6752 return this;
6755 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
6756 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
6757 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
6758 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
6760 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
6761 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6764 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
6765 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
6766 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
6767 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
6769 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
6770 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6773 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6774 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6775 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6776 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6777 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
6778 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
6780 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6781 IOSB_iostate state = IOSTATE_badbit;
6782 unsigned short c = '\n';
6784 TRACE("(%p %p)\n", this, val);
6786 if(basic_ostream_wchar_sentry_create(this)) {
6787 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
6788 c = basic_streambuf_wchar_snextc(val)) {
6789 state = IOSTATE_goodbit;
6791 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
6792 state = IOSTATE_badbit;
6793 break;
6796 }else {
6797 state = IOSTATE_badbit;
6799 basic_ostream_wchar_sentry_destroy(this);
6801 ios_base_width_set(&base->base, 0);
6802 basic_ios_wchar_setstate(base, state);
6803 return this;
6806 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
6808 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6809 int state = IOSTATE_goodbit;
6811 TRACE("(%p %p)\n", this, val);
6813 if(basic_ostream_wchar_sentry_create(this)) {
6814 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6815 ostreambuf_iterator_wchar dest = {0, strbuf};
6817 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6819 basic_ostream_wchar_sentry_destroy(this);
6821 basic_ios_wchar_setstate(base, state);
6822 return this;
6825 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
6826 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
6827 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
6828 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
6830 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
6831 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6834 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
6835 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
6836 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
6837 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
6839 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
6840 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6843 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
6845 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6846 int state = IOSTATE_goodbit;
6848 TRACE("(%p)\n", this);
6850 if(basic_ostream_wchar_sentry_create(this)) {
6851 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6852 ostreambuf_iterator_wchar dest = {0, strbuf};
6854 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6856 basic_ostream_wchar_sentry_destroy(this);
6858 basic_ios_wchar_setstate(base, state);
6859 return this;
6862 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
6863 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
6864 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
6865 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
6867 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
6868 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6871 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
6872 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
6873 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
6874 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
6876 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
6877 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6880 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
6882 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6883 int state = IOSTATE_goodbit;
6885 TRACE("(%p)\n", this);
6887 if(basic_ostream_wchar_sentry_create(this)) {
6888 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6889 ostreambuf_iterator_wchar dest = {0, strbuf};
6891 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6893 basic_ostream_wchar_sentry_destroy(this);
6895 basic_ios_wchar_setstate(base, state);
6896 return this;
6899 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
6900 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
6901 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
6902 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
6904 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
6905 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6908 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
6909 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
6910 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
6911 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
6913 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
6914 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6917 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
6919 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6920 int state = IOSTATE_goodbit;
6922 TRACE("(%p %x)\n", this, val);
6924 if(basic_ostream_wchar_sentry_create(this)) {
6925 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6926 ostreambuf_iterator_wchar dest = {0, strbuf};
6928 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6930 basic_ostream_wchar_sentry_destroy(this);
6932 basic_ios_wchar_setstate(base, state);
6933 return this;
6936 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
6937 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
6938 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
6939 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
6941 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
6942 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6945 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
6946 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
6947 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
6948 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
6950 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
6951 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6954 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6955 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6956 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6957 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6958 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
6960 TRACE("(%p)\n", ostr);
6962 basic_ostream_wchar_put(ostr, 0);
6963 return ostr;
6966 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6967 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6968 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6969 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6970 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
6972 TRACE("(%p)\n", ostr);
6974 basic_ostream_wchar_put(ostr, '\n');
6975 basic_ostream_wchar_flush(ostr);
6976 return ostr;
6979 /* ??$?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 */
6980 /* ??$?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 */
6981 /* ??$?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 */
6982 /* ??$?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 */
6983 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
6985 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6986 IOSB_iostate state = IOSTATE_goodbit;
6988 TRACE("(%p %p)\n", ostr, str);
6990 if(basic_ostream_wchar_sentry_create(ostr)) {
6991 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
6992 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6994 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6995 for(; pad!=0; pad--) {
6996 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6997 state = IOSTATE_badbit;
6998 break;
7003 if(state == IOSTATE_goodbit) {
7004 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7005 state = IOSTATE_badbit;
7008 if(state == IOSTATE_goodbit) {
7009 for(; pad!=0; pad--) {
7010 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7011 state = IOSTATE_badbit;
7012 break;
7017 base->base.wide = 0;
7018 }else {
7019 state = IOSTATE_badbit;
7021 basic_ostream_wchar_sentry_destroy(ostr);
7023 basic_ios_wchar_setstate(base, state);
7024 return ostr;
7027 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
7028 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
7029 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7030 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7031 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
7033 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7034 IOSB_iostate state = IOSTATE_goodbit;
7036 TRACE("(%p %d)\n", ostr, ch);
7038 if(basic_ostream_wchar_sentry_create(ostr)) {
7039 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
7041 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7042 for(; pad!=0; pad--) {
7043 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7044 state = IOSTATE_badbit;
7045 break;
7050 if(state == IOSTATE_goodbit) {
7051 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
7052 state = IOSTATE_badbit;
7055 if(state == IOSTATE_goodbit) {
7056 for(; pad!=0; pad--) {
7057 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7058 state = IOSTATE_badbit;
7059 break;
7064 base->base.wide = 0;
7065 }else {
7066 state = IOSTATE_badbit;
7068 basic_ostream_wchar_sentry_destroy(ostr);
7070 basic_ios_wchar_setstate(base, state);
7071 return ostr;
7074 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
7075 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
7076 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
7077 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
7078 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
7080 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7081 IOSB_iostate state = IOSTATE_goodbit;
7083 TRACE("(%p %s)\n", ostr, debugstr_w(str));
7085 if(basic_ostream_wchar_sentry_create(ostr)) {
7086 MSVCP_size_t len = wcslen(str);
7087 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7089 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7090 for(; pad!=0; pad--) {
7091 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7092 state = IOSTATE_badbit;
7093 break;
7098 if(state == IOSTATE_goodbit) {
7099 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
7100 state = IOSTATE_badbit;
7103 if(state == IOSTATE_goodbit) {
7104 for(; pad!=0; pad--) {
7105 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7106 state = IOSTATE_badbit;
7107 break;
7112 base->base.wide = 0;
7113 }else {
7114 state = IOSTATE_badbit;
7116 basic_ostream_wchar_sentry_destroy(ostr);
7118 basic_ios_wchar_setstate(base, state);
7119 return ostr;
7122 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7123 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7124 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7125 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7126 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
7127 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
7128 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
7130 TRACE("(%p %p)\n", this, pfunc);
7131 pfunc(this);
7132 return this;
7135 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
7136 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
7137 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
7138 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
7139 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
7140 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
7141 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
7143 TRACE("(%p %p)\n", this, pfunc);
7144 pfunc(basic_ostream_wchar_get_basic_ios(this));
7145 return this;
7148 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7149 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7150 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7151 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7152 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
7153 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
7154 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
7156 TRACE("(%p %p)\n", this, pfunc);
7157 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
7158 return this;
7161 /* Caution: basic_istream uses virtual inheritance. */
7162 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
7164 return (basic_ios_char*)((char*)this+this->vbtable[1]);
7167 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
7169 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
7172 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
7174 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
7177 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7178 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7179 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
7180 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)
7182 basic_ios_char *base;
7184 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
7186 if(virt_init) {
7187 this->vbtable = basic_istream_char_vbtable;
7188 base = basic_istream_char_get_basic_ios(this);
7189 basic_ios_char_ctor(base);
7190 }else {
7191 base = basic_istream_char_get_basic_ios(this);
7194 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7195 this->count = 0;
7196 if(!noinit)
7197 basic_ios_char_init(base, strbuf, isstd);
7198 return this;
7201 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7202 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7203 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
7204 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7206 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
7209 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
7210 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
7211 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
7212 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
7214 basic_ios_char *base;
7216 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
7218 if(virt_init) {
7219 this->vbtable = basic_istream_char_vbtable;
7220 base = basic_istream_char_get_basic_ios(this);
7221 basic_ios_char_ctor(base);
7222 }else {
7223 base = basic_istream_char_get_basic_ios(this);
7226 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7227 ios_base_Addstd(&base->base);
7228 return this;
7231 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
7232 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
7233 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
7234 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
7236 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7238 /* don't destroy virtual base here */
7239 TRACE("(%p)\n", this);
7242 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7243 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7244 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
7245 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
7247 TRACE("(%p)\n", this);
7248 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
7249 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
7252 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
7253 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
7255 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7257 TRACE("(%p %x)\n", this, flags);
7259 if(flags & 2) {
7260 /* we have an array, with the number of elements stored before the first object */
7261 INT_PTR i, *ptr = (INT_PTR *)this-1;
7263 for(i=*ptr-1; i>=0; i--)
7264 basic_istream_char_vbase_dtor(this+i);
7265 MSVCRT_operator_delete(ptr);
7266 } else {
7267 basic_istream_char_vbase_dtor(this);
7268 if(flags & 1)
7269 MSVCRT_operator_delete(this);
7272 return this;
7275 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7276 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7277 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
7278 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
7280 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7282 TRACE("(%p %d)\n", this, noskip);
7284 if(ios_base_good(&base->base)) {
7285 if(basic_ios_char_tie_get(base))
7286 basic_ostream_char_flush(basic_ios_char_tie_get(base));
7288 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
7289 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7290 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
7291 int ch;
7293 for(ch = basic_streambuf_char_sgetc(strbuf); ;
7294 ch = basic_streambuf_char_snextc(strbuf)) {
7295 if(ch == EOF) {
7296 basic_ios_char_setstate(base, IOSTATE_eofbit);
7297 break;
7300 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
7301 break;
7306 if(!ios_base_good(&base->base)) {
7307 basic_ios_char_setstate(base, IOSTATE_failbit);
7308 return FALSE;
7311 return TRUE;
7314 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7315 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7316 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
7317 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
7319 return basic_istream_char__Ipfx(this, noskip);
7322 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7323 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7324 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
7325 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
7327 TRACE("(%p)\n", this);
7330 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
7332 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7334 if(basic_ios_char_rdbuf_get(base))
7335 basic_streambuf_char__Lock(base->strbuf);
7337 return basic_istream_char_ipfx(istr, noskip);
7340 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
7342 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7344 if(basic_ios_char_rdbuf_get(base))
7345 basic_streambuf_char__Unlock(base->strbuf);
7348 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
7349 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
7350 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
7351 int __thiscall basic_istream_char_gcount(const basic_istream_char *this)
7353 TRACE("(%p)\n", this);
7354 return this->count;
7357 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7358 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7359 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
7360 int __thiscall basic_istream_char_get(basic_istream_char *this)
7362 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7363 int ret;
7365 TRACE("(%p)\n", this);
7367 this->count = 0;
7369 if(!basic_istream_char_sentry_create(this, TRUE)) {
7370 basic_istream_char_sentry_destroy(this);
7371 return EOF;
7374 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
7375 basic_istream_char_sentry_destroy(this);
7376 if(ret == EOF)
7377 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
7378 else
7379 this->count++;
7381 return ret;
7384 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
7385 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
7386 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
7387 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
7389 int ret;
7391 TRACE("(%p %p)\n", this, ch);
7393 ret = basic_istream_char_get(this);
7394 if(ret != EOF)
7395 *ch = (char)ret;
7396 return this;
7399 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7400 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7401 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
7402 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7404 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7405 int ch = delim;
7407 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
7409 this->count = 0;
7411 if(basic_istream_char_sentry_create(this, TRUE)) {
7412 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7414 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
7415 ch = basic_streambuf_char_snextc(strbuf)) {
7416 if(ch==EOF || ch==delim)
7417 break;
7419 *str++ = ch;
7420 this->count++;
7421 count--;
7424 basic_istream_char_sentry_destroy(this);
7426 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7427 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7428 if(count > 0)
7429 *str = 0;
7430 return this;
7433 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7434 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7435 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
7436 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
7438 return basic_istream_char_get_str_delim(this, str, count, '\n');
7441 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7442 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7443 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
7444 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
7446 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7447 int ch = delim;
7449 TRACE("(%p %p %c)\n", this, strbuf, delim);
7451 this->count = 0;
7453 if(basic_istream_char_sentry_create(this, TRUE)) {
7454 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
7456 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
7457 ch = basic_streambuf_char_snextc(strbuf_read)) {
7458 if(ch==EOF || ch==delim)
7459 break;
7461 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
7462 break;
7463 this->count++;
7466 basic_istream_char_sentry_destroy(this);
7468 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7469 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7470 return this;
7473 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7474 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7475 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
7476 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
7478 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
7481 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7482 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7483 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
7484 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7486 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7487 int ch = (unsigned char)delim;
7489 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
7491 this->count = 0;
7493 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
7494 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7496 while(count > 1) {
7497 ch = basic_streambuf_char_sbumpc(strbuf);
7499 if(ch==EOF || ch==(unsigned char)delim)
7500 break;
7502 *str++ = ch;
7503 this->count++;
7504 count--;
7507 if(ch == (unsigned char)delim)
7508 this->count++;
7509 else if(ch != EOF) {
7510 ch = basic_streambuf_char_sgetc(strbuf);
7512 if(ch == (unsigned char)delim) {
7513 basic_streambuf_char__Gninc(strbuf);
7514 this->count++;
7518 basic_istream_char_sentry_destroy(this);
7520 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
7521 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
7522 if(count > 0)
7523 *str = 0;
7524 return this;
7527 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7528 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7529 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
7530 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
7532 return basic_istream_char_getline_delim(this, str, count, '\n');
7535 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
7536 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
7537 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
7538 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
7540 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7541 int ch = (unsigned char)delim;
7542 unsigned int state;
7544 TRACE("(%p %ld %d)\n", this, count, delim);
7546 this->count = 0;
7548 if(basic_istream_char_sentry_create(this, TRUE)) {
7549 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7550 state = IOSTATE_goodbit;
7552 while(count > 0) {
7553 ch = basic_streambuf_char_sbumpc(strbuf);
7555 if(ch==EOF) {
7556 state = IOSTATE_eofbit;
7557 break;
7560 if(ch==(unsigned char)delim)
7561 break;
7563 this->count++;
7564 if(count != INT_MAX)
7565 count--;
7567 }else
7568 state = IOSTATE_failbit;
7569 basic_istream_char_sentry_destroy(this);
7571 basic_ios_char_setstate(base, state);
7572 return this;
7575 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
7576 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
7577 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
7579 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
7580 int ch = '\n';
7582 TRACE("(%p)\n", istream);
7584 if(basic_istream_char_sentry_create(istream, TRUE)) {
7585 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7586 const ctype_char *ctype = ctype_char_use_facet(strbuf->loc);
7588 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
7589 ch = basic_streambuf_char_snextc(strbuf)) {
7590 if(ch == EOF)
7591 break;
7594 basic_istream_char_sentry_destroy(istream);
7596 if(ch == EOF)
7597 basic_ios_char_setstate(base, IOSTATE_eofbit);
7598 return istream;
7601 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7602 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7603 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
7604 int __thiscall basic_istream_char_peek(basic_istream_char *this)
7606 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7607 int ret = EOF;
7609 TRACE("(%p)\n", this);
7611 this->count = 0;
7613 if(basic_istream_char_sentry_create(this, TRUE))
7614 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
7615 basic_istream_char_sentry_destroy(this);
7617 if (ret == EOF)
7618 basic_ios_char_setstate(base, IOSTATE_eofbit);
7620 return ret;
7623 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
7624 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
7625 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
7626 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
7628 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7629 IOSB_iostate state = IOSTATE_goodbit;
7631 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
7633 if(basic_istream_char_sentry_create(this, TRUE)) {
7634 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7636 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
7637 if(this->count != count)
7638 state |= IOSTATE_failbit | IOSTATE_eofbit;
7639 }else {
7640 this->count = 0;
7642 basic_istream_char_sentry_destroy(this);
7644 basic_ios_char_setstate(base, state);
7645 return this;
7648 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7649 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7650 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
7651 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
7653 return basic_istream_char__Read_s(this, str, count, count);
7656 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
7657 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
7658 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
7659 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
7661 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7662 IOSB_iostate state = IOSTATE_goodbit;
7664 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
7666 this->count = 0;
7668 if(basic_istream_char_sentry_create(this, TRUE)) {
7669 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
7670 if(avail > count)
7671 avail = count;
7673 if(avail == -1)
7674 state |= IOSTATE_eofbit;
7675 else if(avail > 0)
7676 basic_istream_char__Read_s(this, str, size, avail);
7677 }else {
7678 state |= IOSTATE_failbit;
7680 basic_istream_char_sentry_destroy(this);
7682 basic_ios_char_setstate(base, state);
7683 return this->count;
7686 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
7687 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
7688 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
7689 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
7691 return basic_istream_char__Readsome_s(this, str, count, count);
7694 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
7695 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
7696 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
7697 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
7699 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7700 IOSB_iostate state = IOSTATE_goodbit;
7702 TRACE("(%p %c)\n", this, ch);
7704 this->count = 0;
7706 if(basic_istream_char_sentry_create(this, TRUE)) {
7707 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7709 if(!ios_base_good(&base->base))
7710 state |= IOSTATE_failbit;
7711 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
7712 state |= IOSTATE_badbit;
7714 basic_istream_char_sentry_destroy(this);
7716 basic_ios_char_setstate(base, state);
7717 return this;
7720 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
7721 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
7722 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
7723 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
7725 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7726 IOSB_iostate state = IOSTATE_goodbit;
7728 TRACE("(%p)\n", this);
7730 this->count = 0;
7732 if(basic_istream_char_sentry_create(this, TRUE)) {
7733 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7735 if(!ios_base_good(&base->base))
7736 state |= IOSTATE_failbit;
7737 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
7738 state |= IOSTATE_badbit;
7740 basic_istream_char_sentry_destroy(this);
7742 basic_ios_char_setstate(base, state);
7743 return this;
7746 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7747 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7748 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
7749 int __thiscall basic_istream_char_sync(basic_istream_char *this)
7751 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7752 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7754 TRACE("(%p)\n", this);
7756 if(!strbuf)
7757 return -1;
7759 if(basic_istream_char_sentry_create(this, TRUE)) {
7760 if(basic_streambuf_char_pubsync(strbuf) != -1) {
7761 basic_istream_char_sentry_destroy(this);
7762 return 0;
7765 basic_istream_char_sentry_destroy(this);
7767 basic_ios_char_setstate(base, IOSTATE_badbit);
7768 return -1;
7771 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7772 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7773 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
7774 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
7776 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7778 TRACE("(%p %p)\n", this, ret);
7780 if(ios_base_fail(&base->base)) {
7781 ret->off = -1;
7782 ret->pos = 0;
7783 ret->state = 0;
7784 return ret;
7787 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
7788 ret, 0, SEEKDIR_cur, OPENMODE_in);
7790 if(ret->off==-1 && ret->pos==0 && ret->state==0)
7791 basic_ios_char_setstate(base, IOSTATE_failbit);
7793 return ret;
7796 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
7797 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
7798 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
7799 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
7801 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7803 TRACE("(%p %ld %d)\n", this, off, dir);
7805 if(!ios_base_fail(&base->base)) {
7806 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7807 fpos_int ret;
7809 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
7811 if(ret.off==-1 && ret.pos==0 && ret.state==0)
7812 basic_ios_char_setstate(base, IOSTATE_failbit);
7813 else
7814 basic_ios_char_clear(base, IOSTATE_goodbit);
7815 return this;
7816 }else
7817 basic_ios_char_clear(base, IOSTATE_goodbit);
7819 return this;
7822 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7823 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7824 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
7825 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
7827 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7829 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
7831 if(!ios_base_fail(&base->base)) {
7832 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7833 fpos_int ret;
7835 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
7837 if(ret.off==-1 && ret.pos==0 && ret.state==0)
7838 basic_ios_char_setstate(base, IOSTATE_failbit);
7839 else
7840 basic_ios_char_clear(base, IOSTATE_goodbit);
7841 return this;
7842 }else
7843 basic_ios_char_clear(base, IOSTATE_goodbit);
7845 return this;
7848 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
7849 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
7850 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
7851 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
7853 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7854 int state = IOSTATE_goodbit;
7856 TRACE("(%p %p)\n", this, v);
7858 if(basic_istream_char_sentry_create(this, FALSE)) {
7859 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7860 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7861 istreambuf_iterator_char first={0}, last={0};
7862 LONG tmp;
7864 first.strbuf = strbuf;
7865 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
7867 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
7868 *v = tmp;
7869 else
7870 state |= IOSTATE_failbit;
7872 basic_istream_char_sentry_destroy(this);
7874 basic_ios_char_setstate(base, state);
7875 return this;
7878 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
7879 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
7880 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
7881 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
7883 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7884 int state = IOSTATE_goodbit;
7886 TRACE("(%p %p)\n", this, v);
7888 if(basic_istream_char_sentry_create(this, FALSE)) {
7889 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7890 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7891 istreambuf_iterator_char first={0}, last={0};
7893 first.strbuf = strbuf;
7894 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
7896 basic_istream_char_sentry_destroy(this);
7898 basic_ios_char_setstate(base, state);
7899 return this;
7902 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
7903 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
7904 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
7905 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
7907 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7908 int state = IOSTATE_goodbit;
7910 TRACE("(%p %p)\n", this, v);
7912 if(basic_istream_char_sentry_create(this, FALSE)) {
7913 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7914 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7915 istreambuf_iterator_char first={0}, last={0};
7917 first.strbuf = strbuf;
7918 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
7920 basic_istream_char_sentry_destroy(this);
7922 basic_ios_char_setstate(base, state);
7923 return this;
7926 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
7927 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
7928 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
7929 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
7931 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7932 int state = IOSTATE_goodbit;
7934 TRACE("(%p %p)\n", this, v);
7936 if(basic_istream_char_sentry_create(this, FALSE)) {
7937 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7938 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7939 istreambuf_iterator_char first={0}, last={0};
7941 first.strbuf = strbuf;
7942 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
7944 basic_istream_char_sentry_destroy(this);
7946 basic_ios_char_setstate(base, state);
7947 return this;
7950 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
7951 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
7952 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
7953 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
7955 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7956 int state = IOSTATE_goodbit;
7958 TRACE("(%p %p)\n", this, v);
7960 if(basic_istream_char_sentry_create(this, FALSE)) {
7961 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7962 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7963 istreambuf_iterator_char first={0}, last={0};
7965 first.strbuf = strbuf;
7966 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
7968 basic_istream_char_sentry_destroy(this);
7970 basic_ios_char_setstate(base, state);
7971 return this;
7974 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
7975 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
7976 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
7977 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
7979 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7980 int state = IOSTATE_goodbit;
7982 TRACE("(%p %p)\n", this, v);
7984 if(basic_istream_char_sentry_create(this, FALSE)) {
7985 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7986 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7987 istreambuf_iterator_char first={0}, last={0};
7989 first.strbuf = strbuf;
7990 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
7992 basic_istream_char_sentry_destroy(this);
7994 basic_ios_char_setstate(base, state);
7995 return this;
7998 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
7999 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
8000 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
8001 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
8003 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8004 int state = IOSTATE_goodbit;
8006 TRACE("(%p %p)\n", this, v);
8008 if(basic_istream_char_sentry_create(this, FALSE)) {
8009 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8010 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8011 istreambuf_iterator_char first={0}, last={0};
8013 first.strbuf = strbuf;
8014 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
8016 basic_istream_char_sentry_destroy(this);
8018 basic_ios_char_setstate(base, state);
8019 return this;
8022 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
8023 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
8024 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
8025 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
8027 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8028 int state = IOSTATE_goodbit;
8030 TRACE("(%p %p)\n", this, v);
8032 if(basic_istream_char_sentry_create(this, FALSE)) {
8033 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8034 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8035 istreambuf_iterator_char first={0}, last={0};
8037 first.strbuf = strbuf;
8038 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
8040 basic_istream_char_sentry_destroy(this);
8042 basic_ios_char_setstate(base, state);
8043 return this;
8046 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
8047 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
8048 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
8049 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
8051 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8052 int state = IOSTATE_goodbit;
8054 TRACE("(%p %p)\n", this, v);
8056 if(basic_istream_char_sentry_create(this, FALSE)) {
8057 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8058 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8059 istreambuf_iterator_char first={0}, last={0};
8061 first.strbuf = strbuf;
8062 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
8064 basic_istream_char_sentry_destroy(this);
8066 basic_ios_char_setstate(base, state);
8067 return this;
8070 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
8071 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
8072 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
8073 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
8075 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8076 int state = IOSTATE_goodbit;
8078 TRACE("(%p %p)\n", this, v);
8080 if(basic_istream_char_sentry_create(this, FALSE)) {
8081 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8082 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8083 istreambuf_iterator_char first={0}, last={0};
8085 first.strbuf = strbuf;
8086 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
8088 basic_istream_char_sentry_destroy(this);
8090 basic_ios_char_setstate(base, state);
8091 return this;
8094 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
8095 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
8096 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
8097 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
8099 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8100 int state = IOSTATE_goodbit;
8102 TRACE("(%p %p)\n", this, v);
8104 if(basic_istream_char_sentry_create(this, FALSE)) {
8105 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8106 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8107 istreambuf_iterator_char first={0}, last={0};
8109 first.strbuf = strbuf;
8110 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
8112 basic_istream_char_sentry_destroy(this);
8114 basic_ios_char_setstate(base, state);
8115 return this;
8118 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
8119 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
8120 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
8121 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
8123 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8124 int state = IOSTATE_goodbit;
8126 TRACE("(%p %p)\n", this, v);
8128 if(basic_istream_char_sentry_create(this, FALSE)) {
8129 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8130 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8131 istreambuf_iterator_char first={0}, last={0};
8133 first.strbuf = strbuf;
8134 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
8136 basic_istream_char_sentry_destroy(this);
8138 basic_ios_char_setstate(base, state);
8139 return this;
8142 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
8143 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
8144 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
8145 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
8147 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8148 int state = IOSTATE_goodbit;
8150 TRACE("(%p %p)\n", this, v);
8152 if(basic_istream_char_sentry_create(this, FALSE)) {
8153 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8154 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8155 istreambuf_iterator_char first={0}, last={0};
8157 first.strbuf = strbuf;
8158 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
8160 basic_istream_char_sentry_destroy(this);
8162 basic_ios_char_setstate(base, state);
8163 return this;
8166 /* ??$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 */
8167 /* ??$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 */
8168 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
8169 basic_istream_char *istream, basic_string_char *str, char delim)
8171 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8172 IOSB_iostate state = IOSTATE_goodbit;
8173 int c = (unsigned char)delim;
8175 TRACE("(%p %p %c)\n", istream, str, delim);
8177 if(basic_istream_char_sentry_create(istream, TRUE)) {
8178 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8179 MSVCP_basic_string_char_clear(str);
8181 c = basic_streambuf_char_sgetc(strbuf);
8182 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
8183 MSVCP_basic_string_char_append_ch(str, c);
8184 if(c==EOF) state |= IOSTATE_eofbit;
8185 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
8187 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
8189 basic_istream_char_sentry_destroy(istream);
8191 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
8192 return istream;
8195 /* ??$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 */
8196 /* ??$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 */
8197 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
8198 basic_istream_char *istream, basic_string_char *str)
8200 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
8203 /* ??$?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 */
8204 /* ??$?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 */
8205 basic_istream_char* __cdecl basic_istream_char_read_bstr(
8206 basic_istream_char *istream, basic_string_char *str)
8208 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8209 IOSB_iostate state = IOSTATE_failbit;
8210 int c = '\n';
8212 TRACE("(%p %p)\n", istream, str);
8214 if(basic_istream_char_sentry_create(istream, FALSE)) {
8215 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
8216 MSVCP_size_t count = ios_base_width_get(&base->base);
8218 if(!count)
8219 count = -1;
8221 MSVCP_basic_string_char_clear(str);
8223 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8224 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8225 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8226 state = IOSTATE_goodbit;
8227 MSVCP_basic_string_char_append_ch(str, c);
8230 basic_istream_char_sentry_destroy(istream);
8232 ios_base_width_set(&base->base, 0);
8233 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8234 return istream;
8237 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
8238 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
8239 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
8240 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
8241 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
8242 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
8243 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
8245 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8246 IOSB_iostate state = IOSTATE_failbit;
8247 int c = '\n';
8249 TRACE("(%p %p)\n", istream, str);
8251 if(basic_istream_char_sentry_create(istream, FALSE)) {
8252 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
8253 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
8255 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8256 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8257 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8258 state = IOSTATE_goodbit;
8259 *str++ = c;
8262 basic_istream_char_sentry_destroy(istream);
8264 *str = 0;
8265 ios_base_width_set(&base->base, 0);
8266 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8267 return istream;
8270 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
8271 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
8272 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
8273 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
8274 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
8275 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
8276 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
8278 IOSB_iostate state = IOSTATE_failbit;
8279 int c = 0;
8281 TRACE("(%p %p)\n", istream, ch);
8283 if(basic_istream_char_sentry_create(istream, FALSE)) {
8284 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
8285 basic_istream_char_get_basic_ios(istream)));
8286 if(c != EOF) {
8287 state = IOSTATE_goodbit;
8288 *ch = c;
8291 basic_istream_char_sentry_destroy(istream);
8293 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
8294 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8295 return istream;
8298 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8299 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8300 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
8301 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
8302 basic_istream_char *this, basic_streambuf_char *streambuf)
8304 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8305 IOSB_iostate state = IOSTATE_failbit;
8306 int c = '\n';
8308 TRACE("(%p %p)\n", this, streambuf);
8310 if(basic_istream_char_sentry_create(this, FALSE)) {
8311 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
8312 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
8313 state = IOSTATE_goodbit;
8314 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
8315 break;
8318 basic_istream_char_sentry_destroy(this);
8320 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8321 return this;
8324 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8325 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8326 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
8327 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
8328 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
8330 TRACE("(%p %p)\n", this, pfunc);
8331 pfunc(this);
8332 return this;
8335 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
8336 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
8337 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
8338 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
8339 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
8341 TRACE("(%p %p)\n", this, pfunc);
8342 pfunc(basic_istream_char_get_basic_ios(this));
8343 return this;
8346 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8347 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8348 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
8349 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
8350 ios_base* (__cdecl *pfunc)(ios_base*))
8352 TRACE("(%p %p)\n", this, pfunc);
8353 pfunc(&basic_istream_char_get_basic_ios(this)->base);
8354 return this;
8357 /* Caution: basic_istream uses virtual inheritance. */
8358 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
8360 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
8363 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
8365 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
8368 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
8370 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
8373 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
8374 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
8375 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
8376 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
8377 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
8379 basic_ios_wchar *base;
8381 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
8383 if(virt_init) {
8384 this->vbtable = basic_istream_wchar_vbtable;
8385 base = basic_istream_wchar_get_basic_ios(this);
8386 basic_ios_wchar_ctor(base);
8387 }else {
8388 base = basic_istream_wchar_get_basic_ios(this);
8391 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
8392 this->count = 0;
8393 if(!noinit)
8394 basic_ios_wchar_init(base, strbuf, isstd);
8395 return this;
8398 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
8399 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
8400 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
8401 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
8402 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
8404 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
8405 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8406 return this;
8409 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8410 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8411 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
8412 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
8413 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8415 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8418 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8419 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8420 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
8421 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
8422 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8424 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8427 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8428 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8429 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
8430 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
8431 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8433 basic_ios_wchar *base;
8435 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
8437 if(virt_init) {
8438 this->vbtable = basic_istream_wchar_vbtable;
8439 base = basic_istream_wchar_get_basic_ios(this);
8440 basic_ios_wchar_ctor(base);
8441 }else {
8442 base = basic_istream_wchar_get_basic_ios(this);
8445 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
8446 ios_base_Addstd(&base->base);
8447 return this;
8450 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8451 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8452 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
8453 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
8454 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8456 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
8457 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8458 return this;
8461 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
8462 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
8463 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
8464 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
8465 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
8466 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
8468 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8470 /* don't destroy virtual base here */
8471 TRACE("(%p)\n", this);
8474 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
8475 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
8476 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
8477 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
8478 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
8479 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
8481 TRACE("(%p)\n", this);
8482 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
8483 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
8486 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
8487 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
8489 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8491 TRACE("(%p %x)\n", this, flags);
8493 if(flags & 2) {
8494 /* we have an array, with the number of elements stored before the first object */
8495 INT_PTR i, *ptr = (INT_PTR *)this-1;
8497 for(i=*ptr-1; i>=0; i--)
8498 basic_istream_wchar_vbase_dtor(this+i);
8499 MSVCRT_operator_delete(ptr);
8500 } else {
8501 basic_istream_wchar_vbase_dtor(this);
8502 if(flags & 1)
8503 MSVCRT_operator_delete(this);
8506 return this;
8509 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
8510 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
8511 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
8512 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
8513 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
8514 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
8516 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8518 TRACE("(%p %d)\n", this, noskip);
8520 if(ios_base_good(&base->base)) {
8521 if(basic_ios_wchar_tie_get(base))
8522 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
8524 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
8525 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8526 const ctype_wchar *ctype = ctype_wchar_use_facet(base->strbuf->loc);
8527 int ch;
8529 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
8530 ch = basic_streambuf_wchar_snextc(strbuf)) {
8531 if(ch == WEOF) {
8532 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
8533 break;
8536 if(!ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
8537 break;
8542 if(!ios_base_good(&base->base)) {
8543 basic_ios_wchar_setstate(base, IOSTATE_failbit);
8544 return FALSE;
8546 return TRUE;
8549 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
8550 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
8551 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
8552 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
8553 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
8554 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
8556 return basic_istream_wchar__Ipfx(this, noskip);
8559 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
8560 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
8561 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
8562 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
8563 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
8564 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
8566 TRACE("(%p)\n", this);
8569 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
8571 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
8573 if(basic_ios_wchar_rdbuf_get(base))
8574 basic_streambuf_wchar__Lock(base->strbuf);
8576 return basic_istream_wchar_ipfx(istr, noskip);
8579 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
8581 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
8583 if(basic_ios_wchar_rdbuf_get(base))
8584 basic_streambuf_wchar__Unlock(base->strbuf);
8587 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
8588 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
8589 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
8590 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
8591 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
8592 int __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
8594 TRACE("(%p)\n", this);
8595 return this->count;
8598 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
8599 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
8600 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
8601 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
8602 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
8603 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
8605 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8606 int ret;
8608 TRACE("(%p)\n", this);
8610 this->count = 0;
8612 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
8613 basic_istream_wchar_sentry_destroy(this);
8614 return WEOF;
8617 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
8618 basic_istream_wchar_sentry_destroy(this);
8619 if(ret == WEOF)
8620 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
8621 else
8622 this->count++;
8624 return ret;
8627 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
8628 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
8629 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
8630 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
8631 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
8632 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
8634 unsigned short ret;
8636 TRACE("(%p %p)\n", this, ch);
8638 ret = basic_istream_wchar_get(this);
8639 if(ret != WEOF)
8640 *ch = (wchar_t)ret;
8641 return this;
8644 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
8645 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
8646 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
8647 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
8648 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
8649 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
8651 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8652 unsigned short ch = delim;
8654 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
8656 this->count = 0;
8658 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8659 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8661 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
8662 ch = basic_streambuf_wchar_snextc(strbuf)) {
8663 if(ch==WEOF || ch==delim)
8664 break;
8666 *str++ = ch;
8667 this->count++;
8668 count--;
8671 basic_istream_wchar_sentry_destroy(this);
8673 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8674 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8675 if(count > 0)
8676 *str = 0;
8677 return this;
8680 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8681 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8682 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8683 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8684 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
8685 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
8687 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
8690 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
8691 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
8692 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
8693 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
8694 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
8695 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
8697 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8698 unsigned short ch = delim;
8700 TRACE("(%p %p %c)\n", this, strbuf, delim);
8702 this->count = 0;
8704 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8705 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
8707 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
8708 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
8709 if(ch==WEOF || ch==delim)
8710 break;
8712 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
8713 break;
8714 this->count++;
8717 basic_istream_wchar_sentry_destroy(this);
8719 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8720 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8721 return this;
8724 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
8725 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
8726 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
8727 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
8728 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
8729 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
8731 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
8734 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
8735 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
8736 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
8737 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
8738 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
8739 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
8741 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8742 unsigned short ch = delim;
8744 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
8746 this->count = 0;
8748 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
8749 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8751 while(count > 1) {
8752 ch = basic_streambuf_wchar_sbumpc(strbuf);
8754 if(ch==WEOF || ch==delim)
8755 break;
8757 *str++ = ch;
8758 this->count++;
8759 count--;
8762 if(ch == delim)
8763 this->count++;
8764 else if(ch != WEOF) {
8765 ch = basic_streambuf_wchar_sgetc(strbuf);
8767 if(ch == delim) {
8768 basic_streambuf_wchar__Gninc(strbuf);
8769 this->count++;
8773 basic_istream_wchar_sentry_destroy(this);
8775 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8776 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8777 if(count > 0)
8778 *str = 0;
8779 return this;
8782 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8783 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8784 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8785 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8786 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
8787 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
8789 return basic_istream_wchar_getline_delim(this, str, count, '\n');
8792 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
8793 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
8794 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
8795 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
8796 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
8797 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
8799 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8800 unsigned short ch = delim;
8801 unsigned int state;
8803 TRACE("(%p %ld %d)\n", this, count, delim);
8805 this->count = 0;
8807 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8808 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8809 state = IOSTATE_goodbit;
8811 while(count > 0) {
8812 ch = basic_streambuf_wchar_sbumpc(strbuf);
8814 if(ch==WEOF) {
8815 state = IOSTATE_eofbit;
8816 break;
8819 if(ch==delim)
8820 break;
8822 this->count++;
8823 if(count != INT_MAX)
8824 count--;
8826 }else
8827 state = IOSTATE_failbit;
8828 basic_istream_wchar_sentry_destroy(this);
8830 basic_ios_wchar_setstate(base, state);
8831 return this;
8834 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
8835 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
8836 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
8837 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
8838 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
8840 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
8841 unsigned short ch = '\n';
8843 TRACE("(%p)\n", istream);
8845 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
8846 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8847 const ctype_wchar *ctype = ctype_wchar_use_facet(strbuf->loc);
8849 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
8850 ch = basic_streambuf_wchar_snextc(strbuf)) {
8851 if(ch == WEOF)
8852 break;
8855 basic_istream_wchar_sentry_destroy(istream);
8857 if(ch == WEOF)
8858 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
8859 return istream;
8862 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
8863 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
8864 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
8865 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
8866 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
8867 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
8869 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8870 unsigned short ret = WEOF;
8872 TRACE("(%p)\n", this);
8874 this->count = 0;
8876 if(basic_istream_wchar_sentry_create(this, TRUE))
8877 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
8878 basic_istream_wchar_sentry_destroy(this);
8880 if (ret == WEOF)
8881 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
8883 return ret;
8886 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
8887 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
8888 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
8889 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
8890 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
8891 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
8893 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8894 IOSB_iostate state = IOSTATE_goodbit;
8896 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
8898 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8899 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8901 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
8902 if(this->count != count)
8903 state |= IOSTATE_failbit | IOSTATE_eofbit;
8904 }else {
8905 this->count = 0;
8907 basic_istream_wchar_sentry_destroy(this);
8909 basic_ios_wchar_setstate(base, state);
8910 return this;
8913 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8914 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8915 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8916 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8917 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
8918 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
8920 return basic_istream_wchar__Read_s(this, str, count, count);
8923 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
8924 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
8925 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
8926 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
8927 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
8928 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
8930 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8931 IOSB_iostate state = IOSTATE_goodbit;
8933 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
8935 this->count = 0;
8937 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8938 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
8939 if(avail > count)
8940 avail = count;
8942 if(avail == -1)
8943 state |= IOSTATE_eofbit;
8944 else if(avail > 0)
8945 basic_istream_wchar__Read_s(this, str, size, avail);
8946 }else {
8947 state |= IOSTATE_failbit;
8949 basic_istream_wchar_sentry_destroy(this);
8951 basic_ios_wchar_setstate(base, state);
8952 return this->count;
8955 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
8956 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
8957 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
8958 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
8959 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
8960 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
8962 return basic_istream_wchar__Readsome_s(this, str, count, count);
8965 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
8966 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
8967 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
8968 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
8969 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
8970 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
8972 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8973 IOSB_iostate state = IOSTATE_goodbit;
8975 TRACE("(%p %c)\n", this, ch);
8977 this->count = 0;
8979 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8980 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8982 if(!ios_base_good(&base->base))
8983 state |= IOSTATE_failbit;
8984 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
8985 state |= IOSTATE_badbit;
8987 basic_istream_wchar_sentry_destroy(this);
8989 basic_ios_wchar_setstate(base, state);
8990 return this;
8993 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
8994 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
8995 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
8996 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
8997 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
8998 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
9000 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9001 IOSB_iostate state = IOSTATE_goodbit;
9003 TRACE("(%p)\n", this);
9005 this->count = 0;
9007 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9008 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9010 if(!ios_base_good(&base->base))
9011 state |= IOSTATE_failbit;
9012 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
9013 state |= IOSTATE_badbit;
9015 basic_istream_wchar_sentry_destroy(this);
9017 basic_ios_wchar_setstate(base, state);
9018 return this;
9021 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
9022 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
9023 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
9024 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
9025 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
9026 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
9028 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9029 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9031 TRACE("(%p)\n", this);
9033 if(!strbuf)
9034 return -1;
9036 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9037 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
9038 basic_istream_wchar_sentry_destroy(this);
9039 return 0;
9042 basic_istream_wchar_sentry_destroy(this);
9044 basic_ios_wchar_setstate(base, IOSTATE_badbit);
9045 return -1;
9048 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9049 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9050 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9051 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9052 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
9053 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
9055 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9057 TRACE("(%p %p)\n", this, ret);
9059 if(ios_base_fail(&base->base)) {
9060 ret->off = -1;
9061 ret->pos = 0;
9062 ret->state = 0;
9063 return ret;
9066 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
9067 ret, 0, SEEKDIR_cur, OPENMODE_in);
9068 if(ret->off==-1 && ret->pos==0 && ret->state==0)
9069 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9071 return ret;
9074 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
9075 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
9076 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
9077 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
9078 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
9079 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
9081 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9083 TRACE("(%p %ld %d)\n", this, off, dir);
9085 if(!ios_base_fail(&base->base)) {
9086 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9087 fpos_int ret;
9089 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
9091 if(ret.off==-1 && ret.pos==0 && ret.state==0)
9092 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9093 else
9094 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9095 return this;
9096 }else
9097 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9099 return this;
9102 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9103 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9104 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9105 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9106 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
9107 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
9109 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9111 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
9113 if(!ios_base_fail(&base->base)) {
9114 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9115 fpos_int ret;
9117 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
9119 if(ret.off==-1 && ret.pos==0 && ret.state==0)
9120 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9121 else
9122 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9123 return this;
9124 }else
9125 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9127 return this;
9130 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
9132 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9133 int state = IOSTATE_goodbit;
9135 TRACE("(%p %p)\n", this, v);
9137 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9138 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9139 istreambuf_iterator_wchar first={0}, last={0};
9140 LONG tmp;
9142 first.strbuf = strbuf;
9143 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
9145 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
9146 *v = tmp;
9147 else
9148 state |= IOSTATE_failbit;
9150 basic_istream_wchar_sentry_destroy(this);
9152 basic_ios_wchar_setstate(base, state);
9153 return this;
9156 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
9157 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
9158 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
9159 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
9161 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
9162 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9165 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
9166 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
9167 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
9168 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
9170 return basic_istream_read_short(this, v, num_get_short_use_facet(
9171 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9174 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
9175 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
9176 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
9177 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
9179 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9180 int state = IOSTATE_goodbit;
9182 TRACE("(%p %p)\n", this, v);
9184 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9185 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9186 const num_get *numget = num_get_wchar_use_facet(strbuf->loc);
9187 istreambuf_iterator_wchar first={0}, last={0};
9189 first.strbuf = strbuf;
9190 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
9192 basic_istream_wchar_sentry_destroy(this);
9194 basic_ios_wchar_setstate(base, state);
9195 return this;
9198 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *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@AAH@Z */
9219 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
9220 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
9221 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
9223 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
9224 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9227 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
9228 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
9229 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
9230 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
9232 return basic_istream_read_int(this, v, num_get_short_use_facet(
9233 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9236 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
9238 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9239 int state = IOSTATE_goodbit;
9241 TRACE("(%p %p)\n", this, v);
9243 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9244 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9245 istreambuf_iterator_wchar first={0}, last={0};
9247 first.strbuf = strbuf;
9248 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
9250 basic_istream_wchar_sentry_destroy(this);
9252 basic_ios_wchar_setstate(base, state);
9253 return this;
9256 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
9257 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
9258 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
9259 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
9261 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
9262 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9265 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
9266 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
9267 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
9268 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
9270 return basic_istream_read_uint(this, v, num_get_short_use_facet(
9271 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9274 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
9276 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9277 int state = IOSTATE_goodbit;
9279 TRACE("(%p %p)\n", this, v);
9281 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9282 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9283 istreambuf_iterator_wchar first={0}, last={0};
9285 first.strbuf = strbuf;
9286 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9288 basic_istream_wchar_sentry_destroy(this);
9290 basic_ios_wchar_setstate(base, state);
9291 return this;
9294 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
9295 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
9296 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
9297 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
9299 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
9300 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9303 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
9304 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
9305 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
9306 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
9308 return basic_istream_read_long(this, v, num_get_short_use_facet(
9309 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9312 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
9314 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9315 int state = IOSTATE_goodbit;
9317 TRACE("(%p %p)\n", this, v);
9319 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9320 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9321 istreambuf_iterator_wchar first={0}, last={0};
9323 first.strbuf = strbuf;
9324 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
9326 basic_istream_wchar_sentry_destroy(this);
9328 basic_ios_wchar_setstate(base, state);
9329 return this;
9332 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
9333 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
9334 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
9335 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
9337 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
9338 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9341 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
9342 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
9343 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
9344 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
9346 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
9347 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9350 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
9352 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9353 int state = IOSTATE_goodbit;
9355 TRACE("(%p %p)\n", this, v);
9357 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9358 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9359 istreambuf_iterator_wchar first={0}, last={0};
9361 first.strbuf = strbuf;
9362 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
9364 basic_istream_wchar_sentry_destroy(this);
9366 basic_ios_wchar_setstate(base, state);
9367 return this;
9370 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
9371 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
9372 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
9373 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
9375 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
9376 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9379 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
9380 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
9381 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
9382 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
9384 return basic_istream_read_float(this, v, num_get_short_use_facet(
9385 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9388 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
9390 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9391 int state = IOSTATE_goodbit;
9393 TRACE("(%p %p)\n", this, v);
9395 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9396 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9397 istreambuf_iterator_wchar first={0}, last={0};
9399 first.strbuf = strbuf;
9400 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
9402 basic_istream_wchar_sentry_destroy(this);
9404 basic_ios_wchar_setstate(base, state);
9405 return this;
9408 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
9409 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
9410 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
9411 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
9413 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
9414 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9417 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
9418 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
9419 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
9420 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
9422 return basic_istream_read_double(this, v, num_get_short_use_facet(
9423 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9426 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
9428 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9429 int state = IOSTATE_goodbit;
9431 TRACE("(%p %p)\n", this, v);
9433 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9434 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9435 istreambuf_iterator_wchar first={0}, last={0};
9437 first.strbuf = strbuf;
9438 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
9440 basic_istream_wchar_sentry_destroy(this);
9442 basic_ios_wchar_setstate(base, state);
9443 return this;
9446 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
9447 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
9448 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
9449 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
9451 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
9452 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9455 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
9456 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
9457 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
9458 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
9460 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
9461 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9464 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
9466 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9467 int state = IOSTATE_goodbit;
9469 TRACE("(%p %p)\n", this, v);
9471 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9472 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9473 istreambuf_iterator_wchar first={0}, last={0};
9475 first.strbuf = strbuf;
9476 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
9478 basic_istream_wchar_sentry_destroy(this);
9480 basic_ios_wchar_setstate(base, state);
9481 return this;
9484 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
9485 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
9486 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
9487 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
9489 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
9490 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9493 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
9494 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
9495 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
9496 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
9498 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
9499 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9502 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
9504 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9505 int state = IOSTATE_goodbit;
9507 TRACE("(%p %p)\n", this, v);
9509 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9510 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9511 istreambuf_iterator_wchar first={0}, last={0};
9513 first.strbuf = strbuf;
9514 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
9516 basic_istream_wchar_sentry_destroy(this);
9518 basic_ios_wchar_setstate(base, state);
9519 return this;
9522 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
9523 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
9524 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
9525 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
9527 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
9528 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9531 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
9532 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
9533 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
9534 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
9536 return basic_istream_read_int64(this, v, num_get_short_use_facet(
9537 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9540 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
9542 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9543 int state = IOSTATE_goodbit;
9545 TRACE("(%p %p)\n", this, v);
9547 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9548 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9549 istreambuf_iterator_wchar first={0}, last={0};
9551 first.strbuf = strbuf;
9552 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
9554 basic_istream_wchar_sentry_destroy(this);
9556 basic_ios_wchar_setstate(base, state);
9557 return this;
9560 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
9561 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
9562 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
9563 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
9565 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
9566 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9569 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
9570 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
9571 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
9572 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
9574 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
9575 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9578 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
9580 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9581 int state = IOSTATE_goodbit;
9583 TRACE("(%p %p)\n", this, v);
9585 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9586 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9587 istreambuf_iterator_wchar first={0}, last={0};
9589 first.strbuf = strbuf;
9590 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
9592 basic_istream_wchar_sentry_destroy(this);
9594 basic_ios_wchar_setstate(base, state);
9595 return this;
9598 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
9599 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
9600 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
9601 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
9603 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
9604 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9607 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
9608 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
9609 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
9610 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
9612 return basic_istream_read_bool(this, v, num_get_short_use_facet(
9613 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9616 /* ??$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 */
9617 /* ??$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 */
9618 /* ??$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 */
9619 /* ??$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 */
9620 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
9621 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
9623 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9624 IOSB_iostate state = IOSTATE_goodbit;
9625 int c = delim;
9627 TRACE("(%p %p %c)\n", istream, str, delim);
9629 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
9630 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9631 MSVCP_basic_string_wchar_clear(str);
9633 c = basic_streambuf_wchar_sgetc(strbuf);
9634 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
9635 MSVCP_basic_string_wchar_append_ch(str, c);
9636 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
9637 else if(c==WEOF) state |= IOSTATE_eofbit;
9639 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
9641 basic_istream_wchar_sentry_destroy(istream);
9643 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
9644 return istream;
9647 /* ??$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 */
9648 /* ??$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 */
9649 /* ??$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 */
9650 /* ??$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 */
9651 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
9652 basic_istream_wchar *istream, basic_string_wchar *str)
9654 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
9657 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
9658 basic_string_wchar *str, const ctype_wchar *ctype)
9660 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9661 IOSB_iostate state = IOSTATE_failbit;
9662 int c = '\n';
9664 TRACE("(%p %p)\n", istream, str);
9666 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9667 MSVCP_size_t count = ios_base_width_get(&base->base);
9669 if(!count)
9670 count = -1;
9672 MSVCP_basic_string_wchar_clear(str);
9674 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9675 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9676 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
9677 state = IOSTATE_goodbit;
9678 MSVCP_basic_string_wchar_append_ch(str, c);
9681 basic_istream_wchar_sentry_destroy(istream);
9683 ios_base_width_set(&base->base, 0);
9684 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9685 return istream;
9688 /* ??$?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 */
9689 /* ??$?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 */
9690 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
9691 basic_istream_wchar *istream, basic_string_wchar *str)
9693 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
9694 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
9697 /* ??$?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 */
9698 /* ??$?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 */
9699 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
9700 basic_istream_wchar *istream, basic_string_wchar *str)
9702 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
9703 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
9706 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
9708 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9709 IOSB_iostate state = IOSTATE_failbit;
9710 unsigned short c = '\n';
9712 TRACE("(%p %p)\n", istream, str);
9714 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9715 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
9717 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9718 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9719 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
9720 state = IOSTATE_goodbit;
9721 *str++ = c;
9724 basic_istream_wchar_sentry_destroy(istream);
9726 *str = 0;
9727 ios_base_width_set(&base->base, 0);
9728 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9729 return istream;
9732 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
9733 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
9734 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
9736 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
9737 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
9740 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
9741 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
9742 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
9744 return basic_istream_read_str(istream, str, ctype_short_use_facet(
9745 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
9748 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
9749 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
9750 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
9751 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
9752 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
9754 IOSB_iostate state = IOSTATE_failbit;
9755 unsigned short c = 0;
9757 TRACE("(%p %p)\n", istream, ch);
9759 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9760 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
9761 basic_istream_wchar_get_basic_ios(istream)));
9762 if(c != WEOF) {
9763 state = IOSTATE_goodbit;
9764 *ch = c;
9767 basic_istream_wchar_sentry_destroy(istream);
9769 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
9770 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9771 return istream;
9774 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9775 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9776 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9777 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9778 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
9779 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
9780 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
9782 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9783 IOSB_iostate state = IOSTATE_failbit;
9784 unsigned short c = '\n';
9786 TRACE("(%p %p)\n", this, streambuf);
9788 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9789 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
9790 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
9791 state = IOSTATE_goodbit;
9792 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
9793 break;
9796 basic_istream_wchar_sentry_destroy(this);
9798 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9799 return this;
9802 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9803 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9804 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9805 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9806 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
9807 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
9808 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
9810 TRACE("(%p %p)\n", this, pfunc);
9811 pfunc(this);
9812 return this;
9815 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
9816 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
9817 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
9818 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
9819 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
9820 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
9821 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
9823 TRACE("(%p %p)\n", this, pfunc);
9824 pfunc(basic_istream_wchar_get_basic_ios(this));
9825 return this;
9828 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9829 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9830 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9831 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9832 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
9833 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
9834 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
9836 TRACE("(%p %p)\n", this, pfunc);
9837 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
9838 return this;
9841 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
9843 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
9846 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
9848 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
9851 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9852 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9853 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
9854 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
9856 basic_ios_char *basic_ios;
9858 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
9860 if(virt_init) {
9861 this->base1.vbtable = basic_iostream_char_vbtable1;
9862 this->base2.vbtable = basic_iostream_char_vbtable2;
9863 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
9864 basic_ios_char_ctor(basic_ios);
9865 }else {
9866 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
9869 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
9871 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
9872 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
9873 return this;
9876 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
9877 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
9878 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
9879 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
9881 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
9883 TRACE("(%p)\n", this);
9884 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
9885 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
9888 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9889 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9890 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
9891 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
9893 TRACE("(%p)\n", this);
9894 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
9895 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
9898 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
9899 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
9901 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
9903 TRACE("(%p %x)\n", this, flags);
9905 if(flags & 2) {
9906 /* we have an array, with the number of elements stored before the first object */
9907 INT_PTR i, *ptr = (INT_PTR *)this-1;
9909 for(i=*ptr-1; i>=0; i--)
9910 basic_iostream_char_vbase_dtor(this+i);
9911 MSVCRT_operator_delete(ptr);
9912 } else {
9913 basic_iostream_char_vbase_dtor(this);
9914 if(flags & 1)
9915 MSVCRT_operator_delete(this);
9918 return this;
9921 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
9923 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
9926 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9928 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
9931 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9932 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9933 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
9934 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
9935 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
9937 basic_ios_wchar *basic_ios;
9939 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
9941 if(virt_init) {
9942 this->base1.vbtable = basic_iostream_wchar_vbtable1;
9943 this->base2.vbtable = basic_iostream_wchar_vbtable2;
9944 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
9945 basic_ios_wchar_ctor(basic_ios);
9946 }else {
9947 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
9950 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
9951 basic_ostream_wchar_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
9953 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
9954 return this;
9957 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9958 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9959 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
9960 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
9961 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
9963 basic_iostream_wchar_ctor(this, strbuf, virt_init);
9964 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
9965 return this;
9968 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9969 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9970 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9971 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9972 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
9973 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
9975 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
9977 TRACE("(%p)\n", this);
9978 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
9979 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
9982 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9983 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9984 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9985 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9986 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
9987 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
9989 TRACE("(%p)\n", this);
9990 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
9991 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
9994 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
9995 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9997 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
9999 TRACE("(%p %x)\n", this, flags);
10001 if(flags & 2) {
10002 /* we have an array, with the number of elements stored before the first object */
10003 INT_PTR i, *ptr = (INT_PTR *)this-1;
10005 for(i=*ptr-1; i>=0; i--)
10006 basic_iostream_wchar_vbase_dtor(this+i);
10007 MSVCRT_operator_delete(ptr);
10008 } else {
10009 basic_iostream_wchar_vbase_dtor(this);
10010 if(flags & 1)
10011 MSVCRT_operator_delete(this);
10014 return this;
10017 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
10019 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
10022 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
10024 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
10027 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10028 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10029 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
10030 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
10032 basic_ios_char *basic_ios;
10034 TRACE("(%p %d)\n", this, virt_init);
10036 if(virt_init) {
10037 this->base.vbtable = basic_ofstream_char_vbtable;
10038 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10039 basic_ios_char_ctor(basic_ios);
10040 }else {
10041 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10044 basic_filebuf_char_ctor(&this->filebuf);
10045 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10046 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10047 return this;
10050 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10051 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10052 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
10053 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
10054 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
10056 basic_ios_char *basic_ios;
10058 TRACE("(%p %p %d)\n", this, file, virt_init);
10060 if(virt_init) {
10061 this->base.vbtable = basic_ofstream_char_vbtable;
10062 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10063 basic_ios_char_ctor(basic_ios);
10064 }else {
10065 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10068 basic_filebuf_char_ctor_file(&this->filebuf, file);
10069 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10070 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10071 return this;
10074 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
10075 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
10076 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 20)
10077 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
10078 const char *name, int mode, int prot, MSVCP_bool virt_init)
10080 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
10082 basic_ofstream_char_ctor(this, virt_init);
10084 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10085 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10086 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10088 return this;
10091 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
10092 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
10093 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
10094 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
10095 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name_wchar, 20)
10096 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name_wchar(basic_ofstream_char *this,
10097 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10099 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
10101 basic_ofstream_char_ctor(this, virt_init);
10103 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10104 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10105 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10107 return this;
10110 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10111 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10112 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
10113 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
10115 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10117 TRACE("(%p)\n", this);
10119 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
10120 basic_filebuf_char_dtor(&this->filebuf);
10123 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10124 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10125 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
10126 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
10128 TRACE("(%p)\n", this);
10130 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
10131 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
10134 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
10135 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10137 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10139 TRACE("(%p %x)\n", this, flags);
10141 if(flags & 2) {
10142 /* we have an array, with the number of elements stored before the first object */
10143 INT_PTR i, *ptr = (INT_PTR *)this-1;
10145 for(i=*ptr-1; i>=0; i--)
10146 basic_ofstream_char_vbase_dtor(this+i);
10147 MSVCRT_operator_delete(ptr);
10148 } else {
10149 basic_ofstream_char_vbase_dtor(this);
10150 if(flags & 1)
10151 MSVCRT_operator_delete(this);
10154 return this;
10157 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10158 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10159 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
10160 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
10162 TRACE("(%p)\n", this);
10164 if(!basic_filebuf_char_close(&this->filebuf)) {
10165 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10166 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10170 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10171 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10172 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
10173 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
10175 TRACE("(%p)\n", this);
10176 return basic_filebuf_char_is_open(&this->filebuf);
10179 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
10180 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
10181 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 16)
10182 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
10183 const char *name, int mode, int prot)
10185 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
10187 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10188 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10189 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10193 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
10194 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
10195 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
10196 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
10197 const char *name, unsigned int mode)
10199 basic_ofstream_char_open(this, name, mode, _SH_DENYNO);
10202 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
10203 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
10204 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
10205 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
10206 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar, 16)
10207 void __thiscall basic_ofstream_char_open_wchar(basic_ofstream_char *this,
10208 const wchar_t *name, int mode, int prot)
10210 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
10212 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10213 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10214 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10218 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
10219 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
10220 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
10221 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
10222 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar_old, 12)
10223 void __thiscall basic_ofstream_char_open_wchar_old(basic_ofstream_char *this,
10224 const wchar_t *name, unsigned int mode)
10226 basic_ofstream_char_open_wchar(this, name, mode, _SH_DENYNO);
10229 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10230 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10231 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
10232 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
10234 TRACE("(%p)\n", this);
10235 return (basic_filebuf_char*)&this->filebuf;
10238 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
10240 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
10243 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10245 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
10248 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10249 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10250 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
10251 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10253 basic_ios_wchar *basic_ios;
10255 TRACE("(%p %d)\n", this, virt_init);
10257 if(virt_init) {
10258 this->base.vbtable = basic_ofstream_wchar_vbtable;
10259 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10260 basic_ios_wchar_ctor(basic_ios);
10261 }else {
10262 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10265 basic_filebuf_wchar_ctor(&this->filebuf);
10266 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10267 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
10268 return this;
10271 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10272 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10273 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
10274 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10276 basic_ofstream_wchar_ctor(this, virt_init);
10277 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10278 return this;
10281 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10282 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10283 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
10284 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
10285 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10287 basic_ios_wchar *basic_ios;
10289 TRACE("(%p %p %d)\n", this, file, virt_init);
10291 if(virt_init) {
10292 this->base.vbtable = basic_ofstream_wchar_vbtable;
10293 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10294 basic_ios_wchar_ctor(basic_ios);
10295 }else {
10296 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10299 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10300 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10301 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
10302 return this;
10305 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10306 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10307 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
10308 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
10309 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10311 basic_ofstream_wchar_ctor_file(this, file, virt_init);
10312 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10313 return this;
10316 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
10317 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
10318 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name, 20)
10319 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name(basic_ofstream_wchar *this,
10320 const char *name, int mode, int prot, MSVCP_bool virt_init)
10322 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
10324 basic_ofstream_wchar_ctor(this, virt_init);
10326 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10327 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10328 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10330 return this;
10333 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
10334 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
10335 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 20)
10336 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
10337 const char *name, int mode, int prot, MSVCP_bool virt_init)
10339 basic_ofstream_wchar_ctor_name(this, name, mode, prot, virt_init);
10340 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10341 return this;
10344 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
10345 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
10346 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
10347 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
10348 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name_wchar, 20)
10349 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name_wchar(basic_ofstream_wchar *this,
10350 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10352 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
10354 basic_ofstream_wchar_ctor(this, virt_init);
10356 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10357 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10358 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10360 return this;
10363 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
10364 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
10365 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
10366 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
10367 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name_wchar, 20)
10368 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name_wchar(basic_ofstream_wchar *this,
10369 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10371 basic_ofstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
10372 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10373 return this;
10376 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10377 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10378 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10379 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10380 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
10381 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
10383 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
10385 TRACE("(%p)\n", this);
10387 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
10388 basic_filebuf_wchar_dtor(&this->filebuf);
10391 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10392 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10393 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10394 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10395 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
10396 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
10398 TRACE("(%p)\n", this);
10400 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
10401 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
10404 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
10405 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10407 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
10409 TRACE("(%p %x)\n", this, flags);
10411 if(flags & 2) {
10412 /* we have an array, with the number of elements stored before the first object */
10413 INT_PTR i, *ptr = (INT_PTR *)this-1;
10415 for(i=*ptr-1; i>=0; i--)
10416 basic_ofstream_wchar_vbase_dtor(this+i);
10417 MSVCRT_operator_delete(ptr);
10418 } else {
10419 basic_ofstream_wchar_vbase_dtor(this);
10420 if(flags & 1)
10421 MSVCRT_operator_delete(this);
10424 return this;
10427 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10428 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10429 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10430 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10431 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
10432 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
10434 TRACE("(%p)\n", this);
10436 if(!basic_filebuf_wchar_close(&this->filebuf)) {
10437 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10438 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10442 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
10443 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
10444 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
10445 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
10446 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
10447 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
10449 TRACE("(%p)\n", this);
10450 return basic_filebuf_wchar_is_open(&this->filebuf);
10453 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
10454 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
10455 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
10456 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
10457 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 16)
10458 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
10459 const char *name, int mode, int prot)
10461 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
10463 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10464 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10465 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10469 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
10470 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
10471 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
10472 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
10473 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
10474 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
10475 const char *name, unsigned int mode)
10477 basic_ofstream_wchar_open(this, name, mode, _SH_DENYNO);
10480 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
10481 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
10482 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
10483 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
10484 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
10485 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
10486 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
10487 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
10488 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar, 16)
10489 void __thiscall basic_ofstream_wchar_open_wchar(basic_ofstream_wchar *this,
10490 const wchar_t *name, int mode, int prot)
10492 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
10494 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10495 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10496 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10500 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
10501 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
10502 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
10503 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
10504 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
10505 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
10506 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
10507 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
10508 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar_old, 12)
10509 void __thiscall basic_ofstream_wchar_open_wchar_old(basic_ofstream_wchar *this,
10510 const wchar_t *name, unsigned int mode)
10512 basic_ofstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
10515 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10516 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10517 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10518 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10519 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
10520 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
10522 TRACE("(%p)\n", this);
10523 return (basic_filebuf_wchar*)&this->filebuf;
10526 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
10528 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
10531 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
10533 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
10536 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10537 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10538 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
10539 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
10541 basic_ios_char *basic_ios;
10543 TRACE("(%p %d)\n", this, virt_init);
10545 if(virt_init) {
10546 this->base.vbtable = basic_ifstream_char_vbtable;
10547 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10548 basic_ios_char_ctor(basic_ios);
10549 }else {
10550 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10553 basic_filebuf_char_ctor(&this->filebuf);
10554 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10555 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
10556 return this;
10559 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10560 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10561 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
10562 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
10563 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
10565 basic_ios_char *basic_ios;
10567 TRACE("(%p %p %d)\n", this, file, virt_init);
10569 if(virt_init) {
10570 this->base.vbtable = basic_ifstream_char_vbtable;
10571 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10572 basic_ios_char_ctor(basic_ios);
10573 }else {
10574 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10577 basic_filebuf_char_ctor_file(&this->filebuf, file);
10578 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10579 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
10580 return this;
10583 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
10584 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
10585 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 20)
10586 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
10587 const char *name, int mode, int prot, MSVCP_bool virt_init)
10589 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
10591 basic_ifstream_char_ctor(this, virt_init);
10593 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
10594 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10595 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10597 return this;
10600 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
10601 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
10602 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
10603 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
10604 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_wchar, 20)
10605 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_wchar(basic_ifstream_char *this,
10606 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10608 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
10610 basic_ifstream_char_ctor(this, virt_init);
10612 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
10613 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10614 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10616 return this;
10619 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10620 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10621 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
10622 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
10624 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
10626 TRACE("(%p)\n", this);
10628 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
10629 basic_filebuf_char_dtor(&this->filebuf);
10632 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10633 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10634 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
10635 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
10637 TRACE("(%p)\n", this);
10639 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
10640 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
10643 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
10644 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10646 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
10648 TRACE("(%p %x)\n", this, flags);
10650 if(flags & 2) {
10651 /* we have an array, with the number of elements stored before the first object */
10652 INT_PTR i, *ptr = (INT_PTR *)this-1;
10654 for(i=*ptr-1; i>=0; i--)
10655 basic_ifstream_char_vbase_dtor(this+i);
10656 MSVCRT_operator_delete(ptr);
10657 } else {
10658 basic_ifstream_char_vbase_dtor(this);
10659 if(flags & 1)
10660 MSVCRT_operator_delete(this);
10663 return this;
10666 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10667 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10668 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
10669 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
10671 TRACE("(%p)\n", this);
10673 if(!basic_filebuf_char_close(&this->filebuf)) {
10674 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10675 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10679 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10680 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10681 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
10682 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
10684 TRACE("(%p)\n", this);
10685 return basic_filebuf_char_is_open(&this->filebuf);
10688 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
10689 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
10690 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 16)
10691 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
10692 const char *name, int mode, int prot)
10694 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
10696 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
10697 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10698 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10702 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
10703 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
10704 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
10705 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
10706 const char *name, unsigned int mode)
10708 basic_ifstream_char_open(this, name, mode, _SH_DENYNO);
10711 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
10712 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
10713 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
10714 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
10715 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar, 16)
10716 void __thiscall basic_ifstream_char_open_wchar(basic_ifstream_char *this,
10717 const wchar_t *name, int mode, int prot)
10719 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
10721 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
10722 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10723 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10727 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
10728 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
10729 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
10730 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
10731 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar_old, 12)
10732 void __thiscall basic_ifstream_char_open_wchar_old(basic_ifstream_char *this,
10733 const wchar_t *name, unsigned int mode)
10735 basic_ifstream_char_open_wchar(this, name, mode, _SH_DENYNO);
10738 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10739 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10740 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
10741 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
10743 TRACE("(%p)\n", this);
10744 return (basic_filebuf_char*)&this->filebuf;
10747 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
10749 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
10752 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10754 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
10757 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10758 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10759 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
10760 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
10762 basic_ios_wchar *basic_ios;
10764 TRACE("(%p %d)\n", this, virt_init);
10766 if(virt_init) {
10767 this->base.vbtable = basic_ifstream_wchar_vbtable;
10768 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10769 basic_ios_wchar_ctor(basic_ios);
10770 }else {
10771 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10774 basic_filebuf_wchar_ctor(&this->filebuf);
10775 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10776 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
10777 return this;
10780 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10781 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10782 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
10783 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
10785 basic_ifstream_wchar_ctor(this, virt_init);
10786 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10787 return this;
10790 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10791 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10792 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
10793 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
10794 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10796 basic_ios_wchar *basic_ios;
10798 TRACE("(%p %p %d)\n", this, file, virt_init);
10800 if(virt_init) {
10801 this->base.vbtable = basic_ifstream_wchar_vbtable;
10802 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10803 basic_ios_wchar_ctor(basic_ios);
10804 }else {
10805 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10808 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10809 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10810 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
10811 return this;
10814 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10815 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10816 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
10817 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
10818 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10820 basic_ifstream_wchar_ctor_file(this, file, virt_init);
10821 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10822 return this;
10825 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
10826 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
10827 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name, 20)
10828 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name(basic_ifstream_wchar *this,
10829 const char *name, int mode, int prot, MSVCP_bool virt_init)
10831 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
10833 basic_ifstream_wchar_ctor(this, virt_init);
10835 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
10836 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10837 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10839 return this;
10842 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
10843 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
10844 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 20)
10845 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
10846 const char *name, int mode, int prot, MSVCP_bool virt_init)
10848 basic_ifstream_wchar_ctor_name(this, name, mode, prot, virt_init);
10849 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10850 return this;
10853 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
10854 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
10855 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
10856 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
10857 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_wchar, 20)
10858 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_wchar(basic_ifstream_wchar *this,
10859 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10861 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
10863 basic_ifstream_wchar_ctor(this, virt_init);
10865 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
10866 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10867 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10869 return this;
10872 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
10873 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
10874 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
10875 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
10876 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_wchar, 20)
10877 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_wchar(basic_ifstream_wchar *this,
10878 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10880 basic_ifstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
10881 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10882 return this;
10885 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10886 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10887 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10888 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10889 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
10890 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
10892 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
10894 TRACE("(%p)\n", this);
10896 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
10897 basic_filebuf_wchar_dtor(&this->filebuf);
10900 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10901 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10902 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10903 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10904 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
10905 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
10907 TRACE("(%p)\n", this);
10909 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
10910 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
10913 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
10914 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10916 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
10918 TRACE("(%p %x)\n", this, flags);
10920 if(flags & 2) {
10921 /* we have an array, with the number of elements stored before the first object */
10922 INT_PTR i, *ptr = (INT_PTR *)this-1;
10924 for(i=*ptr-1; i>=0; i--)
10925 basic_ifstream_wchar_vbase_dtor(this+i);
10926 MSVCRT_operator_delete(ptr);
10927 } else {
10928 basic_ifstream_wchar_vbase_dtor(this);
10929 if(flags & 1)
10930 MSVCRT_operator_delete(this);
10933 return this;
10936 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10937 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10938 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10939 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10940 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
10941 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
10943 TRACE("(%p)\n", this);
10945 if(!basic_filebuf_wchar_close(&this->filebuf)) {
10946 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10947 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10951 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
10952 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
10953 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
10954 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
10955 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
10956 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
10958 TRACE("(%p)\n", this);
10959 return basic_filebuf_wchar_is_open(&this->filebuf);
10962 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
10963 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
10964 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
10965 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
10966 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 16)
10967 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
10968 const char *name, int mode, int prot)
10970 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
10972 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
10973 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10974 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10978 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
10979 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
10980 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
10981 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
10982 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
10983 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
10984 const char *name, unsigned int mode)
10986 basic_ifstream_wchar_open(this, name, mode, _SH_DENYNO);
10989 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
10990 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
10991 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
10992 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
10993 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
10994 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
10995 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
10996 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
10997 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar, 16)
10998 void __thiscall basic_ifstream_wchar_open_wchar(basic_ifstream_wchar *this,
10999 const wchar_t *name, int mode, int prot)
11001 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11003 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11004 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11005 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11009 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11010 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11011 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11012 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11013 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11014 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11015 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11016 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11017 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar_old, 12)
11018 void __thiscall basic_ifstream_wchar_open_wchar_old(basic_ifstream_wchar *this,
11019 const wchar_t *name, unsigned int mode)
11021 basic_ifstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11024 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11025 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11026 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11027 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11028 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
11029 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
11031 TRACE("(%p)\n", this);
11032 return (basic_filebuf_wchar*)&this->filebuf;
11035 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
11037 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
11040 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
11042 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
11045 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11046 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11047 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
11048 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
11050 basic_ios_char *basic_ios;
11052 TRACE("(%p %d)\n", this, virt_init);
11054 if(virt_init) {
11055 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11056 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11057 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11058 basic_ios_char_ctor(basic_ios);
11059 }else {
11060 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11063 basic_filebuf_char_ctor(&this->filebuf);
11064 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11065 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11066 return this;
11069 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11070 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11071 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
11072 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
11073 FILE *file, MSVCP_bool virt_init)
11075 basic_ios_char *basic_ios;
11077 TRACE("(%p %p %d)\n", this, file, virt_init);
11079 if(virt_init) {
11080 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11081 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11082 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11083 basic_ios_char_ctor(basic_ios);
11084 }else {
11085 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11088 basic_filebuf_char_ctor_file(&this->filebuf, file);
11089 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11090 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11091 return this;
11094 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11095 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11096 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 20)
11097 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
11098 const char *name, int mode, int prot, MSVCP_bool virt_init)
11100 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11102 basic_fstream_char_ctor(this, virt_init);
11104 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
11105 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11106 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11108 return this;
11111 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11112 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11113 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11114 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11115 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_wchar, 20)
11116 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_wchar(basic_fstream_char *this,
11117 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11119 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11121 basic_fstream_char_ctor(this, virt_init);
11123 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
11124 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11125 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11127 return this;
11130 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11131 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11132 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
11133 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
11135 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11137 TRACE("(%p)\n", this);
11139 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
11140 basic_filebuf_char_dtor(&this->filebuf);
11143 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11144 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11145 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
11146 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
11148 TRACE("(%p)\n", this);
11150 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
11151 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
11154 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
11155 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11157 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11159 TRACE("(%p %x)\n", this, flags);
11161 if(flags & 2) {
11162 /* we have an array, with the number of elements stored before the first object */
11163 INT_PTR i, *ptr = (INT_PTR *)this-1;
11165 for(i=*ptr-1; i>=0; i--)
11166 basic_fstream_char_vbase_dtor(this+i);
11167 MSVCRT_operator_delete(ptr);
11168 } else {
11169 basic_fstream_char_vbase_dtor(this);
11170 if(flags & 1)
11171 MSVCRT_operator_delete(this);
11174 return this;
11177 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11178 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11179 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
11180 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
11182 TRACE("(%p)\n", this);
11184 if(!basic_filebuf_char_close(&this->filebuf)) {
11185 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11186 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11190 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11191 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11192 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
11193 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
11195 TRACE("(%p)\n", this);
11196 return basic_filebuf_char_is_open(&this->filebuf);
11199 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11200 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11201 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 16)
11202 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
11203 const char *name, int mode, int prot)
11205 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11207 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
11208 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11209 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11213 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11214 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11215 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
11216 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
11217 const char *name, unsigned int mode)
11219 basic_fstream_char_open(this, name, mode, _SH_DENYNO);
11222 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11223 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11224 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11225 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11226 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar, 16)
11227 void __thiscall basic_fstream_char_open_wchar(basic_fstream_char *this,
11228 const wchar_t *name, int mode, int prot)
11230 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11232 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
11233 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11234 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11238 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11239 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11240 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11241 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11242 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar_old, 12)
11243 void __thiscall basic_fstream_char_open_wchar_old(basic_fstream_char *this,
11244 const wchar_t *name, unsigned int mode)
11246 basic_fstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11249 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11250 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11251 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
11252 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
11254 TRACE("(%p)\n", this);
11255 return (basic_filebuf_char*)&this->filebuf;
11258 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
11260 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
11263 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11265 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
11268 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11269 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11270 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
11271 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
11273 basic_ios_wchar *basic_ios;
11275 TRACE("(%p %d)\n", this, virt_init);
11277 if(virt_init) {
11278 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11279 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11280 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11281 basic_ios_wchar_ctor(basic_ios);
11282 }else {
11283 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11286 basic_filebuf_wchar_ctor(&this->filebuf);
11287 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11288 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11289 return this;
11292 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11293 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11294 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
11295 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
11297 basic_fstream_wchar_ctor(this, virt_init);
11298 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11299 return this;
11302 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11303 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11304 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
11305 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
11306 FILE *file, MSVCP_bool virt_init)
11308 basic_ios_wchar *basic_ios;
11310 TRACE("(%p %p %d)\n", this, file, virt_init);
11312 if(virt_init) {
11313 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11314 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11315 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11316 basic_ios_wchar_ctor(basic_ios);
11317 }else {
11318 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11321 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11322 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11323 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11324 return this;
11327 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11328 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11329 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
11330 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
11331 FILE *file, MSVCP_bool virt_init)
11333 basic_fstream_wchar_ctor_file(this, file, virt_init);
11334 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11335 return this;
11338 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11339 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11340 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name, 20)
11341 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name(basic_fstream_wchar *this,
11342 const char *name, int mode, int prot, MSVCP_bool virt_init)
11344 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11346 basic_fstream_wchar_ctor(this, virt_init);
11348 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
11349 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11350 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11352 return this;
11355 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11356 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11357 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 20)
11358 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
11359 const char *name, int mode, int prot, MSVCP_bool virt_init)
11361 basic_fstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11362 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11363 return this;
11366 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11367 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11368 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11369 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11370 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_wchar, 20)
11371 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_wchar(basic_fstream_wchar *this,
11372 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11374 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11376 basic_fstream_wchar_ctor(this, virt_init);
11378 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
11379 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11380 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11382 return this;
11385 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11386 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11387 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11388 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11389 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_wchar, 20)
11390 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_wchar(basic_fstream_wchar *this,
11391 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11393 basic_fstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11394 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11395 return this;
11398 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11399 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11400 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11401 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11402 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
11403 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
11405 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11407 TRACE("(%p)\n", this);
11409 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
11410 basic_filebuf_wchar_dtor(&this->filebuf);
11413 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11414 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11415 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11416 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11417 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
11418 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
11420 TRACE("(%p)\n", this);
11422 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
11423 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
11426 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
11427 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11429 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11431 TRACE("(%p %x)\n", this, flags);
11433 if(flags & 2) {
11434 /* we have an array, with the number of elements stored before the first object */
11435 INT_PTR i, *ptr = (INT_PTR *)this-1;
11437 for(i=*ptr-1; i>=0; i--)
11438 basic_fstream_wchar_vbase_dtor(this+i);
11439 MSVCRT_operator_delete(ptr);
11440 } else {
11441 basic_fstream_wchar_vbase_dtor(this);
11442 if(flags & 1)
11443 MSVCRT_operator_delete(this);
11446 return this;
11449 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11450 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11451 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11452 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11453 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
11454 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
11456 TRACE("(%p)\n", this);
11458 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11459 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11460 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11464 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11465 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11466 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11467 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11468 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
11469 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
11471 TRACE("(%p)\n", this);
11472 return basic_filebuf_wchar_is_open(&this->filebuf);
11475 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
11476 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
11477 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
11478 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
11479 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 16)
11480 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
11481 const char *name, int mode, int prot)
11483 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11485 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
11486 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11487 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11491 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
11492 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
11493 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
11494 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
11495 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
11496 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
11497 const char *name, unsigned int mode)
11499 basic_fstream_wchar_open(this, name, mode, _SH_DENYNO);
11502 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11503 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11504 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11505 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11506 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11507 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11508 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11509 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11510 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar, 16)
11511 void __thiscall basic_fstream_wchar_open_wchar(basic_fstream_wchar *this,
11512 const wchar_t *name, int mode, int prot)
11514 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11516 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
11517 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11518 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11522 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11523 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11524 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11525 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11526 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11527 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11528 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11529 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11530 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar_old, 12)
11531 void __thiscall basic_fstream_wchar_open_wchar_old(basic_fstream_wchar *this,
11532 const wchar_t *name, unsigned int mode)
11534 basic_fstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11537 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11538 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11539 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11540 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11541 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
11542 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
11544 TRACE("(%p)\n", this);
11545 return (basic_filebuf_wchar*)&this->filebuf;
11548 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
11550 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
11553 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
11555 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
11558 /* ??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 */
11559 /* ??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 */
11560 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
11561 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
11562 const basic_string_char *str, int mode, MSVCP_bool virt_init)
11564 basic_ios_char *basic_ios;
11566 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11568 if(virt_init) {
11569 this->base.vbtable = basic_ostringstream_char_vbtable;
11570 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11571 basic_ios_char_ctor(basic_ios);
11572 }else {
11573 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11576 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
11577 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11578 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
11579 return this;
11582 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
11583 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
11584 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
11585 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
11586 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
11588 basic_ios_char *basic_ios;
11590 TRACE("(%p %d %d)\n", this, mode, virt_init);
11592 if(virt_init) {
11593 this->base.vbtable = basic_ostringstream_char_vbtable;
11594 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11595 basic_ios_char_ctor(basic_ios);
11596 }else {
11597 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11600 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
11601 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11602 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
11603 return this;
11606 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11607 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11608 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
11609 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
11610 basic_ostringstream_char *this)
11612 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
11615 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
11616 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
11617 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
11618 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
11620 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
11622 TRACE("(%p)\n", this);
11624 basic_stringbuf_char_dtor(&this->strbuf);
11625 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
11628 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11629 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11630 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
11631 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
11633 TRACE("(%p)\n", this);
11635 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
11636 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
11639 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
11640 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11642 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
11644 TRACE("(%p %x)\n", this, flags);
11646 if(flags & 2) {
11647 /* we have an array, with the number of elements stored before the first object */
11648 INT_PTR i, *ptr = (INT_PTR *)this-1;
11650 for(i=*ptr-1; i>=0; i--)
11651 basic_ostringstream_char_vbase_dtor(this+i);
11652 MSVCRT_operator_delete(ptr);
11653 } else {
11654 basic_ostringstream_char_vbase_dtor(this);
11655 if(flags & 1)
11656 MSVCRT_operator_delete(this);
11659 return this;
11662 /* ?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 */
11663 /* ?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 */
11664 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
11665 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
11667 TRACE("(%p)\n", this);
11668 return (basic_stringbuf_char*)&this->strbuf;
11671 /* ?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 */
11672 /* ?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 */
11673 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
11674 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
11676 TRACE("(%p %p)\n", this, str);
11677 basic_stringbuf_char_str_set(&this->strbuf, str);
11680 /* ?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 */
11681 /* ?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 */
11682 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
11683 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
11685 TRACE("(%p %p)\n", this, ret);
11686 return basic_stringbuf_char_str_get(&this->strbuf, ret);
11689 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
11691 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
11694 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11696 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
11699 /* ??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 */
11700 /* ??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 */
11701 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
11702 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
11703 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11705 basic_ios_wchar *basic_ios;
11707 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11709 if(virt_init) {
11710 this->base.vbtable = basic_ostringstream_wchar_vbtable;
11711 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11712 basic_ios_wchar_ctor(basic_ios);
11713 }else {
11714 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11717 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
11718 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11719 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
11720 return this;
11723 /* ??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 */
11724 /* ??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 */
11725 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
11726 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
11727 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11729 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
11730 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
11731 return this;
11734 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
11735 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
11736 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
11737 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
11738 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
11740 basic_ios_wchar *basic_ios;
11742 TRACE("(%p %d %d)\n", this, mode, virt_init);
11744 if(virt_init) {
11745 this->base.vbtable = basic_ostringstream_wchar_vbtable;
11746 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11747 basic_ios_wchar_ctor(basic_ios);
11748 }else {
11749 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11752 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
11753 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11754 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
11755 return this;
11758 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
11759 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
11760 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
11761 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
11762 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
11764 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
11765 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
11766 return this;
11769 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
11770 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
11771 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
11772 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
11773 basic_ostringstream_wchar *this)
11775 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
11778 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11779 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11780 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
11781 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
11782 basic_ostringstream_wchar *this)
11784 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
11787 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
11788 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
11789 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
11790 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
11791 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
11792 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
11794 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
11796 TRACE("(%p)\n", this);
11798 basic_stringbuf_wchar_dtor(&this->strbuf);
11799 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11802 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
11803 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
11804 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11805 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11806 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
11807 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
11809 TRACE("(%p)\n", this);
11811 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
11812 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
11815 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
11816 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11818 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
11820 TRACE("(%p %x)\n", this, flags);
11822 if(flags & 2) {
11823 /* we have an array, with the number of elements stored before the first object */
11824 INT_PTR i, *ptr = (INT_PTR *)this-1;
11826 for(i=*ptr-1; i>=0; i--)
11827 basic_ostringstream_wchar_vbase_dtor(this+i);
11828 MSVCRT_operator_delete(ptr);
11829 } else {
11830 basic_ostringstream_wchar_vbase_dtor(this);
11831 if(flags & 1)
11832 MSVCRT_operator_delete(this);
11835 return this;
11838 /* ?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 */
11839 /* ?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 */
11840 /* ?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 */
11841 /* ?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 */
11842 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
11843 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
11845 TRACE("(%p)\n", this);
11846 return (basic_stringbuf_wchar*)&this->strbuf;
11849 /* ?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 */
11850 /* ?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 */
11851 /* ?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 */
11852 /* ?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 */
11853 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
11854 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
11856 TRACE("(%p %p)\n", this, str);
11857 basic_stringbuf_wchar_str_set(&this->strbuf, str);
11860 /* ?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 */
11861 /* ?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 */
11862 /* ?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 */
11863 /* ?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 */
11864 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
11865 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
11867 TRACE("(%p %p)\n", this, ret);
11868 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
11871 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
11873 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
11876 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
11878 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
11881 /* ??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 */
11882 /* ??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 */
11883 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
11884 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
11885 const basic_string_char *str, int mode, MSVCP_bool virt_init)
11887 basic_ios_char *basic_ios;
11889 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11891 if(virt_init) {
11892 this->base.vbtable = basic_istringstream_char_vbtable;
11893 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11894 basic_ios_char_ctor(basic_ios);
11895 }else {
11896 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11899 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
11900 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11901 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
11902 return this;
11905 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
11906 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
11907 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
11908 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
11909 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
11911 basic_ios_char *basic_ios;
11913 TRACE("(%p %d %d)\n", this, mode, virt_init);
11915 if(virt_init) {
11916 this->base.vbtable = basic_istringstream_char_vbtable;
11917 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11918 basic_ios_char_ctor(basic_ios);
11919 }else {
11920 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11923 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
11924 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11925 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
11926 return this;
11929 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11930 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11931 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
11932 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
11933 basic_istringstream_char *this)
11935 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
11938 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
11939 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
11940 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
11941 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
11943 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
11945 TRACE("(%p)\n", this);
11947 basic_stringbuf_char_dtor(&this->strbuf);
11948 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11951 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11952 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11953 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
11954 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
11956 TRACE("(%p)\n", this);
11958 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
11959 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11962 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
11963 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11965 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
11967 TRACE("(%p %x)\n", this, flags);
11969 if(flags & 2) {
11970 /* we have an array, with the number of elements stored before the first object */
11971 INT_PTR i, *ptr = (INT_PTR *)this-1;
11973 for(i=*ptr-1; i>=0; i--)
11974 basic_istringstream_char_vbase_dtor(this+i);
11975 MSVCRT_operator_delete(ptr);
11976 } else {
11977 basic_istringstream_char_vbase_dtor(this);
11978 if(flags & 1)
11979 MSVCRT_operator_delete(this);
11982 return this;
11985 /* ?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 */
11986 /* ?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 */
11987 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
11988 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
11990 TRACE("(%p)\n", this);
11991 return (basic_stringbuf_char*)&this->strbuf;
11994 /* ?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 */
11995 /* ?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 */
11996 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
11997 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
11999 TRACE("(%p %p)\n", this, str);
12000 basic_stringbuf_char_str_set(&this->strbuf, str);
12003 /* ?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 */
12004 /* ?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 */
12005 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
12006 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
12008 TRACE("(%p %p)\n", this, ret);
12009 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12012 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
12014 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
12017 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12019 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
12022 /* ??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 */
12023 /* ??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 */
12024 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
12025 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
12026 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12028 basic_ios_wchar *basic_ios;
12030 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12032 if(virt_init) {
12033 this->base.vbtable = basic_istringstream_wchar_vbtable;
12034 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12035 basic_ios_wchar_ctor(basic_ios);
12036 }else {
12037 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12040 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12041 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12042 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12043 return this;
12046 /* ??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 */
12047 /* ??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 */
12048 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
12049 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
12050 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12052 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
12053 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12054 return this;
12057 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12058 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12059 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
12060 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
12061 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12063 basic_ios_wchar *basic_ios;
12065 TRACE("(%p %d %d)\n", this, mode, virt_init);
12067 if(virt_init) {
12068 this->base.vbtable = basic_istringstream_wchar_vbtable;
12069 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12070 basic_ios_wchar_ctor(basic_ios);
12071 }else {
12072 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12075 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12076 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12077 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12078 return this;
12081 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12082 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12083 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
12084 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
12085 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12087 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
12088 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12089 return this;
12092 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12093 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12094 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
12095 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
12096 basic_istringstream_wchar *this)
12098 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
12101 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12102 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12103 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
12104 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
12105 basic_istringstream_wchar *this)
12107 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
12110 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12111 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12112 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12113 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12114 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
12115 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
12117 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12119 TRACE("(%p)\n", this);
12121 basic_stringbuf_wchar_dtor(&this->strbuf);
12122 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12125 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12126 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12127 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12128 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12129 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
12130 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
12132 TRACE("(%p)\n", this);
12134 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
12135 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
12138 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
12139 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12141 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12143 TRACE("(%p %x)\n", this, flags);
12145 if(flags & 2) {
12146 /* we have an array, with the number of elements stored before the first object */
12147 INT_PTR i, *ptr = (INT_PTR *)this-1;
12149 for(i=*ptr-1; i>=0; i--)
12150 basic_istringstream_wchar_vbase_dtor(this+i);
12151 MSVCRT_operator_delete(ptr);
12152 } else {
12153 basic_istringstream_wchar_vbase_dtor(this);
12154 if(flags & 1)
12155 MSVCRT_operator_delete(this);
12158 return this;
12161 /* ?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 */
12162 /* ?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 */
12163 /* ?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 */
12164 /* ?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 */
12165 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
12166 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
12168 TRACE("(%p)\n", this);
12169 return (basic_stringbuf_wchar*)&this->strbuf;
12172 /* ?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 */
12173 /* ?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 */
12174 /* ?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 */
12175 /* ?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 */
12176 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
12177 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
12179 TRACE("(%p %p)\n", this, str);
12180 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12183 /* ?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 */
12184 /* ?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 */
12185 /* ?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 */
12186 /* ?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 */
12187 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
12188 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
12190 TRACE("(%p %p)\n", this, ret);
12191 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12194 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
12196 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
12199 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
12201 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
12204 /* ??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 */
12205 /* ??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 */
12206 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
12207 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
12208 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12210 basic_ios_char *basic_ios;
12212 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12214 if(virt_init) {
12215 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12216 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12217 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12218 basic_ios_char_ctor(basic_ios);
12219 }else {
12220 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12223 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
12224 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12225 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12226 return this;
12229 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12230 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12231 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
12232 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
12233 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
12235 basic_ios_char *basic_ios;
12237 TRACE("(%p %d %d)\n", this, mode, virt_init);
12239 if(virt_init) {
12240 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12241 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12242 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12243 basic_ios_char_ctor(basic_ios);
12244 }else {
12245 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12248 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
12249 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12250 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12251 return this;
12254 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12255 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12256 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
12257 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
12258 basic_stringstream_char *this)
12260 return basic_stringstream_char_ctor_mode(
12261 this, OPENMODE_out|OPENMODE_in, TRUE);
12264 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12265 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12266 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
12267 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
12269 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12271 TRACE("(%p)\n", this);
12273 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12274 basic_stringbuf_char_dtor(&this->strbuf);
12277 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12278 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12279 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
12280 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
12282 TRACE("(%p)\n", this);
12284 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
12285 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
12288 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
12289 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12291 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12293 TRACE("(%p %x)\n", this, flags);
12295 if(flags & 2) {
12296 /* we have an array, with the number of elements stored before the first object */
12297 INT_PTR i, *ptr = (INT_PTR *)this-1;
12299 for(i=*ptr-1; i>=0; i--)
12300 basic_stringstream_char_vbase_dtor(this+i);
12301 MSVCRT_operator_delete(ptr);
12302 } else {
12303 basic_stringstream_char_vbase_dtor(this);
12304 if(flags & 1)
12305 MSVCRT_operator_delete(this);
12308 return this;
12311 /* ?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 */
12312 /* ?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 */
12313 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
12314 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
12316 TRACE("(%p)\n", this);
12317 return (basic_stringbuf_char*)&this->strbuf;
12320 /* ?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 */
12321 /* ?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 */
12322 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
12323 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
12325 TRACE("(%p %p)\n", this, str);
12326 basic_stringbuf_char_str_set(&this->strbuf, str);
12329 /* ?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 */
12330 /* ?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 */
12331 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
12332 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
12334 TRACE("(%p %p)\n", this, ret);
12335 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12338 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
12340 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
12343 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12345 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
12348 /* ??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 */
12349 /* ??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 */
12350 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
12351 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
12352 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12354 basic_ios_wchar *basic_ios;
12356 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12358 if(virt_init) {
12359 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12360 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12361 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12362 basic_ios_wchar_ctor(basic_ios);
12363 }else {
12364 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12367 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
12368 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12369 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12370 return this;
12373 /* ??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 */
12374 /* ??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 */
12375 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
12376 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
12377 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12379 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
12380 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12381 return this;
12384 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12385 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12386 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
12387 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
12388 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
12390 basic_ios_wchar *basic_ios;
12392 TRACE("(%p %d %d)\n", this, mode, virt_init);
12394 if(virt_init) {
12395 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12396 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12397 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12398 basic_ios_wchar_ctor(basic_ios);
12399 }else {
12400 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12403 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
12404 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12405 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12406 return this;
12409 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12410 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12411 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
12412 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
12413 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
12415 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
12416 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12417 return this;
12420 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12421 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12422 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
12423 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
12424 basic_stringstream_wchar *this)
12426 return basic_stringstream_wchar_ctor_mode(
12427 this, OPENMODE_out|OPENMODE_in, TRUE);
12430 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12431 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12432 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
12433 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
12434 basic_stringstream_wchar *this)
12436 return basic_stringstream_short_ctor_mode(
12437 this, OPENMODE_out|OPENMODE_in, TRUE);
12440 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12441 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12442 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12443 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12444 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
12445 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
12447 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
12449 TRACE("(%p)\n", this);
12451 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
12452 basic_stringbuf_wchar_dtor(&this->strbuf);
12455 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12456 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12457 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12458 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12459 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
12460 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
12462 TRACE("(%p)\n", this);
12464 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
12465 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
12468 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
12469 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12471 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
12473 TRACE("(%p %x)\n", this, flags);
12475 if(flags & 2) {
12476 /* we have an array, with the number of elements stored before the first object */
12477 INT_PTR i, *ptr = (INT_PTR *)this-1;
12479 for(i=*ptr-1; i>=0; i--)
12480 basic_stringstream_wchar_vbase_dtor(this+i);
12481 MSVCRT_operator_delete(ptr);
12482 } else {
12483 basic_stringstream_wchar_vbase_dtor(this);
12484 if(flags & 1)
12485 MSVCRT_operator_delete(this);
12488 return this;
12491 /* ?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 */
12492 /* ?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 */
12493 /* ?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 */
12494 /* ?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 */
12495 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
12496 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
12498 TRACE("(%p)\n", this);
12499 return (basic_stringbuf_wchar*)&this->strbuf;
12502 /* ?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 */
12503 /* ?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 */
12504 /* ?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 */
12505 /* ?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 */
12506 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
12507 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
12509 TRACE("(%p %p)\n", this, str);
12510 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12513 /* ?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 */
12514 /* ?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 */
12515 /* ?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 */
12516 /* ?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 */
12517 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
12518 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
12520 TRACE("(%p %p)\n", this, ret);
12521 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12524 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
12525 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
12526 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
12527 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
12529 TRACE("(%p %ld %p %p %d)\n", this, len, g, p, mode);
12531 this->minsize = 32;
12532 this->endsave = NULL;
12533 this->strmode = mode;
12534 this->palloc = NULL;
12535 this->pfree = NULL;
12537 if(!g) {
12538 this->strmode |= STRSTATE_Dynamic;
12539 if(len > this->minsize)
12540 this->minsize = len;
12541 this->seekhigh = NULL;
12542 return;
12545 if(len < 0)
12546 len = INT_MAX;
12547 else if(!len)
12548 len = strlen(g);
12550 this->seekhigh = g+len;
12551 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
12552 if(p)
12553 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
12556 /* ??0strstreambuf@std@@QAE@PACH0@Z */
12557 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
12558 /* ??0strstreambuf@std@@QAE@PADH0@Z */
12559 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
12560 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
12561 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
12562 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
12563 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
12565 TRACE("(%p %p %ld %p)\n", this, g, len, p);
12567 basic_streambuf_char_ctor(&this->base);
12568 this->base.vtable = &MSVCP_strstreambuf_vtable;
12570 strstreambuf__Init(this, len, g, p, 0);
12571 return this;
12574 /* ??0strstreambuf@std@@QAE@H@Z */
12575 /* ??0strstreambuf@std@@QEAA@_J@Z */
12576 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
12577 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
12579 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
12582 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
12583 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
12584 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
12585 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(MSVCP_size_t), void (__cdecl *pfree)(void*))
12587 TRACE("(%p %p %p)\n", this, palloc, pfree);
12589 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
12590 this->palloc = palloc;
12591 this->pfree = pfree;
12592 return this;
12595 /* ??0strstreambuf@std@@QAE@PBCH@Z */
12596 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
12597 /* ??0strstreambuf@std@@QAE@PBDH@Z */
12598 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
12599 /* ??0strstreambuf@std@@QAE@PBEH@Z */
12600 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
12601 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
12602 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
12604 TRACE("(%p %p %ld)\n", this, g, len);
12606 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
12607 this->strmode |= STRSTATE_Constant;
12608 return this;
12611 /* ??_Fstrstreambuf@std@@QAEXXZ */
12612 /* ??_Fstrstreambuf@std@@QEAAXXZ */
12613 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
12614 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
12616 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
12619 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
12620 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
12621 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
12622 void __thiscall strstreambuf__Tidy(strstreambuf *this)
12624 TRACE("(%p)\n", this);
12626 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
12627 if(this->pfree)
12628 this->pfree(basic_streambuf_char_eback(&this->base));
12629 else
12630 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
12633 this->endsave = NULL;
12634 this->seekhigh = NULL;
12635 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
12636 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
12637 basic_streambuf_char_setp(&this->base, NULL, NULL);
12640 /* ??1strstreambuf@std@@UAE@XZ */
12641 /* ??1strstreambuf@std@@UEAA@XZ */
12642 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
12643 void __thiscall strstreambuf_dtor(strstreambuf *this)
12645 TRACE("(%p)\n", this);
12647 strstreambuf__Tidy(this);
12648 basic_streambuf_char_dtor(&this->base);
12651 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
12652 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
12654 TRACE("(%p %x)\n", this, flags);
12655 if(flags & 2) {
12656 /* we have an array, with the number of elements stored before the first object */
12657 INT_PTR i, *ptr = (INT_PTR *)this-1;
12659 for(i=*ptr-1; i>=0; i--)
12660 strstreambuf_dtor(this+i);
12661 MSVCRT_operator_delete(ptr);
12662 } else {
12663 strstreambuf_dtor(this);
12664 if(flags & 1)
12665 MSVCRT_operator_delete(this);
12668 return this;
12671 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
12672 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
12673 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
12674 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
12676 TRACE("(%p %d)\n", this, freeze);
12678 if(!freeze == !(this->strmode *STRSTATE_Frozen))
12679 return;
12681 if(freeze) {
12682 this->strmode |= STRSTATE_Frozen;
12683 this->endsave = basic_streambuf_char_epptr(&this->base);
12684 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
12685 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
12686 }else {
12687 this->strmode &= ~STRSTATE_Frozen;
12688 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
12689 basic_streambuf_char_pptr(&this->base), this->endsave);
12693 /* ?str@strstreambuf@std@@QAEPADXZ */
12694 /* ?str@strstreambuf@std@@QEAAPEADXZ */
12695 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
12696 char* __thiscall strstreambuf_str(strstreambuf *this)
12698 TRACE("(%p)\n", this);
12700 strstreambuf_freeze(this, TRUE);
12701 return basic_streambuf_char_gptr(&this->base);
12704 /* ?pcount@strstreambuf@std@@QBEHXZ */
12705 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
12706 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
12707 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
12709 char *ppos = basic_streambuf_char_pptr(&this->base);
12711 TRACE("(%p)\n", this);
12713 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
12716 /* ?overflow@strstreambuf@std@@MAEHH@Z */
12717 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
12718 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
12719 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
12721 MSVCP_size_t old_size, size;
12722 char *ptr, *buf;
12724 TRACE("(%p %d)\n", this, c);
12726 if(c == EOF)
12727 return !EOF;
12729 if(this->strmode & STRSTATE_Frozen)
12730 return EOF;
12732 ptr = basic_streambuf_char_pptr(&this->base);
12733 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
12734 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
12736 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
12737 return EOF;
12739 ptr = basic_streambuf_char_eback(&this->base);
12740 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
12742 size = old_size + old_size/2;
12743 if(size < this->minsize)
12744 size = this->minsize;
12746 if(this->palloc)
12747 buf = this->palloc(size);
12748 else
12749 buf = MSVCRT_operator_new(size);
12750 if(!buf)
12751 return EOF;
12753 memcpy(buf, ptr, old_size);
12754 if(this->strmode & STRSTATE_Allocated) {
12755 if(this->pfree)
12756 this->pfree(ptr);
12757 else
12758 MSVCRT_operator_delete(ptr);
12761 this->strmode |= STRSTATE_Allocated;
12762 if(!old_size) {
12763 this->seekhigh = buf;
12764 basic_streambuf_char_setp(&this->base, buf, buf+size);
12765 basic_streambuf_char_setg(&this->base, buf, buf, buf);
12766 }else {
12767 this->seekhigh = this->seekhigh-ptr+buf;
12768 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
12769 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
12770 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
12771 basic_streambuf_char_pptr(&this->base));
12774 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
12777 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
12778 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
12779 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
12780 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
12782 char *ptr = basic_streambuf_char_gptr(&this->base);
12784 TRACE("(%p %d)\n", this, c);
12786 if(ptr<=basic_streambuf_char_eback(&this->base)
12787 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
12788 return EOF;
12790 basic_streambuf_char_gbump(&this->base, -1);
12791 if(c == EOF)
12792 return !EOF;
12793 if(this->strmode & STRSTATE_Constant)
12794 return (unsigned char)c;
12796 return (unsigned char)(ptr[0] = c);
12799 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
12800 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
12801 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
12802 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
12804 char *eback = basic_streambuf_char_eback(&this->base);
12805 char *pptr = basic_streambuf_char_pptr(&this->base);
12806 char *gptr = basic_streambuf_char_gptr(&this->base);
12808 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
12810 ret->off = 0;
12811 ret->state = 0;
12813 if(pptr > this->seekhigh)
12814 this->seekhigh = pptr;
12816 if((mode & OPENMODE_in) && gptr) {
12817 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
12818 off += gptr-eback;
12819 else if(way == SEEKDIR_end)
12820 off += this->seekhigh-eback;
12821 else if(way != SEEKDIR_beg)
12822 off = -1;
12824 if(off<0 || off>this->seekhigh-eback) {
12825 off = -1;
12826 }else {
12827 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
12828 if((mode & OPENMODE_out) && pptr) {
12829 basic_streambuf_char_setp_next(&this->base, eback,
12830 gptr, basic_streambuf_char_epptr(&this->base));
12833 }else if((mode & OPENMODE_out) && pptr) {
12834 if(way == SEEKDIR_cur)
12835 off += pptr-eback;
12836 else if(way == SEEKDIR_end)
12837 off += this->seekhigh-eback;
12838 else if(way != SEEKDIR_beg)
12839 off = -1;
12841 if(off<0 || off>this->seekhigh-eback)
12842 off = -1;
12843 else
12844 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
12845 }else {
12846 off = -1;
12849 ret->pos = off;
12850 return ret;
12853 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
12854 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
12855 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
12856 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
12858 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
12860 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
12861 *ret = pos;
12862 return ret;
12865 return strstreambuf_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
12868 /* ?underflow@strstreambuf@std@@MAEHXZ */
12869 /* ?underflow@strstreambuf@std@@MEAAHXZ */
12870 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
12871 int __thiscall strstreambuf_underflow(strstreambuf *this)
12873 char *gptr = basic_streambuf_char_gptr(&this->base);
12874 char *pptr;
12876 TRACE("(%p)\n", this);
12878 if(!gptr)
12879 return EOF;
12881 if(gptr < basic_streambuf_char_egptr(&this->base))
12882 return (unsigned char)(*gptr);
12884 pptr = basic_streambuf_char_gptr(&this->base);
12885 if(pptr > this->seekhigh)
12886 this->seekhigh = pptr;
12888 if(this->seekhigh <= gptr)
12889 return EOF;
12891 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
12892 gptr, this->seekhigh);
12893 return (unsigned char)(*gptr);
12896 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
12898 ios_base_precision_set(base, prec);
12901 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
12902 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
12903 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
12905 TRACE("(%p %ld)\n", ret, prec);
12907 ret->pfunc = setprecision_func;
12908 ret->arg = prec;
12909 return ret;
12912 static void __cdecl setw_func(ios_base *base, streamsize width)
12914 ios_base_width_set(base, width);
12917 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
12918 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
12919 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
12921 TRACE("(%p %ld)\n", ret, width);
12923 ret->pfunc = setw_func;
12924 ret->arg = width;
12925 return ret;
12928 static void __cdecl resetioflags_func(ios_base *base, int mask)
12930 ios_base_setf_mask(base, 0, mask);
12933 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
12934 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
12936 TRACE("(%p %d)\n", ret, mask);
12938 ret->pfunc = resetioflags_func;
12939 ret->arg = mask;
12940 return ret;
12943 static void __cdecl setiosflags_func(ios_base *base, int mask)
12945 ios_base_setf_mask(base, FMTFLAG_mask, mask);
12948 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
12949 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
12951 TRACE("(%p %d)\n", ret, mask);
12953 ret->pfunc = setiosflags_func;
12954 ret->arg = mask;
12955 return ret;
12958 static void __cdecl setbase_func(ios_base *base, int set_base)
12960 if(set_base == 10)
12961 set_base = FMTFLAG_dec;
12962 else if(set_base == 8)
12963 set_base = FMTFLAG_oct;
12964 else if(set_base == 16)
12965 set_base = FMTFLAG_hex;
12966 else
12967 set_base = 0;
12969 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
12972 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
12973 manip_int* __cdecl setbase(manip_int *ret, int base)
12975 TRACE("(%p %d)\n", ret, base);
12977 ret->pfunc = setbase_func;
12978 ret->arg = base;
12979 return ret;
12982 static basic_filebuf_char filebuf_char_stdin;
12983 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
12984 struct {
12985 basic_istream_char obj;
12986 basic_ios_char vbase;
12987 } cin = { { 0 } };
12988 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
12989 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
12990 basic_istream_char *_Ptr_cin = &cin.obj;
12992 static basic_filebuf_wchar filebuf_short_stdin;
12993 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
12994 struct {
12995 basic_istream_wchar obj;
12996 basic_ios_wchar vbase;
12997 } ucin = { { 0 } };
12998 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
12999 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
13000 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
13002 static basic_filebuf_wchar filebuf_wchar_stdin;
13003 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13004 struct {
13005 basic_istream_wchar obj;
13006 basic_ios_wchar vbase;
13007 } wcin = { { 0 } };
13008 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13009 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
13010 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
13012 static basic_filebuf_char filebuf_char_stdout;
13013 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13014 struct {
13015 basic_ostream_char obj;
13016 basic_ios_char vbase;
13017 } cout = { { 0 } };
13018 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13019 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13020 basic_ostream_char *_Ptr_cout = &cout.obj;
13022 static basic_filebuf_wchar filebuf_short_stdout;
13023 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13024 struct {
13025 basic_ostream_wchar obj;
13026 basic_ios_wchar vbase;
13027 } ucout = { { 0 } };
13028 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13029 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13030 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
13032 static basic_filebuf_wchar filebuf_wchar_stdout;
13033 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13034 struct {
13035 basic_ostream_wchar obj;
13036 basic_ios_wchar vbase;
13037 } wcout = { { 0 } };
13038 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13039 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13040 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
13042 static basic_filebuf_char filebuf_char_stderr;
13043 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13044 struct {
13045 basic_ostream_char obj;
13046 basic_ios_char vbase;
13047 } cerr = { { 0 } };
13048 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13049 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13050 basic_ostream_char *_Ptr_cerr = &cerr.obj;
13052 static basic_filebuf_wchar filebuf_short_stderr;
13053 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13054 struct {
13055 basic_ostream_wchar obj;
13056 basic_ios_wchar vbase;
13057 } ucerr = { { 0 } };
13058 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13059 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13060 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
13062 static basic_filebuf_wchar filebuf_wchar_stderr;
13063 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13064 struct {
13065 basic_ostream_wchar obj;
13066 basic_ios_wchar vbase;
13067 } wcerr = { { 0 } };
13068 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13069 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13070 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
13072 static basic_filebuf_char filebuf_char_log;
13073 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13074 struct {
13075 basic_ostream_char obj;
13076 basic_ios_char vbase;
13077 } clog = { { 0 } };
13078 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13079 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13080 basic_ostream_char *_Ptr_clog = &clog.obj;
13082 static basic_filebuf_wchar filebuf_short_log;
13083 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13084 struct {
13085 basic_ostream_wchar obj;
13086 basic_ios_wchar vbase;
13087 } uclog = { { 0 } };
13088 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13089 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13090 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
13092 static basic_filebuf_wchar filebuf_wchar_log;
13093 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13094 struct {
13095 basic_ostream_wchar obj;
13096 basic_ios_wchar vbase;
13097 } wclog = { { 0 } };
13098 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13099 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13100 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
13102 /* ?_Init_cnt@Init@ios_base@std@@0HA */
13103 int ios_base_Init__Init_cnt = -1;
13105 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
13106 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
13107 int* __cdecl ios_base_Init__Init_cnt_func(void)
13109 return &ios_base_Init__Init_cnt;
13112 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
13113 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
13114 void __cdecl ios_base_Init__Init_ctor(void *this)
13116 TRACE("(%p)\n", this);
13118 if(ios_base_Init__Init_cnt < 0)
13119 ios_base_Init__Init_cnt = 1;
13120 else
13121 ios_base_Init__Init_cnt++;
13124 /* ??0Init@ios_base@std@@QAE@XZ */
13125 /* ??0Init@ios_base@std@@QEAA@XZ */
13126 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
13127 void* __thiscall ios_base_Init_ctor(void *this)
13129 ios_base_Init__Init_ctor(this);
13130 return this;
13133 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
13134 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
13135 void __cdecl ios_base_Init__Init_dtor(void *this)
13137 TRACE("(%p)\n", this);
13139 ios_base_Init__Init_cnt--;
13140 if(!ios_base_Init__Init_cnt) {
13141 basic_ostream_char_flush(&cout.obj);
13142 basic_ostream_char_flush(&cerr.obj);
13143 basic_ostream_char_flush(&clog.obj);
13147 /* ??1Init@ios_base@std@@QAE@XZ */
13148 /* ??1Init@ios_base@std@@QEAA@XZ */
13149 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
13150 void __thiscall ios_base_Init_dtor(void *this)
13152 ios_base_Init__Init_dtor(this);
13155 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
13156 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
13157 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
13158 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
13160 TRACE("(%p %p)\n", this, rhs);
13161 return this;
13164 /* ?_Init_cnt@_Winit@std@@0HA */
13165 int _Winit__Init_cnt = -1;
13167 /* ??0_Winit@std@@QAE@XZ */
13168 /* ??0_Winit@std@@QEAA@XZ */
13169 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
13170 void* __thiscall _Winit_ctor(void *this)
13172 TRACE("(%p)\n", this);
13174 if(_Winit__Init_cnt < 0)
13175 _Winit__Init_cnt = 1;
13176 else
13177 _Winit__Init_cnt++;
13179 return this;
13182 /* ??1_Winit@std@@QAE@XZ */
13183 /* ??1_Winit@std@@QAE@XZ */
13184 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
13185 void __thiscall _Winit_dtor(void *this)
13187 TRACE("(%p)\n", this);
13189 _Winit__Init_cnt--;
13190 if(!_Winit__Init_cnt) {
13191 basic_ostream_wchar_flush(&wcout.obj);
13192 basic_ostream_wchar_flush(&wcerr.obj);
13193 basic_ostream_wchar_flush(&wclog.obj);
13197 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
13198 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
13199 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
13200 void* __thiscall _Winit_op_assign(void *this, void *rhs)
13202 TRACE("(%p %p)\n", this, rhs);
13203 return this;
13206 void init_io(void *base)
13208 #ifdef __x86_64__
13209 init_iosb_rtti(base);
13210 init_ios_base_rtti(base);
13211 init_basic_ios_char_rtti(base);
13212 init_basic_ios_wchar_rtti(base);
13213 init_basic_ios_short_rtti(base);
13214 init_basic_streambuf_char_rtti(base);
13215 init_basic_streambuf_wchar_rtti(base);
13216 init_basic_streambuf_short_rtti(base);
13217 init_basic_filebuf_char_rtti(base);
13218 init_basic_filebuf_wchar_rtti(base);
13219 init_basic_filebuf_short_rtti(base);
13220 init_basic_stringbuf_char_rtti(base);
13221 init_basic_stringbuf_wchar_rtti(base);
13222 init_basic_stringbuf_short_rtti(base);
13223 init_basic_ostream_char_rtti(base);
13224 init_basic_ostream_wchar_rtti(base);
13225 init_basic_ostream_short_rtti(base);
13226 init_basic_istream_char_rtti(base);
13227 init_basic_istream_wchar_rtti(base);
13228 init_basic_istream_short_rtti(base);
13229 init_basic_iostream_char_rtti(base);
13230 init_basic_iostream_wchar_rtti(base);
13231 init_basic_iostream_short_rtti(base);
13232 init_basic_ofstream_char_rtti(base);
13233 init_basic_ofstream_wchar_rtti(base);
13234 init_basic_ofstream_short_rtti(base);
13235 init_basic_ifstream_char_rtti(base);
13236 init_basic_ifstream_wchar_rtti(base);
13237 init_basic_ifstream_short_rtti(base);
13238 init_basic_fstream_char_rtti(base);
13239 init_basic_fstream_wchar_rtti(base);
13240 init_basic_fstream_short_rtti(base);
13241 init_basic_ostringstream_char_rtti(base);
13242 init_basic_ostringstream_wchar_rtti(base);
13243 init_basic_ostringstream_short_rtti(base);
13244 init_basic_istringstream_char_rtti(base);
13245 init_basic_istringstream_wchar_rtti(base);
13246 init_basic_istringstream_short_rtti(base);
13247 init_basic_stringstream_char_rtti(base);
13248 init_basic_stringstream_wchar_rtti(base);
13249 init_basic_stringstream_short_rtti(base);
13250 init_strstreambuf_rtti(base);
13251 #endif
13253 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
13254 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
13256 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
13257 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
13259 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
13260 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
13262 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
13263 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE);
13265 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
13266 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE);
13268 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
13269 basic_ostream_wchar_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE);
13271 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
13272 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE);
13274 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
13275 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE);
13277 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
13278 basic_ostream_wchar_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE);
13280 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
13281 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE);
13283 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
13284 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE);
13286 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
13287 basic_ostream_wchar_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE);
13290 void free_io(void)
13292 basic_istream_char_vbase_dtor(&cin.obj);
13293 basic_filebuf_char_dtor(&filebuf_char_stdin);
13295 basic_istream_wchar_vbase_dtor(&ucin.obj);
13296 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
13298 basic_istream_wchar_vbase_dtor(&wcin.obj);
13299 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
13301 basic_ostream_char_vbase_dtor(&cout.obj);
13302 basic_filebuf_char_dtor(&filebuf_char_stdout);
13304 basic_ostream_wchar_vbase_dtor(&ucout.obj);
13305 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
13307 basic_ostream_wchar_vbase_dtor(&wcout.obj);
13308 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
13310 basic_ostream_char_vbase_dtor(&cerr.obj);
13311 basic_filebuf_char_dtor(&filebuf_char_stderr);
13313 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
13314 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
13316 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
13317 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
13319 basic_ostream_char_vbase_dtor(&clog.obj);
13320 basic_filebuf_char_dtor(&filebuf_char_log);
13322 basic_ostream_wchar_vbase_dtor(&uclog.obj);
13323 basic_filebuf_wchar_dtor(&filebuf_short_log);
13325 basic_ostream_wchar_vbase_dtor(&wclog.obj);
13326 basic_filebuf_wchar_dtor(&filebuf_wchar_log);