wined3d: Pass a wined3d_device_context to wined3d_cs_emit_blt_sub_resource().
[wine/zf.git] / dlls / msvcp60 / ios.c
blob12222dc6260da33e97c533bd33ea15844cf49c87
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
20 #include <stdarg.h>
21 #include <stdio.h>
22 #include <limits.h>
23 #include <share.h>
24 #include <locale.h>
26 #include "msvcp.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
32 /* ?_Index@ios_base@std@@0HA */
33 int ios_base_Index = 0;
34 /* ?_Sync@ios_base@std@@0_NA */
35 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 int state0;
68 int state;
69 basic_string_char *str;
70 bool close;
71 #if _MSVCP_VER <= 70
72 locale loc;
73 #endif
74 FILE *file;
75 } basic_filebuf_char;
77 typedef struct {
78 basic_streambuf_wchar base;
79 codecvt_wchar *cvt;
80 int state0;
81 int state;
82 basic_string_char *str;
83 bool close;
84 #if _MSVCP_VER <= 70
85 locale loc;
86 #endif
87 FILE *file;
88 } basic_filebuf_wchar;
90 typedef enum {
91 STRINGBUF_allocated = 1,
92 STRINGBUF_no_write = 2,
93 STRINGBUF_no_read = 4,
94 STRINGBUF_append = 8,
95 STRINGBUF_at_end = 16
96 } basic_stringbuf_state;
98 typedef struct {
99 basic_streambuf_char base;
100 char *pendsave;
101 char *seekhigh;
102 int alsize;
103 int state;
104 char allocator; /* empty struct */
105 } basic_stringbuf_char;
107 typedef struct {
108 basic_streambuf_wchar base;
109 wchar_t *pendsave;
110 wchar_t *seekhigh;
111 int alsize;
112 int state;
113 char allocator; /* empty struct */
114 } basic_stringbuf_wchar;
116 typedef struct {
117 ios_base base;
118 basic_streambuf_char *strbuf;
119 struct _basic_ostream_char *stream;
120 char fillch;
121 } basic_ios_char;
123 typedef struct {
124 ios_base base;
125 basic_streambuf_wchar *strbuf;
126 struct _basic_ostream_wchar *stream;
127 wchar_t fillch;
128 } basic_ios_wchar;
130 typedef struct _basic_ostream_char {
131 const int *vbtable;
132 /* virtual inheritance
133 * basic_ios_char basic_ios;
135 } basic_ostream_char;
137 typedef struct _basic_ostream_wchar {
138 const int *vbtable;
139 /* virtual inheritance
140 * basic_ios_wchar basic_ios;
142 } basic_ostream_wchar;
144 typedef struct {
145 const int *vbtable;
146 streamsize count;
147 /* virtual inheritance
148 * basic_ios_char basic_ios;
150 } basic_istream_char;
152 typedef struct {
153 const int *vbtable;
154 streamsize count;
155 /* virtual inheritance
156 * basic_ios_wchar basic_ios;
158 } basic_istream_wchar;
160 typedef struct {
161 basic_istream_char base1;
162 basic_ostream_char base2;
163 /* virtual inheritance
164 * basic_ios_char basic_ios;
166 } basic_iostream_char;
168 typedef struct {
169 basic_istream_wchar base1;
170 basic_ostream_wchar base2;
171 /* virtual inheritance
172 * basic_ios_wchar basic_ios;
174 } basic_iostream_wchar;
176 typedef struct {
177 basic_ostream_char base;
178 basic_filebuf_char filebuf;
179 /* virtual inheritance
180 * basic_ios_char basic_ios;
182 } basic_ofstream_char;
184 typedef struct {
185 basic_ostream_wchar base;
186 basic_filebuf_wchar filebuf;
187 /* virtual inheritance
188 * basic_ios_wchar basic_ios;
190 } basic_ofstream_wchar;
192 typedef struct {
193 basic_istream_char base;
194 basic_filebuf_char filebuf;
195 /* virtual inheritance
196 * basic_ios_char basic_ios;
198 } basic_ifstream_char;
200 typedef struct {
201 basic_istream_wchar base;
202 basic_filebuf_wchar filebuf;
203 /* virtual inheritance
204 * basic_ios_wchar basic_ios;
206 } basic_ifstream_wchar;
208 typedef struct {
209 basic_iostream_char base;
210 basic_filebuf_char filebuf;
211 /* virtual inheritance
212 * basic_ios_char basic_ios;
214 } basic_fstream_char;
216 typedef struct {
217 basic_iostream_wchar base;
218 basic_filebuf_wchar filebuf;
219 /* virtual inheritance
220 * basic_ios_char basic_ios;
222 } basic_fstream_wchar;
224 typedef struct {
225 basic_ostream_char base;
226 basic_stringbuf_char strbuf;
227 /* virtual inheritance
228 * basic_ios_char basic_ios;
230 } basic_ostringstream_char;
232 typedef struct {
233 basic_ostream_wchar base;
234 basic_stringbuf_wchar strbuf;
235 /* virtual inheritance
236 * basic_ios_wchar basic_ios;
238 } basic_ostringstream_wchar;
240 typedef struct {
241 basic_istream_char base;
242 basic_stringbuf_char strbuf;
243 /* virtual inheritance
244 * basic_ios_char basic_ios;
246 } basic_istringstream_char;
248 typedef struct {
249 basic_istream_wchar base;
250 basic_stringbuf_wchar strbuf;
251 /* virtual inheritance
252 * basic_ios_wchar basic_ios;
254 } basic_istringstream_wchar;
256 typedef struct {
257 basic_iostream_char base;
258 basic_stringbuf_char strbuf;
259 /* virtual inheritance
260 * basic_ios_char basic_ios;
262 } basic_stringstream_char;
264 typedef struct {
265 basic_iostream_wchar base;
266 basic_stringbuf_wchar strbuf;
267 /* virtual inheritance
268 * basic_ios_wchar basic_ios;
270 } basic_stringstream_wchar;
272 typedef enum {
273 STRSTATE_Allocated = 1,
274 STRSTATE_Constant = 2,
275 STRSTATE_Dynamic = 4,
276 STRSTATE_Frozen = 8
277 } strstreambuf__Strstate;
279 typedef struct {
280 basic_streambuf_char base;
281 char *endsave;
282 char *seekhigh;
283 streamsize minsize;
284 int strmode;
285 void* (__cdecl *palloc)(size_t);
286 void (__cdecl *pfree)(void*);
287 } strstreambuf;
289 typedef struct {
290 basic_ostream_char base;
291 strstreambuf buf;
292 /* virtual inheritance
293 * basic_ios_char basic_ios;
295 } ostrstream;
297 typedef struct {
298 basic_istream_char base;
299 strstreambuf buf;
300 /* virtual inheritance
301 * basic_ios_char basic_ios;
303 } istrstream;
305 typedef struct {
306 basic_iostream_char base;
307 strstreambuf buf;
308 /* virtual inheritance
309 * basic_ios_char basic_ios;
311 } strstream;
313 #if _MSVCP_VER >= 100
314 #define VBTABLE_ALIGN 8
315 #else
316 #define VBTABLE_ALIGN 4
317 #endif
319 extern const vtable_ptr MSVCP_iosb_vtable;
321 /* ??_7ios_base@std@@6B@ */
322 extern const vtable_ptr MSVCP_ios_base_vtable;
324 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
325 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
327 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
328 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
330 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
331 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
333 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
334 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
336 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
337 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
339 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
340 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
342 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
343 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
345 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
346 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
348 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
349 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
351 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
352 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
354 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
355 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
357 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
358 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
360 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
361 const int basic_ostream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_char), VBTABLE_ALIGN)};
362 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
363 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
365 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
366 const int basic_ostream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
367 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
368 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
370 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
371 const int basic_ostream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
372 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
373 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
375 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
376 const int basic_istream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_char), VBTABLE_ALIGN)};
377 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
378 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
380 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
381 const int basic_istream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
382 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
383 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
385 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
386 const int basic_istream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
387 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
388 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
390 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
391 const int basic_iostream_char_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)};
392 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
393 const int basic_iostream_char_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_char, base2)};
394 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
395 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
397 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
398 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
399 const int basic_iostream_wchar_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)};
400 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
401 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
402 const int basic_iostream_wchar_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_wchar, base2)};
403 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
404 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
405 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
406 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
408 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
409 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
410 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
411 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
413 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
414 const int basic_ofstream_wchar_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
415 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
416 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
418 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
419 const int basic_ofstream_short_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
420 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
421 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
423 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
424 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
425 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
426 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
428 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
429 const int basic_ifstream_wchar_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
430 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
431 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
433 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
434 const int basic_ifstream_short_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
435 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
436 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
438 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
439 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
440 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
441 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
442 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
443 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
445 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
446 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
447 const int basic_fstream_wchar_vbtable1[] = {0, sizeof(basic_fstream_wchar)};
448 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
449 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
450 const int basic_fstream_wchar_vbtable2[] = {0, sizeof(basic_fstream_wchar)-FIELD_OFFSET(basic_fstream_wchar, base.base2)};
451 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
452 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
453 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
454 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
456 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
457 const int basic_ostringstream_char_vbtable[] = {0, sizeof(basic_ostringstream_char)};
458 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
459 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
461 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
462 const int basic_ostringstream_wchar_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
463 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
464 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
466 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
467 const int basic_ostringstream_short_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
468 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
469 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
471 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
472 const int basic_istringstream_char_vbtable[] = {0, sizeof(basic_istringstream_char)};
473 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
474 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
476 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
477 const int basic_istringstream_wchar_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
478 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
479 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
481 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
482 const int basic_istringstream_short_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
483 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
484 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
486 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
487 const int basic_stringstream_char_vbtable1[] = {0, sizeof(basic_stringstream_char)};
488 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
489 const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_char)-FIELD_OFFSET(basic_stringstream_char, base.base2)};
490 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
491 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
493 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
494 const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
495 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
496 const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
497 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
498 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
500 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
501 const int basic_stringstream_short_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
502 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
503 const int basic_stringstream_short_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
504 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
505 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
507 /* ??_7strstreambuf@std@@6B */
508 extern const vtable_ptr MSVCP_strstreambuf_vtable;
510 static const int ostrstream_vbtable[] = {0, sizeof(ostrstream)};
511 extern const vtable_ptr MSVCP_ostrstream_vtable;
513 static const int istrstream_vbtable[] = {0, sizeof(istrstream)};
515 static const int strstream_vbtable1[] = {0, sizeof(strstream)};
516 static const int strstream_vbtable2[] = {0, sizeof(strstream)-FIELD_OFFSET(strstream, base.base2)};
517 extern const vtable_ptr MSVCP_strstream_vtable;
519 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
520 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
521 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
522 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
523 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
524 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
525 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
526 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
527 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
528 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
529 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
530 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
531 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
532 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
533 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
534 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
535 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
536 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
537 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
538 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
539 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
540 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
541 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
542 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
543 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
544 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
545 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
546 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
547 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
548 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
549 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
550 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
551 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
552 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
553 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
554 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
555 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
556 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
557 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
558 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
559 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
560 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
561 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
562 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
563 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
564 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
565 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
566 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
567 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
568 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
569 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
570 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
571 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
572 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
573 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
574 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
575 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
576 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
577 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
578 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
579 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
580 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
581 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
582 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
583 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
584 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
585 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
586 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
587 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
588 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
589 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
590 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
591 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
592 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
593 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
594 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
595 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
596 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
597 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
598 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
599 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
600 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
601 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
602 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
603 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
604 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
605 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
606 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
607 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
608 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
609 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
610 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
611 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
612 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
613 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
614 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
615 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
616 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
617 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
618 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
619 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
620 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
621 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
622 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
623 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
624 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
625 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
626 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
627 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
628 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
629 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
630 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
631 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
632 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
633 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
634 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
635 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
636 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
637 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
638 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
639 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
640 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
641 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
642 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
643 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
644 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
645 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
646 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
647 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
648 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
649 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
650 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
651 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
652 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
653 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
654 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
655 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
656 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
657 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
658 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
659 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
660 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
661 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
662 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
663 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
664 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
665 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
666 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
667 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
668 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
669 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
670 "?AVostrstream@std@@")
671 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
672 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
673 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
674 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
675 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
676 "?AVstrstream@std@@")
678 __ASM_BLOCK_BEGIN(ios_vtables)
679 __ASM_VTABLE(iosb,
680 VTABLE_ADD_FUNC(iosb_vector_dtor));
681 __ASM_VTABLE(ios_base,
682 VTABLE_ADD_FUNC(ios_base_vector_dtor));
683 __ASM_VTABLE(basic_ios_char,
684 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor));
685 __ASM_VTABLE(basic_ios_wchar,
686 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
687 __ASM_VTABLE(basic_ios_short,
688 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
689 __ASM_VTABLE(basic_streambuf_char,
690 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
691 #if _MSVCP_VER >= 100
692 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
693 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
694 #endif
695 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
696 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
697 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
698 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
699 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
700 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
701 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
702 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
703 #endif
704 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
705 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
706 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
707 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
708 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
709 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
710 __ASM_VTABLE(basic_streambuf_wchar,
711 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
712 #if _MSVCP_VER >= 100
713 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
714 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
715 #endif
716 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
717 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
718 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
719 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
720 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
721 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
722 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
723 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
724 #endif
725 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
726 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
727 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
728 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
729 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
730 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
731 __ASM_VTABLE(basic_streambuf_short,
732 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
733 #if _MSVCP_VER >= 100
734 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
735 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
736 #endif
737 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
738 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
739 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
740 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
741 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
742 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
743 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
744 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
745 #endif
746 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
747 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
748 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
749 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
750 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
751 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
752 __ASM_VTABLE(basic_filebuf_char,
753 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
754 #if _MSVCP_VER >= 100
755 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
756 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
757 #endif
758 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
759 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
760 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
761 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
762 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
763 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
764 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
765 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
766 #endif
767 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
768 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
769 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
770 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
771 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
772 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
773 __ASM_VTABLE(basic_filebuf_wchar,
774 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
775 #if _MSVCP_VER >= 100
776 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
777 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
778 #endif
779 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
780 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
781 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
782 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
783 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
784 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
785 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
786 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
787 #endif
788 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
789 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
790 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
791 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
792 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
793 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
794 __ASM_VTABLE(basic_filebuf_short,
795 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
796 #if _MSVCP_VER >= 100
797 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
798 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
799 #endif
800 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
801 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
802 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
803 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
804 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
805 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
806 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
807 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
808 #endif
809 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
810 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
811 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
812 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
813 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
814 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
815 __ASM_VTABLE(basic_stringbuf_char,
816 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
817 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
818 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
819 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
820 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
821 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
822 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
823 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
824 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
825 #endif
826 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
827 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
828 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
829 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
830 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
831 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
832 __ASM_VTABLE(basic_stringbuf_wchar,
833 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
834 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
835 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
836 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
837 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
838 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
839 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
840 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
841 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
842 #endif
843 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
844 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
845 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
846 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
847 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
848 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
849 __ASM_VTABLE(basic_stringbuf_short,
850 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
851 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
852 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
853 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
854 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
855 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
856 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
857 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
858 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
859 #endif
860 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
861 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
862 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
863 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
864 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
865 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
866 __ASM_VTABLE(basic_ostream_char,
867 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor));
868 __ASM_VTABLE(basic_ostream_wchar,
869 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
870 __ASM_VTABLE(basic_ostream_short,
871 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
872 __ASM_VTABLE(basic_istream_char,
873 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor));
874 __ASM_VTABLE(basic_istream_wchar,
875 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
876 __ASM_VTABLE(basic_istream_short,
877 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
878 __ASM_VTABLE(basic_iostream_char,
879 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor));
880 __ASM_VTABLE(basic_iostream_wchar,
881 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
882 __ASM_VTABLE(basic_iostream_short,
883 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
884 __ASM_VTABLE(basic_ofstream_char,
885 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor));
886 __ASM_VTABLE(basic_ofstream_wchar,
887 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
888 __ASM_VTABLE(basic_ofstream_short,
889 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
890 __ASM_VTABLE(basic_ifstream_char,
891 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor));
892 __ASM_VTABLE(basic_ifstream_wchar,
893 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
894 __ASM_VTABLE(basic_ifstream_short,
895 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
896 __ASM_VTABLE(basic_fstream_char,
897 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor));
898 __ASM_VTABLE(basic_fstream_wchar,
899 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
900 __ASM_VTABLE(basic_fstream_short,
901 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
902 __ASM_VTABLE(basic_ostringstream_char,
903 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor));
904 __ASM_VTABLE(basic_ostringstream_wchar,
905 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
906 __ASM_VTABLE(basic_ostringstream_short,
907 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
908 __ASM_VTABLE(basic_istringstream_char,
909 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor));
910 __ASM_VTABLE(basic_istringstream_wchar,
911 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
912 __ASM_VTABLE(basic_istringstream_short,
913 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
914 __ASM_VTABLE(basic_stringstream_char,
915 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor));
916 __ASM_VTABLE(basic_stringstream_wchar,
917 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
918 __ASM_VTABLE(basic_stringstream_short,
919 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
920 __ASM_VTABLE(strstreambuf,
921 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
922 VTABLE_ADD_FUNC(strstreambuf_overflow)
923 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
924 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
925 VTABLE_ADD_FUNC(strstreambuf_underflow)
926 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
927 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
928 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
929 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
930 #endif
931 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
932 VTABLE_ADD_FUNC(strstreambuf_seekoff)
933 VTABLE_ADD_FUNC(strstreambuf_seekpos)
934 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
935 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
936 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
937 __ASM_VTABLE(ostrstream,
938 VTABLE_ADD_FUNC(ostrstream_vector_dtor));
939 __ASM_VTABLE(strstream,
940 VTABLE_ADD_FUNC(strstream_vector_dtor));
941 __ASM_BLOCK_END
943 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
944 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
945 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
946 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
948 TRACE("(%p %p %p %p)\n", this, first, next, last);
950 this->wbuf = first;
951 this->wpos = next;
952 this->wsize = last-next;
955 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
956 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
957 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
958 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
960 basic_streambuf_char_setp_next(this, first, first, last);
963 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
964 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
965 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
966 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
968 TRACE("(%p %p %p %p)\n", this, first, next, last);
970 this->rbuf = first;
971 this->rpos = next;
972 this->rsize = last-next;
975 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
976 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
977 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
978 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
980 TRACE("(%p)\n", this);
982 this->prbuf = &this->rbuf;
983 this->pwbuf = &this->wbuf;
984 this->prpos = &this->rpos;
985 this->pwpos = &this->wpos;
986 this->prsize = &this->rsize;
987 this->pwsize = &this->wsize;
989 basic_streambuf_char_setp(this, NULL, NULL);
990 basic_streambuf_char_setg(this, NULL, NULL, NULL);
993 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
994 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
995 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
996 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
998 TRACE("(%p %d)\n", this, uninitialized);
999 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1000 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1001 mutex_ctor(&this->lock);
1002 #endif
1003 return this;
1006 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
1007 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
1008 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
1009 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
1011 TRACE("(%p)\n", this);
1013 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1014 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1015 mutex_ctor(&this->lock);
1016 #endif
1017 #if _MSVCP_VER >= 70
1018 this->loc = MSVCRT_operator_new(sizeof(locale));
1019 #endif
1020 locale_ctor(IOS_LOCALE(this));
1021 basic_streambuf_char__Init_empty(this);
1023 return this;
1026 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
1027 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1028 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
1029 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
1031 TRACE("(%p)\n", this);
1033 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1034 mutex_dtor(&this->lock);
1035 #endif
1036 locale_dtor(IOS_LOCALE(this));
1037 #if _MSVCP_VER >= 70
1038 MSVCRT_operator_delete(this->loc);
1039 #endif
1042 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
1043 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
1045 TRACE("(%p %x)\n", this, flags);
1046 if(flags & 2) {
1047 /* we have an array, with the number of elements stored before the first object */
1048 INT_PTR i, *ptr = (INT_PTR *)this-1;
1050 for(i=*ptr-1; i>=0; i--)
1051 basic_streambuf_char_dtor(this+i);
1052 MSVCRT_operator_delete(ptr);
1053 } else {
1054 basic_streambuf_char_dtor(this);
1055 if(flags & 1)
1056 MSVCRT_operator_delete(this);
1059 return this;
1062 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1063 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1064 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
1065 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
1067 TRACE("(%p)\n", this);
1068 return *this->prpos ? *this->prsize : 0;
1071 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1072 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1073 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1074 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1076 TRACE("(%p)\n", this);
1077 (*this->prsize)++;
1078 (*this->prpos)--;
1079 return *this->prpos;
1082 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1083 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1084 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1085 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1087 TRACE("(%p)\n", this);
1088 (*this->prsize)--;
1089 return (*this->prpos)++;
1092 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1093 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1094 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1095 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1097 TRACE("(%p)\n", this);
1098 (*this->prsize)--;
1099 (*this->prpos)++;
1100 return *this->prpos;
1103 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1104 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1105 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1106 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1108 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1110 this->prbuf = gf;
1111 this->pwbuf = pf;
1112 this->prpos = gn;
1113 this->pwpos = pn;
1114 this->prsize = gc;
1115 this->pwsize = pc;
1118 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1119 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1120 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1121 #if _MSVCP_VER >= 100
1122 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1123 #else
1124 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1125 #endif
1126 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1128 TRACE("(%p)\n", this);
1129 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1130 mutex_lock(&this->lock);
1131 #endif
1134 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1135 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1136 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1137 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1139 TRACE("(%p)\n", this);
1140 return *this->pwpos ? *this->pwsize : 0;
1143 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1144 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1145 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1146 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1148 TRACE("(%p)\n", this);
1149 (*this->pwsize)--;
1150 return (*this->pwpos)++;
1153 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1154 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1155 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1156 #if _MSVCP_VER >= 100
1157 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1158 #else
1159 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1160 #endif
1161 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1163 TRACE("(%p)\n", this);
1164 return EOF;
1167 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1168 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1169 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1170 #if _MSVCP_VER >= 100
1171 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1172 #else
1173 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1174 #endif
1175 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1177 int ret;
1179 TRACE("(%p)\n", this);
1181 if(call_basic_streambuf_char_underflow(this)==EOF)
1182 return EOF;
1184 ret = (unsigned char)**this->prpos;
1185 (*this->prsize)--;
1186 (*this->prpos)++;
1187 return ret;
1190 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1191 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1192 #if STREAMSIZE_BITS == 64
1193 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1194 #else
1195 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1196 #endif
1197 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1198 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1199 streamsize, (basic_streambuf_char*, char*, size_t, streamsize), (this, ptr, size, count))
1200 #else
1201 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1202 #endif
1203 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, size_t size, streamsize count)
1205 streamsize copied, chunk;
1206 int c;
1208 TRACE("(%p %p %Iu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1210 for(copied=0; copied<count && size;) {
1211 chunk = basic_streambuf_char__Gnavail(this);
1212 if(chunk > count-copied)
1213 chunk = count-copied;
1215 if(chunk > 0) {
1216 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1217 *this->prpos += chunk;
1218 *this->prsize -= chunk;
1219 copied += chunk;
1220 size -= chunk;
1221 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1222 ptr[copied] = c;
1223 copied++;
1224 size--;
1225 }else {
1226 break;
1230 return copied;
1233 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1234 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1235 #if STREAMSIZE_BITS == 64
1236 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1237 #else
1238 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1239 #endif
1240 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, size_t size, streamsize count)
1242 TRACE("(%p %p %Iu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1243 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1246 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1247 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1248 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1249 #if _MSVCP_VER >= 100
1250 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1251 #else
1252 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1253 #endif
1254 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1256 TRACE("(%p)\n", this);
1257 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1258 mutex_unlock(&this->lock);
1259 #endif
1262 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1263 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1264 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1265 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1267 TRACE("(%p)\n", this);
1268 return *this->prbuf;
1271 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1272 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1273 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1274 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1276 TRACE("(%p)\n", this);
1277 return *this->prpos;
1280 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1281 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1282 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1283 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1285 TRACE("(%p)\n", this);
1286 return *this->prpos+*this->prsize;
1289 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1290 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1291 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1292 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1294 TRACE("(%p)\n", this);
1295 return *this->pwpos+*this->pwsize;
1298 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1299 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1300 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1301 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1303 TRACE("(%p %d)\n", this, off);
1304 *this->prpos += off;
1305 *this->prsize -= off;
1308 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@XZ */
1309 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1310 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?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, IOS_LOCALE(this));
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, IOS_LOCALE(this), sizeof(locale));
1397 call_basic_streambuf_char_imbue(this, loc);
1398 locale_copy_ctor(IOS_LOCALE(this), loc);
1399 return ret;
1402 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1403 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1404 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1405 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1406 #if STREAMOFF_BITS == 64
1407 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1408 #else
1409 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1410 #endif
1411 #if _MSVCP_VER >= 100
1412 #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))
1413 #elif _MSVCP_VER >= 80
1414 #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))
1415 #else
1416 #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))
1417 #endif
1418 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1419 fpos_int *ret, streamoff off, int way, int mode)
1421 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1422 ret->off = -1;
1423 ret->pos = 0;
1424 ret->state = 0;
1425 return ret;
1428 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1429 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1430 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
1431 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
1432 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1433 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1434 #if STREAMOFF_BITS == 64
1435 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1436 #else
1437 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1438 #endif
1439 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1440 fpos_int *ret, streamoff off, int way, int mode)
1442 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1443 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1446 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1447 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1448 #if STREAMOFF_BITS == 64
1449 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 24)
1450 #else
1451 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1452 #endif
1453 fpos_int* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1454 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
1456 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1457 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1460 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1461 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1462 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1463 #if _MSVCP_VER >= 100
1464 #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))
1465 #elif _MSVCP_VER >= 80
1466 #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))
1467 #else
1468 #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))
1469 #endif
1470 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1471 fpos_int *ret, fpos_int pos, int mode)
1473 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1474 ret->off = -1;
1475 ret->pos = 0;
1476 ret->state = 0;
1477 return ret;
1480 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1481 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1482 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1483 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1484 fpos_int *ret, fpos_int pos, int mode)
1486 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1487 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1490 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1491 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1492 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1493 fpos_int* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1494 fpos_int *ret, fpos_int pos, unsigned int mode)
1496 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1497 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1500 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1501 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1502 #if STREAMSIZE_BITS == 64
1503 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1504 #else
1505 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1506 #endif
1507 #if _MSVCP_VER >= 100
1508 #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))
1509 #elif _MSVCP_VER >= 80
1510 #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))
1511 #else
1512 #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))
1513 #endif
1514 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1516 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1517 return this;
1520 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1521 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1522 #if STREAMSIZE_BITS == 64
1523 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1524 #else
1525 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1526 #endif
1527 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1529 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1530 return call_basic_streambuf_char_setbuf(this, buf, count);
1533 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1534 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1535 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1536 #if _MSVCP_VER >= 100
1537 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1538 #elif _MSVCP_VER >= 80
1539 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1540 #else
1541 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1542 #endif
1543 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1545 TRACE("(%p)\n", this);
1546 return 0;
1549 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1550 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1551 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1552 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1554 TRACE("(%p)\n", this);
1555 return call_basic_streambuf_char_sync(this);
1558 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1559 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1560 #if STREAMSIZE_BITS == 64
1561 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1562 #else
1563 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1564 #endif
1565 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1567 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1568 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1571 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1572 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1573 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1574 #if _MSVCP_VER >= 100
1575 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1576 #else
1577 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1578 #endif
1579 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1581 TRACE("(%p)\n", this);
1582 return 0;
1585 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1586 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1587 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1588 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1590 streamsize ret;
1592 TRACE("(%p)\n", this);
1594 ret = basic_streambuf_char__Gnavail(this);
1595 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1598 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1599 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1600 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1601 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1603 TRACE("(%p %d)\n", this, ch);
1604 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1605 (*this->prsize)++;
1606 (*this->prpos)--;
1607 return (unsigned char)ch;
1610 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1613 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1614 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1615 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1616 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1618 TRACE("(%p %d)\n", this, ch);
1619 return basic_streambuf_char__Pnavail(this) ?
1620 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1621 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1624 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1625 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1626 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1627 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1629 TRACE("(%p)\n", this);
1630 if(*this->prpos && *this->prpos>*this->prbuf) {
1631 (*this->prsize)++;
1632 (*this->prpos)--;
1633 return (unsigned char)**this->prpos;
1636 return call_basic_streambuf_char_pbackfail(this, EOF);
1639 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1640 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1641 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1642 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1644 TRACE("(%p)\n", this);
1645 if(basic_streambuf_char__Gnavail(this))
1646 basic_streambuf_char__Gninc(this);
1647 else
1648 call_basic_streambuf_char_uflow(this);
1651 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1652 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1653 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1654 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1656 TRACE("(%p)\n", this);
1657 return basic_streambuf_char__Gnavail(this) ?
1658 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1661 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1662 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1663 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1664 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1666 TRACE("(%p)\n", this);
1667 return basic_streambuf_char__Gnavail(this) ?
1668 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1671 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1672 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1673 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1674 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1676 TRACE("(%p)\n", this);
1678 if(basic_streambuf_char__Gnavail(this) > 1)
1679 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1680 return basic_streambuf_char_sbumpc(this)==EOF ?
1681 EOF : basic_streambuf_char_sgetc(this);
1684 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1685 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1686 #if STREAMSIZE_BITS == 64
1687 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1688 #else
1689 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1690 #endif
1691 #if _MSVCP_VER >= 100
1692 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1693 #else
1694 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1695 #endif
1696 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1698 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1699 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1702 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1703 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1704 #if STREAMSIZE_BITS == 64
1705 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1706 #else
1707 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1708 #endif
1709 #if _MSVCP_VER >= 100
1710 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1711 #elif _MSVCP_VER >= 80
1712 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1713 #else
1714 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1715 #endif
1716 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1718 streamsize copied, chunk;
1720 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1722 for(copied=0; copied<count;) {
1723 chunk = basic_streambuf_char__Pnavail(this);
1724 if(chunk > count-copied)
1725 chunk = count-copied;
1727 if(chunk > 0) {
1728 memcpy(*this->pwpos, ptr+copied, chunk);
1729 *this->pwpos += chunk;
1730 *this->pwsize -= chunk;
1731 copied += chunk;
1732 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1733 copied++;
1734 }else {
1735 break;
1739 return copied;
1742 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1743 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1744 #if STREAMSIZE_BITS == 64
1745 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
1746 #else
1747 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1748 #endif
1749 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1751 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1752 return call_basic_streambuf_char_xsputn(this, ptr, count);
1755 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
1756 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
1757 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8)
1758 void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r)
1760 basic_streambuf_char tmp;
1762 TRACE("(%p %p)\n", this, r);
1764 if(this == r)
1765 return;
1767 tmp = *this;
1768 *this = *r;
1769 this->vtable = tmp.vtable;
1770 tmp.vtable = r->vtable;
1771 *r = tmp;
1774 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1775 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1776 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1777 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1778 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1779 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1781 TRACE("(%p %p %p %p)\n", this, first, next, last);
1783 this->wbuf = first;
1784 this->wpos = next;
1785 this->wsize = last-next;
1788 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1789 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1790 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1791 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1792 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1793 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1795 basic_streambuf_wchar_setp_next(this, first, first, last);
1798 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1799 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1800 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1801 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1802 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1803 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1805 TRACE("(%p %p %p %p)\n", this, first, next, last);
1807 this->rbuf = first;
1808 this->rpos = next;
1809 this->rsize = last-next;
1812 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1813 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1814 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1815 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1816 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1817 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1819 TRACE("(%p)\n", this);
1821 this->prbuf = &this->rbuf;
1822 this->pwbuf = &this->wbuf;
1823 this->prpos = &this->rpos;
1824 this->pwpos = &this->wpos;
1825 this->prsize = &this->rsize;
1826 this->pwsize = &this->wsize;
1828 basic_streambuf_wchar_setp(this, NULL, NULL);
1829 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1832 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1833 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1834 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
1835 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1837 TRACE("(%p %d)\n", this, uninitialized);
1838 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1839 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1840 mutex_ctor(&this->lock);
1841 #endif
1842 return this;
1845 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1846 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1847 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1848 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1850 TRACE("(%p %d)\n", this, uninitialized);
1851 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1852 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1853 return this;
1856 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1857 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1858 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
1859 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1861 TRACE("(%p)\n", this);
1863 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1864 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1865 mutex_ctor(&this->lock);
1866 #endif
1867 #if _MSVCP_VER >= 70
1868 this->loc = MSVCRT_operator_new(sizeof(locale));
1869 #endif
1870 locale_ctor(IOS_LOCALE(this));
1871 basic_streambuf_wchar__Init_empty(this);
1873 return this;
1876 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1877 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1878 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1879 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1881 TRACE("(%p)\n", this);
1882 basic_streambuf_wchar_ctor(this);
1883 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1884 return this;
1887 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1888 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1889 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1890 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1891 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1892 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1894 TRACE("(%p)\n", this);
1896 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1897 mutex_dtor(&this->lock);
1898 #endif
1899 locale_dtor(IOS_LOCALE(this));
1900 #if _MSVCP_VER >= 70
1901 MSVCRT_operator_delete(this->loc);
1902 #endif
1905 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
1906 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1908 TRACE("(%p %x)\n", this, flags);
1909 if(flags & 2) {
1910 /* we have an array, with the number of elements stored before the first object */
1911 INT_PTR i, *ptr = (INT_PTR *)this-1;
1913 for(i=*ptr-1; i>=0; i--)
1914 basic_streambuf_wchar_dtor(this+i);
1915 MSVCRT_operator_delete(ptr);
1916 } else {
1917 basic_streambuf_wchar_dtor(this);
1918 if(flags & 1)
1919 MSVCRT_operator_delete(this);
1922 return this;
1925 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1926 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1927 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1928 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1929 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
1930 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1932 TRACE("(%p)\n", this);
1933 return *this->prpos ? *this->prsize : 0;
1936 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1937 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1938 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1939 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1940 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1941 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1943 TRACE("(%p)\n", this);
1944 (*this->prsize)++;
1945 (*this->prpos)--;
1946 return *this->prpos;
1949 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1950 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1951 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1952 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1953 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1954 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1956 TRACE("(%p)\n", this);
1957 (*this->prsize)--;
1958 return (*this->prpos)++;
1961 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1962 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1963 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1964 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1965 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
1966 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1968 TRACE("(%p)\n", this);
1969 (*this->prsize)--;
1970 (*this->prpos)++;
1971 return *this->prpos;
1974 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1975 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1976 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1977 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1978 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1979 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)
1981 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1983 this->prbuf = gf;
1984 this->pwbuf = pf;
1985 this->prpos = gn;
1986 this->pwpos = pn;
1987 this->prsize = gc;
1988 this->pwsize = pc;
1991 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1992 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1993 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1994 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1995 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
1996 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
1998 TRACE("(%p)\n", this);
1999 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2000 mutex_lock(&this->lock);
2001 #endif
2004 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2005 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2006 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2007 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2008 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
2009 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
2011 TRACE("(%p)\n", this);
2012 return *this->pwpos ? *this->pwsize : 0;
2015 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2016 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2017 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2018 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2019 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
2020 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
2022 TRACE("(%p)\n", this);
2023 (*this->pwsize)--;
2024 return (*this->pwpos)++;
2027 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2028 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2029 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2030 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2031 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
2032 #if _MSVCP_VER >= 100
2033 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
2034 #else
2035 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
2036 #endif
2037 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
2039 TRACE("(%p)\n", this);
2040 return WEOF;
2043 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2044 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2045 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2046 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2047 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
2048 #if _MSVCP_VER >= 100
2049 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
2050 #else
2051 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
2052 #endif
2053 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
2055 int ret;
2057 TRACE("(%p)\n", this);
2059 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
2060 return WEOF;
2062 ret = **this->prpos;
2063 (*this->prsize)--;
2064 (*this->prpos)++;
2065 return ret;
2068 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
2069 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
2070 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
2071 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
2072 #if STREAMSIZE_BITS == 64
2073 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
2074 #else
2075 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
2076 #endif
2077 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2078 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
2079 streamsize, (basic_streambuf_wchar*, wchar_t*, size_t, streamsize), (this, ptr, size, count))
2080 #else
2081 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
2082 #endif
2083 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, size_t size, streamsize count)
2085 streamsize copied, chunk;
2086 unsigned short c;
2088 TRACE("(%p %p %Iu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2090 for(copied=0; copied<count && size;) {
2091 chunk = basic_streambuf_wchar__Gnavail(this);
2092 if(chunk > count-copied)
2093 chunk = count-copied;
2095 if(chunk > 0) {
2096 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
2097 *this->prpos += chunk;
2098 *this->prsize -= chunk;
2099 copied += chunk;
2100 size -= chunk*sizeof(wchar_t);
2101 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
2102 ptr[copied] = c;
2103 copied++;
2104 size--;
2105 }else {
2106 break;
2110 return copied;
2113 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
2114 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
2115 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
2116 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
2117 #if STREAMSIZE_BITS == 64
2118 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
2119 #else
2120 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
2121 #endif
2122 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, size_t size, streamsize count)
2124 TRACE("(%p %p %Iu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2125 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
2128 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2129 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2130 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2131 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2132 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
2133 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
2135 TRACE("(%p)\n", this);
2136 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2137 mutex_unlock(&this->lock);
2138 #endif
2141 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2142 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2143 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2144 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2145 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2146 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2148 TRACE("(%p)\n", this);
2149 return *this->prbuf;
2152 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2153 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2154 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2155 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2156 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2157 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2159 TRACE("(%p)\n", this);
2160 return *this->prpos;
2163 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2164 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2165 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2166 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2167 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2168 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2170 TRACE("(%p)\n", this);
2171 return *this->prpos+*this->prsize;
2174 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2175 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2176 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2177 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2178 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2179 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2181 TRACE("(%p)\n", this);
2182 return *this->pwpos+*this->pwsize;
2185 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2186 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2187 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2188 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2189 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2190 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2192 TRACE("(%p %d)\n", this, off);
2193 *this->prpos += off;
2194 *this->prsize -= off;
2197 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
2198 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
2199 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
2200 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
2201 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
2202 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
2204 TRACE("(%p)\n", this);
2205 return locale_copy_ctor(ret, IOS_LOCALE(this));
2208 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2209 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2210 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2211 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2212 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2213 #if _MSVCP_VER >= 100
2214 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2215 #elif _MSVCP_VER >= 80
2216 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2217 #else
2218 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2219 #endif
2220 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2222 TRACE("(%p %p)\n", this, loc);
2225 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2226 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2227 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2228 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2229 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2230 #if _MSVCP_VER >= 100
2231 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2232 #else
2233 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2234 #endif
2235 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2237 TRACE("(%p %d)\n", this, ch);
2238 return WEOF;
2241 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2242 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2243 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2244 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2245 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2246 #if _MSVCP_VER >= 100
2247 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2248 #else
2249 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2250 #endif
2251 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2253 TRACE("(%p %d)\n", this, ch);
2254 return WEOF;
2257 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2258 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2259 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2260 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2261 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2262 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2264 TRACE("(%p)\n", this);
2265 return *this->pwbuf;
2268 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2269 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2270 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2271 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2272 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2273 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2275 TRACE("(%p %d)\n", this, off);
2276 *this->pwpos += off;
2277 *this->pwsize -= off;
2280 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2281 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2282 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2283 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2284 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2285 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2287 TRACE("(%p)\n", this);
2288 return *this->pwpos;
2291 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2292 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2293 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2294 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2295 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2296 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2298 TRACE("(%p %p)\n", this, loc);
2299 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
2300 call_basic_streambuf_wchar_imbue(this, loc);
2301 locale_copy_ctor(IOS_LOCALE(this), loc);
2302 return ret;
2305 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2306 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
2307 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2308 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2309 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2310 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2311 #if STREAMOFF_BITS == 64
2312 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2313 #else
2314 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2315 #endif
2316 #if _MSVCP_VER >= 100
2317 #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))
2318 #elif _MSVCP_VER >= 80
2319 #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))
2320 #else
2321 #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))
2322 #endif
2323 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2324 fpos_int *ret, streamoff off, int way, int mode)
2326 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2327 ret->off = -1;
2328 ret->pos = 0;
2329 ret->state = 0;
2330 return ret;
2333 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2334 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2335 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2336 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2337 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
2338 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
2339 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2340 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ioos_base@2@H@Z */
2341 #if STREAMOFF_BITS == 64
2342 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2343 #else
2344 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2345 #endif
2346 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2347 fpos_int *ret, streamoff off, int way, int mode)
2349 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2350 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2353 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2354 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2355 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2356 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2357 #if STREAMOFF_BITS == 64
2358 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 24)
2359 #else
2360 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2361 #endif
2362 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2363 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
2365 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2366 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2369 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2370 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2371 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2372 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2373 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2374 #if _MSVCP_VER >= 100
2375 #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))
2376 #elif _MSVCP_VER >= 80
2377 #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))
2378 #else
2379 #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))
2380 #endif
2381 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2382 fpos_int *ret, fpos_int pos, int mode)
2384 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2385 ret->off = -1;
2386 ret->pos = 0;
2387 ret->state = 0;
2388 return ret;
2391 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2392 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2393 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2394 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2395 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2396 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2397 fpos_int *ret, fpos_int pos, int mode)
2399 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2400 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2403 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2404 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2405 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2406 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2407 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2408 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2409 fpos_int *ret, fpos_int pos, unsigned int mode)
2411 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2412 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2415 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2416 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2417 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2418 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2419 #if STREAMSIZE_BITS == 64
2420 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2421 #else
2422 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2423 #endif
2424 #if _MSVCP_VER >= 100
2425 #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))
2426 #elif _MSVCP_VER >= 80
2427 #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))
2428 #else
2429 #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))
2430 #endif
2431 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2433 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2434 return this;
2437 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2438 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2439 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2440 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2441 #if STREAMSIZE_BITS == 64
2442 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2443 #else
2444 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2445 #endif
2446 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2448 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2449 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2452 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2453 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2454 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2455 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2456 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2457 #if _MSVCP_VER >= 100
2458 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2459 #elif _MSVCP_VER >= 80
2460 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2461 #else
2462 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2463 #endif
2464 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2466 TRACE("(%p)\n", this);
2467 return 0;
2470 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2471 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2472 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2473 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2474 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2475 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2477 TRACE("(%p)\n", this);
2478 return call_basic_streambuf_wchar_sync(this);
2481 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2482 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2483 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2484 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2485 #if STREAMSIZE_BITS == 64
2486 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2487 #else
2488 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2489 #endif
2490 #if _MSVCP_VER >= 100
2491 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2492 #else
2493 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2494 #endif
2495 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2497 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2498 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2501 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2502 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2503 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2504 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2505 #if STREAMSIZE_BITS == 64
2506 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2507 #else
2508 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2509 #endif
2510 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2512 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2513 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2516 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2517 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2518 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2519 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2520 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2521 #if _MSVCP_VER >= 100
2522 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2523 #else
2524 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2525 #endif
2526 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2528 TRACE("(%p)\n", this);
2529 return 0;
2532 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2533 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2534 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2535 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2536 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2537 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2539 streamsize ret;
2541 TRACE("(%p)\n", this);
2543 ret = basic_streambuf_wchar__Gnavail(this);
2544 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2547 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2548 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2549 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2550 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2551 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2552 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2554 TRACE("(%p %d)\n", this, ch);
2555 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2556 (*this->prsize)++;
2557 (*this->prpos)--;
2558 return ch;
2561 return call_basic_streambuf_wchar_pbackfail(this, ch);
2564 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2565 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2566 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2567 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2568 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2569 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2571 TRACE("(%p %d)\n", this, ch);
2572 return basic_streambuf_wchar__Pnavail(this) ?
2573 (*basic_streambuf_wchar__Pninc(this) = ch) :
2574 call_basic_streambuf_wchar_overflow(this, ch);
2577 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2578 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2579 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2580 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2581 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2582 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2584 TRACE("(%p)\n", this);
2585 if(*this->prpos && *this->prpos>*this->prbuf) {
2586 (*this->prsize)++;
2587 (*this->prpos)--;
2588 return **this->prpos;
2591 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2594 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2595 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2596 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2597 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2598 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2599 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2601 TRACE("(%p)\n", this);
2602 if(basic_streambuf_wchar__Gnavail(this))
2603 basic_streambuf_wchar__Gninc(this);
2604 else
2605 call_basic_streambuf_wchar_uflow(this);
2608 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2609 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2610 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2611 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2612 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2613 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2615 TRACE("(%p)\n", this);
2616 return basic_streambuf_wchar__Gnavail(this) ?
2617 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2620 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2621 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2622 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2623 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2624 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2625 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2627 TRACE("(%p)\n", this);
2628 return basic_streambuf_wchar__Gnavail(this) ?
2629 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2632 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2633 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2634 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2635 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2636 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2637 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2639 TRACE("(%p)\n", this);
2641 if(basic_streambuf_wchar__Gnavail(this) > 1)
2642 return *basic_streambuf_wchar__Gnpreinc(this);
2643 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2644 WEOF : basic_streambuf_wchar_sgetc(this);
2647 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2648 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2649 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2650 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2651 #if STREAMSIZE_BITS == 64
2652 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2653 #else
2654 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2655 #endif
2656 #if _MSVCP_VER >= 100
2657 #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))
2658 #elif _MSVCP_VER >= 80
2659 #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))
2660 #else
2661 #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))
2662 #endif
2663 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2665 streamsize copied, chunk;
2667 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2669 for(copied=0; copied<count;) {
2670 chunk = basic_streambuf_wchar__Pnavail(this);
2671 if(chunk > count-copied)
2672 chunk = count-copied;
2674 if(chunk > 0) {
2675 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2676 *this->pwpos += chunk;
2677 *this->pwsize -= chunk;
2678 copied += chunk;
2679 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2680 copied++;
2681 }else {
2682 break;
2686 return copied;
2689 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2690 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2691 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2692 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2693 #if STREAMSIZE_BITS == 64
2694 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2695 #else
2696 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2697 #endif
2698 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2700 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2701 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2704 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
2705 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
2706 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2707 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2708 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8)
2709 void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r)
2711 basic_streambuf_wchar tmp;
2713 TRACE("(%p %p)\n", this, r);
2715 if(this == r)
2716 return;
2718 tmp = *this;
2719 *this = *r;
2720 this->vtable = tmp.vtable;
2721 tmp.vtable = r->vtable;
2722 *r = tmp;
2725 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2726 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2727 int basic_filebuf_char__Init__Stinit = 0;
2729 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2730 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2731 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2732 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2734 TRACE("(%p %p %d)\n", this, file, which);
2736 this->cvt = NULL;
2737 this->state0 = basic_filebuf_char__Init__Stinit;
2738 this->state = basic_filebuf_char__Init__Stinit;
2739 if(which == INITFL_new)
2740 this->str = NULL;
2741 this->close = (which == INITFL_open);
2742 this->file = file;
2744 basic_streambuf_char__Init_empty(&this->base);
2745 if(file)
2746 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2747 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2750 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
2751 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
2752 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt_cvt, 8)
2753 void __thiscall basic_filebuf_char__Initcvt_cvt(basic_filebuf_char *this, codecvt_char *cvt)
2755 TRACE("(%p %p)\n", this, cvt);
2757 if(codecvt_base_always_noconv(&cvt->base)) {
2758 this->cvt = NULL;
2759 }else {
2760 this->str = MSVCRT_operator_new(sizeof(basic_string_char));
2761 MSVCP_basic_string_char_ctor(this->str);
2762 this->cvt = cvt;
2766 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
2767 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
2768 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 4)
2769 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this)
2771 codecvt_char *cvt = codecvt_char_use_facet(IOS_LOCALE(&this->base));
2773 TRACE("(%p)\n", this);
2775 locale__Addfac(&this->loc, &cvt->base.facet, codecvt_char_id.id, LC_CTYPE);
2776 basic_filebuf_char__Initcvt_cvt( this, cvt );
2779 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2780 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2781 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2782 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2784 basic_filebuf_char *ret = this;
2786 TRACE("(%p)\n", this);
2788 if(!this->file || fclose(this->file))
2789 return NULL;
2791 basic_filebuf_char__Init(this, NULL, INITFL_close);
2792 return ret;
2795 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2796 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2797 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2798 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2800 TRACE("(%p %p)\n", this, file);
2802 basic_streambuf_char_ctor(&this->base);
2803 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2805 locale_ctor(&this->loc);
2806 basic_filebuf_char__Init(this, file, INITFL_new);
2807 return this;
2810 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2811 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2812 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2813 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2815 return basic_filebuf_char_ctor_file(this, NULL);
2818 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2819 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2820 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2821 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2823 TRACE("(%p %d)\n", this, uninitialized);
2825 basic_streambuf_char_ctor_uninitialized(&this->base, 0);
2826 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2827 locale_ctor(&this->loc);
2828 return this;
2831 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2832 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2833 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2834 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2836 TRACE("(%p)\n", this);
2838 if(this->close)
2839 basic_filebuf_char_close(this);
2840 if(this->str) {
2841 MSVCP_basic_string_char_dtor(this->str);
2842 MSVCRT_operator_delete(this->str);
2844 locale_dtor(&this->loc);
2845 basic_streambuf_char_dtor(&this->base);
2848 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
2849 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2851 TRACE("(%p %x)\n", this, flags);
2852 if(flags & 2) {
2853 /* we have an array, with the number of elements stored before the first object */
2854 INT_PTR i, *ptr = (INT_PTR *)this-1;
2856 for(i=*ptr-1; i>=0; i--)
2857 basic_filebuf_char_dtor(this+i);
2858 MSVCRT_operator_delete(ptr);
2859 } else {
2860 basic_filebuf_char_dtor(this);
2861 if(flags & 1)
2862 MSVCRT_operator_delete(this);
2865 return this;
2868 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2869 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2870 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2871 bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2873 TRACE("(%p)\n", this);
2874 return this->file != NULL;
2877 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
2878 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
2879 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
2881 static const struct {
2882 int mode;
2883 const wchar_t str[4];
2884 const wchar_t str_bin[4];
2885 } str_mode[] = {
2886 {OPENMODE_out, L"w", L"wb"},
2887 {OPENMODE_out|OPENMODE_app, L"a", L"ab"},
2888 {OPENMODE_app, L"a", L"ab"},
2889 {OPENMODE_out|OPENMODE_trunc, L"w", L"wb"},
2890 {OPENMODE_in, L"r", L"rb"},
2891 {OPENMODE_in|OPENMODE_out, L"r+", L"r+b"},
2892 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, L"w+", L"w+b"},
2893 {OPENMODE_in|OPENMODE_out|OPENMODE_app, L"a+", L"a+b"},
2894 {OPENMODE_in|OPENMODE_app, L"a+", L"a+b"}
2897 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2898 size_t mode_idx;
2899 FILE *f = NULL;
2901 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
2903 for(mode_idx=0; mode_idx<ARRAY_SIZE(str_mode); mode_idx++)
2904 if(str_mode[mode_idx].mode == real_mode)
2905 break;
2906 if(mode_idx == ARRAY_SIZE(str_mode))
2907 return NULL;
2909 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, L"r")))
2910 return NULL;
2911 else if(f)
2912 fclose(f);
2914 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2915 && (f = _wfopen(name, L"r"))) {
2916 fclose(f);
2917 return NULL;
2920 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2921 : str_mode[mode_idx].str, prot);
2922 if(!f)
2923 return NULL;
2925 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2926 fclose(f);
2927 return NULL;
2930 return f;
2933 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
2934 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
2935 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
2937 wchar_t nameW[FILENAME_MAX];
2939 TRACE("(%s %d %d)\n", name, mode, prot);
2941 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2942 return NULL;
2943 return _Fiopen_wchar(nameW, mode, prot);
2946 /* ?__Fiopen@std@@YAPAU_iobuf@@PBDH@Z */
2947 /* ?__Fiopen@std@@YAPEAU_iobuf@@PEBDH@Z */
2948 FILE* __cdecl ___Fiopen(const char *name, int mode)
2950 TRACE("(%p %d)\n", name, mode);
2951 return _Fiopen(name, mode, _SH_DENYNO);
2954 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2955 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2956 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2957 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2958 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
2959 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2961 FILE *f = NULL;
2963 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2965 if(basic_filebuf_char_is_open(this))
2966 return NULL;
2968 if(!(f = _Fiopen_wchar(name, mode, prot)))
2969 return NULL;
2971 basic_filebuf_char__Init(this, f, INITFL_open);
2972 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(IOS_LOCALE(&this->base)));
2973 return this;
2976 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
2977 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
2978 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
2979 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
2980 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
2981 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
2983 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
2986 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2987 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2988 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
2989 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2991 wchar_t nameW[FILENAME_MAX];
2993 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
2995 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2996 return NULL;
2997 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
3000 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDF@Z */
3001 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDF@Z */
3002 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
3003 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
3005 TRACE("(%p %p %d)\n", this, name, mode);
3006 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3009 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDH@Z */
3010 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDH@Z */
3011 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
3012 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
3013 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
3014 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
3016 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3019 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3020 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3021 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
3022 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
3024 char *ptr, ch = c, *to_next;
3025 const char *from_next;
3026 int ret;
3029 TRACE("(%p %d)\n", this, c);
3031 if(!basic_filebuf_char_is_open(this))
3032 return EOF;
3033 if(c == EOF)
3034 return !c;
3036 if(!this->cvt)
3037 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3039 from_next = &ch;
3040 MSVCP_basic_string_char_clear(this->str);
3041 MSVCP_basic_string_char_append_len_ch(this->str, 8, '\0');
3042 ptr = this->str->ptr;
3043 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1, &from_next,
3044 ptr, ptr+MSVCP_basic_string_char_length(this->str), &to_next);
3046 switch(ret) {
3047 case CODECVT_partial:
3048 if(from_next == &ch)
3049 return EOF;
3050 case CODECVT_ok:
3051 if(!fwrite(ptr, to_next-ptr, 1, this->file))
3052 return EOF;
3053 return c;
3054 case CODECVT_noconv:
3055 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3056 default:
3057 return EOF;
3061 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3062 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3063 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
3064 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
3066 TRACE("(%p %d)\n", this, c);
3068 if(!basic_filebuf_char_is_open(this))
3069 return EOF;
3071 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
3072 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
3073 basic_streambuf_char__Gndec(&this->base);
3074 return c==EOF ? !c : c;
3075 }else if(c == EOF) {
3076 return EOF;
3077 }else if(!this->cvt) {
3078 return ungetc(c, this->file);
3079 }else if(MSVCP_basic_string_char_length(this->str)) {
3080 char *b, *e, *cur;
3082 e = this->str->ptr;
3083 b = e+this->str->size-1;
3084 for(cur = b; cur>=e; cur--) {
3085 if(ungetc(*cur, this->file) == EOF) {
3086 for(; cur<=b; cur++)
3087 fgetc(this->file);
3088 return EOF;
3091 MSVCP_basic_string_char_clear(this->str);
3092 this->state = this->state0;
3093 return c;
3096 return EOF;
3099 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3100 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3101 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
3102 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
3104 char ch, *to_next;
3105 const char *buf_next;
3106 int c;
3108 TRACE("(%p)\n", this);
3110 if(!basic_filebuf_char_is_open(this))
3111 return EOF;
3113 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3114 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
3116 c = fgetc(this->file);
3117 if(!this->cvt || c==EOF)
3118 return c;
3120 MSVCP_basic_string_char_clear(this->str);
3121 this->state0 = this->state;
3122 while(1) {
3123 MSVCP_basic_string_char_append_ch(this->str, c);
3124 this->state = this->state0;
3126 switch(codecvt_char_in(this->cvt, &this->state, this->str->ptr,
3127 this->str->ptr+this->str->size, &buf_next, &ch, &ch+1, &to_next)) {
3128 case CODECVT_partial:
3129 break;
3130 case CODECVT_noconv:
3131 return (unsigned char)this->str->ptr[0];
3132 case CODECVT_ok:
3133 return (unsigned char)ch;
3134 default:
3135 return EOF;
3138 c = fgetc(this->file);
3139 if(c == EOF)
3140 return EOF;
3144 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3145 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3146 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
3147 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
3149 int ret;
3151 TRACE("(%p)\n", this);
3153 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3154 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
3156 ret = call_basic_streambuf_char_uflow(&this->base);
3157 if(ret != EOF)
3158 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
3159 return ret;
3162 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3163 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3164 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3165 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3166 #if STREAMOFF_BITS == 64
3167 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
3168 #else
3169 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
3170 #endif
3171 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
3172 fpos_int *ret, streamoff off, int way, int mode)
3174 fpos_t pos;
3176 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3178 if(!basic_filebuf_char_is_open(this) || fseek(this->file, off, way)) {
3179 ret->off = -1;
3180 ret->pos = 0;
3181 ret->state = 0;
3182 return ret;
3185 fgetpos(this->file, &pos);
3186 ret->off = 0;
3187 ret->pos = pos;
3188 ret->state = this->state;
3189 return ret;
3192 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3193 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3194 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
3195 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
3196 fpos_int *ret, fpos_int pos, int mode)
3198 fpos_t fpos;
3200 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3202 if(!basic_filebuf_char_is_open(this) || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3203 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3204 ret->off = -1;
3205 ret->pos = 0;
3206 ret->state = 0;
3207 return ret;
3210 fgetpos(this->file, &fpos);
3211 ret->off = 0;
3212 ret->pos = fpos;
3213 ret->state = this->state;
3214 return ret;
3217 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
3218 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
3219 #if STREAMSIZE_BITS == 64
3220 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
3221 #else
3222 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
3223 #endif
3224 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
3226 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3228 if(!basic_filebuf_char_is_open(this))
3229 return NULL;
3231 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3232 return NULL;
3234 basic_filebuf_char__Init(this, this->file, INITFL_open);
3235 return &this->base;
3238 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3239 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3240 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3241 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3243 TRACE("(%p)\n", this);
3245 if(!basic_filebuf_char_is_open(this))
3246 return 0;
3248 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3249 return 0;
3250 return fflush(this->file);
3253 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
3254 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
3255 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
3256 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
3258 TRACE("(%p %p)\n", this, loc);
3259 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(loc));
3262 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3263 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3264 int basic_filebuf_wchar__Init__Stinit = 0;
3266 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3267 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3268 int basic_filebuf_short__Init__Stinit = 0;
3270 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3271 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3272 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3273 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3275 TRACE("(%p %p %d)\n", this, file, which);
3277 this->cvt = NULL;
3278 this->state0 = basic_filebuf_short__Init__Stinit;
3279 this->state = basic_filebuf_short__Init__Stinit;
3280 if(which == INITFL_new)
3281 this->str = NULL;
3282 this->close = (which == INITFL_open);
3283 this->file = file;
3285 basic_streambuf_wchar__Init_empty(&this->base);
3288 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3289 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3290 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3291 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3293 TRACE("(%p %p %d)\n", this, file, which);
3295 this->cvt = NULL;
3296 this->state0 = basic_filebuf_short__Init__Stinit;
3297 this->state = basic_filebuf_short__Init__Stinit;
3298 if(which == INITFL_new)
3299 this->str = NULL;
3300 this->close = (which == INITFL_open);
3301 this->file = file;
3303 basic_streambuf_wchar__Init_empty(&this->base);
3306 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
3307 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
3308 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
3309 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
3310 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt_cvt, 8)
3311 void __thiscall basic_filebuf_wchar__Initcvt_cvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
3313 TRACE("(%p %p)\n", this, cvt);
3315 if(codecvt_base_always_noconv(&cvt->base)) {
3316 this->cvt = NULL;
3317 }else {
3318 basic_streambuf_wchar__Init_empty(&this->base);
3319 this->cvt = cvt;
3323 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
3324 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
3325 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 4)
3326 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this)
3328 codecvt_wchar *cvt = codecvt_wchar_use_facet(IOS_LOCALE(&this->base));
3329 basic_filebuf_wchar__Initcvt_cvt( this, cvt );
3332 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3333 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3334 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3335 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3336 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3337 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3339 basic_filebuf_wchar *ret = this;
3341 TRACE("(%p)\n", this);
3343 if(!this->file || fclose(this->file))
3344 return NULL;
3346 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3347 return ret;
3350 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3351 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3352 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3353 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3355 TRACE("(%p %p)\n", this, file);
3357 basic_streambuf_wchar_ctor(&this->base);
3358 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3360 locale_ctor(&this->loc);
3361 basic_filebuf_wchar__Init(this, file, INITFL_new);
3362 return this;
3365 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3366 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3367 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3368 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3370 TRACE("(%p %p)\n", this, file);
3372 basic_streambuf_short_ctor(&this->base);
3373 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3375 locale_ctor(&this->loc);
3376 basic_filebuf_short__Init(this, file, INITFL_new);
3377 return this;
3380 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3381 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3382 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3383 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3385 return basic_filebuf_wchar_ctor_file(this, NULL);
3388 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3389 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3390 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3391 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3393 return basic_filebuf_short_ctor_file(this, NULL);
3396 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3397 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3398 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3399 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3401 TRACE("(%p %d)\n", this, uninitialized);
3403 basic_streambuf_wchar_ctor(&this->base);
3404 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3405 return this;
3408 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3409 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3410 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3411 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3413 TRACE("(%p %d)\n", this, uninitialized);
3415 basic_streambuf_short_ctor_uninitialized(&this->base, 0);
3416 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3417 locale_ctor(&this->loc);
3418 return this;
3421 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3422 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3423 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3424 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3425 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3426 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3428 TRACE("(%p)\n", this);
3430 if(this->close)
3431 basic_filebuf_wchar_close(this);
3432 if(this->str) {
3433 MSVCP_basic_string_char_dtor(this->str);
3434 MSVCRT_operator_delete(this->str);
3436 locale_dtor(&this->loc);
3437 basic_streambuf_wchar_dtor(&this->base);
3440 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3441 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3443 TRACE("(%p %x)\n", this, flags);
3444 if(flags & 2) {
3445 /* we have an array, with the number of elements stored before the first object */
3446 INT_PTR i, *ptr = (INT_PTR *)this-1;
3448 for(i=*ptr-1; i>=0; i--)
3449 basic_filebuf_wchar_dtor(this+i);
3450 MSVCRT_operator_delete(ptr);
3451 } else {
3452 basic_filebuf_wchar_dtor(this);
3453 if(flags & 1)
3454 MSVCRT_operator_delete(this);
3457 return this;
3460 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3461 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3462 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3463 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3464 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3465 bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3467 TRACE("(%p)\n", this);
3468 return this->file != NULL;
3471 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3472 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3473 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3474 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3475 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3476 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3478 FILE *f = NULL;
3480 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3482 if(basic_filebuf_wchar_is_open(this))
3483 return NULL;
3485 if(!(f = _Fiopen_wchar(name, mode, prot)))
3486 return NULL;
3488 basic_filebuf_wchar__Init(this, f, INITFL_open);
3489 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(IOS_LOCALE(&this->base)));
3490 return this;
3493 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3494 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3495 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3496 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3497 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3498 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3500 FILE *f = NULL;
3502 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3504 if(basic_filebuf_wchar_is_open(this))
3505 return NULL;
3507 if(!(f = _Fiopen_wchar(name, mode, prot)))
3508 return NULL;
3510 basic_filebuf_short__Init(this, f, INITFL_open);
3511 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(IOS_LOCALE(&this->base)));
3512 return this;
3515 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3516 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3517 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3518 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3519 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3520 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3522 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3525 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3526 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3527 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3528 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3529 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3530 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3532 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3535 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3536 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3537 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3538 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3540 wchar_t nameW[FILENAME_MAX];
3542 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3544 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3545 return NULL;
3546 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3549 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3550 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3551 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3552 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3554 wchar_t nameW[FILENAME_MAX];
3556 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3558 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3559 return NULL;
3560 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3563 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
3564 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
3565 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
3566 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
3568 TRACE("(%p %p %d)\n", this, name, mode);
3569 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3572 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
3573 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
3574 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3575 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3576 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3577 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3579 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3582 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3583 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3584 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3585 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3587 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3590 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3591 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3592 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3593 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3594 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3595 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3597 char *ptr, *to_next;
3598 wchar_t ch = c;
3599 const wchar_t *from_next;
3600 unsigned short ret;
3603 TRACE("(%p %d)\n", this, c);
3605 if(!basic_filebuf_wchar_is_open(this))
3606 return WEOF;
3607 if(c == WEOF)
3608 return !c;
3610 if(!this->cvt)
3611 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3613 from_next = &ch;
3614 MSVCP_basic_string_char_clear(this->str);
3615 MSVCP_basic_string_char_append_len_ch(this->str, 8, '\0');
3616 ptr = this->str->ptr;
3617 ret = codecvt_wchar_out(this->cvt, &this->state, &ch, &ch+1, &from_next,
3618 ptr, ptr+MSVCP_basic_string_char_length(this->str), &to_next);
3620 switch(ret) {
3621 case CODECVT_partial:
3622 if(from_next == &ch)
3623 return WEOF;
3624 /* fall through */
3625 case CODECVT_ok:
3626 if(!fwrite(ptr, to_next-ptr, 1, this->file))
3627 return WEOF;
3628 return c;
3629 case CODECVT_noconv:
3630 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3631 default:
3632 return WEOF;
3636 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3637 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3638 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3639 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3640 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3641 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3643 TRACE("(%p %d)\n", this, c);
3645 if(!basic_filebuf_wchar_is_open(this))
3646 return WEOF;
3648 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3649 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3650 basic_streambuf_wchar__Gndec(&this->base);
3651 return c==WEOF ? !c : c;
3652 }else if(c == WEOF) {
3653 return WEOF;
3654 }else if(!this->cvt) {
3655 return ungetwc(c, this->file);
3656 }else if(MSVCP_basic_string_char_length(this->str)) {
3657 char *b, *e, *cur;
3659 e = this->str->ptr;
3660 b = e+this->str->size-1;
3661 for(cur = b; cur>=e; cur--) {
3662 if(ungetc(*cur, this->file) == EOF) {
3663 for(; cur<=b; cur++)
3664 fgetc(this->file);
3665 return WEOF;
3668 MSVCP_basic_string_char_clear(this->str);
3669 this->state = this->state0;
3670 return c;
3673 return WEOF;
3676 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3677 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3678 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3679 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3680 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
3681 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
3683 wchar_t ch, *to_next;
3684 const char *buf_next;
3685 int c;
3687 TRACE("(%p)\n", this);
3689 if(!basic_filebuf_wchar_is_open(this))
3690 return WEOF;
3692 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3693 return *basic_streambuf_wchar__Gninc(&this->base);
3695 if(!this->cvt)
3696 return fgetwc(this->file);
3698 MSVCP_basic_string_char_clear(this->str);
3699 this->state0 = this->state;
3700 while(1) {
3701 if((c = fgetc(this->file)) == EOF)
3702 return WEOF;
3703 MSVCP_basic_string_char_append_ch(this->str, c);
3704 this->state = this->state0;
3706 switch(codecvt_wchar_in(this->cvt, &this->state, this->str->ptr,
3707 this->str->ptr+this->str->size, &buf_next, &ch, &ch+1, &to_next)) {
3708 case CODECVT_partial:
3709 break;
3710 case CODECVT_noconv:
3711 if(this->str->size < sizeof(unsigned short)/sizeof(char))
3712 break;
3713 return *(unsigned short*)this->str->ptr;
3714 case CODECVT_ok:
3715 return (unsigned short)ch;
3716 default:
3717 return WEOF;
3722 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3723 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3724 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3725 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3726 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
3727 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
3729 unsigned short ret;
3731 TRACE("(%p)\n", this);
3733 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3734 return *basic_streambuf_wchar_gptr(&this->base);
3736 ret = call_basic_streambuf_wchar_uflow(&this->base);
3737 if(ret != WEOF)
3738 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
3739 return ret;
3742 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3743 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3744 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3745 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3746 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3747 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3748 #if STREAMOFF_BITS == 64
3749 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
3750 #else
3751 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
3752 #endif
3753 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
3754 fpos_int *ret, streamoff off, int way, int mode)
3756 fpos_t pos;
3758 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3760 if(!basic_filebuf_wchar_is_open(this) || fseek(this->file, off, way)) {
3761 ret->off = -1;
3762 ret->pos = 0;
3763 ret->state = 0;
3764 return ret;
3767 fgetpos(this->file, &pos);
3768 ret->off = 0;
3769 ret->pos = pos;
3770 ret->state = this->state;
3771 return ret;
3774 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3775 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3776 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3777 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3778 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
3779 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
3780 fpos_int *ret, fpos_int pos, int mode)
3782 fpos_t fpos;
3784 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3786 if(!basic_filebuf_wchar_is_open(this) || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3787 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3788 ret->off = -1;
3789 ret->pos = 0;
3790 ret->state = 0;
3791 return ret;
3794 fgetpos(this->file, &fpos);
3795 ret->off = 0;
3796 ret->pos = fpos;
3797 ret->state = this->state;
3798 return ret;
3801 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
3802 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
3803 #if STREAMSIZE_BITS == 64
3804 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
3805 #else
3806 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
3807 #endif
3808 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3810 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3812 if(!basic_filebuf_wchar_is_open(this))
3813 return NULL;
3815 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3816 return NULL;
3818 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
3819 return &this->base;
3822 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
3823 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
3824 #if STREAMSIZE_BITS == 64
3825 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
3826 #else
3827 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
3828 #endif
3829 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3831 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3833 if(!basic_filebuf_wchar_is_open(this))
3834 return NULL;
3836 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3837 return NULL;
3839 basic_filebuf_short__Init(this, this->file, INITFL_open);
3840 return &this->base;
3843 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
3844 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
3845 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
3846 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
3847 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
3848 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
3850 TRACE("(%p)\n", this);
3852 if(!basic_filebuf_wchar_is_open(this))
3853 return 0;
3855 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3856 return 0;
3857 return fflush(this->file);
3860 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
3861 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
3862 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
3863 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
3865 TRACE("(%p %p)\n", this, loc);
3866 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(loc));
3869 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
3870 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
3871 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
3872 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
3874 TRACE("(%p %p)\n", this, loc);
3875 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(loc));
3878 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3879 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3880 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3881 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3882 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
3883 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
3885 int state = 0;
3887 if(!(mode & OPENMODE_in))
3888 state |= STRINGBUF_no_read;
3890 if(!(mode & OPENMODE_out))
3891 state |= STRINGBUF_no_write;
3893 if(mode & OPENMODE_ate)
3894 state |= STRINGBUF_at_end;
3896 if(mode & OPENMODE_app)
3897 state |= STRINGBUF_append;
3899 return state;
3902 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
3903 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
3904 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
3905 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, size_t count, int state)
3907 TRACE("(%p, %p, %Iu, %d)\n", this, str, count, state);
3909 basic_streambuf_char__Init_empty(&this->base);
3911 this->state = state;
3912 this->seekhigh = NULL;
3914 if(count && str) {
3915 char *buf = MSVCRT_operator_new(count);
3916 if(!buf) {
3917 ERR("Out of memory\n");
3918 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3921 memcpy(buf, str, count);
3922 this->seekhigh = buf + count;
3924 this->state |= STRINGBUF_allocated;
3926 if(!(state & STRINGBUF_no_read))
3927 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
3929 if(!(state & STRINGBUF_no_write)) {
3930 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3932 if(!basic_streambuf_char_gptr(&this->base))
3933 basic_streambuf_char_setg(&this->base, buf, 0, buf);
3938 /* ??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 */
3939 /* ??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 */
3940 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
3941 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
3942 const basic_string_char *str, IOSB_openmode mode)
3944 TRACE("(%p %p %d)\n", this, str, mode);
3946 basic_streambuf_char_ctor(&this->base);
3947 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3949 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
3950 str->size, basic_stringbuf_char__Getstate(this, mode));
3951 return this;
3954 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
3955 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
3956 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
3957 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
3958 basic_stringbuf_char *this, IOSB_openmode mode)
3960 TRACE("(%p %d)\n", this, mode);
3962 basic_streambuf_char_ctor(&this->base);
3963 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3965 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
3966 return this;
3969 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
3970 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
3971 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
3972 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
3974 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
3977 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
3978 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
3979 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
3980 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
3982 TRACE("(%p)\n", this);
3984 if(this->state & STRINGBUF_allocated) {
3985 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
3986 this->seekhigh = NULL;
3987 this->state &= ~STRINGBUF_allocated;
3990 basic_streambuf_char__Init_empty(&this->base);
3993 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
3994 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
3995 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
3996 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
3998 TRACE("(%p)\n", this);
4000 basic_stringbuf_char__Tidy(this);
4001 basic_streambuf_char_dtor(&this->base);
4004 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
4005 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
4007 TRACE("(%p %x)\n", this, flags);
4009 if(flags & 2) {
4010 /* we have an array, with the number of elements stored before the first object */
4011 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4013 for (i = *ptr - 1; i >= 0; i--)
4014 basic_stringbuf_char_dtor(this+i);
4016 MSVCRT_operator_delete(ptr);
4017 }else {
4018 basic_stringbuf_char_dtor(this);
4020 if(flags & 1)
4021 MSVCRT_operator_delete(this);
4024 return this;
4027 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4028 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4029 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
4030 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
4032 size_t oldsize, size;
4033 char *ptr, *buf;
4035 TRACE("(%p %x)\n", this, meta);
4037 if(meta == EOF)
4038 return !EOF;
4039 if(this->state & STRINGBUF_no_write)
4040 return EOF;
4042 ptr = basic_streambuf_char_pptr(&this->base);
4043 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4044 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
4045 this->seekhigh, basic_streambuf_char_epptr(&this->base));
4047 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
4048 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4050 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
4051 size = oldsize|0xf;
4052 size += size/2;
4053 buf = MSVCRT_operator_new(size);
4054 if(!buf) {
4055 ERR("Out of memory\n");
4056 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4059 if(!oldsize) {
4060 this->seekhigh = buf;
4061 basic_streambuf_char_setp(&this->base, buf, buf+size);
4062 if(this->state & STRINGBUF_no_read)
4063 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4064 else
4065 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
4067 this->state |= STRINGBUF_allocated;
4068 }else {
4069 ptr = basic_streambuf_char_eback(&this->base);
4070 memcpy(buf, ptr, oldsize);
4072 this->seekhigh = buf+(this->seekhigh-ptr);
4073 basic_streambuf_char_setp_next(&this->base, buf,
4074 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
4075 if(this->state & STRINGBUF_no_read)
4076 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4077 else
4078 basic_streambuf_char_setg(&this->base, buf,
4079 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
4080 basic_streambuf_char_pptr(&this->base)+1);
4082 MSVCRT_operator_delete(ptr);
4085 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4088 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4089 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4090 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
4091 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
4093 char *cur;
4095 TRACE("(%p %x)\n", this, c);
4097 cur = basic_streambuf_char_gptr(&this->base);
4098 if(!cur || cur==basic_streambuf_char_eback(&this->base)
4099 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4100 return EOF;
4102 if(c != EOF)
4103 cur[-1] = c;
4104 basic_streambuf_char_gbump(&this->base, -1);
4105 return c==EOF ? !EOF : c;
4108 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
4109 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
4110 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
4111 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
4113 char *ptr, *cur;
4115 TRACE("(%p)\n", this);
4117 cur = basic_streambuf_char_gptr(&this->base);
4118 if(!cur || this->state&STRINGBUF_no_read)
4119 return EOF;
4121 ptr = basic_streambuf_char_pptr(&this->base);
4122 if(this->seekhigh < ptr)
4123 this->seekhigh = ptr;
4125 ptr = basic_streambuf_char_egptr(&this->base);
4126 if(this->seekhigh > ptr)
4127 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
4129 if(cur < this->seekhigh)
4130 return (unsigned char)*cur;
4131 return EOF;
4134 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4135 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4136 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4137 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4138 #if STREAMOFF_BITS == 64
4139 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
4140 #else
4141 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
4142 #endif
4143 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
4144 fpos_int *ret, streamoff off, int way, int mode)
4146 char *beg, *cur_r, *cur_w;
4148 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4150 cur_w = basic_streambuf_char_pptr(&this->base);
4151 if(cur_w > this->seekhigh)
4152 this->seekhigh = cur_w;
4154 ret->off = 0;
4155 ret->pos = 0;
4156 ret->state = 0;
4158 beg = basic_streambuf_char_eback(&this->base);
4159 cur_r = basic_streambuf_char_gptr(&this->base);
4160 if((mode & OPENMODE_in) && cur_r) {
4161 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4162 off += cur_r-beg;
4163 else if(way == SEEKDIR_end)
4164 off += this->seekhigh-beg;
4165 else if(way != SEEKDIR_beg)
4166 off = -1;
4168 if(off<0 || off>this->seekhigh-beg) {
4169 off = -1;
4170 }else {
4171 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
4172 if((mode & OPENMODE_out) && cur_w) {
4173 basic_streambuf_char_setp_next(&this->base, beg,
4174 basic_streambuf_char_gptr(&this->base),
4175 basic_streambuf_char_epptr(&this->base));
4178 }else if((mode & OPENMODE_out) && cur_w) {
4179 if(way == SEEKDIR_cur)
4180 off += cur_w-beg;
4181 else if(way == SEEKDIR_end)
4182 off += this->seekhigh-beg;
4183 else if(way != SEEKDIR_beg)
4184 off = -1;
4186 if(off<0 || off>this->seekhigh-beg)
4187 off = -1;
4188 else
4189 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
4190 }else {
4191 off = -1;
4194 ret->off = off;
4195 return ret;
4198 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4199 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4200 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
4201 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
4202 fpos_int *ret, fpos_int pos, int mode)
4204 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4206 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4207 *ret = pos;
4208 return ret;
4211 return basic_stringbuf_char_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4214 /* ?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 */
4215 /* ?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 */
4216 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
4217 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
4219 TRACE("(%p %p)\n", this, str);
4221 basic_stringbuf_char__Tidy(this);
4222 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
4225 /* ?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 */
4226 /* ?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 */
4227 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
4228 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
4230 char *ptr;
4232 TRACE("(%p)\n", this);
4234 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
4235 char *pptr;
4237 ptr = basic_streambuf_char_pbase(&this->base);
4238 pptr = basic_streambuf_char_pptr(&this->base);
4240 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4243 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
4244 ptr = basic_streambuf_char_eback(&this->base);
4245 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
4248 return MSVCP_basic_string_char_ctor(ret);
4251 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
4252 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
4253 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4254 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4255 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4256 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4257 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
4258 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
4260 int state = 0;
4262 if(!(mode & OPENMODE_in))
4263 state |= STRINGBUF_no_read;
4265 if(!(mode & OPENMODE_out))
4266 state |= STRINGBUF_no_write;
4268 if(mode & OPENMODE_ate)
4269 state |= STRINGBUF_at_end;
4271 if(mode & OPENMODE_app)
4272 state |= STRINGBUF_append;
4274 return state;
4277 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
4278 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
4279 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
4280 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
4281 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
4282 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, size_t count, int state)
4284 TRACE("(%p, %p, %Iu, %d)\n", this, str, count, state);
4286 basic_streambuf_wchar__Init_empty(&this->base);
4288 this->state = state;
4289 this->seekhigh = NULL;
4291 if(count && str) {
4292 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
4293 if(!buf) {
4294 ERR("Out of memory\n");
4295 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4298 memcpy(buf, str, count*sizeof(wchar_t));
4299 this->seekhigh = buf + count;
4301 this->state |= STRINGBUF_allocated;
4303 if(!(state & STRINGBUF_no_read))
4304 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
4306 if(!(state & STRINGBUF_no_write)) {
4307 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4309 if(!basic_streambuf_wchar_gptr(&this->base))
4310 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
4315 /* ??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 */
4316 /* ??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 */
4317 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
4318 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
4319 const basic_string_wchar *str, IOSB_openmode mode)
4321 TRACE("(%p %p %d)\n", this, str, mode);
4323 basic_streambuf_wchar_ctor(&this->base);
4324 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4326 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
4327 str->size, basic_stringbuf_wchar__Getstate(this, mode));
4328 return this;
4331 /* ??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 */
4332 /* ??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 */
4333 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
4334 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
4335 const basic_string_wchar *str, IOSB_openmode mode)
4337 basic_stringbuf_wchar_ctor_str(this, str, mode);
4338 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4339 return this;
4342 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4343 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4344 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4345 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4346 basic_stringbuf_wchar *this, IOSB_openmode mode)
4348 TRACE("(%p %d)\n", this, mode);
4350 basic_streambuf_wchar_ctor(&this->base);
4351 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4353 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4354 return this;
4357 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4358 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4359 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4360 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4361 basic_stringbuf_wchar *this, IOSB_openmode mode)
4363 basic_stringbuf_wchar_ctor_mode(this, mode);
4364 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4365 return this;
4368 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4369 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4370 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4371 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4373 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4376 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4377 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4378 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4379 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4381 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4384 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4385 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4386 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4387 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4388 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4389 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4391 TRACE("(%p)\n", this);
4393 if(this->state & STRINGBUF_allocated) {
4394 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4395 this->seekhigh = NULL;
4396 this->state &= ~STRINGBUF_allocated;
4399 basic_streambuf_wchar__Init_empty(&this->base);
4402 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4403 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4404 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4405 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4406 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4407 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4409 TRACE("(%p)\n", this);
4411 basic_stringbuf_wchar__Tidy(this);
4412 basic_streambuf_wchar_dtor(&this->base);
4415 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4416 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4418 TRACE("(%p %x)\n", this, flags);
4420 if(flags & 2) {
4421 /* we have an array, with the number of elements stored before the first object */
4422 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4424 for (i = *ptr - 1; i >= 0; i--)
4425 basic_stringbuf_wchar_dtor(this+i);
4427 MSVCRT_operator_delete(ptr);
4428 }else {
4429 basic_stringbuf_wchar_dtor(this);
4431 if(flags & 1)
4432 MSVCRT_operator_delete(this);
4435 return this;
4438 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4439 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4440 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4441 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4442 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4443 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4445 size_t oldsize, size;
4446 wchar_t *ptr, *buf;
4448 TRACE("(%p %x)\n", this, meta);
4450 if(meta == WEOF)
4451 return !WEOF;
4452 if(this->state & STRINGBUF_no_write)
4453 return WEOF;
4455 ptr = basic_streambuf_wchar_pptr(&this->base);
4456 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4457 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4458 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4460 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4461 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4463 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4464 size = oldsize|0xf;
4465 size += size/2;
4466 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4467 if(!buf) {
4468 ERR("Out of memory\n");
4469 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4472 if(!oldsize) {
4473 this->seekhigh = buf;
4474 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4475 if(this->state & STRINGBUF_no_read)
4476 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4477 else
4478 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4480 this->state |= STRINGBUF_allocated;
4481 }else {
4482 ptr = basic_streambuf_wchar_eback(&this->base);
4483 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4485 this->seekhigh = buf+(this->seekhigh-ptr);
4486 basic_streambuf_wchar_setp_next(&this->base, buf,
4487 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4488 if(this->state & STRINGBUF_no_read)
4489 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4490 else
4491 basic_streambuf_wchar_setg(&this->base, buf,
4492 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4493 basic_streambuf_wchar_pptr(&this->base)+1);
4495 MSVCRT_operator_delete(ptr);
4498 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4501 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4502 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4503 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4504 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4505 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4506 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4508 wchar_t *cur;
4510 TRACE("(%p %x)\n", this, c);
4512 cur = basic_streambuf_wchar_gptr(&this->base);
4513 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4514 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4515 return WEOF;
4517 if(c != WEOF)
4518 cur[-1] = c;
4519 basic_streambuf_wchar_gbump(&this->base, -1);
4520 return c==WEOF ? !WEOF : c;
4523 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4524 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4525 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4526 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4527 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4528 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4530 wchar_t *ptr, *cur;
4532 TRACE("(%p)\n", this);
4534 cur = basic_streambuf_wchar_gptr(&this->base);
4535 if(!cur || this->state&STRINGBUF_no_read)
4536 return WEOF;
4538 ptr = basic_streambuf_wchar_pptr(&this->base);
4539 if(this->seekhigh < ptr)
4540 this->seekhigh = ptr;
4542 ptr = basic_streambuf_wchar_egptr(&this->base);
4543 if(this->seekhigh > ptr)
4544 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4546 if(cur < this->seekhigh)
4547 return *cur;
4548 return WEOF;
4551 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4552 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4553 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4554 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4555 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4556 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4557 #if STREAMOFF_BITS == 64
4558 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4559 #else
4560 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4561 #endif
4562 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4563 fpos_int *ret, streamoff off, int way, int mode)
4565 wchar_t *beg, *cur_r, *cur_w;
4567 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4569 cur_w = basic_streambuf_wchar_pptr(&this->base);
4570 if(cur_w > this->seekhigh)
4571 this->seekhigh = cur_w;
4573 ret->off = 0;
4574 ret->pos = 0;
4575 ret->state = 0;
4577 beg = basic_streambuf_wchar_eback(&this->base);
4578 cur_r = basic_streambuf_wchar_gptr(&this->base);
4579 if((mode & OPENMODE_in) && cur_r) {
4580 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4581 off += cur_r-beg;
4582 else if(way == SEEKDIR_end)
4583 off += this->seekhigh-beg;
4584 else if(way != SEEKDIR_beg)
4585 off = -1;
4587 if(off<0 || off>this->seekhigh-beg) {
4588 off = -1;
4589 }else {
4590 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4591 if((mode & OPENMODE_out) && cur_w) {
4592 basic_streambuf_wchar_setp_next(&this->base, beg,
4593 basic_streambuf_wchar_gptr(&this->base),
4594 basic_streambuf_wchar_epptr(&this->base));
4597 }else if((mode & OPENMODE_out) && cur_w) {
4598 if(way == SEEKDIR_cur)
4599 off += cur_w-beg;
4600 else if(way == SEEKDIR_end)
4601 off += this->seekhigh-beg;
4602 else if(way != SEEKDIR_beg)
4603 off = -1;
4605 if(off<0 || off>this->seekhigh-beg)
4606 off = -1;
4607 else
4608 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4609 }else {
4610 off = -1;
4613 ret->off = off;
4614 return ret;
4617 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4618 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4619 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4620 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4621 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4622 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4623 fpos_int *ret, fpos_int pos, int mode)
4625 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4627 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4628 *ret = pos;
4629 return ret;
4632 return basic_stringbuf_wchar_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4635 /* ?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 */
4636 /* ?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 */
4637 /* ?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 */
4638 /* ?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 */
4639 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4640 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4642 TRACE("(%p %p)\n", this, str);
4644 basic_stringbuf_wchar__Tidy(this);
4645 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
4648 /* ?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 */
4649 /* ?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 */
4650 /* ?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 */
4651 /* ?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 */
4652 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
4653 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
4655 wchar_t *ptr;
4657 TRACE("(%p)\n", this);
4659 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
4660 wchar_t *pptr;
4662 ptr = basic_streambuf_wchar_pbase(&this->base);
4663 pptr = basic_streambuf_wchar_pptr(&this->base);
4665 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4668 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
4669 ptr = basic_streambuf_wchar_eback(&this->base);
4670 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
4673 return MSVCP_basic_string_wchar_ctor(ret);
4676 /* ??0ios_base@std@@IAE@XZ */
4677 /* ??0ios_base@std@@IEAA@XZ */
4678 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
4679 ios_base* __thiscall ios_base_ctor(ios_base *this)
4681 TRACE("(%p)\n", this);
4682 this->vtable = &MSVCP_ios_base_vtable;
4683 locale_ctor_uninitialized(IOS_LOCALE(this), 0);
4684 return this;
4687 /* ??0ios_base@std@@QAE@ABV01@@Z */
4688 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
4689 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
4690 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
4692 TRACE("(%p %p)\n", this, copy);
4693 *this = *copy;
4694 this->vtable = &MSVCP_ios_base_vtable;
4695 return this;
4698 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
4699 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
4700 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
4701 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
4703 IOS_BASE_fnarray *cur;
4705 TRACE("(%p %x)\n", this, event);
4707 for(cur=this->calls; cur; cur=cur->next)
4708 cur->event_handler(event, this, cur->index);
4711 /* ?_Tidy@ios_base@std@@AAAXXZ */
4712 /* ?_Tidy@ios_base@std@@AEAAXXZ */
4713 void __cdecl ios_base_Tidy(ios_base *this)
4715 IOS_BASE_iosarray *arr_cur, *arr_next;
4716 IOS_BASE_fnarray *event_cur, *event_next;
4718 TRACE("(%p)\n", this);
4720 ios_base_Callfns(this, EVENT_erase_event);
4722 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
4723 arr_next = arr_cur->next;
4724 MSVCRT_operator_delete(arr_cur);
4726 this->arr = NULL;
4728 for(event_cur=this->calls; event_cur; event_cur=event_next) {
4729 event_next = event_cur->next;
4730 MSVCRT_operator_delete(event_cur);
4732 this->calls = NULL;
4735 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
4736 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
4737 void __cdecl ios_base_Ios_base_dtor(ios_base *obj)
4739 TRACE("(%p)\n", obj);
4740 locale_dtor(IOS_LOCALE(obj));
4741 #if _MSVCP_VER >= 70
4742 MSVCRT_operator_delete(obj->loc);
4743 #endif
4744 ios_base_Tidy(obj);
4747 /* ??1ios_base@std@@UAE@XZ */
4748 /* ??1ios_base@std@@UEAA@XZ */
4749 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
4750 void __thiscall ios_base_dtor(ios_base *this)
4752 ios_base_Ios_base_dtor(this);
4755 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
4756 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
4758 TRACE("(%p %x)\n", this, flags);
4759 if(flags & 2) {
4760 /* we have an array, with the number of elements stored before the first object */
4761 INT_PTR i, *ptr = (INT_PTR *)this-1;
4763 for(i=*ptr-1; i>=0; i--)
4764 ios_base_dtor(this+i);
4765 MSVCRT_operator_delete(ptr);
4766 } else {
4767 ios_base_dtor(this);
4768 if(flags & 1)
4769 MSVCRT_operator_delete(this);
4772 return this;
4775 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
4776 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
4778 TRACE("(%p %x)\n", this, flags);
4779 if(flags & 2) {
4780 INT_PTR *ptr = (INT_PTR *)this-1;
4781 MSVCRT_operator_delete(ptr);
4782 } else {
4783 if(flags & 1)
4784 MSVCRT_operator_delete(this);
4787 return this;
4790 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
4791 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
4792 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
4793 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
4795 IOS_BASE_iosarray *p;
4797 TRACE("(%p %d)\n", this, index);
4799 for(p=this->arr; p; p=p->next) {
4800 if(p->index == index)
4801 return p;
4804 for(p=this->arr; p; p=p->next) {
4805 if(!p->long_val && !p->ptr_val) {
4806 p->index = index;
4807 return p;
4811 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
4812 p->next = this->arr;
4813 p->index = index;
4814 p->long_val = 0;
4815 p->ptr_val = NULL;
4816 this->arr = p;
4817 return p;
4820 /* ?iword@ios_base@std@@QAEAAJH@Z */
4821 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
4822 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
4823 LONG* __thiscall ios_base_iword(ios_base *this, int index)
4825 TRACE("(%p %d)\n", this, index);
4826 return &ios_base_Findarr(this, index)->long_val;
4829 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
4830 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
4831 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
4832 void** __thiscall ios_base_pword(ios_base *this, int index)
4834 TRACE("(%p %d)\n", this, index);
4835 return &ios_base_Findarr(this, index)->ptr_val;
4838 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
4839 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
4840 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
4841 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
4843 IOS_BASE_fnarray *event;
4845 TRACE("(%p %p %d)\n", this, callback, index);
4847 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
4848 event->next = this->calls;
4849 event->index = index;
4850 event->event_handler = callback;
4851 this->calls = event;
4854 /* ?clear@ios_base@std@@QAEXH_N@Z */
4855 /* ?clear@ios_base@std@@QEAAXH_N@Z */
4856 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
4857 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, bool reraise)
4859 TRACE("(%p %x %x)\n", this, state, reraise);
4861 this->state = state & IOSTATE_mask;
4862 if(!(this->state & this->except))
4863 return;
4865 if(reraise)
4866 throw_exception(EXCEPTION_RERAISE, NULL);
4867 else if(this->state & this->except & IOSTATE_eofbit)
4868 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
4869 else if(this->state & this->except & IOSTATE_failbit)
4870 throw_exception(EXCEPTION_FAILURE, "failbit is set");
4871 else if(this->state & this->except & IOSTATE_badbit)
4872 throw_exception(EXCEPTION_FAILURE, "badbit is set");
4873 else if(this->state & this->except & IOSTATE__Hardfail)
4874 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
4877 /* ?clear@ios_base@std@@QAEXH@Z */
4878 /* ?clear@ios_base@std@@QEAAXH@Z */
4879 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
4880 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
4882 ios_base_clear_reraise(this, state, FALSE);
4885 /* ?clear@ios_base@std@@QAEXI@Z */
4886 /* ?clear@ios_base@std@@QEAAXI@Z */
4887 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
4888 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
4890 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
4893 /* ?exceptions@ios_base@std@@QAEXH@Z */
4894 /* ?exceptions@ios_base@std@@QEAAXH@Z */
4895 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
4896 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
4898 TRACE("(%p %x)\n", this, state);
4899 this->except = state & IOSTATE_mask;
4900 ios_base_clear(this, this->state);
4903 /* ?exceptions@ios_base@std@@QAEXI@Z */
4904 /* ?exceptions@ios_base@std@@QEAAXI@Z */
4905 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
4906 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
4908 TRACE("(%p %x)\n", this, state);
4909 ios_base_exceptions_set(this, state);
4912 /* ?exceptions@ios_base@std@@QBEHXZ */
4913 /* ?exceptions@ios_base@std@@QEBAHXZ */
4914 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
4915 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
4917 TRACE("(%p)\n", this);
4918 return this->except;
4921 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
4922 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
4923 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
4924 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
4926 TRACE("(%p %p)\n", this, rhs);
4928 if(this != rhs) {
4929 IOS_BASE_iosarray *arr_cur;
4930 IOS_BASE_fnarray *event_cur;
4932 ios_base_Tidy(this);
4934 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
4935 if(arr_cur->long_val)
4936 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
4937 if(arr_cur->ptr_val)
4938 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
4940 this->stdstr = rhs->stdstr;
4941 this->fmtfl = rhs->fmtfl;
4942 this->prec = rhs->prec;
4943 this->wide = rhs->wide;
4944 locale_operator_assign(IOS_LOCALE(this), IOS_LOCALE(rhs));
4946 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
4947 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
4949 ios_base_Callfns(this, EVENT_copyfmt_event);
4950 ios_base_exceptions_set(this, rhs->except);
4953 return this;
4956 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
4957 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
4958 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
4959 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
4961 TRACE("(%p %p)\n", this, right);
4963 if(this != right) {
4964 this->state = right->state;
4965 ios_base_copyfmt(this, right);
4968 return this;
4971 /* ?fail@ios_base@std@@QBE_NXZ */
4972 /* ?fail@ios_base@std@@QEBA_NXZ */
4973 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
4974 bool __thiscall ios_base_fail(const ios_base *this)
4976 TRACE("(%p)\n", this);
4977 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
4980 /* ??7ios_base@std@@QBE_NXZ */
4981 /* ??7ios_base@std@@QEBA_NXZ */
4982 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
4983 bool __thiscall ios_base_op_succ(const ios_base *this)
4985 TRACE("(%p)\n", this);
4986 return ios_base_fail(this);
4989 /* ??Bios_base@std@@QBEPAXXZ */
4990 /* ??Bios_base@std@@QEBAPEAXXZ */
4991 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
4992 void* __thiscall ios_base_op_fail(const ios_base *this)
4994 TRACE("(%p)\n", this);
4995 return ios_base_fail(this) ? NULL : (void*)this;
4998 /* ??Bios_base@std@@QBA_NXZ */
4999 /* ??Bios_base@std@@QBE_NXZ */
5000 /* ??Bios_base@std@@QEBA_NXZ */
5001 DEFINE_THISCALL_WRAPPER(ios_base_operator_bool, 4)
5002 bool __thiscall ios_base_operator_bool(const ios_base *this)
5004 TRACE("(%p)\n", this);
5005 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) == 0;
5008 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
5009 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
5010 void __cdecl ios_base_Addstd(ios_base *add)
5012 FIXME("(%p) stub\n", add);
5015 /* ?_Index_func@ios_base@std@@CAAAHXZ */
5016 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
5017 int* __cdecl ios_base_Index_func(void)
5019 TRACE("\n");
5020 return &ios_base_Index;
5023 /* ?_Init@ios_base@std@@IAEXXZ */
5024 /* ?_Init@ios_base@std@@IEAAXXZ */
5025 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
5026 void __thiscall ios_base__Init(ios_base *this)
5028 TRACE("(%p)\n", this);
5030 this->stdstr = 0;
5031 this->state = this->except = IOSTATE_goodbit;
5032 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
5033 this->prec = 6;
5034 this->wide = 0;
5035 this->arr = NULL;
5036 this->calls = NULL;
5037 #if _MSVCP_VER >= 70
5038 this->loc = MSVCRT_operator_new(sizeof(locale));
5039 #endif
5040 locale_ctor(IOS_LOCALE(this));
5043 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
5044 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
5045 bool* __cdecl ios_base_Sync_func(void)
5047 TRACE("\n");
5048 return &ios_base_Sync;
5051 /* ?bad@ios_base@std@@QBE_NXZ */
5052 /* ?bad@ios_base@std@@QEBA_NXZ */
5053 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
5054 bool __thiscall ios_base_bad(const ios_base *this)
5056 TRACE("(%p)\n", this);
5057 return (this->state & IOSTATE_badbit) != 0;
5060 /* ?eof@ios_base@std@@QBE_NXZ */
5061 /* ?eof@ios_base@std@@QEBA_NXZ */
5062 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
5063 bool __thiscall ios_base_eof(const ios_base *this)
5065 TRACE("(%p)\n", this);
5066 return (this->state & IOSTATE_eofbit) != 0;
5069 /* ?flags@ios_base@std@@QAEHH@Z */
5070 /* ?flags@ios_base@std@@QEAAHH@Z */
5071 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
5072 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
5074 IOSB_fmtflags ret = this->fmtfl;
5076 TRACE("(%p %x)\n", this, flags);
5078 this->fmtfl = flags & FMTFLAG_mask;
5079 return ret;
5082 /* ?flags@ios_base@std@@QBEHXZ */
5083 /* ?flags@ios_base@std@@QEBAHXZ */
5084 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
5085 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
5087 TRACE("(%p)\n", this);
5088 return this->fmtfl;
5091 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
5092 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
5093 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
5094 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
5096 TRACE("(%p)\n", this);
5097 return locale_copy_ctor(ret, IOS_LOCALE(this));
5100 /* ?good@ios_base@std@@QBE_NXZ */
5101 /* ?good@ios_base@std@@QEBA_NXZ */
5102 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
5103 bool __thiscall ios_base_good(const ios_base *this)
5105 TRACE("(%p)\n", this);
5106 return this->state == IOSTATE_goodbit;
5109 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
5110 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
5111 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
5112 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
5114 TRACE("(%p %p)\n", this, loc);
5115 *ret = *IOS_LOCALE(this);
5116 locale_copy_ctor(IOS_LOCALE(this), loc);
5117 return ret;
5120 /* ?precision@ios_base@std@@QAEHH@Z */
5121 /* ?precision@ios_base@std@@QEAA_J_J@Z */
5122 #if STREAMSIZE_BITS == 64
5123 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
5124 #else
5125 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
5126 #endif
5127 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
5129 streamsize ret = this->prec;
5131 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
5133 this->prec = precision;
5134 return ret;
5137 /* ?precision@ios_base@std@@QBEHXZ */
5138 /* ?precision@ios_base@std@@QEBA_JXZ */
5139 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
5140 streamsize __thiscall ios_base_precision_get(const ios_base *this)
5142 TRACE("(%p)\n", this);
5143 return this->prec;
5146 /* ?rdstate@ios_base@std@@QBEHXZ */
5147 /* ?rdstate@ios_base@std@@QEBAHXZ */
5148 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
5149 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
5151 TRACE("(%p)\n", this);
5152 return this->state;
5155 /* ?setf@ios_base@std@@QAEHHH@Z */
5156 /* ?setf@ios_base@std@@QEAAHHH@Z */
5157 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
5158 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
5160 IOSB_fmtflags ret = this->fmtfl;
5162 TRACE("(%p %x %x)\n", this, flags, mask);
5164 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
5165 return ret;
5168 /* ?setf@ios_base@std@@QAEHH@Z */
5169 /* ?setf@ios_base@std@@QEAAHH@Z */
5170 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
5171 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
5173 IOSB_fmtflags ret = this->fmtfl;
5175 TRACE("(%p %x)\n", this, flags);
5177 this->fmtfl |= flags & FMTFLAG_mask;
5178 return ret;
5181 /* ?setstate@ios_base@std@@QAEXH_N@Z */
5182 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
5183 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
5184 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, bool reraise)
5186 TRACE("(%p %x %x)\n", this, state, reraise);
5188 if(state != IOSTATE_goodbit)
5189 ios_base_clear_reraise(this, this->state | state, reraise);
5192 /* ?setstate@ios_base@std@@QAEXH@Z */
5193 /* ?setstate@ios_base@std@@QEAAXH@Z */
5194 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
5195 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
5197 ios_base_setstate_reraise(this, state, FALSE);
5200 /* ?setstate@ios_base@std@@QAEXI@Z */
5201 /* ?setstate@ios_base@std@@QEAAXI@Z */
5202 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
5203 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
5205 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5208 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
5209 bool __cdecl ios_base_sync_with_stdio(bool sync)
5211 _Lockit lock;
5212 bool ret;
5214 TRACE("(%x)\n", sync);
5216 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5217 ret = ios_base_Sync;
5218 ios_base_Sync = sync;
5219 _Lockit_dtor(&lock);
5220 return ret;
5223 /* ?unsetf@ios_base@std@@QAEXH@Z */
5224 /* ?unsetf@ios_base@std@@QEAAXH@Z */
5225 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
5226 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
5228 TRACE("(%p %x)\n", this, flags);
5229 this->fmtfl &= ~flags;
5232 /* ?width@ios_base@std@@QAEHH@Z */
5233 /* ?width@ios_base@std@@QEAA_J_J@Z */
5234 #if STREAMSIZE_BITS == 64
5235 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
5236 #else
5237 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
5238 #endif
5239 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
5241 streamsize ret = this->wide;
5243 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
5245 this->wide = width;
5246 return ret;
5249 /* ?width@ios_base@std@@QBEHXZ */
5250 /* ?width@ios_base@std@@QEBA_JXZ */
5251 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
5252 streamsize __thiscall ios_base_width_get(ios_base *this)
5254 TRACE("(%p)\n", this);
5255 return this->wide;
5258 /* ?xalloc@ios_base@std@@SAHXZ */
5259 int __cdecl ios_base_xalloc(void)
5261 _Lockit lock;
5262 int ret;
5264 TRACE("\n");
5266 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5267 ret = ios_base_Index++;
5268 _Lockit_dtor(&lock);
5269 return ret;
5272 /* ?swap@ios_base@std@@QAEXAAV12@@Z */
5273 /* ?swap@ios_base@std@@QEAAXAEAV12@@Z */
5274 DEFINE_THISCALL_WRAPPER(ios_base_swap, 8)
5275 void __thiscall ios_base_swap(ios_base *this, ios_base *r)
5277 ios_base tmp;
5279 TRACE("(%p %p)\n", this, r);
5281 if(this == r)
5282 return;
5284 tmp = *this;
5285 *this = *r;
5286 this->vtable = tmp.vtable;
5287 tmp.vtable = r->vtable;
5288 *r = tmp;
5291 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
5292 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
5293 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
5294 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
5296 TRACE("(%p)\n", this);
5298 ios_base_ctor(&this->base);
5299 this->base.vtable = &MSVCP_basic_ios_char_vtable;
5300 return this;
5303 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5304 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5305 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
5306 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, bool isstd)
5308 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5309 ios_base__Init(&this->base);
5310 this->strbuf = streambuf;
5311 this->stream = NULL;
5312 this->fillch = ' ';
5314 if(!streambuf)
5315 ios_base_setstate(&this->base, IOSTATE_badbit);
5317 if(isstd)
5318 FIXME("standard streams not handled yet\n");
5321 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5322 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5323 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
5324 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
5326 TRACE("(%p %p)\n", this, strbuf);
5328 basic_ios_char_ctor(this);
5329 basic_ios_char_init(this, strbuf, FALSE);
5330 return this;
5333 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
5334 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5335 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
5336 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
5338 TRACE("(%p)\n", this);
5339 ios_base_dtor(&this->base);
5342 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
5343 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
5345 TRACE("(%p %x)\n", this, flags);
5346 if(flags & 2) {
5347 /* we have an array, with the number of elements stored before the first object */
5348 INT_PTR i, *ptr = (INT_PTR *)this-1;
5350 for(i=*ptr-1; i>=0; i--)
5351 basic_ios_char_dtor(this+i);
5352 MSVCRT_operator_delete(ptr);
5353 } else {
5354 basic_ios_char_dtor(this);
5355 if(flags & 1)
5356 MSVCRT_operator_delete(this);
5359 return this;
5362 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5363 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5364 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5365 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, bool reraise)
5367 TRACE("(%p %x %x)\n", this, state, reraise);
5368 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5371 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5372 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5373 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5374 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5376 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5379 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5380 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5381 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5382 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5384 TRACE("(%p %p)\n", this, copy);
5385 if(this == copy)
5386 return this;
5388 this->stream = copy->stream;
5389 this->fillch = copy->fillch;
5390 ios_base_copyfmt(&this->base, &copy->base);
5391 return this;
5394 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5395 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5396 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5397 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5399 char ret = this->fillch;
5401 TRACE("(%p %c)\n", this, fill);
5403 this->fillch = fill;
5404 return ret;
5407 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5408 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5409 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5410 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5412 TRACE("(%p)\n", this);
5413 return this->fillch;
5416 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5417 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5418 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5419 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5421 TRACE("(%p %p %p)\n", this, ret, loc);
5423 if(this->strbuf) {
5424 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5425 locale_dtor(ret);
5428 return ios_base_imbue(&this->base, ret, loc);
5431 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5432 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5433 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5434 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5436 TRACE("(%p %c %c)\n", this, ch, def);
5437 return ctype_char_narrow_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5440 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5441 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5442 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5443 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5445 basic_streambuf_char *ret = this->strbuf;
5447 TRACE("(%p %p)\n", this, streambuf);
5449 this->strbuf = streambuf;
5450 basic_ios_char_clear(this, IOSTATE_goodbit);
5451 return ret;
5454 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5455 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5456 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5457 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5459 TRACE("(%p)\n", this);
5460 return this->strbuf;
5463 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5464 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5465 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5466 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, bool reraise)
5468 TRACE("(%p %x %x)\n", this, state, reraise);
5470 if(state != IOSTATE_goodbit)
5471 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5474 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5475 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5476 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5477 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5479 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5482 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5483 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5484 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5485 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5487 basic_ostream_char *ret = this->stream;
5489 TRACE("(%p %p)\n", this, ostream);
5491 this->stream = ostream;
5492 return ret;
5495 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5496 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5497 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5498 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5500 TRACE("(%p)\n", this);
5501 return this->stream;
5504 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5505 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5506 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5507 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5509 TRACE("(%p %c)\n", this, ch);
5510 return ctype_char_widen_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch);
5513 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
5514 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
5515 DEFINE_THISCALL_WRAPPER(basic_ios_char_swap, 8)
5516 void __thiscall basic_ios_char_swap(basic_ios_char *this, basic_ios_char *r)
5518 void *swap_ptr;
5520 TRACE("(%p %p)\n", this, r);
5522 if(this == r)
5523 return;
5525 ios_base_swap(&this->base, &r->base);
5526 swap_ptr = this->stream;
5527 this->stream = r->stream;
5528 r->stream = swap_ptr;
5529 this->fillch ^= r->fillch;
5530 r->fillch ^= this->fillch;
5531 this->fillch ^= r->fillch;
5534 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5535 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5536 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5537 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5539 TRACE("(%p)\n", this);
5541 ios_base_ctor(&this->base);
5542 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5543 return this;
5546 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5547 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5548 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5549 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5551 basic_ios_wchar_ctor(this);
5552 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5553 return this;
5556 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5557 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5558 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5559 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5560 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5561 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, bool isstd)
5563 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5564 ios_base__Init(&this->base);
5565 this->strbuf = streambuf;
5566 this->stream = NULL;
5567 this->fillch = ' ';
5569 if(!streambuf)
5570 ios_base_setstate(&this->base, IOSTATE_badbit);
5572 if(isstd)
5573 FIXME("standard streams not handled yet\n");
5576 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5577 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5578 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
5579 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5581 TRACE("(%p %p)\n", this, strbuf);
5583 basic_ios_wchar_ctor(this);
5584 basic_ios_wchar_init(this, strbuf, FALSE);
5585 return this;
5588 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5589 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5590 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
5591 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5593 basic_ios_wchar_ctor_streambuf(this, strbuf);
5594 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5595 return this;
5598 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
5599 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
5600 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
5601 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
5602 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
5603 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
5605 TRACE("(%p)\n", this);
5606 ios_base_dtor(&this->base);
5609 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5610 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5612 TRACE("(%p %x)\n", this, flags);
5613 if(flags & 2) {
5614 /* we have an array, with the number of elements stored before the first object */
5615 INT_PTR i, *ptr = (INT_PTR *)this-1;
5617 for(i=*ptr-1; i>=0; i--)
5618 basic_ios_wchar_dtor(this+i);
5619 MSVCRT_operator_delete(ptr);
5620 } else {
5621 basic_ios_wchar_dtor(this);
5622 if(flags & 1)
5623 MSVCRT_operator_delete(this);
5626 return this;
5629 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5630 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5631 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5632 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5633 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5634 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, bool reraise)
5636 TRACE("(%p %x %x)\n", this, state, reraise);
5637 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5640 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5641 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5642 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5643 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5644 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
5645 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
5647 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
5650 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
5651 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5652 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
5653 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5654 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
5655 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
5657 TRACE("(%p %p)\n", this, copy);
5658 if(this == copy)
5659 return this;
5661 this->stream = copy->stream;
5662 this->fillch = copy->fillch;
5663 ios_base_copyfmt(&this->base, &copy->base);
5664 return this;
5667 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
5668 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
5669 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
5670 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
5671 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
5672 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
5674 wchar_t ret = this->fillch;
5676 TRACE("(%p %c)\n", this, fill);
5678 this->fillch = fill;
5679 return ret;
5682 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
5683 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
5684 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
5685 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
5686 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
5687 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
5689 TRACE("(%p)\n", this);
5690 return this->fillch;
5693 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5694 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5695 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5696 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5697 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
5698 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
5700 TRACE("(%p %p %p)\n", this, ret, loc);
5702 if(this->strbuf) {
5703 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
5704 locale_dtor(ret);
5707 return ios_base_imbue(&this->base, ret, loc);
5710 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
5711 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
5712 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
5713 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
5714 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
5715 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
5717 TRACE("(%p %c %c)\n", this, ch, def);
5718 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5721 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5722 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5723 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
5724 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5725 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
5726 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
5728 basic_streambuf_wchar *ret = this->strbuf;
5730 TRACE("(%p %p)\n", this, streambuf);
5732 this->strbuf = streambuf;
5733 basic_ios_wchar_clear(this, IOSTATE_goodbit);
5734 return ret;
5737 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5738 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5739 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5740 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5741 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
5742 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
5744 TRACE("(%p)\n", this);
5745 return this->strbuf;
5748 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5749 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5750 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5751 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5752 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
5753 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, bool reraise)
5755 TRACE("(%p %x %x)\n", this, state, reraise);
5757 if(state != IOSTATE_goodbit)
5758 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
5761 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5762 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5763 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5764 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5765 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
5766 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
5768 basic_ios_wchar_setstate_reraise(this, state, FALSE);
5771 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5772 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5773 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
5774 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5775 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
5776 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
5778 basic_ostream_wchar *ret = this->stream;
5780 TRACE("(%p %p)\n", this, ostream);
5782 this->stream = ostream;
5783 return ret;
5786 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5787 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5788 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5789 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5790 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
5791 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
5793 TRACE("(%p)\n", this);
5794 return this->stream;
5797 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
5798 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
5799 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
5800 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
5801 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
5802 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
5804 TRACE("(%p %c)\n", this, ch);
5805 return ctype_wchar_widen_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch);
5808 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
5809 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
5810 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
5811 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
5812 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_swap, 8)
5813 void __thiscall basic_ios_wchar_swap(basic_ios_wchar *this, basic_ios_wchar *r)
5815 void *swap_ptr;
5817 TRACE("(%p %p)\n", this, r);
5819 if(this == r)
5820 return;
5822 ios_base_swap(&this->base, &r->base);
5823 swap_ptr = this->stream;
5824 this->stream = r->stream;
5825 r->stream = swap_ptr;
5826 this->fillch ^= r->fillch;
5827 r->fillch ^= this->fillch;
5828 this->fillch ^= r->fillch;
5831 /* Caution: basic_ostream uses virtual inheritance.
5832 * All constructors have additional parameter that says if base class should be initialized.
5833 * Base class needs to be accessed using vbtable.
5835 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
5837 return (basic_ios_char*)((char*)this+this->vbtable[1]);
5840 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
5842 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
5845 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
5847 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
5850 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
5851 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
5852 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 20)
5853 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
5854 basic_streambuf_char *strbuf, bool isstd, bool init, bool virt_init)
5856 basic_ios_char *base;
5858 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, init, virt_init);
5860 if(virt_init) {
5861 this->vbtable = basic_ostream_char_vbtable;
5862 base = basic_ostream_char_get_basic_ios(this);
5863 basic_ios_char_ctor(base);
5864 }else {
5865 base = basic_ostream_char_get_basic_ios(this);
5868 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5869 if(init)
5870 basic_ios_char_init(base, strbuf, isstd);
5871 return this;
5874 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
5875 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
5876 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 12)
5877 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
5878 int uninitialized, bool virt_init)
5880 basic_ios_char *base;
5882 TRACE("(%p %d)\n", this, uninitialized);
5884 if(virt_init) {
5885 this->vbtable = basic_ostream_char_vbtable;
5886 base = basic_ostream_char_get_basic_ios(this);
5887 basic_ios_char_ctor(base);
5888 }else {
5889 base = basic_ostream_char_get_basic_ios(this);
5892 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5893 ios_base_Addstd(&base->base);
5894 return this;
5897 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5898 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5899 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
5900 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
5902 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5904 /* don't destroy virtual base here */
5905 TRACE("(%p)\n", this);
5908 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5909 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5910 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
5911 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
5913 TRACE("(%p)\n", this);
5914 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
5915 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
5918 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
5919 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5921 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5923 TRACE("(%p %x)\n", this, flags);
5925 if(flags & 2) {
5926 /* we have an array, with the number of elements stored before the first object */
5927 INT_PTR i, *ptr = (INT_PTR *)this-1;
5929 for(i=*ptr-1; i>=0; i--)
5930 basic_ostream_char_vbase_dtor(this+i);
5931 MSVCRT_operator_delete(ptr);
5932 } else {
5933 basic_ostream_char_vbase_dtor(this);
5934 if(flags & 1)
5935 MSVCRT_operator_delete(this);
5938 return this;
5941 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
5942 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
5943 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
5944 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
5946 /* this function is not matching C++ specification */
5947 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5949 TRACE("(%p)\n", this);
5951 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
5952 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
5953 basic_ios_char_setstate(base, IOSTATE_badbit);
5954 return this;
5957 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5958 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5959 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
5961 return basic_ostream_char_flush(ostream);
5964 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5965 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5966 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
5967 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
5969 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5971 TRACE("(%p)\n", this);
5973 if(base->base.fmtfl & FMTFLAG_unitbuf)
5974 basic_ostream_char_flush(this);
5977 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5978 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5979 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
5980 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
5982 TRACE("(%p)\n", this);
5983 basic_ostream_char__Osfx(this);
5986 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
5988 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5990 if(basic_ios_char_rdbuf_get(base))
5991 call_basic_streambuf_char__Lock(base->strbuf);
5993 if(ios_base_good(&base->base) && base->stream)
5994 basic_ostream_char_flush(base->stream);
5996 return ios_base_good(&base->base);
5999 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
6001 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6003 if(ios_base_good(&base->base) && !__uncaught_exception())
6004 basic_ostream_char_osfx(ostr);
6006 if(basic_ios_char_rdbuf_get(base))
6007 call_basic_streambuf_char__Unlock(base->strbuf);
6010 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
6011 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
6012 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
6013 bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
6015 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6017 TRACE("(%p)\n", this);
6019 if(ios_base_good(&base->base) && base->stream)
6020 basic_ostream_char_flush(base->stream);
6021 return ios_base_good(&base->base);
6024 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
6025 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
6026 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
6027 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
6029 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6031 TRACE("(%p %c)\n", this, ch);
6033 if(!basic_ostream_char_sentry_create(this)
6034 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
6035 basic_ostream_char_sentry_destroy(this);
6036 basic_ios_char_setstate(base, IOSTATE_badbit);
6037 return this;
6040 basic_ostream_char_sentry_destroy(this);
6041 return this;
6044 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
6045 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
6046 #if STREAMOFF_BITS == 64
6047 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 16)
6048 #else
6049 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
6050 #endif
6051 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
6053 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6055 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6057 if(!ios_base_fail(&base->base)) {
6058 fpos_int seek;
6060 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6061 &seek, off, way, OPENMODE_out);
6062 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6063 basic_ios_char_setstate(base, IOSTATE_failbit);
6065 return this;
6068 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6069 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6070 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
6071 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
6073 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6075 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6077 if(!ios_base_fail(&base->base)) {
6078 fpos_int seek;
6080 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
6081 &seek, pos, OPENMODE_out);
6082 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6083 basic_ios_char_setstate(base, IOSTATE_failbit);
6085 return this;
6088 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6089 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6090 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
6091 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
6093 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6095 TRACE("(%p)\n", this);
6097 if(!ios_base_fail(&base->base)) {
6098 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6099 ret, 0, SEEKDIR_cur, OPENMODE_out);
6100 }else {
6101 ret->off = -1;
6102 ret->pos = 0;
6103 ret->state = 0;
6105 return ret;
6108 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
6109 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
6110 #if STREAMSIZE_BITS == 64
6111 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
6112 #else
6113 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
6114 #endif
6115 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
6117 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6119 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
6121 if(!basic_ostream_char_sentry_create(this)
6122 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
6123 basic_ostream_char_sentry_destroy(this);
6124 basic_ios_char_setstate(base, IOSTATE_badbit);
6125 return this;
6128 basic_ostream_char_sentry_destroy(this);
6129 return this;
6132 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
6133 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
6134 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
6135 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
6137 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6138 int state = IOSTATE_goodbit;
6140 TRACE("(%p %d)\n", this, val);
6142 if(basic_ostream_char_sentry_create(this)) {
6143 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6144 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6145 ostreambuf_iterator_char dest;
6147 memset(&dest, 0, sizeof(dest));
6148 dest.strbuf = strbuf;
6149 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
6150 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6151 ? (LONG)((unsigned short)val) : (LONG)val);
6153 basic_ostream_char_sentry_destroy(this);
6155 basic_ios_char_setstate(base, state);
6156 return this;
6159 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
6160 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
6161 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
6162 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
6164 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6165 int state = IOSTATE_goodbit;
6167 TRACE("(%p %u)\n", this, val);
6169 if(basic_ostream_char_sentry_create(this)) {
6170 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6171 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6172 ostreambuf_iterator_char dest;
6174 memset(&dest, 0, sizeof(dest));
6175 dest.strbuf = strbuf;
6176 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6178 basic_ostream_char_sentry_destroy(this);
6180 basic_ios_char_setstate(base, state);
6181 return this;
6184 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
6185 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
6186 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
6187 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
6188 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
6189 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
6191 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6192 int state = IOSTATE_goodbit;
6194 TRACE("(%p %d)\n", this, val);
6196 if(basic_ostream_char_sentry_create(this)) {
6197 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6198 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6199 ostreambuf_iterator_char dest;
6201 memset(&dest, 0, sizeof(dest));
6202 dest.strbuf = strbuf;
6203 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6205 basic_ostream_char_sentry_destroy(this);
6207 basic_ios_char_setstate(base, state);
6208 return this;
6211 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
6212 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
6213 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
6214 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
6215 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
6216 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
6218 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6219 int state = IOSTATE_goodbit;
6221 TRACE("(%p %u)\n", this, val);
6223 if(basic_ostream_char_sentry_create(this)) {
6224 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6225 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6226 ostreambuf_iterator_char dest;
6228 memset(&dest, 0, sizeof(dest));
6229 dest.strbuf = strbuf;
6230 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6232 basic_ostream_char_sentry_destroy(this);
6234 basic_ios_char_setstate(base, state);
6235 return this;
6238 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
6239 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
6240 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
6241 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
6243 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6244 int state = IOSTATE_goodbit;
6246 TRACE("(%p %f)\n", this, val);
6248 if(basic_ostream_char_sentry_create(this)) {
6249 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6250 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6251 ostreambuf_iterator_char dest;
6253 memset(&dest, 0, sizeof(dest));
6254 dest.strbuf = strbuf;
6255 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6257 basic_ostream_char_sentry_destroy(this);
6259 basic_ios_char_setstate(base, state);
6260 return this;
6263 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
6264 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
6265 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
6266 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
6268 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6269 int state = IOSTATE_goodbit;
6271 TRACE("(%p %lf)\n", this, val);
6273 if(basic_ostream_char_sentry_create(this)) {
6274 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6275 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6276 ostreambuf_iterator_char dest;
6278 memset(&dest, 0, sizeof(dest));
6279 dest.strbuf = strbuf;
6280 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6282 basic_ostream_char_sentry_destroy(this);
6284 basic_ios_char_setstate(base, state);
6285 return this;
6288 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
6289 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
6290 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
6291 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
6293 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6294 int state = IOSTATE_goodbit;
6296 TRACE("(%p %lf)\n", this, val);
6298 if(basic_ostream_char_sentry_create(this)) {
6299 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6300 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6301 ostreambuf_iterator_char dest;
6303 memset(&dest, 0, sizeof(dest));
6304 dest.strbuf = strbuf;
6305 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6307 basic_ostream_char_sentry_destroy(this);
6309 basic_ios_char_setstate(base, state);
6310 return this;
6313 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6314 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6315 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
6316 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
6318 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6319 IOSB_iostate state = IOSTATE_badbit;
6320 int c = '\n';
6322 TRACE("(%p %p)\n", this, val);
6324 if(basic_ostream_char_sentry_create(this)) {
6325 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
6326 c = basic_streambuf_char_snextc(val)) {
6327 state = IOSTATE_goodbit;
6329 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
6330 state = IOSTATE_badbit;
6331 break;
6334 }else {
6335 state = IOSTATE_badbit;
6337 basic_ostream_char_sentry_destroy(this);
6339 ios_base_width_set(&base->base, 0);
6340 basic_ios_char_setstate(base, state);
6341 return this;
6344 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
6345 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
6346 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
6347 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
6349 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6350 int state = IOSTATE_goodbit;
6352 TRACE("(%p %p)\n", this, val);
6354 if(basic_ostream_char_sentry_create(this)) {
6355 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6356 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6357 ostreambuf_iterator_char dest;
6359 memset(&dest, 0, sizeof(dest));
6360 dest.strbuf = strbuf;
6361 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6363 basic_ostream_char_sentry_destroy(this);
6365 basic_ios_char_setstate(base, state);
6366 return this;
6369 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
6370 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
6371 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
6372 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
6374 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6375 int state = IOSTATE_goodbit;
6377 TRACE("(%p)\n", this);
6379 if(basic_ostream_char_sentry_create(this)) {
6380 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6381 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6382 ostreambuf_iterator_char dest;
6384 memset(&dest, 0, sizeof(dest));
6385 dest.strbuf = strbuf;
6386 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6388 basic_ostream_char_sentry_destroy(this);
6390 basic_ios_char_setstate(base, state);
6391 return this;
6394 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
6395 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
6396 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
6397 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
6399 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6400 int state = IOSTATE_goodbit;
6402 TRACE("(%p)\n", this);
6404 if(basic_ostream_char_sentry_create(this)) {
6405 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6406 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6407 ostreambuf_iterator_char dest;
6409 memset(&dest, 0, sizeof(dest));
6410 dest.strbuf = strbuf;
6411 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6413 basic_ostream_char_sentry_destroy(this);
6415 basic_ios_char_setstate(base, state);
6416 return this;
6419 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
6420 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
6421 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
6422 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, bool val)
6424 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6425 int state = IOSTATE_goodbit;
6427 TRACE("(%p %x)\n", this, val);
6429 if(basic_ostream_char_sentry_create(this)) {
6430 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6431 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6432 ostreambuf_iterator_char dest;
6434 memset(&dest, 0, sizeof(dest));
6435 dest.strbuf = strbuf;
6436 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6438 basic_ostream_char_sentry_destroy(this);
6440 basic_ios_char_setstate(base, state);
6441 return this;
6444 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6445 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6446 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6448 TRACE("(%p)\n", ostr);
6450 basic_ostream_char_put(ostr, 0);
6451 return ostr;
6454 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6455 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6456 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6458 TRACE("(%p)\n", ostr);
6460 basic_ostream_char_put(ostr, '\n');
6461 basic_ostream_char_flush(ostr);
6462 return ostr;
6465 /* ??$?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 */
6466 /* ??$?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 */
6467 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6469 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6470 IOSB_iostate state = IOSTATE_goodbit;
6472 TRACE("(%p %p)\n", ostr, str);
6474 if(basic_ostream_char_sentry_create(ostr)) {
6475 size_t len = MSVCP_basic_string_char_length(str);
6476 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6478 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6479 for(; pad!=0; pad--) {
6480 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6481 state = IOSTATE_badbit;
6482 break;
6487 if(state == IOSTATE_goodbit) {
6488 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6489 state = IOSTATE_badbit;
6492 if(state == IOSTATE_goodbit) {
6493 for(; pad!=0; pad--) {
6494 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6495 state = IOSTATE_badbit;
6496 break;
6501 base->base.wide = 0;
6502 }else {
6503 state = IOSTATE_badbit;
6505 basic_ostream_char_sentry_destroy(ostr);
6507 basic_ios_char_setstate(base, state);
6508 return ostr;
6511 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6512 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6513 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6514 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6515 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6516 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6517 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6519 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6520 IOSB_iostate state = IOSTATE_goodbit;
6522 TRACE("(%p %d)\n", ostr, ch);
6524 if(basic_ostream_char_sentry_create(ostr)) {
6525 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6527 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6528 for(; pad!=0; pad--) {
6529 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6530 state = IOSTATE_badbit;
6531 break;
6536 if(state == IOSTATE_goodbit) {
6537 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6538 state = IOSTATE_badbit;
6541 if(state == IOSTATE_goodbit) {
6542 for(; pad!=0; pad--) {
6543 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6544 state = IOSTATE_badbit;
6545 break;
6550 base->base.wide = 0;
6551 }else {
6552 state = IOSTATE_badbit;
6554 basic_ostream_char_sentry_destroy(ostr);
6556 basic_ios_char_setstate(base, state);
6557 return ostr;
6560 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6561 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6562 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6563 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6564 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
6565 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
6566 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
6568 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6569 IOSB_iostate state = IOSTATE_goodbit;
6571 TRACE("(%p %s)\n", ostr, str);
6573 if(basic_ostream_char_sentry_create(ostr)) {
6574 size_t len = strlen(str);
6575 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6577 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6578 for(; pad!=0; pad--) {
6579 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6580 state = IOSTATE_badbit;
6581 break;
6586 if(state == IOSTATE_goodbit) {
6587 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
6588 state = IOSTATE_badbit;
6591 if(state == IOSTATE_goodbit) {
6592 for(; pad!=0; pad--) {
6593 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6594 state = IOSTATE_badbit;
6595 break;
6600 base->base.wide = 0;
6601 }else {
6602 state = IOSTATE_badbit;
6604 basic_ostream_char_sentry_destroy(ostr);
6606 basic_ios_char_setstate(base, state);
6607 return ostr;
6610 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6611 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6612 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
6613 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
6614 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
6616 TRACE("(%p %p)\n", this, pfunc);
6617 pfunc(this);
6618 return this;
6621 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
6622 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
6623 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
6624 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
6625 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
6627 TRACE("(%p %p)\n", this, pfunc);
6628 pfunc(basic_ostream_char_get_basic_ios(this));
6629 return this;
6632 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6633 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6634 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
6635 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
6636 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
6638 TRACE("(%p %p)\n", this, pfunc);
6639 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
6640 return this;
6643 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
6644 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
6645 DEFINE_THISCALL_WRAPPER(basic_ostream_char_swap, 8)
6646 void __thiscall basic_ostream_char_swap(basic_ostream_char *this, basic_ostream_char *r)
6648 TRACE("(%p %p)\n", this, r);
6650 if(this == r)
6651 return;
6653 basic_ios_char_swap(basic_ostream_char_get_basic_ios(this),
6654 basic_ostream_char_get_basic_ios(r));
6657 /* Caution: basic_ostream uses virtual inheritance. */
6658 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
6660 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
6663 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
6665 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
6668 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
6670 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
6673 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
6674 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
6675 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 20)
6676 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
6677 basic_streambuf_wchar *strbuf, bool isstd, bool init, bool virt_init)
6679 basic_ios_wchar *base;
6681 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6683 if(virt_init) {
6684 this->vbtable = basic_ostream_wchar_vbtable;
6685 base = basic_ostream_wchar_get_basic_ios(this);
6686 basic_ios_wchar_ctor(base);
6687 }else {
6688 base = basic_ostream_wchar_get_basic_ios(this);
6691 base->base.vtable = &MSVCP_basic_ostream_short_vtable;
6692 if(init)
6693 basic_ios_wchar_init(base, strbuf, isstd);
6694 return this;
6697 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
6698 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
6699 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 12)
6700 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
6701 int uninitialized, bool virt_init)
6703 basic_ios_wchar *base;
6705 TRACE("(%p %d)\n", this, uninitialized);
6707 if(virt_init) {
6708 this->vbtable = basic_ostream_wchar_vbtable;
6709 base = basic_ostream_wchar_get_basic_ios(this);
6710 basic_ios_wchar_ctor(base);
6711 }else {
6712 base = basic_ostream_wchar_get_basic_ios(this);
6715 base->base.vtable = &MSVCP_basic_ostream_short_vtable;
6716 ios_base_Addstd(&base->base);
6717 return this;
6720 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6721 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6722 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
6723 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6724 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
6725 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
6727 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6729 /* don't destroy virtual base here */
6730 TRACE("(%p)\n", this);
6733 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6734 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6735 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6736 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6737 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
6738 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
6740 TRACE("(%p)\n", this);
6741 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
6742 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
6745 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
6746 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
6748 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6750 TRACE("(%p %x)\n", this, flags);
6752 if(flags & 2) {
6753 /* we have an array, with the number of elements stored before the first object */
6754 INT_PTR i, *ptr = (INT_PTR *)this-1;
6756 for(i=*ptr-1; i>=0; i--)
6757 basic_ostream_wchar_vbase_dtor(this+i);
6758 MSVCRT_operator_delete(ptr);
6759 } else {
6760 basic_ostream_wchar_vbase_dtor(this);
6761 if(flags & 1)
6762 MSVCRT_operator_delete(this);
6765 return this;
6768 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
6769 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
6770 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
6771 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
6772 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
6773 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
6775 /* this function is not matching C++ specification */
6776 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6778 TRACE("(%p)\n", this);
6780 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
6781 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
6782 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6783 return this;
6786 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6787 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6788 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6789 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6790 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
6792 return basic_ostream_wchar_flush(ostream);
6795 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6796 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6797 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6798 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6799 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
6800 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
6802 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6804 TRACE("(%p)\n", this);
6806 if(base->base.fmtfl & FMTFLAG_unitbuf)
6807 basic_ostream_wchar_flush(this);
6810 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6811 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6812 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6813 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6814 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
6815 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
6817 TRACE("(%p)\n", this);
6818 basic_ostream_wchar__Osfx(this);
6821 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
6823 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6825 if(basic_ios_wchar_rdbuf_get(base))
6826 basic_streambuf_wchar__Lock(base->strbuf);
6828 if(ios_base_good(&base->base) && base->stream)
6829 basic_ostream_wchar_flush(base->stream);
6831 return ios_base_good(&base->base);
6834 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
6836 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6838 if(ios_base_good(&base->base) && !__uncaught_exception())
6839 basic_ostream_wchar_osfx(ostr);
6841 if(basic_ios_wchar_rdbuf_get(base))
6842 basic_streambuf_wchar__Unlock(base->strbuf);
6845 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
6846 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
6847 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
6848 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
6849 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
6850 bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
6852 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6854 TRACE("(%p)\n", this);
6856 if(ios_base_good(&base->base) && base->stream)
6857 basic_ostream_wchar_flush(base->stream);
6858 return ios_base_good(&base->base);
6861 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
6862 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
6863 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
6864 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
6865 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
6866 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
6868 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6870 TRACE("(%p %c)\n", this, ch);
6872 if(!basic_ostream_wchar_sentry_create(this)
6873 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
6874 basic_ostream_wchar_sentry_destroy(this);
6875 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6876 return this;
6879 basic_ostream_wchar_sentry_destroy(this);
6880 return this;
6883 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
6884 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
6885 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
6886 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
6887 #if STREAMOFF_BITS == 64
6888 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 16)
6889 #else
6890 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
6891 #endif
6892 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
6894 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6896 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6898 if(!ios_base_fail(&base->base)) {
6899 fpos_int seek;
6901 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6902 &seek, off, way, OPENMODE_out);
6903 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6904 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6906 return this;
6909 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6910 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6911 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6912 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6913 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
6914 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_int pos)
6916 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6918 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6920 if(!ios_base_fail(&base->base)) {
6921 fpos_int seek;
6923 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
6924 &seek, pos, OPENMODE_out);
6925 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6926 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6928 return this;
6931 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6932 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6933 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6934 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6935 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
6936 fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_int *ret)
6938 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6940 TRACE("(%p)\n", this);
6942 if(!ios_base_fail(&base->base)) {
6943 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6944 ret, 0, SEEKDIR_cur, OPENMODE_out);
6945 }else {
6946 ret->off = -1;
6947 ret->pos = 0;
6948 ret->state = 0;
6950 return ret;
6953 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
6954 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
6955 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
6956 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
6957 #if STREAMSIZE_BITS == 64
6958 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
6959 #else
6960 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
6961 #endif
6962 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
6964 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6966 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
6968 if(!basic_ostream_wchar_sentry_create(this)
6969 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
6970 basic_ostream_wchar_sentry_destroy(this);
6971 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6972 return this;
6975 basic_ostream_wchar_sentry_destroy(this);
6976 return this;
6979 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
6981 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6982 int state = IOSTATE_goodbit;
6984 TRACE("(%p %d)\n", this, val);
6986 if(basic_ostream_wchar_sentry_create(this)) {
6987 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6988 ostreambuf_iterator_wchar dest;
6990 memset(&dest, 0, sizeof(dest));
6991 dest.strbuf = strbuf;
6992 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
6993 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6994 ? (LONG)((unsigned short)val) : (LONG)val);
6996 basic_ostream_wchar_sentry_destroy(this);
6998 basic_ios_wchar_setstate(base, state);
6999 return this;
7002 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
7003 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
7004 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
7005 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
7007 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
7008 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7011 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
7012 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
7013 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
7014 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
7016 return basic_ostream_print_short(this, val, num_put_short_use_facet(
7017 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7020 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
7022 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7023 int state = IOSTATE_goodbit;
7025 TRACE("(%p %d)\n", this, val);
7027 if(basic_ostream_wchar_sentry_create(this)) {
7028 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7029 ostreambuf_iterator_wchar dest;
7031 memset(&dest, 0, sizeof(dest));
7032 dest.strbuf = strbuf;
7033 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7035 basic_ostream_wchar_sentry_destroy(this);
7037 basic_ios_wchar_setstate(base, state);
7038 return this;
7041 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
7042 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
7043 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
7044 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
7046 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
7047 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7050 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
7051 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
7052 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
7053 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
7055 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
7056 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7059 /* ??6std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7060 /* ??6std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7061 basic_ostream_wchar* __cdecl basic_ostream_short_print_ushort_global(basic_ostream_wchar *ostr, unsigned short val)
7063 return basic_ostream_print_ushort(ostr, val, num_put_short_use_facet(
7064 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(ostr)))));
7067 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
7069 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7070 int state = IOSTATE_goodbit;
7072 TRACE("(%p %d)\n", this, val);
7074 if(basic_ostream_wchar_sentry_create(this)) {
7075 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7076 ostreambuf_iterator_wchar dest;
7078 memset(&dest, 0, sizeof(dest));
7079 dest.strbuf = strbuf;
7080 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7082 basic_ostream_wchar_sentry_destroy(this);
7084 basic_ios_wchar_setstate(base, state);
7085 return this;
7088 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
7089 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
7090 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
7091 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
7092 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
7093 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
7095 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
7096 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7099 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
7100 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
7101 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
7102 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
7103 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
7104 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
7106 return basic_ostream_print_int(this, val, num_put_short_use_facet(
7107 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7110 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
7112 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7113 int state = IOSTATE_goodbit;
7115 TRACE("(%p %u)\n", this, val);
7117 if(basic_ostream_wchar_sentry_create(this)) {
7118 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7119 ostreambuf_iterator_wchar dest;
7121 memset(&dest, 0, sizeof(dest));
7122 dest.strbuf = strbuf;
7123 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7125 basic_ostream_wchar_sentry_destroy(this);
7127 basic_ios_wchar_setstate(base, state);
7128 return this;
7131 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
7132 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
7133 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
7134 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
7135 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
7136 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
7138 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
7139 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7142 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
7143 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
7144 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
7145 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
7146 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
7147 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
7149 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
7150 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7153 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
7155 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7156 int state = IOSTATE_goodbit;
7158 TRACE("(%p %f)\n", this, val);
7160 if(basic_ostream_wchar_sentry_create(this)) {
7161 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7162 ostreambuf_iterator_wchar dest;
7164 memset(&dest, 0, sizeof(dest));
7165 dest.strbuf = strbuf;
7166 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7168 basic_ostream_wchar_sentry_destroy(this);
7170 basic_ios_wchar_setstate(base, state);
7171 return this;
7174 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
7175 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
7176 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
7177 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
7179 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
7180 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7183 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
7184 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
7185 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
7186 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
7188 return basic_ostream_print_float(this, val, num_put_short_use_facet(
7189 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7192 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
7194 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7195 int state = IOSTATE_goodbit;
7197 TRACE("(%p %lf)\n", this, val);
7199 if(basic_ostream_wchar_sentry_create(this)) {
7200 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7201 ostreambuf_iterator_wchar dest;
7203 memset(&dest, 0, sizeof(dest));
7204 dest.strbuf = strbuf;
7205 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7207 basic_ostream_wchar_sentry_destroy(this);
7209 basic_ios_wchar_setstate(base, state);
7210 return this;
7213 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
7214 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
7215 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
7216 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
7218 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
7219 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7222 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
7223 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
7224 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
7225 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
7227 return basic_ostream_print_double(this, val, num_put_short_use_facet(
7228 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7231 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
7233 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7234 int state = IOSTATE_goodbit;
7236 TRACE("(%p %lf)\n", this, val);
7238 if(basic_ostream_wchar_sentry_create(this)) {
7239 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7240 ostreambuf_iterator_wchar dest;
7242 memset(&dest, 0, sizeof(dest));
7243 dest.strbuf = strbuf;
7244 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7246 basic_ostream_wchar_sentry_destroy(this);
7248 basic_ios_wchar_setstate(base, state);
7249 return this;
7252 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
7253 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
7254 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
7255 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
7257 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
7258 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7261 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
7262 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
7263 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
7264 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
7266 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
7267 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7270 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7271 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7272 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7273 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7274 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
7275 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
7277 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7278 IOSB_iostate state = IOSTATE_badbit;
7279 unsigned short c = '\n';
7281 TRACE("(%p %p)\n", this, val);
7283 if(basic_ostream_wchar_sentry_create(this)) {
7284 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
7285 c = basic_streambuf_wchar_snextc(val)) {
7286 state = IOSTATE_goodbit;
7288 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
7289 state = IOSTATE_badbit;
7290 break;
7293 }else {
7294 state = IOSTATE_badbit;
7296 basic_ostream_wchar_sentry_destroy(this);
7298 ios_base_width_set(&base->base, 0);
7299 basic_ios_wchar_setstate(base, state);
7300 return this;
7303 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
7305 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7306 int state = IOSTATE_goodbit;
7308 TRACE("(%p %p)\n", this, val);
7310 if(basic_ostream_wchar_sentry_create(this)) {
7311 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7312 ostreambuf_iterator_wchar dest;
7314 memset(&dest, 0, sizeof(dest));
7315 dest.strbuf = strbuf;
7316 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7318 basic_ostream_wchar_sentry_destroy(this);
7320 basic_ios_wchar_setstate(base, state);
7321 return this;
7324 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
7325 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
7326 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
7327 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
7329 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
7330 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7333 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
7334 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
7335 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
7336 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
7338 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
7339 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7342 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
7344 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7345 int state = IOSTATE_goodbit;
7347 TRACE("(%p)\n", this);
7349 if(basic_ostream_wchar_sentry_create(this)) {
7350 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7351 ostreambuf_iterator_wchar dest;
7353 memset(&dest, 0, sizeof(dest));
7354 dest.strbuf = strbuf;
7355 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7357 basic_ostream_wchar_sentry_destroy(this);
7359 basic_ios_wchar_setstate(base, state);
7360 return this;
7363 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
7364 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
7365 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
7366 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
7368 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
7369 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7372 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
7373 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
7374 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
7375 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
7377 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
7378 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7381 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
7383 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7384 int state = IOSTATE_goodbit;
7386 TRACE("(%p)\n", this);
7388 if(basic_ostream_wchar_sentry_create(this)) {
7389 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7390 ostreambuf_iterator_wchar dest;
7392 memset(&dest, 0, sizeof(dest));
7393 dest.strbuf = strbuf;
7394 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7396 basic_ostream_wchar_sentry_destroy(this);
7398 basic_ios_wchar_setstate(base, state);
7399 return this;
7402 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
7403 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
7404 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
7405 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7407 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
7408 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7411 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
7412 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
7413 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
7414 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7416 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
7417 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7420 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, bool val, const num_put *numput)
7422 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7423 int state = IOSTATE_goodbit;
7425 TRACE("(%p %x)\n", this, val);
7427 if(basic_ostream_wchar_sentry_create(this)) {
7428 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7429 ostreambuf_iterator_wchar dest;
7431 memset(&dest, 0, sizeof(dest));
7432 dest.strbuf = strbuf;
7433 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7435 basic_ostream_wchar_sentry_destroy(this);
7437 basic_ios_wchar_setstate(base, state);
7438 return this;
7441 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
7442 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
7443 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
7444 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, bool val)
7446 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
7447 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7450 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
7451 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
7452 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
7453 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, bool val)
7455 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
7456 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7459 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7460 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7461 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7462 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7463 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
7465 TRACE("(%p)\n", ostr);
7467 basic_ostream_wchar_put(ostr, 0);
7468 return ostr;
7471 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7472 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7473 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7474 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7475 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
7477 TRACE("(%p)\n", ostr);
7479 basic_ostream_wchar_put(ostr, '\n');
7480 basic_ostream_wchar_flush(ostr);
7481 return ostr;
7484 /* ??$?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 */
7485 /* ??$?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 */
7486 /* ??$?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 */
7487 /* ??$?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 */
7488 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
7490 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7491 IOSB_iostate state = IOSTATE_goodbit;
7493 TRACE("(%p %p)\n", ostr, str);
7495 if(basic_ostream_wchar_sentry_create(ostr)) {
7496 size_t len = MSVCP_basic_string_wchar_length(str);
7497 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7499 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7500 for(; pad!=0; pad--) {
7501 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7502 state = IOSTATE_badbit;
7503 break;
7508 if(state == IOSTATE_goodbit) {
7509 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7510 state = IOSTATE_badbit;
7513 if(state == IOSTATE_goodbit) {
7514 for(; pad!=0; pad--) {
7515 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7516 state = IOSTATE_badbit;
7517 break;
7522 base->base.wide = 0;
7523 }else {
7524 state = IOSTATE_badbit;
7526 basic_ostream_wchar_sentry_destroy(ostr);
7528 basic_ios_wchar_setstate(base, state);
7529 return ostr;
7532 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
7533 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
7534 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7535 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7536 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
7538 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7539 IOSB_iostate state = IOSTATE_goodbit;
7541 TRACE("(%p %d)\n", ostr, ch);
7543 if(basic_ostream_wchar_sentry_create(ostr)) {
7544 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
7546 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7547 for(; pad!=0; pad--) {
7548 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7549 state = IOSTATE_badbit;
7550 break;
7555 if(state == IOSTATE_goodbit) {
7556 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
7557 state = IOSTATE_badbit;
7560 if(state == IOSTATE_goodbit) {
7561 for(; pad!=0; pad--) {
7562 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7563 state = IOSTATE_badbit;
7564 break;
7569 base->base.wide = 0;
7570 }else {
7571 state = IOSTATE_badbit;
7573 basic_ostream_wchar_sentry_destroy(ostr);
7575 basic_ios_wchar_setstate(base, state);
7576 return ostr;
7579 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
7580 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
7581 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
7582 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
7583 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
7585 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7586 IOSB_iostate state = IOSTATE_goodbit;
7588 TRACE("(%p %s)\n", ostr, debugstr_w(str));
7590 if(basic_ostream_wchar_sentry_create(ostr)) {
7591 size_t len = wcslen(str);
7592 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7594 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7595 for(; pad!=0; pad--) {
7596 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7597 state = IOSTATE_badbit;
7598 break;
7603 if(state == IOSTATE_goodbit) {
7604 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
7605 state = IOSTATE_badbit;
7608 if(state == IOSTATE_goodbit) {
7609 for(; pad!=0; pad--) {
7610 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7611 state = IOSTATE_badbit;
7612 break;
7617 base->base.wide = 0;
7618 }else {
7619 state = IOSTATE_badbit;
7621 basic_ostream_wchar_sentry_destroy(ostr);
7623 basic_ios_wchar_setstate(base, state);
7624 return ostr;
7627 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7628 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7629 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7630 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7631 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
7632 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
7633 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
7635 TRACE("(%p %p)\n", this, pfunc);
7636 pfunc(this);
7637 return this;
7640 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
7641 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
7642 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
7643 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
7644 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
7645 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
7646 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
7648 TRACE("(%p %p)\n", this, pfunc);
7649 pfunc(basic_ostream_wchar_get_basic_ios(this));
7650 return this;
7653 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7654 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7655 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7656 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7657 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
7658 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
7659 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
7661 TRACE("(%p %p)\n", this, pfunc);
7662 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
7663 return this;
7666 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
7667 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
7668 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
7669 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IEAAXAEAV12@@Z */
7670 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_swap, 8)
7671 void __thiscall basic_ostream_wchar_swap(basic_ostream_wchar *this, basic_ostream_wchar *r)
7673 TRACE("(%p %p)\n", this, r);
7675 if(this == r)
7676 return;
7678 basic_ios_wchar_swap(basic_ostream_wchar_get_basic_ios(this),
7679 basic_ostream_wchar_get_basic_ios(r));
7682 /* Caution: basic_istream uses virtual inheritance. */
7683 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
7685 return (basic_ios_char*)((char*)this+this->vbtable[1]);
7688 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
7690 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
7693 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
7695 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
7698 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7699 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7700 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
7701 basic_istream_char* __thiscall basic_istream_char_ctor_init(basic_istream_char *this, basic_streambuf_char *strbuf, bool isstd, bool noinit, bool virt_init)
7703 basic_ios_char *base;
7705 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
7707 if(virt_init) {
7708 this->vbtable = basic_istream_char_vbtable;
7709 base = basic_istream_char_get_basic_ios(this);
7710 basic_ios_char_ctor(base);
7711 }else {
7712 base = basic_istream_char_get_basic_ios(this);
7715 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7716 this->count = 0;
7717 if(!noinit)
7718 basic_ios_char_init(base, strbuf, isstd);
7719 return this;
7722 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7723 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7724 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
7725 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, bool isstd, bool virt_init)
7727 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
7730 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
7731 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
7732 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
7733 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, bool virt_init)
7735 basic_ios_char *base;
7737 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
7739 if(virt_init) {
7740 this->vbtable = basic_istream_char_vbtable;
7741 base = basic_istream_char_get_basic_ios(this);
7742 basic_ios_char_ctor(base);
7743 }else {
7744 base = basic_istream_char_get_basic_ios(this);
7747 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7748 ios_base_Addstd(&base->base);
7749 return this;
7752 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
7753 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
7754 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
7755 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
7757 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7759 /* don't destroy virtual base here */
7760 TRACE("(%p)\n", this);
7763 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7764 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7765 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
7766 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
7768 TRACE("(%p)\n", this);
7769 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
7770 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
7773 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
7774 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
7776 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7778 TRACE("(%p %x)\n", this, flags);
7780 if(flags & 2) {
7781 /* we have an array, with the number of elements stored before the first object */
7782 INT_PTR i, *ptr = (INT_PTR *)this-1;
7784 for(i=*ptr-1; i>=0; i--)
7785 basic_istream_char_vbase_dtor(this+i);
7786 MSVCRT_operator_delete(ptr);
7787 } else {
7788 basic_istream_char_vbase_dtor(this);
7789 if(flags & 1)
7790 MSVCRT_operator_delete(this);
7793 return this;
7796 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7797 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7798 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
7799 bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, bool noskip)
7801 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7803 TRACE("(%p %d)\n", this, noskip);
7805 if(ios_base_good(&base->base)) {
7806 if(basic_ios_char_tie_get(base))
7807 basic_ostream_char_flush(basic_ios_char_tie_get(base));
7809 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
7810 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7811 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
7812 int ch;
7814 for(ch = basic_streambuf_char_sgetc(strbuf); ;
7815 ch = basic_streambuf_char_snextc(strbuf)) {
7816 if(ch==EOF || !ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
7817 break;
7822 if(!ios_base_good(&base->base)) {
7823 basic_ios_char_setstate(base, IOSTATE_failbit);
7824 return FALSE;
7827 return TRUE;
7830 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7831 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7832 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
7833 bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, bool noskip)
7835 return basic_istream_char__Ipfx(this, noskip);
7838 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7839 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7840 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
7841 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
7843 TRACE("(%p)\n", this);
7846 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, bool noskip)
7848 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7850 if(basic_ios_char_rdbuf_get(base))
7851 call_basic_streambuf_char__Lock(base->strbuf);
7853 return basic_istream_char_ipfx(istr, noskip);
7856 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
7858 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7860 if(basic_ios_char_rdbuf_get(base))
7861 call_basic_streambuf_char__Unlock(base->strbuf);
7864 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
7865 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
7866 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
7867 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
7868 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
7869 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
7871 TRACE("(%p)\n", this);
7872 return this->count;
7875 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7876 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7877 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
7878 int __thiscall basic_istream_char_get(basic_istream_char *this)
7880 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7881 int ret;
7883 TRACE("(%p)\n", this);
7885 this->count = 0;
7887 if(!basic_istream_char_sentry_create(this, TRUE)) {
7888 basic_istream_char_sentry_destroy(this);
7889 return EOF;
7892 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
7893 basic_istream_char_sentry_destroy(this);
7894 if(ret == EOF)
7895 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
7896 else
7897 this->count++;
7899 return ret;
7902 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
7903 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
7904 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
7905 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
7907 int ret;
7909 TRACE("(%p %p)\n", this, ch);
7911 ret = basic_istream_char_get(this);
7912 if(ret != EOF)
7913 *ch = (char)ret;
7914 return this;
7917 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7918 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7919 #if STREAMSIZE_BITS == 64
7920 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
7921 #else
7922 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
7923 #endif
7924 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7926 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7927 int ch = delim;
7929 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_an(&delim, 1));
7931 this->count = 0;
7933 if(basic_istream_char_sentry_create(this, TRUE)) {
7934 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7936 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
7937 ch = basic_streambuf_char_snextc(strbuf)) {
7938 if(ch==EOF || ch==delim)
7939 break;
7941 *str++ = ch;
7942 this->count++;
7943 count--;
7946 basic_istream_char_sentry_destroy(this);
7948 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7949 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7950 if(count > 0)
7951 *str = 0;
7952 return this;
7955 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7956 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7957 #if STREAMSIZE_BITS == 64
7958 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
7959 #else
7960 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
7961 #endif
7962 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
7964 return basic_istream_char_get_str_delim(this, str, count, '\n');
7967 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7968 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7969 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
7970 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
7972 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7973 int ch = delim;
7975 TRACE("(%p %p %s)\n", this, strbuf, debugstr_an(&delim, 1));
7977 this->count = 0;
7979 if(basic_istream_char_sentry_create(this, TRUE)) {
7980 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
7982 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
7983 ch = basic_streambuf_char_snextc(strbuf_read)) {
7984 if(ch==EOF || ch==delim)
7985 break;
7987 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
7988 break;
7989 this->count++;
7992 basic_istream_char_sentry_destroy(this);
7994 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7995 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7996 return this;
7999 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8000 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8001 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
8002 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
8004 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
8007 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8008 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8009 #if STREAMSIZE_BITS == 64
8010 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
8011 #else
8012 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
8013 #endif
8014 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8016 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8017 int ch = (unsigned char)delim;
8019 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_an(&delim, 1));
8021 this->count = 0;
8023 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
8024 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8026 while(count > 1) {
8027 ch = basic_streambuf_char_sbumpc(strbuf);
8029 if(ch==EOF || ch==(unsigned char)delim)
8030 break;
8032 *str++ = ch;
8033 this->count++;
8034 count--;
8037 if(ch == (unsigned char)delim)
8038 this->count++;
8039 else if(ch != EOF) {
8040 ch = basic_streambuf_char_sgetc(strbuf);
8042 if(ch == (unsigned char)delim) {
8043 basic_streambuf_char__Gninc(strbuf);
8044 this->count++;
8048 basic_istream_char_sentry_destroy(this);
8050 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8051 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8052 if(count > 0)
8053 *str = 0;
8054 return this;
8057 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8058 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8059 #if STREAMSIZE_BITS == 64
8060 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
8061 #else
8062 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
8063 #endif
8064 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
8066 return basic_istream_char_getline_delim(this, str, count, '\n');
8069 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
8070 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8071 #if STREAMSIZE_BITS == 64
8072 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
8073 #else
8074 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
8075 #endif
8076 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
8078 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8079 int ch = (unsigned char)delim;
8080 unsigned int state;
8082 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8084 this->count = 0;
8086 if(basic_istream_char_sentry_create(this, TRUE)) {
8087 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8088 state = IOSTATE_goodbit;
8090 while(count > 0) {
8091 ch = basic_streambuf_char_sbumpc(strbuf);
8093 if(ch==EOF) {
8094 state = IOSTATE_eofbit;
8095 break;
8098 if(ch==delim)
8099 break;
8101 this->count++;
8102 if(count != INT_MAX)
8103 count--;
8105 }else
8106 state = IOSTATE_failbit;
8107 basic_istream_char_sentry_destroy(this);
8109 basic_ios_char_setstate(base, state);
8110 return this;
8113 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
8114 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
8115 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
8117 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8118 int ch = '\n';
8120 TRACE("(%p)\n", istream);
8122 if(basic_istream_char_sentry_create(istream, TRUE)) {
8123 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8124 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(strbuf));
8126 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
8127 ch = basic_streambuf_char_snextc(strbuf)) {
8128 if(ch == EOF)
8129 break;
8132 basic_istream_char_sentry_destroy(istream);
8134 if(ch == EOF)
8135 basic_ios_char_setstate(base, IOSTATE_eofbit);
8136 return istream;
8139 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8140 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8141 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
8142 int __thiscall basic_istream_char_peek(basic_istream_char *this)
8144 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8145 int ret = EOF;
8147 TRACE("(%p)\n", this);
8149 this->count = 0;
8151 if(basic_istream_char_sentry_create(this, TRUE))
8152 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8153 basic_istream_char_sentry_destroy(this);
8155 if (ret == EOF)
8156 basic_ios_char_setstate(base, IOSTATE_eofbit);
8158 return ret;
8161 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
8162 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
8163 #if STREAMSIZE_BITS == 64
8164 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
8165 #else
8166 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
8167 #endif
8168 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, size_t size, streamsize count)
8170 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8171 IOSB_iostate state = IOSTATE_goodbit;
8173 TRACE("(%p %p %Iu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8175 if(basic_istream_char_sentry_create(this, TRUE)) {
8176 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8178 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
8179 if(this->count != count)
8180 state |= IOSTATE_failbit | IOSTATE_eofbit;
8181 }else {
8182 this->count = 0;
8184 basic_istream_char_sentry_destroy(this);
8186 basic_ios_char_setstate(base, state);
8187 return this;
8190 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8191 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8192 #if STREAMSIZE_BITS == 64
8193 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
8194 #else
8195 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
8196 #endif
8197 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
8199 return basic_istream_char__Read_s(this, str, -1, count);
8202 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
8203 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
8204 #if STREAMSIZE_BITS == 64
8205 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
8206 #else
8207 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
8208 #endif
8209 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, size_t size, streamsize count)
8211 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8212 IOSB_iostate state = IOSTATE_goodbit;
8214 TRACE("(%p %p %Iu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8216 this->count = 0;
8218 if(basic_istream_char_sentry_create(this, TRUE)) {
8219 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
8220 if(avail > count)
8221 avail = count;
8223 if(avail == -1)
8224 state |= IOSTATE_eofbit;
8225 else if(avail > 0)
8226 basic_istream_char__Read_s(this, str, size, avail);
8227 }else {
8228 state |= IOSTATE_failbit;
8230 basic_istream_char_sentry_destroy(this);
8232 basic_ios_char_setstate(base, state);
8233 return this->count;
8236 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
8237 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
8238 #if STREAMSIZE_BITS == 64
8239 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
8240 #else
8241 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
8242 #endif
8243 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
8245 return basic_istream_char__Readsome_s(this, str, count, count);
8248 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
8249 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
8250 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
8251 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
8253 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8254 IOSB_iostate state = IOSTATE_goodbit;
8256 TRACE("(%p %c)\n", this, ch);
8258 this->count = 0;
8260 if(basic_istream_char_sentry_create(this, TRUE)) {
8261 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8263 if(!ios_base_good(&base->base))
8264 state |= IOSTATE_failbit;
8265 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
8266 state |= IOSTATE_badbit;
8268 basic_istream_char_sentry_destroy(this);
8270 basic_ios_char_setstate(base, state);
8271 return this;
8274 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
8275 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
8276 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
8277 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
8279 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8280 IOSB_iostate state = IOSTATE_goodbit;
8282 TRACE("(%p)\n", this);
8284 this->count = 0;
8286 if(basic_istream_char_sentry_create(this, TRUE)) {
8287 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8289 if(!ios_base_good(&base->base))
8290 state |= IOSTATE_failbit;
8291 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
8292 state |= IOSTATE_badbit;
8294 basic_istream_char_sentry_destroy(this);
8296 basic_ios_char_setstate(base, state);
8297 return this;
8300 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8301 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8302 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
8303 int __thiscall basic_istream_char_sync(basic_istream_char *this)
8305 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8306 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8308 TRACE("(%p)\n", this);
8310 if(!strbuf)
8311 return -1;
8313 if(basic_istream_char_sentry_create(this, TRUE)) {
8314 if(basic_streambuf_char_pubsync(strbuf) != -1) {
8315 basic_istream_char_sentry_destroy(this);
8316 return 0;
8319 basic_istream_char_sentry_destroy(this);
8321 basic_ios_char_setstate(base, IOSTATE_badbit);
8322 return -1;
8325 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8326 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8327 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
8328 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
8330 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8332 TRACE("(%p %p)\n", this, ret);
8334 if(ios_base_fail(&base->base)) {
8335 ret->off = -1;
8336 ret->pos = 0;
8337 ret->state = 0;
8338 return ret;
8341 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8342 ret, 0, SEEKDIR_cur, OPENMODE_in);
8344 return ret;
8347 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
8348 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
8349 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
8350 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8351 #if STREAMOFF_BITS == 64
8352 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
8353 #else
8354 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
8355 #endif
8356 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
8358 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8360 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8362 if(!ios_base_fail(&base->base)) {
8363 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8364 fpos_int ret;
8366 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8369 return this;
8372 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8373 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8374 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
8375 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
8377 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8379 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
8381 if(!ios_base_fail(&base->base)) {
8382 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8383 fpos_int ret;
8385 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8388 return this;
8391 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
8392 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
8393 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
8394 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
8396 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8397 int state = IOSTATE_goodbit;
8399 TRACE("(%p %p)\n", this, v);
8401 if(basic_istream_char_sentry_create(this, FALSE)) {
8402 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8403 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8404 istreambuf_iterator_char first={0}, last={0};
8405 LONG tmp;
8407 first.strbuf = strbuf;
8408 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8410 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8411 *v = tmp;
8412 else
8413 state |= IOSTATE_failbit;
8415 basic_istream_char_sentry_destroy(this);
8417 basic_ios_char_setstate(base, state);
8418 return this;
8421 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
8422 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
8423 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
8424 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
8426 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8427 int state = IOSTATE_goodbit;
8429 TRACE("(%p %p)\n", this, v);
8431 if(basic_istream_char_sentry_create(this, FALSE)) {
8432 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8433 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8434 istreambuf_iterator_char first={0}, last={0};
8436 first.strbuf = strbuf;
8437 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
8439 basic_istream_char_sentry_destroy(this);
8441 basic_ios_char_setstate(base, state);
8442 return this;
8445 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
8446 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
8447 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
8448 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
8450 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8451 int state = IOSTATE_goodbit;
8453 TRACE("(%p %p)\n", this, v);
8455 if(basic_istream_char_sentry_create(this, FALSE)) {
8456 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8457 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8458 istreambuf_iterator_char first={0}, last={0};
8460 first.strbuf = strbuf;
8461 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8463 basic_istream_char_sentry_destroy(this);
8465 basic_ios_char_setstate(base, state);
8466 return this;
8469 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
8470 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
8471 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
8472 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
8474 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8475 int state = IOSTATE_goodbit;
8477 TRACE("(%p %p)\n", this, v);
8479 if(basic_istream_char_sentry_create(this, FALSE)) {
8480 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8481 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8482 istreambuf_iterator_char first={0}, last={0};
8484 first.strbuf = strbuf;
8485 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
8487 basic_istream_char_sentry_destroy(this);
8489 basic_ios_char_setstate(base, state);
8490 return this;
8493 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
8494 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
8495 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
8496 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
8498 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8499 int state = IOSTATE_goodbit;
8501 TRACE("(%p %p)\n", this, v);
8503 if(basic_istream_char_sentry_create(this, FALSE)) {
8504 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8505 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8506 istreambuf_iterator_char first={0}, last={0};
8508 first.strbuf = strbuf;
8509 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8511 basic_istream_char_sentry_destroy(this);
8513 basic_ios_char_setstate(base, state);
8514 return this;
8517 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
8518 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
8519 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
8520 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
8522 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8523 int state = IOSTATE_goodbit;
8525 TRACE("(%p %p)\n", this, v);
8527 if(basic_istream_char_sentry_create(this, FALSE)) {
8528 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8529 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8530 istreambuf_iterator_char first={0}, last={0};
8532 first.strbuf = strbuf;
8533 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
8535 basic_istream_char_sentry_destroy(this);
8537 basic_ios_char_setstate(base, state);
8538 return this;
8541 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
8542 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
8543 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
8544 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
8546 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8547 int state = IOSTATE_goodbit;
8549 TRACE("(%p %p)\n", this, v);
8551 if(basic_istream_char_sentry_create(this, FALSE)) {
8552 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8553 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8554 istreambuf_iterator_char first={0}, last={0};
8556 first.strbuf = strbuf;
8557 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
8559 basic_istream_char_sentry_destroy(this);
8561 basic_ios_char_setstate(base, state);
8562 return this;
8565 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
8566 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
8567 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
8568 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
8570 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8571 int state = IOSTATE_goodbit;
8573 TRACE("(%p %p)\n", this, v);
8575 if(basic_istream_char_sentry_create(this, FALSE)) {
8576 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8577 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8578 istreambuf_iterator_char first={0}, last={0};
8580 first.strbuf = strbuf;
8581 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
8583 basic_istream_char_sentry_destroy(this);
8585 basic_ios_char_setstate(base, state);
8586 return this;
8589 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
8590 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
8591 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
8592 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
8594 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8595 int state = IOSTATE_goodbit;
8597 TRACE("(%p %p)\n", this, v);
8599 if(basic_istream_char_sentry_create(this, FALSE)) {
8600 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8601 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8602 istreambuf_iterator_char first={0}, last={0};
8604 first.strbuf = strbuf;
8605 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
8607 basic_istream_char_sentry_destroy(this);
8609 basic_ios_char_setstate(base, state);
8610 return this;
8613 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
8614 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
8615 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
8616 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
8618 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8619 int state = IOSTATE_goodbit;
8621 TRACE("(%p %p)\n", this, v);
8623 if(basic_istream_char_sentry_create(this, FALSE)) {
8624 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8625 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8626 istreambuf_iterator_char first={0}, last={0};
8628 first.strbuf = strbuf;
8629 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
8631 basic_istream_char_sentry_destroy(this);
8633 basic_ios_char_setstate(base, state);
8634 return this;
8637 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
8638 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
8639 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
8640 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
8642 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8643 int state = IOSTATE_goodbit;
8645 TRACE("(%p %p)\n", this, v);
8647 if(basic_istream_char_sentry_create(this, FALSE)) {
8648 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8649 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8650 istreambuf_iterator_char first={0}, last={0};
8652 first.strbuf = strbuf;
8653 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
8655 basic_istream_char_sentry_destroy(this);
8657 basic_ios_char_setstate(base, state);
8658 return this;
8661 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
8662 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
8663 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
8664 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
8666 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8667 int state = IOSTATE_goodbit;
8669 TRACE("(%p %p)\n", this, v);
8671 if(basic_istream_char_sentry_create(this, FALSE)) {
8672 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8673 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8674 istreambuf_iterator_char first={0}, last={0};
8676 first.strbuf = strbuf;
8677 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
8679 basic_istream_char_sentry_destroy(this);
8681 basic_ios_char_setstate(base, state);
8682 return this;
8685 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
8686 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
8687 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
8688 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, bool *v)
8690 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8691 int state = IOSTATE_goodbit;
8693 TRACE("(%p %p)\n", this, v);
8695 if(basic_istream_char_sentry_create(this, FALSE)) {
8696 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8697 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8698 istreambuf_iterator_char first={0}, last={0};
8700 first.strbuf = strbuf;
8701 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
8703 basic_istream_char_sentry_destroy(this);
8705 basic_ios_char_setstate(base, state);
8706 return this;
8709 /* ??$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 */
8710 /* ??$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 */
8711 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
8712 basic_istream_char *istream, basic_string_char *str, char delim)
8714 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8715 IOSB_iostate state = IOSTATE_goodbit;
8716 int c = (unsigned char)delim;
8718 TRACE("(%p %p %s)\n", istream, str, debugstr_an(&delim, 1));
8720 MSVCP_basic_string_char_clear(str);
8721 if(basic_istream_char_sentry_create(istream, TRUE)) {
8722 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8724 c = basic_streambuf_char_sgetc(strbuf);
8725 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
8726 MSVCP_basic_string_char_append_ch(str, c);
8727 if(c==EOF) state |= IOSTATE_eofbit;
8728 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
8730 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
8732 basic_istream_char_sentry_destroy(istream);
8734 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
8735 return istream;
8738 /* ??$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 */
8739 /* ??$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 */
8740 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
8741 basic_istream_char *istream, basic_string_char *str)
8743 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
8746 /* ??$?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 */
8747 /* ??$?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 */
8748 basic_istream_char* __cdecl basic_istream_char_read_bstr(
8749 basic_istream_char *istream, basic_string_char *str)
8751 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8752 IOSB_iostate state = IOSTATE_failbit;
8753 int c = '\n';
8755 TRACE("(%p %p)\n", istream, str);
8757 if(basic_istream_char_sentry_create(istream, FALSE)) {
8758 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8759 size_t count = ios_base_width_get(&base->base);
8761 if(!count)
8762 count = -1;
8764 MSVCP_basic_string_char_clear(str);
8766 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8767 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8768 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8769 state = IOSTATE_goodbit;
8770 MSVCP_basic_string_char_append_ch(str, c);
8773 basic_istream_char_sentry_destroy(istream);
8775 ios_base_width_set(&base->base, 0);
8776 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8777 return istream;
8780 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
8781 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
8782 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
8783 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
8784 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
8785 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
8786 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
8788 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8789 IOSB_iostate state = IOSTATE_failbit;
8790 int c = '\n';
8792 TRACE("(%p %p)\n", istream, str);
8794 if(basic_istream_char_sentry_create(istream, FALSE)) {
8795 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8796 size_t count = ios_base_width_get(&base->base)-1;
8798 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8799 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8800 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8801 state = IOSTATE_goodbit;
8802 *str++ = c;
8805 basic_istream_char_sentry_destroy(istream);
8807 *str = 0;
8808 ios_base_width_set(&base->base, 0);
8809 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8810 return istream;
8813 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
8814 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
8815 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
8816 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
8817 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
8818 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
8819 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
8821 IOSB_iostate state = IOSTATE_failbit;
8822 int c = 0;
8824 TRACE("(%p %p)\n", istream, ch);
8826 if(basic_istream_char_sentry_create(istream, FALSE)) {
8827 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
8828 basic_istream_char_get_basic_ios(istream)));
8829 if(c != EOF) {
8830 state = IOSTATE_goodbit;
8831 *ch = c;
8834 basic_istream_char_sentry_destroy(istream);
8836 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
8837 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8838 return istream;
8841 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8842 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8843 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
8844 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
8845 basic_istream_char *this, basic_streambuf_char *streambuf)
8847 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8848 IOSB_iostate state = IOSTATE_failbit;
8849 int c = '\n';
8851 TRACE("(%p %p)\n", this, streambuf);
8853 if(basic_istream_char_sentry_create(this, FALSE)) {
8854 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
8855 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
8856 state = IOSTATE_goodbit;
8857 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
8858 break;
8861 basic_istream_char_sentry_destroy(this);
8863 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8864 return this;
8867 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8868 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8869 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
8870 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
8871 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
8873 TRACE("(%p %p)\n", this, pfunc);
8874 pfunc(this);
8875 return this;
8878 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
8879 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
8880 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
8881 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
8882 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
8884 TRACE("(%p %p)\n", this, pfunc);
8885 pfunc(basic_istream_char_get_basic_ios(this));
8886 return this;
8889 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8890 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8891 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
8892 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
8893 ios_base* (__cdecl *pfunc)(ios_base*))
8895 TRACE("(%p %p)\n", this, pfunc);
8896 pfunc(&basic_istream_char_get_basic_ios(this)->base);
8897 return this;
8900 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@M@0@@Z */
8901 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@M@0@@Z */
8902 basic_istream_char* __cdecl basic_istream_char_read_complex_float(basic_istream_char *this, complex_float *v)
8904 float r;
8905 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8907 TRACE("(%p %p)\n", this, v);
8909 ws_basic_istream_char(this);
8910 if(basic_istream_char_peek(this) == '(') {
8911 char c;
8912 basic_istream_char_get(this);
8913 basic_istream_char_read_float(this, &r);
8915 if(ios_base_fail(&base->base))
8916 return this;
8918 ws_basic_istream_char(this);
8919 c = basic_istream_char_peek(this);
8920 if(c == ',') {
8921 float i;
8922 basic_istream_char_get(this);
8923 basic_istream_char_read_float(this, &i);
8925 if(ios_base_fail(&base->base))
8926 return this;
8928 ws_basic_istream_char(this);
8929 c = basic_istream_char_peek(this);
8930 if(c == ')') { /* supported format: (real, imag) */
8931 basic_istream_char_get(this);
8932 v->real = r;
8933 v->imag = i;
8934 }else {
8935 basic_ios_char_setstate(base, IOSTATE_failbit);
8936 return this;
8938 }else if(c == ')') { /* supported format: (real) */
8939 basic_istream_char_get(this);
8940 v->real = r;
8941 v->imag = 0;
8942 }else {
8943 basic_ios_char_setstate(base, IOSTATE_failbit);
8944 return this;
8946 }else { /* supported format: real */
8947 basic_istream_char_read_float(this, &r);
8949 if(ios_base_fail(&base->base))
8950 return this;
8952 v->real = r;
8953 v->imag = 0;
8956 return this;
8959 /* ??$?5NDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@N@0@@Z */
8960 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@N@0@@Z */
8961 basic_istream_char* __cdecl basic_istream_char_read_complex_double(basic_istream_char *this, complex_double *v)
8963 double r;
8964 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8966 TRACE("(%p %p)\n", this, v);
8968 ws_basic_istream_char(this);
8969 if(basic_istream_char_peek(this) == '(') {
8970 char c;
8971 basic_istream_char_get(this);
8972 basic_istream_char_read_double(this, &r);
8974 if(ios_base_fail(&base->base))
8975 return this;
8977 ws_basic_istream_char(this);
8978 c = basic_istream_char_peek(this);
8979 if(c == ',') {
8980 double i;
8981 basic_istream_char_get(this);
8982 basic_istream_char_read_double(this, &i);
8984 if(ios_base_fail(&base->base))
8985 return this;
8987 ws_basic_istream_char(this);
8988 c = basic_istream_char_peek(this);
8989 if(c == ')') { /* supported format: (real, imag) */
8990 basic_istream_char_get(this);
8991 v->real = r;
8992 v->imag = i;
8993 }else {
8994 basic_ios_char_setstate(base, IOSTATE_failbit);
8995 return this;
8997 }else if(c == ')') { /* supported format: (real) */
8998 basic_istream_char_get(this);
8999 v->real = r;
9000 v->imag = 0;
9001 }else {
9002 basic_ios_char_setstate(base, IOSTATE_failbit);
9003 return this;
9005 }else { /* supported format: real */
9006 basic_istream_char_read_double(this, &r);
9008 if(ios_base_fail(&base->base))
9009 return this;
9011 v->real = r;
9012 v->imag = 0;
9015 return this;
9018 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@O@0@@Z */
9019 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@O@0@@Z */
9020 basic_istream_char* __cdecl basic_istream_char_read_complex_ldouble(basic_istream_char *this, complex_double *v)
9022 double r;
9023 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9025 TRACE("(%p %p)\n", this, v);
9027 ws_basic_istream_char(this);
9028 if(basic_istream_char_peek(this) == '(') {
9029 char c;
9030 basic_istream_char_get(this);
9031 basic_istream_char_read_ldouble(this, &r);
9033 if(ios_base_fail(&base->base))
9034 return this;
9036 ws_basic_istream_char(this);
9037 c = basic_istream_char_peek(this);
9038 if(c == ',') {
9039 double i;
9040 basic_istream_char_get(this);
9041 basic_istream_char_read_ldouble(this, &i);
9043 if(ios_base_fail(&base->base))
9044 return this;
9046 ws_basic_istream_char(this);
9047 c = basic_istream_char_peek(this);
9048 if(c == ')') { /* supported format: (real, imag) */
9049 basic_istream_char_get(this);
9050 v->real = r;
9051 v->imag = i;
9052 }else {
9053 basic_ios_char_setstate(base, IOSTATE_failbit);
9054 return this;
9056 }else if(c == ')') { /* supported format: (real) */
9057 basic_istream_char_get(this);
9058 v->real = r;
9059 v->imag = 0;
9060 }else {
9061 basic_ios_char_setstate(base, IOSTATE_failbit);
9062 return this;
9064 }else { /* supported format: real */
9065 basic_istream_char_read_ldouble(this, &r);
9067 if(ios_base_fail(&base->base))
9068 return this;
9070 v->real = r;
9071 v->imag = 0;
9074 return this;
9077 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
9078 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
9079 DEFINE_THISCALL_WRAPPER(basic_istream_char_swap, 8)
9080 void __thiscall basic_istream_char_swap(basic_istream_char *this, basic_istream_char *r)
9082 TRACE("(%p %p)\n", this, r);
9084 if(this == r)
9085 return;
9087 basic_ios_char_swap(basic_istream_char_get_basic_ios(this),
9088 basic_istream_char_get_basic_ios(r));
9089 this->count ^= r->count;
9090 r->count ^= this->count;
9091 this->count ^= r->count;
9094 /* Caution: basic_istream uses virtual inheritance. */
9095 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
9097 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
9100 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
9102 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
9105 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9107 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
9110 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9111 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9112 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
9113 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
9114 basic_streambuf_wchar *strbuf, bool isstd, bool noinit, bool virt_init)
9116 basic_ios_wchar *base;
9118 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
9120 if(virt_init) {
9121 this->vbtable = basic_istream_wchar_vbtable;
9122 base = basic_istream_wchar_get_basic_ios(this);
9123 basic_ios_wchar_ctor(base);
9124 }else {
9125 base = basic_istream_wchar_get_basic_ios(this);
9128 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9129 this->count = 0;
9130 if(!noinit)
9131 basic_ios_wchar_init(base, strbuf, isstd);
9132 return this;
9135 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9136 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9137 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
9138 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
9139 basic_streambuf_wchar *strbuf, bool isstd, bool noinit, bool virt_init)
9141 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
9142 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9143 return this;
9146 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9147 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9148 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
9149 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
9150 basic_streambuf_wchar *strbuf, bool isstd, bool virt_init)
9152 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9155 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9156 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9157 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
9158 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
9159 basic_streambuf_wchar *strbuf, bool isstd, bool virt_init)
9161 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9164 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9165 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9166 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
9167 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
9168 basic_istream_wchar *this, int uninitialized, bool virt_init)
9170 basic_ios_wchar *base;
9172 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
9174 if(virt_init) {
9175 this->vbtable = basic_istream_wchar_vbtable;
9176 base = basic_istream_wchar_get_basic_ios(this);
9177 basic_ios_wchar_ctor(base);
9178 }else {
9179 base = basic_istream_wchar_get_basic_ios(this);
9182 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9183 ios_base_Addstd(&base->base);
9184 return this;
9187 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9188 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9189 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
9190 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
9191 basic_istream_wchar *this, int uninitialized, bool virt_init)
9193 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
9194 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9195 return this;
9198 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9199 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9200 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9201 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9202 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
9203 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
9205 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9207 /* don't destroy virtual base here */
9208 TRACE("(%p)\n", this);
9211 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9212 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9213 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9214 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9215 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
9216 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
9218 TRACE("(%p)\n", this);
9219 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
9220 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
9223 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
9224 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9226 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9228 TRACE("(%p %x)\n", this, flags);
9230 if(flags & 2) {
9231 /* we have an array, with the number of elements stored before the first object */
9232 INT_PTR i, *ptr = (INT_PTR *)this-1;
9234 for(i=*ptr-1; i>=0; i--)
9235 basic_istream_wchar_vbase_dtor(this+i);
9236 MSVCRT_operator_delete(ptr);
9237 } else {
9238 basic_istream_wchar_vbase_dtor(this);
9239 if(flags & 1)
9240 MSVCRT_operator_delete(this);
9243 return this;
9246 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9247 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9248 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9249 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9250 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
9251 bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, bool noskip)
9253 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9255 TRACE("(%p %d)\n", this, noskip);
9257 if(ios_base_good(&base->base)) {
9258 if(basic_ios_wchar_tie_get(base))
9259 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
9261 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
9262 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9263 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(base->strbuf));
9264 int ch;
9266 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
9267 ch = basic_streambuf_wchar_snextc(strbuf)) {
9268 if(ch==WEOF || !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
9269 break;
9274 if(!ios_base_good(&base->base)) {
9275 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9276 return FALSE;
9278 return TRUE;
9281 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9282 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9283 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9284 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9285 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
9286 bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, bool noskip)
9288 return basic_istream_wchar__Ipfx(this, noskip);
9291 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9292 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9293 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9294 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9295 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
9296 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
9298 TRACE("(%p)\n", this);
9301 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, bool noskip)
9303 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9305 if(basic_ios_wchar_rdbuf_get(base))
9306 basic_streambuf_wchar__Lock(base->strbuf);
9308 return basic_istream_wchar_ipfx(istr, noskip);
9311 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
9313 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9315 if(basic_ios_wchar_rdbuf_get(base))
9316 basic_streambuf_wchar__Unlock(base->strbuf);
9319 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
9320 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
9321 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
9322 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
9323 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
9324 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
9325 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
9326 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
9327 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
9328 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
9330 TRACE("(%p)\n", this);
9331 return this->count;
9334 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9335 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9336 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9337 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9338 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
9339 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
9341 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9342 int ret;
9344 TRACE("(%p)\n", this);
9346 this->count = 0;
9348 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
9349 basic_istream_wchar_sentry_destroy(this);
9350 return WEOF;
9353 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
9354 basic_istream_wchar_sentry_destroy(this);
9355 if(ret == WEOF)
9356 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
9357 else
9358 this->count++;
9360 return ret;
9363 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
9364 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
9365 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
9366 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
9367 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
9368 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
9370 unsigned short ret;
9372 TRACE("(%p %p)\n", this, ch);
9374 ret = basic_istream_wchar_get(this);
9375 if(ret != WEOF)
9376 *ch = (wchar_t)ret;
9377 return this;
9380 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9381 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9382 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9383 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9384 #if STREAMSIZE_BITS == 64
9385 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
9386 #else
9387 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
9388 #endif
9389 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9391 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9392 unsigned short ch = delim;
9394 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_wn(&delim, 1));
9396 this->count = 0;
9398 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9399 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9401 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
9402 ch = basic_streambuf_wchar_snextc(strbuf)) {
9403 if(ch==WEOF || ch==delim)
9404 break;
9406 *str++ = ch;
9407 this->count++;
9408 count--;
9411 basic_istream_wchar_sentry_destroy(this);
9413 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9414 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9415 if(count > 0)
9416 *str = 0;
9417 return this;
9420 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9421 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9422 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9423 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9424 #if STREAMSIZE_BITS == 64
9425 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
9426 #else
9427 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
9428 #endif
9429 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
9431 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
9434 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9435 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9436 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9437 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9438 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
9439 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
9441 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9442 unsigned short ch = delim;
9444 TRACE("(%p %p %s)\n", this, strbuf, debugstr_wn(&delim, 1));
9446 this->count = 0;
9448 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9449 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
9451 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
9452 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
9453 if(ch==WEOF || ch==delim)
9454 break;
9456 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
9457 break;
9458 this->count++;
9461 basic_istream_wchar_sentry_destroy(this);
9463 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9464 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9465 return this;
9468 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9469 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9470 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9471 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9472 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
9473 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
9475 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
9478 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9479 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9480 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9481 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9482 #if STREAMSIZE_BITS == 64
9483 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
9484 #else
9485 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
9486 #endif
9487 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9489 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9490 unsigned short ch = delim;
9492 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_wn(&delim, 1));
9494 this->count = 0;
9496 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
9497 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9499 while(count > 1) {
9500 ch = basic_streambuf_wchar_sbumpc(strbuf);
9502 if(ch==WEOF || ch==delim)
9503 break;
9505 *str++ = ch;
9506 this->count++;
9507 count--;
9510 if(ch == delim)
9511 this->count++;
9512 else if(ch != WEOF) {
9513 ch = basic_streambuf_wchar_sgetc(strbuf);
9515 if(ch == delim) {
9516 basic_streambuf_wchar__Gninc(strbuf);
9517 this->count++;
9521 basic_istream_wchar_sentry_destroy(this);
9523 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
9524 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
9525 if(count > 0)
9526 *str = 0;
9527 return this;
9530 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9531 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9532 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9533 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9534 #if STREAMSIZE_BITS == 64
9535 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
9536 #else
9537 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
9538 #endif
9539 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
9541 return basic_istream_wchar_getline_delim(this, str, count, '\n');
9544 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
9545 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
9546 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
9547 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
9548 #if STREAMSIZE_BITS == 64
9549 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
9550 #else
9551 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
9552 #endif
9553 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
9555 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9556 unsigned short ch = delim;
9557 unsigned int state;
9559 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
9561 this->count = 0;
9563 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9564 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9565 state = IOSTATE_goodbit;
9567 while(count > 0) {
9568 ch = basic_streambuf_wchar_sbumpc(strbuf);
9570 if(ch==WEOF) {
9571 state = IOSTATE_eofbit;
9572 break;
9575 if(ch==delim)
9576 break;
9578 this->count++;
9579 if(count != INT_MAX)
9580 count--;
9582 }else
9583 state = IOSTATE_failbit;
9584 basic_istream_wchar_sentry_destroy(this);
9586 basic_ios_wchar_setstate(base, state);
9587 return this;
9590 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
9591 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
9592 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
9593 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
9594 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
9596 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9597 unsigned short ch = '\n';
9599 TRACE("(%p)\n", istream);
9601 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
9602 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9603 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(strbuf));
9605 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
9606 ch = basic_streambuf_wchar_snextc(strbuf)) {
9607 if(ch == WEOF)
9608 break;
9611 basic_istream_wchar_sentry_destroy(istream);
9613 if(ch == WEOF)
9614 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9615 return istream;
9618 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9619 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9620 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9621 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9622 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
9623 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
9625 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9626 unsigned short ret = WEOF;
9628 TRACE("(%p)\n", this);
9630 this->count = 0;
9632 if(basic_istream_wchar_sentry_create(this, TRUE))
9633 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9634 basic_istream_wchar_sentry_destroy(this);
9636 if (ret == WEOF)
9637 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9639 return ret;
9642 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
9643 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
9644 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
9645 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
9646 #if STREAMSIZE_BITS == 64
9647 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
9648 #else
9649 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
9650 #endif
9651 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, size_t size, streamsize count)
9653 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9654 IOSB_iostate state = IOSTATE_goodbit;
9656 TRACE("(%p %p %Iu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9658 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9659 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9661 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
9662 if(this->count != count)
9663 state |= IOSTATE_failbit | IOSTATE_eofbit;
9664 }else {
9665 this->count = 0;
9667 basic_istream_wchar_sentry_destroy(this);
9669 basic_ios_wchar_setstate(base, state);
9670 return this;
9673 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9674 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9675 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9676 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9677 #if STREAMSIZE_BITS == 64
9678 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
9679 #else
9680 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
9681 #endif
9682 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
9684 return basic_istream_wchar__Read_s(this, str, -1, count);
9687 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
9688 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
9689 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
9690 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
9691 #if STREAMSIZE_BITS == 64
9692 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
9693 #else
9694 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
9695 #endif
9696 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, size_t size, streamsize count)
9698 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9699 IOSB_iostate state = IOSTATE_goodbit;
9701 TRACE("(%p %p %Iu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9703 this->count = 0;
9705 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9706 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
9707 if(avail > count)
9708 avail = count;
9710 if(avail == -1)
9711 state |= IOSTATE_eofbit;
9712 else if(avail > 0)
9713 basic_istream_wchar__Read_s(this, str, size, avail);
9714 }else {
9715 state |= IOSTATE_failbit;
9717 basic_istream_wchar_sentry_destroy(this);
9719 basic_ios_wchar_setstate(base, state);
9720 return this->count;
9723 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
9724 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
9725 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
9726 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
9727 #if STREAMSIZE_BITS == 64
9728 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
9729 #else
9730 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
9731 #endif
9732 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
9734 return basic_istream_wchar__Readsome_s(this, str, count, count);
9737 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
9738 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
9739 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
9740 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
9741 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
9742 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
9744 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9745 IOSB_iostate state = IOSTATE_goodbit;
9747 TRACE("(%p %c)\n", this, ch);
9749 this->count = 0;
9751 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9752 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9754 if(!ios_base_good(&base->base))
9755 state |= IOSTATE_failbit;
9756 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
9757 state |= IOSTATE_badbit;
9759 basic_istream_wchar_sentry_destroy(this);
9761 basic_ios_wchar_setstate(base, state);
9762 return this;
9765 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
9766 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
9767 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
9768 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
9769 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
9770 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
9772 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9773 IOSB_iostate state = IOSTATE_goodbit;
9775 TRACE("(%p)\n", this);
9777 this->count = 0;
9779 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9780 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9782 if(!ios_base_good(&base->base))
9783 state |= IOSTATE_failbit;
9784 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
9785 state |= IOSTATE_badbit;
9787 basic_istream_wchar_sentry_destroy(this);
9789 basic_ios_wchar_setstate(base, state);
9790 return this;
9793 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
9794 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
9795 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
9796 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
9797 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
9798 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
9800 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9801 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9803 TRACE("(%p)\n", this);
9805 if(!strbuf)
9806 return -1;
9808 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9809 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
9810 basic_istream_wchar_sentry_destroy(this);
9811 return 0;
9814 basic_istream_wchar_sentry_destroy(this);
9816 basic_ios_wchar_setstate(base, IOSTATE_badbit);
9817 return -1;
9820 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9821 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9822 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9823 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9824 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
9825 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
9827 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9829 TRACE("(%p %p)\n", this, ret);
9831 if(ios_base_fail(&base->base)) {
9832 ret->off = -1;
9833 ret->pos = 0;
9834 ret->state = 0;
9835 return ret;
9838 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
9839 ret, 0, SEEKDIR_cur, OPENMODE_in);
9841 return ret;
9844 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
9845 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
9846 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
9847 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
9848 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
9849 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
9850 #if STREAMOFF_BITS == 64
9851 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
9852 #else
9853 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
9854 #endif
9855 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
9857 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9859 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
9861 if(!ios_base_fail(&base->base)) {
9862 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9863 fpos_int ret;
9865 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
9868 return this;
9871 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9872 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9873 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9874 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9875 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
9876 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
9878 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9880 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
9882 if(!ios_base_fail(&base->base)) {
9883 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9884 fpos_int ret;
9886 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
9889 return this;
9892 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
9894 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9895 int state = IOSTATE_goodbit;
9897 TRACE("(%p %p)\n", this, v);
9899 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9900 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9901 istreambuf_iterator_wchar first={0}, last={0};
9902 LONG tmp;
9904 first.strbuf = strbuf;
9905 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
9907 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
9908 *v = tmp;
9909 else
9910 state |= IOSTATE_failbit;
9912 basic_istream_wchar_sentry_destroy(this);
9914 basic_ios_wchar_setstate(base, state);
9915 return this;
9918 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
9919 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
9920 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
9921 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
9923 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
9924 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9927 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
9928 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
9929 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
9930 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
9932 return basic_istream_read_short(this, v, num_get_short_use_facet(
9933 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9936 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
9937 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
9938 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
9939 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
9941 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9942 int state = IOSTATE_goodbit;
9944 TRACE("(%p %p)\n", this, v);
9946 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9947 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9948 const num_get *numget = num_get_wchar_use_facet(IOS_LOCALE(strbuf));
9949 istreambuf_iterator_wchar first={0}, last={0};
9951 first.strbuf = strbuf;
9952 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
9954 basic_istream_wchar_sentry_destroy(this);
9956 basic_ios_wchar_setstate(base, state);
9957 return this;
9960 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
9962 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9963 int state = IOSTATE_goodbit;
9965 TRACE("(%p %p)\n", this, v);
9967 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9968 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9969 istreambuf_iterator_wchar first={0}, last={0};
9971 first.strbuf = strbuf;
9972 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9974 basic_istream_wchar_sentry_destroy(this);
9976 basic_ios_wchar_setstate(base, state);
9977 return this;
9980 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAH@Z */
9981 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
9982 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
9983 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
9985 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
9986 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9989 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
9990 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
9991 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
9992 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
9994 return basic_istream_read_int(this, v, num_get_short_use_facet(
9995 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9998 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
10000 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10001 int state = IOSTATE_goodbit;
10003 TRACE("(%p %p)\n", this, v);
10005 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10006 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10007 istreambuf_iterator_wchar first={0}, last={0};
10009 first.strbuf = strbuf;
10010 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
10012 basic_istream_wchar_sentry_destroy(this);
10014 basic_ios_wchar_setstate(base, state);
10015 return this;
10018 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
10019 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
10020 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
10021 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
10023 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
10024 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10027 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
10028 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
10029 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
10030 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
10032 return basic_istream_read_uint(this, v, num_get_short_use_facet(
10033 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10036 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
10038 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10039 int state = IOSTATE_goodbit;
10041 TRACE("(%p %p)\n", this, v);
10043 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10044 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10045 istreambuf_iterator_wchar first={0}, last={0};
10047 first.strbuf = strbuf;
10048 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10050 basic_istream_wchar_sentry_destroy(this);
10052 basic_ios_wchar_setstate(base, state);
10053 return this;
10056 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10057 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10058 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
10059 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
10061 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
10062 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10065 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10066 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10067 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
10068 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
10070 return basic_istream_read_long(this, v, num_get_short_use_facet(
10071 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10074 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
10076 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10077 int state = IOSTATE_goodbit;
10079 TRACE("(%p %p)\n", this, v);
10081 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10082 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10083 istreambuf_iterator_wchar first={0}, last={0};
10085 first.strbuf = strbuf;
10086 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
10088 basic_istream_wchar_sentry_destroy(this);
10090 basic_ios_wchar_setstate(base, state);
10091 return this;
10094 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
10095 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
10096 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
10097 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
10099 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
10100 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10103 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
10104 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
10105 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
10106 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
10108 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
10109 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10112 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
10114 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10115 int state = IOSTATE_goodbit;
10117 TRACE("(%p %p)\n", this, v);
10119 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10120 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10121 istreambuf_iterator_wchar first={0}, last={0};
10123 first.strbuf = strbuf;
10124 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
10126 basic_istream_wchar_sentry_destroy(this);
10128 basic_ios_wchar_setstate(base, state);
10129 return this;
10132 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
10133 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
10134 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
10135 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
10137 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
10138 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10141 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
10142 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
10143 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
10144 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
10146 return basic_istream_read_float(this, v, num_get_short_use_facet(
10147 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10150 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
10152 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10153 int state = IOSTATE_goodbit;
10155 TRACE("(%p %p)\n", this, v);
10157 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10158 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10159 istreambuf_iterator_wchar first={0}, last={0};
10161 first.strbuf = strbuf;
10162 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
10164 basic_istream_wchar_sentry_destroy(this);
10166 basic_ios_wchar_setstate(base, state);
10167 return this;
10170 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
10171 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
10172 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
10173 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
10175 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
10176 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10179 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
10180 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
10181 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
10182 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
10184 return basic_istream_read_double(this, v, num_get_short_use_facet(
10185 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10188 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
10190 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10191 int state = IOSTATE_goodbit;
10193 TRACE("(%p %p)\n", this, v);
10195 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10196 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10197 istreambuf_iterator_wchar first={0}, last={0};
10199 first.strbuf = strbuf;
10200 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
10202 basic_istream_wchar_sentry_destroy(this);
10204 basic_ios_wchar_setstate(base, state);
10205 return this;
10208 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
10209 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
10210 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
10211 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
10213 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
10214 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10217 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
10218 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
10219 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
10220 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
10222 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
10223 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10226 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
10228 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10229 int state = IOSTATE_goodbit;
10231 TRACE("(%p %p)\n", this, v);
10233 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10234 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10235 istreambuf_iterator_wchar first={0}, last={0};
10237 first.strbuf = strbuf;
10238 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
10240 basic_istream_wchar_sentry_destroy(this);
10242 basic_ios_wchar_setstate(base, state);
10243 return this;
10246 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
10247 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10248 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
10249 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
10251 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
10252 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10255 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
10256 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10257 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
10258 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
10260 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
10261 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10264 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
10266 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10267 int state = IOSTATE_goodbit;
10269 TRACE("(%p %p)\n", this, v);
10271 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10272 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10273 istreambuf_iterator_wchar first={0}, last={0};
10275 first.strbuf = strbuf;
10276 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
10278 basic_istream_wchar_sentry_destroy(this);
10280 basic_ios_wchar_setstate(base, state);
10281 return this;
10284 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
10285 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
10286 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
10287 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
10289 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
10290 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10293 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
10294 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
10295 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
10296 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
10298 return basic_istream_read_int64(this, v, num_get_short_use_facet(
10299 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10302 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
10304 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10305 int state = IOSTATE_goodbit;
10307 TRACE("(%p %p)\n", this, v);
10309 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10310 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10311 istreambuf_iterator_wchar first={0}, last={0};
10313 first.strbuf = strbuf;
10314 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
10316 basic_istream_wchar_sentry_destroy(this);
10318 basic_ios_wchar_setstate(base, state);
10319 return this;
10322 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
10323 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
10324 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
10325 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10327 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
10328 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10331 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
10332 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
10333 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
10334 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10336 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
10337 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10340 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, bool *v, const num_get *numget)
10342 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10343 int state = IOSTATE_goodbit;
10345 TRACE("(%p %p)\n", this, v);
10347 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10348 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10349 istreambuf_iterator_wchar first={0}, last={0};
10351 first.strbuf = strbuf;
10352 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
10354 basic_istream_wchar_sentry_destroy(this);
10356 basic_ios_wchar_setstate(base, state);
10357 return this;
10360 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
10361 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
10362 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
10363 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, bool *v)
10365 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
10366 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10369 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
10370 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
10371 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
10372 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, bool *v)
10374 return basic_istream_read_bool(this, v, num_get_short_use_facet(
10375 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10378 /* ??$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 */
10379 /* ??$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 */
10380 /* ??$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 */
10381 /* ??$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 */
10382 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
10383 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
10385 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10386 IOSB_iostate state = IOSTATE_goodbit;
10387 int c = delim;
10389 TRACE("(%p %p %s)\n", istream, str, debugstr_wn(&delim, 1));
10391 MSVCP_basic_string_wchar_clear(str);
10392 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10393 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10395 c = basic_streambuf_wchar_sgetc(strbuf);
10396 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
10397 MSVCP_basic_string_wchar_append_ch(str, c);
10398 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
10399 else if(c==WEOF) state |= IOSTATE_eofbit;
10401 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
10403 basic_istream_wchar_sentry_destroy(istream);
10405 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
10406 return istream;
10409 /* ??$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 */
10410 /* ??$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 */
10411 /* ??$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 */
10412 /* ??$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 */
10413 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
10414 basic_istream_wchar *istream, basic_string_wchar *str)
10416 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
10419 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
10420 basic_string_wchar *str, const ctype_wchar *ctype)
10422 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10423 IOSB_iostate state = IOSTATE_failbit;
10424 int c = '\n';
10426 TRACE("(%p %p)\n", istream, str);
10428 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10429 size_t count = ios_base_width_get(&base->base);
10431 if(!count)
10432 count = -1;
10434 MSVCP_basic_string_wchar_clear(str);
10436 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10437 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10438 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10439 state = IOSTATE_goodbit;
10440 MSVCP_basic_string_wchar_append_ch(str, c);
10443 basic_istream_wchar_sentry_destroy(istream);
10445 ios_base_width_set(&base->base, 0);
10446 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10447 return istream;
10450 /* ??$?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 */
10451 /* ??$?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 */
10452 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
10453 basic_istream_wchar *istream, basic_string_wchar *str)
10455 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
10456 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10459 /* ??$?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 */
10460 /* ??$?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 */
10461 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
10462 basic_istream_wchar *istream, basic_string_wchar *str)
10464 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
10465 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10468 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
10470 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10471 IOSB_iostate state = IOSTATE_failbit;
10472 unsigned short c = '\n';
10474 TRACE("(%p %p)\n", istream, str);
10476 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10477 size_t count = ios_base_width_get(&base->base)-1;
10479 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10480 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10481 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10482 state = IOSTATE_goodbit;
10483 *str++ = c;
10486 basic_istream_wchar_sentry_destroy(istream);
10488 *str = 0;
10489 ios_base_width_set(&base->base, 0);
10490 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10491 return istream;
10494 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
10495 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
10496 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
10498 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
10499 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10502 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
10503 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
10504 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
10506 return basic_istream_read_str(istream, str, ctype_short_use_facet(
10507 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10510 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
10511 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
10512 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
10513 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
10514 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
10516 IOSB_iostate state = IOSTATE_failbit;
10517 unsigned short c = 0;
10519 TRACE("(%p %p)\n", istream, ch);
10521 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10522 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
10523 basic_istream_wchar_get_basic_ios(istream)));
10524 if(c != WEOF) {
10525 state = IOSTATE_goodbit;
10526 *ch = c;
10529 basic_istream_wchar_sentry_destroy(istream);
10531 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
10532 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10533 return istream;
10536 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10537 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10538 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10539 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10540 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
10541 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
10542 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
10544 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10545 IOSB_iostate state = IOSTATE_failbit;
10546 unsigned short c = '\n';
10548 TRACE("(%p %p)\n", this, streambuf);
10550 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10551 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
10552 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
10553 state = IOSTATE_goodbit;
10554 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
10555 break;
10558 basic_istream_wchar_sentry_destroy(this);
10560 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10561 return this;
10564 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10565 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10566 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10567 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10568 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
10569 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
10570 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
10572 TRACE("(%p %p)\n", this, pfunc);
10573 pfunc(this);
10574 return this;
10577 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
10578 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
10579 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
10580 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
10581 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
10582 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
10583 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
10585 TRACE("(%p %p)\n", this, pfunc);
10586 pfunc(basic_istream_wchar_get_basic_ios(this));
10587 return this;
10590 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10591 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10592 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10593 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10594 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
10595 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
10596 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
10598 TRACE("(%p %p)\n", this, pfunc);
10599 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
10600 return this;
10603 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
10604 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
10605 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
10606 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
10607 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_swap, 8)
10608 void __thiscall basic_istream_wchar_swap(basic_istream_wchar *this, basic_istream_wchar *r)
10610 TRACE("(%p %p)\n", this, r);
10612 if(this == r)
10613 return;
10615 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(this),
10616 basic_istream_wchar_get_basic_ios(r));
10617 this->count ^= r->count;
10618 r->count ^= this->count;
10619 this->count ^= r->count;
10622 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
10624 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
10627 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
10629 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
10632 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10633 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10634 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
10635 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, bool virt_init)
10637 basic_ios_char *basic_ios;
10639 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10641 if(virt_init) {
10642 this->base1.vbtable = basic_iostream_char_vbtable1;
10643 this->base2.vbtable = basic_iostream_char_vbtable2;
10644 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10645 basic_ios_char_ctor(basic_ios);
10646 }else {
10647 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10650 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
10652 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
10653 basic_ostream_char_ctor(&this->base2, NULL, FALSE, FALSE, FALSE);
10654 return this;
10657 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10658 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10659 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
10660 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
10662 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10664 TRACE("(%p)\n", this);
10665 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
10666 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
10669 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10670 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10671 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
10672 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
10674 TRACE("(%p)\n", this);
10675 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
10676 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
10679 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
10680 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10682 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10684 TRACE("(%p %x)\n", this, flags);
10686 if(flags & 2) {
10687 /* we have an array, with the number of elements stored before the first object */
10688 INT_PTR i, *ptr = (INT_PTR *)this-1;
10690 for(i=*ptr-1; i>=0; i--)
10691 basic_iostream_char_vbase_dtor(this+i);
10692 MSVCRT_operator_delete(ptr);
10693 } else {
10694 basic_iostream_char_vbase_dtor(this);
10695 if(flags & 1)
10696 MSVCRT_operator_delete(this);
10699 return this;
10702 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
10703 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
10704 DEFINE_THISCALL_WRAPPER(basic_iostream_char_swap, 8)
10705 void __thiscall basic_iostream_char_swap(basic_iostream_char *this, basic_iostream_char *r)
10707 TRACE("(%p %p)\n", this, r);
10709 if(this == r)
10710 return;
10712 basic_ios_char_swap(basic_istream_char_get_basic_ios(&this->base1),
10713 basic_istream_char_get_basic_ios(&r->base1));
10716 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
10718 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
10721 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10723 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
10726 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10727 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10728 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
10729 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
10730 basic_streambuf_wchar *strbuf, bool virt_init)
10732 basic_ios_wchar *basic_ios;
10734 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10736 if(virt_init) {
10737 this->base1.vbtable = basic_iostream_wchar_vbtable1;
10738 this->base2.vbtable = basic_iostream_wchar_vbtable2;
10739 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10740 basic_ios_wchar_ctor(basic_ios);
10741 }else {
10742 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10745 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
10746 basic_ostream_short_ctor(&this->base2, NULL, FALSE, FALSE, FALSE);
10748 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
10749 return this;
10752 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10753 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10754 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
10755 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
10756 basic_streambuf_wchar *strbuf, bool virt_init)
10758 basic_iostream_wchar_ctor(this, strbuf, virt_init);
10759 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
10760 return this;
10763 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10764 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10765 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10766 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10767 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
10768 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
10770 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10772 TRACE("(%p)\n", this);
10773 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
10774 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
10777 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10778 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10779 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10780 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10781 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
10782 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
10784 TRACE("(%p)\n", this);
10785 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
10786 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
10789 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
10790 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10792 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10794 TRACE("(%p %x)\n", this, flags);
10796 if(flags & 2) {
10797 /* we have an array, with the number of elements stored before the first object */
10798 INT_PTR i, *ptr = (INT_PTR *)this-1;
10800 for(i=*ptr-1; i>=0; i--)
10801 basic_iostream_wchar_vbase_dtor(this+i);
10802 MSVCRT_operator_delete(ptr);
10803 } else {
10804 basic_iostream_wchar_vbase_dtor(this);
10805 if(flags & 1)
10806 MSVCRT_operator_delete(this);
10809 return this;
10812 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
10813 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
10814 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
10815 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
10816 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_swap, 8)
10817 void __thiscall basic_iostream_wchar_swap(basic_iostream_wchar *this, basic_iostream_wchar *r)
10819 TRACE("(%p %p)\n", this, r);
10821 if(this == r)
10822 return;
10824 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(&this->base1),
10825 basic_istream_wchar_get_basic_ios(&r->base1));
10828 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
10830 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
10833 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
10835 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
10838 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10839 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10840 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
10841 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, bool virt_init)
10843 basic_ios_char *basic_ios;
10845 TRACE("(%p %d)\n", this, virt_init);
10847 if(virt_init) {
10848 this->base.vbtable = basic_ofstream_char_vbtable;
10849 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10850 basic_ios_char_ctor(basic_ios);
10851 }else {
10852 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10855 basic_filebuf_char_ctor(&this->filebuf);
10856 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
10857 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10858 return this;
10861 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10862 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10863 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
10864 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
10865 basic_ofstream_char *this, FILE *file, bool virt_init)
10867 basic_ios_char *basic_ios;
10869 TRACE("(%p %p %d)\n", this, file, virt_init);
10871 if(virt_init) {
10872 this->base.vbtable = basic_ofstream_char_vbtable;
10873 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10874 basic_ios_char_ctor(basic_ios);
10875 }else {
10876 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10879 basic_filebuf_char_ctor_file(&this->filebuf, file);
10880 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
10881 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10882 return this;
10885 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
10886 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
10887 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_copy_ctor, 12)
10888 basic_ofstream_char* __thiscall basic_ofstream_char_copy_ctor(basic_ofstream_char *this,
10889 basic_ofstream_char *copy, bool virt_init)
10891 TRACE("(%p %p %d)\n", this, copy, virt_init);
10892 return basic_ofstream_char_ctor_file(this, copy->filebuf.file, virt_init);
10895 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
10896 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
10897 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 16)
10898 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
10899 const char *name, int mode, bool virt_init)
10901 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10903 basic_ofstream_char_ctor(this, virt_init);
10905 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
10906 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10907 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10909 return this;
10912 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10913 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10914 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
10915 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
10917 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10919 TRACE("(%p)\n", this);
10921 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
10922 basic_filebuf_char_dtor(&this->filebuf);
10925 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10926 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10927 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
10928 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
10930 TRACE("(%p)\n", this);
10932 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
10933 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
10936 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
10937 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10939 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10941 TRACE("(%p %x)\n", this, flags);
10943 if(flags & 2) {
10944 /* we have an array, with the number of elements stored before the first object */
10945 INT_PTR i, *ptr = (INT_PTR *)this-1;
10947 for(i=*ptr-1; i>=0; i--)
10948 basic_ofstream_char_vbase_dtor(this+i);
10949 MSVCRT_operator_delete(ptr);
10950 } else {
10951 basic_ofstream_char_vbase_dtor(this);
10952 if(flags & 1)
10953 MSVCRT_operator_delete(this);
10956 return this;
10959 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10960 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10961 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
10962 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
10964 TRACE("(%p)\n", this);
10966 if(!basic_filebuf_char_close(&this->filebuf)) {
10967 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10968 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10972 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10973 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10974 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
10975 bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
10977 TRACE("(%p)\n", this);
10978 return basic_filebuf_char_is_open(&this->filebuf);
10981 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
10982 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
10983 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 12)
10984 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
10985 const char *name, int mode)
10987 TRACE("(%p %s %d)\n", this, name, mode);
10989 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
10990 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10991 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10995 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
10996 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
10997 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
10998 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
10999 const char *name, short mode)
11001 basic_ofstream_char_open(this, name, mode);
11004 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11005 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11006 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
11007 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
11009 TRACE("(%p)\n", this);
11010 return (basic_filebuf_char*)&this->filebuf;
11013 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
11015 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
11018 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11020 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
11023 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11024 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11025 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
11026 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, bool virt_init)
11028 basic_ios_wchar *basic_ios;
11030 TRACE("(%p %d)\n", this, virt_init);
11032 if(virt_init) {
11033 this->base.vbtable = basic_ofstream_wchar_vbtable;
11034 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11035 basic_ios_wchar_ctor(basic_ios);
11036 }else {
11037 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11040 basic_filebuf_wchar_ctor(&this->filebuf);
11041 basic_ostream_short_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
11042 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11043 return this;
11046 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11047 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11048 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
11049 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, bool virt_init)
11051 basic_ofstream_wchar_ctor(this, virt_init);
11052 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11053 return this;
11056 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11057 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11058 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
11059 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
11060 basic_ofstream_wchar *this, FILE *file, bool virt_init)
11062 basic_ios_wchar *basic_ios;
11064 TRACE("(%p %p %d)\n", this, file, virt_init);
11066 if(virt_init) {
11067 this->base.vbtable = basic_ofstream_wchar_vbtable;
11068 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11069 basic_ios_wchar_ctor(basic_ios);
11070 }else {
11071 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11074 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11075 basic_ostream_short_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
11076 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11077 return this;
11080 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11081 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11082 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
11083 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
11084 basic_ofstream_wchar *this, FILE *file, bool virt_init)
11086 basic_ofstream_wchar_ctor_file(this, file, virt_init);
11087 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11088 return this;
11091 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
11092 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
11093 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_copy_ctor, 12)
11094 basic_ofstream_wchar* __thiscall basic_ofstream_short_copy_ctor(basic_ofstream_wchar *this,
11095 basic_ofstream_wchar *copy, bool virt_init)
11097 TRACE("(%p %p %d)\n", this, copy, virt_init);
11098 return basic_ofstream_short_ctor_file(this, copy->filebuf.file, virt_init);
11101 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
11102 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
11103 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 16)
11104 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
11105 const char *name, int mode, bool virt_init)
11107 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11109 basic_ofstream_short_ctor(this, virt_init);
11111 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
11112 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11113 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11115 return this;
11118 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11119 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11120 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11121 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11122 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
11123 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
11125 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11127 TRACE("(%p)\n", this);
11129 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11130 basic_filebuf_wchar_dtor(&this->filebuf);
11133 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11134 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11135 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11136 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11137 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
11138 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
11140 TRACE("(%p)\n", this);
11142 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
11143 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
11146 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
11147 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11149 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11151 TRACE("(%p %x)\n", this, flags);
11153 if(flags & 2) {
11154 /* we have an array, with the number of elements stored before the first object */
11155 INT_PTR i, *ptr = (INT_PTR *)this-1;
11157 for(i=*ptr-1; i>=0; i--)
11158 basic_ofstream_wchar_vbase_dtor(this+i);
11159 MSVCRT_operator_delete(ptr);
11160 } else {
11161 basic_ofstream_wchar_vbase_dtor(this);
11162 if(flags & 1)
11163 MSVCRT_operator_delete(this);
11166 return this;
11169 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11170 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11171 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11172 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11173 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
11174 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
11176 TRACE("(%p)\n", this);
11178 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11179 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11180 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11184 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11185 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11186 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11187 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11188 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
11189 bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
11191 TRACE("(%p)\n", this);
11192 return basic_filebuf_wchar_is_open(&this->filebuf);
11195 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
11196 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
11197 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 12)
11198 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
11199 const char *name, int mode)
11201 TRACE("(%p %s %d)\n", this, name, mode);
11203 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
11204 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11205 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11209 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
11210 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
11211 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
11212 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
11213 const char *name, int mode)
11215 basic_ofstream_wchar_open(this, name, mode);
11218 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11219 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11220 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11221 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11222 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
11223 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
11225 TRACE("(%p)\n", this);
11226 return (basic_filebuf_wchar*)&this->filebuf;
11229 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
11231 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
11234 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
11236 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
11239 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11240 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11241 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
11242 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, bool virt_init)
11244 basic_ios_char *basic_ios;
11246 TRACE("(%p %d)\n", this, virt_init);
11248 if(virt_init) {
11249 this->base.vbtable = basic_ifstream_char_vbtable;
11250 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11251 basic_ios_char_ctor(basic_ios);
11252 }else {
11253 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11256 basic_filebuf_char_ctor(&this->filebuf);
11257 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11258 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11259 return this;
11262 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11263 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11264 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
11265 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
11266 basic_ifstream_char *this, FILE *file, bool virt_init)
11268 basic_ios_char *basic_ios;
11270 TRACE("(%p %p %d)\n", this, file, virt_init);
11272 if(virt_init) {
11273 this->base.vbtable = basic_ifstream_char_vbtable;
11274 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11275 basic_ios_char_ctor(basic_ios);
11276 }else {
11277 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11280 basic_filebuf_char_ctor_file(&this->filebuf, file);
11281 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11282 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11283 return this;
11286 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
11287 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
11288 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_copy_ctor, 12)
11289 basic_ifstream_char* __thiscall basic_ifstream_char_copy_ctor(basic_ifstream_char *this,
11290 const basic_ifstream_char *copy, bool virt_init)
11292 TRACE("(%p %p %d)\n", this, copy, virt_init);
11293 return basic_ifstream_char_ctor_file(this, copy->filebuf.file, virt_init);
11296 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
11297 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
11298 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 16)
11299 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
11300 const char *name, int mode, bool virt_init)
11302 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11304 basic_ifstream_char_ctor(this, virt_init);
11306 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11307 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11308 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11310 return this;
11313 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11314 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11315 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
11316 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
11318 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11320 TRACE("(%p)\n", this);
11322 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11323 basic_filebuf_char_dtor(&this->filebuf);
11326 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11327 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11328 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
11329 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
11331 TRACE("(%p)\n", this);
11333 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
11334 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11337 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
11338 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11340 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11342 TRACE("(%p %x)\n", this, flags);
11344 if(flags & 2) {
11345 /* we have an array, with the number of elements stored before the first object */
11346 INT_PTR i, *ptr = (INT_PTR *)this-1;
11348 for(i=*ptr-1; i>=0; i--)
11349 basic_ifstream_char_vbase_dtor(this+i);
11350 MSVCRT_operator_delete(ptr);
11351 } else {
11352 basic_ifstream_char_vbase_dtor(this);
11353 if(flags & 1)
11354 MSVCRT_operator_delete(this);
11357 return this;
11360 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11361 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11362 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
11363 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
11365 TRACE("(%p)\n", this);
11367 if(!basic_filebuf_char_close(&this->filebuf)) {
11368 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11369 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11373 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11374 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11375 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
11376 bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
11378 TRACE("(%p)\n", this);
11379 return basic_filebuf_char_is_open(&this->filebuf);
11382 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
11383 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
11384 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 12)
11385 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
11386 const char *name, int mode)
11388 TRACE("(%p %s %d)\n", this, name, mode);
11390 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11391 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11392 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11396 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
11397 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
11398 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
11399 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
11400 const char *name, short mode)
11402 basic_ifstream_char_open(this, name, mode);
11405 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11406 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11407 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
11408 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
11410 TRACE("(%p)\n", this);
11411 return (basic_filebuf_char*)&this->filebuf;
11414 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
11416 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
11419 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11421 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
11424 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11425 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11426 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
11427 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, bool virt_init)
11429 basic_ios_wchar *basic_ios;
11431 TRACE("(%p %d)\n", this, virt_init);
11433 if(virt_init) {
11434 this->base.vbtable = basic_ifstream_wchar_vbtable;
11435 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11436 basic_ios_wchar_ctor(basic_ios);
11437 }else {
11438 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11441 basic_filebuf_wchar_ctor(&this->filebuf);
11442 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11443 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11444 return this;
11447 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11448 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11449 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
11450 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, bool virt_init)
11452 basic_ifstream_wchar_ctor(this, virt_init);
11453 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11454 return this;
11457 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11458 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11459 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
11460 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
11461 basic_ifstream_wchar *this, FILE *file, bool virt_init)
11463 basic_ios_wchar *basic_ios;
11465 TRACE("(%p %p %d)\n", this, file, virt_init);
11467 if(virt_init) {
11468 this->base.vbtable = basic_ifstream_wchar_vbtable;
11469 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11470 basic_ios_wchar_ctor(basic_ios);
11471 }else {
11472 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11475 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11476 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11477 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11478 return this;
11481 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11482 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11483 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
11484 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
11485 basic_ifstream_wchar *this, FILE *file, bool virt_init)
11487 basic_ifstream_wchar_ctor_file(this, file, virt_init);
11488 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11489 return this;
11492 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
11493 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
11494 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_copy_ctor, 12)
11495 basic_ifstream_wchar* __thiscall basic_ifstream_short_copy_ctor(basic_ifstream_wchar *this,
11496 basic_ifstream_wchar *copy, bool virt_init)
11498 TRACE("(%p %p %d)\n", this, copy, virt_init);
11499 return basic_ifstream_short_ctor_file(this, copy->filebuf.file, virt_init);
11502 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
11503 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
11504 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 16)
11505 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
11506 const char *name, int mode, bool virt_init)
11508 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11510 basic_ifstream_short_ctor(this, virt_init);
11512 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11513 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11514 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11516 return this;
11519 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11520 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11521 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11522 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11523 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
11524 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
11526 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11528 TRACE("(%p)\n", this);
11530 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
11531 basic_filebuf_wchar_dtor(&this->filebuf);
11534 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11535 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11536 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11537 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11538 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
11539 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
11541 TRACE("(%p)\n", this);
11543 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
11544 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
11547 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
11548 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11550 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11552 TRACE("(%p %x)\n", this, flags);
11554 if(flags & 2) {
11555 /* we have an array, with the number of elements stored before the first object */
11556 INT_PTR i, *ptr = (INT_PTR *)this-1;
11558 for(i=*ptr-1; i>=0; i--)
11559 basic_ifstream_wchar_vbase_dtor(this+i);
11560 MSVCRT_operator_delete(ptr);
11561 } else {
11562 basic_ifstream_wchar_vbase_dtor(this);
11563 if(flags & 1)
11564 MSVCRT_operator_delete(this);
11567 return this;
11570 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11571 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11572 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11573 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11574 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
11575 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
11577 TRACE("(%p)\n", this);
11579 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11580 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11581 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11585 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11586 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11587 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11588 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11589 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
11590 bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
11592 TRACE("(%p)\n", this);
11593 return basic_filebuf_wchar_is_open(&this->filebuf);
11596 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
11597 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
11598 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 12)
11599 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
11600 const char *name, int mode)
11602 TRACE("(%p %s %d)\n", this, name, mode);
11604 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11605 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11606 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11610 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
11611 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
11612 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
11613 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
11614 const char *name, short mode)
11616 basic_ifstream_wchar_open(this, name, mode);
11619 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11620 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11621 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11622 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11623 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
11624 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
11626 TRACE("(%p)\n", this);
11627 return (basic_filebuf_wchar*)&this->filebuf;
11630 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
11632 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
11635 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
11637 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
11640 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11641 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11642 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
11643 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, bool virt_init)
11645 basic_ios_char *basic_ios;
11647 TRACE("(%p %d)\n", this, virt_init);
11649 if(virt_init) {
11650 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11651 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11652 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11653 basic_ios_char_ctor(basic_ios);
11654 }else {
11655 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11658 basic_filebuf_char_ctor(&this->filebuf);
11659 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11660 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11661 return this;
11664 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11665 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11666 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
11667 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
11668 FILE *file, bool virt_init)
11670 basic_ios_char *basic_ios;
11672 TRACE("(%p %p %d)\n", this, file, virt_init);
11674 if(virt_init) {
11675 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11676 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11677 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11678 basic_ios_char_ctor(basic_ios);
11679 }else {
11680 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11683 basic_filebuf_char_ctor_file(&this->filebuf, file);
11684 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11685 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11686 return this;
11689 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
11690 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
11691 DEFINE_THISCALL_WRAPPER(basic_fstream_char_copy_ctor, 12)
11692 basic_fstream_char* __thiscall basic_fstream_char_copy_ctor(basic_fstream_char *this,
11693 basic_fstream_char *copy, bool virt_init)
11695 TRACE("(%p %p %d)\n", this, copy, virt_init);
11696 return basic_fstream_char_ctor_file(this, copy->filebuf.file, virt_init);
11699 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
11700 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
11701 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 16)
11702 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
11703 const char *name, int mode, bool virt_init)
11705 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11707 basic_fstream_char_ctor(this, virt_init);
11709 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
11710 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11711 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11713 return this;
11716 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11717 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11718 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
11719 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
11721 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11723 TRACE("(%p)\n", this);
11725 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
11726 basic_filebuf_char_dtor(&this->filebuf);
11729 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11730 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11731 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
11732 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
11734 TRACE("(%p)\n", this);
11736 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
11737 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
11740 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
11741 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11743 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11745 TRACE("(%p %x)\n", this, flags);
11747 if(flags & 2) {
11748 /* we have an array, with the number of elements stored before the first object */
11749 INT_PTR i, *ptr = (INT_PTR *)this-1;
11751 for(i=*ptr-1; i>=0; i--)
11752 basic_fstream_char_vbase_dtor(this+i);
11753 MSVCRT_operator_delete(ptr);
11754 } else {
11755 basic_fstream_char_vbase_dtor(this);
11756 if(flags & 1)
11757 MSVCRT_operator_delete(this);
11760 return this;
11763 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11764 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11765 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
11766 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
11768 TRACE("(%p)\n", this);
11770 if(!basic_filebuf_char_close(&this->filebuf)) {
11771 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11772 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11776 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11777 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11778 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
11779 bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
11781 TRACE("(%p)\n", this);
11782 return basic_filebuf_char_is_open(&this->filebuf);
11785 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
11786 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
11787 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 12)
11788 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
11789 const char *name, int mode)
11791 TRACE("(%p %s %d)\n", this, name, mode);
11793 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
11794 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11795 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11799 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
11800 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
11801 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
11802 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
11803 const char *name, int mode)
11805 basic_fstream_char_open(this, name, mode);
11808 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11809 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11810 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
11811 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
11813 TRACE("(%p)\n", this);
11814 return (basic_filebuf_char*)&this->filebuf;
11817 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
11819 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
11822 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11824 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
11827 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11828 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11829 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
11830 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, bool virt_init)
11832 basic_ios_wchar *basic_ios;
11834 TRACE("(%p %d)\n", this, virt_init);
11836 if(virt_init) {
11837 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11838 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11839 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11840 basic_ios_wchar_ctor(basic_ios);
11841 }else {
11842 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11845 basic_filebuf_wchar_ctor(&this->filebuf);
11846 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11847 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11848 return this;
11851 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11852 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11853 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
11854 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, bool virt_init)
11856 basic_fstream_wchar_ctor(this, virt_init);
11857 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11858 return this;
11861 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11862 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11863 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
11864 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
11865 FILE *file, bool virt_init)
11867 basic_ios_wchar *basic_ios;
11869 TRACE("(%p %p %d)\n", this, file, virt_init);
11871 if(virt_init) {
11872 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11873 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11874 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11875 basic_ios_wchar_ctor(basic_ios);
11876 }else {
11877 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11880 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11881 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11882 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11883 return this;
11886 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11887 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11888 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
11889 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
11890 FILE *file, bool virt_init)
11892 basic_fstream_wchar_ctor_file(this, file, virt_init);
11893 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11894 return this;
11897 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
11898 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
11899 DEFINE_THISCALL_WRAPPER(basic_fstream_short_copy_ctor, 12)
11900 basic_fstream_wchar* __thiscall basic_fstream_short_copy_ctor(basic_fstream_wchar *this,
11901 basic_fstream_wchar *copy, bool virt_init)
11903 TRACE("(%p %p %d)\n", this, copy, virt_init);
11904 return basic_fstream_short_ctor_file(this, copy->filebuf.file, virt_init);
11907 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11908 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11909 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 16)
11910 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
11911 const char *name, int mode, bool virt_init)
11913 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11915 basic_fstream_short_ctor(this, virt_init);
11917 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
11918 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11919 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11921 return this;
11924 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11925 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11926 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11927 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11928 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
11929 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
11931 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11933 TRACE("(%p)\n", this);
11935 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
11936 basic_filebuf_wchar_dtor(&this->filebuf);
11939 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11940 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11941 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11942 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11943 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
11944 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
11946 TRACE("(%p)\n", this);
11948 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
11949 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
11952 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
11953 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11955 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11957 TRACE("(%p %x)\n", this, flags);
11959 if(flags & 2) {
11960 /* we have an array, with the number of elements stored before the first object */
11961 INT_PTR i, *ptr = (INT_PTR *)this-1;
11963 for(i=*ptr-1; i>=0; i--)
11964 basic_fstream_wchar_vbase_dtor(this+i);
11965 MSVCRT_operator_delete(ptr);
11966 } else {
11967 basic_fstream_wchar_vbase_dtor(this);
11968 if(flags & 1)
11969 MSVCRT_operator_delete(this);
11972 return this;
11975 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11976 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11977 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11978 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11979 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
11980 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
11982 TRACE("(%p)\n", this);
11984 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11985 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11986 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11990 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11991 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11992 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11993 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11994 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
11995 bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
11997 TRACE("(%p)\n", this);
11998 return basic_filebuf_wchar_is_open(&this->filebuf);
12001 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
12002 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
12003 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 12)
12004 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
12005 const char *name, int mode)
12007 TRACE("(%p %s %d)\n", this, name, mode);
12009 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
12010 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12011 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12015 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
12016 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
12017 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
12018 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
12019 const char *name, int mode)
12021 basic_fstream_wchar_open(this, name, mode);
12024 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12025 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12026 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12027 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12028 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
12029 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
12031 TRACE("(%p)\n", this);
12032 return (basic_filebuf_wchar*)&this->filebuf;
12035 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
12037 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
12040 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
12042 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
12045 /* ??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 */
12046 /* ??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 */
12047 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
12048 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
12049 const basic_string_char *str, int mode, bool virt_init)
12051 basic_ios_char *basic_ios;
12053 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12055 if(virt_init) {
12056 this->base.vbtable = basic_ostringstream_char_vbtable;
12057 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12058 basic_ios_char_ctor(basic_ios);
12059 }else {
12060 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12063 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12064 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12065 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12066 return this;
12069 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12070 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12071 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
12072 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
12073 basic_ostringstream_char *this, int mode, bool virt_init)
12075 basic_ios_char *basic_ios;
12077 TRACE("(%p %d %d)\n", this, mode, virt_init);
12079 if(virt_init) {
12080 this->base.vbtable = basic_ostringstream_char_vbtable;
12081 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12082 basic_ios_char_ctor(basic_ios);
12083 }else {
12084 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12087 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12088 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12089 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12090 return this;
12093 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12094 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12095 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
12096 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
12097 basic_ostringstream_char *this)
12099 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
12102 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12103 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12104 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
12105 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
12107 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12109 TRACE("(%p)\n", this);
12111 basic_stringbuf_char_dtor(&this->strbuf);
12112 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
12115 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12116 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12117 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
12118 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
12120 TRACE("(%p)\n", this);
12122 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
12123 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
12126 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
12127 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12129 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12131 TRACE("(%p %x)\n", this, flags);
12133 if(flags & 2) {
12134 /* we have an array, with the number of elements stored before the first object */
12135 INT_PTR i, *ptr = (INT_PTR *)this-1;
12137 for(i=*ptr-1; i>=0; i--)
12138 basic_ostringstream_char_vbase_dtor(this+i);
12139 MSVCRT_operator_delete(ptr);
12140 } else {
12141 basic_ostringstream_char_vbase_dtor(this);
12142 if(flags & 1)
12143 MSVCRT_operator_delete(this);
12146 return this;
12149 /* ?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 */
12150 /* ?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 */
12151 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
12152 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
12154 TRACE("(%p)\n", this);
12155 return (basic_stringbuf_char*)&this->strbuf;
12158 /* ?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 */
12159 /* ?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 */
12160 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
12161 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
12163 TRACE("(%p %p)\n", this, str);
12164 basic_stringbuf_char_str_set(&this->strbuf, str);
12167 /* ?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 */
12168 /* ?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 */
12169 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
12170 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
12172 TRACE("(%p %p)\n", this, ret);
12173 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12176 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
12178 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
12181 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12183 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
12186 /* ??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 */
12187 /* ??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 */
12188 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
12189 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
12190 const basic_string_wchar *str, int mode, bool virt_init)
12192 basic_ios_wchar *basic_ios;
12194 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12196 if(virt_init) {
12197 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12198 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12199 basic_ios_wchar_ctor(basic_ios);
12200 }else {
12201 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12204 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12205 basic_ostream_short_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12206 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12207 return this;
12210 /* ??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 */
12211 /* ??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 */
12212 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
12213 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
12214 const basic_string_wchar *str, int mode, bool virt_init)
12216 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
12217 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12218 return this;
12221 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12222 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12223 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
12224 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
12225 basic_ostringstream_wchar *this, int mode, bool virt_init)
12227 basic_ios_wchar *basic_ios;
12229 TRACE("(%p %d %d)\n", this, mode, virt_init);
12231 if(virt_init) {
12232 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12233 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12234 basic_ios_wchar_ctor(basic_ios);
12235 }else {
12236 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12239 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12240 basic_ostream_short_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12241 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12242 return this;
12245 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12246 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12247 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
12248 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
12249 basic_ostringstream_wchar *this, int mode, bool virt_init)
12251 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
12252 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12253 return this;
12256 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12257 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12258 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
12259 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
12260 basic_ostringstream_wchar *this)
12262 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
12265 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12266 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12267 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
12268 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
12269 basic_ostringstream_wchar *this)
12271 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
12274 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12275 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12276 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12277 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12278 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
12279 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
12281 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12283 TRACE("(%p)\n", this);
12285 basic_stringbuf_wchar_dtor(&this->strbuf);
12286 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
12289 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12290 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12291 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12292 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12293 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
12294 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
12296 TRACE("(%p)\n", this);
12298 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
12299 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
12302 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
12303 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12305 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12307 TRACE("(%p %x)\n", this, flags);
12309 if(flags & 2) {
12310 /* we have an array, with the number of elements stored before the first object */
12311 INT_PTR i, *ptr = (INT_PTR *)this-1;
12313 for(i=*ptr-1; i>=0; i--)
12314 basic_ostringstream_wchar_vbase_dtor(this+i);
12315 MSVCRT_operator_delete(ptr);
12316 } else {
12317 basic_ostringstream_wchar_vbase_dtor(this);
12318 if(flags & 1)
12319 MSVCRT_operator_delete(this);
12322 return this;
12325 /* ?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 */
12326 /* ?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 */
12327 /* ?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 */
12328 /* ?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 */
12329 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
12330 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
12332 TRACE("(%p)\n", this);
12333 return (basic_stringbuf_wchar*)&this->strbuf;
12336 /* ?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 */
12337 /* ?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 */
12338 /* ?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 */
12339 /* ?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 */
12340 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
12341 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
12343 TRACE("(%p %p)\n", this, str);
12344 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12347 /* ?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 */
12348 /* ?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 */
12349 /* ?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 */
12350 /* ?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 */
12351 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
12352 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
12354 TRACE("(%p %p)\n", this, ret);
12355 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12358 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
12360 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
12363 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
12365 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
12368 /* ??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 */
12369 /* ??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 */
12370 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
12371 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
12372 const basic_string_char *str, int mode, bool virt_init)
12374 basic_ios_char *basic_ios;
12376 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12378 if(virt_init) {
12379 this->base.vbtable = basic_istringstream_char_vbtable;
12380 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12381 basic_ios_char_ctor(basic_ios);
12382 }else {
12383 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12386 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12387 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12388 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12389 return this;
12392 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12393 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12394 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
12395 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
12396 basic_istringstream_char *this, int mode, bool virt_init)
12398 basic_ios_char *basic_ios;
12400 TRACE("(%p %d %d)\n", this, mode, virt_init);
12402 if(virt_init) {
12403 this->base.vbtable = basic_istringstream_char_vbtable;
12404 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12405 basic_ios_char_ctor(basic_ios);
12406 }else {
12407 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12410 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12411 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12412 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12413 return this;
12416 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12417 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12418 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
12419 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
12420 basic_istringstream_char *this)
12422 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
12425 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12426 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12427 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
12428 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
12430 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12432 TRACE("(%p)\n", this);
12434 basic_stringbuf_char_dtor(&this->strbuf);
12435 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
12438 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12439 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12440 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
12441 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
12443 TRACE("(%p)\n", this);
12445 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
12446 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
12449 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
12450 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12452 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12454 TRACE("(%p %x)\n", this, flags);
12456 if(flags & 2) {
12457 /* we have an array, with the number of elements stored before the first object */
12458 INT_PTR i, *ptr = (INT_PTR *)this-1;
12460 for(i=*ptr-1; i>=0; i--)
12461 basic_istringstream_char_vbase_dtor(this+i);
12462 MSVCRT_operator_delete(ptr);
12463 } else {
12464 basic_istringstream_char_vbase_dtor(this);
12465 if(flags & 1)
12466 MSVCRT_operator_delete(this);
12469 return this;
12472 /* ?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 */
12473 /* ?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 */
12474 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
12475 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
12477 TRACE("(%p)\n", this);
12478 return (basic_stringbuf_char*)&this->strbuf;
12481 /* ?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 */
12482 /* ?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 */
12483 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
12484 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
12486 TRACE("(%p %p)\n", this, str);
12487 basic_stringbuf_char_str_set(&this->strbuf, str);
12490 /* ?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 */
12491 /* ?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 */
12492 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
12493 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
12495 TRACE("(%p %p)\n", this, ret);
12496 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12499 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
12501 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
12504 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12506 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
12509 /* ??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 */
12510 /* ??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 */
12511 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
12512 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
12513 const basic_string_wchar *str, int mode, bool virt_init)
12515 basic_ios_wchar *basic_ios;
12517 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12519 if(virt_init) {
12520 this->base.vbtable = basic_istringstream_wchar_vbtable;
12521 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12522 basic_ios_wchar_ctor(basic_ios);
12523 }else {
12524 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12527 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12528 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12529 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12530 return this;
12533 /* ??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 */
12534 /* ??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 */
12535 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
12536 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
12537 const basic_string_wchar *str, int mode, bool virt_init)
12539 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
12540 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12541 return this;
12544 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12545 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12546 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
12547 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
12548 basic_istringstream_wchar *this, int mode, bool virt_init)
12550 basic_ios_wchar *basic_ios;
12552 TRACE("(%p %d %d)\n", this, mode, virt_init);
12554 if(virt_init) {
12555 this->base.vbtable = basic_istringstream_wchar_vbtable;
12556 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12557 basic_ios_wchar_ctor(basic_ios);
12558 }else {
12559 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12562 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12563 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12564 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12565 return this;
12568 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12569 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12570 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
12571 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
12572 basic_istringstream_wchar *this, int mode, bool virt_init)
12574 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
12575 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12576 return this;
12579 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12580 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12581 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
12582 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
12583 basic_istringstream_wchar *this)
12585 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
12588 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12589 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12590 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
12591 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
12592 basic_istringstream_wchar *this)
12594 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
12597 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12598 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12599 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12600 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12601 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
12602 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
12604 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12606 TRACE("(%p)\n", this);
12608 basic_stringbuf_wchar_dtor(&this->strbuf);
12609 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12612 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12613 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12614 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12615 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12616 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
12617 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
12619 TRACE("(%p)\n", this);
12621 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
12622 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
12625 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
12626 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12628 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12630 TRACE("(%p %x)\n", this, flags);
12632 if(flags & 2) {
12633 /* we have an array, with the number of elements stored before the first object */
12634 INT_PTR i, *ptr = (INT_PTR *)this-1;
12636 for(i=*ptr-1; i>=0; i--)
12637 basic_istringstream_wchar_vbase_dtor(this+i);
12638 MSVCRT_operator_delete(ptr);
12639 } else {
12640 basic_istringstream_wchar_vbase_dtor(this);
12641 if(flags & 1)
12642 MSVCRT_operator_delete(this);
12645 return this;
12648 /* ?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 */
12649 /* ?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 */
12650 /* ?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 */
12651 /* ?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 */
12652 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
12653 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
12655 TRACE("(%p)\n", this);
12656 return (basic_stringbuf_wchar*)&this->strbuf;
12659 /* ?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 */
12660 /* ?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 */
12661 /* ?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 */
12662 /* ?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 */
12663 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
12664 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
12666 TRACE("(%p %p)\n", this, str);
12667 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12670 /* ?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 */
12671 /* ?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 */
12672 /* ?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 */
12673 /* ?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 */
12674 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
12675 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
12677 TRACE("(%p %p)\n", this, ret);
12678 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12681 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
12683 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
12686 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
12688 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
12691 /* ??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 */
12692 /* ??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 */
12693 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
12694 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
12695 const basic_string_char *str, int mode, bool virt_init)
12697 basic_ios_char *basic_ios;
12699 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12701 if(virt_init) {
12702 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12703 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12704 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12705 basic_ios_char_ctor(basic_ios);
12706 }else {
12707 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12710 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
12711 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12712 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12713 return this;
12716 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12717 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12718 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
12719 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
12720 basic_stringstream_char *this, int mode, bool virt_init)
12722 basic_ios_char *basic_ios;
12724 TRACE("(%p %d %d)\n", this, mode, virt_init);
12726 if(virt_init) {
12727 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12728 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12729 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12730 basic_ios_char_ctor(basic_ios);
12731 }else {
12732 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12735 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
12736 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12737 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12738 return this;
12741 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12742 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12743 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
12744 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
12745 basic_stringstream_char *this)
12747 return basic_stringstream_char_ctor_mode(
12748 this, OPENMODE_out|OPENMODE_in, TRUE);
12751 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12752 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12753 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
12754 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
12756 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12758 TRACE("(%p)\n", this);
12760 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12761 basic_stringbuf_char_dtor(&this->strbuf);
12764 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12765 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12766 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
12767 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
12769 TRACE("(%p)\n", this);
12771 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
12772 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
12775 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
12776 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12778 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12780 TRACE("(%p %x)\n", this, flags);
12782 if(flags & 2) {
12783 /* we have an array, with the number of elements stored before the first object */
12784 INT_PTR i, *ptr = (INT_PTR *)this-1;
12786 for(i=*ptr-1; i>=0; i--)
12787 basic_stringstream_char_vbase_dtor(this+i);
12788 MSVCRT_operator_delete(ptr);
12789 } else {
12790 basic_stringstream_char_vbase_dtor(this);
12791 if(flags & 1)
12792 MSVCRT_operator_delete(this);
12795 return this;
12798 /* ?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 */
12799 /* ?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 */
12800 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
12801 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
12803 TRACE("(%p)\n", this);
12804 return (basic_stringbuf_char*)&this->strbuf;
12807 /* ?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 */
12808 /* ?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 */
12809 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
12810 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
12812 TRACE("(%p %p)\n", this, str);
12813 basic_stringbuf_char_str_set(&this->strbuf, str);
12816 /* ?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 */
12817 /* ?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 */
12818 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
12819 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
12821 TRACE("(%p %p)\n", this, ret);
12822 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12825 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
12827 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
12830 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12832 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
12835 /* ??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 */
12836 /* ??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 */
12837 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
12838 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
12839 const basic_string_wchar *str, int mode, bool virt_init)
12841 basic_ios_wchar *basic_ios;
12843 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12845 if(virt_init) {
12846 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12847 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12848 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12849 basic_ios_wchar_ctor(basic_ios);
12850 }else {
12851 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12854 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
12855 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12856 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12857 return this;
12860 /* ??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 */
12861 /* ??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 */
12862 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
12863 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
12864 const basic_string_wchar *str, int mode, bool virt_init)
12866 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
12867 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12868 return this;
12871 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12872 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12873 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
12874 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
12875 basic_stringstream_wchar *this, int mode, bool virt_init)
12877 basic_ios_wchar *basic_ios;
12879 TRACE("(%p %d %d)\n", this, mode, virt_init);
12881 if(virt_init) {
12882 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12883 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12884 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12885 basic_ios_wchar_ctor(basic_ios);
12886 }else {
12887 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12890 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
12891 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12892 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12893 return this;
12896 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12897 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12898 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
12899 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
12900 basic_stringstream_wchar *this, int mode, bool virt_init)
12902 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
12903 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12904 return this;
12907 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12908 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12909 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
12910 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
12911 basic_stringstream_wchar *this)
12913 return basic_stringstream_wchar_ctor_mode(
12914 this, OPENMODE_out|OPENMODE_in, TRUE);
12917 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12918 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12919 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
12920 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
12921 basic_stringstream_wchar *this)
12923 return basic_stringstream_short_ctor_mode(
12924 this, OPENMODE_out|OPENMODE_in, TRUE);
12927 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12928 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12929 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12930 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12931 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
12932 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
12934 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
12936 TRACE("(%p)\n", this);
12938 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
12939 basic_stringbuf_wchar_dtor(&this->strbuf);
12942 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12943 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12944 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12945 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12946 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
12947 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
12949 TRACE("(%p)\n", this);
12951 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
12952 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
12955 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
12956 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12958 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
12960 TRACE("(%p %x)\n", this, flags);
12962 if(flags & 2) {
12963 /* we have an array, with the number of elements stored before the first object */
12964 INT_PTR i, *ptr = (INT_PTR *)this-1;
12966 for(i=*ptr-1; i>=0; i--)
12967 basic_stringstream_wchar_vbase_dtor(this+i);
12968 MSVCRT_operator_delete(ptr);
12969 } else {
12970 basic_stringstream_wchar_vbase_dtor(this);
12971 if(flags & 1)
12972 MSVCRT_operator_delete(this);
12975 return this;
12978 /* ?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 */
12979 /* ?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 */
12980 /* ?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 */
12981 /* ?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 */
12982 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
12983 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
12985 TRACE("(%p)\n", this);
12986 return (basic_stringbuf_wchar*)&this->strbuf;
12989 /* ?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 */
12990 /* ?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 */
12991 /* ?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 */
12992 /* ?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 */
12993 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
12994 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
12996 TRACE("(%p %p)\n", this, str);
12997 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13000 /* ?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 */
13001 /* ?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 */
13002 /* ?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 */
13003 /* ?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 */
13004 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
13005 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
13007 TRACE("(%p %p)\n", this, ret);
13008 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13011 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
13012 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
13013 #if STREAMSIZE_BITS == 64
13014 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
13015 #else
13016 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
13017 #endif
13018 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
13020 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
13022 this->minsize = 32;
13023 this->endsave = NULL;
13024 this->strmode = mode;
13025 this->palloc = NULL;
13026 this->pfree = NULL;
13028 if(!g) {
13029 this->strmode |= STRSTATE_Dynamic;
13030 if(len > this->minsize)
13031 this->minsize = len;
13032 this->seekhigh = NULL;
13033 return;
13036 if(len < 0)
13037 len = INT_MAX;
13038 else if(!len)
13039 len = strlen(g);
13041 this->seekhigh = g+len;
13042 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
13043 if(p)
13044 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
13047 /* ??0strstreambuf@std@@QAE@PACH0@Z */
13048 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
13049 /* ??0strstreambuf@std@@QAE@PADH0@Z */
13050 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
13051 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
13052 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
13053 #if STREAMSIZE_BITS == 64
13054 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
13055 #else
13056 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
13057 #endif
13058 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
13060 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
13062 basic_streambuf_char_ctor(&this->base);
13063 this->base.vtable = &MSVCP_strstreambuf_vtable;
13065 strstreambuf__Init(this, len, g, p, 0);
13066 return this;
13069 /* ??0strstreambuf@std@@QAE@H@Z */
13070 /* ??0strstreambuf@std@@QEAA@_J@Z */
13071 #if STREAMSIZE_BITS == 64
13072 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 12)
13073 #else
13074 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
13075 #endif
13076 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
13078 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
13081 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
13082 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
13083 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
13084 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(size_t), void (__cdecl *pfree)(void*))
13086 TRACE("(%p %p %p)\n", this, palloc, pfree);
13088 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13089 this->palloc = palloc;
13090 this->pfree = pfree;
13091 return this;
13094 /* ??0strstreambuf@std@@QAE@PBCH@Z */
13095 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
13096 /* ??0strstreambuf@std@@QAE@PBDH@Z */
13097 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
13098 /* ??0strstreambuf@std@@QAE@PBEH@Z */
13099 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
13100 #if STREAMSIZE_BITS == 64
13101 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 16)
13102 #else
13103 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
13104 #endif
13105 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
13107 TRACE("(%p %p %s)\n", this, g, wine_dbgstr_longlong(len));
13109 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
13110 this->strmode |= STRSTATE_Constant;
13111 return this;
13114 /* ??_Fstrstreambuf@std@@QAEXXZ */
13115 /* ??_Fstrstreambuf@std@@QEAAXXZ */
13116 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
13117 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
13119 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13122 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
13123 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
13124 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
13125 void __thiscall strstreambuf__Tidy(strstreambuf *this)
13127 TRACE("(%p)\n", this);
13129 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
13130 if(this->pfree)
13131 this->pfree(basic_streambuf_char_eback(&this->base));
13132 else
13133 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
13136 this->endsave = NULL;
13137 this->seekhigh = NULL;
13138 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
13139 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
13140 basic_streambuf_char_setp(&this->base, NULL, NULL);
13143 /* ??1strstreambuf@std@@UAE@XZ */
13144 /* ??1strstreambuf@std@@UEAA@XZ */
13145 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
13146 void __thiscall strstreambuf_dtor(strstreambuf *this)
13148 TRACE("(%p)\n", this);
13150 strstreambuf__Tidy(this);
13151 basic_streambuf_char_dtor(&this->base);
13154 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
13155 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
13157 TRACE("(%p %x)\n", this, flags);
13158 if(flags & 2) {
13159 /* we have an array, with the number of elements stored before the first object */
13160 INT_PTR i, *ptr = (INT_PTR *)this-1;
13162 for(i=*ptr-1; i>=0; i--)
13163 strstreambuf_dtor(this+i);
13164 MSVCRT_operator_delete(ptr);
13165 } else {
13166 strstreambuf_dtor(this);
13167 if(flags & 1)
13168 MSVCRT_operator_delete(this);
13171 return this;
13174 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
13175 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
13176 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
13177 void __thiscall strstreambuf_freeze(strstreambuf *this, bool freeze)
13179 TRACE("(%p %d)\n", this, freeze);
13181 if(!freeze == !(this->strmode & STRSTATE_Frozen))
13182 return;
13184 if(freeze) {
13185 this->strmode |= STRSTATE_Frozen;
13186 this->endsave = basic_streambuf_char_epptr(&this->base);
13187 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13188 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
13189 }else {
13190 this->strmode &= ~STRSTATE_Frozen;
13191 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13192 basic_streambuf_char_pptr(&this->base), this->endsave);
13196 /* ?str@strstreambuf@std@@QAEPADXZ */
13197 /* ?str@strstreambuf@std@@QEAAPEADXZ */
13198 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
13199 char* __thiscall strstreambuf_str(strstreambuf *this)
13201 TRACE("(%p)\n", this);
13203 strstreambuf_freeze(this, TRUE);
13204 return basic_streambuf_char_gptr(&this->base);
13207 /* ?pcount@strstreambuf@std@@QBEHXZ */
13208 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
13209 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
13210 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
13212 char *ppos = basic_streambuf_char_pptr(&this->base);
13214 TRACE("(%p)\n", this);
13216 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
13219 /* ?overflow@strstreambuf@std@@MAEHH@Z */
13220 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
13221 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
13222 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
13224 size_t old_size, size;
13225 char *ptr, *buf;
13227 TRACE("(%p %d)\n", this, c);
13229 if(c == EOF)
13230 return !EOF;
13232 if(this->strmode & STRSTATE_Frozen)
13233 return EOF;
13235 ptr = basic_streambuf_char_pptr(&this->base);
13236 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
13237 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13239 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
13240 return EOF;
13242 ptr = basic_streambuf_char_eback(&this->base);
13243 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
13245 size = old_size + old_size/2;
13246 if(size < this->minsize)
13247 size = this->minsize;
13249 if(this->palloc)
13250 buf = this->palloc(size);
13251 else
13252 buf = MSVCRT_operator_new(size);
13253 if(!buf)
13254 return EOF;
13256 memcpy(buf, ptr, old_size);
13257 if(this->strmode & STRSTATE_Allocated) {
13258 if(this->pfree)
13259 this->pfree(ptr);
13260 else
13261 MSVCRT_operator_delete(ptr);
13264 this->strmode |= STRSTATE_Allocated;
13265 if(!old_size) {
13266 this->seekhigh = buf;
13267 basic_streambuf_char_setp(&this->base, buf, buf+size);
13268 basic_streambuf_char_setg(&this->base, buf, buf, buf);
13269 }else {
13270 this->seekhigh = this->seekhigh-ptr+buf;
13271 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
13272 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
13273 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
13274 basic_streambuf_char_pptr(&this->base));
13277 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13280 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
13281 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
13282 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
13283 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
13285 char *ptr = basic_streambuf_char_gptr(&this->base);
13287 TRACE("(%p %d)\n", this, c);
13289 if(ptr<=basic_streambuf_char_eback(&this->base)
13290 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
13291 return EOF;
13293 basic_streambuf_char_gbump(&this->base, -1);
13294 if(c == EOF)
13295 return !EOF;
13296 if(this->strmode & STRSTATE_Constant)
13297 return (unsigned char)c;
13299 return (unsigned char)(ptr[0] = c);
13302 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
13303 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
13304 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
13305 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
13306 #if STREAMOFF_BITS == 64
13307 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
13308 #else
13309 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
13310 #endif
13311 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
13313 char *eback = basic_streambuf_char_eback(&this->base);
13314 char *pptr = basic_streambuf_char_pptr(&this->base);
13315 char *gptr = basic_streambuf_char_gptr(&this->base);
13317 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
13319 ret->off = 0;
13320 ret->state = 0;
13322 if(pptr > this->seekhigh)
13323 this->seekhigh = pptr;
13325 if((mode & OPENMODE_in) && gptr) {
13326 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
13327 off += gptr-eback;
13328 else if(way == SEEKDIR_end)
13329 off += this->seekhigh-eback;
13330 else if(way != SEEKDIR_beg)
13331 off = -1;
13333 if(off<0 || off>this->seekhigh-eback) {
13334 off = -1;
13335 }else {
13336 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
13337 if((mode & OPENMODE_out) && pptr) {
13338 basic_streambuf_char_setp_next(&this->base, eback,
13339 gptr, basic_streambuf_char_epptr(&this->base));
13342 }else if((mode & OPENMODE_out) && pptr) {
13343 if(way == SEEKDIR_cur)
13344 off += pptr-eback;
13345 else if(way == SEEKDIR_end)
13346 off += this->seekhigh-eback;
13347 else if(way != SEEKDIR_beg)
13348 off = -1;
13350 if(off<0 || off>this->seekhigh-eback)
13351 off = -1;
13352 else
13353 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
13354 }else {
13355 off = -1;
13358 ret->pos = off;
13359 return ret;
13362 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
13363 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
13364 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
13365 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
13367 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
13369 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
13370 *ret = pos;
13371 return ret;
13374 return strstreambuf_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
13377 /* ?underflow@strstreambuf@std@@MAEHXZ */
13378 /* ?underflow@strstreambuf@std@@MEAAHXZ */
13379 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
13380 int __thiscall strstreambuf_underflow(strstreambuf *this)
13382 char *gptr = basic_streambuf_char_gptr(&this->base);
13383 char *pptr;
13385 TRACE("(%p)\n", this);
13387 if(!gptr)
13388 return EOF;
13390 if(gptr < basic_streambuf_char_egptr(&this->base))
13391 return (unsigned char)(*gptr);
13393 pptr = basic_streambuf_char_gptr(&this->base);
13394 if(pptr > this->seekhigh)
13395 this->seekhigh = pptr;
13397 if(this->seekhigh <= gptr)
13398 return EOF;
13400 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
13401 gptr, this->seekhigh);
13402 return (unsigned char)(*gptr);
13405 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
13407 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
13410 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
13412 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
13415 /* ??0ostrstream@std@@QAE@PADHH@Z */
13416 #if STREAMSIZE_BITS == 64
13417 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
13418 #else
13419 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
13420 #endif
13421 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, bool virt_init)
13423 basic_ios_char *basic_ios;
13425 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13427 if(virt_init) {
13428 this->base.vbtable = ostrstream_vbtable;
13429 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13430 basic_ios_char_ctor(basic_ios);
13431 }else {
13432 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13435 strstreambuf_ctor_get_put(&this->buf, buf, size,
13436 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13437 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, TRUE, FALSE);
13438 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
13439 return this;
13442 /* ??1ostrstream@std@@UAE@XZ */
13443 /* ??1ostrstream@std@@UEAA@XZ */
13444 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
13445 void __thiscall ostrstream_dtor(basic_ios_char *base)
13447 ostrstream *this = ostrstream_from_basic_ios(base);
13449 TRACE("(%p)\n", this);
13451 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
13452 strstreambuf_dtor(&this->buf);
13455 static void ostrstream_vbase_dtor(ostrstream *this)
13457 TRACE("(%p)\n", this);
13459 ostrstream_dtor(ostrstream_to_basic_ios(this));
13460 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
13463 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
13464 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13466 ostrstream *this = ostrstream_from_basic_ios(base);
13468 TRACE("(%p %x)\n", this, flags);
13470 if(flags & 2) {
13471 /* we have an array, with the number of elements stored before the first object */
13472 INT_PTR i, *ptr = (INT_PTR *)this-1;
13474 for(i=*ptr-1; i>=0; i--)
13475 ostrstream_vbase_dtor(this+i);
13476 MSVCRT_operator_delete(ptr);
13477 } else {
13478 ostrstream_vbase_dtor(this);
13479 if(flags & 1)
13480 MSVCRT_operator_delete(this);
13483 return this;
13486 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
13488 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
13491 /* ??1istrstream@std@@UAE@XZ */
13492 /* ??1istrstream@std@@UEAA@XZ */
13493 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
13494 void __thiscall istrstream_dtor(basic_ios_char *base)
13496 istrstream *this = istrstream_from_basic_ios(base);
13498 TRACE("(%p)\n", this);
13500 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
13501 strstreambuf_dtor(&this->buf);
13504 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
13506 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
13509 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
13511 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
13514 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@M@0@@Z */
13515 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@M@0@@Z */
13516 basic_ostream_char* __cdecl basic_ostream_char_print_complex_float(basic_ostream_char *ostr, const complex_float *val)
13518 struct {
13519 basic_ostringstream_char obj;
13520 basic_ios_char vbase;
13521 } oss;
13522 ios_base *ostringstream_ios_base, *ostream_ios_base;
13523 locale loc;
13524 basic_string_char str;
13525 basic_ostringstream_char_ctor(&oss.obj);
13526 ostringstream_ios_base = &oss.vbase.base;
13527 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13528 TRACE("(%p %p)\n", ostr, val);
13530 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
13531 locale_dtor(&loc);
13532 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13533 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13535 basic_ostream_char_print_ch(&oss.obj.base, '(');
13536 basic_ostream_char_print_float(&oss.obj.base, val->real);
13537 basic_ostream_char_print_ch(&oss.obj.base, ',');
13538 basic_ostream_char_print_float(&oss.obj.base, val->imag);
13539 basic_ostream_char_print_ch(&oss.obj.base, ')');
13541 basic_ostringstream_char_str_get(&oss.obj, &str);
13542 basic_ostringstream_char_dtor(&oss.vbase);
13543 basic_ostream_char_print_bstr(ostr, &str);
13544 MSVCP_basic_string_char_dtor(&str);
13545 return ostr;
13548 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@N@0@@Z */
13549 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@N@0@@Z */
13550 basic_ostream_char* __cdecl basic_ostream_char_print_complex_double(basic_ostream_char *ostr, const complex_double *val)
13552 struct {
13553 basic_ostringstream_char obj;
13554 basic_ios_char vbase;
13555 } oss;
13556 ios_base *ostringstream_ios_base, *ostream_ios_base;
13557 locale loc;
13558 basic_string_char str;
13559 basic_ostringstream_char_ctor(&oss.obj);
13560 ostringstream_ios_base = &oss.vbase.base;
13561 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13562 TRACE("(%p %p)\n", ostr, val);
13564 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
13565 locale_dtor(&loc);
13566 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13567 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13569 basic_ostream_char_print_ch(&oss.obj.base, '(');
13570 basic_ostream_char_print_double(&oss.obj.base, val->real);
13571 basic_ostream_char_print_ch(&oss.obj.base, ',');
13572 basic_ostream_char_print_double(&oss.obj.base, val->imag);
13573 basic_ostream_char_print_ch(&oss.obj.base, ')');
13575 basic_ostringstream_char_str_get(&oss.obj, &str);
13576 basic_ostringstream_char_dtor(&oss.vbase);
13577 basic_ostream_char_print_bstr(ostr, &str);
13578 MSVCP_basic_string_char_dtor(&str);
13579 return ostr;
13582 /* ??$?6odu?$char_traits@d@std@@@std@@yaaav?$basic_ostream@du?$char_traits@d@std@@@0@aav10@abv?$complex@o@0@@Z */
13583 /* ??$?6ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@O@0@@Z */
13584 basic_ostream_char* __cdecl basic_ostream_char_print_complex_ldouble(basic_ostream_char *ostr, const complex_double *val)
13586 struct {
13587 basic_ostringstream_char obj;
13588 basic_ios_char vbase;
13589 } oss;
13590 ios_base *ostringstream_ios_base, *ostream_ios_base;
13591 locale loc;
13592 basic_string_char str;
13593 basic_ostringstream_char_ctor(&oss.obj);
13594 ostringstream_ios_base = &oss.vbase.base;
13595 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13596 TRACE("(%p %p)\n", ostr, val);
13598 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
13599 locale_dtor(&loc);
13600 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13601 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13603 basic_ostream_char_print_ch(&oss.obj.base, '(');
13604 basic_ostream_char_print_ldouble(&oss.obj.base, val->real);
13605 basic_ostream_char_print_ch(&oss.obj.base, ',');
13606 basic_ostream_char_print_ldouble(&oss.obj.base, val->imag);
13607 basic_ostream_char_print_ch(&oss.obj.base, ')');
13609 basic_ostringstream_char_str_get(&oss.obj, &str);
13610 basic_ostringstream_char_dtor(&oss.vbase);
13611 basic_ostream_char_print_bstr(ostr, &str);
13612 MSVCP_basic_string_char_dtor(&str);
13613 return ostr;
13616 /* ??0strstream@std@@QAE@PADHH@Z */
13617 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
13618 #if STREAMSIZE_BITS == 64
13619 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
13620 #else
13621 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
13622 #endif
13623 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, bool virt_init)
13625 basic_ios_char *basic_ios;
13627 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13629 if(virt_init) {
13630 this->base.base1.vbtable = strstream_vbtable1;
13631 this->base.base2.vbtable = strstream_vbtable2;
13632 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13633 basic_ios_char_ctor(basic_ios);
13634 }else {
13635 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13638 strstreambuf_ctor_get_put(&this->buf, buf, size,
13639 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13640 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
13641 basic_ios->base.vtable = &MSVCP_strstream_vtable;
13642 return this;
13645 /* ??1strstream@std@@UAE@XZ */
13646 /* ??1strstream@std@@UEAA@XZ */
13647 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
13648 void __thiscall strstream_dtor(basic_ios_char *base)
13650 strstream *this = strstream_from_basic_ios(base);
13652 TRACE("(%p)\n", this);
13654 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13655 strstreambuf_dtor(&this->buf);
13658 static void strstream_vbase_dtor(strstream *this)
13660 TRACE("(%p)\n", this);
13662 strstream_dtor(strstream_to_basic_ios(this));
13663 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
13666 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
13667 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13669 strstream *this = strstream_from_basic_ios(base);
13671 TRACE("(%p %x)\n", this, flags);
13673 if(flags & 2) {
13674 /* we have an array, with the number of elements stored before the first object */
13675 INT_PTR i, *ptr = (INT_PTR *)this-1;
13677 for(i=*ptr-1; i>=0; i--)
13678 strstream_vbase_dtor(this+i);
13679 MSVCRT_operator_delete(ptr);
13680 } else {
13681 strstream_vbase_dtor(this);
13682 if(flags & 1)
13683 MSVCRT_operator_delete(this);
13686 return this;
13689 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
13691 ios_base_precision_set(base, prec);
13694 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
13695 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13696 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
13698 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
13700 ret->pfunc = setprecision_func;
13701 ret->arg = prec;
13702 return ret;
13705 static void __cdecl setw_func(ios_base *base, streamsize width)
13707 ios_base_width_set(base, width);
13710 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
13711 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13712 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
13714 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
13716 ret->pfunc = setw_func;
13717 ret->arg = width;
13718 return ret;
13721 static void __cdecl resetioflags_func(ios_base *base, int mask)
13723 ios_base_setf_mask(base, 0, mask);
13726 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
13727 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
13729 TRACE("(%p %d)\n", ret, mask);
13731 ret->pfunc = resetioflags_func;
13732 ret->arg = mask;
13733 return ret;
13736 static void __cdecl setiosflags_func(ios_base *base, int mask)
13738 ios_base_setf_mask(base, FMTFLAG_mask, mask);
13741 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
13742 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
13744 TRACE("(%p %d)\n", ret, mask);
13746 ret->pfunc = setiosflags_func;
13747 ret->arg = mask;
13748 return ret;
13751 static void __cdecl setbase_func(ios_base *base, int set_base)
13753 if(set_base == 10)
13754 set_base = FMTFLAG_dec;
13755 else if(set_base == 8)
13756 set_base = FMTFLAG_oct;
13757 else if(set_base == 16)
13758 set_base = FMTFLAG_hex;
13759 else
13760 set_base = 0;
13762 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
13765 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
13766 manip_int* __cdecl setbase(manip_int *ret, int base)
13768 TRACE("(%p %d)\n", ret, base);
13770 ret->pfunc = setbase_func;
13771 ret->arg = base;
13772 return ret;
13775 static basic_filebuf_char filebuf_char_stdin;
13776 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
13777 struct {
13778 basic_istream_char obj;
13779 basic_ios_char vbase;
13780 } cin = { { 0 } };
13781 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
13782 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
13783 basic_istream_char *_Ptr_cin = &cin.obj;
13785 static basic_filebuf_wchar filebuf_short_stdin;
13786 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
13787 struct {
13788 basic_istream_wchar obj;
13789 basic_ios_wchar vbase;
13790 } ucin = { { 0 } };
13791 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
13792 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
13793 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
13795 static basic_filebuf_wchar filebuf_wchar_stdin;
13796 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13797 struct {
13798 basic_istream_wchar obj;
13799 basic_ios_wchar vbase;
13800 } wcin = { { 0 } };
13801 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13802 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
13803 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
13805 static basic_filebuf_char filebuf_char_stdout;
13806 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13807 struct {
13808 basic_ostream_char obj;
13809 basic_ios_char vbase;
13810 } cout = { { 0 } };
13811 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13812 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13813 basic_ostream_char *_Ptr_cout = &cout.obj;
13815 static basic_filebuf_wchar filebuf_short_stdout;
13816 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13817 struct {
13818 basic_ostream_wchar obj;
13819 basic_ios_wchar vbase;
13820 } ucout = { { 0 } };
13821 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13822 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13823 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
13825 static basic_filebuf_wchar filebuf_wchar_stdout;
13826 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13827 struct {
13828 basic_ostream_wchar obj;
13829 basic_ios_wchar vbase;
13830 } wcout = { { 0 } };
13831 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13832 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13833 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
13835 static basic_filebuf_char filebuf_char_stderr;
13836 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13837 struct {
13838 basic_ostream_char obj;
13839 basic_ios_char vbase;
13840 } cerr = { { 0 } };
13841 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13842 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13843 basic_ostream_char *_Ptr_cerr = &cerr.obj;
13845 static basic_filebuf_wchar filebuf_short_stderr;
13846 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13847 struct {
13848 basic_ostream_wchar obj;
13849 basic_ios_wchar vbase;
13850 } ucerr = { { 0 } };
13851 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13852 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13853 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
13855 static basic_filebuf_wchar filebuf_wchar_stderr;
13856 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13857 struct {
13858 basic_ostream_wchar obj;
13859 basic_ios_wchar vbase;
13860 } wcerr = { { 0 } };
13861 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13862 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13863 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
13865 static basic_filebuf_char filebuf_char_log;
13866 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13867 struct {
13868 basic_ostream_char obj;
13869 basic_ios_char vbase;
13870 } MSVCP_clog = { { 0 } };
13871 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13872 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13873 basic_ostream_char *_Ptr_clog = &MSVCP_clog.obj;
13875 static basic_filebuf_wchar filebuf_short_log;
13876 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13877 struct {
13878 basic_ostream_wchar obj;
13879 basic_ios_wchar vbase;
13880 } uclog = { { 0 } };
13881 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13882 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13883 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
13885 static basic_filebuf_wchar filebuf_wchar_log;
13886 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13887 struct {
13888 basic_ostream_wchar obj;
13889 basic_ios_wchar vbase;
13890 } wclog = { { 0 } };
13891 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13892 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13893 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
13895 /* ?_Init_cnt@Init@ios_base@std@@0HA */
13896 int ios_base_Init__Init_cnt = -1;
13898 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
13899 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
13900 int* __cdecl ios_base_Init__Init_cnt_func(void)
13902 return &ios_base_Init__Init_cnt;
13905 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
13906 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
13907 void __cdecl ios_base_Init__Init_ctor(void *this)
13909 TRACE("(%p)\n", this);
13911 if(ios_base_Init__Init_cnt < 0)
13912 ios_base_Init__Init_cnt = 1;
13913 else
13914 ios_base_Init__Init_cnt++;
13917 /* ??0Init@ios_base@std@@QAE@XZ */
13918 /* ??0Init@ios_base@std@@QEAA@XZ */
13919 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
13920 void* __thiscall ios_base_Init_ctor(void *this)
13922 ios_base_Init__Init_ctor(this);
13923 return this;
13926 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
13927 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
13928 void __cdecl ios_base_Init__Init_dtor(void *this)
13930 TRACE("(%p)\n", this);
13932 ios_base_Init__Init_cnt--;
13933 if(!ios_base_Init__Init_cnt) {
13934 basic_ostream_char_flush(&cout.obj);
13935 basic_ostream_char_flush(&cerr.obj);
13936 basic_ostream_char_flush(&MSVCP_clog.obj);
13940 /* ??1Init@ios_base@std@@QAE@XZ */
13941 /* ??1Init@ios_base@std@@QEAA@XZ */
13942 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
13943 void __thiscall ios_base_Init_dtor(void *this)
13945 ios_base_Init__Init_dtor(this);
13948 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
13949 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
13950 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
13951 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
13953 TRACE("(%p %p)\n", this, rhs);
13954 return this;
13957 /* ?_Init_cnt@_Winit@std@@0HA */
13958 int _Winit__Init_cnt = -1;
13960 /* ??0_Winit@std@@QAE@XZ */
13961 /* ??0_Winit@std@@QEAA@XZ */
13962 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
13963 void* __thiscall _Winit_ctor(void *this)
13965 TRACE("(%p)\n", this);
13967 if(_Winit__Init_cnt < 0)
13968 _Winit__Init_cnt = 1;
13969 else
13970 _Winit__Init_cnt++;
13972 return this;
13975 /* ??1_Winit@std@@QAE@XZ */
13976 /* ??1_Winit@std@@QAE@XZ */
13977 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
13978 void __thiscall _Winit_dtor(void *this)
13980 TRACE("(%p)\n", this);
13982 _Winit__Init_cnt--;
13983 if(!_Winit__Init_cnt) {
13984 basic_ostream_wchar_flush(&wcout.obj);
13985 basic_ostream_wchar_flush(&wcerr.obj);
13986 basic_ostream_wchar_flush(&wclog.obj);
13990 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
13991 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
13992 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
13993 void* __thiscall _Winit_op_assign(void *this, void *rhs)
13995 TRACE("(%p %p)\n", this, rhs);
13996 return this;
13999 void init_io(void *base)
14001 #ifdef __x86_64__
14002 init_iosb_rtti(base);
14003 init_ios_base_rtti(base);
14004 init_basic_ios_char_rtti(base);
14005 init_basic_ios_wchar_rtti(base);
14006 init_basic_ios_short_rtti(base);
14007 init_basic_streambuf_char_rtti(base);
14008 init_basic_streambuf_wchar_rtti(base);
14009 init_basic_streambuf_short_rtti(base);
14010 init_basic_filebuf_char_rtti(base);
14011 init_basic_filebuf_wchar_rtti(base);
14012 init_basic_filebuf_short_rtti(base);
14013 init_basic_stringbuf_char_rtti(base);
14014 init_basic_stringbuf_wchar_rtti(base);
14015 init_basic_stringbuf_short_rtti(base);
14016 init_basic_ostream_char_rtti(base);
14017 init_basic_ostream_wchar_rtti(base);
14018 init_basic_ostream_short_rtti(base);
14019 init_basic_istream_char_rtti(base);
14020 init_basic_istream_wchar_rtti(base);
14021 init_basic_istream_short_rtti(base);
14022 init_basic_iostream_char_rtti(base);
14023 init_basic_iostream_wchar_rtti(base);
14024 init_basic_iostream_short_rtti(base);
14025 init_basic_ofstream_char_rtti(base);
14026 init_basic_ofstream_wchar_rtti(base);
14027 init_basic_ofstream_short_rtti(base);
14028 init_basic_ifstream_char_rtti(base);
14029 init_basic_ifstream_wchar_rtti(base);
14030 init_basic_ifstream_short_rtti(base);
14031 init_basic_fstream_char_rtti(base);
14032 init_basic_fstream_wchar_rtti(base);
14033 init_basic_fstream_short_rtti(base);
14034 init_basic_ostringstream_char_rtti(base);
14035 init_basic_ostringstream_wchar_rtti(base);
14036 init_basic_ostringstream_short_rtti(base);
14037 init_basic_istringstream_char_rtti(base);
14038 init_basic_istringstream_wchar_rtti(base);
14039 init_basic_istringstream_short_rtti(base);
14040 init_basic_stringstream_char_rtti(base);
14041 init_basic_stringstream_wchar_rtti(base);
14042 init_basic_stringstream_short_rtti(base);
14043 init_strstreambuf_rtti(base);
14044 init_strstream_rtti(base);
14045 init_ostrstream_rtti(base);
14046 #endif
14048 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
14049 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
14051 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
14052 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
14054 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
14055 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
14057 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
14058 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
14060 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
14061 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
14063 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
14064 basic_ostream_short_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
14066 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
14067 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
14069 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
14070 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
14072 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
14073 basic_ostream_short_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
14075 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
14076 basic_ostream_char_ctor(&MSVCP_clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE, TRUE);
14078 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
14079 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE, TRUE);
14081 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
14082 basic_ostream_short_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE, TRUE);
14085 void free_io(void)
14087 basic_istream_char_vbase_dtor(&cin.obj);
14088 basic_filebuf_char_dtor(&filebuf_char_stdin);
14090 basic_istream_wchar_vbase_dtor(&ucin.obj);
14091 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
14093 basic_istream_wchar_vbase_dtor(&wcin.obj);
14094 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
14096 basic_ostream_char_vbase_dtor(&cout.obj);
14097 basic_filebuf_char_dtor(&filebuf_char_stdout);
14099 basic_ostream_wchar_vbase_dtor(&ucout.obj);
14100 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
14102 basic_ostream_wchar_vbase_dtor(&wcout.obj);
14103 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
14105 basic_ostream_char_vbase_dtor(&cerr.obj);
14106 basic_filebuf_char_dtor(&filebuf_char_stderr);
14108 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
14109 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
14111 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
14112 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
14114 basic_ostream_char_vbase_dtor(&MSVCP_clog.obj);
14115 basic_filebuf_char_dtor(&filebuf_char_log);
14117 basic_ostream_wchar_vbase_dtor(&uclog.obj);
14118 basic_filebuf_wchar_dtor(&filebuf_short_log);
14120 basic_ostream_wchar_vbase_dtor(&wclog.obj);
14121 basic_filebuf_wchar_dtor(&filebuf_wchar_log);