ntdll/tests: Get rid of "defined but not used" warnings on non-x86(_64) platforms.
[wine.git] / dlls / msvcp90 / ios.c
blobb7588870278865440f882a2966ac29d8b5eb57bd
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 "msvcp90.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(%s %s %d)", wine_dbgstr_longlong(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 #if _MSVCP_VER < 80
68 int state0;
69 char putback;
70 basic_string_char *conv;
71 #else
72 char putback;
73 #endif
74 MSVCP_bool wrotesome;
75 int state;
76 MSVCP_bool close;
77 FILE *file;
78 } basic_filebuf_char;
80 typedef struct {
81 basic_streambuf_wchar base;
82 codecvt_wchar *cvt;
83 #if _MSVCP_VER < 80
84 int state0;
85 wchar_t putback;
86 basic_string_char *conv;
87 #else
88 wchar_t putback;
89 #endif
90 MSVCP_bool wrotesome;
91 int state;
92 MSVCP_bool close;
93 FILE *file;
94 } basic_filebuf_wchar;
96 typedef enum {
97 STRINGBUF_allocated = 1,
98 STRINGBUF_no_write = 2,
99 STRINGBUF_no_read = 4,
100 STRINGBUF_append = 8,
101 STRINGBUF_at_end = 16
102 } basic_stringbuf_state;
104 typedef struct {
105 basic_streambuf_char base;
106 char *seekhigh;
107 int state;
108 char allocator; /* empty struct */
109 } basic_stringbuf_char;
111 typedef struct {
112 basic_streambuf_wchar base;
113 wchar_t *seekhigh;
114 int state;
115 char allocator; /* empty struct */
116 } basic_stringbuf_wchar;
118 typedef struct {
119 ios_base base;
120 basic_streambuf_char *strbuf;
121 struct _basic_ostream_char *stream;
122 char fillch;
123 } basic_ios_char;
125 typedef struct {
126 ios_base base;
127 basic_streambuf_wchar *strbuf;
128 struct _basic_ostream_wchar *stream;
129 wchar_t fillch;
130 } basic_ios_wchar;
132 typedef struct _basic_ostream_char {
133 const int *vbtable;
134 /* virtual inheritance
135 * basic_ios_char basic_ios;
137 } basic_ostream_char;
139 typedef struct _basic_ostream_wchar {
140 const int *vbtable;
141 /* virtual inheritance
142 * basic_ios_wchar basic_ios;
144 } basic_ostream_wchar;
146 typedef struct {
147 const int *vbtable;
148 streamsize count;
149 /* virtual inheritance
150 * basic_ios_char basic_ios;
152 } basic_istream_char;
154 typedef struct {
155 const int *vbtable;
156 streamsize count;
157 /* virtual inheritance
158 * basic_ios_wchar basic_ios;
160 } basic_istream_wchar;
162 typedef struct {
163 basic_istream_char base1;
164 basic_ostream_char base2;
165 /* virtual inheritance
166 * basic_ios_char basic_ios;
168 } basic_iostream_char;
170 typedef struct {
171 basic_istream_wchar base1;
172 basic_ostream_wchar base2;
173 /* virtual inheritance
174 * basic_ios_wchar basic_ios;
176 } basic_iostream_wchar;
178 typedef struct {
179 basic_ostream_char base;
180 basic_filebuf_char filebuf;
181 /* virtual inheritance
182 * basic_ios_char basic_ios;
184 } basic_ofstream_char;
186 typedef struct {
187 basic_ostream_wchar base;
188 basic_filebuf_wchar filebuf;
189 /* virtual inheritance
190 * basic_ios_wchar basic_ios;
192 } basic_ofstream_wchar;
194 typedef struct {
195 basic_istream_char base;
196 basic_filebuf_char filebuf;
197 /* virtual inheritance
198 * basic_ios_char basic_ios;
200 } basic_ifstream_char;
202 typedef struct {
203 basic_istream_wchar base;
204 basic_filebuf_wchar filebuf;
205 /* virtual inheritance
206 * basic_ios_wchar basic_ios;
208 } basic_ifstream_wchar;
210 typedef struct {
211 basic_iostream_char base;
212 basic_filebuf_char filebuf;
213 /* virtual inheritance
214 * basic_ios_char basic_ios;
216 } basic_fstream_char;
218 typedef struct {
219 basic_iostream_wchar base;
220 basic_filebuf_wchar filebuf;
221 /* virtual inheritance
222 * basic_ios_char basic_ios;
224 } basic_fstream_wchar;
226 typedef struct {
227 basic_ostream_char base;
228 basic_stringbuf_char strbuf;
229 /* virtual inheritance
230 * basic_ios_char basic_ios;
232 } basic_ostringstream_char;
234 typedef struct {
235 basic_ostream_wchar base;
236 basic_stringbuf_wchar strbuf;
237 /* virtual inheritance
238 * basic_ios_wchar basic_ios;
240 } basic_ostringstream_wchar;
242 typedef struct {
243 basic_istream_char base;
244 basic_stringbuf_char strbuf;
245 /* virtual inheritance
246 * basic_ios_char basic_ios;
248 } basic_istringstream_char;
250 typedef struct {
251 basic_istream_wchar base;
252 basic_stringbuf_wchar strbuf;
253 /* virtual inheritance
254 * basic_ios_wchar basic_ios;
256 } basic_istringstream_wchar;
258 typedef struct {
259 basic_iostream_char base;
260 basic_stringbuf_char strbuf;
261 /* virtual inheritance
262 * basic_ios_char basic_ios;
264 } basic_stringstream_char;
266 typedef struct {
267 basic_iostream_wchar base;
268 basic_stringbuf_wchar strbuf;
269 /* virtual inheritance
270 * basic_ios_wchar basic_ios;
272 } basic_stringstream_wchar;
274 typedef enum {
275 STRSTATE_Allocated = 1,
276 STRSTATE_Constant = 2,
277 STRSTATE_Dynamic = 4,
278 STRSTATE_Frozen = 8
279 } strstreambuf__Strstate;
281 typedef struct {
282 basic_streambuf_char base;
283 streamsize minsize;
284 char *endsave;
285 char *seekhigh;
286 int strmode;
287 void* (__cdecl *palloc)(MSVCP_size_t);
288 void (__cdecl *pfree)(void*);
289 } strstreambuf;
291 typedef struct {
292 basic_ostream_char base;
293 strstreambuf buf;
294 /* virtual inheritance
295 * basic_ios_char basic_ios;
297 } ostrstream;
299 typedef struct {
300 basic_istream_char base;
301 strstreambuf buf;
302 /* virtual inheritance
303 * basic_ios_char basic_ios;
305 } istrstream;
307 typedef struct {
308 basic_iostream_char base;
309 strstreambuf buf;
310 /* virtual inheritance
311 * basic_ios_char basic_ios;
313 } strstream;
315 #if _MSVCP_VER >= 100
316 #define VBTABLE_ALIGN 8
317 #else
318 #define VBTABLE_ALIGN 4
319 #endif
321 extern const vtable_ptr MSVCP_iosb_vtable;
323 /* ??_7ios_base@std@@6B@ */
324 extern const vtable_ptr MSVCP_ios_base_vtable;
326 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
327 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
329 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
330 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
332 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
333 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
335 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
336 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
338 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
339 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
341 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
342 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
344 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
345 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
347 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
348 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
350 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
351 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
353 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
354 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
356 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
357 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
359 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
360 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
362 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
363 const int basic_ostream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_char), VBTABLE_ALIGN)};
364 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
365 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
367 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
368 const int basic_ostream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
369 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
370 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
372 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
373 const int basic_ostream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
374 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
375 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
377 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
378 const int basic_istream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_char), VBTABLE_ALIGN)};
379 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
380 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
382 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
383 const int basic_istream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
384 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
385 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
387 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
388 const int basic_istream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
389 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
390 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
392 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
393 const int basic_iostream_char_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)};
394 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
395 const int basic_iostream_char_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_char, base2)};
396 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
397 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
399 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
400 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
401 const int basic_iostream_wchar_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)};
402 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
403 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
404 const int basic_iostream_wchar_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_wchar, base2)};
405 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
406 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
407 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
408 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
410 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
411 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
412 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
413 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
415 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
416 const int basic_ofstream_wchar_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
417 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
418 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
420 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
421 const int basic_ofstream_short_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
422 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
423 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
425 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
426 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
427 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
428 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
430 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
431 const int basic_ifstream_wchar_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
432 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
433 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
435 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
436 const int basic_ifstream_short_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
437 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
438 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
440 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
441 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
442 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
443 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
444 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
445 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
447 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
448 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
449 const int basic_fstream_wchar_vbtable1[] = {0, sizeof(basic_fstream_wchar)};
450 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
451 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
452 const int basic_fstream_wchar_vbtable2[] = {0, sizeof(basic_fstream_wchar)-FIELD_OFFSET(basic_fstream_wchar, base.base2)};
453 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
454 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
455 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
456 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
458 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
459 const int basic_ostringstream_char_vbtable[] = {0, sizeof(basic_ostringstream_char)};
460 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
461 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
463 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
464 const int basic_ostringstream_wchar_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
465 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
466 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
468 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
469 const int basic_ostringstream_short_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
470 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
471 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
473 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
474 const int basic_istringstream_char_vbtable[] = {0, sizeof(basic_istringstream_char)};
475 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
476 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
478 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
479 const int basic_istringstream_wchar_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
480 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
481 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
483 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
484 const int basic_istringstream_short_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
485 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
486 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
488 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
489 const int basic_stringstream_char_vbtable1[] = {0, sizeof(basic_stringstream_char)};
490 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
491 const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_char)-FIELD_OFFSET(basic_stringstream_char, base.base2)};
492 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
493 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
495 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
496 const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
497 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
498 const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
499 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
500 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
502 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
503 const int basic_stringstream_short_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
504 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
505 const int basic_stringstream_short_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
506 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
507 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
509 /* ??_7strstreambuf@std@@6B */
510 extern const vtable_ptr MSVCP_strstreambuf_vtable;
512 static const int ostrstream_vbtable[] = {0, sizeof(ostrstream)};
513 extern const vtable_ptr MSVCP_ostrstream_vtable;
515 static const int istrstream_vbtable[] = {0, sizeof(istrstream)};
517 static const int strstream_vbtable1[] = {0, sizeof(strstream)};
518 static const int strstream_vbtable2[] = {0, sizeof(strstream)-FIELD_OFFSET(strstream, base.base2)};
519 extern const vtable_ptr MSVCP_strstream_vtable;
521 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
522 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
523 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
524 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
525 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
526 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
527 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
528 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
529 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
530 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
531 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
532 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
533 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
534 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
535 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
536 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
537 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
538 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
539 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
540 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
541 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
542 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
543 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
544 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
545 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
546 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
547 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
548 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
549 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
550 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
551 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
552 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
553 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
554 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
555 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
556 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
557 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
558 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
559 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
560 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
561 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
562 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
563 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
564 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
565 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
566 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
567 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
568 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
569 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
570 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
571 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
572 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
573 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
574 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
575 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
576 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
577 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
578 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
579 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
580 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
581 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
582 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
583 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
584 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
585 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
586 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
587 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
588 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
589 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
590 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
591 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
592 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
593 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
594 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
595 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
596 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
597 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
598 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
599 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
600 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
601 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
602 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
603 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
604 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
605 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
606 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
607 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
608 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
609 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
610 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
611 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
612 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
613 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
614 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
615 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
616 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
617 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
618 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
619 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
620 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
621 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
622 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
623 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
624 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
625 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
626 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
627 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
628 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
629 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
630 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
631 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
632 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
633 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
634 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
635 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
636 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
637 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
638 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
639 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
640 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
641 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
642 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
643 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
644 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
645 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
646 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
647 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
648 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
649 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
650 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
651 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
652 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
653 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
654 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
655 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
656 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
657 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
658 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
659 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
660 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
661 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
662 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
663 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
664 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
665 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
666 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
667 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
668 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
669 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
670 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
671 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
672 "?AVostrstream@std@@")
673 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
674 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
675 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
676 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
677 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
678 "?AVstrstream@std@@")
680 #ifndef __GNUC__
681 void __asm_dummy_vtables(void) {
682 #endif
683 __ASM_VTABLE(iosb,
684 VTABLE_ADD_FUNC(iosb_vector_dtor));
685 __ASM_VTABLE(ios_base,
686 VTABLE_ADD_FUNC(ios_base_vector_dtor));
687 __ASM_VTABLE(basic_ios_char,
688 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor));
689 __ASM_VTABLE(basic_ios_wchar,
690 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
691 __ASM_VTABLE(basic_ios_short,
692 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
693 __ASM_VTABLE(basic_streambuf_char,
694 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
695 #if _MSVCP_VER >= 100
696 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
697 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
698 #endif
699 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
700 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
701 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
702 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
703 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
704 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
705 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
706 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
707 #endif
708 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
709 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
710 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
711 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
712 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
713 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
714 __ASM_VTABLE(basic_streambuf_wchar,
715 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
716 #if _MSVCP_VER >= 100
717 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
718 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
719 #endif
720 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
721 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
722 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
723 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
724 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
725 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
726 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
727 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
728 #endif
729 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
730 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
731 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
732 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
733 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
734 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
735 __ASM_VTABLE(basic_streambuf_short,
736 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
737 #if _MSVCP_VER >= 100
738 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
739 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
740 #endif
741 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
742 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
743 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
744 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
745 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
746 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
747 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
748 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
749 #endif
750 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
751 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
752 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
753 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
754 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
755 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
756 __ASM_VTABLE(basic_filebuf_char,
757 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
758 #if _MSVCP_VER >= 100
759 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
760 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
761 #endif
762 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
763 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
764 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
765 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
766 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
767 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
768 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
769 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
770 #endif
771 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
772 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
773 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
774 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
775 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
776 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
777 __ASM_VTABLE(basic_filebuf_wchar,
778 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
779 #if _MSVCP_VER >= 100
780 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
781 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
782 #endif
783 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
784 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
785 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
786 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
787 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
788 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
789 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
790 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
791 #endif
792 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
793 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
794 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
795 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
796 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
797 VTABLE_ADD_FUNC(basic_filebuf_wchar_imbue));
798 __ASM_VTABLE(basic_filebuf_short,
799 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
800 #if _MSVCP_VER >= 100
801 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
802 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
803 #endif
804 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
805 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
806 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
807 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
808 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
809 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
810 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
811 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
812 #endif
813 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
814 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
815 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
816 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
817 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
818 VTABLE_ADD_FUNC(basic_filebuf_short_imbue));
819 __ASM_VTABLE(basic_stringbuf_char,
820 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
821 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
822 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
823 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
824 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
825 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
826 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
827 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
828 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
829 #endif
830 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
831 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
832 VTABLE_ADD_FUNC(basic_stringbuf_char_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 __ASM_VTABLE(basic_stringbuf_wchar,
837 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
838 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
839 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
840 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
841 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
842 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
843 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
844 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
845 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
846 #endif
847 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
848 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
849 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
850 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
851 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
852 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
853 __ASM_VTABLE(basic_stringbuf_short,
854 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
855 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
856 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
857 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
858 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
859 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
860 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
861 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
862 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
863 #endif
864 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
865 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
866 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
867 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
868 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
869 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
870 __ASM_VTABLE(basic_ostream_char,
871 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor));
872 __ASM_VTABLE(basic_ostream_wchar,
873 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
874 __ASM_VTABLE(basic_ostream_short,
875 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
876 __ASM_VTABLE(basic_istream_char,
877 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor));
878 __ASM_VTABLE(basic_istream_wchar,
879 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
880 __ASM_VTABLE(basic_istream_short,
881 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
882 __ASM_VTABLE(basic_iostream_char,
883 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor));
884 __ASM_VTABLE(basic_iostream_wchar,
885 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
886 __ASM_VTABLE(basic_iostream_short,
887 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
888 __ASM_VTABLE(basic_ofstream_char,
889 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor));
890 __ASM_VTABLE(basic_ofstream_wchar,
891 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
892 __ASM_VTABLE(basic_ofstream_short,
893 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
894 __ASM_VTABLE(basic_ifstream_char,
895 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor));
896 __ASM_VTABLE(basic_ifstream_wchar,
897 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
898 __ASM_VTABLE(basic_ifstream_short,
899 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
900 __ASM_VTABLE(basic_fstream_char,
901 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor));
902 __ASM_VTABLE(basic_fstream_wchar,
903 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
904 __ASM_VTABLE(basic_fstream_short,
905 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
906 __ASM_VTABLE(basic_ostringstream_char,
907 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor));
908 __ASM_VTABLE(basic_ostringstream_wchar,
909 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
910 __ASM_VTABLE(basic_ostringstream_short,
911 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
912 __ASM_VTABLE(basic_istringstream_char,
913 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor));
914 __ASM_VTABLE(basic_istringstream_wchar,
915 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
916 __ASM_VTABLE(basic_istringstream_short,
917 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
918 __ASM_VTABLE(basic_stringstream_char,
919 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor));
920 __ASM_VTABLE(basic_stringstream_wchar,
921 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
922 __ASM_VTABLE(basic_stringstream_short,
923 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
924 __ASM_VTABLE(strstreambuf,
925 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
926 VTABLE_ADD_FUNC(strstreambuf_overflow)
927 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
928 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
929 VTABLE_ADD_FUNC(strstreambuf_underflow)
930 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
931 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
932 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
933 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
934 #endif
935 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
936 VTABLE_ADD_FUNC(strstreambuf_seekoff)
937 VTABLE_ADD_FUNC(strstreambuf_seekpos)
938 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
939 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
940 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
941 __ASM_VTABLE(ostrstream,
942 VTABLE_ADD_FUNC(ostrstream_vector_dtor));
943 __ASM_VTABLE(strstream,
944 VTABLE_ADD_FUNC(strstream_vector_dtor));
945 #ifndef __GNUC__
947 #endif
949 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
950 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
951 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
952 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
954 TRACE("(%p %p %p %p)\n", this, first, next, last);
956 this->wbuf = first;
957 this->wpos = next;
958 this->wsize = last-next;
961 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
962 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
963 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
964 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
966 basic_streambuf_char_setp_next(this, first, first, last);
969 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
970 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
971 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
972 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
974 TRACE("(%p %p %p %p)\n", this, first, next, last);
976 this->rbuf = first;
977 this->rpos = next;
978 this->rsize = last-next;
981 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
982 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
983 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
984 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
986 TRACE("(%p)\n", this);
988 this->prbuf = &this->rbuf;
989 this->pwbuf = &this->wbuf;
990 this->prpos = &this->rpos;
991 this->pwpos = &this->wpos;
992 this->prsize = &this->rsize;
993 this->pwsize = &this->wsize;
995 basic_streambuf_char_setp(this, NULL, NULL);
996 basic_streambuf_char_setg(this, NULL, NULL, NULL);
999 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1000 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1001 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
1002 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
1004 TRACE("(%p %d)\n", this, uninitialized);
1005 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1006 #if _MSVCP_VER <= 100
1007 mutex_ctor(&this->lock);
1008 #endif
1009 return this;
1012 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
1013 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
1014 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
1015 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
1017 TRACE("(%p)\n", this);
1019 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1020 #if _MSVCP_VER <= 100
1021 mutex_ctor(&this->lock);
1022 #endif
1023 this->loc = MSVCRT_operator_new(sizeof(locale));
1024 locale_ctor(this->loc);
1025 basic_streambuf_char__Init_empty(this);
1027 return this;
1030 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
1031 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1032 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
1033 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
1035 TRACE("(%p)\n", this);
1037 #if _MSVCP_VER <= 100
1038 mutex_dtor(&this->lock);
1039 #endif
1040 locale_dtor(this->loc);
1041 MSVCRT_operator_delete(this->loc);
1044 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
1045 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
1047 TRACE("(%p %x)\n", this, flags);
1048 if(flags & 2) {
1049 /* we have an array, with the number of elements stored before the first object */
1050 INT_PTR i, *ptr = (INT_PTR *)this-1;
1052 for(i=*ptr-1; i>=0; i--)
1053 basic_streambuf_char_dtor(this+i);
1054 MSVCRT_operator_delete(ptr);
1055 } else {
1056 basic_streambuf_char_dtor(this);
1057 if(flags & 1)
1058 MSVCRT_operator_delete(this);
1061 return this;
1064 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1065 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1066 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
1067 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
1069 TRACE("(%p)\n", this);
1070 return *this->prpos ? *this->prsize : 0;
1073 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1074 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1075 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1076 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1078 TRACE("(%p)\n", this);
1079 (*this->prsize)++;
1080 (*this->prpos)--;
1081 return *this->prpos;
1084 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1085 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1086 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1087 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1089 TRACE("(%p)\n", this);
1090 (*this->prsize)--;
1091 return (*this->prpos)++;
1094 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1095 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1096 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1097 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1099 TRACE("(%p)\n", this);
1100 (*this->prsize)--;
1101 (*this->prpos)++;
1102 return *this->prpos;
1105 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1106 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1107 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1108 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1110 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1112 this->prbuf = gf;
1113 this->pwbuf = pf;
1114 this->prpos = gn;
1115 this->pwpos = pn;
1116 this->prsize = gc;
1117 this->pwsize = pc;
1120 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1121 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1122 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1123 #if _MSVCP_VER >= 100
1124 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1125 #else
1126 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1127 #endif
1128 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1130 TRACE("(%p)\n", this);
1131 #if _MSVCP_VER <= 100
1132 mutex_lock(&this->lock);
1133 #endif
1136 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1137 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1138 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1139 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1141 TRACE("(%p)\n", this);
1142 return *this->pwpos ? *this->pwsize : 0;
1145 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1146 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1147 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1148 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1150 TRACE("(%p)\n", this);
1151 (*this->pwsize)--;
1152 return (*this->pwpos)++;
1155 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1156 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1157 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1158 #if _MSVCP_VER >= 100
1159 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1160 #else
1161 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1162 #endif
1163 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1165 TRACE("(%p)\n", this);
1166 return EOF;
1169 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1170 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1171 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1172 #if _MSVCP_VER >= 100
1173 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1174 #else
1175 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1176 #endif
1177 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1179 int ret;
1181 TRACE("(%p)\n", this);
1183 if(call_basic_streambuf_char_underflow(this)==EOF)
1184 return EOF;
1186 ret = (unsigned char)**this->prpos;
1187 (*this->prsize)--;
1188 (*this->prpos)++;
1189 return ret;
1192 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1193 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1194 #if STREAMSIZE_BITS == 64
1195 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1196 #else
1197 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1198 #endif
1199 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1200 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1201 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1202 #else
1203 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1204 #endif
1205 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1207 streamsize copied, chunk;
1208 int c;
1210 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1212 for(copied=0; copied<count && size;) {
1213 chunk = basic_streambuf_char__Gnavail(this);
1214 if(chunk > count-copied)
1215 chunk = count-copied;
1217 if(chunk > 0) {
1218 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1219 *this->prpos += chunk;
1220 *this->prsize -= chunk;
1221 copied += chunk;
1222 size -= chunk;
1223 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1224 ptr[copied] = c;
1225 copied++;
1226 size--;
1227 }else {
1228 break;
1232 return copied;
1235 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1236 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1237 #if STREAMSIZE_BITS == 64
1238 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1239 #else
1240 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1241 #endif
1242 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1244 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1245 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1248 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1249 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1250 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1251 #if _MSVCP_VER >= 100
1252 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1253 #else
1254 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1255 #endif
1256 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1258 TRACE("(%p)\n", this);
1259 #if _MSVCP_VER <= 100
1260 mutex_unlock(&this->lock);
1261 #endif
1264 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1265 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1266 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1267 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1269 TRACE("(%p)\n", this);
1270 return *this->prbuf;
1273 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1274 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1275 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1276 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1278 TRACE("(%p)\n", this);
1279 return *this->prpos;
1282 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1283 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1284 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1285 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1287 TRACE("(%p)\n", this);
1288 return *this->prpos+*this->prsize;
1291 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1292 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1293 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1294 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1296 TRACE("(%p)\n", this);
1297 return *this->pwpos+*this->pwsize;
1300 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1301 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1302 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1303 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1305 TRACE("(%p %d)\n", this, off);
1306 *this->prpos += off;
1307 *this->prsize -= off;
1310 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1311 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1312 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1313 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
1315 TRACE("(%p)\n", this);
1316 return locale_copy_ctor(ret, this->loc);
1319 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1320 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1321 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1322 #if _MSVCP_VER >= 100
1323 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_char*, const locale*), (this, loc))
1324 #elif _MSVCP_VER >= 80
1325 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_char*, const locale*), (this, loc))
1326 #else
1327 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_char*, const locale*), (this, loc))
1328 #endif
1329 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1331 TRACE("(%p %p)\n", this, loc);
1334 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1335 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1336 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1337 #if _MSVCP_VER >= 100
1338 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 12, int, (basic_streambuf_char*, int), (this, ch))
1339 #else
1340 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, int, (basic_streambuf_char*, int), (this, ch))
1341 #endif
1342 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1344 TRACE("(%p %d)\n", this, ch);
1345 return EOF;
1348 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1349 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1350 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1351 #if _MSVCP_VER >= 100
1352 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*, int), (this, ch))
1353 #else
1354 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, int, (basic_streambuf_char*, int), (this, ch))
1355 #endif
1356 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1358 TRACE("(%p %d)\n", this, ch);
1359 return EOF;
1362 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1363 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1364 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1365 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1367 TRACE("(%p)\n", this);
1368 return *this->pwbuf;
1371 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1372 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1373 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1374 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1376 TRACE("(%p %d)\n", this, off);
1377 *this->pwpos += off;
1378 *this->pwsize -= off;
1381 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1382 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1383 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1384 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1386 TRACE("(%p)\n", this);
1387 return *this->pwpos;
1390 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1391 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1392 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1393 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1395 TRACE("(%p %p)\n", this, loc);
1396 memcpy(ret, this->loc, sizeof(locale));
1397 call_basic_streambuf_char_imbue(this, loc);
1398 locale_copy_ctor(this->loc, loc);
1399 return ret;
1402 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1403 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1404 #if STREAMOFF_BITS == 64
1405 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1406 #else
1407 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1408 #endif
1409 #if _MSVCP_VER >= 100
1410 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1411 #elif _MSVCP_VER >= 80
1412 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1413 #else
1414 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1415 #endif
1416 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1417 fpos_int *ret, streamoff off, int way, int mode)
1419 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1420 ret->off = -1;
1421 ret->pos = 0;
1422 ret->state = 0;
1423 return ret;
1426 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1427 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1428 #if STREAMOFF_BITS == 64
1429 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1430 #else
1431 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1432 #endif
1433 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1434 fpos_int *ret, streamoff off, int way, int mode)
1436 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1437 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1440 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1441 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1442 #if STREAMOFF_BITS == 64
1443 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 24)
1444 #else
1445 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1446 #endif
1447 fpos_int* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1448 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
1450 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1451 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1454 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1455 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1456 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1457 #if _MSVCP_VER >= 100
1458 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 44, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1459 #elif _MSVCP_VER >= 80
1460 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1461 #else
1462 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1463 #endif
1464 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1465 fpos_int *ret, fpos_int pos, int mode)
1467 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1468 ret->off = -1;
1469 ret->pos = 0;
1470 ret->state = 0;
1471 return ret;
1474 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1475 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1476 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1477 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1478 fpos_int *ret, fpos_int pos, int mode)
1480 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1481 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1484 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1485 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1486 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1487 fpos_int* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1488 fpos_int *ret, fpos_int pos, unsigned int mode)
1490 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1491 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1494 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1495 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1496 #if STREAMSIZE_BITS == 64
1497 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1498 #else
1499 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1500 #endif
1501 #if _MSVCP_VER >= 100
1502 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 48, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1503 #elif _MSVCP_VER >= 80
1504 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1505 #else
1506 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1507 #endif
1508 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1510 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1511 return this;
1514 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1515 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1516 #if STREAMSIZE_BITS == 64
1517 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1518 #else
1519 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1520 #endif
1521 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1523 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1524 return call_basic_streambuf_char_setbuf(this, buf, count);
1527 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1528 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1529 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1530 #if _MSVCP_VER >= 100
1531 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1532 #elif _MSVCP_VER >= 80
1533 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1534 #else
1535 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1536 #endif
1537 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1539 TRACE("(%p)\n", this);
1540 return 0;
1543 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1544 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1545 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1546 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1548 TRACE("(%p)\n", this);
1549 return call_basic_streambuf_char_sync(this);
1552 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1553 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1554 #if STREAMSIZE_BITS == 64
1555 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1556 #else
1557 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1558 #endif
1559 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1561 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1562 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1565 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1566 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1567 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1568 #if _MSVCP_VER >= 100
1569 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1570 #else
1571 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1572 #endif
1573 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1575 TRACE("(%p)\n", this);
1576 return 0;
1579 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1580 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1581 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1582 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1584 streamsize ret;
1586 TRACE("(%p)\n", this);
1588 ret = basic_streambuf_char__Gnavail(this);
1589 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1592 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1593 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1594 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1595 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1597 TRACE("(%p %d)\n", this, ch);
1598 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1599 (*this->prsize)++;
1600 (*this->prpos)--;
1601 return (unsigned char)ch;
1604 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1607 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1608 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1609 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1610 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1612 TRACE("(%p %d)\n", this, ch);
1613 return basic_streambuf_char__Pnavail(this) ?
1614 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1615 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1618 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1619 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1620 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1621 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1623 TRACE("(%p)\n", this);
1624 if(*this->prpos && *this->prpos>*this->prbuf) {
1625 (*this->prsize)++;
1626 (*this->prpos)--;
1627 return (unsigned char)**this->prpos;
1630 return call_basic_streambuf_char_pbackfail(this, EOF);
1633 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1634 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1635 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1636 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1638 TRACE("(%p)\n", this);
1639 if(basic_streambuf_char__Gnavail(this))
1640 basic_streambuf_char__Gninc(this);
1641 else
1642 call_basic_streambuf_char_uflow(this);
1645 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1646 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1647 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1648 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1650 TRACE("(%p)\n", this);
1651 return basic_streambuf_char__Gnavail(this) ?
1652 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1655 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1656 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1657 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1658 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1660 TRACE("(%p)\n", this);
1661 return basic_streambuf_char__Gnavail(this) ?
1662 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1665 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1666 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1667 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1668 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1670 TRACE("(%p)\n", this);
1672 if(basic_streambuf_char__Gnavail(this) > 1)
1673 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1674 return basic_streambuf_char_sbumpc(this)==EOF ?
1675 EOF : basic_streambuf_char_sgetc(this);
1678 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1679 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1680 #if STREAMSIZE_BITS == 64
1681 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1682 #else
1683 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1684 #endif
1685 #if _MSVCP_VER >= 100
1686 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1687 #else
1688 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1689 #endif
1690 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1692 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1693 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1696 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1697 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1698 #if STREAMSIZE_BITS == 64
1699 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1700 #else
1701 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1702 #endif
1703 #if _MSVCP_VER >= 100
1704 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1705 #elif _MSVCP_VER >= 80
1706 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1707 #else
1708 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1709 #endif
1710 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1712 streamsize copied, chunk;
1714 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1716 for(copied=0; copied<count;) {
1717 chunk = basic_streambuf_char__Pnavail(this);
1718 if(chunk > count-copied)
1719 chunk = count-copied;
1721 if(chunk > 0) {
1722 memcpy(*this->pwpos, ptr+copied, chunk);
1723 *this->pwpos += chunk;
1724 *this->pwsize -= chunk;
1725 copied += chunk;
1726 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1727 copied++;
1728 }else {
1729 break;
1733 return copied;
1736 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1737 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1738 #if STREAMSIZE_BITS == 64
1739 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
1740 #else
1741 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1742 #endif
1743 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1745 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1746 return call_basic_streambuf_char_xsputn(this, ptr, count);
1749 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
1750 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
1751 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8)
1752 void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r)
1754 basic_streambuf_char tmp;
1756 TRACE("(%p %p)\n", this, r);
1758 if(this == r)
1759 return;
1761 tmp = *this;
1762 *this = *r;
1763 this->vtable = tmp.vtable;
1764 tmp.vtable = r->vtable;
1765 *r = tmp;
1768 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1769 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1770 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1771 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1772 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1773 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1775 TRACE("(%p %p %p %p)\n", this, first, next, last);
1777 this->wbuf = first;
1778 this->wpos = next;
1779 this->wsize = last-next;
1782 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1783 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1784 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1785 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1786 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1787 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1789 basic_streambuf_wchar_setp_next(this, first, first, last);
1792 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1793 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1794 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1795 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1796 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1797 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1799 TRACE("(%p %p %p %p)\n", this, first, next, last);
1801 this->rbuf = first;
1802 this->rpos = next;
1803 this->rsize = last-next;
1806 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1807 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1808 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1809 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1810 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1811 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1813 TRACE("(%p)\n", this);
1815 this->prbuf = &this->rbuf;
1816 this->pwbuf = &this->wbuf;
1817 this->prpos = &this->rpos;
1818 this->pwpos = &this->wpos;
1819 this->prsize = &this->rsize;
1820 this->pwsize = &this->wsize;
1822 basic_streambuf_wchar_setp(this, NULL, NULL);
1823 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1826 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1827 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1828 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
1829 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1831 TRACE("(%p %d)\n", this, uninitialized);
1832 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1833 #if _MSVCP_VER <= 100
1834 mutex_ctor(&this->lock);
1835 #endif
1836 return this;
1839 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1840 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1841 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1842 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1844 TRACE("(%p %d)\n", this, uninitialized);
1845 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1846 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1847 return this;
1850 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1851 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1852 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
1853 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1855 TRACE("(%p)\n", this);
1857 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1858 #if _MSVCP_VER <= 100
1859 mutex_ctor(&this->lock);
1860 #endif
1861 this->loc = MSVCRT_operator_new(sizeof(locale));
1862 locale_ctor(this->loc);
1863 basic_streambuf_wchar__Init_empty(this);
1865 return this;
1868 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1869 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1870 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1871 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1873 TRACE("(%p)\n", this);
1874 basic_streambuf_wchar_ctor(this);
1875 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1876 return this;
1879 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1880 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1881 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1882 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1883 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1884 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1886 TRACE("(%p)\n", this);
1888 #if _MSVCP_VER <= 100
1889 mutex_dtor(&this->lock);
1890 #endif
1891 locale_dtor(this->loc);
1892 MSVCRT_operator_delete(this->loc);
1895 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
1896 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1898 TRACE("(%p %x)\n", this, flags);
1899 if(flags & 2) {
1900 /* we have an array, with the number of elements stored before the first object */
1901 INT_PTR i, *ptr = (INT_PTR *)this-1;
1903 for(i=*ptr-1; i>=0; i--)
1904 basic_streambuf_wchar_dtor(this+i);
1905 MSVCRT_operator_delete(ptr);
1906 } else {
1907 basic_streambuf_wchar_dtor(this);
1908 if(flags & 1)
1909 MSVCRT_operator_delete(this);
1912 return this;
1915 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1916 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1917 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1918 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1919 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
1920 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1922 TRACE("(%p)\n", this);
1923 return *this->prpos ? *this->prsize : 0;
1926 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1927 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1928 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1929 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1930 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1931 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1933 TRACE("(%p)\n", this);
1934 (*this->prsize)++;
1935 (*this->prpos)--;
1936 return *this->prpos;
1939 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1940 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1941 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1942 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1943 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1944 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1946 TRACE("(%p)\n", this);
1947 (*this->prsize)--;
1948 return (*this->prpos)++;
1951 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1952 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1953 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1954 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1955 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
1956 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1958 TRACE("(%p)\n", this);
1959 (*this->prsize)--;
1960 (*this->prpos)++;
1961 return *this->prpos;
1964 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1965 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1966 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1967 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1968 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1969 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)
1971 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1973 this->prbuf = gf;
1974 this->pwbuf = pf;
1975 this->prpos = gn;
1976 this->pwpos = pn;
1977 this->prsize = gc;
1978 this->pwsize = pc;
1981 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1982 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1983 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1984 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1985 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
1986 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
1988 TRACE("(%p)\n", this);
1989 #if _MSVCP_VER <= 100
1990 mutex_lock(&this->lock);
1991 #endif
1994 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1995 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1996 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1997 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1998 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
1999 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
2001 TRACE("(%p)\n", this);
2002 return *this->pwpos ? *this->pwsize : 0;
2005 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2006 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2007 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2008 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2009 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
2010 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
2012 TRACE("(%p)\n", this);
2013 (*this->pwsize)--;
2014 return (*this->pwpos)++;
2017 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2018 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2019 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2020 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2021 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
2022 #if _MSVCP_VER >= 100
2023 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
2024 #else
2025 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
2026 #endif
2027 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
2029 TRACE("(%p)\n", this);
2030 return WEOF;
2033 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2034 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2035 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2036 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2037 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
2038 #if _MSVCP_VER >= 100
2039 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
2040 #else
2041 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
2042 #endif
2043 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
2045 int ret;
2047 TRACE("(%p)\n", this);
2049 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
2050 return WEOF;
2052 ret = **this->prpos;
2053 (*this->prsize)--;
2054 (*this->prpos)++;
2055 return ret;
2058 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
2059 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
2060 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
2061 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
2062 #if STREAMSIZE_BITS == 64
2063 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
2064 #else
2065 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
2066 #endif
2067 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2068 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
2069 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
2070 #else
2071 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
2072 #endif
2073 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2075 streamsize copied, chunk;
2076 unsigned short c;
2078 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2080 for(copied=0; copied<count && size;) {
2081 chunk = basic_streambuf_wchar__Gnavail(this);
2082 if(chunk > count-copied)
2083 chunk = count-copied;
2085 if(chunk > 0) {
2086 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
2087 *this->prpos += chunk;
2088 *this->prsize -= chunk;
2089 copied += chunk;
2090 size -= chunk*sizeof(wchar_t);
2091 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
2092 ptr[copied] = c;
2093 copied++;
2094 size--;
2095 }else {
2096 break;
2100 return copied;
2103 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
2104 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
2105 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
2106 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
2107 #if STREAMSIZE_BITS == 64
2108 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
2109 #else
2110 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
2111 #endif
2112 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2114 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2115 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
2118 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2119 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2120 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2121 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2122 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
2123 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
2125 TRACE("(%p)\n", this);
2126 #if _MSVCP_VER <= 100
2127 mutex_unlock(&this->lock);
2128 #endif
2131 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2132 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2133 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2134 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2135 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2136 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2138 TRACE("(%p)\n", this);
2139 return *this->prbuf;
2142 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2143 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2144 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2145 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2146 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2147 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2149 TRACE("(%p)\n", this);
2150 return *this->prpos;
2153 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2154 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2155 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2156 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2157 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2158 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2160 TRACE("(%p)\n", this);
2161 return *this->prpos+*this->prsize;
2164 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2165 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2166 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2167 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2168 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2169 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2171 TRACE("(%p)\n", this);
2172 return *this->pwpos+*this->pwsize;
2175 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2176 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2177 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2178 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2179 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2180 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2182 TRACE("(%p %d)\n", this, off);
2183 *this->prpos += off;
2184 *this->prsize -= off;
2187 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
2188 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
2189 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
2190 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
2191 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
2192 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
2194 TRACE("(%p)\n", this);
2195 return locale_copy_ctor(ret, this->loc);
2198 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2199 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2200 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2201 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2202 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2203 #if _MSVCP_VER >= 100
2204 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2205 #elif _MSVCP_VER >= 80
2206 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2207 #else
2208 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2209 #endif
2210 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2212 TRACE("(%p %p)\n", this, loc);
2215 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2216 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2217 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2218 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2219 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2220 #if _MSVCP_VER >= 100
2221 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2222 #else
2223 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2224 #endif
2225 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2227 TRACE("(%p %d)\n", this, ch);
2228 return WEOF;
2231 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2232 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2233 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2234 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2235 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2236 #if _MSVCP_VER >= 100
2237 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2238 #else
2239 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2240 #endif
2241 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2243 TRACE("(%p %d)\n", this, ch);
2244 return WEOF;
2247 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2248 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2249 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2250 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2251 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2252 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2254 TRACE("(%p)\n", this);
2255 return *this->pwbuf;
2258 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2259 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2260 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2261 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2262 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2263 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2265 TRACE("(%p %d)\n", this, off);
2266 *this->pwpos += off;
2267 *this->pwsize -= off;
2270 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2271 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2272 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2273 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2274 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2275 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2277 TRACE("(%p)\n", this);
2278 return *this->pwpos;
2281 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2282 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2283 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2284 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2285 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2286 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2288 TRACE("(%p %p)\n", this, loc);
2289 memcpy(ret, this->loc, sizeof(locale));
2290 call_basic_streambuf_wchar_imbue(this, loc);
2291 locale_copy_ctor(this->loc, loc);
2292 return ret;
2295 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2296 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2297 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2298 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2299 #if STREAMOFF_BITS == 64
2300 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2301 #else
2302 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2303 #endif
2304 #if _MSVCP_VER >= 100
2305 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2306 #elif _MSVCP_VER >= 80
2307 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2308 #else
2309 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2310 #endif
2311 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2312 fpos_int *ret, streamoff off, int way, int mode)
2314 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2315 ret->off = -1;
2316 ret->pos = 0;
2317 ret->state = 0;
2318 return ret;
2321 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2322 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2323 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2324 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2325 #if STREAMOFF_BITS == 64
2326 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2327 #else
2328 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2329 #endif
2330 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2331 fpos_int *ret, streamoff off, int way, int mode)
2333 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2334 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2337 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2338 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2339 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2340 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2341 #if STREAMOFF_BITS == 64
2342 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 24)
2343 #else
2344 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2345 #endif
2346 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2347 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
2349 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2350 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2353 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2354 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2355 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2356 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2357 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2358 #if _MSVCP_VER >= 100
2359 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 44, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2360 #elif _MSVCP_VER >= 80
2361 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2362 #else
2363 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2364 #endif
2365 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2366 fpos_int *ret, fpos_int pos, int mode)
2368 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2369 ret->off = -1;
2370 ret->pos = 0;
2371 ret->state = 0;
2372 return ret;
2375 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2376 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2377 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2378 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2379 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2380 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2381 fpos_int *ret, fpos_int pos, int mode)
2383 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2384 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2387 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2388 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2389 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2390 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2391 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2392 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2393 fpos_int *ret, fpos_int pos, unsigned int mode)
2395 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2396 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2399 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2400 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2401 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2402 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2403 #if STREAMSIZE_BITS == 64
2404 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2405 #else
2406 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2407 #endif
2408 #if _MSVCP_VER >= 100
2409 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 48, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2410 #elif _MSVCP_VER >= 80
2411 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2412 #else
2413 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2414 #endif
2415 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2417 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2418 return this;
2421 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2422 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2423 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2424 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2425 #if STREAMSIZE_BITS == 64
2426 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2427 #else
2428 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2429 #endif
2430 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2432 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2433 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2436 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2437 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2438 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2439 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2440 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2441 #if _MSVCP_VER >= 100
2442 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2443 #elif _MSVCP_VER >= 80
2444 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2445 #else
2446 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2447 #endif
2448 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2450 TRACE("(%p)\n", this);
2451 return 0;
2454 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2455 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2456 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2457 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2458 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2459 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2461 TRACE("(%p)\n", this);
2462 return call_basic_streambuf_wchar_sync(this);
2465 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2466 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2467 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2468 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2469 #if STREAMSIZE_BITS == 64
2470 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2471 #else
2472 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2473 #endif
2474 #if _MSVCP_VER >= 100
2475 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2476 #else
2477 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2478 #endif
2479 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2481 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2482 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2485 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2486 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2487 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2488 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2489 #if STREAMSIZE_BITS == 64
2490 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2491 #else
2492 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2493 #endif
2494 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2496 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2497 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2500 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2501 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2502 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2503 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2504 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2505 #if _MSVCP_VER >= 100
2506 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2507 #else
2508 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2509 #endif
2510 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2512 TRACE("(%p)\n", this);
2513 return 0;
2516 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2517 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2518 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2519 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2520 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2521 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2523 streamsize ret;
2525 TRACE("(%p)\n", this);
2527 ret = basic_streambuf_wchar__Gnavail(this);
2528 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2531 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2532 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2533 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2534 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2535 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2536 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2538 TRACE("(%p %d)\n", this, ch);
2539 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2540 (*this->prsize)++;
2541 (*this->prpos)--;
2542 return ch;
2545 return call_basic_streambuf_wchar_pbackfail(this, ch);
2548 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2549 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2550 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2551 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2552 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2553 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2555 TRACE("(%p %d)\n", this, ch);
2556 return basic_streambuf_wchar__Pnavail(this) ?
2557 (*basic_streambuf_wchar__Pninc(this) = ch) :
2558 call_basic_streambuf_wchar_overflow(this, ch);
2561 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2562 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2563 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2564 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2565 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2566 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2568 TRACE("(%p)\n", this);
2569 if(*this->prpos && *this->prpos>*this->prbuf) {
2570 (*this->prsize)++;
2571 (*this->prpos)--;
2572 return **this->prpos;
2575 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2578 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2579 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2580 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2581 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2582 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2583 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2585 TRACE("(%p)\n", this);
2586 if(basic_streambuf_wchar__Gnavail(this))
2587 basic_streambuf_wchar__Gninc(this);
2588 else
2589 call_basic_streambuf_wchar_uflow(this);
2592 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2593 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2594 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2595 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2596 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2597 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2599 TRACE("(%p)\n", this);
2600 return basic_streambuf_wchar__Gnavail(this) ?
2601 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2604 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2605 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2606 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2607 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2608 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2609 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2611 TRACE("(%p)\n", this);
2612 return basic_streambuf_wchar__Gnavail(this) ?
2613 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2616 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2617 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2618 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2619 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2620 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2621 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2623 TRACE("(%p)\n", this);
2625 if(basic_streambuf_wchar__Gnavail(this) > 1)
2626 return *basic_streambuf_wchar__Gnpreinc(this);
2627 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2628 WEOF : basic_streambuf_wchar_sgetc(this);
2631 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2632 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2633 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2634 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2635 #if STREAMSIZE_BITS == 64
2636 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2637 #else
2638 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2639 #endif
2640 #if _MSVCP_VER >= 100
2641 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2642 #elif _MSVCP_VER >= 80
2643 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2644 #else
2645 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2646 #endif
2647 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2649 streamsize copied, chunk;
2651 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2653 for(copied=0; copied<count;) {
2654 chunk = basic_streambuf_wchar__Pnavail(this);
2655 if(chunk > count-copied)
2656 chunk = count-copied;
2658 if(chunk > 0) {
2659 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2660 *this->pwpos += chunk;
2661 *this->pwsize -= chunk;
2662 copied += chunk;
2663 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2664 copied++;
2665 }else {
2666 break;
2670 return copied;
2673 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2674 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2675 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2676 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2677 #if STREAMSIZE_BITS == 64
2678 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2679 #else
2680 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2681 #endif
2682 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2684 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2685 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2688 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
2689 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
2690 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2691 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2692 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8)
2693 void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r)
2695 basic_streambuf_wchar tmp;
2697 TRACE("(%p %p)\n", this, r);
2699 if(this == r)
2700 return;
2702 tmp = *this;
2703 *this = *r;
2704 this->vtable = tmp.vtable;
2705 tmp.vtable = r->vtable;
2706 *r = tmp;
2709 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2710 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2711 int basic_filebuf_char__Init__Stinit = 0;
2713 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2714 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2715 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2716 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2718 TRACE("(%p %p %d)\n", this, file, which);
2720 this->cvt = NULL;
2721 this->wrotesome = FALSE;
2722 this->state = basic_filebuf_char__Init__Stinit;
2723 this->close = (which == INITFL_open);
2724 this->file = file;
2726 basic_streambuf_char__Init_empty(&this->base);
2727 if(file)
2728 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2729 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2732 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
2733 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
2734 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 8)
2735 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this, codecvt_char *cvt)
2737 TRACE("(%p %p)\n", this, cvt);
2739 if(codecvt_base_always_noconv(&cvt->base)) {
2740 this->cvt = NULL;
2741 }else {
2742 basic_streambuf_char__Init_empty(&this->base);
2743 this->cvt = cvt;
2747 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
2748 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
2749 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Endwrite, 4)
2750 MSVCP_bool __thiscall basic_filebuf_char__Endwrite(basic_filebuf_char *this)
2752 TRACE("(%p)\n", this);
2754 if(!this->wrotesome || !this->cvt)
2755 return TRUE;
2758 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2759 return FALSE;
2761 while(1) {
2762 /* TODO: check if we need a dynamic buffer here */
2763 char buf[128];
2764 char *next;
2765 int ret;
2767 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
2768 switch(ret) {
2769 case CODECVT_ok:
2770 this->wrotesome = FALSE;
2771 /* fall through */
2772 case CODECVT_partial:
2773 if(!fwrite(buf, next-buf, 1, this->file))
2774 return FALSE;
2775 if(this->wrotesome)
2776 break;
2777 /* fall through */
2778 case CODECVT_noconv:
2779 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2780 return FALSE;
2781 return TRUE;
2782 default:
2783 return FALSE;
2788 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2789 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2790 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2791 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2793 basic_filebuf_char *ret = this;
2795 TRACE("(%p)\n", this);
2797 if(!this->file)
2798 return NULL;
2800 /* TODO: handle exceptions */
2801 if(!basic_filebuf_char__Endwrite(this))
2802 ret = NULL;
2803 if(fclose(this->file))
2804 ret = NULL;
2806 basic_filebuf_char__Init(this, NULL, INITFL_close);
2807 return ret;
2810 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2811 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2812 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2813 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2815 TRACE("(%p %p)\n", this, file);
2817 basic_streambuf_char_ctor(&this->base);
2818 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2820 basic_filebuf_char__Init(this, file, INITFL_new);
2821 return this;
2824 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2825 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2826 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2827 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2829 return basic_filebuf_char_ctor_file(this, NULL);
2832 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2833 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2834 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2835 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2837 TRACE("(%p %d)\n", this, uninitialized);
2839 basic_streambuf_char_ctor(&this->base);
2840 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2841 return this;
2844 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2845 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2846 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2847 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2849 TRACE("(%p)\n", this);
2851 if(this->close)
2852 basic_filebuf_char_close(this);
2853 basic_streambuf_char_dtor(&this->base);
2856 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
2857 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2859 TRACE("(%p %x)\n", this, flags);
2860 if(flags & 2) {
2861 /* we have an array, with the number of elements stored before the first object */
2862 INT_PTR i, *ptr = (INT_PTR *)this-1;
2864 for(i=*ptr-1; i>=0; i--)
2865 basic_filebuf_char_dtor(this+i);
2866 MSVCRT_operator_delete(ptr);
2867 } else {
2868 basic_filebuf_char_dtor(this);
2869 if(flags & 1)
2870 MSVCRT_operator_delete(this);
2873 return this;
2876 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2877 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2878 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2879 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2881 TRACE("(%p)\n", this);
2882 return this->file != NULL;
2885 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
2886 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
2887 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
2889 static const wchar_t rW[] = {'r',0};
2890 static const struct {
2891 int mode;
2892 const wchar_t str[4];
2893 const wchar_t str_bin[4];
2894 } str_mode[] = {
2895 {OPENMODE_out, {'w',0}, {'w','b',0}},
2896 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
2897 {OPENMODE_app, {'a',0}, {'a','b',0}},
2898 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
2899 {OPENMODE_in, {'r',0}, {'r','b',0}},
2900 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
2901 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
2902 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
2903 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
2906 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2907 size_t mode_idx;
2908 FILE *f = NULL;
2910 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
2912 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
2913 if(str_mode[mode_idx].mode == real_mode)
2914 break;
2915 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
2916 return NULL;
2918 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
2919 return NULL;
2920 else if(f)
2921 fclose(f);
2923 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2924 && (f = _wfopen(name, rW))) {
2925 fclose(f);
2926 return NULL;
2929 #if _MSVCP_VER < 80 /* msvcp60 - msvcp71 are ignoring prot argument */
2930 prot = SH_DENYNO;
2931 #endif
2933 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2934 : str_mode[mode_idx].str, prot);
2935 if(!f)
2936 return NULL;
2938 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2939 fclose(f);
2940 return NULL;
2943 return f;
2946 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
2947 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
2948 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
2950 wchar_t nameW[FILENAME_MAX];
2952 TRACE("(%s %d %d)\n", name, mode, prot);
2954 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2955 return NULL;
2956 return _Fiopen_wchar(nameW, mode, prot);
2959 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2960 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2961 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2962 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2963 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
2964 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2966 FILE *f = NULL;
2968 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2970 if(basic_filebuf_char_is_open(this))
2971 return NULL;
2973 if(!(f = _Fiopen_wchar(name, mode, prot)))
2974 return NULL;
2976 basic_filebuf_char__Init(this, f, INITFL_open);
2977 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(this->base.loc));
2978 return this;
2981 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
2982 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
2983 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
2984 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
2985 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
2986 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
2988 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
2991 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2992 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2993 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
2994 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2996 wchar_t nameW[FILENAME_MAX];
2998 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3000 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3001 return NULL;
3002 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
3005 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
3006 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
3007 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
3008 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
3010 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3013 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3014 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3015 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
3016 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
3018 char buf[8], *dyn_buf;
3019 char ch = c, *to_next;
3020 const char *from_next;
3021 int ret, max_size;
3024 TRACE("(%p %d)\n", this, c);
3026 if(!basic_filebuf_char_is_open(this))
3027 return EOF;
3028 if(c == EOF)
3029 return !c;
3031 if(!this->cvt)
3032 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3034 from_next = &ch;
3035 do {
3036 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3037 &from_next, buf, buf+sizeof(buf), &to_next);
3039 switch(ret) {
3040 case CODECVT_partial:
3041 if(to_next == buf)
3042 break;
3043 /* fall through */
3044 case CODECVT_ok:
3045 if(!fwrite(buf, to_next-buf, 1, this->file))
3046 return EOF;
3047 if(ret == CODECVT_partial)
3048 continue;
3049 return c;
3050 case CODECVT_noconv:
3051 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3052 default:
3053 return EOF;
3056 break;
3057 } while(1);
3059 max_size = codecvt_base_max_length(&this->cvt->base);
3060 dyn_buf = malloc(max_size);
3061 if(!dyn_buf)
3062 return EOF;
3064 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3065 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3067 switch(ret) {
3068 case CODECVT_ok:
3069 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3070 free(dyn_buf);
3071 return ret ? c : EOF;
3072 case CODECVT_partial:
3073 ERR("buffer should be big enough to store all output\n");
3074 /* fall through */
3075 default:
3076 free(dyn_buf);
3077 return EOF;
3081 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3082 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3083 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
3084 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
3086 TRACE("(%p %d)\n", this, c);
3088 if(!basic_filebuf_char_is_open(this))
3089 return EOF;
3091 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
3092 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
3093 basic_streambuf_char__Gndec(&this->base);
3094 return c==EOF ? !c : c;
3095 }else if(c!=EOF && !this->cvt) {
3096 return ungetc(c, this->file);
3099 return EOF;
3102 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3103 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3104 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
3105 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
3107 char ch, buf[128], *to_next;
3108 const char *buf_next;
3109 int c, j;
3110 size_t i;
3112 TRACE("(%p)\n", this);
3114 if(!basic_filebuf_char_is_open(this))
3115 return EOF;
3117 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3118 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
3120 c = fgetc(this->file);
3121 if(!this->cvt || c==EOF)
3122 return c;
3124 buf_next = buf;
3125 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3126 buf[i] = c;
3128 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
3129 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3130 case CODECVT_partial:
3131 case CODECVT_ok:
3132 if(to_next == &ch) {
3133 c = fgetc(this->file);
3134 if(c == EOF)
3135 return EOF;
3136 continue;
3139 for(j = --i; j >= buf_next-buf; j--)
3140 ungetc(buf[j], this->file);
3141 return ch;
3142 case CODECVT_noconv:
3143 return (unsigned char)buf[0];
3144 default:
3145 return EOF;
3149 FIXME("buffer is too small\n");
3150 return EOF;
3153 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3154 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3155 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
3156 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
3158 int ret;
3160 TRACE("(%p)\n", this);
3162 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3163 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
3165 ret = call_basic_streambuf_char_uflow(&this->base);
3166 if(ret != EOF)
3167 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
3168 return ret;
3171 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3172 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3173 #if STREAMOFF_BITS == 64
3174 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
3175 #else
3176 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
3177 #endif
3178 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
3179 fpos_int *ret, streamoff off, int way, int mode)
3181 fpos_t pos;
3183 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3185 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3186 || fseek(this->file, off, way)) {
3187 ret->off = -1;
3188 ret->pos = 0;
3189 ret->state = 0;
3190 return ret;
3193 fgetpos(this->file, &pos);
3194 ret->off = 0;
3195 ret->pos = pos;
3196 ret->state = this->state;
3197 return ret;
3200 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3201 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3202 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
3203 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
3204 fpos_int *ret, fpos_int pos, int mode)
3206 fpos_t fpos;
3208 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3210 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3211 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3212 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3213 ret->off = -1;
3214 ret->pos = 0;
3215 ret->state = 0;
3216 return ret;
3219 fgetpos(this->file, &fpos);
3220 ret->off = 0;
3221 ret->pos = fpos;
3222 ret->state = this->state;
3223 return ret;
3226 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
3227 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
3228 #if STREAMSIZE_BITS == 64
3229 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
3230 #else
3231 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
3232 #endif
3233 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
3235 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3237 if(!basic_filebuf_char_is_open(this))
3238 return NULL;
3240 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3241 return NULL;
3243 basic_filebuf_char__Init(this, this->file, INITFL_open);
3244 return &this->base;
3247 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3248 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3249 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3250 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3252 TRACE("(%p)\n", this);
3254 if(!basic_filebuf_char_is_open(this))
3255 return 0;
3257 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3258 return 0;
3259 return fflush(this->file);
3262 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
3263 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
3264 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
3265 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
3267 TRACE("(%p %p)\n", this, loc);
3268 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(loc));
3271 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3272 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3273 int basic_filebuf_wchar__Init__Stinit = 0;
3275 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3276 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3277 int basic_filebuf_short__Init__Stinit = 0;
3279 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3280 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3281 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3282 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3284 TRACE("(%p %p %d)\n", this, file, which);
3286 this->cvt = NULL;
3287 this->wrotesome = FALSE;
3288 this->state = basic_filebuf_wchar__Init__Stinit;
3289 this->close = (which == INITFL_open);
3290 this->file = file;
3292 basic_streambuf_wchar__Init_empty(&this->base);
3295 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3296 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3297 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3298 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3300 TRACE("(%p %p %d)\n", this, file, which);
3302 this->cvt = NULL;
3303 this->wrotesome = FALSE;
3304 this->state = basic_filebuf_short__Init__Stinit;
3305 this->close = (which == INITFL_open);
3306 this->file = file;
3308 basic_streambuf_wchar__Init_empty(&this->base);
3311 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
3312 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
3313 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
3314 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
3315 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 8)
3316 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
3318 TRACE("(%p %p)\n", this, cvt);
3320 if(codecvt_base_always_noconv(&cvt->base)) {
3321 this->cvt = NULL;
3322 }else {
3323 basic_streambuf_wchar__Init_empty(&this->base);
3324 this->cvt = cvt;
3328 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAE_NXZ */
3329 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAA_NXZ */
3330 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAE_NXZ */
3331 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAA_NXZ */
3332 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Endwrite, 4)
3333 MSVCP_bool __thiscall basic_filebuf_wchar__Endwrite(basic_filebuf_wchar *this)
3335 TRACE("(%p)\n", this);
3337 if(!this->wrotesome || !this->cvt)
3338 return TRUE;
3340 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3341 return FALSE;
3343 while(1) {
3344 /* TODO: check if we need a dynamic buffer here */
3345 char buf[128];
3346 char *next;
3347 int ret;
3349 ret = codecvt_wchar_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3350 switch(ret) {
3351 case CODECVT_ok:
3352 this->wrotesome = FALSE;
3353 /* fall through */
3354 case CODECVT_partial:
3355 if(!fwrite(buf, next-buf, 1, this->file))
3356 return FALSE;
3357 if(this->wrotesome)
3358 break;
3359 /* fall through */
3360 case CODECVT_noconv:
3361 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3362 return FALSE;
3363 return TRUE;
3364 default:
3365 return FALSE;
3370 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3371 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3372 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3373 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3374 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3375 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3377 basic_filebuf_wchar *ret = this;
3379 TRACE("(%p)\n", this);
3381 if(!this->file)
3382 return NULL;
3384 /* TODO: handle exceptions */
3385 if(!basic_filebuf_wchar__Endwrite(this))
3386 ret = NULL;
3387 if(fclose(this->file))
3388 ret = NULL;
3390 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3391 return ret;
3394 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3395 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3396 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3397 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3399 TRACE("(%p %p)\n", this, file);
3401 basic_streambuf_wchar_ctor(&this->base);
3402 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3404 basic_filebuf_wchar__Init(this, file, INITFL_new);
3405 return this;
3408 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3409 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3410 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3411 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3413 TRACE("(%p %p)\n", this, file);
3415 basic_streambuf_short_ctor(&this->base);
3416 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3418 basic_filebuf_short__Init(this, file, INITFL_new);
3419 return this;
3422 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3423 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3424 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3425 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3427 return basic_filebuf_wchar_ctor_file(this, NULL);
3430 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3431 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3432 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3433 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3435 return basic_filebuf_short_ctor_file(this, NULL);
3438 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3439 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3440 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3441 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3443 TRACE("(%p %d)\n", this, uninitialized);
3445 basic_streambuf_wchar_ctor(&this->base);
3446 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3447 return this;
3450 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3451 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3452 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3453 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3455 TRACE("(%p %d)\n", this, uninitialized);
3457 basic_streambuf_short_ctor(&this->base);
3458 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3459 return this;
3462 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3463 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3464 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3465 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3466 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3467 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3469 TRACE("(%p)\n", this);
3471 if(this->close)
3472 basic_filebuf_wchar_close(this);
3473 basic_streambuf_wchar_dtor(&this->base);
3476 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3477 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3479 TRACE("(%p %x)\n", this, flags);
3480 if(flags & 2) {
3481 /* we have an array, with the number of elements stored before the first object */
3482 INT_PTR i, *ptr = (INT_PTR *)this-1;
3484 for(i=*ptr-1; i>=0; i--)
3485 basic_filebuf_wchar_dtor(this+i);
3486 MSVCRT_operator_delete(ptr);
3487 } else {
3488 basic_filebuf_wchar_dtor(this);
3489 if(flags & 1)
3490 MSVCRT_operator_delete(this);
3493 return this;
3496 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3497 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3498 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3499 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3500 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3501 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3503 TRACE("(%p)\n", this);
3504 return this->file != NULL;
3507 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3508 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3509 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3510 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3511 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3512 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3514 FILE *f = NULL;
3516 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3518 if(basic_filebuf_wchar_is_open(this))
3519 return NULL;
3521 if(!(f = _Fiopen_wchar(name, mode, prot)))
3522 return NULL;
3524 basic_filebuf_wchar__Init(this, f, INITFL_open);
3525 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(this->base.loc));
3526 return this;
3529 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3530 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3531 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3532 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3533 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3534 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3536 FILE *f = NULL;
3538 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3540 if(basic_filebuf_wchar_is_open(this))
3541 return NULL;
3543 if(!(f = _Fiopen_wchar(name, mode, prot)))
3544 return NULL;
3546 basic_filebuf_short__Init(this, f, INITFL_open);
3547 basic_filebuf_wchar__Initcvt(this, codecvt_short_use_facet(this->base.loc));
3548 return this;
3551 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3552 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3553 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3554 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3555 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3556 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3558 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3561 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3562 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3563 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3564 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3565 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3566 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3568 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3571 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3572 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3573 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3574 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3576 wchar_t nameW[FILENAME_MAX];
3578 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3580 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3581 return NULL;
3582 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3585 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3586 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3587 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3588 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3590 wchar_t nameW[FILENAME_MAX];
3592 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3594 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3595 return NULL;
3596 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3599 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3600 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3601 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3602 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3604 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3607 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3608 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3609 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3610 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3612 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3615 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3616 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3617 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3618 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3619 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3620 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3622 char buf[8], *dyn_buf, *to_next;
3623 wchar_t ch = c;
3624 const wchar_t *from_next;
3625 int max_size;
3626 unsigned short ret;
3629 TRACE("(%p %d)\n", this, c);
3631 if(!basic_filebuf_wchar_is_open(this))
3632 return WEOF;
3633 if(c == WEOF)
3634 return !c;
3636 if(!this->cvt)
3637 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3639 from_next = &ch;
3640 do {
3641 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3642 &from_next, buf, buf+sizeof(buf), &to_next);
3644 switch(ret) {
3645 case CODECVT_partial:
3646 if(to_next == buf)
3647 break;
3648 /* fall through */
3649 case CODECVT_ok:
3650 if(!fwrite(buf, to_next-buf, 1, this->file))
3651 return WEOF;
3652 if(ret == CODECVT_partial)
3653 continue;
3654 return c;
3655 case CODECVT_noconv:
3656 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3657 default:
3658 return WEOF;
3661 break;
3662 } while(1);
3664 max_size = codecvt_base_max_length(&this->cvt->base);
3665 dyn_buf = malloc(max_size);
3666 if(!dyn_buf)
3667 return WEOF;
3669 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3670 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3672 switch(ret) {
3673 case CODECVT_ok:
3674 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3675 free(dyn_buf);
3676 return ret ? c : WEOF;
3677 case CODECVT_partial:
3678 ERR("buffer should be big enough to store all output\n");
3679 /* fall through */
3680 default:
3681 free(dyn_buf);
3682 return WEOF;
3686 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3687 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3688 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3689 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3690 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3691 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3693 TRACE("(%p %d)\n", this, c);
3695 if(!basic_filebuf_wchar_is_open(this))
3696 return WEOF;
3698 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3699 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3700 basic_streambuf_wchar__Gndec(&this->base);
3701 return c==WEOF ? !c : c;
3702 }else if(c!=WEOF && !this->cvt) {
3703 return ungetwc(c, this->file);
3704 }else if(c!=WEOF && basic_streambuf_wchar_gptr(&this->base)!=&this->putback) {
3705 this->putback = c;
3706 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback, &this->putback+1);
3707 return c;
3710 return WEOF;
3713 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3714 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3715 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3716 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3717 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
3718 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
3720 wchar_t ch, *to_next;
3721 char buf[128];
3722 const char *buf_next;
3723 int c, j;
3724 size_t i;
3726 TRACE("(%p)\n", this);
3728 if(!basic_filebuf_wchar_is_open(this))
3729 return WEOF;
3731 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3732 return *basic_streambuf_wchar__Gninc(&this->base);
3734 if(!this->cvt)
3735 return fgetwc(this->file);
3737 buf_next = buf;
3738 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3739 if((c = fgetc(this->file)) == EOF)
3740 return WEOF;
3741 buf[i] = c;
3743 switch(codecvt_wchar_in(this->cvt, &this->state, buf_next,
3744 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3745 case CODECVT_partial:
3746 case CODECVT_ok:
3747 if(to_next == &ch)
3748 continue;
3750 for(j = --i; j >= buf_next-buf; j--)
3751 ungetc(buf[j], this->file);
3752 return ch;
3753 case CODECVT_noconv:
3754 if(i+1 < sizeof(wchar_t))
3755 continue;
3757 memcpy(&ch, buf, sizeof(wchar_t));
3758 return ch;
3759 default:
3760 return WEOF;
3764 FIXME("buffer is too small\n");
3765 return WEOF;
3768 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3769 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3770 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3771 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3772 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
3773 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
3775 unsigned short ret;
3777 TRACE("(%p)\n", this);
3779 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3780 return *basic_streambuf_wchar_gptr(&this->base);
3782 ret = call_basic_streambuf_wchar_uflow(&this->base);
3783 if(ret != WEOF)
3784 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
3785 return ret;
3788 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3789 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3790 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3791 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3792 #if STREAMOFF_BITS == 64
3793 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
3794 #else
3795 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
3796 #endif
3797 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
3798 fpos_int *ret, streamoff off, int way, int mode)
3800 fpos_t pos;
3802 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3804 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback) {
3805 if(way == SEEKDIR_cur)
3806 off -= sizeof(wchar_t);
3808 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3811 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3812 || fseek(this->file, off, way)) {
3813 ret->off = -1;
3814 ret->pos = 0;
3815 ret->state = 0;
3816 return ret;
3819 fgetpos(this->file, &pos);
3820 ret->off = 0;
3821 ret->pos = pos;
3822 ret->state = this->state;
3823 return ret;
3826 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3827 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3828 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3829 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3830 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
3831 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
3832 fpos_int *ret, fpos_int pos, int mode)
3834 fpos_t fpos;
3836 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3838 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3839 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3840 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3841 ret->off = -1;
3842 ret->pos = 0;
3843 ret->state = 0;
3844 return ret;
3847 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback)
3848 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3850 fgetpos(this->file, &fpos);
3851 ret->off = 0;
3852 ret->pos = fpos;
3853 ret->state = this->state;
3854 return ret;
3857 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
3858 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
3859 #if STREAMSIZE_BITS == 64
3860 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
3861 #else
3862 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
3863 #endif
3864 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3866 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3868 if(!basic_filebuf_wchar_is_open(this))
3869 return NULL;
3871 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3872 return NULL;
3874 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
3875 return &this->base;
3878 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
3879 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
3880 #if STREAMSIZE_BITS == 64
3881 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
3882 #else
3883 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
3884 #endif
3885 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3887 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3889 if(!basic_filebuf_wchar_is_open(this))
3890 return NULL;
3892 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3893 return NULL;
3895 basic_filebuf_short__Init(this, this->file, INITFL_open);
3896 return &this->base;
3899 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
3900 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
3901 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
3902 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
3903 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
3904 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
3906 TRACE("(%p)\n", this);
3908 if(!basic_filebuf_wchar_is_open(this))
3909 return 0;
3911 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3912 return 0;
3913 return fflush(this->file);
3916 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
3917 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
3918 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
3919 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
3921 TRACE("(%p %p)\n", this, loc);
3922 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(loc));
3925 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
3926 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
3927 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
3928 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
3930 TRACE("(%p %p)\n", this, loc);
3931 basic_filebuf_wchar__Initcvt(this, codecvt_short_use_facet(loc));
3934 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3935 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3936 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
3937 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
3939 int state = 0;
3941 if(!(mode & OPENMODE_in))
3942 state |= STRINGBUF_no_read;
3944 if(!(mode & OPENMODE_out))
3945 state |= STRINGBUF_no_write;
3947 if(mode & OPENMODE_ate)
3948 state |= STRINGBUF_at_end;
3950 if(mode & OPENMODE_app)
3951 state |= STRINGBUF_append;
3953 return state;
3956 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
3957 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
3958 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
3959 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
3961 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
3963 basic_streambuf_char__Init_empty(&this->base);
3965 this->state = state;
3966 this->seekhigh = NULL;
3968 if(count && str) {
3969 char *buf = MSVCRT_operator_new(count);
3970 if(!buf) {
3971 ERR("Out of memory\n");
3972 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3975 memcpy(buf, str, count);
3976 this->seekhigh = buf + count;
3978 this->state |= STRINGBUF_allocated;
3980 if(!(state & STRINGBUF_no_read))
3981 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
3983 if(!(state & STRINGBUF_no_write)) {
3984 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3986 if(!basic_streambuf_char_gptr(&this->base))
3987 basic_streambuf_char_setg(&this->base, buf, 0, buf);
3992 /* ??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 */
3993 /* ??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 */
3994 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
3995 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
3996 const basic_string_char *str, IOSB_openmode mode)
3998 TRACE("(%p %p %d)\n", this, str, mode);
4000 basic_streambuf_char_ctor(&this->base);
4001 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4003 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
4004 str->size, basic_stringbuf_char__Getstate(this, mode));
4005 return this;
4008 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
4009 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
4010 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
4011 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
4012 basic_stringbuf_char *this, IOSB_openmode mode)
4014 TRACE("(%p %d)\n", this, mode);
4016 basic_streambuf_char_ctor(&this->base);
4017 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4019 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
4020 return this;
4023 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
4024 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
4025 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
4026 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
4028 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4031 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
4032 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
4033 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
4034 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
4036 TRACE("(%p)\n", this);
4038 if(this->state & STRINGBUF_allocated) {
4039 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
4040 this->seekhigh = NULL;
4041 this->state &= ~STRINGBUF_allocated;
4044 basic_streambuf_char__Init_empty(&this->base);
4047 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
4048 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
4049 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
4050 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
4052 TRACE("(%p)\n", this);
4054 basic_stringbuf_char__Tidy(this);
4055 basic_streambuf_char_dtor(&this->base);
4058 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
4059 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
4061 TRACE("(%p %x)\n", this, flags);
4063 if(flags & 2) {
4064 /* we have an array, with the number of elements stored before the first object */
4065 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4067 for (i = *ptr - 1; i >= 0; i--)
4068 basic_stringbuf_char_dtor(this+i);
4070 MSVCRT_operator_delete(ptr);
4071 }else {
4072 basic_stringbuf_char_dtor(this);
4074 if(flags & 1)
4075 MSVCRT_operator_delete(this);
4078 return this;
4081 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4082 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4083 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
4084 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
4086 MSVCP_size_t oldsize, size;
4087 char *ptr, *buf;
4089 TRACE("(%p %x)\n", this, meta);
4091 if(meta == EOF)
4092 return !EOF;
4093 if(this->state & STRINGBUF_no_write)
4094 return EOF;
4096 ptr = basic_streambuf_char_pptr(&this->base);
4097 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4098 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
4099 this->seekhigh, basic_streambuf_char_epptr(&this->base));
4101 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
4102 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4104 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
4105 size = oldsize|0xf;
4106 size += size/2;
4107 buf = MSVCRT_operator_new(size);
4108 if(!buf) {
4109 ERR("Out of memory\n");
4110 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4113 if(!oldsize) {
4114 this->seekhigh = buf;
4115 basic_streambuf_char_setp(&this->base, buf, buf+size);
4116 if(this->state & STRINGBUF_no_read)
4117 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4118 else
4119 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
4121 this->state |= STRINGBUF_allocated;
4122 }else {
4123 ptr = basic_streambuf_char_eback(&this->base);
4124 memcpy(buf, ptr, oldsize);
4126 this->seekhigh = buf+(this->seekhigh-ptr);
4127 basic_streambuf_char_setp_next(&this->base, buf,
4128 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
4129 if(this->state & STRINGBUF_no_read)
4130 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4131 else
4132 basic_streambuf_char_setg(&this->base, buf,
4133 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
4134 basic_streambuf_char_pptr(&this->base)+1);
4136 MSVCRT_operator_delete(ptr);
4139 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4142 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4143 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4144 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
4145 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
4147 char *cur;
4149 TRACE("(%p %x)\n", this, c);
4151 cur = basic_streambuf_char_gptr(&this->base);
4152 if(!cur || cur==basic_streambuf_char_eback(&this->base)
4153 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4154 return EOF;
4156 if(c != EOF)
4157 cur[-1] = c;
4158 basic_streambuf_char_gbump(&this->base, -1);
4159 return c==EOF ? !EOF : c;
4162 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
4163 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
4164 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
4165 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
4167 char *ptr, *cur;
4169 TRACE("(%p)\n", this);
4171 cur = basic_streambuf_char_gptr(&this->base);
4172 if(!cur || this->state&STRINGBUF_no_read)
4173 return EOF;
4175 ptr = basic_streambuf_char_pptr(&this->base);
4176 if(this->seekhigh < ptr)
4177 this->seekhigh = ptr;
4179 ptr = basic_streambuf_char_egptr(&this->base);
4180 if(this->seekhigh > ptr)
4181 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
4183 if(cur < this->seekhigh)
4184 return (unsigned char)*cur;
4185 return EOF;
4188 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4189 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4190 #if STREAMOFF_BITS == 64
4191 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
4192 #else
4193 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
4194 #endif
4195 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
4196 fpos_int *ret, streamoff off, int way, int mode)
4198 char *beg, *cur_r, *cur_w;
4200 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4202 cur_w = basic_streambuf_char_pptr(&this->base);
4203 if(cur_w > this->seekhigh)
4204 this->seekhigh = cur_w;
4206 ret->off = 0;
4207 ret->pos = 0;
4208 ret->state = 0;
4210 beg = basic_streambuf_char_eback(&this->base);
4211 cur_r = basic_streambuf_char_gptr(&this->base);
4212 if((mode & OPENMODE_in) && cur_r) {
4213 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4214 off += cur_r-beg;
4215 else if(way == SEEKDIR_end)
4216 off += this->seekhigh-beg;
4217 else if(way != SEEKDIR_beg)
4218 off = -1;
4220 if(off<0 || off>this->seekhigh-beg) {
4221 off = -1;
4222 }else {
4223 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
4224 if((mode & OPENMODE_out) && cur_w) {
4225 basic_streambuf_char_setp_next(&this->base, beg,
4226 basic_streambuf_char_gptr(&this->base),
4227 basic_streambuf_char_epptr(&this->base));
4230 }else if((mode & OPENMODE_out) && cur_w) {
4231 if(way == SEEKDIR_cur)
4232 off += cur_w-beg;
4233 else if(way == SEEKDIR_end)
4234 off += this->seekhigh-beg;
4235 else if(way != SEEKDIR_beg)
4236 off = -1;
4238 if(off<0 || off>this->seekhigh-beg)
4239 off = -1;
4240 else
4241 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
4242 }else {
4243 off = -1;
4246 ret->off = off;
4247 return ret;
4250 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4251 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4252 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
4253 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
4254 fpos_int *ret, fpos_int pos, int mode)
4256 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4258 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4259 *ret = pos;
4260 return ret;
4263 return basic_stringbuf_char_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
4266 /* ?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 */
4267 /* ?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 */
4268 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
4269 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
4271 TRACE("(%p %p)\n", this, str);
4273 basic_stringbuf_char__Tidy(this);
4274 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
4277 /* ?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 */
4278 /* ?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 */
4279 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
4280 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
4282 char *ptr;
4284 TRACE("(%p)\n", this);
4286 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
4287 char *pptr;
4289 ptr = basic_streambuf_char_pbase(&this->base);
4290 pptr = basic_streambuf_char_pptr(&this->base);
4292 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4295 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
4296 ptr = basic_streambuf_char_eback(&this->base);
4297 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
4300 return MSVCP_basic_string_char_ctor(ret);
4303 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
4304 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
4305 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4306 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4307 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
4308 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
4310 int state = 0;
4312 if(!(mode & OPENMODE_in))
4313 state |= STRINGBUF_no_read;
4315 if(!(mode & OPENMODE_out))
4316 state |= STRINGBUF_no_write;
4318 if(mode & OPENMODE_ate)
4319 state |= STRINGBUF_at_end;
4321 if(mode & OPENMODE_app)
4322 state |= STRINGBUF_append;
4324 return state;
4327 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
4328 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
4329 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
4330 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
4331 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
4332 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
4334 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
4336 basic_streambuf_wchar__Init_empty(&this->base);
4338 this->state = state;
4339 this->seekhigh = NULL;
4341 if(count && str) {
4342 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
4343 if(!buf) {
4344 ERR("Out of memory\n");
4345 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4348 memcpy(buf, str, count*sizeof(wchar_t));
4349 this->seekhigh = buf + count;
4351 this->state |= STRINGBUF_allocated;
4353 if(!(state & STRINGBUF_no_read))
4354 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
4356 if(!(state & STRINGBUF_no_write)) {
4357 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4359 if(!basic_streambuf_wchar_gptr(&this->base))
4360 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
4365 /* ??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 */
4366 /* ??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 */
4367 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
4368 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
4369 const basic_string_wchar *str, IOSB_openmode mode)
4371 TRACE("(%p %p %d)\n", this, str, mode);
4373 basic_streambuf_wchar_ctor(&this->base);
4374 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4376 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
4377 str->size, basic_stringbuf_wchar__Getstate(this, mode));
4378 return this;
4381 /* ??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 */
4382 /* ??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 */
4383 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
4384 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
4385 const basic_string_wchar *str, IOSB_openmode mode)
4387 basic_stringbuf_wchar_ctor_str(this, str, mode);
4388 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4389 return this;
4392 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4393 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4394 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4395 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4396 basic_stringbuf_wchar *this, IOSB_openmode mode)
4398 TRACE("(%p %d)\n", this, mode);
4400 basic_streambuf_wchar_ctor(&this->base);
4401 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4403 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4404 return this;
4407 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4408 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4409 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4410 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4411 basic_stringbuf_wchar *this, IOSB_openmode mode)
4413 basic_stringbuf_wchar_ctor_mode(this, mode);
4414 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4415 return this;
4418 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4419 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4420 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4421 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4423 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4426 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4427 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4428 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4429 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4431 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4434 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4435 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4436 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4437 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4438 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4439 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4441 TRACE("(%p)\n", this);
4443 if(this->state & STRINGBUF_allocated) {
4444 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4445 this->seekhigh = NULL;
4446 this->state &= ~STRINGBUF_allocated;
4449 basic_streambuf_wchar__Init_empty(&this->base);
4452 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4453 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4454 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4455 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4456 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4457 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4459 TRACE("(%p)\n", this);
4461 basic_stringbuf_wchar__Tidy(this);
4462 basic_streambuf_wchar_dtor(&this->base);
4465 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4466 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4468 TRACE("(%p %x)\n", this, flags);
4470 if(flags & 2) {
4471 /* we have an array, with the number of elements stored before the first object */
4472 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4474 for (i = *ptr - 1; i >= 0; i--)
4475 basic_stringbuf_wchar_dtor(this+i);
4477 MSVCRT_operator_delete(ptr);
4478 }else {
4479 basic_stringbuf_wchar_dtor(this);
4481 if(flags & 1)
4482 MSVCRT_operator_delete(this);
4485 return this;
4488 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4489 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4490 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4491 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4492 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4493 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4495 MSVCP_size_t oldsize, size;
4496 wchar_t *ptr, *buf;
4498 TRACE("(%p %x)\n", this, meta);
4500 if(meta == WEOF)
4501 return !WEOF;
4502 if(this->state & STRINGBUF_no_write)
4503 return WEOF;
4505 ptr = basic_streambuf_wchar_pptr(&this->base);
4506 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4507 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4508 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4510 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4511 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4513 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4514 size = oldsize|0xf;
4515 size += size/2;
4516 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4517 if(!buf) {
4518 ERR("Out of memory\n");
4519 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4522 if(!oldsize) {
4523 this->seekhigh = buf;
4524 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4525 if(this->state & STRINGBUF_no_read)
4526 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4527 else
4528 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4530 this->state |= STRINGBUF_allocated;
4531 }else {
4532 ptr = basic_streambuf_wchar_eback(&this->base);
4533 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4535 this->seekhigh = buf+(this->seekhigh-ptr);
4536 basic_streambuf_wchar_setp_next(&this->base, buf,
4537 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4538 if(this->state & STRINGBUF_no_read)
4539 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4540 else
4541 basic_streambuf_wchar_setg(&this->base, buf,
4542 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4543 basic_streambuf_wchar_pptr(&this->base)+1);
4545 MSVCRT_operator_delete(ptr);
4548 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4551 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4552 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4553 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4554 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4555 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4556 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4558 wchar_t *cur;
4560 TRACE("(%p %x)\n", this, c);
4562 cur = basic_streambuf_wchar_gptr(&this->base);
4563 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4564 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4565 return WEOF;
4567 if(c != WEOF)
4568 cur[-1] = c;
4569 basic_streambuf_wchar_gbump(&this->base, -1);
4570 return c==WEOF ? !WEOF : c;
4573 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4574 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4575 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4576 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4577 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4578 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4580 wchar_t *ptr, *cur;
4582 TRACE("(%p)\n", this);
4584 cur = basic_streambuf_wchar_gptr(&this->base);
4585 if(!cur || this->state&STRINGBUF_no_read)
4586 return WEOF;
4588 ptr = basic_streambuf_wchar_pptr(&this->base);
4589 if(this->seekhigh < ptr)
4590 this->seekhigh = ptr;
4592 ptr = basic_streambuf_wchar_egptr(&this->base);
4593 if(this->seekhigh > ptr)
4594 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4596 if(cur < this->seekhigh)
4597 return *cur;
4598 return WEOF;
4601 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4602 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4603 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4604 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4605 #if STREAMOFF_BITS == 64
4606 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4607 #else
4608 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4609 #endif
4610 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4611 fpos_int *ret, streamoff off, int way, int mode)
4613 wchar_t *beg, *cur_r, *cur_w;
4615 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4617 cur_w = basic_streambuf_wchar_pptr(&this->base);
4618 if(cur_w > this->seekhigh)
4619 this->seekhigh = cur_w;
4621 ret->off = 0;
4622 ret->pos = 0;
4623 ret->state = 0;
4625 beg = basic_streambuf_wchar_eback(&this->base);
4626 cur_r = basic_streambuf_wchar_gptr(&this->base);
4627 if((mode & OPENMODE_in) && cur_r) {
4628 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4629 off += cur_r-beg;
4630 else if(way == SEEKDIR_end)
4631 off += this->seekhigh-beg;
4632 else if(way != SEEKDIR_beg)
4633 off = -1;
4635 if(off<0 || off>this->seekhigh-beg) {
4636 off = -1;
4637 }else {
4638 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4639 if((mode & OPENMODE_out) && cur_w) {
4640 basic_streambuf_wchar_setp_next(&this->base, beg,
4641 basic_streambuf_wchar_gptr(&this->base),
4642 basic_streambuf_wchar_epptr(&this->base));
4645 }else if((mode & OPENMODE_out) && cur_w) {
4646 if(way == SEEKDIR_cur)
4647 off += cur_w-beg;
4648 else if(way == SEEKDIR_end)
4649 off += this->seekhigh-beg;
4650 else if(way != SEEKDIR_beg)
4651 off = -1;
4653 if(off<0 || off>this->seekhigh-beg)
4654 off = -1;
4655 else
4656 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4657 }else {
4658 off = -1;
4661 ret->off = off;
4662 return ret;
4665 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4666 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4667 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4668 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4669 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4670 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4671 fpos_int *ret, fpos_int pos, int mode)
4673 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4675 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4676 *ret = pos;
4677 return ret;
4680 return basic_stringbuf_wchar_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
4683 /* ?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 */
4684 /* ?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 */
4685 /* ?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 */
4686 /* ?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 */
4687 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4688 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4690 TRACE("(%p %p)\n", this, str);
4692 basic_stringbuf_wchar__Tidy(this);
4693 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
4696 /* ?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 */
4697 /* ?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 */
4698 /* ?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 */
4699 /* ?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 */
4700 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
4701 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
4703 wchar_t *ptr;
4705 TRACE("(%p)\n", this);
4707 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
4708 wchar_t *pptr;
4710 ptr = basic_streambuf_wchar_pbase(&this->base);
4711 pptr = basic_streambuf_wchar_pptr(&this->base);
4713 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4716 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
4717 ptr = basic_streambuf_wchar_eback(&this->base);
4718 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
4721 return MSVCP_basic_string_wchar_ctor(ret);
4724 /* ??0ios_base@std@@IAE@XZ */
4725 /* ??0ios_base@std@@IEAA@XZ */
4726 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
4727 ios_base* __thiscall ios_base_ctor(ios_base *this)
4729 TRACE("(%p)\n", this);
4730 this->vtable = &MSVCP_ios_base_vtable;
4731 return this;
4734 /* ??0ios_base@std@@QAE@ABV01@@Z */
4735 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
4736 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
4737 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
4739 TRACE("(%p %p)\n", this, copy);
4740 *this = *copy;
4741 this->vtable = &MSVCP_ios_base_vtable;
4742 return this;
4745 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
4746 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
4747 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
4748 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
4750 IOS_BASE_fnarray *cur;
4752 TRACE("(%p %x)\n", this, event);
4754 for(cur=this->calls; cur; cur=cur->next)
4755 cur->event_handler(event, this, cur->index);
4758 /* ?_Tidy@ios_base@std@@AAAXXZ */
4759 /* ?_Tidy@ios_base@std@@AEAAXXZ */
4760 void CDECL ios_base_Tidy(ios_base *this)
4762 IOS_BASE_iosarray *arr_cur, *arr_next;
4763 IOS_BASE_fnarray *event_cur, *event_next;
4765 TRACE("(%p)\n", this);
4767 ios_base_Callfns(this, EVENT_erase_event);
4769 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
4770 arr_next = arr_cur->next;
4771 MSVCRT_operator_delete(arr_cur);
4773 this->arr = NULL;
4775 for(event_cur=this->calls; event_cur; event_cur=event_next) {
4776 event_next = event_cur->next;
4777 MSVCRT_operator_delete(event_cur);
4779 this->calls = NULL;
4782 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
4783 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
4784 void CDECL ios_base_Ios_base_dtor(ios_base *obj)
4786 TRACE("(%p)\n", obj);
4787 if(obj->loc) {
4788 locale_dtor(obj->loc);
4789 MSVCRT_operator_delete(obj->loc);
4791 ios_base_Tidy(obj);
4794 /* ??1ios_base@std@@UAE@XZ */
4795 /* ??1ios_base@std@@UEAA@XZ */
4796 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
4797 void __thiscall ios_base_dtor(ios_base *this)
4799 ios_base_Ios_base_dtor(this);
4802 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
4803 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
4805 TRACE("(%p %x)\n", this, flags);
4806 if(flags & 2) {
4807 /* we have an array, with the number of elements stored before the first object */
4808 INT_PTR i, *ptr = (INT_PTR *)this-1;
4810 for(i=*ptr-1; i>=0; i--)
4811 ios_base_dtor(this+i);
4812 MSVCRT_operator_delete(ptr);
4813 } else {
4814 ios_base_dtor(this);
4815 if(flags & 1)
4816 MSVCRT_operator_delete(this);
4819 return this;
4822 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
4823 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
4825 TRACE("(%p %x)\n", this, flags);
4826 if(flags & 2) {
4827 INT_PTR *ptr = (INT_PTR *)this-1;
4828 MSVCRT_operator_delete(ptr);
4829 } else {
4830 if(flags & 1)
4831 MSVCRT_operator_delete(this);
4834 return this;
4837 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
4838 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
4839 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
4840 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
4842 IOS_BASE_iosarray *p;
4844 TRACE("(%p %d)\n", this, index);
4846 for(p=this->arr; p; p=p->next) {
4847 if(p->index == index)
4848 return p;
4851 for(p=this->arr; p; p=p->next) {
4852 if(!p->long_val && !p->ptr_val) {
4853 p->index = index;
4854 return p;
4858 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
4859 p->next = this->arr;
4860 p->index = index;
4861 p->long_val = 0;
4862 p->ptr_val = NULL;
4863 this->arr = p;
4864 return p;
4867 /* ?iword@ios_base@std@@QAEAAJH@Z */
4868 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
4869 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
4870 LONG* __thiscall ios_base_iword(ios_base *this, int index)
4872 TRACE("(%p %d)\n", this, index);
4873 return &ios_base_Findarr(this, index)->long_val;
4876 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
4877 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
4878 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
4879 void** __thiscall ios_base_pword(ios_base *this, int index)
4881 TRACE("(%p %d)\n", this, index);
4882 return &ios_base_Findarr(this, index)->ptr_val;
4885 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
4886 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
4887 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
4888 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
4890 IOS_BASE_fnarray *event;
4892 TRACE("(%p %p %d)\n", this, callback, index);
4894 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
4895 event->next = this->calls;
4896 event->index = index;
4897 event->event_handler = callback;
4898 this->calls = event;
4901 /* ?clear@ios_base@std@@QAEXH_N@Z */
4902 /* ?clear@ios_base@std@@QEAAXH_N@Z */
4903 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
4904 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4906 TRACE("(%p %x %x)\n", this, state, reraise);
4908 this->state = state & IOSTATE_mask;
4909 if(!(this->state & this->except))
4910 return;
4912 if(reraise)
4913 throw_exception(EXCEPTION_RERAISE, NULL);
4914 else if(this->state & this->except & IOSTATE_eofbit)
4915 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
4916 else if(this->state & this->except & IOSTATE_failbit)
4917 throw_exception(EXCEPTION_FAILURE, "failbit is set");
4918 else if(this->state & this->except & IOSTATE_badbit)
4919 throw_exception(EXCEPTION_FAILURE, "badbit is set");
4920 else if(this->state & this->except & IOSTATE__Hardfail)
4921 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
4924 /* ?clear@ios_base@std@@QAEXH@Z */
4925 /* ?clear@ios_base@std@@QEAAXH@Z */
4926 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
4927 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
4929 ios_base_clear_reraise(this, state, FALSE);
4932 /* ?clear@ios_base@std@@QAEXI@Z */
4933 /* ?clear@ios_base@std@@QEAAXI@Z */
4934 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
4935 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
4937 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
4940 /* ?exceptions@ios_base@std@@QAEXH@Z */
4941 /* ?exceptions@ios_base@std@@QEAAXH@Z */
4942 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
4943 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
4945 TRACE("(%p %x)\n", this, state);
4946 this->except = state & IOSTATE_mask;
4947 ios_base_clear(this, this->state);
4950 /* ?exceptions@ios_base@std@@QAEXI@Z */
4951 /* ?exceptions@ios_base@std@@QEAAXI@Z */
4952 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
4953 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
4955 TRACE("(%p %x)\n", this, state);
4956 ios_base_exceptions_set(this, state);
4959 /* ?exceptions@ios_base@std@@QBEHXZ */
4960 /* ?exceptions@ios_base@std@@QEBAHXZ */
4961 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
4962 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
4964 TRACE("(%p)\n", this);
4965 return this->except;
4968 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
4969 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
4970 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
4971 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
4973 TRACE("(%p %p)\n", this, rhs);
4975 if(this != rhs) {
4976 IOS_BASE_iosarray *arr_cur;
4977 IOS_BASE_fnarray *event_cur;
4979 ios_base_Tidy(this);
4981 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
4982 if(arr_cur->long_val)
4983 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
4984 if(arr_cur->ptr_val)
4985 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
4987 this->stdstr = rhs->stdstr;
4988 this->fmtfl = rhs->fmtfl;
4989 this->prec = rhs->prec;
4990 this->wide = rhs->wide;
4991 locale_operator_assign(this->loc, rhs->loc);
4993 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
4994 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
4996 ios_base_Callfns(this, EVENT_copyfmt_event);
4997 ios_base_exceptions_set(this, rhs->except);
5000 return this;
5003 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
5004 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
5005 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
5006 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
5008 TRACE("(%p %p)\n", this, right);
5010 if(this != right) {
5011 this->state = right->state;
5012 ios_base_copyfmt(this, right);
5015 return this;
5018 /* ?fail@ios_base@std@@QBE_NXZ */
5019 /* ?fail@ios_base@std@@QEBA_NXZ */
5020 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
5021 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
5023 TRACE("(%p)\n", this);
5024 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
5027 /* ??7ios_base@std@@QBE_NXZ */
5028 /* ??7ios_base@std@@QEBA_NXZ */
5029 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
5030 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
5032 TRACE("(%p)\n", this);
5033 return ios_base_fail(this);
5036 /* ??Bios_base@std@@QBEPAXXZ */
5037 /* ??Bios_base@std@@QEBAPEAXXZ */
5038 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
5039 void* __thiscall ios_base_op_fail(const ios_base *this)
5041 TRACE("(%p)\n", this);
5042 return ios_base_fail(this) ? NULL : (void*)this;
5045 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
5046 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
5047 void CDECL ios_base_Addstd(ios_base *add)
5049 FIXME("(%p) stub\n", add);
5052 /* ?_Index_func@ios_base@std@@CAAAHXZ */
5053 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
5054 int* CDECL ios_base_Index_func(void)
5056 TRACE("\n");
5057 return &ios_base_Index;
5060 /* ?_Init@ios_base@std@@IAEXXZ */
5061 /* ?_Init@ios_base@std@@IEAAXXZ */
5062 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
5063 void __thiscall ios_base__Init(ios_base *this)
5065 TRACE("(%p)\n", this);
5067 this->stdstr = 0;
5068 this->state = this->except = IOSTATE_goodbit;
5069 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
5070 this->prec = 6;
5071 this->wide = 0;
5072 this->arr = NULL;
5073 this->calls = NULL;
5074 this->loc = MSVCRT_operator_new(sizeof(locale));
5075 locale_ctor(this->loc);
5078 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
5079 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
5080 MSVCP_bool* CDECL ios_base_Sync_func(void)
5082 TRACE("\n");
5083 return &ios_base_Sync;
5086 /* ?bad@ios_base@std@@QBE_NXZ */
5087 /* ?bad@ios_base@std@@QEBA_NXZ */
5088 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
5089 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
5091 TRACE("(%p)\n", this);
5092 return (this->state & IOSTATE_badbit) != 0;
5095 /* ?eof@ios_base@std@@QBE_NXZ */
5096 /* ?eof@ios_base@std@@QEBA_NXZ */
5097 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
5098 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
5100 TRACE("(%p)\n", this);
5101 return (this->state & IOSTATE_eofbit) != 0;
5104 /* ?flags@ios_base@std@@QAEHH@Z */
5105 /* ?flags@ios_base@std@@QEAAHH@Z */
5106 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
5107 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
5109 IOSB_fmtflags ret = this->fmtfl;
5111 TRACE("(%p %x)\n", this, flags);
5113 this->fmtfl = flags & FMTFLAG_mask;
5114 return ret;
5117 /* ?flags@ios_base@std@@QBEHXZ */
5118 /* ?flags@ios_base@std@@QEBAHXZ */
5119 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
5120 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
5122 TRACE("(%p)\n", this);
5123 return this->fmtfl;
5126 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
5127 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
5128 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
5129 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
5131 TRACE("(%p)\n", this);
5132 return locale_copy_ctor(ret, this->loc);
5135 /* ?good@ios_base@std@@QBE_NXZ */
5136 /* ?good@ios_base@std@@QEBA_NXZ */
5137 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
5138 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
5140 TRACE("(%p)\n", this);
5141 return this->state == IOSTATE_goodbit;
5144 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
5145 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
5146 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
5147 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
5149 TRACE("(%p %p)\n", this, loc);
5150 *ret = *this->loc;
5151 locale_copy_ctor(this->loc, loc);
5152 return ret;
5155 /* ?precision@ios_base@std@@QAEHH@Z */
5156 /* ?precision@ios_base@std@@QEAA_J_J@Z */
5157 #if STREAMSIZE_BITS == 64
5158 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
5159 #else
5160 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
5161 #endif
5162 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
5164 streamsize ret = this->prec;
5166 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
5168 this->prec = precision;
5169 return ret;
5172 /* ?precision@ios_base@std@@QBEHXZ */
5173 /* ?precision@ios_base@std@@QEBA_JXZ */
5174 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
5175 streamsize __thiscall ios_base_precision_get(const ios_base *this)
5177 TRACE("(%p)\n", this);
5178 return this->prec;
5181 /* ?rdstate@ios_base@std@@QBEHXZ */
5182 /* ?rdstate@ios_base@std@@QEBAHXZ */
5183 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
5184 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
5186 TRACE("(%p)\n", this);
5187 return this->state;
5190 /* ?setf@ios_base@std@@QAEHHH@Z */
5191 /* ?setf@ios_base@std@@QEAAHHH@Z */
5192 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
5193 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
5195 IOSB_fmtflags ret = this->fmtfl;
5197 TRACE("(%p %x %x)\n", this, flags, mask);
5199 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
5200 return ret;
5203 /* ?setf@ios_base@std@@QAEHH@Z */
5204 /* ?setf@ios_base@std@@QEAAHH@Z */
5205 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
5206 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
5208 IOSB_fmtflags ret = this->fmtfl;
5210 TRACE("(%p %x)\n", this, flags);
5212 this->fmtfl |= flags & FMTFLAG_mask;
5213 return ret;
5216 /* ?setstate@ios_base@std@@QAEXH_N@Z */
5217 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
5218 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
5219 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5221 TRACE("(%p %x %x)\n", this, state, reraise);
5223 if(state != IOSTATE_goodbit)
5224 ios_base_clear_reraise(this, this->state | state, reraise);
5227 /* ?setstate@ios_base@std@@QAEXH@Z */
5228 /* ?setstate@ios_base@std@@QEAAXH@Z */
5229 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
5230 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
5232 ios_base_setstate_reraise(this, state, FALSE);
5235 /* ?setstate@ios_base@std@@QAEXI@Z */
5236 /* ?setstate@ios_base@std@@QEAAXI@Z */
5237 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
5238 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
5240 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5243 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
5244 MSVCP_bool CDECL ios_base_sync_with_stdio(MSVCP_bool sync)
5246 _Lockit lock;
5247 MSVCP_bool ret;
5249 TRACE("(%x)\n", sync);
5251 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5252 ret = ios_base_Sync;
5253 ios_base_Sync = sync;
5254 _Lockit_dtor(&lock);
5255 return ret;
5258 /* ?unsetf@ios_base@std@@QAEXH@Z */
5259 /* ?unsetf@ios_base@std@@QEAAXH@Z */
5260 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
5261 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
5263 TRACE("(%p %x)\n", this, flags);
5264 this->fmtfl &= ~flags;
5267 /* ?width@ios_base@std@@QAEHH@Z */
5268 /* ?width@ios_base@std@@QEAA_J_J@Z */
5269 #if STREAMSIZE_BITS == 64
5270 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
5271 #else
5272 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
5273 #endif
5274 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
5276 streamsize ret = this->wide;
5278 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
5280 this->wide = width;
5281 return ret;
5284 /* ?width@ios_base@std@@QBEHXZ */
5285 /* ?width@ios_base@std@@QEBA_JXZ */
5286 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
5287 streamsize __thiscall ios_base_width_get(ios_base *this)
5289 TRACE("(%p)\n", this);
5290 return this->wide;
5293 /* ?xalloc@ios_base@std@@SAHXZ */
5294 int CDECL ios_base_xalloc(void)
5296 _Lockit lock;
5297 int ret;
5299 TRACE("\n");
5301 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5302 ret = ios_base_Index++;
5303 _Lockit_dtor(&lock);
5304 return ret;
5307 /* ?swap@ios_base@std@@QAEXAAV12@@Z */
5308 /* ?swap@ios_base@std@@QEAAXAEAV12@@Z */
5309 DEFINE_THISCALL_WRAPPER(ios_base_swap, 8)
5310 void __thiscall ios_base_swap(ios_base *this, ios_base *r)
5312 ios_base tmp;
5314 TRACE("(%p %p)\n", this, r);
5316 if(this == r)
5317 return;
5319 tmp = *this;
5320 *this = *r;
5321 this->vtable = tmp.vtable;
5322 tmp.vtable = r->vtable;
5323 *r = tmp;
5326 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
5327 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
5328 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
5329 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
5331 TRACE("(%p)\n", this);
5333 ios_base_ctor(&this->base);
5334 this->base.vtable = &MSVCP_basic_ios_char_vtable;
5335 return this;
5338 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5339 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5340 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
5341 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
5343 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5344 ios_base__Init(&this->base);
5345 this->strbuf = streambuf;
5346 this->stream = NULL;
5347 this->fillch = ' ';
5349 if(!streambuf)
5350 ios_base_setstate(&this->base, IOSTATE_badbit);
5352 if(isstd)
5353 FIXME("standard streams not handled yet\n");
5356 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5357 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5358 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
5359 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
5361 TRACE("(%p %p)\n", this, strbuf);
5363 basic_ios_char_ctor(this);
5364 basic_ios_char_init(this, strbuf, FALSE);
5365 return this;
5368 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
5369 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5370 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
5371 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
5373 TRACE("(%p)\n", this);
5374 ios_base_dtor(&this->base);
5377 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
5378 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
5380 TRACE("(%p %x)\n", this, flags);
5381 if(flags & 2) {
5382 /* we have an array, with the number of elements stored before the first object */
5383 INT_PTR i, *ptr = (INT_PTR *)this-1;
5385 for(i=*ptr-1; i>=0; i--)
5386 basic_ios_char_dtor(this+i);
5387 MSVCRT_operator_delete(ptr);
5388 } else {
5389 basic_ios_char_dtor(this);
5390 if(flags & 1)
5391 MSVCRT_operator_delete(this);
5394 return this;
5397 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5398 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5399 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5400 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5402 TRACE("(%p %x %x)\n", this, state, reraise);
5403 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5406 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5407 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5408 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5409 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5411 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5414 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5415 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5416 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5417 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5419 TRACE("(%p %p)\n", this, copy);
5420 if(this == copy)
5421 return this;
5423 this->stream = copy->stream;
5424 this->fillch = copy->fillch;
5425 ios_base_copyfmt(&this->base, &copy->base);
5426 return this;
5429 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5430 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5431 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5432 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5434 char ret = this->fillch;
5436 TRACE("(%p %c)\n", this, fill);
5438 this->fillch = fill;
5439 return ret;
5442 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5443 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5444 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5445 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5447 TRACE("(%p)\n", this);
5448 return this->fillch;
5451 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5452 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5453 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5454 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5456 TRACE("(%p %p %p)\n", this, ret, loc);
5458 if(this->strbuf) {
5459 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5460 locale_dtor(ret);
5463 return ios_base_imbue(&this->base, ret, loc);
5466 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5467 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5468 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5469 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5471 TRACE("(%p %c %c)\n", this, ch, def);
5472 return ctype_char_narrow_ch(ctype_char_use_facet(this->strbuf->loc), ch, def);
5475 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5476 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5477 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5478 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5480 basic_streambuf_char *ret = this->strbuf;
5482 TRACE("(%p %p)\n", this, streambuf);
5484 this->strbuf = streambuf;
5485 basic_ios_char_clear(this, IOSTATE_goodbit);
5486 return ret;
5489 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5490 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5491 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5492 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5494 TRACE("(%p)\n", this);
5495 return this->strbuf;
5498 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5499 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5500 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5501 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5503 TRACE("(%p %x %x)\n", this, state, reraise);
5505 if(state != IOSTATE_goodbit)
5506 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5509 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5510 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5511 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5512 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5514 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5517 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5518 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5519 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5520 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5522 basic_ostream_char *ret = this->stream;
5524 TRACE("(%p %p)\n", this, ostream);
5526 this->stream = ostream;
5527 return ret;
5530 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5531 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5532 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5533 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5535 TRACE("(%p)\n", this);
5536 return this->stream;
5539 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5540 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5541 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5542 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5544 TRACE("(%p %c)\n", this, ch);
5545 return ctype_char_widen_ch(ctype_char_use_facet(this->strbuf->loc), ch);
5548 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
5549 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
5550 DEFINE_THISCALL_WRAPPER(basic_ios_char_swap, 8)
5551 void __thiscall basic_ios_char_swap(basic_ios_char *this, basic_ios_char *r)
5553 void *swap_ptr;
5555 TRACE("(%p %p)\n", this, r);
5557 if(this == r)
5558 return;
5560 ios_base_swap(&this->base, &r->base);
5561 swap_ptr = this->stream;
5562 this->stream = r->stream;
5563 r->stream = swap_ptr;
5564 this->fillch ^= r->fillch;
5565 r->fillch ^= this->fillch;
5566 this->fillch ^= r->fillch;
5569 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5570 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5571 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5572 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5574 TRACE("(%p)\n", this);
5576 ios_base_ctor(&this->base);
5577 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5578 return this;
5581 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5582 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5583 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5584 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5586 basic_ios_wchar_ctor(this);
5587 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5588 return this;
5591 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5592 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5593 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5594 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5595 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5596 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
5598 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5599 ios_base__Init(&this->base);
5600 this->strbuf = streambuf;
5601 this->stream = NULL;
5602 this->fillch = ' ';
5604 if(!streambuf)
5605 ios_base_setstate(&this->base, IOSTATE_badbit);
5607 if(isstd)
5608 FIXME("standard streams not handled yet\n");
5611 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5612 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5613 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
5614 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5616 TRACE("(%p %p)\n", this, strbuf);
5618 basic_ios_wchar_ctor(this);
5619 basic_ios_wchar_init(this, strbuf, FALSE);
5620 return this;
5623 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5624 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5625 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
5626 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5628 basic_ios_wchar_ctor_streambuf(this, strbuf);
5629 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5630 return this;
5633 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
5634 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
5635 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
5636 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
5637 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
5638 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
5640 TRACE("(%p)\n", this);
5641 ios_base_dtor(&this->base);
5644 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5645 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5647 TRACE("(%p %x)\n", this, flags);
5648 if(flags & 2) {
5649 /* we have an array, with the number of elements stored before the first object */
5650 INT_PTR i, *ptr = (INT_PTR *)this-1;
5652 for(i=*ptr-1; i>=0; i--)
5653 basic_ios_wchar_dtor(this+i);
5654 MSVCRT_operator_delete(ptr);
5655 } else {
5656 basic_ios_wchar_dtor(this);
5657 if(flags & 1)
5658 MSVCRT_operator_delete(this);
5661 return this;
5664 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5665 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5666 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5667 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5668 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5669 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5671 TRACE("(%p %x %x)\n", this, state, reraise);
5672 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5675 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5676 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5677 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5678 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5679 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
5680 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
5682 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
5685 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
5686 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5687 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
5688 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5689 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
5690 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
5692 TRACE("(%p %p)\n", this, copy);
5693 if(this == copy)
5694 return this;
5696 this->stream = copy->stream;
5697 this->fillch = copy->fillch;
5698 ios_base_copyfmt(&this->base, &copy->base);
5699 return this;
5702 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
5703 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
5704 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
5705 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
5706 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
5707 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
5709 wchar_t ret = this->fillch;
5711 TRACE("(%p %c)\n", this, fill);
5713 this->fillch = fill;
5714 return ret;
5717 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
5718 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
5719 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
5720 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
5721 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
5722 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
5724 TRACE("(%p)\n", this);
5725 return this->fillch;
5728 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5729 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5730 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5731 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5732 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
5733 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
5735 TRACE("(%p %p %p)\n", this, ret, loc);
5737 if(this->strbuf) {
5738 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
5739 locale_dtor(ret);
5742 return ios_base_imbue(&this->base, ret, loc);
5745 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
5746 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
5747 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
5748 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
5749 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
5750 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
5752 TRACE("(%p %c %c)\n", this, ch, def);
5753 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(this->strbuf->loc), ch, def);
5756 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5757 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5758 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
5759 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5760 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
5761 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
5763 basic_streambuf_wchar *ret = this->strbuf;
5765 TRACE("(%p %p)\n", this, streambuf);
5767 this->strbuf = streambuf;
5768 basic_ios_wchar_clear(this, IOSTATE_goodbit);
5769 return ret;
5772 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5773 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5774 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5775 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5776 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
5777 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
5779 TRACE("(%p)\n", this);
5780 return this->strbuf;
5783 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5784 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5785 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5786 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5787 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
5788 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5790 TRACE("(%p %x %x)\n", this, state, reraise);
5792 if(state != IOSTATE_goodbit)
5793 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
5796 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5797 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5798 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5799 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5800 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
5801 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
5803 basic_ios_wchar_setstate_reraise(this, state, FALSE);
5806 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5807 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5808 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
5809 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5810 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
5811 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
5813 basic_ostream_wchar *ret = this->stream;
5815 TRACE("(%p %p)\n", this, ostream);
5817 this->stream = ostream;
5818 return ret;
5821 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5822 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5823 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5824 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5825 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
5826 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
5828 TRACE("(%p)\n", this);
5829 return this->stream;
5832 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
5833 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
5834 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
5835 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
5836 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
5837 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
5839 TRACE("(%p %c)\n", this, ch);
5840 return ctype_wchar_widen_ch(ctype_wchar_use_facet(this->strbuf->loc), ch);
5843 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
5844 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
5845 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
5846 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
5847 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_swap, 8)
5848 void __thiscall basic_ios_wchar_swap(basic_ios_wchar *this, basic_ios_wchar *r)
5850 void *swap_ptr;
5852 TRACE("(%p %p)\n", this, r);
5854 if(this == r)
5855 return;
5857 ios_base_swap(&this->base, &r->base);
5858 swap_ptr = this->stream;
5859 this->stream = r->stream;
5860 r->stream = swap_ptr;
5861 this->fillch ^= r->fillch;
5862 r->fillch ^= this->fillch;
5863 this->fillch ^= r->fillch;
5866 /* Caution: basic_ostream uses virtual inheritance.
5867 * All constructors have additional parameter that says if base class should be initialized.
5868 * Base class needs to be accessed using vbtable.
5870 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
5872 return (basic_ios_char*)((char*)this+this->vbtable[1]);
5875 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
5877 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
5880 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
5882 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
5885 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5886 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5887 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 16)
5888 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
5889 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
5891 basic_ios_char *base;
5893 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
5895 if(virt_init) {
5896 this->vbtable = basic_ostream_char_vbtable;
5897 base = basic_ostream_char_get_basic_ios(this);
5898 basic_ios_char_ctor(base);
5899 }else {
5900 base = basic_ostream_char_get_basic_ios(this);
5903 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5904 basic_ios_char_init(base, strbuf, isstd);
5905 return this;
5908 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
5909 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
5910 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 16)
5911 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
5912 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
5914 basic_ios_char *base;
5916 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
5918 if(virt_init) {
5919 this->vbtable = basic_ostream_char_vbtable;
5920 base = basic_ostream_char_get_basic_ios(this);
5921 basic_ios_char_ctor(base);
5922 }else {
5923 base = basic_ostream_char_get_basic_ios(this);
5926 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5927 if(addstd)
5928 ios_base_Addstd(&base->base);
5929 return this;
5932 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5933 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5934 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
5935 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
5937 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5939 /* don't destroy virtual base here */
5940 TRACE("(%p)\n", this);
5943 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5944 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5945 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
5946 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
5948 TRACE("(%p)\n", this);
5949 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
5950 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
5953 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
5954 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5956 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5958 TRACE("(%p %x)\n", this, flags);
5960 if(flags & 2) {
5961 /* we have an array, with the number of elements stored before the first object */
5962 INT_PTR i, *ptr = (INT_PTR *)this-1;
5964 for(i=*ptr-1; i>=0; i--)
5965 basic_ostream_char_vbase_dtor(this+i);
5966 MSVCRT_operator_delete(ptr);
5967 } else {
5968 basic_ostream_char_vbase_dtor(this);
5969 if(flags & 1)
5970 MSVCRT_operator_delete(this);
5973 return this;
5976 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
5977 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
5978 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
5979 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
5981 /* this function is not matching C++ specification */
5982 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5984 TRACE("(%p)\n", this);
5986 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
5987 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
5988 basic_ios_char_setstate(base, IOSTATE_badbit);
5989 return this;
5992 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5993 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5994 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
5996 return basic_ostream_char_flush(ostream);
5999 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6000 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6001 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
6002 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
6004 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6006 TRACE("(%p)\n", this);
6008 if(base->base.fmtfl & FMTFLAG_unitbuf)
6009 basic_ostream_char_flush(this);
6012 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6013 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6014 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
6015 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
6017 TRACE("(%p)\n", this);
6018 basic_ostream_char__Osfx(this);
6021 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
6023 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6025 if(basic_ios_char_rdbuf_get(base))
6026 call_basic_streambuf_char__Lock(base->strbuf);
6028 if(ios_base_good(&base->base) && base->stream)
6029 basic_ostream_char_flush(base->stream);
6031 return ios_base_good(&base->base);
6034 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
6036 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6038 if(ios_base_good(&base->base) && !__uncaught_exception())
6039 basic_ostream_char_osfx(ostr);
6041 if(basic_ios_char_rdbuf_get(base))
6042 call_basic_streambuf_char__Unlock(base->strbuf);
6045 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
6046 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
6047 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
6048 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
6050 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6052 TRACE("(%p)\n", this);
6054 if(ios_base_good(&base->base) && base->stream)
6055 basic_ostream_char_flush(base->stream);
6056 return ios_base_good(&base->base);
6059 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
6060 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
6061 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
6062 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
6064 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6066 TRACE("(%p %c)\n", this, ch);
6068 if(!basic_ostream_char_sentry_create(this)
6069 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
6070 basic_ostream_char_sentry_destroy(this);
6071 basic_ios_char_setstate(base, IOSTATE_badbit);
6072 return this;
6075 basic_ostream_char_sentry_destroy(this);
6076 return this;
6079 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
6080 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
6081 #if STREAMOFF_BITS == 64
6082 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 16)
6083 #else
6084 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
6085 #endif
6086 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
6088 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6090 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6092 if(!ios_base_fail(&base->base)) {
6093 fpos_int seek;
6095 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6096 &seek, off, way, OPENMODE_out);
6097 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6098 basic_ios_char_setstate(base, IOSTATE_failbit);
6100 return this;
6103 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6104 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6105 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
6106 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
6108 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6110 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6112 if(!ios_base_fail(&base->base)) {
6113 fpos_int seek;
6115 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
6116 &seek, pos, OPENMODE_out);
6117 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6118 basic_ios_char_setstate(base, IOSTATE_failbit);
6120 return this;
6123 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6124 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6125 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
6126 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
6128 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6130 TRACE("(%p)\n", this);
6132 if(!ios_base_fail(&base->base)) {
6133 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6134 ret, 0, SEEKDIR_cur, OPENMODE_out);
6135 }else {
6136 ret->off = -1;
6137 ret->pos = 0;
6138 ret->state = 0;
6140 return ret;
6143 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
6144 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
6145 #if STREAMSIZE_BITS == 64
6146 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
6147 #else
6148 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
6149 #endif
6150 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
6152 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6154 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
6156 if(!basic_ostream_char_sentry_create(this)
6157 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
6158 basic_ostream_char_sentry_destroy(this);
6159 basic_ios_char_setstate(base, IOSTATE_badbit);
6160 return this;
6163 basic_ostream_char_sentry_destroy(this);
6164 return this;
6167 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
6168 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
6169 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
6170 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
6172 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6173 int state = IOSTATE_goodbit;
6175 TRACE("(%p %d)\n", this, val);
6177 if(basic_ostream_char_sentry_create(this)) {
6178 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6179 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6180 ostreambuf_iterator_char dest;
6182 memset(&dest, 0, sizeof(dest));
6183 dest.strbuf = strbuf;
6184 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
6185 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6186 ? (LONG)((unsigned short)val) : (LONG)val);
6188 basic_ostream_char_sentry_destroy(this);
6190 basic_ios_char_setstate(base, state);
6191 return this;
6194 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
6195 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
6196 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
6197 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
6199 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6200 int state = IOSTATE_goodbit;
6202 TRACE("(%p %u)\n", this, val);
6204 if(basic_ostream_char_sentry_create(this)) {
6205 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6206 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6207 ostreambuf_iterator_char dest;
6209 memset(&dest, 0, sizeof(dest));
6210 dest.strbuf = strbuf;
6211 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6213 basic_ostream_char_sentry_destroy(this);
6215 basic_ios_char_setstate(base, state);
6216 return this;
6219 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
6220 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
6221 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
6222 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
6223 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
6224 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
6226 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6227 int state = IOSTATE_goodbit;
6229 TRACE("(%p %d)\n", this, val);
6231 if(basic_ostream_char_sentry_create(this)) {
6232 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6233 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6234 ostreambuf_iterator_char dest;
6236 memset(&dest, 0, sizeof(dest));
6237 dest.strbuf = strbuf;
6238 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6240 basic_ostream_char_sentry_destroy(this);
6242 basic_ios_char_setstate(base, state);
6243 return this;
6246 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
6247 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
6248 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
6249 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
6250 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
6251 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
6253 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6254 int state = IOSTATE_goodbit;
6256 TRACE("(%p %u)\n", this, val);
6258 if(basic_ostream_char_sentry_create(this)) {
6259 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6260 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6261 ostreambuf_iterator_char dest;
6263 memset(&dest, 0, sizeof(dest));
6264 dest.strbuf = strbuf;
6265 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6267 basic_ostream_char_sentry_destroy(this);
6269 basic_ios_char_setstate(base, state);
6270 return this;
6273 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
6274 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
6275 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
6276 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
6278 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6279 int state = IOSTATE_goodbit;
6281 TRACE("(%p %f)\n", this, val);
6283 if(basic_ostream_char_sentry_create(this)) {
6284 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6285 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6286 ostreambuf_iterator_char dest;
6288 memset(&dest, 0, sizeof(dest));
6289 dest.strbuf = strbuf;
6290 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6292 basic_ostream_char_sentry_destroy(this);
6294 basic_ios_char_setstate(base, state);
6295 return this;
6298 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
6299 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
6300 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
6301 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
6303 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6304 int state = IOSTATE_goodbit;
6306 TRACE("(%p %lf)\n", this, val);
6308 if(basic_ostream_char_sentry_create(this)) {
6309 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6310 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6311 ostreambuf_iterator_char dest;
6313 memset(&dest, 0, sizeof(dest));
6314 dest.strbuf = strbuf;
6315 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6317 basic_ostream_char_sentry_destroy(this);
6319 basic_ios_char_setstate(base, state);
6320 return this;
6323 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
6324 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
6325 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
6326 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
6328 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6329 int state = IOSTATE_goodbit;
6331 TRACE("(%p %lf)\n", this, val);
6333 if(basic_ostream_char_sentry_create(this)) {
6334 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6335 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6336 ostreambuf_iterator_char dest;
6338 memset(&dest, 0, sizeof(dest));
6339 dest.strbuf = strbuf;
6340 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6342 basic_ostream_char_sentry_destroy(this);
6344 basic_ios_char_setstate(base, state);
6345 return this;
6348 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6349 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6350 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
6351 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
6353 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6354 IOSB_iostate state = IOSTATE_badbit;
6355 int c = '\n';
6357 TRACE("(%p %p)\n", this, val);
6359 if(basic_ostream_char_sentry_create(this)) {
6360 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
6361 c = basic_streambuf_char_snextc(val)) {
6362 state = IOSTATE_goodbit;
6364 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
6365 state = IOSTATE_badbit;
6366 break;
6369 }else {
6370 state = IOSTATE_badbit;
6372 basic_ostream_char_sentry_destroy(this);
6374 ios_base_width_set(&base->base, 0);
6375 basic_ios_char_setstate(base, state);
6376 return this;
6379 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
6380 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
6381 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
6382 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
6384 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6385 int state = IOSTATE_goodbit;
6387 TRACE("(%p %p)\n", this, val);
6389 if(basic_ostream_char_sentry_create(this)) {
6390 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6391 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6392 ostreambuf_iterator_char dest;
6394 memset(&dest, 0, sizeof(dest));
6395 dest.strbuf = strbuf;
6396 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6398 basic_ostream_char_sentry_destroy(this);
6400 basic_ios_char_setstate(base, state);
6401 return this;
6404 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
6405 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
6406 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
6407 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
6409 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6410 int state = IOSTATE_goodbit;
6412 TRACE("(%p)\n", this);
6414 if(basic_ostream_char_sentry_create(this)) {
6415 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6416 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6417 ostreambuf_iterator_char dest;
6419 memset(&dest, 0, sizeof(dest));
6420 dest.strbuf = strbuf;
6421 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6423 basic_ostream_char_sentry_destroy(this);
6425 basic_ios_char_setstate(base, state);
6426 return this;
6429 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
6430 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
6431 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
6432 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
6434 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6435 int state = IOSTATE_goodbit;
6437 TRACE("(%p)\n", this);
6439 if(basic_ostream_char_sentry_create(this)) {
6440 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6441 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6442 ostreambuf_iterator_char dest;
6444 memset(&dest, 0, sizeof(dest));
6445 dest.strbuf = strbuf;
6446 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6448 basic_ostream_char_sentry_destroy(this);
6450 basic_ios_char_setstate(base, state);
6451 return this;
6454 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
6455 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
6456 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
6457 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
6459 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6460 int state = IOSTATE_goodbit;
6462 TRACE("(%p %x)\n", this, val);
6464 if(basic_ostream_char_sentry_create(this)) {
6465 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6466 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6467 ostreambuf_iterator_char dest;
6469 memset(&dest, 0, sizeof(dest));
6470 dest.strbuf = strbuf;
6471 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6473 basic_ostream_char_sentry_destroy(this);
6475 basic_ios_char_setstate(base, state);
6476 return this;
6479 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6480 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6481 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6483 TRACE("(%p)\n", ostr);
6485 basic_ostream_char_put(ostr, 0);
6486 return ostr;
6489 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6490 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6491 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6493 TRACE("(%p)\n", ostr);
6495 basic_ostream_char_put(ostr, '\n');
6496 basic_ostream_char_flush(ostr);
6497 return ostr;
6500 /* ??$?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 */
6501 /* ??$?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 */
6502 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6504 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6505 IOSB_iostate state = IOSTATE_goodbit;
6507 TRACE("(%p %p)\n", ostr, str);
6509 if(basic_ostream_char_sentry_create(ostr)) {
6510 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6511 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6513 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6514 for(; pad!=0; pad--) {
6515 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6516 state = IOSTATE_badbit;
6517 break;
6522 if(state == IOSTATE_goodbit) {
6523 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6524 state = IOSTATE_badbit;
6527 if(state == IOSTATE_goodbit) {
6528 for(; pad!=0; pad--) {
6529 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6530 state = IOSTATE_badbit;
6531 break;
6536 base->base.wide = 0;
6537 }else {
6538 state = IOSTATE_badbit;
6540 basic_ostream_char_sentry_destroy(ostr);
6542 basic_ios_char_setstate(base, state);
6543 return ostr;
6546 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6547 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6548 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6549 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6550 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6551 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6552 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6554 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6555 IOSB_iostate state = IOSTATE_goodbit;
6557 TRACE("(%p %d)\n", ostr, ch);
6559 if(basic_ostream_char_sentry_create(ostr)) {
6560 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6562 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6563 for(; pad!=0; pad--) {
6564 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6565 state = IOSTATE_badbit;
6566 break;
6571 if(state == IOSTATE_goodbit) {
6572 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6573 state = IOSTATE_badbit;
6576 if(state == IOSTATE_goodbit) {
6577 for(; pad!=0; pad--) {
6578 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6579 state = IOSTATE_badbit;
6580 break;
6585 base->base.wide = 0;
6586 }else {
6587 state = IOSTATE_badbit;
6589 basic_ostream_char_sentry_destroy(ostr);
6591 basic_ios_char_setstate(base, state);
6592 return ostr;
6595 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6596 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6597 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6598 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6599 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
6600 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
6601 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
6603 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6604 IOSB_iostate state = IOSTATE_goodbit;
6606 TRACE("(%p %s)\n", ostr, str);
6608 if(basic_ostream_char_sentry_create(ostr)) {
6609 MSVCP_size_t len = strlen(str);
6610 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6612 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6613 for(; pad!=0; pad--) {
6614 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6615 state = IOSTATE_badbit;
6616 break;
6621 if(state == IOSTATE_goodbit) {
6622 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
6623 state = IOSTATE_badbit;
6626 if(state == IOSTATE_goodbit) {
6627 for(; pad!=0; pad--) {
6628 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6629 state = IOSTATE_badbit;
6630 break;
6635 base->base.wide = 0;
6636 }else {
6637 state = IOSTATE_badbit;
6639 basic_ostream_char_sentry_destroy(ostr);
6641 basic_ios_char_setstate(base, state);
6642 return ostr;
6645 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6646 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6647 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
6648 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
6649 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
6651 TRACE("(%p %p)\n", this, pfunc);
6652 pfunc(this);
6653 return this;
6656 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
6657 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
6658 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
6659 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
6660 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
6662 TRACE("(%p %p)\n", this, pfunc);
6663 pfunc(basic_ostream_char_get_basic_ios(this));
6664 return this;
6667 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6668 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6669 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
6670 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
6671 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
6673 TRACE("(%p %p)\n", this, pfunc);
6674 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
6675 return this;
6678 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
6679 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
6680 DEFINE_THISCALL_WRAPPER(basic_ostream_char_swap, 8)
6681 void __thiscall basic_ostream_char_swap(basic_ostream_char *this, basic_ostream_char *r)
6683 TRACE("(%p %p)\n", this, r);
6685 if(this == r)
6686 return;
6688 basic_ios_char_swap(basic_ostream_char_get_basic_ios(this),
6689 basic_ostream_char_get_basic_ios(r));
6692 /* Caution: basic_ostream uses virtual inheritance. */
6693 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
6695 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
6698 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
6700 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
6703 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
6705 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
6708 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
6709 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
6710 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor, 16)
6711 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor(basic_ostream_wchar *this,
6712 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6714 basic_ios_wchar *base;
6716 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6718 if(virt_init) {
6719 this->vbtable = basic_ostream_wchar_vbtable;
6720 base = basic_ostream_wchar_get_basic_ios(this);
6721 basic_ios_wchar_ctor(base);
6722 }else {
6723 base = basic_ostream_wchar_get_basic_ios(this);
6726 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
6727 basic_ios_wchar_init(base, strbuf, isstd);
6728 return this;
6731 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
6732 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
6733 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 16)
6734 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
6735 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6737 basic_ostream_wchar_ctor(this, strbuf, isstd, virt_init);
6738 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
6739 return this;
6742 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6743 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6744 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor_uninitialized, 16)
6745 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor_uninitialized(basic_ostream_wchar *this,
6746 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6748 basic_ios_wchar *base;
6750 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
6752 if(virt_init) {
6753 this->vbtable = basic_ostream_wchar_vbtable;
6754 base = basic_ostream_wchar_get_basic_ios(this);
6755 basic_ios_wchar_ctor(base);
6756 }else {
6757 base = basic_ostream_wchar_get_basic_ios(this);
6760 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
6761 if(addstd)
6762 ios_base_Addstd(&base->base);
6763 return this;
6766 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6767 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6768 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 16)
6769 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
6770 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6772 basic_ostream_wchar_ctor_uninitialized(this, uninitialized, addstd, virt_init);
6773 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
6774 return this;
6777 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6778 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6779 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
6780 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6781 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
6782 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
6784 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6786 /* don't destroy virtual base here */
6787 TRACE("(%p)\n", this);
6790 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6791 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6792 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6793 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6794 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
6795 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
6797 TRACE("(%p)\n", this);
6798 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
6799 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
6802 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
6803 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
6805 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6807 TRACE("(%p %x)\n", this, flags);
6809 if(flags & 2) {
6810 /* we have an array, with the number of elements stored before the first object */
6811 INT_PTR i, *ptr = (INT_PTR *)this-1;
6813 for(i=*ptr-1; i>=0; i--)
6814 basic_ostream_wchar_vbase_dtor(this+i);
6815 MSVCRT_operator_delete(ptr);
6816 } else {
6817 basic_ostream_wchar_vbase_dtor(this);
6818 if(flags & 1)
6819 MSVCRT_operator_delete(this);
6822 return this;
6825 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
6826 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
6827 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
6828 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
6829 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
6830 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
6832 /* this function is not matching C++ specification */
6833 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6835 TRACE("(%p)\n", this);
6837 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
6838 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
6839 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6840 return this;
6843 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6844 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6845 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6846 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6847 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
6849 return basic_ostream_wchar_flush(ostream);
6852 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6853 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6854 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6855 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6856 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
6857 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
6859 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6861 TRACE("(%p)\n", this);
6863 if(base->base.fmtfl & FMTFLAG_unitbuf)
6864 basic_ostream_wchar_flush(this);
6867 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6868 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6869 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6870 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6871 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
6872 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
6874 TRACE("(%p)\n", this);
6875 basic_ostream_wchar__Osfx(this);
6878 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
6880 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6882 if(basic_ios_wchar_rdbuf_get(base))
6883 basic_streambuf_wchar__Lock(base->strbuf);
6885 if(ios_base_good(&base->base) && base->stream)
6886 basic_ostream_wchar_flush(base->stream);
6888 return ios_base_good(&base->base);
6891 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
6893 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6895 if(ios_base_good(&base->base) && !__uncaught_exception())
6896 basic_ostream_wchar_osfx(ostr);
6898 if(basic_ios_wchar_rdbuf_get(base))
6899 basic_streambuf_wchar__Unlock(base->strbuf);
6902 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
6903 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
6904 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
6905 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
6906 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
6907 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
6909 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6911 TRACE("(%p)\n", this);
6913 if(ios_base_good(&base->base) && base->stream)
6914 basic_ostream_wchar_flush(base->stream);
6915 return ios_base_good(&base->base);
6918 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
6919 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
6920 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
6921 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
6922 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
6923 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
6925 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6927 TRACE("(%p %c)\n", this, ch);
6929 if(!basic_ostream_wchar_sentry_create(this)
6930 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
6931 basic_ostream_wchar_sentry_destroy(this);
6932 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6933 return this;
6936 basic_ostream_wchar_sentry_destroy(this);
6937 return this;
6940 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
6941 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
6942 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
6943 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
6944 #if STREAMOFF_BITS == 64
6945 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 16)
6946 #else
6947 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
6948 #endif
6949 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
6951 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6953 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6955 if(!ios_base_fail(&base->base)) {
6956 fpos_int seek;
6958 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6959 &seek, off, way, OPENMODE_out);
6960 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6961 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6963 return this;
6966 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6967 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6968 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6969 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6970 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
6971 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_int pos)
6973 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6975 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6977 if(!ios_base_fail(&base->base)) {
6978 fpos_int seek;
6980 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
6981 &seek, pos, OPENMODE_out);
6982 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6983 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6985 return this;
6988 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6989 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6990 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6991 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6992 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
6993 fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_int *ret)
6995 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6997 TRACE("(%p)\n", this);
6999 if(!ios_base_fail(&base->base)) {
7000 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
7001 ret, 0, SEEKDIR_cur, OPENMODE_out);
7002 }else {
7003 ret->off = -1;
7004 ret->pos = 0;
7005 ret->state = 0;
7007 return ret;
7010 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
7011 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
7012 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
7013 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
7014 #if STREAMSIZE_BITS == 64
7015 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
7016 #else
7017 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
7018 #endif
7019 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
7021 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7023 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
7025 if(!basic_ostream_wchar_sentry_create(this)
7026 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
7027 basic_ostream_wchar_sentry_destroy(this);
7028 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7029 return this;
7032 basic_ostream_wchar_sentry_destroy(this);
7033 return this;
7036 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
7038 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7039 int state = IOSTATE_goodbit;
7041 TRACE("(%p %d)\n", this, val);
7043 if(basic_ostream_wchar_sentry_create(this)) {
7044 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7045 ostreambuf_iterator_wchar dest;
7047 memset(&dest, 0, sizeof(dest));
7048 dest.strbuf = strbuf;
7049 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
7050 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
7051 ? (LONG)((unsigned short)val) : (LONG)val);
7053 basic_ostream_wchar_sentry_destroy(this);
7055 basic_ios_wchar_setstate(base, state);
7056 return this;
7059 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
7060 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
7061 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
7062 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
7064 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
7065 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7068 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
7069 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
7070 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
7071 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
7073 return basic_ostream_print_short(this, val, num_put_short_use_facet(
7074 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7077 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
7079 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7080 int state = IOSTATE_goodbit;
7082 TRACE("(%p %d)\n", this, val);
7084 if(basic_ostream_wchar_sentry_create(this)) {
7085 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7086 ostreambuf_iterator_wchar dest;
7088 memset(&dest, 0, sizeof(dest));
7089 dest.strbuf = strbuf;
7090 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7092 basic_ostream_wchar_sentry_destroy(this);
7094 basic_ios_wchar_setstate(base, state);
7095 return this;
7098 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
7099 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
7100 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
7101 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
7103 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
7104 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7107 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
7108 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
7109 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
7110 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
7112 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
7113 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7116 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
7118 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7119 int state = IOSTATE_goodbit;
7121 TRACE("(%p %d)\n", this, val);
7123 if(basic_ostream_wchar_sentry_create(this)) {
7124 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7125 ostreambuf_iterator_wchar dest;
7127 memset(&dest, 0, sizeof(dest));
7128 dest.strbuf = strbuf;
7129 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7131 basic_ostream_wchar_sentry_destroy(this);
7133 basic_ios_wchar_setstate(base, state);
7134 return this;
7137 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
7138 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
7139 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
7140 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
7141 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
7142 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
7144 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
7145 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7148 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
7149 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
7150 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
7151 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
7152 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
7153 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
7155 return basic_ostream_print_int(this, val, num_put_short_use_facet(
7156 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7159 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
7161 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7162 int state = IOSTATE_goodbit;
7164 TRACE("(%p %u)\n", this, val);
7166 if(basic_ostream_wchar_sentry_create(this)) {
7167 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7168 ostreambuf_iterator_wchar dest;
7170 memset(&dest, 0, sizeof(dest));
7171 dest.strbuf = strbuf;
7172 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7174 basic_ostream_wchar_sentry_destroy(this);
7176 basic_ios_wchar_setstate(base, state);
7177 return this;
7180 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
7181 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
7182 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
7183 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
7184 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
7185 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
7187 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
7188 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7191 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
7192 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
7193 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
7194 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
7195 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
7196 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
7198 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
7199 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7202 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
7204 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7205 int state = IOSTATE_goodbit;
7207 TRACE("(%p %f)\n", this, val);
7209 if(basic_ostream_wchar_sentry_create(this)) {
7210 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7211 ostreambuf_iterator_wchar dest;
7213 memset(&dest, 0, sizeof(dest));
7214 dest.strbuf = strbuf;
7215 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7217 basic_ostream_wchar_sentry_destroy(this);
7219 basic_ios_wchar_setstate(base, state);
7220 return this;
7223 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
7224 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
7225 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
7226 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
7228 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
7229 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7232 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
7233 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
7234 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
7235 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
7237 return basic_ostream_print_float(this, val, num_put_short_use_facet(
7238 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7241 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
7243 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7244 int state = IOSTATE_goodbit;
7246 TRACE("(%p %lf)\n", this, val);
7248 if(basic_ostream_wchar_sentry_create(this)) {
7249 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7250 ostreambuf_iterator_wchar dest;
7252 memset(&dest, 0, sizeof(dest));
7253 dest.strbuf = strbuf;
7254 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7256 basic_ostream_wchar_sentry_destroy(this);
7258 basic_ios_wchar_setstate(base, state);
7259 return this;
7262 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
7263 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
7264 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
7265 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
7267 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
7268 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7271 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
7272 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
7273 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
7274 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
7276 return basic_ostream_print_double(this, val, num_put_short_use_facet(
7277 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7280 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
7282 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7283 int state = IOSTATE_goodbit;
7285 TRACE("(%p %lf)\n", this, val);
7287 if(basic_ostream_wchar_sentry_create(this)) {
7288 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7289 ostreambuf_iterator_wchar dest;
7291 memset(&dest, 0, sizeof(dest));
7292 dest.strbuf = strbuf;
7293 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7295 basic_ostream_wchar_sentry_destroy(this);
7297 basic_ios_wchar_setstate(base, state);
7298 return this;
7301 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
7302 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
7303 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
7304 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
7306 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
7307 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7310 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
7311 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
7312 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
7313 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
7315 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
7316 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7319 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7320 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7321 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7322 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7323 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
7324 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
7326 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7327 IOSB_iostate state = IOSTATE_badbit;
7328 unsigned short c = '\n';
7330 TRACE("(%p %p)\n", this, val);
7332 if(basic_ostream_wchar_sentry_create(this)) {
7333 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
7334 c = basic_streambuf_wchar_snextc(val)) {
7335 state = IOSTATE_goodbit;
7337 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
7338 state = IOSTATE_badbit;
7339 break;
7342 }else {
7343 state = IOSTATE_badbit;
7345 basic_ostream_wchar_sentry_destroy(this);
7347 ios_base_width_set(&base->base, 0);
7348 basic_ios_wchar_setstate(base, state);
7349 return this;
7352 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
7354 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7355 int state = IOSTATE_goodbit;
7357 TRACE("(%p %p)\n", this, val);
7359 if(basic_ostream_wchar_sentry_create(this)) {
7360 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7361 ostreambuf_iterator_wchar dest;
7363 memset(&dest, 0, sizeof(dest));
7364 dest.strbuf = strbuf;
7365 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7367 basic_ostream_wchar_sentry_destroy(this);
7369 basic_ios_wchar_setstate(base, state);
7370 return this;
7373 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
7374 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
7375 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
7376 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
7378 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
7379 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7382 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
7383 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
7384 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
7385 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
7387 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
7388 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7391 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
7393 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7394 int state = IOSTATE_goodbit;
7396 TRACE("(%p)\n", this);
7398 if(basic_ostream_wchar_sentry_create(this)) {
7399 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7400 ostreambuf_iterator_wchar dest;
7402 memset(&dest, 0, sizeof(dest));
7403 dest.strbuf = strbuf;
7404 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7406 basic_ostream_wchar_sentry_destroy(this);
7408 basic_ios_wchar_setstate(base, state);
7409 return this;
7412 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
7413 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
7414 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
7415 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
7417 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
7418 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7421 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
7422 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
7423 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
7424 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
7426 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
7427 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7430 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
7432 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7433 int state = IOSTATE_goodbit;
7435 TRACE("(%p)\n", this);
7437 if(basic_ostream_wchar_sentry_create(this)) {
7438 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7439 ostreambuf_iterator_wchar dest;
7441 memset(&dest, 0, sizeof(dest));
7442 dest.strbuf = strbuf;
7443 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7445 basic_ostream_wchar_sentry_destroy(this);
7447 basic_ios_wchar_setstate(base, state);
7448 return this;
7451 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
7452 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
7453 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
7454 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7456 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
7457 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7460 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
7461 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
7462 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
7463 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7465 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
7466 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7469 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
7471 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7472 int state = IOSTATE_goodbit;
7474 TRACE("(%p %x)\n", this, val);
7476 if(basic_ostream_wchar_sentry_create(this)) {
7477 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7478 ostreambuf_iterator_wchar dest;
7480 memset(&dest, 0, sizeof(dest));
7481 dest.strbuf = strbuf;
7482 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7484 basic_ostream_wchar_sentry_destroy(this);
7486 basic_ios_wchar_setstate(base, state);
7487 return this;
7490 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
7491 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
7492 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
7493 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7495 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
7496 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7499 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
7500 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
7501 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
7502 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7504 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
7505 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7508 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7509 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7510 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7511 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7512 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
7514 TRACE("(%p)\n", ostr);
7516 basic_ostream_wchar_put(ostr, 0);
7517 return ostr;
7520 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7521 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7522 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7523 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7524 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
7526 TRACE("(%p)\n", ostr);
7528 basic_ostream_wchar_put(ostr, '\n');
7529 basic_ostream_wchar_flush(ostr);
7530 return ostr;
7533 /* ??$?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 */
7534 /* ??$?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 */
7535 /* ??$?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 */
7536 /* ??$?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 */
7537 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
7539 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7540 IOSB_iostate state = IOSTATE_goodbit;
7542 TRACE("(%p %p)\n", ostr, str);
7544 if(basic_ostream_wchar_sentry_create(ostr)) {
7545 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
7546 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7548 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7549 for(; pad!=0; pad--) {
7550 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7551 state = IOSTATE_badbit;
7552 break;
7557 if(state == IOSTATE_goodbit) {
7558 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7559 state = IOSTATE_badbit;
7562 if(state == IOSTATE_goodbit) {
7563 for(; pad!=0; pad--) {
7564 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7565 state = IOSTATE_badbit;
7566 break;
7571 base->base.wide = 0;
7572 }else {
7573 state = IOSTATE_badbit;
7575 basic_ostream_wchar_sentry_destroy(ostr);
7577 basic_ios_wchar_setstate(base, state);
7578 return ostr;
7581 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
7582 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
7583 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7584 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7585 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
7587 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7588 IOSB_iostate state = IOSTATE_goodbit;
7590 TRACE("(%p %d)\n", ostr, ch);
7592 if(basic_ostream_wchar_sentry_create(ostr)) {
7593 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
7595 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7596 for(; pad!=0; pad--) {
7597 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7598 state = IOSTATE_badbit;
7599 break;
7604 if(state == IOSTATE_goodbit) {
7605 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
7606 state = IOSTATE_badbit;
7609 if(state == IOSTATE_goodbit) {
7610 for(; pad!=0; pad--) {
7611 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7612 state = IOSTATE_badbit;
7613 break;
7618 base->base.wide = 0;
7619 }else {
7620 state = IOSTATE_badbit;
7622 basic_ostream_wchar_sentry_destroy(ostr);
7624 basic_ios_wchar_setstate(base, state);
7625 return ostr;
7628 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
7629 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
7630 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
7631 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
7632 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
7634 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7635 IOSB_iostate state = IOSTATE_goodbit;
7637 TRACE("(%p %s)\n", ostr, debugstr_w(str));
7639 if(basic_ostream_wchar_sentry_create(ostr)) {
7640 MSVCP_size_t len = wcslen(str);
7641 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7643 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7644 for(; pad!=0; pad--) {
7645 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7646 state = IOSTATE_badbit;
7647 break;
7652 if(state == IOSTATE_goodbit) {
7653 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
7654 state = IOSTATE_badbit;
7657 if(state == IOSTATE_goodbit) {
7658 for(; pad!=0; pad--) {
7659 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7660 state = IOSTATE_badbit;
7661 break;
7666 base->base.wide = 0;
7667 }else {
7668 state = IOSTATE_badbit;
7670 basic_ostream_wchar_sentry_destroy(ostr);
7672 basic_ios_wchar_setstate(base, state);
7673 return ostr;
7676 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7677 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7678 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7679 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7680 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
7681 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
7682 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
7684 TRACE("(%p %p)\n", this, pfunc);
7685 pfunc(this);
7686 return this;
7689 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
7690 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
7691 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
7692 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
7693 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
7694 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
7695 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
7697 TRACE("(%p %p)\n", this, pfunc);
7698 pfunc(basic_ostream_wchar_get_basic_ios(this));
7699 return this;
7702 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7703 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7704 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7705 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7706 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
7707 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
7708 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
7710 TRACE("(%p %p)\n", this, pfunc);
7711 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
7712 return this;
7715 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
7716 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
7717 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
7718 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IEAAXAEAV12@@Z */
7719 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_swap, 8)
7720 void __thiscall basic_ostream_wchar_swap(basic_ostream_wchar *this, basic_ostream_wchar *r)
7722 TRACE("(%p %p)\n", this, r);
7724 if(this == r)
7725 return;
7727 basic_ios_wchar_swap(basic_ostream_wchar_get_basic_ios(this),
7728 basic_ostream_wchar_get_basic_ios(r));
7731 /* Caution: basic_istream uses virtual inheritance. */
7732 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
7734 return (basic_ios_char*)((char*)this+this->vbtable[1]);
7737 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
7739 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
7742 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
7744 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
7747 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7748 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7749 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
7750 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)
7752 basic_ios_char *base;
7754 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
7756 if(virt_init) {
7757 this->vbtable = basic_istream_char_vbtable;
7758 base = basic_istream_char_get_basic_ios(this);
7759 basic_ios_char_ctor(base);
7760 }else {
7761 base = basic_istream_char_get_basic_ios(this);
7764 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7765 this->count = 0;
7766 if(!noinit)
7767 basic_ios_char_init(base, strbuf, isstd);
7768 return this;
7771 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7772 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7773 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
7774 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7776 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
7779 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
7780 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
7781 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
7782 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
7784 basic_ios_char *base;
7786 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
7788 if(virt_init) {
7789 this->vbtable = basic_istream_char_vbtable;
7790 base = basic_istream_char_get_basic_ios(this);
7791 basic_ios_char_ctor(base);
7792 }else {
7793 base = basic_istream_char_get_basic_ios(this);
7796 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7797 ios_base_Addstd(&base->base);
7798 return this;
7801 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
7802 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
7803 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
7804 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
7806 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7808 /* don't destroy virtual base here */
7809 TRACE("(%p)\n", this);
7812 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7813 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7814 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
7815 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
7817 TRACE("(%p)\n", this);
7818 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
7819 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
7822 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
7823 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
7825 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7827 TRACE("(%p %x)\n", this, flags);
7829 if(flags & 2) {
7830 /* we have an array, with the number of elements stored before the first object */
7831 INT_PTR i, *ptr = (INT_PTR *)this-1;
7833 for(i=*ptr-1; i>=0; i--)
7834 basic_istream_char_vbase_dtor(this+i);
7835 MSVCRT_operator_delete(ptr);
7836 } else {
7837 basic_istream_char_vbase_dtor(this);
7838 if(flags & 1)
7839 MSVCRT_operator_delete(this);
7842 return this;
7845 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7846 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7847 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
7848 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
7850 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7852 TRACE("(%p %d)\n", this, noskip);
7854 if(ios_base_good(&base->base)) {
7855 if(basic_ios_char_tie_get(base))
7856 basic_ostream_char_flush(basic_ios_char_tie_get(base));
7858 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
7859 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7860 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
7861 int ch;
7863 for(ch = basic_streambuf_char_sgetc(strbuf); ;
7864 ch = basic_streambuf_char_snextc(strbuf)) {
7865 if(ch == EOF) {
7866 basic_ios_char_setstate(base, IOSTATE_eofbit);
7867 break;
7870 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
7871 break;
7876 if(!ios_base_good(&base->base)) {
7877 basic_ios_char_setstate(base, IOSTATE_failbit);
7878 return FALSE;
7881 return TRUE;
7884 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7885 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7886 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
7887 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
7889 return basic_istream_char__Ipfx(this, noskip);
7892 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7893 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7894 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
7895 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
7897 TRACE("(%p)\n", this);
7900 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
7902 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7904 if(basic_ios_char_rdbuf_get(base))
7905 call_basic_streambuf_char__Lock(base->strbuf);
7907 return basic_istream_char_ipfx(istr, noskip);
7910 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
7912 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7914 if(basic_ios_char_rdbuf_get(base))
7915 call_basic_streambuf_char__Unlock(base->strbuf);
7918 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
7919 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
7920 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
7921 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
7922 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
7923 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
7925 TRACE("(%p)\n", this);
7926 return this->count;
7929 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7930 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7931 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
7932 int __thiscall basic_istream_char_get(basic_istream_char *this)
7934 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7935 int ret;
7937 TRACE("(%p)\n", this);
7939 this->count = 0;
7941 if(!basic_istream_char_sentry_create(this, TRUE)) {
7942 basic_istream_char_sentry_destroy(this);
7943 return EOF;
7946 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
7947 basic_istream_char_sentry_destroy(this);
7948 if(ret == EOF)
7949 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
7950 else
7951 this->count++;
7953 return ret;
7956 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
7957 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
7958 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
7959 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
7961 int ret;
7963 TRACE("(%p %p)\n", this, ch);
7965 ret = basic_istream_char_get(this);
7966 if(ret != EOF)
7967 *ch = (char)ret;
7968 return this;
7971 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7972 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7973 #if STREAMSIZE_BITS == 64
7974 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
7975 #else
7976 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
7977 #endif
7978 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7980 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7981 int ch = delim;
7983 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
7985 this->count = 0;
7987 if(basic_istream_char_sentry_create(this, TRUE)) {
7988 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7990 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
7991 ch = basic_streambuf_char_snextc(strbuf)) {
7992 if(ch==EOF || ch==delim)
7993 break;
7995 *str++ = ch;
7996 this->count++;
7997 count--;
8000 basic_istream_char_sentry_destroy(this);
8002 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8003 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8004 if(count > 0)
8005 *str = 0;
8006 return this;
8009 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8010 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8011 #if STREAMSIZE_BITS == 64
8012 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
8013 #else
8014 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
8015 #endif
8016 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
8018 return basic_istream_char_get_str_delim(this, str, count, '\n');
8021 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8022 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8023 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
8024 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
8026 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8027 int ch = delim;
8029 TRACE("(%p %p %c)\n", this, strbuf, delim);
8031 this->count = 0;
8033 if(basic_istream_char_sentry_create(this, TRUE)) {
8034 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
8036 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
8037 ch = basic_streambuf_char_snextc(strbuf_read)) {
8038 if(ch==EOF || ch==delim)
8039 break;
8041 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
8042 break;
8043 this->count++;
8046 basic_istream_char_sentry_destroy(this);
8048 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8049 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8050 return this;
8053 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8054 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8055 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
8056 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
8058 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
8061 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8062 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8063 #if STREAMSIZE_BITS == 64
8064 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
8065 #else
8066 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
8067 #endif
8068 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8070 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8071 int ch = (unsigned char)delim;
8073 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
8075 this->count = 0;
8077 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
8078 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8080 while(count > 1) {
8081 ch = basic_streambuf_char_sbumpc(strbuf);
8083 if(ch==EOF || ch==(unsigned char)delim)
8084 break;
8086 *str++ = ch;
8087 this->count++;
8088 count--;
8091 if(ch == (unsigned char)delim)
8092 this->count++;
8093 else if(ch != EOF) {
8094 ch = basic_streambuf_char_sgetc(strbuf);
8096 if(ch == (unsigned char)delim) {
8097 basic_streambuf_char__Gninc(strbuf);
8098 this->count++;
8102 basic_istream_char_sentry_destroy(this);
8104 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8105 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8106 if(count > 0)
8107 *str = 0;
8108 return this;
8111 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8112 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8113 #if STREAMSIZE_BITS == 64
8114 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
8115 #else
8116 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
8117 #endif
8118 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
8120 return basic_istream_char_getline_delim(this, str, count, '\n');
8123 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
8124 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8125 #if STREAMSIZE_BITS == 64
8126 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
8127 #else
8128 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
8129 #endif
8130 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
8132 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8133 int ch = (unsigned char)delim;
8134 unsigned int state;
8136 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8138 this->count = 0;
8140 if(basic_istream_char_sentry_create(this, TRUE)) {
8141 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8142 state = IOSTATE_goodbit;
8144 while(count > 0) {
8145 ch = basic_streambuf_char_sbumpc(strbuf);
8147 if(ch==EOF) {
8148 state = IOSTATE_eofbit;
8149 break;
8152 if(ch==(unsigned char)delim)
8153 break;
8155 this->count++;
8156 if(count != INT_MAX)
8157 count--;
8159 }else
8160 state = IOSTATE_failbit;
8161 basic_istream_char_sentry_destroy(this);
8163 basic_ios_char_setstate(base, state);
8164 return this;
8167 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
8168 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
8169 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
8171 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8172 int ch = '\n';
8174 TRACE("(%p)\n", istream);
8176 if(basic_istream_char_sentry_create(istream, TRUE)) {
8177 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8178 const ctype_char *ctype = ctype_char_use_facet(strbuf->loc);
8180 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
8181 ch = basic_streambuf_char_snextc(strbuf)) {
8182 if(ch == EOF)
8183 break;
8186 basic_istream_char_sentry_destroy(istream);
8188 if(ch == EOF)
8189 basic_ios_char_setstate(base, IOSTATE_eofbit);
8190 return istream;
8193 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8194 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8195 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
8196 int __thiscall basic_istream_char_peek(basic_istream_char *this)
8198 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8199 int ret = EOF;
8201 TRACE("(%p)\n", this);
8203 this->count = 0;
8205 if(basic_istream_char_sentry_create(this, TRUE))
8206 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8207 basic_istream_char_sentry_destroy(this);
8209 if (ret == EOF)
8210 basic_ios_char_setstate(base, IOSTATE_eofbit);
8212 return ret;
8215 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
8216 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
8217 #if STREAMSIZE_BITS == 64
8218 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
8219 #else
8220 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
8221 #endif
8222 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8224 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8225 IOSB_iostate state = IOSTATE_goodbit;
8227 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8229 if(basic_istream_char_sentry_create(this, TRUE)) {
8230 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8232 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
8233 if(this->count != count)
8234 state |= IOSTATE_failbit | IOSTATE_eofbit;
8235 }else {
8236 this->count = 0;
8238 basic_istream_char_sentry_destroy(this);
8240 basic_ios_char_setstate(base, state);
8241 return this;
8244 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8245 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8246 #if STREAMSIZE_BITS == 64
8247 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
8248 #else
8249 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
8250 #endif
8251 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
8253 return basic_istream_char__Read_s(this, str, -1, count);
8256 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
8257 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
8258 #if STREAMSIZE_BITS == 64
8259 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
8260 #else
8261 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
8262 #endif
8263 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8265 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8266 IOSB_iostate state = IOSTATE_goodbit;
8268 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8270 this->count = 0;
8272 if(basic_istream_char_sentry_create(this, TRUE)) {
8273 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
8274 if(avail > count)
8275 avail = count;
8277 if(avail == -1)
8278 state |= IOSTATE_eofbit;
8279 else if(avail > 0)
8280 basic_istream_char__Read_s(this, str, size, avail);
8281 }else {
8282 state |= IOSTATE_failbit;
8284 basic_istream_char_sentry_destroy(this);
8286 basic_ios_char_setstate(base, state);
8287 return this->count;
8290 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
8291 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
8292 #if STREAMSIZE_BITS == 64
8293 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
8294 #else
8295 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
8296 #endif
8297 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
8299 return basic_istream_char__Readsome_s(this, str, count, count);
8302 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
8303 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
8304 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
8305 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
8307 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8308 IOSB_iostate state = IOSTATE_goodbit;
8310 TRACE("(%p %c)\n", this, ch);
8312 this->count = 0;
8314 if(basic_istream_char_sentry_create(this, TRUE)) {
8315 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8317 if(!ios_base_good(&base->base))
8318 state |= IOSTATE_failbit;
8319 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
8320 state |= IOSTATE_badbit;
8322 basic_istream_char_sentry_destroy(this);
8324 basic_ios_char_setstate(base, state);
8325 return this;
8328 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
8329 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
8330 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
8331 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
8333 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8334 IOSB_iostate state = IOSTATE_goodbit;
8336 TRACE("(%p)\n", this);
8338 this->count = 0;
8340 if(basic_istream_char_sentry_create(this, TRUE)) {
8341 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8343 if(!ios_base_good(&base->base))
8344 state |= IOSTATE_failbit;
8345 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
8346 state |= IOSTATE_badbit;
8348 basic_istream_char_sentry_destroy(this);
8350 basic_ios_char_setstate(base, state);
8351 return this;
8354 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8355 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8356 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
8357 int __thiscall basic_istream_char_sync(basic_istream_char *this)
8359 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8360 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8362 TRACE("(%p)\n", this);
8364 if(!strbuf)
8365 return -1;
8367 if(basic_istream_char_sentry_create(this, TRUE)) {
8368 if(basic_streambuf_char_pubsync(strbuf) != -1) {
8369 basic_istream_char_sentry_destroy(this);
8370 return 0;
8373 basic_istream_char_sentry_destroy(this);
8375 basic_ios_char_setstate(base, IOSTATE_badbit);
8376 return -1;
8379 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8380 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8381 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
8382 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
8384 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8386 TRACE("(%p %p)\n", this, ret);
8388 if(ios_base_fail(&base->base)) {
8389 ret->off = -1;
8390 ret->pos = 0;
8391 ret->state = 0;
8392 return ret;
8395 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8396 ret, 0, SEEKDIR_cur, OPENMODE_in);
8398 if(ret->off==-1 && ret->pos==0 && ret->state==0)
8399 basic_ios_char_setstate(base, IOSTATE_failbit);
8401 return ret;
8404 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
8405 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8406 #if STREAMOFF_BITS == 64
8407 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
8408 #else
8409 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
8410 #endif
8411 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
8413 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8415 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8417 if(!ios_base_fail(&base->base)) {
8418 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8419 fpos_int ret;
8421 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8423 if(ret.off==-1 && ret.pos==0 && ret.state==0)
8424 basic_ios_char_setstate(base, IOSTATE_failbit);
8425 else
8426 basic_ios_char_clear(base, IOSTATE_goodbit);
8427 return this;
8428 }else
8429 basic_ios_char_clear(base, IOSTATE_goodbit);
8431 return this;
8434 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8435 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8436 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
8437 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
8439 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8441 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
8443 if(!ios_base_fail(&base->base)) {
8444 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8445 fpos_int ret;
8447 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8449 if(ret.off==-1 && ret.pos==0 && ret.state==0)
8450 basic_ios_char_setstate(base, IOSTATE_failbit);
8451 else
8452 basic_ios_char_clear(base, IOSTATE_goodbit);
8453 return this;
8454 }else
8455 basic_ios_char_clear(base, IOSTATE_goodbit);
8457 return this;
8460 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
8461 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
8462 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
8463 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
8465 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8466 int state = IOSTATE_goodbit;
8468 TRACE("(%p %p)\n", this, v);
8470 if(basic_istream_char_sentry_create(this, FALSE)) {
8471 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8472 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8473 istreambuf_iterator_char first={0}, last={0};
8474 LONG tmp;
8476 first.strbuf = strbuf;
8477 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8479 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8480 *v = tmp;
8481 else
8482 state |= IOSTATE_failbit;
8484 basic_istream_char_sentry_destroy(this);
8486 basic_ios_char_setstate(base, state);
8487 return this;
8490 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
8491 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
8492 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
8493 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
8495 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8496 int state = IOSTATE_goodbit;
8498 TRACE("(%p %p)\n", this, v);
8500 if(basic_istream_char_sentry_create(this, FALSE)) {
8501 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8502 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8503 istreambuf_iterator_char first={0}, last={0};
8505 first.strbuf = strbuf;
8506 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
8508 basic_istream_char_sentry_destroy(this);
8510 basic_ios_char_setstate(base, state);
8511 return this;
8514 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
8515 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
8516 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
8517 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
8519 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8520 int state = IOSTATE_goodbit;
8522 TRACE("(%p %p)\n", this, v);
8524 if(basic_istream_char_sentry_create(this, FALSE)) {
8525 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8526 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8527 istreambuf_iterator_char first={0}, last={0};
8529 first.strbuf = strbuf;
8530 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8532 basic_istream_char_sentry_destroy(this);
8534 basic_ios_char_setstate(base, state);
8535 return this;
8538 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
8539 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
8540 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
8541 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
8543 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8544 int state = IOSTATE_goodbit;
8546 TRACE("(%p %p)\n", this, v);
8548 if(basic_istream_char_sentry_create(this, FALSE)) {
8549 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8550 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8551 istreambuf_iterator_char first={0}, last={0};
8553 first.strbuf = strbuf;
8554 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
8556 basic_istream_char_sentry_destroy(this);
8558 basic_ios_char_setstate(base, state);
8559 return this;
8562 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
8563 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
8564 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
8565 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
8567 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8568 int state = IOSTATE_goodbit;
8570 TRACE("(%p %p)\n", this, v);
8572 if(basic_istream_char_sentry_create(this, FALSE)) {
8573 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8574 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8575 istreambuf_iterator_char first={0}, last={0};
8577 first.strbuf = strbuf;
8578 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8580 basic_istream_char_sentry_destroy(this);
8582 basic_ios_char_setstate(base, state);
8583 return this;
8586 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
8587 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
8588 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
8589 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
8591 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8592 int state = IOSTATE_goodbit;
8594 TRACE("(%p %p)\n", this, v);
8596 if(basic_istream_char_sentry_create(this, FALSE)) {
8597 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8598 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8599 istreambuf_iterator_char first={0}, last={0};
8601 first.strbuf = strbuf;
8602 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
8604 basic_istream_char_sentry_destroy(this);
8606 basic_ios_char_setstate(base, state);
8607 return this;
8610 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
8611 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
8612 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
8613 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
8615 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8616 int state = IOSTATE_goodbit;
8618 TRACE("(%p %p)\n", this, v);
8620 if(basic_istream_char_sentry_create(this, FALSE)) {
8621 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8622 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8623 istreambuf_iterator_char first={0}, last={0};
8625 first.strbuf = strbuf;
8626 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
8628 basic_istream_char_sentry_destroy(this);
8630 basic_ios_char_setstate(base, state);
8631 return this;
8634 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
8635 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
8636 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
8637 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
8639 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8640 int state = IOSTATE_goodbit;
8642 TRACE("(%p %p)\n", this, v);
8644 if(basic_istream_char_sentry_create(this, FALSE)) {
8645 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8646 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8647 istreambuf_iterator_char first={0}, last={0};
8649 first.strbuf = strbuf;
8650 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
8652 basic_istream_char_sentry_destroy(this);
8654 basic_ios_char_setstate(base, state);
8655 return this;
8658 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
8659 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
8660 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
8661 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
8663 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8664 int state = IOSTATE_goodbit;
8666 TRACE("(%p %p)\n", this, v);
8668 if(basic_istream_char_sentry_create(this, FALSE)) {
8669 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8670 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8671 istreambuf_iterator_char first={0}, last={0};
8673 first.strbuf = strbuf;
8674 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
8676 basic_istream_char_sentry_destroy(this);
8678 basic_ios_char_setstate(base, state);
8679 return this;
8682 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
8683 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
8684 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
8685 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
8687 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8688 int state = IOSTATE_goodbit;
8690 TRACE("(%p %p)\n", this, v);
8692 if(basic_istream_char_sentry_create(this, FALSE)) {
8693 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8694 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8695 istreambuf_iterator_char first={0}, last={0};
8697 first.strbuf = strbuf;
8698 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
8700 basic_istream_char_sentry_destroy(this);
8702 basic_ios_char_setstate(base, state);
8703 return this;
8706 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
8707 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
8708 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
8709 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
8711 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8712 int state = IOSTATE_goodbit;
8714 TRACE("(%p %p)\n", this, v);
8716 if(basic_istream_char_sentry_create(this, FALSE)) {
8717 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8718 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8719 istreambuf_iterator_char first={0}, last={0};
8721 first.strbuf = strbuf;
8722 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
8724 basic_istream_char_sentry_destroy(this);
8726 basic_ios_char_setstate(base, state);
8727 return this;
8730 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
8731 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
8732 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
8733 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
8735 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8736 int state = IOSTATE_goodbit;
8738 TRACE("(%p %p)\n", this, v);
8740 if(basic_istream_char_sentry_create(this, FALSE)) {
8741 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8742 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8743 istreambuf_iterator_char first={0}, last={0};
8745 first.strbuf = strbuf;
8746 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
8748 basic_istream_char_sentry_destroy(this);
8750 basic_ios_char_setstate(base, state);
8751 return this;
8754 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
8755 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
8756 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
8757 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
8759 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8760 int state = IOSTATE_goodbit;
8762 TRACE("(%p %p)\n", this, v);
8764 if(basic_istream_char_sentry_create(this, FALSE)) {
8765 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8766 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8767 istreambuf_iterator_char first={0}, last={0};
8769 first.strbuf = strbuf;
8770 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
8772 basic_istream_char_sentry_destroy(this);
8774 basic_ios_char_setstate(base, state);
8775 return this;
8778 /* ??$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 */
8779 /* ??$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 */
8780 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
8781 basic_istream_char *istream, basic_string_char *str, char delim)
8783 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8784 IOSB_iostate state = IOSTATE_goodbit;
8785 int c = (unsigned char)delim;
8787 TRACE("(%p %p %c)\n", istream, str, delim);
8789 if(basic_istream_char_sentry_create(istream, TRUE)) {
8790 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8791 MSVCP_basic_string_char_clear(str);
8793 c = basic_streambuf_char_sgetc(strbuf);
8794 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
8795 MSVCP_basic_string_char_append_ch(str, c);
8796 if(c==EOF) state |= IOSTATE_eofbit;
8797 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
8799 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
8801 basic_istream_char_sentry_destroy(istream);
8803 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
8804 return istream;
8807 /* ??$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 */
8808 /* ??$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 */
8809 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
8810 basic_istream_char *istream, basic_string_char *str)
8812 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
8815 /* ??$?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 */
8816 /* ??$?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 */
8817 basic_istream_char* __cdecl basic_istream_char_read_bstr(
8818 basic_istream_char *istream, basic_string_char *str)
8820 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8821 IOSB_iostate state = IOSTATE_failbit;
8822 int c = '\n';
8824 TRACE("(%p %p)\n", istream, str);
8826 if(basic_istream_char_sentry_create(istream, FALSE)) {
8827 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
8828 MSVCP_size_t count = ios_base_width_get(&base->base);
8830 if(!count)
8831 count = -1;
8833 MSVCP_basic_string_char_clear(str);
8835 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8836 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8837 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8838 state = IOSTATE_goodbit;
8839 MSVCP_basic_string_char_append_ch(str, c);
8842 basic_istream_char_sentry_destroy(istream);
8844 ios_base_width_set(&base->base, 0);
8845 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8846 return istream;
8849 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
8850 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
8851 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
8852 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
8853 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
8854 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
8855 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
8857 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8858 IOSB_iostate state = IOSTATE_failbit;
8859 int c = '\n';
8861 TRACE("(%p %p)\n", istream, str);
8863 if(basic_istream_char_sentry_create(istream, FALSE)) {
8864 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
8865 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
8867 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8868 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8869 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8870 state = IOSTATE_goodbit;
8871 *str++ = c;
8874 basic_istream_char_sentry_destroy(istream);
8876 *str = 0;
8877 ios_base_width_set(&base->base, 0);
8878 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8879 return istream;
8882 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
8883 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
8884 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
8885 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
8886 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
8887 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
8888 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
8890 IOSB_iostate state = IOSTATE_failbit;
8891 int c = 0;
8893 TRACE("(%p %p)\n", istream, ch);
8895 if(basic_istream_char_sentry_create(istream, FALSE)) {
8896 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
8897 basic_istream_char_get_basic_ios(istream)));
8898 if(c != EOF) {
8899 state = IOSTATE_goodbit;
8900 *ch = c;
8903 basic_istream_char_sentry_destroy(istream);
8905 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
8906 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8907 return istream;
8910 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8911 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8912 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
8913 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
8914 basic_istream_char *this, basic_streambuf_char *streambuf)
8916 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8917 IOSB_iostate state = IOSTATE_failbit;
8918 int c = '\n';
8920 TRACE("(%p %p)\n", this, streambuf);
8922 if(basic_istream_char_sentry_create(this, FALSE)) {
8923 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
8924 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
8925 state = IOSTATE_goodbit;
8926 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
8927 break;
8930 basic_istream_char_sentry_destroy(this);
8932 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8933 return this;
8936 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8937 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8938 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
8939 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
8940 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
8942 TRACE("(%p %p)\n", this, pfunc);
8943 pfunc(this);
8944 return this;
8947 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
8948 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
8949 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
8950 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
8951 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
8953 TRACE("(%p %p)\n", this, pfunc);
8954 pfunc(basic_istream_char_get_basic_ios(this));
8955 return this;
8958 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8959 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8960 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
8961 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
8962 ios_base* (__cdecl *pfunc)(ios_base*))
8964 TRACE("(%p %p)\n", this, pfunc);
8965 pfunc(&basic_istream_char_get_basic_ios(this)->base);
8966 return this;
8969 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
8970 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
8971 DEFINE_THISCALL_WRAPPER(basic_istream_char_swap, 8)
8972 void __thiscall basic_istream_char_swap(basic_istream_char *this, basic_istream_char *r)
8974 TRACE("(%p %p)\n", this, r);
8976 if(this == r)
8977 return;
8979 basic_ios_char_swap(basic_istream_char_get_basic_ios(this),
8980 basic_istream_char_get_basic_ios(r));
8981 this->count ^= r->count;
8982 r->count ^= this->count;
8983 this->count ^= r->count;
8986 /* Caution: basic_istream uses virtual inheritance. */
8987 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
8989 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
8992 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
8994 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
8997 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
8999 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
9002 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9003 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9004 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
9005 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
9006 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9008 basic_ios_wchar *base;
9010 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
9012 if(virt_init) {
9013 this->vbtable = basic_istream_wchar_vbtable;
9014 base = basic_istream_wchar_get_basic_ios(this);
9015 basic_ios_wchar_ctor(base);
9016 }else {
9017 base = basic_istream_wchar_get_basic_ios(this);
9020 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9021 this->count = 0;
9022 if(!noinit)
9023 basic_ios_wchar_init(base, strbuf, isstd);
9024 return this;
9027 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9028 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9029 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
9030 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
9031 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9033 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
9034 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9035 return this;
9038 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9039 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9040 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
9041 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
9042 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9044 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9047 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9048 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9049 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
9050 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
9051 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9053 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9056 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9057 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9058 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
9059 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
9060 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9062 basic_ios_wchar *base;
9064 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
9066 if(virt_init) {
9067 this->vbtable = basic_istream_wchar_vbtable;
9068 base = basic_istream_wchar_get_basic_ios(this);
9069 basic_ios_wchar_ctor(base);
9070 }else {
9071 base = basic_istream_wchar_get_basic_ios(this);
9074 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9075 ios_base_Addstd(&base->base);
9076 return this;
9079 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9080 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9081 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
9082 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
9083 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9085 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
9086 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9087 return this;
9090 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9091 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9092 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9093 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9094 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
9095 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
9097 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9099 /* don't destroy virtual base here */
9100 TRACE("(%p)\n", this);
9103 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9104 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9105 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9106 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9107 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
9108 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
9110 TRACE("(%p)\n", this);
9111 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
9112 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
9115 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
9116 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9118 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9120 TRACE("(%p %x)\n", this, flags);
9122 if(flags & 2) {
9123 /* we have an array, with the number of elements stored before the first object */
9124 INT_PTR i, *ptr = (INT_PTR *)this-1;
9126 for(i=*ptr-1; i>=0; i--)
9127 basic_istream_wchar_vbase_dtor(this+i);
9128 MSVCRT_operator_delete(ptr);
9129 } else {
9130 basic_istream_wchar_vbase_dtor(this);
9131 if(flags & 1)
9132 MSVCRT_operator_delete(this);
9135 return this;
9138 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9139 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9140 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9141 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9142 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
9143 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9145 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9147 TRACE("(%p %d)\n", this, noskip);
9149 if(ios_base_good(&base->base)) {
9150 if(basic_ios_wchar_tie_get(base))
9151 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
9153 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
9154 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9155 const ctype_wchar *ctype = ctype_wchar_use_facet(base->strbuf->loc);
9156 int ch;
9158 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
9159 ch = basic_streambuf_wchar_snextc(strbuf)) {
9160 if(ch == WEOF) {
9161 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9162 break;
9165 if(!ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
9166 break;
9171 if(!ios_base_good(&base->base)) {
9172 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9173 return FALSE;
9175 return TRUE;
9178 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9179 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9180 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9181 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9182 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
9183 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9185 return basic_istream_wchar__Ipfx(this, noskip);
9188 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9189 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9190 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9191 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9192 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
9193 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
9195 TRACE("(%p)\n", this);
9198 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
9200 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9202 if(basic_ios_wchar_rdbuf_get(base))
9203 basic_streambuf_wchar__Lock(base->strbuf);
9205 return basic_istream_wchar_ipfx(istr, noskip);
9208 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
9210 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9212 if(basic_ios_wchar_rdbuf_get(base))
9213 basic_streambuf_wchar__Unlock(base->strbuf);
9216 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
9217 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
9218 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
9219 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
9220 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
9221 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
9222 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
9223 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
9224 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
9225 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
9227 TRACE("(%p)\n", this);
9228 return this->count;
9231 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9232 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9233 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9234 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9235 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
9236 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
9238 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9239 int ret;
9241 TRACE("(%p)\n", this);
9243 this->count = 0;
9245 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
9246 basic_istream_wchar_sentry_destroy(this);
9247 return WEOF;
9250 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
9251 basic_istream_wchar_sentry_destroy(this);
9252 if(ret == WEOF)
9253 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
9254 else
9255 this->count++;
9257 return ret;
9260 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
9261 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
9262 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
9263 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
9264 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
9265 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
9267 unsigned short ret;
9269 TRACE("(%p %p)\n", this, ch);
9271 ret = basic_istream_wchar_get(this);
9272 if(ret != WEOF)
9273 *ch = (wchar_t)ret;
9274 return this;
9277 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9278 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9279 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9280 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9281 #if STREAMSIZE_BITS == 64
9282 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
9283 #else
9284 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
9285 #endif
9286 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9288 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9289 unsigned short ch = delim;
9291 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
9293 this->count = 0;
9295 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9296 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9298 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
9299 ch = basic_streambuf_wchar_snextc(strbuf)) {
9300 if(ch==WEOF || ch==delim)
9301 break;
9303 *str++ = ch;
9304 this->count++;
9305 count--;
9308 basic_istream_wchar_sentry_destroy(this);
9310 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9311 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9312 if(count > 0)
9313 *str = 0;
9314 return this;
9317 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9318 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9319 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9320 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9321 #if STREAMSIZE_BITS == 64
9322 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
9323 #else
9324 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
9325 #endif
9326 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
9328 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
9331 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9332 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9333 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9334 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9335 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
9336 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
9338 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9339 unsigned short ch = delim;
9341 TRACE("(%p %p %c)\n", this, strbuf, delim);
9343 this->count = 0;
9345 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9346 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
9348 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
9349 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
9350 if(ch==WEOF || ch==delim)
9351 break;
9353 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
9354 break;
9355 this->count++;
9358 basic_istream_wchar_sentry_destroy(this);
9360 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9361 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9362 return this;
9365 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9366 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9367 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9368 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9369 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
9370 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
9372 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
9375 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9376 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9377 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9378 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9379 #if STREAMSIZE_BITS == 64
9380 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
9381 #else
9382 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
9383 #endif
9384 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9386 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9387 unsigned short ch = delim;
9389 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
9391 this->count = 0;
9393 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
9394 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9396 while(count > 1) {
9397 ch = basic_streambuf_wchar_sbumpc(strbuf);
9399 if(ch==WEOF || ch==delim)
9400 break;
9402 *str++ = ch;
9403 this->count++;
9404 count--;
9407 if(ch == delim)
9408 this->count++;
9409 else if(ch != WEOF) {
9410 ch = basic_streambuf_wchar_sgetc(strbuf);
9412 if(ch == delim) {
9413 basic_streambuf_wchar__Gninc(strbuf);
9414 this->count++;
9418 basic_istream_wchar_sentry_destroy(this);
9420 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
9421 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
9422 if(count > 0)
9423 *str = 0;
9424 return this;
9427 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9428 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9429 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9430 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9431 #if STREAMSIZE_BITS == 64
9432 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
9433 #else
9434 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
9435 #endif
9436 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
9438 return basic_istream_wchar_getline_delim(this, str, count, '\n');
9441 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
9442 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
9443 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
9444 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
9445 #if STREAMSIZE_BITS == 64
9446 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
9447 #else
9448 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
9449 #endif
9450 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
9452 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9453 unsigned short ch = delim;
9454 unsigned int state;
9456 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
9458 this->count = 0;
9460 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9461 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9462 state = IOSTATE_goodbit;
9464 while(count > 0) {
9465 ch = basic_streambuf_wchar_sbumpc(strbuf);
9467 if(ch==WEOF) {
9468 state = IOSTATE_eofbit;
9469 break;
9472 if(ch==delim)
9473 break;
9475 this->count++;
9476 if(count != INT_MAX)
9477 count--;
9479 }else
9480 state = IOSTATE_failbit;
9481 basic_istream_wchar_sentry_destroy(this);
9483 basic_ios_wchar_setstate(base, state);
9484 return this;
9487 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
9488 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
9489 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
9490 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
9491 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
9493 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9494 unsigned short ch = '\n';
9496 TRACE("(%p)\n", istream);
9498 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
9499 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9500 const ctype_wchar *ctype = ctype_wchar_use_facet(strbuf->loc);
9502 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
9503 ch = basic_streambuf_wchar_snextc(strbuf)) {
9504 if(ch == WEOF)
9505 break;
9508 basic_istream_wchar_sentry_destroy(istream);
9510 if(ch == WEOF)
9511 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9512 return istream;
9515 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9516 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9517 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9518 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9519 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
9520 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
9522 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9523 unsigned short ret = WEOF;
9525 TRACE("(%p)\n", this);
9527 this->count = 0;
9529 if(basic_istream_wchar_sentry_create(this, TRUE))
9530 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9531 basic_istream_wchar_sentry_destroy(this);
9533 if (ret == WEOF)
9534 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9536 return ret;
9539 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
9540 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
9541 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
9542 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
9543 #if STREAMSIZE_BITS == 64
9544 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
9545 #else
9546 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
9547 #endif
9548 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
9550 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9551 IOSB_iostate state = IOSTATE_goodbit;
9553 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9555 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9556 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9558 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
9559 if(this->count != count)
9560 state |= IOSTATE_failbit | IOSTATE_eofbit;
9561 }else {
9562 this->count = 0;
9564 basic_istream_wchar_sentry_destroy(this);
9566 basic_ios_wchar_setstate(base, state);
9567 return this;
9570 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9571 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9572 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9573 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9574 #if STREAMSIZE_BITS == 64
9575 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
9576 #else
9577 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
9578 #endif
9579 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
9581 return basic_istream_wchar__Read_s(this, str, -1, count);
9584 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
9585 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
9586 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
9587 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
9588 #if STREAMSIZE_BITS == 64
9589 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
9590 #else
9591 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
9592 #endif
9593 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
9595 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9596 IOSB_iostate state = IOSTATE_goodbit;
9598 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9600 this->count = 0;
9602 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9603 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
9604 if(avail > count)
9605 avail = count;
9607 if(avail == -1)
9608 state |= IOSTATE_eofbit;
9609 else if(avail > 0)
9610 basic_istream_wchar__Read_s(this, str, size, avail);
9611 }else {
9612 state |= IOSTATE_failbit;
9614 basic_istream_wchar_sentry_destroy(this);
9616 basic_ios_wchar_setstate(base, state);
9617 return this->count;
9620 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
9621 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
9622 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
9623 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
9624 #if STREAMSIZE_BITS == 64
9625 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
9626 #else
9627 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
9628 #endif
9629 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
9631 return basic_istream_wchar__Readsome_s(this, str, count, count);
9634 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
9635 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
9636 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
9637 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
9638 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
9639 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
9641 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9642 IOSB_iostate state = IOSTATE_goodbit;
9644 TRACE("(%p %c)\n", this, ch);
9646 this->count = 0;
9648 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9649 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9651 if(!ios_base_good(&base->base))
9652 state |= IOSTATE_failbit;
9653 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
9654 state |= IOSTATE_badbit;
9656 basic_istream_wchar_sentry_destroy(this);
9658 basic_ios_wchar_setstate(base, state);
9659 return this;
9662 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
9663 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
9664 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
9665 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
9666 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
9667 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
9669 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9670 IOSB_iostate state = IOSTATE_goodbit;
9672 TRACE("(%p)\n", this);
9674 this->count = 0;
9676 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9677 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9679 if(!ios_base_good(&base->base))
9680 state |= IOSTATE_failbit;
9681 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
9682 state |= IOSTATE_badbit;
9684 basic_istream_wchar_sentry_destroy(this);
9686 basic_ios_wchar_setstate(base, state);
9687 return this;
9690 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
9691 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
9692 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
9693 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
9694 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
9695 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
9697 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9698 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9700 TRACE("(%p)\n", this);
9702 if(!strbuf)
9703 return -1;
9705 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9706 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
9707 basic_istream_wchar_sentry_destroy(this);
9708 return 0;
9711 basic_istream_wchar_sentry_destroy(this);
9713 basic_ios_wchar_setstate(base, IOSTATE_badbit);
9714 return -1;
9717 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9718 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9719 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9720 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9721 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
9722 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
9724 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9726 TRACE("(%p %p)\n", this, ret);
9728 if(ios_base_fail(&base->base)) {
9729 ret->off = -1;
9730 ret->pos = 0;
9731 ret->state = 0;
9732 return ret;
9735 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
9736 ret, 0, SEEKDIR_cur, OPENMODE_in);
9737 if(ret->off==-1 && ret->pos==0 && ret->state==0)
9738 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9740 return ret;
9743 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
9744 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
9745 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
9746 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
9747 #if STREAMOFF_BITS == 64
9748 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
9749 #else
9750 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
9751 #endif
9752 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
9754 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9756 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
9758 if(!ios_base_fail(&base->base)) {
9759 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9760 fpos_int ret;
9762 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
9764 if(ret.off==-1 && ret.pos==0 && ret.state==0)
9765 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9766 else
9767 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9768 return this;
9769 }else
9770 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9772 return this;
9775 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9776 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9777 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9778 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9779 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
9780 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
9782 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9784 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
9786 if(!ios_base_fail(&base->base)) {
9787 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9788 fpos_int ret;
9790 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
9792 if(ret.off==-1 && ret.pos==0 && ret.state==0)
9793 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9794 else
9795 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9796 return this;
9797 }else
9798 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9800 return this;
9803 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
9805 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9806 int state = IOSTATE_goodbit;
9808 TRACE("(%p %p)\n", this, v);
9810 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9811 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9812 istreambuf_iterator_wchar first={0}, last={0};
9813 LONG tmp;
9815 first.strbuf = strbuf;
9816 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
9818 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
9819 *v = tmp;
9820 else
9821 state |= IOSTATE_failbit;
9823 basic_istream_wchar_sentry_destroy(this);
9825 basic_ios_wchar_setstate(base, state);
9826 return this;
9829 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
9830 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
9831 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
9832 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
9834 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
9835 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9838 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
9839 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
9840 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
9841 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
9843 return basic_istream_read_short(this, v, num_get_short_use_facet(
9844 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9847 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
9848 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
9849 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
9850 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
9852 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9853 int state = IOSTATE_goodbit;
9855 TRACE("(%p %p)\n", this, v);
9857 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9858 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9859 const num_get *numget = num_get_wchar_use_facet(strbuf->loc);
9860 istreambuf_iterator_wchar first={0}, last={0};
9862 first.strbuf = strbuf;
9863 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
9865 basic_istream_wchar_sentry_destroy(this);
9867 basic_ios_wchar_setstate(base, state);
9868 return this;
9871 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
9873 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9874 int state = IOSTATE_goodbit;
9876 TRACE("(%p %p)\n", this, v);
9878 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9879 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9880 istreambuf_iterator_wchar first={0}, last={0};
9882 first.strbuf = strbuf;
9883 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9885 basic_istream_wchar_sentry_destroy(this);
9887 basic_ios_wchar_setstate(base, state);
9888 return this;
9891 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAH@Z */
9892 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
9893 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
9894 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
9896 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
9897 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9900 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
9901 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
9902 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
9903 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
9905 return basic_istream_read_int(this, v, num_get_short_use_facet(
9906 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9909 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
9911 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9912 int state = IOSTATE_goodbit;
9914 TRACE("(%p %p)\n", this, v);
9916 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9917 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9918 istreambuf_iterator_wchar first={0}, last={0};
9920 first.strbuf = strbuf;
9921 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
9923 basic_istream_wchar_sentry_destroy(this);
9925 basic_ios_wchar_setstate(base, state);
9926 return this;
9929 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
9930 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
9931 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
9932 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
9934 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
9935 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9938 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
9939 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
9940 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
9941 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
9943 return basic_istream_read_uint(this, v, num_get_short_use_facet(
9944 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9947 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
9949 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9950 int state = IOSTATE_goodbit;
9952 TRACE("(%p %p)\n", this, v);
9954 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9955 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9956 istreambuf_iterator_wchar first={0}, last={0};
9958 first.strbuf = strbuf;
9959 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9961 basic_istream_wchar_sentry_destroy(this);
9963 basic_ios_wchar_setstate(base, state);
9964 return this;
9967 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
9968 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
9969 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
9970 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
9972 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
9973 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9976 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
9977 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
9978 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
9979 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
9981 return basic_istream_read_long(this, v, num_get_short_use_facet(
9982 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9985 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
9987 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9988 int state = IOSTATE_goodbit;
9990 TRACE("(%p %p)\n", this, v);
9992 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9993 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9994 istreambuf_iterator_wchar first={0}, last={0};
9996 first.strbuf = strbuf;
9997 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
9999 basic_istream_wchar_sentry_destroy(this);
10001 basic_ios_wchar_setstate(base, state);
10002 return this;
10005 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
10006 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
10007 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
10008 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
10010 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
10011 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10014 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
10015 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
10016 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
10017 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
10019 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
10020 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10023 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
10025 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10026 int state = IOSTATE_goodbit;
10028 TRACE("(%p %p)\n", this, v);
10030 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10031 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10032 istreambuf_iterator_wchar first={0}, last={0};
10034 first.strbuf = strbuf;
10035 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
10037 basic_istream_wchar_sentry_destroy(this);
10039 basic_ios_wchar_setstate(base, state);
10040 return this;
10043 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
10044 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
10045 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
10046 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
10048 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
10049 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10052 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
10053 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
10054 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
10055 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
10057 return basic_istream_read_float(this, v, num_get_short_use_facet(
10058 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10061 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
10063 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10064 int state = IOSTATE_goodbit;
10066 TRACE("(%p %p)\n", this, v);
10068 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10069 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10070 istreambuf_iterator_wchar first={0}, last={0};
10072 first.strbuf = strbuf;
10073 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
10075 basic_istream_wchar_sentry_destroy(this);
10077 basic_ios_wchar_setstate(base, state);
10078 return this;
10081 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
10082 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
10083 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
10084 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
10086 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
10087 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10090 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
10091 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
10092 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
10093 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
10095 return basic_istream_read_double(this, v, num_get_short_use_facet(
10096 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10099 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
10101 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10102 int state = IOSTATE_goodbit;
10104 TRACE("(%p %p)\n", this, v);
10106 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10107 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10108 istreambuf_iterator_wchar first={0}, last={0};
10110 first.strbuf = strbuf;
10111 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
10113 basic_istream_wchar_sentry_destroy(this);
10115 basic_ios_wchar_setstate(base, state);
10116 return this;
10119 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
10120 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
10121 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
10122 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
10124 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
10125 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10128 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
10129 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
10130 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
10131 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
10133 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
10134 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10137 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
10139 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10140 int state = IOSTATE_goodbit;
10142 TRACE("(%p %p)\n", this, v);
10144 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10145 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10146 istreambuf_iterator_wchar first={0}, last={0};
10148 first.strbuf = strbuf;
10149 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
10151 basic_istream_wchar_sentry_destroy(this);
10153 basic_ios_wchar_setstate(base, state);
10154 return this;
10157 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
10158 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10159 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
10160 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
10162 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
10163 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10166 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
10167 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10168 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
10169 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
10171 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
10172 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10175 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
10177 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10178 int state = IOSTATE_goodbit;
10180 TRACE("(%p %p)\n", this, v);
10182 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10183 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10184 istreambuf_iterator_wchar first={0}, last={0};
10186 first.strbuf = strbuf;
10187 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
10189 basic_istream_wchar_sentry_destroy(this);
10191 basic_ios_wchar_setstate(base, state);
10192 return this;
10195 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
10196 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
10197 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
10198 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
10200 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
10201 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10204 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
10205 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
10206 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
10207 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
10209 return basic_istream_read_int64(this, v, num_get_short_use_facet(
10210 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10213 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
10215 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10216 int state = IOSTATE_goodbit;
10218 TRACE("(%p %p)\n", this, v);
10220 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10221 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10222 istreambuf_iterator_wchar first={0}, last={0};
10224 first.strbuf = strbuf;
10225 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
10227 basic_istream_wchar_sentry_destroy(this);
10229 basic_ios_wchar_setstate(base, state);
10230 return this;
10233 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
10234 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
10235 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
10236 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10238 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
10239 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10242 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
10243 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
10244 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
10245 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10247 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
10248 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10251 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
10253 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10254 int state = IOSTATE_goodbit;
10256 TRACE("(%p %p)\n", this, v);
10258 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10259 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10260 istreambuf_iterator_wchar first={0}, last={0};
10262 first.strbuf = strbuf;
10263 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
10265 basic_istream_wchar_sentry_destroy(this);
10267 basic_ios_wchar_setstate(base, state);
10268 return this;
10271 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
10272 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
10273 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
10274 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10276 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
10277 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10280 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
10281 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
10282 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
10283 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10285 return basic_istream_read_bool(this, v, num_get_short_use_facet(
10286 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10289 /* ??$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 */
10290 /* ??$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 */
10291 /* ??$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 */
10292 /* ??$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 */
10293 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
10294 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
10296 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10297 IOSB_iostate state = IOSTATE_goodbit;
10298 int c = delim;
10300 TRACE("(%p %p %c)\n", istream, str, delim);
10302 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10303 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10304 MSVCP_basic_string_wchar_clear(str);
10306 c = basic_streambuf_wchar_sgetc(strbuf);
10307 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
10308 MSVCP_basic_string_wchar_append_ch(str, c);
10309 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
10310 else if(c==WEOF) state |= IOSTATE_eofbit;
10312 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
10314 basic_istream_wchar_sentry_destroy(istream);
10316 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
10317 return istream;
10320 /* ??$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 */
10321 /* ??$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 */
10322 /* ??$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 */
10323 /* ??$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 */
10324 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
10325 basic_istream_wchar *istream, basic_string_wchar *str)
10327 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
10330 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
10331 basic_string_wchar *str, const ctype_wchar *ctype)
10333 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10334 IOSB_iostate state = IOSTATE_failbit;
10335 int c = '\n';
10337 TRACE("(%p %p)\n", istream, str);
10339 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10340 MSVCP_size_t count = ios_base_width_get(&base->base);
10342 if(!count)
10343 count = -1;
10345 MSVCP_basic_string_wchar_clear(str);
10347 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10348 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10349 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10350 state = IOSTATE_goodbit;
10351 MSVCP_basic_string_wchar_append_ch(str, c);
10354 basic_istream_wchar_sentry_destroy(istream);
10356 ios_base_width_set(&base->base, 0);
10357 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10358 return istream;
10361 /* ??$?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 */
10362 /* ??$?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 */
10363 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
10364 basic_istream_wchar *istream, basic_string_wchar *str)
10366 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
10367 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10370 /* ??$?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 */
10371 /* ??$?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 */
10372 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
10373 basic_istream_wchar *istream, basic_string_wchar *str)
10375 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
10376 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10379 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
10381 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10382 IOSB_iostate state = IOSTATE_failbit;
10383 unsigned short c = '\n';
10385 TRACE("(%p %p)\n", istream, str);
10387 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10388 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
10390 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10391 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10392 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10393 state = IOSTATE_goodbit;
10394 *str++ = c;
10397 basic_istream_wchar_sentry_destroy(istream);
10399 *str = 0;
10400 ios_base_width_set(&base->base, 0);
10401 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10402 return istream;
10405 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
10406 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
10407 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
10409 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
10410 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10413 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
10414 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
10415 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
10417 return basic_istream_read_str(istream, str, ctype_short_use_facet(
10418 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10421 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
10422 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
10423 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
10424 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
10425 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
10427 IOSB_iostate state = IOSTATE_failbit;
10428 unsigned short c = 0;
10430 TRACE("(%p %p)\n", istream, ch);
10432 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10433 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
10434 basic_istream_wchar_get_basic_ios(istream)));
10435 if(c != WEOF) {
10436 state = IOSTATE_goodbit;
10437 *ch = c;
10440 basic_istream_wchar_sentry_destroy(istream);
10442 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
10443 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10444 return istream;
10447 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10448 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10449 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10450 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10451 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
10452 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
10453 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
10455 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10456 IOSB_iostate state = IOSTATE_failbit;
10457 unsigned short c = '\n';
10459 TRACE("(%p %p)\n", this, streambuf);
10461 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10462 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
10463 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
10464 state = IOSTATE_goodbit;
10465 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
10466 break;
10469 basic_istream_wchar_sentry_destroy(this);
10471 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10472 return this;
10475 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10476 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10477 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10478 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10479 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
10480 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
10481 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
10483 TRACE("(%p %p)\n", this, pfunc);
10484 pfunc(this);
10485 return this;
10488 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
10489 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
10490 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
10491 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
10492 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
10493 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
10494 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
10496 TRACE("(%p %p)\n", this, pfunc);
10497 pfunc(basic_istream_wchar_get_basic_ios(this));
10498 return this;
10501 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10502 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10503 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10504 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10505 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
10506 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
10507 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
10509 TRACE("(%p %p)\n", this, pfunc);
10510 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
10511 return this;
10514 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
10515 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
10516 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
10517 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
10518 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_swap, 8)
10519 void __thiscall basic_istream_wchar_swap(basic_istream_wchar *this, basic_istream_wchar *r)
10521 TRACE("(%p %p)\n", this, r);
10523 if(this == r)
10524 return;
10526 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(this),
10527 basic_istream_wchar_get_basic_ios(r));
10528 this->count ^= r->count;
10529 r->count ^= this->count;
10530 this->count ^= r->count;
10533 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
10535 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
10538 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
10540 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
10543 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10544 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10545 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
10546 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
10548 basic_ios_char *basic_ios;
10550 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10552 if(virt_init) {
10553 this->base1.vbtable = basic_iostream_char_vbtable1;
10554 this->base2.vbtable = basic_iostream_char_vbtable2;
10555 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10556 basic_ios_char_ctor(basic_ios);
10557 }else {
10558 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10561 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
10563 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
10564 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
10565 return this;
10568 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10569 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10570 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
10571 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
10573 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10575 TRACE("(%p)\n", this);
10576 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
10577 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
10580 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10581 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10582 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
10583 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
10585 TRACE("(%p)\n", this);
10586 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
10587 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
10590 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
10591 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10593 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10595 TRACE("(%p %x)\n", this, flags);
10597 if(flags & 2) {
10598 /* we have an array, with the number of elements stored before the first object */
10599 INT_PTR i, *ptr = (INT_PTR *)this-1;
10601 for(i=*ptr-1; i>=0; i--)
10602 basic_iostream_char_vbase_dtor(this+i);
10603 MSVCRT_operator_delete(ptr);
10604 } else {
10605 basic_iostream_char_vbase_dtor(this);
10606 if(flags & 1)
10607 MSVCRT_operator_delete(this);
10610 return this;
10613 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
10614 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
10615 DEFINE_THISCALL_WRAPPER(basic_iostream_char_swap, 8)
10616 void __thiscall basic_iostream_char_swap(basic_iostream_char *this, basic_iostream_char *r)
10618 TRACE("(%p %p)\n", this, r);
10620 if(this == r)
10621 return;
10623 basic_ios_char_swap(basic_istream_char_get_basic_ios(&this->base1),
10624 basic_istream_char_get_basic_ios(&r->base1));
10627 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
10629 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
10632 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10634 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
10637 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10638 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10639 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
10640 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
10641 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
10643 basic_ios_wchar *basic_ios;
10645 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10647 if(virt_init) {
10648 this->base1.vbtable = basic_iostream_wchar_vbtable1;
10649 this->base2.vbtable = basic_iostream_wchar_vbtable2;
10650 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10651 basic_ios_wchar_ctor(basic_ios);
10652 }else {
10653 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10656 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
10657 basic_ostream_wchar_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
10659 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
10660 return this;
10663 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10664 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10665 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
10666 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
10667 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
10669 basic_iostream_wchar_ctor(this, strbuf, virt_init);
10670 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
10671 return this;
10674 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10675 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10676 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10677 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10678 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
10679 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
10681 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10683 TRACE("(%p)\n", this);
10684 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
10685 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
10688 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10689 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10690 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10691 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10692 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
10693 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
10695 TRACE("(%p)\n", this);
10696 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
10697 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
10700 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
10701 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10703 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10705 TRACE("(%p %x)\n", this, flags);
10707 if(flags & 2) {
10708 /* we have an array, with the number of elements stored before the first object */
10709 INT_PTR i, *ptr = (INT_PTR *)this-1;
10711 for(i=*ptr-1; i>=0; i--)
10712 basic_iostream_wchar_vbase_dtor(this+i);
10713 MSVCRT_operator_delete(ptr);
10714 } else {
10715 basic_iostream_wchar_vbase_dtor(this);
10716 if(flags & 1)
10717 MSVCRT_operator_delete(this);
10720 return this;
10723 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
10724 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
10725 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
10726 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
10727 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_swap, 8)
10728 void __thiscall basic_iostream_wchar_swap(basic_iostream_wchar *this, basic_iostream_wchar *r)
10730 TRACE("(%p %p)\n", this, r);
10732 if(this == r)
10733 return;
10735 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(&this->base1),
10736 basic_istream_wchar_get_basic_ios(&r->base1));
10739 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
10741 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
10744 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
10746 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
10749 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10750 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10751 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
10752 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
10754 basic_ios_char *basic_ios;
10756 TRACE("(%p %d)\n", this, virt_init);
10758 if(virt_init) {
10759 this->base.vbtable = basic_ofstream_char_vbtable;
10760 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10761 basic_ios_char_ctor(basic_ios);
10762 }else {
10763 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10766 basic_filebuf_char_ctor(&this->filebuf);
10767 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10768 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10769 return this;
10772 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10773 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10774 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
10775 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
10776 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
10778 basic_ios_char *basic_ios;
10780 TRACE("(%p %p %d)\n", this, file, virt_init);
10782 if(virt_init) {
10783 this->base.vbtable = basic_ofstream_char_vbtable;
10784 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10785 basic_ios_char_ctor(basic_ios);
10786 }else {
10787 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10790 basic_filebuf_char_ctor_file(&this->filebuf, file);
10791 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10792 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10793 return this;
10796 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
10797 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
10798 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 20)
10799 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
10800 const char *name, int mode, int prot, MSVCP_bool virt_init)
10802 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
10804 basic_ofstream_char_ctor(this, virt_init);
10806 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10807 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10808 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10810 return this;
10813 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
10814 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
10815 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
10816 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
10817 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name_wchar, 20)
10818 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name_wchar(basic_ofstream_char *this,
10819 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10821 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
10823 basic_ofstream_char_ctor(this, virt_init);
10825 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10826 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10827 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10829 return this;
10832 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10833 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10834 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
10835 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
10837 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10839 TRACE("(%p)\n", this);
10841 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
10842 basic_filebuf_char_dtor(&this->filebuf);
10845 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10846 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10847 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
10848 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
10850 TRACE("(%p)\n", this);
10852 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
10853 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
10856 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
10857 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10859 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10861 TRACE("(%p %x)\n", this, flags);
10863 if(flags & 2) {
10864 /* we have an array, with the number of elements stored before the first object */
10865 INT_PTR i, *ptr = (INT_PTR *)this-1;
10867 for(i=*ptr-1; i>=0; i--)
10868 basic_ofstream_char_vbase_dtor(this+i);
10869 MSVCRT_operator_delete(ptr);
10870 } else {
10871 basic_ofstream_char_vbase_dtor(this);
10872 if(flags & 1)
10873 MSVCRT_operator_delete(this);
10876 return this;
10879 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10880 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10881 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
10882 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
10884 TRACE("(%p)\n", this);
10886 if(!basic_filebuf_char_close(&this->filebuf)) {
10887 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10888 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10892 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10893 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10894 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
10895 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
10897 TRACE("(%p)\n", this);
10898 return basic_filebuf_char_is_open(&this->filebuf);
10901 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
10902 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
10903 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 16)
10904 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
10905 const char *name, int mode, int prot)
10907 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
10909 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10910 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10911 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10915 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
10916 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
10917 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
10918 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
10919 const char *name, unsigned int mode)
10921 basic_ofstream_char_open(this, name, mode, _SH_DENYNO);
10924 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
10925 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
10926 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
10927 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
10928 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar, 16)
10929 void __thiscall basic_ofstream_char_open_wchar(basic_ofstream_char *this,
10930 const wchar_t *name, int mode, int prot)
10932 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
10934 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10935 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10936 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10940 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
10941 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
10942 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
10943 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
10944 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar_old, 12)
10945 void __thiscall basic_ofstream_char_open_wchar_old(basic_ofstream_char *this,
10946 const wchar_t *name, unsigned int mode)
10948 basic_ofstream_char_open_wchar(this, name, mode, _SH_DENYNO);
10951 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10952 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10953 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
10954 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
10956 TRACE("(%p)\n", this);
10957 return (basic_filebuf_char*)&this->filebuf;
10960 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
10962 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
10965 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10967 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
10970 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10971 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10972 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
10973 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10975 basic_ios_wchar *basic_ios;
10977 TRACE("(%p %d)\n", this, virt_init);
10979 if(virt_init) {
10980 this->base.vbtable = basic_ofstream_wchar_vbtable;
10981 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10982 basic_ios_wchar_ctor(basic_ios);
10983 }else {
10984 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10987 basic_filebuf_wchar_ctor(&this->filebuf);
10988 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10989 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
10990 return this;
10993 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10994 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10995 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
10996 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10998 basic_ofstream_wchar_ctor(this, virt_init);
10999 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11000 return this;
11003 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11004 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11005 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
11006 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
11007 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11009 basic_ios_wchar *basic_ios;
11011 TRACE("(%p %p %d)\n", this, file, virt_init);
11013 if(virt_init) {
11014 this->base.vbtable = basic_ofstream_wchar_vbtable;
11015 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11016 basic_ios_wchar_ctor(basic_ios);
11017 }else {
11018 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11021 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11022 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11023 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11024 return this;
11027 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11028 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11029 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
11030 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
11031 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11033 basic_ofstream_wchar_ctor_file(this, file, virt_init);
11034 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11035 return this;
11038 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
11039 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
11040 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name, 20)
11041 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name(basic_ofstream_wchar *this,
11042 const char *name, int mode, int prot, MSVCP_bool virt_init)
11044 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11046 basic_ofstream_wchar_ctor(this, virt_init);
11048 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11049 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11050 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11052 return this;
11055 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
11056 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
11057 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 20)
11058 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
11059 const char *name, int mode, int prot, MSVCP_bool virt_init)
11061 basic_ofstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11062 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11063 return this;
11066 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11067 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11068 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11069 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11070 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name_wchar, 20)
11071 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name_wchar(basic_ofstream_wchar *this,
11072 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11074 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11076 basic_ofstream_wchar_ctor(this, virt_init);
11078 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11079 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11080 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11082 return this;
11085 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11086 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11087 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11088 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11089 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name_wchar, 20)
11090 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name_wchar(basic_ofstream_wchar *this,
11091 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11093 basic_ofstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11094 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11095 return this;
11098 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11099 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11100 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11101 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11102 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
11103 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
11105 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11107 TRACE("(%p)\n", this);
11109 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11110 basic_filebuf_wchar_dtor(&this->filebuf);
11113 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11114 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11115 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11116 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11117 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
11118 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
11120 TRACE("(%p)\n", this);
11122 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
11123 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
11126 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
11127 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11129 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11131 TRACE("(%p %x)\n", this, flags);
11133 if(flags & 2) {
11134 /* we have an array, with the number of elements stored before the first object */
11135 INT_PTR i, *ptr = (INT_PTR *)this-1;
11137 for(i=*ptr-1; i>=0; i--)
11138 basic_ofstream_wchar_vbase_dtor(this+i);
11139 MSVCRT_operator_delete(ptr);
11140 } else {
11141 basic_ofstream_wchar_vbase_dtor(this);
11142 if(flags & 1)
11143 MSVCRT_operator_delete(this);
11146 return this;
11149 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11150 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11151 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11152 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11153 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
11154 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
11156 TRACE("(%p)\n", this);
11158 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11159 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11160 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11164 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11165 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11166 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11167 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11168 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
11169 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
11171 TRACE("(%p)\n", this);
11172 return basic_filebuf_wchar_is_open(&this->filebuf);
11175 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
11176 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
11177 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
11178 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
11179 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 16)
11180 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
11181 const char *name, int mode, int prot)
11183 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11185 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11186 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11187 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11191 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
11192 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
11193 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
11194 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
11195 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
11196 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
11197 const char *name, unsigned int mode)
11199 basic_ofstream_wchar_open(this, name, mode, _SH_DENYNO);
11202 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11203 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11204 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11205 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11206 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11207 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11208 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11209 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11210 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar, 16)
11211 void __thiscall basic_ofstream_wchar_open_wchar(basic_ofstream_wchar *this,
11212 const wchar_t *name, int mode, int prot)
11214 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11216 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11217 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11218 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11222 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11223 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11224 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11225 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11226 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11227 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11228 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11229 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11230 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar_old, 12)
11231 void __thiscall basic_ofstream_wchar_open_wchar_old(basic_ofstream_wchar *this,
11232 const wchar_t *name, unsigned int mode)
11234 basic_ofstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11237 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11238 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11239 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11240 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11241 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
11242 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
11244 TRACE("(%p)\n", this);
11245 return (basic_filebuf_wchar*)&this->filebuf;
11248 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
11250 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
11253 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
11255 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
11258 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11259 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11260 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
11261 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
11263 basic_ios_char *basic_ios;
11265 TRACE("(%p %d)\n", this, virt_init);
11267 if(virt_init) {
11268 this->base.vbtable = basic_ifstream_char_vbtable;
11269 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11270 basic_ios_char_ctor(basic_ios);
11271 }else {
11272 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11275 basic_filebuf_char_ctor(&this->filebuf);
11276 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11277 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11278 return this;
11281 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11282 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11283 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
11284 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
11285 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
11287 basic_ios_char *basic_ios;
11289 TRACE("(%p %p %d)\n", this, file, virt_init);
11291 if(virt_init) {
11292 this->base.vbtable = basic_ifstream_char_vbtable;
11293 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11294 basic_ios_char_ctor(basic_ios);
11295 }else {
11296 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11299 basic_filebuf_char_ctor_file(&this->filebuf, file);
11300 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11301 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11302 return this;
11305 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11306 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11307 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 20)
11308 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
11309 const char *name, int mode, int prot, MSVCP_bool virt_init)
11311 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11313 basic_ifstream_char_ctor(this, virt_init);
11315 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11316 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11317 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11319 return this;
11322 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11323 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11324 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11325 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11326 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_wchar, 20)
11327 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_wchar(basic_ifstream_char *this,
11328 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11330 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11332 basic_ifstream_char_ctor(this, virt_init);
11334 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11335 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11336 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11338 return this;
11341 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11342 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11343 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
11344 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
11346 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11348 TRACE("(%p)\n", this);
11350 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11351 basic_filebuf_char_dtor(&this->filebuf);
11354 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11355 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11356 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
11357 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
11359 TRACE("(%p)\n", this);
11361 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
11362 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11365 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
11366 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11368 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11370 TRACE("(%p %x)\n", this, flags);
11372 if(flags & 2) {
11373 /* we have an array, with the number of elements stored before the first object */
11374 INT_PTR i, *ptr = (INT_PTR *)this-1;
11376 for(i=*ptr-1; i>=0; i--)
11377 basic_ifstream_char_vbase_dtor(this+i);
11378 MSVCRT_operator_delete(ptr);
11379 } else {
11380 basic_ifstream_char_vbase_dtor(this);
11381 if(flags & 1)
11382 MSVCRT_operator_delete(this);
11385 return this;
11388 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11389 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11390 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
11391 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
11393 TRACE("(%p)\n", this);
11395 if(!basic_filebuf_char_close(&this->filebuf)) {
11396 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11397 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11401 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11402 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11403 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
11404 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
11406 TRACE("(%p)\n", this);
11407 return basic_filebuf_char_is_open(&this->filebuf);
11410 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11411 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11412 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 16)
11413 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
11414 const char *name, int mode, int prot)
11416 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11418 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11419 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11420 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11424 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11425 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11426 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
11427 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
11428 const char *name, unsigned int mode)
11430 basic_ifstream_char_open(this, name, mode, _SH_DENYNO);
11433 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11434 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11435 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11436 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11437 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar, 16)
11438 void __thiscall basic_ifstream_char_open_wchar(basic_ifstream_char *this,
11439 const wchar_t *name, int mode, int prot)
11441 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11443 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11444 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11445 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11449 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11450 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11451 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11452 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11453 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar_old, 12)
11454 void __thiscall basic_ifstream_char_open_wchar_old(basic_ifstream_char *this,
11455 const wchar_t *name, unsigned int mode)
11457 basic_ifstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11460 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11461 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11462 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
11463 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
11465 TRACE("(%p)\n", this);
11466 return (basic_filebuf_char*)&this->filebuf;
11469 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
11471 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
11474 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11476 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
11479 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11480 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11481 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
11482 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
11484 basic_ios_wchar *basic_ios;
11486 TRACE("(%p %d)\n", this, virt_init);
11488 if(virt_init) {
11489 this->base.vbtable = basic_ifstream_wchar_vbtable;
11490 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11491 basic_ios_wchar_ctor(basic_ios);
11492 }else {
11493 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11496 basic_filebuf_wchar_ctor(&this->filebuf);
11497 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11498 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11499 return this;
11502 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11503 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11504 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
11505 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
11507 basic_ifstream_wchar_ctor(this, virt_init);
11508 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11509 return this;
11512 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11513 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11514 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
11515 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
11516 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11518 basic_ios_wchar *basic_ios;
11520 TRACE("(%p %p %d)\n", this, file, virt_init);
11522 if(virt_init) {
11523 this->base.vbtable = basic_ifstream_wchar_vbtable;
11524 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11525 basic_ios_wchar_ctor(basic_ios);
11526 }else {
11527 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11530 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11531 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11532 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11533 return this;
11536 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11537 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11538 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
11539 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
11540 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11542 basic_ifstream_wchar_ctor_file(this, file, virt_init);
11543 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11544 return this;
11547 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
11548 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
11549 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name, 20)
11550 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name(basic_ifstream_wchar *this,
11551 const char *name, int mode, int prot, MSVCP_bool virt_init)
11553 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11555 basic_ifstream_wchar_ctor(this, virt_init);
11557 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11558 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11559 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11561 return this;
11564 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
11565 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
11566 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 20)
11567 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
11568 const char *name, int mode, int prot, MSVCP_bool virt_init)
11570 basic_ifstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11571 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11572 return this;
11575 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11576 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11577 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11578 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11579 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_wchar, 20)
11580 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_wchar(basic_ifstream_wchar *this,
11581 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11583 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11585 basic_ifstream_wchar_ctor(this, virt_init);
11587 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11588 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11589 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11591 return this;
11594 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11595 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11596 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11597 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11598 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_wchar, 20)
11599 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_wchar(basic_ifstream_wchar *this,
11600 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11602 basic_ifstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11603 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11604 return this;
11607 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11608 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11609 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11610 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11611 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
11612 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
11614 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11616 TRACE("(%p)\n", this);
11618 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
11619 basic_filebuf_wchar_dtor(&this->filebuf);
11622 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11623 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11624 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11625 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11626 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
11627 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
11629 TRACE("(%p)\n", this);
11631 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
11632 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
11635 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
11636 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11638 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11640 TRACE("(%p %x)\n", this, flags);
11642 if(flags & 2) {
11643 /* we have an array, with the number of elements stored before the first object */
11644 INT_PTR i, *ptr = (INT_PTR *)this-1;
11646 for(i=*ptr-1; i>=0; i--)
11647 basic_ifstream_wchar_vbase_dtor(this+i);
11648 MSVCRT_operator_delete(ptr);
11649 } else {
11650 basic_ifstream_wchar_vbase_dtor(this);
11651 if(flags & 1)
11652 MSVCRT_operator_delete(this);
11655 return this;
11658 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11659 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11660 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11661 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11662 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
11663 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
11665 TRACE("(%p)\n", this);
11667 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11668 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11669 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11673 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11674 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11675 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11676 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11677 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
11678 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
11680 TRACE("(%p)\n", this);
11681 return basic_filebuf_wchar_is_open(&this->filebuf);
11684 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
11685 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
11686 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
11687 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
11688 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 16)
11689 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
11690 const char *name, int mode, int prot)
11692 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11694 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11695 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11696 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11700 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
11701 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
11702 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
11703 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
11704 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
11705 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
11706 const char *name, unsigned int mode)
11708 basic_ifstream_wchar_open(this, name, mode, _SH_DENYNO);
11711 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11712 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11713 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11714 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11715 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11716 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11717 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11718 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11719 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar, 16)
11720 void __thiscall basic_ifstream_wchar_open_wchar(basic_ifstream_wchar *this,
11721 const wchar_t *name, int mode, int prot)
11723 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11725 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11726 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11727 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11731 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11732 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11733 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11734 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11735 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11736 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11737 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11738 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11739 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar_old, 12)
11740 void __thiscall basic_ifstream_wchar_open_wchar_old(basic_ifstream_wchar *this,
11741 const wchar_t *name, unsigned int mode)
11743 basic_ifstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11746 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11747 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11748 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11749 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11750 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
11751 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
11753 TRACE("(%p)\n", this);
11754 return (basic_filebuf_wchar*)&this->filebuf;
11757 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
11759 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
11762 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
11764 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
11767 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11768 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11769 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
11770 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
11772 basic_ios_char *basic_ios;
11774 TRACE("(%p %d)\n", this, virt_init);
11776 if(virt_init) {
11777 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11778 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11779 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11780 basic_ios_char_ctor(basic_ios);
11781 }else {
11782 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11785 basic_filebuf_char_ctor(&this->filebuf);
11786 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11787 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11788 return this;
11791 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11792 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11793 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
11794 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
11795 FILE *file, MSVCP_bool virt_init)
11797 basic_ios_char *basic_ios;
11799 TRACE("(%p %p %d)\n", this, file, virt_init);
11801 if(virt_init) {
11802 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11803 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11804 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11805 basic_ios_char_ctor(basic_ios);
11806 }else {
11807 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11810 basic_filebuf_char_ctor_file(&this->filebuf, file);
11811 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11812 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11813 return this;
11816 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11817 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11818 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 20)
11819 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
11820 const char *name, int mode, int prot, MSVCP_bool virt_init)
11822 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11824 basic_fstream_char_ctor(this, virt_init);
11826 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
11827 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11828 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11830 return this;
11833 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
11834 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
11835 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_noprot, 16)
11836 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_noprot(basic_fstream_char *this,
11837 const char *name, int mode, MSVCP_bool virt_init)
11839 return basic_fstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
11842 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11843 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11844 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11845 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11846 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_wchar, 20)
11847 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_wchar(basic_fstream_char *this,
11848 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11850 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11852 basic_fstream_char_ctor(this, virt_init);
11854 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
11855 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11856 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11858 return this;
11861 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11862 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11863 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
11864 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
11866 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11868 TRACE("(%p)\n", this);
11870 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
11871 basic_filebuf_char_dtor(&this->filebuf);
11874 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11875 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11876 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
11877 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
11879 TRACE("(%p)\n", this);
11881 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
11882 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
11885 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
11886 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11888 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11890 TRACE("(%p %x)\n", this, flags);
11892 if(flags & 2) {
11893 /* we have an array, with the number of elements stored before the first object */
11894 INT_PTR i, *ptr = (INT_PTR *)this-1;
11896 for(i=*ptr-1; i>=0; i--)
11897 basic_fstream_char_vbase_dtor(this+i);
11898 MSVCRT_operator_delete(ptr);
11899 } else {
11900 basic_fstream_char_vbase_dtor(this);
11901 if(flags & 1)
11902 MSVCRT_operator_delete(this);
11905 return this;
11908 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11909 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11910 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
11911 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
11913 TRACE("(%p)\n", this);
11915 if(!basic_filebuf_char_close(&this->filebuf)) {
11916 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11917 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11921 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11922 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11923 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
11924 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
11926 TRACE("(%p)\n", this);
11927 return basic_filebuf_char_is_open(&this->filebuf);
11930 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11931 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11932 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 16)
11933 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
11934 const char *name, int mode, int prot)
11936 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11938 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
11939 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11940 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11944 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11945 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11946 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
11947 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
11948 const char *name, unsigned int mode)
11950 basic_fstream_char_open(this, name, mode, _SH_DENYNO);
11953 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11954 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11955 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11956 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11957 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar, 16)
11958 void __thiscall basic_fstream_char_open_wchar(basic_fstream_char *this,
11959 const wchar_t *name, int mode, int prot)
11961 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11963 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
11964 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11965 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11969 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11970 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11971 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11972 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11973 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar_old, 12)
11974 void __thiscall basic_fstream_char_open_wchar_old(basic_fstream_char *this,
11975 const wchar_t *name, unsigned int mode)
11977 basic_fstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11980 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11981 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11982 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
11983 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
11985 TRACE("(%p)\n", this);
11986 return (basic_filebuf_char*)&this->filebuf;
11989 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
11991 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
11994 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11996 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
11999 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
12000 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
12001 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
12002 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12004 basic_ios_wchar *basic_ios;
12006 TRACE("(%p %d)\n", this, virt_init);
12008 if(virt_init) {
12009 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12010 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12011 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12012 basic_ios_wchar_ctor(basic_ios);
12013 }else {
12014 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12017 basic_filebuf_wchar_ctor(&this->filebuf);
12018 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12019 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12020 return this;
12023 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
12024 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
12025 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
12026 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12028 basic_fstream_wchar_ctor(this, virt_init);
12029 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12030 return this;
12033 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
12034 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12035 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
12036 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
12037 FILE *file, MSVCP_bool virt_init)
12039 basic_ios_wchar *basic_ios;
12041 TRACE("(%p %p %d)\n", this, file, virt_init);
12043 if(virt_init) {
12044 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12045 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12046 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12047 basic_ios_wchar_ctor(basic_ios);
12048 }else {
12049 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12052 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
12053 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12054 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12055 return this;
12058 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
12059 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12060 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
12061 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
12062 FILE *file, MSVCP_bool virt_init)
12064 basic_fstream_wchar_ctor_file(this, file, virt_init);
12065 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12066 return this;
12069 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12070 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12071 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name, 20)
12072 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name(basic_fstream_wchar *this,
12073 const char *name, int mode, int prot, MSVCP_bool virt_init)
12075 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12077 basic_fstream_wchar_ctor(this, virt_init);
12079 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
12080 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12081 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12083 return this;
12086 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12087 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12088 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 20)
12089 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
12090 const char *name, int mode, int prot, MSVCP_bool virt_init)
12092 basic_fstream_wchar_ctor_name(this, name, mode, prot, virt_init);
12093 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12094 return this;
12097 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
12098 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_noprot, 16)
12099 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_noprot(basic_fstream_wchar *this,
12100 const char *name, int mode, MSVCP_bool virt_init)
12102 return basic_fstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12105 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
12106 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
12107 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_noprot, 16)
12108 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_noprot(basic_fstream_wchar *this,
12109 const char *name, int mode, MSVCP_bool virt_init)
12111 return basic_fstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12114 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
12115 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
12116 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12117 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12118 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_wchar, 20)
12119 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_wchar(basic_fstream_wchar *this,
12120 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12122 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12124 basic_fstream_wchar_ctor(this, virt_init);
12126 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
12127 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12128 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12130 return this;
12133 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12134 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12135 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
12136 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
12137 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_wchar, 20)
12138 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_wchar(basic_fstream_wchar *this,
12139 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12141 basic_fstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
12142 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12143 return this;
12146 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
12147 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
12148 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
12149 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
12150 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
12151 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
12153 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12155 TRACE("(%p)\n", this);
12157 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
12158 basic_filebuf_wchar_dtor(&this->filebuf);
12161 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12162 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12163 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12164 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12165 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
12166 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
12168 TRACE("(%p)\n", this);
12170 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
12171 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
12174 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
12175 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12177 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12179 TRACE("(%p %x)\n", this, flags);
12181 if(flags & 2) {
12182 /* we have an array, with the number of elements stored before the first object */
12183 INT_PTR i, *ptr = (INT_PTR *)this-1;
12185 for(i=*ptr-1; i>=0; i--)
12186 basic_fstream_wchar_vbase_dtor(this+i);
12187 MSVCRT_operator_delete(ptr);
12188 } else {
12189 basic_fstream_wchar_vbase_dtor(this);
12190 if(flags & 1)
12191 MSVCRT_operator_delete(this);
12194 return this;
12197 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12198 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12199 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12200 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12201 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
12202 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
12204 TRACE("(%p)\n", this);
12206 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12207 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12208 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12212 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12213 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12214 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12215 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12216 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
12217 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
12219 TRACE("(%p)\n", this);
12220 return basic_filebuf_wchar_is_open(&this->filebuf);
12223 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
12224 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
12225 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
12226 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
12227 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 16)
12228 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
12229 const char *name, int mode, int prot)
12231 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12233 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
12234 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12235 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12239 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
12240 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
12241 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
12242 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
12243 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
12244 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
12245 const char *name, unsigned int mode)
12247 basic_fstream_wchar_open(this, name, mode, _SH_DENYNO);
12250 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
12251 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
12252 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
12253 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
12254 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
12255 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
12256 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
12257 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
12258 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar, 16)
12259 void __thiscall basic_fstream_wchar_open_wchar(basic_fstream_wchar *this,
12260 const wchar_t *name, int mode, int prot)
12262 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12264 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
12265 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12266 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12270 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
12271 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
12272 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
12273 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
12274 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
12275 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
12276 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
12277 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
12278 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar_old, 12)
12279 void __thiscall basic_fstream_wchar_open_wchar_old(basic_fstream_wchar *this,
12280 const wchar_t *name, unsigned int mode)
12282 basic_fstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
12285 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12286 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12287 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12288 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12289 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
12290 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
12292 TRACE("(%p)\n", this);
12293 return (basic_filebuf_wchar*)&this->filebuf;
12296 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
12298 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
12301 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
12303 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
12306 /* ??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 */
12307 /* ??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 */
12308 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
12309 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
12310 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12312 basic_ios_char *basic_ios;
12314 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12316 if(virt_init) {
12317 this->base.vbtable = basic_ostringstream_char_vbtable;
12318 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12319 basic_ios_char_ctor(basic_ios);
12320 }else {
12321 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12324 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12325 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12326 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12327 return this;
12330 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12331 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12332 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
12333 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
12334 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
12336 basic_ios_char *basic_ios;
12338 TRACE("(%p %d %d)\n", this, mode, virt_init);
12340 if(virt_init) {
12341 this->base.vbtable = basic_ostringstream_char_vbtable;
12342 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12343 basic_ios_char_ctor(basic_ios);
12344 }else {
12345 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12348 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12349 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12350 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12351 return this;
12354 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12355 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12356 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
12357 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
12358 basic_ostringstream_char *this)
12360 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
12363 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12364 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12365 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
12366 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
12368 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12370 TRACE("(%p)\n", this);
12372 basic_stringbuf_char_dtor(&this->strbuf);
12373 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
12376 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12377 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12378 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
12379 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
12381 TRACE("(%p)\n", this);
12383 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
12384 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
12387 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
12388 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12390 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12392 TRACE("(%p %x)\n", this, flags);
12394 if(flags & 2) {
12395 /* we have an array, with the number of elements stored before the first object */
12396 INT_PTR i, *ptr = (INT_PTR *)this-1;
12398 for(i=*ptr-1; i>=0; i--)
12399 basic_ostringstream_char_vbase_dtor(this+i);
12400 MSVCRT_operator_delete(ptr);
12401 } else {
12402 basic_ostringstream_char_vbase_dtor(this);
12403 if(flags & 1)
12404 MSVCRT_operator_delete(this);
12407 return this;
12410 /* ?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 */
12411 /* ?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 */
12412 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
12413 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
12415 TRACE("(%p)\n", this);
12416 return (basic_stringbuf_char*)&this->strbuf;
12419 /* ?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 */
12420 /* ?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 */
12421 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
12422 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
12424 TRACE("(%p %p)\n", this, str);
12425 basic_stringbuf_char_str_set(&this->strbuf, str);
12428 /* ?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 */
12429 /* ?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 */
12430 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
12431 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
12433 TRACE("(%p %p)\n", this, ret);
12434 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12437 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
12439 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
12442 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12444 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
12447 /* ??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 */
12448 /* ??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 */
12449 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
12450 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
12451 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12453 basic_ios_wchar *basic_ios;
12455 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12457 if(virt_init) {
12458 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12459 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12460 basic_ios_wchar_ctor(basic_ios);
12461 }else {
12462 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12465 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12466 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12467 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12468 return this;
12471 /* ??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 */
12472 /* ??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 */
12473 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
12474 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
12475 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12477 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
12478 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12479 return this;
12482 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12483 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12484 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
12485 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
12486 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
12488 basic_ios_wchar *basic_ios;
12490 TRACE("(%p %d %d)\n", this, mode, virt_init);
12492 if(virt_init) {
12493 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12494 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12495 basic_ios_wchar_ctor(basic_ios);
12496 }else {
12497 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12500 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12501 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12502 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12503 return this;
12506 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12507 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12508 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
12509 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
12510 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
12512 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
12513 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12514 return this;
12517 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12518 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12519 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
12520 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
12521 basic_ostringstream_wchar *this)
12523 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
12526 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12527 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12528 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
12529 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
12530 basic_ostringstream_wchar *this)
12532 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
12535 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12536 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12537 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12538 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12539 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
12540 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
12542 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12544 TRACE("(%p)\n", this);
12546 basic_stringbuf_wchar_dtor(&this->strbuf);
12547 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
12550 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12551 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12552 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12553 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12554 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
12555 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
12557 TRACE("(%p)\n", this);
12559 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
12560 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
12563 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
12564 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12566 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12568 TRACE("(%p %x)\n", this, flags);
12570 if(flags & 2) {
12571 /* we have an array, with the number of elements stored before the first object */
12572 INT_PTR i, *ptr = (INT_PTR *)this-1;
12574 for(i=*ptr-1; i>=0; i--)
12575 basic_ostringstream_wchar_vbase_dtor(this+i);
12576 MSVCRT_operator_delete(ptr);
12577 } else {
12578 basic_ostringstream_wchar_vbase_dtor(this);
12579 if(flags & 1)
12580 MSVCRT_operator_delete(this);
12583 return this;
12586 /* ?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 */
12587 /* ?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 */
12588 /* ?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 */
12589 /* ?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 */
12590 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
12591 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
12593 TRACE("(%p)\n", this);
12594 return (basic_stringbuf_wchar*)&this->strbuf;
12597 /* ?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 */
12598 /* ?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 */
12599 /* ?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 */
12600 /* ?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 */
12601 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
12602 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
12604 TRACE("(%p %p)\n", this, str);
12605 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12608 /* ?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 */
12609 /* ?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 */
12610 /* ?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 */
12611 /* ?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 */
12612 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
12613 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
12615 TRACE("(%p %p)\n", this, ret);
12616 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12619 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
12621 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
12624 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
12626 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
12629 /* ??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 */
12630 /* ??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 */
12631 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
12632 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
12633 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12635 basic_ios_char *basic_ios;
12637 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12639 if(virt_init) {
12640 this->base.vbtable = basic_istringstream_char_vbtable;
12641 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12642 basic_ios_char_ctor(basic_ios);
12643 }else {
12644 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12647 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12648 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12649 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12650 return this;
12653 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12654 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12655 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
12656 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
12657 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
12659 basic_ios_char *basic_ios;
12661 TRACE("(%p %d %d)\n", this, mode, virt_init);
12663 if(virt_init) {
12664 this->base.vbtable = basic_istringstream_char_vbtable;
12665 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12666 basic_ios_char_ctor(basic_ios);
12667 }else {
12668 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12671 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12672 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12673 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12674 return this;
12677 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12678 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12679 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
12680 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
12681 basic_istringstream_char *this)
12683 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
12686 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12687 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12688 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
12689 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
12691 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12693 TRACE("(%p)\n", this);
12695 basic_stringbuf_char_dtor(&this->strbuf);
12696 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
12699 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12700 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12701 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
12702 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
12704 TRACE("(%p)\n", this);
12706 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
12707 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
12710 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
12711 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12713 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12715 TRACE("(%p %x)\n", this, flags);
12717 if(flags & 2) {
12718 /* we have an array, with the number of elements stored before the first object */
12719 INT_PTR i, *ptr = (INT_PTR *)this-1;
12721 for(i=*ptr-1; i>=0; i--)
12722 basic_istringstream_char_vbase_dtor(this+i);
12723 MSVCRT_operator_delete(ptr);
12724 } else {
12725 basic_istringstream_char_vbase_dtor(this);
12726 if(flags & 1)
12727 MSVCRT_operator_delete(this);
12730 return this;
12733 /* ?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 */
12734 /* ?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 */
12735 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
12736 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
12738 TRACE("(%p)\n", this);
12739 return (basic_stringbuf_char*)&this->strbuf;
12742 /* ?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 */
12743 /* ?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 */
12744 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
12745 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
12747 TRACE("(%p %p)\n", this, str);
12748 basic_stringbuf_char_str_set(&this->strbuf, str);
12751 /* ?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 */
12752 /* ?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 */
12753 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
12754 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
12756 TRACE("(%p %p)\n", this, ret);
12757 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12760 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
12762 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
12765 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12767 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
12770 /* ??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 */
12771 /* ??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 */
12772 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
12773 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
12774 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12776 basic_ios_wchar *basic_ios;
12778 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12780 if(virt_init) {
12781 this->base.vbtable = basic_istringstream_wchar_vbtable;
12782 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12783 basic_ios_wchar_ctor(basic_ios);
12784 }else {
12785 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12788 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12789 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12790 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12791 return this;
12794 /* ??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 */
12795 /* ??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 */
12796 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
12797 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
12798 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12800 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
12801 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12802 return this;
12805 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12806 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12807 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
12808 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
12809 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12811 basic_ios_wchar *basic_ios;
12813 TRACE("(%p %d %d)\n", this, mode, virt_init);
12815 if(virt_init) {
12816 this->base.vbtable = basic_istringstream_wchar_vbtable;
12817 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12818 basic_ios_wchar_ctor(basic_ios);
12819 }else {
12820 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12823 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12824 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12825 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12826 return this;
12829 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12830 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12831 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
12832 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
12833 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12835 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
12836 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12837 return this;
12840 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12841 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12842 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
12843 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
12844 basic_istringstream_wchar *this)
12846 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
12849 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12850 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12851 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
12852 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
12853 basic_istringstream_wchar *this)
12855 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
12858 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12859 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12860 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12861 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12862 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
12863 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
12865 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12867 TRACE("(%p)\n", this);
12869 basic_stringbuf_wchar_dtor(&this->strbuf);
12870 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12873 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12874 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12875 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12876 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12877 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
12878 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
12880 TRACE("(%p)\n", this);
12882 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
12883 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
12886 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
12887 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12889 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12891 TRACE("(%p %x)\n", this, flags);
12893 if(flags & 2) {
12894 /* we have an array, with the number of elements stored before the first object */
12895 INT_PTR i, *ptr = (INT_PTR *)this-1;
12897 for(i=*ptr-1; i>=0; i--)
12898 basic_istringstream_wchar_vbase_dtor(this+i);
12899 MSVCRT_operator_delete(ptr);
12900 } else {
12901 basic_istringstream_wchar_vbase_dtor(this);
12902 if(flags & 1)
12903 MSVCRT_operator_delete(this);
12906 return this;
12909 /* ?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 */
12910 /* ?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 */
12911 /* ?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 */
12912 /* ?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 */
12913 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
12914 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
12916 TRACE("(%p)\n", this);
12917 return (basic_stringbuf_wchar*)&this->strbuf;
12920 /* ?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 */
12921 /* ?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 */
12922 /* ?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 */
12923 /* ?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 */
12924 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
12925 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
12927 TRACE("(%p %p)\n", this, str);
12928 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12931 /* ?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 */
12932 /* ?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 */
12933 /* ?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 */
12934 /* ?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 */
12935 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
12936 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
12938 TRACE("(%p %p)\n", this, ret);
12939 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12942 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
12944 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
12947 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
12949 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
12952 /* ??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 */
12953 /* ??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 */
12954 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
12955 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
12956 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12958 basic_ios_char *basic_ios;
12960 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12962 if(virt_init) {
12963 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12964 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12965 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12966 basic_ios_char_ctor(basic_ios);
12967 }else {
12968 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12971 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
12972 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12973 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12974 return this;
12977 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12978 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12979 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
12980 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
12981 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
12983 basic_ios_char *basic_ios;
12985 TRACE("(%p %d %d)\n", this, mode, virt_init);
12987 if(virt_init) {
12988 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12989 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12990 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12991 basic_ios_char_ctor(basic_ios);
12992 }else {
12993 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12996 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
12997 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12998 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12999 return this;
13002 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13003 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13004 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
13005 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
13006 basic_stringstream_char *this)
13008 return basic_stringstream_char_ctor_mode(
13009 this, OPENMODE_out|OPENMODE_in, TRUE);
13012 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13013 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13014 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
13015 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
13017 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13019 TRACE("(%p)\n", this);
13021 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13022 basic_stringbuf_char_dtor(&this->strbuf);
13025 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13026 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13027 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
13028 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
13030 TRACE("(%p)\n", this);
13032 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
13033 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
13036 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
13037 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13039 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13041 TRACE("(%p %x)\n", this, flags);
13043 if(flags & 2) {
13044 /* we have an array, with the number of elements stored before the first object */
13045 INT_PTR i, *ptr = (INT_PTR *)this-1;
13047 for(i=*ptr-1; i>=0; i--)
13048 basic_stringstream_char_vbase_dtor(this+i);
13049 MSVCRT_operator_delete(ptr);
13050 } else {
13051 basic_stringstream_char_vbase_dtor(this);
13052 if(flags & 1)
13053 MSVCRT_operator_delete(this);
13056 return this;
13059 /* ?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 */
13060 /* ?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 */
13061 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
13062 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
13064 TRACE("(%p)\n", this);
13065 return (basic_stringbuf_char*)&this->strbuf;
13068 /* ?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 */
13069 /* ?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 */
13070 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
13071 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
13073 TRACE("(%p %p)\n", this, str);
13074 basic_stringbuf_char_str_set(&this->strbuf, str);
13077 /* ?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 */
13078 /* ?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 */
13079 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
13080 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
13082 TRACE("(%p %p)\n", this, ret);
13083 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13086 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
13088 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
13091 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13093 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
13096 /* ??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 */
13097 /* ??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 */
13098 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
13099 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
13100 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13102 basic_ios_wchar *basic_ios;
13104 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13106 if(virt_init) {
13107 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13108 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13109 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13110 basic_ios_wchar_ctor(basic_ios);
13111 }else {
13112 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13115 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
13116 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13117 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13118 return this;
13121 /* ??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 */
13122 /* ??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 */
13123 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
13124 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
13125 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13127 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
13128 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13129 return this;
13132 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13133 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13134 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
13135 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
13136 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13138 basic_ios_wchar *basic_ios;
13140 TRACE("(%p %d %d)\n", this, mode, virt_init);
13142 if(virt_init) {
13143 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13144 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13145 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13146 basic_ios_wchar_ctor(basic_ios);
13147 }else {
13148 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13151 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
13152 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13153 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13154 return this;
13157 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13158 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13159 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
13160 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
13161 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13163 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
13164 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13165 return this;
13168 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13169 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13170 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
13171 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
13172 basic_stringstream_wchar *this)
13174 return basic_stringstream_wchar_ctor_mode(
13175 this, OPENMODE_out|OPENMODE_in, TRUE);
13178 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13179 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13180 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
13181 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
13182 basic_stringstream_wchar *this)
13184 return basic_stringstream_short_ctor_mode(
13185 this, OPENMODE_out|OPENMODE_in, TRUE);
13188 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13189 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13190 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13191 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13192 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
13193 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
13195 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13197 TRACE("(%p)\n", this);
13199 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
13200 basic_stringbuf_wchar_dtor(&this->strbuf);
13203 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13204 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13205 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13206 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13207 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
13208 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
13210 TRACE("(%p)\n", this);
13212 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
13213 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
13216 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
13217 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13219 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13221 TRACE("(%p %x)\n", this, flags);
13223 if(flags & 2) {
13224 /* we have an array, with the number of elements stored before the first object */
13225 INT_PTR i, *ptr = (INT_PTR *)this-1;
13227 for(i=*ptr-1; i>=0; i--)
13228 basic_stringstream_wchar_vbase_dtor(this+i);
13229 MSVCRT_operator_delete(ptr);
13230 } else {
13231 basic_stringstream_wchar_vbase_dtor(this);
13232 if(flags & 1)
13233 MSVCRT_operator_delete(this);
13236 return this;
13239 /* ?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 */
13240 /* ?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 */
13241 /* ?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 */
13242 /* ?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 */
13243 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
13244 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
13246 TRACE("(%p)\n", this);
13247 return (basic_stringbuf_wchar*)&this->strbuf;
13250 /* ?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 */
13251 /* ?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 */
13252 /* ?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 */
13253 /* ?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 */
13254 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
13255 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
13257 TRACE("(%p %p)\n", this, str);
13258 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13261 /* ?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 */
13262 /* ?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 */
13263 /* ?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 */
13264 /* ?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 */
13265 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
13266 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
13268 TRACE("(%p %p)\n", this, ret);
13269 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13272 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
13273 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
13274 #if STREAMSIZE_BITS == 64
13275 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
13276 #else
13277 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
13278 #endif
13279 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
13281 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
13283 this->minsize = 32;
13284 this->endsave = NULL;
13285 this->strmode = mode;
13286 this->palloc = NULL;
13287 this->pfree = NULL;
13289 if(!g) {
13290 this->strmode |= STRSTATE_Dynamic;
13291 if(len > this->minsize)
13292 this->minsize = len;
13293 this->seekhigh = NULL;
13294 return;
13297 if(len < 0)
13298 len = INT_MAX;
13299 else if(!len)
13300 len = strlen(g);
13302 this->seekhigh = g+len;
13303 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
13304 if(p)
13305 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
13308 /* ??0strstreambuf@std@@QAE@PACH0@Z */
13309 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
13310 /* ??0strstreambuf@std@@QAE@PADH0@Z */
13311 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
13312 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
13313 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
13314 #if STREAMSIZE_BITS == 64
13315 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
13316 #else
13317 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
13318 #endif
13319 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
13321 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
13323 basic_streambuf_char_ctor(&this->base);
13324 this->base.vtable = &MSVCP_strstreambuf_vtable;
13326 strstreambuf__Init(this, len, g, p, 0);
13327 return this;
13330 /* ??0strstreambuf@std@@QAE@H@Z */
13331 /* ??0strstreambuf@std@@QEAA@_J@Z */
13332 #if STREAMSIZE_BITS == 64
13333 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 12)
13334 #else
13335 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
13336 #endif
13337 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
13339 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
13342 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
13343 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
13344 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
13345 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(MSVCP_size_t), void (__cdecl *pfree)(void*))
13347 TRACE("(%p %p %p)\n", this, palloc, pfree);
13349 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13350 this->palloc = palloc;
13351 this->pfree = pfree;
13352 return this;
13355 /* ??0strstreambuf@std@@QAE@PBCH@Z */
13356 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
13357 /* ??0strstreambuf@std@@QAE@PBDH@Z */
13358 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
13359 /* ??0strstreambuf@std@@QAE@PBEH@Z */
13360 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
13361 #if STREAMSIZE_BITS == 64
13362 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 16)
13363 #else
13364 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
13365 #endif
13366 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
13368 TRACE("(%p %p %s)\n", this, g, wine_dbgstr_longlong(len));
13370 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
13371 this->strmode |= STRSTATE_Constant;
13372 return this;
13375 /* ??_Fstrstreambuf@std@@QAEXXZ */
13376 /* ??_Fstrstreambuf@std@@QEAAXXZ */
13377 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
13378 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
13380 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13383 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
13384 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
13385 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
13386 void __thiscall strstreambuf__Tidy(strstreambuf *this)
13388 TRACE("(%p)\n", this);
13390 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
13391 if(this->pfree)
13392 this->pfree(basic_streambuf_char_eback(&this->base));
13393 else
13394 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
13397 this->endsave = NULL;
13398 this->seekhigh = NULL;
13399 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
13400 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
13401 basic_streambuf_char_setp(&this->base, NULL, NULL);
13404 /* ??1strstreambuf@std@@UAE@XZ */
13405 /* ??1strstreambuf@std@@UEAA@XZ */
13406 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
13407 void __thiscall strstreambuf_dtor(strstreambuf *this)
13409 TRACE("(%p)\n", this);
13411 strstreambuf__Tidy(this);
13412 basic_streambuf_char_dtor(&this->base);
13415 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
13416 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
13418 TRACE("(%p %x)\n", this, flags);
13419 if(flags & 2) {
13420 /* we have an array, with the number of elements stored before the first object */
13421 INT_PTR i, *ptr = (INT_PTR *)this-1;
13423 for(i=*ptr-1; i>=0; i--)
13424 strstreambuf_dtor(this+i);
13425 MSVCRT_operator_delete(ptr);
13426 } else {
13427 strstreambuf_dtor(this);
13428 if(flags & 1)
13429 MSVCRT_operator_delete(this);
13432 return this;
13435 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
13436 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
13437 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
13438 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
13440 TRACE("(%p %d)\n", this, freeze);
13442 if(!freeze == !(this->strmode & STRSTATE_Frozen))
13443 return;
13445 if(freeze) {
13446 this->strmode |= STRSTATE_Frozen;
13447 this->endsave = basic_streambuf_char_epptr(&this->base);
13448 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13449 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
13450 }else {
13451 this->strmode &= ~STRSTATE_Frozen;
13452 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13453 basic_streambuf_char_pptr(&this->base), this->endsave);
13457 /* ?str@strstreambuf@std@@QAEPADXZ */
13458 /* ?str@strstreambuf@std@@QEAAPEADXZ */
13459 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
13460 char* __thiscall strstreambuf_str(strstreambuf *this)
13462 TRACE("(%p)\n", this);
13464 strstreambuf_freeze(this, TRUE);
13465 return basic_streambuf_char_gptr(&this->base);
13468 /* ?pcount@strstreambuf@std@@QBEHXZ */
13469 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
13470 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
13471 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
13473 char *ppos = basic_streambuf_char_pptr(&this->base);
13475 TRACE("(%p)\n", this);
13477 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
13480 /* ?overflow@strstreambuf@std@@MAEHH@Z */
13481 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
13482 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
13483 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
13485 MSVCP_size_t old_size, size;
13486 char *ptr, *buf;
13488 TRACE("(%p %d)\n", this, c);
13490 if(c == EOF)
13491 return !EOF;
13493 if(this->strmode & STRSTATE_Frozen)
13494 return EOF;
13496 ptr = basic_streambuf_char_pptr(&this->base);
13497 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
13498 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13500 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
13501 return EOF;
13503 ptr = basic_streambuf_char_eback(&this->base);
13504 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
13506 size = old_size + old_size/2;
13507 if(size < this->minsize)
13508 size = this->minsize;
13510 if(this->palloc)
13511 buf = this->palloc(size);
13512 else
13513 buf = MSVCRT_operator_new(size);
13514 if(!buf)
13515 return EOF;
13517 memcpy(buf, ptr, old_size);
13518 if(this->strmode & STRSTATE_Allocated) {
13519 if(this->pfree)
13520 this->pfree(ptr);
13521 else
13522 MSVCRT_operator_delete(ptr);
13525 this->strmode |= STRSTATE_Allocated;
13526 if(!old_size) {
13527 this->seekhigh = buf;
13528 basic_streambuf_char_setp(&this->base, buf, buf+size);
13529 basic_streambuf_char_setg(&this->base, buf, buf, buf);
13530 }else {
13531 this->seekhigh = this->seekhigh-ptr+buf;
13532 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
13533 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
13534 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
13535 basic_streambuf_char_pptr(&this->base));
13538 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13541 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
13542 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
13543 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
13544 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
13546 char *ptr = basic_streambuf_char_gptr(&this->base);
13548 TRACE("(%p %d)\n", this, c);
13550 if(ptr<=basic_streambuf_char_eback(&this->base)
13551 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
13552 return EOF;
13554 basic_streambuf_char_gbump(&this->base, -1);
13555 if(c == EOF)
13556 return !EOF;
13557 if(this->strmode & STRSTATE_Constant)
13558 return (unsigned char)c;
13560 return (unsigned char)(ptr[0] = c);
13563 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
13564 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
13565 #if STREAMOFF_BITS == 64
13566 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
13567 #else
13568 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
13569 #endif
13570 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
13572 char *eback = basic_streambuf_char_eback(&this->base);
13573 char *pptr = basic_streambuf_char_pptr(&this->base);
13574 char *gptr = basic_streambuf_char_gptr(&this->base);
13576 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
13578 ret->off = 0;
13579 ret->state = 0;
13581 if(pptr > this->seekhigh)
13582 this->seekhigh = pptr;
13584 if((mode & OPENMODE_in) && gptr) {
13585 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
13586 off += gptr-eback;
13587 else if(way == SEEKDIR_end)
13588 off += this->seekhigh-eback;
13589 else if(way != SEEKDIR_beg)
13590 off = -1;
13592 if(off<0 || off>this->seekhigh-eback) {
13593 off = -1;
13594 }else {
13595 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
13596 if((mode & OPENMODE_out) && pptr) {
13597 basic_streambuf_char_setp_next(&this->base, eback,
13598 gptr, basic_streambuf_char_epptr(&this->base));
13601 }else if((mode & OPENMODE_out) && pptr) {
13602 if(way == SEEKDIR_cur)
13603 off += pptr-eback;
13604 else if(way == SEEKDIR_end)
13605 off += this->seekhigh-eback;
13606 else if(way != SEEKDIR_beg)
13607 off = -1;
13609 if(off<0 || off>this->seekhigh-eback)
13610 off = -1;
13611 else
13612 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
13613 }else {
13614 off = -1;
13617 ret->pos = off;
13618 return ret;
13621 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
13622 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
13623 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
13624 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
13626 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
13628 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
13629 *ret = pos;
13630 return ret;
13633 return strstreambuf_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
13636 /* ?underflow@strstreambuf@std@@MAEHXZ */
13637 /* ?underflow@strstreambuf@std@@MEAAHXZ */
13638 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
13639 int __thiscall strstreambuf_underflow(strstreambuf *this)
13641 char *gptr = basic_streambuf_char_gptr(&this->base);
13642 char *pptr;
13644 TRACE("(%p)\n", this);
13646 if(!gptr)
13647 return EOF;
13649 if(gptr < basic_streambuf_char_egptr(&this->base))
13650 return (unsigned char)(*gptr);
13652 pptr = basic_streambuf_char_gptr(&this->base);
13653 if(pptr > this->seekhigh)
13654 this->seekhigh = pptr;
13656 if(this->seekhigh <= gptr)
13657 return EOF;
13659 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
13660 gptr, this->seekhigh);
13661 return (unsigned char)(*gptr);
13664 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
13666 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
13669 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
13671 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
13674 /* ??0ostrstream@std@@QAE@PADHH@Z */
13675 #if STREAMSIZE_BITS == 64
13676 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
13677 #else
13678 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
13679 #endif
13680 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
13682 basic_ios_char *basic_ios;
13684 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13686 if(virt_init) {
13687 this->base.vbtable = ostrstream_vbtable;
13688 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13689 basic_ios_char_ctor(basic_ios);
13690 }else {
13691 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13694 strstreambuf_ctor_get_put(&this->buf, buf, size,
13695 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13696 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, FALSE);
13697 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
13698 return this;
13701 /* ??1ostrstream@std@@UAE@XZ */
13702 /* ??1ostrstream@std@@UEAA@XZ */
13703 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
13704 void __thiscall ostrstream_dtor(basic_ios_char *base)
13706 ostrstream *this = ostrstream_from_basic_ios(base);
13708 TRACE("(%p)\n", this);
13710 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
13711 strstreambuf_dtor(&this->buf);
13714 static void ostrstream_vbase_dtor(ostrstream *this)
13716 TRACE("(%p)\n", this);
13718 ostrstream_dtor(ostrstream_to_basic_ios(this));
13719 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
13722 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
13723 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13725 ostrstream *this = ostrstream_from_basic_ios(base);
13727 TRACE("(%p %x)\n", this, flags);
13729 if(flags & 2) {
13730 /* we have an array, with the number of elements stored before the first object */
13731 INT_PTR i, *ptr = (INT_PTR *)this-1;
13733 for(i=*ptr-1; i>=0; i--)
13734 ostrstream_vbase_dtor(this+i);
13735 MSVCRT_operator_delete(ptr);
13736 } else {
13737 ostrstream_vbase_dtor(this);
13738 if(flags & 1)
13739 MSVCRT_operator_delete(this);
13742 return this;
13745 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
13747 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
13750 /* ??1istrstream@std@@UAE@XZ */
13751 /* ??1istrstream@std@@UEAA@XZ */
13752 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
13753 void __thiscall istrstream_dtor(basic_ios_char *base)
13755 istrstream *this = istrstream_from_basic_ios(base);
13757 TRACE("(%p)\n", this);
13759 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
13760 strstreambuf_dtor(&this->buf);
13763 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
13765 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
13768 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
13770 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
13773 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@M@0@@Z */
13774 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@M@0@@Z */
13775 basic_ostream_char* __cdecl basic_ostream_char_print_complex_float(basic_ostream_char *ostr, const complex_float *val)
13777 struct {
13778 basic_ostringstream_char obj;
13779 basic_ios_char vbase;
13780 } oss;
13781 ios_base *ostringstream_ios_base, *ostream_ios_base;
13782 locale loc;
13783 basic_string_char str;
13784 basic_ostringstream_char_ctor(&oss.obj);
13785 ostringstream_ios_base = &oss.vbase.base;
13786 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13787 TRACE("(%p %p)\n", ostr, val);
13789 ios_base_imbue(ostringstream_ios_base, &loc, ostream_ios_base->loc);
13790 locale_dtor(&loc);
13791 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13792 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13794 basic_ostream_char_print_ch(&oss.obj.base, '(');
13795 basic_ostream_char_print_float(&oss.obj.base, val->real);
13796 basic_ostream_char_print_ch(&oss.obj.base, ',');
13797 basic_ostream_char_print_float(&oss.obj.base, val->imag);
13798 basic_ostream_char_print_ch(&oss.obj.base, ')');
13800 basic_ostringstream_char_str_get(&oss.obj, &str);
13801 basic_ostringstream_char_dtor(&oss.vbase);
13802 basic_ostream_char_print_bstr(ostr, &str);
13803 MSVCP_basic_string_char_dtor(&str);
13804 return ostr;
13807 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@N@0@@Z */
13808 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@N@0@@Z */
13809 basic_ostream_char* __cdecl basic_ostream_char_print_complex_double(basic_ostream_char *ostr, const complex_double *val)
13811 struct {
13812 basic_ostringstream_char obj;
13813 basic_ios_char vbase;
13814 } oss;
13815 ios_base *ostringstream_ios_base, *ostream_ios_base;
13816 locale loc;
13817 basic_string_char str;
13818 basic_ostringstream_char_ctor(&oss.obj);
13819 ostringstream_ios_base = &oss.vbase.base;
13820 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13821 TRACE("(%p %p)\n", ostr, val);
13823 ios_base_imbue(ostringstream_ios_base, &loc, ostream_ios_base->loc);
13824 locale_dtor(&loc);
13825 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13826 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13828 basic_ostream_char_print_ch(&oss.obj.base, '(');
13829 basic_ostream_char_print_double(&oss.obj.base, val->real);
13830 basic_ostream_char_print_ch(&oss.obj.base, ',');
13831 basic_ostream_char_print_double(&oss.obj.base, val->imag);
13832 basic_ostream_char_print_ch(&oss.obj.base, ')');
13834 basic_ostringstream_char_str_get(&oss.obj, &str);
13835 basic_ostringstream_char_dtor(&oss.vbase);
13836 basic_ostream_char_print_bstr(ostr, &str);
13837 MSVCP_basic_string_char_dtor(&str);
13838 return ostr;
13841 /* ??$?6odu?$char_traits@d@std@@@std@@yaaav?$basic_ostream@du?$char_traits@d@std@@@0@aav10@abv?$complex@o@0@@Z */
13842 /* ??$?6ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@O@0@@Z */
13843 basic_ostream_char* __cdecl basic_ostream_char_print_complex_ldouble(basic_ostream_char *ostr, const complex_double *val)
13845 struct {
13846 basic_ostringstream_char obj;
13847 basic_ios_char vbase;
13848 } oss;
13849 ios_base *ostringstream_ios_base, *ostream_ios_base;
13850 locale loc;
13851 basic_string_char str;
13852 basic_ostringstream_char_ctor(&oss.obj);
13853 ostringstream_ios_base = &oss.vbase.base;
13854 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13855 TRACE("(%p %p)\n", ostr, val);
13857 ios_base_imbue(ostringstream_ios_base, &loc, ostream_ios_base->loc);
13858 locale_dtor(&loc);
13859 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13860 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13862 basic_ostream_char_print_ch(&oss.obj.base, '(');
13863 basic_ostream_char_print_ldouble(&oss.obj.base, val->real);
13864 basic_ostream_char_print_ch(&oss.obj.base, ',');
13865 basic_ostream_char_print_ldouble(&oss.obj.base, val->imag);
13866 basic_ostream_char_print_ch(&oss.obj.base, ')');
13868 basic_ostringstream_char_str_get(&oss.obj, &str);
13869 basic_ostringstream_char_dtor(&oss.vbase);
13870 basic_ostream_char_print_bstr(ostr, &str);
13871 MSVCP_basic_string_char_dtor(&str);
13872 return ostr;
13875 /* ??0strstream@std@@QAE@PADHH@Z */
13876 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
13877 #if STREAMSIZE_BITS == 64
13878 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
13879 #else
13880 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
13881 #endif
13882 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
13884 basic_ios_char *basic_ios;
13886 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13888 if(virt_init) {
13889 this->base.base1.vbtable = strstream_vbtable1;
13890 this->base.base2.vbtable = strstream_vbtable2;
13891 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13892 basic_ios_char_ctor(basic_ios);
13893 }else {
13894 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13897 strstreambuf_ctor_get_put(&this->buf, buf, size,
13898 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13899 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
13900 basic_ios->base.vtable = &MSVCP_strstream_vtable;
13901 return this;
13904 /* ??1strstream@std@@UAE@XZ */
13905 /* ??1strstream@std@@UEAA@XZ */
13906 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
13907 void __thiscall strstream_dtor(basic_ios_char *base)
13909 strstream *this = strstream_from_basic_ios(base);
13911 TRACE("(%p)\n", this);
13913 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13914 strstreambuf_dtor(&this->buf);
13917 static void strstream_vbase_dtor(strstream *this)
13919 TRACE("(%p)\n", this);
13921 strstream_dtor(strstream_to_basic_ios(this));
13922 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
13925 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
13926 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13928 strstream *this = strstream_from_basic_ios(base);
13930 TRACE("(%p %x)\n", this, flags);
13932 if(flags & 2) {
13933 /* we have an array, with the number of elements stored before the first object */
13934 INT_PTR i, *ptr = (INT_PTR *)this-1;
13936 for(i=*ptr-1; i>=0; i--)
13937 strstream_vbase_dtor(this+i);
13938 MSVCRT_operator_delete(ptr);
13939 } else {
13940 strstream_vbase_dtor(this);
13941 if(flags & 1)
13942 MSVCRT_operator_delete(this);
13945 return this;
13948 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
13950 ios_base_precision_set(base, prec);
13953 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
13954 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13955 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
13957 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
13959 ret->pfunc = setprecision_func;
13960 ret->arg = prec;
13961 return ret;
13964 static void __cdecl setw_func(ios_base *base, streamsize width)
13966 ios_base_width_set(base, width);
13969 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
13970 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13971 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
13973 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
13975 ret->pfunc = setw_func;
13976 ret->arg = width;
13977 return ret;
13980 static void __cdecl resetioflags_func(ios_base *base, int mask)
13982 ios_base_setf_mask(base, 0, mask);
13985 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
13986 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
13988 TRACE("(%p %d)\n", ret, mask);
13990 ret->pfunc = resetioflags_func;
13991 ret->arg = mask;
13992 return ret;
13995 static void __cdecl setiosflags_func(ios_base *base, int mask)
13997 ios_base_setf_mask(base, FMTFLAG_mask, mask);
14000 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
14001 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
14003 TRACE("(%p %d)\n", ret, mask);
14005 ret->pfunc = setiosflags_func;
14006 ret->arg = mask;
14007 return ret;
14010 static void __cdecl setbase_func(ios_base *base, int set_base)
14012 if(set_base == 10)
14013 set_base = FMTFLAG_dec;
14014 else if(set_base == 8)
14015 set_base = FMTFLAG_oct;
14016 else if(set_base == 16)
14017 set_base = FMTFLAG_hex;
14018 else
14019 set_base = 0;
14021 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
14024 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
14025 manip_int* __cdecl setbase(manip_int *ret, int base)
14027 TRACE("(%p %d)\n", ret, base);
14029 ret->pfunc = setbase_func;
14030 ret->arg = base;
14031 return ret;
14034 static basic_filebuf_char filebuf_char_stdin;
14035 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
14036 struct {
14037 basic_istream_char obj;
14038 basic_ios_char vbase;
14039 } cin = { { 0 } };
14040 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
14041 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
14042 basic_istream_char *_Ptr_cin = &cin.obj;
14044 static basic_filebuf_wchar filebuf_short_stdin;
14045 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
14046 struct {
14047 basic_istream_wchar obj;
14048 basic_ios_wchar vbase;
14049 } ucin = { { 0 } };
14050 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
14051 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
14052 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
14054 static basic_filebuf_wchar filebuf_wchar_stdin;
14055 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
14056 struct {
14057 basic_istream_wchar obj;
14058 basic_ios_wchar vbase;
14059 } wcin = { { 0 } };
14060 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
14061 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
14062 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
14064 static basic_filebuf_char filebuf_char_stdout;
14065 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14066 struct {
14067 basic_ostream_char obj;
14068 basic_ios_char vbase;
14069 } cout = { { 0 } };
14070 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14071 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
14072 basic_ostream_char *_Ptr_cout = &cout.obj;
14074 static basic_filebuf_wchar filebuf_short_stdout;
14075 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14076 struct {
14077 basic_ostream_wchar obj;
14078 basic_ios_wchar vbase;
14079 } ucout = { { 0 } };
14080 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14081 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
14082 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
14084 static basic_filebuf_wchar filebuf_wchar_stdout;
14085 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
14086 struct {
14087 basic_ostream_wchar obj;
14088 basic_ios_wchar vbase;
14089 } wcout = { { 0 } };
14090 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
14091 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
14092 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
14094 static basic_filebuf_char filebuf_char_stderr;
14095 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14096 struct {
14097 basic_ostream_char obj;
14098 basic_ios_char vbase;
14099 } cerr = { { 0 } };
14100 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14101 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
14102 basic_ostream_char *_Ptr_cerr = &cerr.obj;
14104 static basic_filebuf_wchar filebuf_short_stderr;
14105 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14106 struct {
14107 basic_ostream_wchar obj;
14108 basic_ios_wchar vbase;
14109 } ucerr = { { 0 } };
14110 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14111 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
14112 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
14114 static basic_filebuf_wchar filebuf_wchar_stderr;
14115 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
14116 struct {
14117 basic_ostream_wchar obj;
14118 basic_ios_wchar vbase;
14119 } wcerr = { { 0 } };
14120 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
14121 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
14122 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
14124 static basic_filebuf_char filebuf_char_log;
14125 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14126 struct {
14127 basic_ostream_char obj;
14128 basic_ios_char vbase;
14129 } clog = { { 0 } };
14130 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14131 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
14132 basic_ostream_char *_Ptr_clog = &clog.obj;
14134 static basic_filebuf_wchar filebuf_short_log;
14135 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14136 struct {
14137 basic_ostream_wchar obj;
14138 basic_ios_wchar vbase;
14139 } uclog = { { 0 } };
14140 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14141 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
14142 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
14144 static basic_filebuf_wchar filebuf_wchar_log;
14145 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
14146 struct {
14147 basic_ostream_wchar obj;
14148 basic_ios_wchar vbase;
14149 } wclog = { { 0 } };
14150 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
14151 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
14152 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
14154 /* ?_Init_cnt@Init@ios_base@std@@0HA */
14155 int ios_base_Init__Init_cnt = -1;
14157 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
14158 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
14159 int* __cdecl ios_base_Init__Init_cnt_func(void)
14161 return &ios_base_Init__Init_cnt;
14164 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
14165 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
14166 void __cdecl ios_base_Init__Init_ctor(void *this)
14168 TRACE("(%p)\n", this);
14170 if(ios_base_Init__Init_cnt < 0)
14171 ios_base_Init__Init_cnt = 1;
14172 else
14173 ios_base_Init__Init_cnt++;
14176 /* ??0Init@ios_base@std@@QAE@XZ */
14177 /* ??0Init@ios_base@std@@QEAA@XZ */
14178 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
14179 void* __thiscall ios_base_Init_ctor(void *this)
14181 ios_base_Init__Init_ctor(this);
14182 return this;
14185 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
14186 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
14187 void __cdecl ios_base_Init__Init_dtor(void *this)
14189 TRACE("(%p)\n", this);
14191 ios_base_Init__Init_cnt--;
14192 if(!ios_base_Init__Init_cnt) {
14193 basic_ostream_char_flush(&cout.obj);
14194 basic_ostream_char_flush(&cerr.obj);
14195 basic_ostream_char_flush(&clog.obj);
14199 /* ??1Init@ios_base@std@@QAE@XZ */
14200 /* ??1Init@ios_base@std@@QEAA@XZ */
14201 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
14202 void __thiscall ios_base_Init_dtor(void *this)
14204 ios_base_Init__Init_dtor(this);
14207 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
14208 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
14209 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
14210 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
14212 TRACE("(%p %p)\n", this, rhs);
14213 return this;
14216 /* ?_Init_cnt@_Winit@std@@0HA */
14217 int _Winit__Init_cnt = -1;
14219 /* ??0_Winit@std@@QAE@XZ */
14220 /* ??0_Winit@std@@QEAA@XZ */
14221 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
14222 void* __thiscall _Winit_ctor(void *this)
14224 TRACE("(%p)\n", this);
14226 if(_Winit__Init_cnt < 0)
14227 _Winit__Init_cnt = 1;
14228 else
14229 _Winit__Init_cnt++;
14231 return this;
14234 /* ??1_Winit@std@@QAE@XZ */
14235 /* ??1_Winit@std@@QAE@XZ */
14236 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
14237 void __thiscall _Winit_dtor(void *this)
14239 TRACE("(%p)\n", this);
14241 _Winit__Init_cnt--;
14242 if(!_Winit__Init_cnt) {
14243 basic_ostream_wchar_flush(&wcout.obj);
14244 basic_ostream_wchar_flush(&wcerr.obj);
14245 basic_ostream_wchar_flush(&wclog.obj);
14249 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
14250 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
14251 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
14252 void* __thiscall _Winit_op_assign(void *this, void *rhs)
14254 TRACE("(%p %p)\n", this, rhs);
14255 return this;
14258 void init_io(void *base)
14260 #ifdef __x86_64__
14261 init_iosb_rtti(base);
14262 init_ios_base_rtti(base);
14263 init_basic_ios_char_rtti(base);
14264 init_basic_ios_wchar_rtti(base);
14265 init_basic_ios_short_rtti(base);
14266 init_basic_streambuf_char_rtti(base);
14267 init_basic_streambuf_wchar_rtti(base);
14268 init_basic_streambuf_short_rtti(base);
14269 init_basic_filebuf_char_rtti(base);
14270 init_basic_filebuf_wchar_rtti(base);
14271 init_basic_filebuf_short_rtti(base);
14272 init_basic_stringbuf_char_rtti(base);
14273 init_basic_stringbuf_wchar_rtti(base);
14274 init_basic_stringbuf_short_rtti(base);
14275 init_basic_ostream_char_rtti(base);
14276 init_basic_ostream_wchar_rtti(base);
14277 init_basic_ostream_short_rtti(base);
14278 init_basic_istream_char_rtti(base);
14279 init_basic_istream_wchar_rtti(base);
14280 init_basic_istream_short_rtti(base);
14281 init_basic_iostream_char_rtti(base);
14282 init_basic_iostream_wchar_rtti(base);
14283 init_basic_iostream_short_rtti(base);
14284 init_basic_ofstream_char_rtti(base);
14285 init_basic_ofstream_wchar_rtti(base);
14286 init_basic_ofstream_short_rtti(base);
14287 init_basic_ifstream_char_rtti(base);
14288 init_basic_ifstream_wchar_rtti(base);
14289 init_basic_ifstream_short_rtti(base);
14290 init_basic_fstream_char_rtti(base);
14291 init_basic_fstream_wchar_rtti(base);
14292 init_basic_fstream_short_rtti(base);
14293 init_basic_ostringstream_char_rtti(base);
14294 init_basic_ostringstream_wchar_rtti(base);
14295 init_basic_ostringstream_short_rtti(base);
14296 init_basic_istringstream_char_rtti(base);
14297 init_basic_istringstream_wchar_rtti(base);
14298 init_basic_istringstream_short_rtti(base);
14299 init_basic_stringstream_char_rtti(base);
14300 init_basic_stringstream_wchar_rtti(base);
14301 init_basic_stringstream_short_rtti(base);
14302 init_strstreambuf_rtti(base);
14303 init_strstream_rtti(base);
14304 init_ostrstream_rtti(base);
14305 #endif
14307 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
14308 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
14310 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
14311 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
14313 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
14314 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
14316 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
14317 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE);
14319 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
14320 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE);
14322 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
14323 basic_ostream_wchar_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE);
14325 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
14326 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE);
14328 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
14329 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE);
14331 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
14332 basic_ostream_wchar_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE);
14334 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
14335 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE);
14337 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
14338 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE);
14340 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
14341 basic_ostream_wchar_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE);
14344 void free_io(void)
14346 basic_istream_char_vbase_dtor(&cin.obj);
14347 basic_filebuf_char_dtor(&filebuf_char_stdin);
14349 basic_istream_wchar_vbase_dtor(&ucin.obj);
14350 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
14352 basic_istream_wchar_vbase_dtor(&wcin.obj);
14353 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
14355 basic_ostream_char_vbase_dtor(&cout.obj);
14356 basic_filebuf_char_dtor(&filebuf_char_stdout);
14358 basic_ostream_wchar_vbase_dtor(&ucout.obj);
14359 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
14361 basic_ostream_wchar_vbase_dtor(&wcout.obj);
14362 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
14364 basic_ostream_char_vbase_dtor(&cerr.obj);
14365 basic_filebuf_char_dtor(&filebuf_char_stderr);
14367 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
14368 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
14370 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
14371 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
14373 basic_ostream_char_vbase_dtor(&clog.obj);
14374 basic_filebuf_char_dtor(&filebuf_char_log);
14376 basic_ostream_wchar_vbase_dtor(&uclog.obj);
14377 basic_filebuf_wchar_dtor(&filebuf_short_log);
14379 basic_ostream_wchar_vbase_dtor(&wclog.obj);
14380 basic_filebuf_wchar_dtor(&filebuf_wchar_log);