user32: Don't flush window surfaces while waiting for a sent message reply.
[wine/multimedia.git] / dlls / msvcp60 / ios.c
blob71ff1931a2947ab29bd628841f766eca185a382a
1 /*
2 * Copyright 2011 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include <limits.h>
24 #include <share.h>
26 #include "msvcp.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
32 /* ?_Index@ios_base@std@@0HA */
33 int ios_base_Index = 0;
34 /* ?_Sync@ios_base@std@@0_NA */
35 MSVCP_bool ios_base_Sync = FALSE;
37 typedef struct {
38 streamoff off;
39 __int64 DECLSPEC_ALIGN(8) pos;
40 int state;
41 } fpos_int;
43 static inline const char* debugstr_fpos_int(fpos_int *fpos)
45 return wine_dbg_sprintf("fpos(%ld %s %d)", fpos->off, wine_dbgstr_longlong(fpos->pos), fpos->state);
48 typedef struct {
49 void (__cdecl *pfunc)(ios_base*, streamsize);
50 streamsize arg;
51 } manip_streamsize;
53 typedef struct {
54 void (__cdecl *pfunc)(ios_base*, int);
55 int arg;
56 } manip_int;
58 typedef enum {
59 INITFL_new = 0,
60 INITFL_open = 1,
61 INITFL_close = 2
62 } basic_filebuf__Initfl;
64 typedef struct {
65 basic_streambuf_char base;
66 codecvt_char *cvt;
67 char putback;
68 MSVCP_bool wrotesome;
69 int state;
70 MSVCP_bool close;
71 FILE *file;
72 } basic_filebuf_char;
74 typedef struct {
75 basic_streambuf_wchar base;
76 codecvt_wchar *cvt;
77 wchar_t putback;
78 MSVCP_bool wrotesome;
79 int state;
80 MSVCP_bool close;
81 FILE *file;
82 } basic_filebuf_wchar;
84 typedef enum {
85 STRINGBUF_allocated = 1,
86 STRINGBUF_no_write = 2,
87 STRINGBUF_no_read = 4,
88 STRINGBUF_append = 8,
89 STRINGBUF_at_end = 16
90 } basic_stringbuf_state;
92 typedef struct {
93 basic_streambuf_char base;
94 char *pendsave;
95 char *seekhigh;
96 int alsize;
97 int state;
98 char allocator; /* empty struct */
99 } basic_stringbuf_char;
101 typedef struct {
102 basic_streambuf_wchar base;
103 wchar_t *pendsave;
104 wchar_t *seekhigh;
105 int alsize;
106 int state;
107 char allocator; /* empty struct */
108 } basic_stringbuf_wchar;
110 typedef struct {
111 ios_base base;
112 basic_streambuf_char *strbuf;
113 struct _basic_ostream_char *stream;
114 char fillch;
115 } basic_ios_char;
117 typedef struct {
118 ios_base base;
119 basic_streambuf_wchar *strbuf;
120 struct _basic_ostream_wchar *stream;
121 wchar_t fillch;
122 } basic_ios_wchar;
124 typedef struct _basic_ostream_char {
125 const int *vbtable;
126 /* virtual inheritance
127 * basic_ios_char basic_ios;
129 } basic_ostream_char;
131 typedef struct _basic_ostream_wchar {
132 const int *vbtable;
133 /* virtual inheritance
134 * basic_ios_wchar basic_ios;
136 } basic_ostream_wchar;
138 typedef struct {
139 const int *vbtable;
140 streamsize count;
141 /* virtual inheritance
142 * basic_ios_char basic_ios;
144 } basic_istream_char;
146 typedef struct {
147 const int *vbtable;
148 streamsize count;
149 /* virtual inheritance
150 * basic_ios_wchar basic_ios;
152 } basic_istream_wchar;
154 typedef struct {
155 basic_istream_char base1;
156 basic_ostream_char base2;
157 /* virtual inheritance
158 * basic_ios_char basic_ios;
160 } basic_iostream_char;
162 typedef struct {
163 basic_istream_wchar base1;
164 basic_ostream_wchar base2;
165 /* virtual inheritance
166 * basic_ios_wchar basic_ios;
168 } basic_iostream_wchar;
170 typedef struct {
171 basic_ostream_char base;
172 basic_filebuf_char filebuf;
173 /* virtual inheritance
174 * basic_ios_char basic_ios;
176 } basic_ofstream_char;
178 typedef struct {
179 basic_ostream_wchar base;
180 basic_filebuf_wchar filebuf;
181 /* virtual inheritance
182 * basic_ios_wchar basic_ios;
184 } basic_ofstream_wchar;
186 typedef struct {
187 basic_istream_char base;
188 basic_filebuf_char filebuf;
189 /* virtual inheritance
190 * basic_ios_char basic_ios;
192 } basic_ifstream_char;
194 typedef struct {
195 basic_istream_wchar base;
196 basic_filebuf_wchar filebuf;
197 /* virtual inheritance
198 * basic_ios_wchar basic_ios;
200 } basic_ifstream_wchar;
202 typedef struct {
203 basic_iostream_char base;
204 basic_filebuf_char filebuf;
205 /* virtual inheritance
206 * basic_ios_char basic_ios;
208 } basic_fstream_char;
210 typedef struct {
211 basic_iostream_wchar base;
212 basic_filebuf_wchar filebuf;
213 /* virtual inheritance
214 * basic_ios_char basic_ios;
216 } basic_fstream_wchar;
218 typedef struct {
219 basic_ostream_char base;
220 basic_stringbuf_char strbuf;
221 /* virtual inheritance
222 * basic_ios_char basic_ios;
224 } basic_ostringstream_char;
226 typedef struct {
227 basic_ostream_wchar base;
228 basic_stringbuf_wchar strbuf;
229 /* virtual inheritance
230 * basic_ios_wchar basic_ios;
232 } basic_ostringstream_wchar;
234 typedef struct {
235 basic_istream_char base;
236 basic_stringbuf_char strbuf;
237 /* virtual inheritance
238 * basic_ios_char basic_ios;
240 } basic_istringstream_char;
242 typedef struct {
243 basic_istream_wchar base;
244 basic_stringbuf_wchar strbuf;
245 /* virtual inheritance
246 * basic_ios_wchar basic_ios;
248 } basic_istringstream_wchar;
250 typedef struct {
251 basic_iostream_char base;
252 basic_stringbuf_char strbuf;
253 /* virtual inheritance
254 * basic_ios_char basic_ios;
256 } basic_stringstream_char;
258 typedef struct {
259 basic_iostream_wchar base;
260 basic_stringbuf_wchar strbuf;
261 /* virtual inheritance
262 * basic_ios_wchar basic_ios;
264 } basic_stringstream_wchar;
266 typedef enum {
267 STRSTATE_Allocated = 1,
268 STRSTATE_Constant = 2,
269 STRSTATE_Dynamic = 4,
270 STRSTATE_Frozen = 8
271 } strstreambuf__Strstate;
273 typedef struct {
274 basic_streambuf_char base;
275 streamsize minsize;
276 char *endsave;
277 char *seekhigh;
278 int strmode;
279 void* (__cdecl *palloc)(MSVCP_size_t);
280 void (__cdecl *pfree)(void*);
281 } strstreambuf;
283 typedef struct {
284 basic_ostream_char base;
285 strstreambuf buf;
286 /* virtual inheritance
287 * basic_ios_char basic_ios;
289 } ostrstream;
291 typedef struct {
292 basic_istream_char base;
293 strstreambuf buf;
294 /* virtual inheritance
295 * basic_ios_char basic_ios;
297 } istrstream;
299 typedef struct {
300 basic_iostream_char base;
301 strstreambuf buf;
302 /* virtual inheritance
303 * basic_ios_char basic_ios;
305 } strstream;
307 extern const vtable_ptr MSVCP_iosb_vtable;
309 /* ??_7ios_base@std@@6B@ */
310 extern const vtable_ptr MSVCP_ios_base_vtable;
312 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
313 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
315 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
316 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
318 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
319 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
321 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
322 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
324 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
325 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
327 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
328 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
330 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
331 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
333 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
334 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
336 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
337 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
339 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
340 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
342 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
343 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
345 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
346 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
348 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
349 const int basic_ostream_char_vbtable[] = {0, sizeof(basic_ostream_char)};
350 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
351 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
353 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
354 const int basic_ostream_wchar_vbtable[] = {0, sizeof(basic_ostream_wchar)};
355 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
356 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
358 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
359 const int basic_ostream_short_vbtable[] = {0, sizeof(basic_ostream_wchar)};
360 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
361 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
363 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
364 const int basic_istream_char_vbtable[] = {0, sizeof(basic_istream_char)};
365 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
366 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
368 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
369 const int basic_istream_wchar_vbtable[] = {0, sizeof(basic_istream_wchar)};
370 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
371 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
373 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
374 const int basic_istream_short_vbtable[] = {0, sizeof(basic_istream_wchar)};
375 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
376 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
378 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
379 const int basic_iostream_char_vbtable1[] = {0, sizeof(basic_iostream_char)};
380 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
381 const int basic_iostream_char_vbtable2[] = {0, sizeof(basic_iostream_char)-FIELD_OFFSET(basic_iostream_char, base2)};
382 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
383 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
385 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
386 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
387 const int basic_iostream_wchar_vbtable1[] = {0, sizeof(basic_iostream_wchar)};
388 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
389 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
390 const int basic_iostream_wchar_vbtable2[] = {0, sizeof(basic_iostream_wchar)-FIELD_OFFSET(basic_iostream_wchar, base2)};
391 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
392 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
393 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
394 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
396 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
397 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
398 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
399 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
401 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
402 const int basic_ofstream_wchar_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
403 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
404 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
406 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
407 const int basic_ofstream_short_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
408 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
409 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
411 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
412 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
413 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
414 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
416 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
417 const int basic_ifstream_wchar_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
418 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
419 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
421 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
422 const int basic_ifstream_short_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
423 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
424 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
426 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
427 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
428 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
429 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
430 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
431 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
433 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
434 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
435 const int basic_fstream_wchar_vbtable1[] = {0, sizeof(basic_fstream_wchar)};
436 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
437 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
438 const int basic_fstream_wchar_vbtable2[] = {0, sizeof(basic_fstream_wchar)-FIELD_OFFSET(basic_fstream_wchar, base.base2)};
439 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
440 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
441 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
442 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
444 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
445 const int basic_ostringstream_char_vbtable[] = {0, sizeof(basic_ostringstream_char)};
446 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
447 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
449 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
450 const int basic_ostringstream_wchar_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
451 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
452 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
454 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
455 const int basic_ostringstream_short_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
456 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
457 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
459 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
460 const int basic_istringstream_char_vbtable[] = {0, sizeof(basic_istringstream_char)};
461 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
462 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
464 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
465 const int basic_istringstream_wchar_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
466 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
467 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
469 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
470 const int basic_istringstream_short_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
471 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
472 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
474 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
475 const int basic_stringstream_char_vbtable1[] = {0, sizeof(basic_stringstream_char)};
476 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
477 const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_char)-FIELD_OFFSET(basic_stringstream_char, base.base2)};
478 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
479 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
481 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
482 const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
483 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
484 const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
485 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
486 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
488 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
489 const int basic_stringstream_short_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
490 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
491 const int basic_stringstream_short_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
492 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
493 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
495 /* ??_7strstreambuf@std@@6B */
496 extern const vtable_ptr MSVCP_strstreambuf_vtable;
498 static const int ostrstream_vbtable[] = {0, sizeof(ostrstream)};
499 extern const vtable_ptr MSVCP_ostrstream_vtable;
501 static const int istrstream_vbtable[] = {0, sizeof(istrstream)};
503 static const int strstream_vbtable1[] = {0, sizeof(strstream)};
504 static const int strstream_vbtable2[] = {0, sizeof(strstream)-FIELD_OFFSET(strstream, base.base2)};
505 extern const vtable_ptr MSVCP_strstream_vtable;
507 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@");
508 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@");
509 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
510 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@");
511 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
512 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@");
513 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
514 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@");
515 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
516 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@");
517 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
518 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@");
519 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
520 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@");
521 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
522 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@");
523 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
524 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@");
525 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
526 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@");
527 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
528 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@");
529 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
530 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@");
531 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
532 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@");
533 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
534 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
535 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@");
536 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
537 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
538 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@");
539 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
540 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
541 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@");
542 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
543 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
544 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@");
545 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
546 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
547 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@");
548 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
549 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
550 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@");
551 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
552 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
553 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
554 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
555 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
556 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@");
557 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
558 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
559 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
560 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
561 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
562 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@");
563 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
564 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
565 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
566 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
567 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
568 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@");
569 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
570 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
571 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
572 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@");
573 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
574 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
575 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
576 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@");
577 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
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_ofstream@GU?$char_traits@G@std@@@std@@");
581 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
582 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
583 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
584 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@");
585 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
586 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
587 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
588 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@");
589 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
590 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
591 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
592 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@");
593 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_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 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
597 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
598 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@");
599 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
600 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
601 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
602 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
603 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
604 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@");
605 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
606 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
607 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
608 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
609 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
610 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@");
611 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
612 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
613 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
614 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@");
615 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
616 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
617 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
618 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@");
619 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
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_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@");
623 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_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_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@");
627 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_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_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@");
631 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_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_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@");
635 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
636 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
637 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
638 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
639 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
640 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@");
641 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
642 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
643 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
644 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
645 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
646 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@");
647 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
648 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
649 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
650 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
651 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
652 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@");
653 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
654 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@");
655 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
656 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
657 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
658 "?AVostrstream@std@@");
659 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
660 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
661 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
662 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
663 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
664 "?AVstrstream@std@@");
666 #ifndef __GNUC__
667 void __asm_dummy_vtables(void) {
668 #endif
669 __ASM_VTABLE(iosb,
670 VTABLE_ADD_FUNC(iosb_vector_dtor));
671 __ASM_VTABLE(ios_base,
672 VTABLE_ADD_FUNC(ios_base_vector_dtor));
673 __ASM_VTABLE(basic_ios_char,
674 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor));
675 __ASM_VTABLE(basic_ios_wchar,
676 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
677 __ASM_VTABLE(basic_ios_short,
678 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
679 __ASM_VTABLE(basic_streambuf_char,
680 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
681 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
682 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
683 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
684 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
685 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
686 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
687 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
688 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
689 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
690 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
691 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
692 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
693 __ASM_VTABLE(basic_streambuf_wchar,
694 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
695 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
696 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
697 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
698 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
699 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
700 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
701 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
702 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
703 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
704 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
705 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
706 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
707 __ASM_VTABLE(basic_streambuf_short,
708 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
709 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
710 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
711 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
712 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
713 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
714 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
715 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
716 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
717 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
718 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
719 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
720 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
721 __ASM_VTABLE(basic_filebuf_char,
722 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
723 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
724 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
725 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
726 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
727 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
728 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
729 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
730 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
731 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
732 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
733 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
734 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
735 __ASM_VTABLE(basic_filebuf_wchar,
736 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
737 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
738 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
739 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
740 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
741 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
742 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
743 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
744 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
745 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
746 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
747 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
748 VTABLE_ADD_FUNC(basic_filebuf_wchar_imbue));
749 __ASM_VTABLE(basic_filebuf_short,
750 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
751 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
752 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
753 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
754 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
755 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
756 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
757 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
758 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
759 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
760 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
761 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
762 VTABLE_ADD_FUNC(basic_filebuf_short_imbue));
763 __ASM_VTABLE(basic_stringbuf_char,
764 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
765 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
766 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
767 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
768 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
769 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
770 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
771 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
772 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
773 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
774 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
775 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
776 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
777 __ASM_VTABLE(basic_stringbuf_wchar,
778 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
779 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
780 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
781 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
782 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
783 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
784 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
785 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
786 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
787 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
788 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
789 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
790 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
791 __ASM_VTABLE(basic_stringbuf_short,
792 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
793 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
794 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
795 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
796 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
797 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
798 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
799 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
800 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
801 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
802 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
803 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
804 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
805 __ASM_VTABLE(basic_ostream_char,
806 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor));
807 __ASM_VTABLE(basic_ostream_wchar,
808 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
809 __ASM_VTABLE(basic_ostream_short,
810 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
811 __ASM_VTABLE(basic_istream_char,
812 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor));
813 __ASM_VTABLE(basic_istream_wchar,
814 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
815 __ASM_VTABLE(basic_istream_short,
816 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
817 __ASM_VTABLE(basic_iostream_char,
818 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor));
819 __ASM_VTABLE(basic_iostream_wchar,
820 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
821 __ASM_VTABLE(basic_iostream_short,
822 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
823 __ASM_VTABLE(basic_ofstream_char,
824 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor));
825 __ASM_VTABLE(basic_ofstream_wchar,
826 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
827 __ASM_VTABLE(basic_ofstream_short,
828 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
829 __ASM_VTABLE(basic_ifstream_char,
830 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor));
831 __ASM_VTABLE(basic_ifstream_wchar,
832 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
833 __ASM_VTABLE(basic_ifstream_short,
834 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
835 __ASM_VTABLE(basic_fstream_char,
836 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor));
837 __ASM_VTABLE(basic_fstream_wchar,
838 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
839 __ASM_VTABLE(basic_fstream_short,
840 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
841 __ASM_VTABLE(basic_ostringstream_char,
842 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor));
843 __ASM_VTABLE(basic_ostringstream_wchar,
844 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
845 __ASM_VTABLE(basic_ostringstream_short,
846 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
847 __ASM_VTABLE(basic_istringstream_char,
848 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor));
849 __ASM_VTABLE(basic_istringstream_wchar,
850 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
851 __ASM_VTABLE(basic_istringstream_short,
852 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
853 __ASM_VTABLE(basic_stringstream_char,
854 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor));
855 __ASM_VTABLE(basic_stringstream_wchar,
856 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
857 __ASM_VTABLE(basic_stringstream_short,
858 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
859 __ASM_VTABLE(strstreambuf,
860 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
861 VTABLE_ADD_FUNC(strstreambuf_overflow)
862 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
863 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
864 VTABLE_ADD_FUNC(strstreambuf_underflow)
865 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
866 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
867 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
868 VTABLE_ADD_FUNC(strstreambuf_seekoff)
869 VTABLE_ADD_FUNC(strstreambuf_seekpos)
870 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
871 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
872 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
873 __ASM_VTABLE(ostrstream,
874 VTABLE_ADD_FUNC(ostrstream_vector_dtor));
875 __ASM_VTABLE(strstream,
876 VTABLE_ADD_FUNC(strstream_vector_dtor));
877 #ifndef __GNUC__
879 #endif
881 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
882 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
883 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
884 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
886 TRACE("(%p %p %p %p)\n", this, first, next, last);
888 this->wbuf = first;
889 this->wpos = next;
890 this->wsize = last-next;
893 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
894 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
895 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
896 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
898 basic_streambuf_char_setp_next(this, first, first, last);
901 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
902 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
903 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
904 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
906 TRACE("(%p %p %p %p)\n", this, first, next, last);
908 this->rbuf = first;
909 this->rpos = next;
910 this->rsize = last-next;
913 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
914 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
915 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
916 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
918 TRACE("(%p)\n", this);
920 this->prbuf = &this->rbuf;
921 this->pwbuf = &this->wbuf;
922 this->prpos = &this->rpos;
923 this->pwpos = &this->wpos;
924 this->prsize = &this->rsize;
925 this->pwsize = &this->wsize;
927 basic_streambuf_char_setp(this, NULL, NULL);
928 basic_streambuf_char_setg(this, NULL, NULL, NULL);
931 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
932 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
933 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
934 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
936 TRACE("(%p %d)\n", this, uninitialized);
937 this->vtable = &MSVCP_basic_streambuf_char_vtable;
938 return this;
941 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
942 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
943 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
944 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
946 TRACE("(%p)\n", this);
948 this->vtable = &MSVCP_basic_streambuf_char_vtable;
949 this->loc = MSVCRT_operator_new(sizeof(locale));
950 locale_ctor(this->loc);
951 basic_streambuf_char__Init_empty(this);
953 return this;
956 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
957 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
958 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
959 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
961 TRACE("(%p)\n", this);
963 locale_dtor(this->loc);
964 MSVCRT_operator_delete(this->loc);
967 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
968 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
970 TRACE("(%p %x)\n", this, flags);
971 if(flags & 2) {
972 /* we have an array, with the number of elements stored before the first object */
973 INT_PTR i, *ptr = (INT_PTR *)this-1;
975 for(i=*ptr-1; i>=0; i--)
976 basic_streambuf_char_dtor(this+i);
977 MSVCRT_operator_delete(ptr);
978 } else {
979 basic_streambuf_char_dtor(this);
980 if(flags & 1)
981 MSVCRT_operator_delete(this);
984 return this;
987 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
988 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
989 static streamsize basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
991 TRACE("(%p)\n", this);
992 return *this->prpos ? *this->prsize : 0;
995 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
996 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
997 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
998 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1000 TRACE("(%p)\n", this);
1001 (*this->prsize)++;
1002 (*this->prpos)--;
1003 return *this->prpos;
1006 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1007 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1008 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1009 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1011 TRACE("(%p)\n", this);
1012 (*this->prsize)--;
1013 return (*this->prpos)++;
1016 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1017 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1018 static char* basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1020 TRACE("(%p)\n", this);
1021 (*this->prsize)--;
1022 (*this->prpos)++;
1023 return *this->prpos;
1026 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1027 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1028 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1029 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1031 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1033 this->prbuf = gf;
1034 this->pwbuf = pf;
1035 this->prpos = gn;
1036 this->pwpos = pn;
1037 this->prsize = gc;
1038 this->pwsize = pc;
1041 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1042 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1043 static void basic_streambuf_char__Lock(basic_streambuf_char *this)
1045 TRACE("(%p)\n", this);
1048 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1049 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1050 static streamsize basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1052 TRACE("(%p)\n", this);
1053 return *this->pwpos ? *this->pwsize : 0;
1056 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1057 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1058 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1059 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1061 TRACE("(%p)\n", this);
1062 (*this->pwsize)--;
1063 return (*this->pwpos)++;
1066 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1067 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1068 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1069 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, \
1070 int, (basic_streambuf_char*), (this))
1071 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1073 TRACE("(%p)\n", this);
1074 return EOF;
1077 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1078 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1079 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1080 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, \
1081 int, (basic_streambuf_char*), (this))
1082 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1084 int ret;
1086 TRACE("(%p)\n", this);
1088 if(call_basic_streambuf_char_underflow(this)==EOF)
1089 return EOF;
1091 ret = (unsigned char)**this->prpos;
1092 (*this->prsize)--;
1093 (*this->prpos)++;
1094 return ret;
1097 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1098 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1099 static streamsize basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1101 streamsize copied, chunk;
1102 int c;
1104 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1106 for(copied=0; copied<count && size;) {
1107 chunk = basic_streambuf_char__Gnavail(this);
1108 if(chunk > count-copied)
1109 chunk = count-copied;
1111 if(chunk > 0) {
1112 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1113 *this->prpos += chunk;
1114 *this->prsize -= chunk;
1115 copied += chunk;
1116 size -= chunk;
1117 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1118 ptr[copied] = c;
1119 copied++;
1120 size--;
1121 }else {
1122 break;
1126 return copied;
1129 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1130 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1131 static streamsize basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1133 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1134 return basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1137 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1138 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1139 static void basic_streambuf_char__Unlock(basic_streambuf_char *this)
1141 TRACE("(%p)\n", this);
1144 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1145 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1146 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1147 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1149 TRACE("(%p)\n", this);
1150 return *this->prbuf;
1153 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1154 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1155 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1156 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1158 TRACE("(%p)\n", this);
1159 return *this->prpos;
1162 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1163 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1164 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1165 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1167 TRACE("(%p)\n", this);
1168 return *this->prpos+*this->prsize;
1171 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1172 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1173 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1174 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1176 TRACE("(%p)\n", this);
1177 return *this->pwpos+*this->pwsize;
1180 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1181 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1182 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1183 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1185 TRACE("(%p %d)\n", this, off);
1186 *this->prpos += off;
1187 *this->prsize -= off;
1190 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1191 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1192 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1193 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, \
1194 void, (basic_streambuf_char*, const locale*), (this, loc))
1195 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1197 TRACE("(%p %p)\n", this, loc);
1200 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1201 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1202 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1203 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, \
1204 int, (basic_streambuf_char*, int), (this, ch))
1205 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1207 TRACE("(%p %d)\n", this, ch);
1208 return EOF;
1211 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1212 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1213 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1214 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, \
1215 int, (basic_streambuf_char*, int), (this, ch))
1216 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1218 TRACE("(%p %d)\n", this, ch);
1219 return EOF;
1222 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1223 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1224 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1225 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1227 TRACE("(%p)\n", this);
1228 return *this->pwbuf;
1231 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1232 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1233 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1234 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1236 TRACE("(%p %d)\n", this, off);
1237 *this->pwpos += off;
1238 *this->pwsize -= off;
1241 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1242 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1243 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1244 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1246 TRACE("(%p)\n", this);
1247 return *this->pwpos;
1250 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1251 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1252 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1253 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1255 TRACE("(%p %p)\n", this, loc);
1256 memcpy(ret, this->loc, sizeof(locale));
1257 call_basic_streambuf_char_imbue(this, loc);
1258 locale_copy_ctor(this->loc, loc);
1259 return ret;
1262 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1263 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1264 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1265 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, \
1266 fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1267 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1268 fpos_int *ret, streamoff off, int way, int mode)
1270 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1271 ret->off = 0;
1272 ret->pos = -1;
1273 ret->state = 0;
1274 return ret;
1277 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1278 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1279 static fpos_int* basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1280 fpos_int *ret, streamoff off, int way, int mode)
1282 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1283 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1286 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1287 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1288 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1289 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, \
1290 fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1291 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1292 fpos_int *ret, fpos_int pos, int mode)
1294 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1295 ret->off = 0;
1296 ret->pos = -1;
1297 ret->state = 0;
1298 return ret;
1301 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1302 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1303 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1304 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1305 fpos_int *ret, fpos_int pos, int mode)
1307 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1308 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1311 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1312 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1313 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1314 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, \
1315 basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1316 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1318 TRACE("(%p %p %ld)\n", this, buf, count);
1319 return this;
1322 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1323 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1324 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1325 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1327 TRACE("(%p %p %ld)\n", this, buf, count);
1328 return call_basic_streambuf_char_setbuf(this, buf, count);
1331 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1332 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1333 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1334 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, \
1335 int, (basic_streambuf_char*), (this))
1336 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1338 TRACE("(%p)\n", this);
1339 return 0;
1342 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1343 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1344 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1345 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1347 TRACE("(%p)\n", this);
1348 return call_basic_streambuf_char_sync(this);
1351 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1352 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1353 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1354 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1356 TRACE("(%p %p %ld)\n", this, ptr, count);
1357 return basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1360 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1361 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1362 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1363 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, \
1364 streamsize, (basic_streambuf_char*), (this))
1365 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1367 TRACE("(%p)\n", this);
1368 return 0;
1371 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1372 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1373 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1374 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1376 streamsize ret;
1378 TRACE("(%p)\n", this);
1380 ret = basic_streambuf_char__Gnavail(this);
1381 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1384 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1385 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1386 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1387 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1389 TRACE("(%p %d)\n", this, ch);
1390 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1391 (*this->prsize)++;
1392 (*this->prpos)--;
1393 return (unsigned char)ch;
1396 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1399 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1400 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1401 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1402 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1404 TRACE("(%p %d)\n", this, ch);
1405 return basic_streambuf_char__Pnavail(this) ?
1406 (*basic_streambuf_char__Pninc(this) = ch) :
1407 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1410 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1411 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1412 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1413 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1415 TRACE("(%p)\n", this);
1416 if(*this->prpos && *this->prpos>*this->prbuf) {
1417 (*this->prsize)++;
1418 (*this->prpos)--;
1419 return (unsigned char)**this->prpos;
1422 return call_basic_streambuf_char_pbackfail(this, EOF);
1425 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1426 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1427 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1428 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1430 TRACE("(%p)\n", this);
1431 if(basic_streambuf_char__Gnavail(this))
1432 basic_streambuf_char__Gninc(this);
1433 else
1434 call_basic_streambuf_char_uflow(this);
1437 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1438 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1439 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1440 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1442 TRACE("(%p)\n", this);
1443 return basic_streambuf_char__Gnavail(this) ?
1444 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1447 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1448 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1449 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1450 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1452 TRACE("(%p)\n", this);
1453 return basic_streambuf_char__Gnavail(this) ?
1454 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1457 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1458 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1459 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1460 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1462 TRACE("(%p)\n", this);
1464 if(basic_streambuf_char__Gnavail(this) > 1)
1465 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1466 return basic_streambuf_char_sbumpc(this)==EOF ?
1467 EOF : basic_streambuf_char_sgetc(this);
1470 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1471 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1472 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1473 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, \
1474 streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1475 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1477 TRACE("(%p %p %ld)\n", this, ptr, count);
1478 return basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1481 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1482 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1483 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1484 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, \
1485 streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1486 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1488 streamsize copied, chunk;
1490 TRACE("(%p %p %ld)\n", this, ptr, count);
1492 for(copied=0; copied<count;) {
1493 chunk = basic_streambuf_char__Pnavail(this);
1494 if(chunk > count-copied)
1495 chunk = count-copied;
1497 if(chunk > 0) {
1498 memcpy(*this->pwpos, ptr+copied, chunk);
1499 *this->pwpos += chunk;
1500 *this->pwsize -= chunk;
1501 copied += chunk;
1502 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1503 copied++;
1504 }else {
1505 break;
1509 return copied;
1512 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1513 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1514 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1515 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1517 TRACE("(%p %p %ld)\n", this, ptr, count);
1518 return call_basic_streambuf_char_xsputn(this, ptr, count);
1521 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1522 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1523 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1524 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1525 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1526 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1528 TRACE("(%p %p %p %p)\n", this, first, next, last);
1530 this->wbuf = first;
1531 this->wpos = next;
1532 this->wsize = last-next;
1535 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1536 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1537 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1538 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1539 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1540 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1542 basic_streambuf_wchar_setp_next(this, first, first, last);
1545 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1546 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1547 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1548 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1549 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1550 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1552 TRACE("(%p %p %p %p)\n", this, first, next, last);
1554 this->rbuf = first;
1555 this->rpos = next;
1556 this->rsize = last-next;
1559 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1560 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1561 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1562 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1563 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1564 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1566 TRACE("(%p)\n", this);
1568 this->prbuf = &this->rbuf;
1569 this->pwbuf = &this->wbuf;
1570 this->prpos = &this->rpos;
1571 this->pwpos = &this->wpos;
1572 this->prsize = &this->rsize;
1573 this->pwsize = &this->wsize;
1575 basic_streambuf_wchar_setp(this, NULL, NULL);
1576 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1579 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1580 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1581 static basic_streambuf_wchar* basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1583 TRACE("(%p %d)\n", this, uninitialized);
1584 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1585 mutex_ctor(&this->lock);
1586 return this;
1589 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1590 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1591 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1592 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1594 TRACE("(%p %d)\n", this, uninitialized);
1595 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1596 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1597 return this;
1600 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1601 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1602 static basic_streambuf_wchar* basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1604 TRACE("(%p)\n", this);
1606 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1607 mutex_ctor(&this->lock);
1608 this->loc = MSVCRT_operator_new(sizeof(locale));
1609 locale_ctor(this->loc);
1610 basic_streambuf_wchar__Init_empty(this);
1612 return this;
1615 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1616 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1617 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1618 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1620 TRACE("(%p)\n", this);
1621 basic_streambuf_wchar_ctor(this);
1622 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1623 return this;
1626 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1627 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1628 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1629 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1630 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1631 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1633 TRACE("(%p)\n", this);
1635 mutex_dtor(&this->lock);
1636 locale_dtor(this->loc);
1637 MSVCRT_operator_delete(this->loc);
1640 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
1641 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1643 TRACE("(%p %x)\n", this, flags);
1644 if(flags & 2) {
1645 /* we have an array, with the number of elements stored before the first object */
1646 INT_PTR i, *ptr = (INT_PTR *)this-1;
1648 for(i=*ptr-1; i>=0; i--)
1649 basic_streambuf_wchar_dtor(this+i);
1650 MSVCRT_operator_delete(ptr);
1651 } else {
1652 basic_streambuf_wchar_dtor(this);
1653 if(flags & 1)
1654 MSVCRT_operator_delete(this);
1657 return this;
1660 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1661 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1662 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1663 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1664 static streamsize basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1666 TRACE("(%p)\n", this);
1667 return *this->prpos ? *this->prsize : 0;
1670 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1671 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1672 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1673 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1674 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1675 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1677 TRACE("(%p)\n", this);
1678 (*this->prsize)++;
1679 (*this->prpos)--;
1680 return *this->prpos;
1683 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1684 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1685 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1686 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1687 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1688 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1690 TRACE("(%p)\n", this);
1691 (*this->prsize)--;
1692 return (*this->prpos)++;
1695 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1696 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1697 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1698 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1699 static wchar_t* basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1701 TRACE("(%p)\n", this);
1702 (*this->prsize)--;
1703 (*this->prpos)++;
1704 return *this->prpos;
1707 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1708 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1709 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1710 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1711 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1712 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)
1714 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1716 this->prbuf = gf;
1717 this->pwbuf = pf;
1718 this->prpos = gn;
1719 this->pwpos = pn;
1720 this->prsize = gc;
1721 this->pwsize = pc;
1724 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1725 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1726 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1727 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1728 static void basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
1730 TRACE("(%p)\n", this);
1731 mutex_lock(&this->lock);
1734 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1735 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1736 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1737 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1738 static streamsize basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
1740 TRACE("(%p)\n", this);
1741 return *this->pwpos ? *this->pwsize : 0;
1744 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1745 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1746 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1747 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1748 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
1749 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
1751 TRACE("(%p)\n", this);
1752 (*this->pwsize)--;
1753 return (*this->pwpos)++;
1756 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1757 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1758 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1759 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1760 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
1761 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, \
1762 unsigned short, (basic_streambuf_wchar*), (this))
1763 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
1765 TRACE("(%p)\n", this);
1766 return WEOF;
1769 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1770 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1771 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1772 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1773 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
1774 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, \
1775 unsigned short, (basic_streambuf_wchar*), (this))
1776 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
1778 int ret;
1780 TRACE("(%p)\n", this);
1782 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
1783 return WEOF;
1785 ret = **this->prpos;
1786 (*this->prsize)--;
1787 (*this->prpos)++;
1788 return ret;
1791 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
1792 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
1793 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
1794 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
1795 static streamsize basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1797 streamsize copied, chunk;
1798 unsigned short c;
1800 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1802 for(copied=0; copied<count && size;) {
1803 chunk = basic_streambuf_wchar__Gnavail(this);
1804 if(chunk > count-copied)
1805 chunk = count-copied;
1807 if(chunk > 0) {
1808 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
1809 *this->prpos += chunk;
1810 *this->prsize -= chunk;
1811 copied += chunk;
1812 size -= chunk*sizeof(wchar_t);
1813 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
1814 ptr[copied] = c;
1815 copied++;
1816 size--;
1817 }else {
1818 break;
1822 return copied;
1825 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
1826 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
1827 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
1828 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
1829 static streamsize basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1831 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1832 return basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
1835 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1836 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1837 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1838 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1839 static void basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
1841 TRACE("(%p)\n", this);
1842 mutex_unlock(&this->lock);
1845 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1846 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1847 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1848 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1849 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
1850 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
1852 TRACE("(%p)\n", this);
1853 return *this->prbuf;
1856 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1857 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1858 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1859 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1860 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
1861 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
1863 TRACE("(%p)\n", this);
1864 return *this->prpos;
1867 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1868 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1869 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1870 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1871 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
1872 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
1874 TRACE("(%p)\n", this);
1875 return *this->prpos+*this->prsize;
1878 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1879 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1880 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1881 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1882 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
1883 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
1885 TRACE("(%p)\n", this);
1886 return *this->pwpos+*this->pwsize;
1889 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
1890 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
1891 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
1892 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
1893 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
1894 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
1896 TRACE("(%p %d)\n", this, off);
1897 *this->prpos += off;
1898 *this->prsize -= off;
1901 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
1902 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
1903 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
1904 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
1905 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
1906 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, \
1907 void, (basic_streambuf_wchar*, const locale*), (this, loc))
1908 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
1910 TRACE("(%p %p)\n", this, loc);
1913 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
1914 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
1915 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
1916 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
1917 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
1918 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, \
1919 unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
1920 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
1922 TRACE("(%p %d)\n", this, ch);
1923 return WEOF;
1926 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
1927 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
1928 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
1929 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
1930 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
1931 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, \
1932 unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
1933 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
1935 TRACE("(%p %d)\n", this, ch);
1936 return WEOF;
1939 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1940 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1941 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1942 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1943 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
1944 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
1946 TRACE("(%p)\n", this);
1947 return *this->pwbuf;
1950 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
1951 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
1952 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
1953 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
1954 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
1955 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
1957 TRACE("(%p %d)\n", this, off);
1958 *this->pwpos += off;
1959 *this->pwsize -= off;
1962 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1963 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1964 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1965 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1966 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
1967 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
1969 TRACE("(%p)\n", this);
1970 return *this->pwpos;
1973 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1974 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1975 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1976 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1977 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
1978 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
1980 TRACE("(%p %p)\n", this, loc);
1981 memcpy(ret, this->loc, sizeof(locale));
1982 call_basic_streambuf_wchar_imbue(this, loc);
1983 locale_copy_ctor(this->loc, loc);
1984 return ret;
1987 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1988 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1989 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1990 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1991 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
1992 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, \
1993 fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1994 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
1995 fpos_int *ret, streamoff off, int way, int mode)
1997 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1998 ret->off = 0;
1999 ret->pos = -1;
2000 ret->state = 0;
2001 return ret;
2004 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2005 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2006 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2007 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2008 static fpos_int* basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2009 fpos_int *ret, streamoff off, int way, int mode)
2011 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
2012 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2015 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2016 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2017 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2018 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2019 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2020 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, \
2021 fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2022 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2023 fpos_int *ret, fpos_int pos, int mode)
2025 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2026 ret->off = 0;
2027 ret->pos = -1;
2028 ret->state = 0;
2029 return ret;
2032 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2033 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2034 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2035 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2036 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2037 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2038 fpos_int *ret, fpos_int pos, int mode)
2040 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2041 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2044 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2045 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2046 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2047 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2048 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2049 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, \
2050 basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2051 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2053 TRACE("(%p %p %ld)\n", this, buf, count);
2054 return this;
2057 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2058 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2059 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2060 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2061 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2062 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2064 TRACE("(%p %p %ld)\n", this, buf, count);
2065 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2068 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2069 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2070 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2071 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2072 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2073 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, \
2074 int, (basic_streambuf_wchar*), (this))
2075 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2077 TRACE("(%p)\n", this);
2078 return 0;
2081 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2082 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2083 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2084 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2085 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2086 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2088 TRACE("(%p)\n", this);
2089 return call_basic_streambuf_wchar_sync(this);
2092 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2093 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2094 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2095 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2096 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2097 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2099 TRACE("(%p %p %ld)\n", this, ptr, count);
2100 return basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2103 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2104 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2105 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2106 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2107 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2108 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, \
2109 streamsize, (basic_streambuf_wchar*), (this))
2110 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2112 TRACE("(%p)\n", this);
2113 return 0;
2116 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2117 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2118 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2119 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2120 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2121 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2123 streamsize ret;
2125 TRACE("(%p)\n", this);
2127 ret = basic_streambuf_wchar__Gnavail(this);
2128 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2131 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2132 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2133 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2134 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2135 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2136 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2138 TRACE("(%p %d)\n", this, ch);
2139 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2140 (*this->prsize)++;
2141 (*this->prpos)--;
2142 return ch;
2145 return call_basic_streambuf_wchar_pbackfail(this, ch);
2148 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2149 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2150 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2151 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2152 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2153 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2155 TRACE("(%p %d)\n", this, ch);
2156 return basic_streambuf_wchar__Pnavail(this) ?
2157 (*basic_streambuf_wchar__Pninc(this) = ch) :
2158 call_basic_streambuf_wchar_overflow(this, ch);
2161 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2162 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2163 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2164 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2165 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2166 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2168 TRACE("(%p)\n", this);
2169 if(*this->prpos && *this->prpos>*this->prbuf) {
2170 (*this->prsize)++;
2171 (*this->prpos)--;
2172 return **this->prpos;
2175 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2178 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2179 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2180 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2181 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2182 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2183 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2185 TRACE("(%p)\n", this);
2186 if(basic_streambuf_wchar__Gnavail(this))
2187 basic_streambuf_wchar__Gninc(this);
2188 else
2189 call_basic_streambuf_wchar_uflow(this);
2192 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2193 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2194 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2195 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2196 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2197 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2199 TRACE("(%p)\n", this);
2200 return basic_streambuf_wchar__Gnavail(this) ?
2201 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2204 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2205 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2206 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2207 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2208 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2209 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2211 TRACE("(%p)\n", this);
2212 return basic_streambuf_wchar__Gnavail(this) ?
2213 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2216 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2217 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2218 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2219 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2220 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2221 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2223 TRACE("(%p)\n", this);
2225 if(basic_streambuf_wchar__Gnavail(this) > 1)
2226 return *basic_streambuf_wchar__Gnpreinc(this);
2227 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2228 WEOF : basic_streambuf_wchar_sgetc(this);
2231 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2232 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2233 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2234 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2235 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2236 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, \
2237 streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2238 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2240 TRACE("(%p %p %ld)\n", this, ptr, count);
2241 return basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2244 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2245 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2246 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2247 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2248 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2249 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, \
2250 streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2251 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2253 streamsize copied, chunk;
2255 TRACE("(%p %p %ld)\n", this, ptr, count);
2257 for(copied=0; copied<count;) {
2258 chunk = basic_streambuf_wchar__Pnavail(this);
2259 if(chunk > count-copied)
2260 chunk = count-copied;
2262 if(chunk > 0) {
2263 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2264 *this->pwpos += chunk;
2265 *this->pwsize -= chunk;
2266 copied += chunk;
2267 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2268 copied++;
2269 }else {
2270 break;
2274 return copied;
2277 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2278 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2279 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2280 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2281 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2282 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2284 TRACE("(%p %p %ld)\n", this, ptr, count);
2285 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2288 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2289 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2290 int basic_filebuf_char__Init__Stinit = 0;
2292 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2293 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2294 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2295 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2297 TRACE("(%p %p %d)\n", this, file, which);
2299 this->cvt = NULL;
2300 this->wrotesome = FALSE;
2301 this->state = basic_filebuf_char__Init__Stinit;
2302 this->close = (which == INITFL_open);
2303 this->file = file;
2305 basic_streambuf_char__Init_empty(&this->base);
2306 if(file)
2307 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2308 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2311 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
2312 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
2313 static void basic_filebuf_char__Initcvt(basic_filebuf_char *this, codecvt_char *cvt)
2315 TRACE("(%p %p)\n", this, cvt);
2317 if(codecvt_base_always_noconv(&cvt->base)) {
2318 this->cvt = NULL;
2319 }else {
2320 basic_streambuf_char__Init_empty(&this->base);
2321 this->cvt = cvt;
2325 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
2326 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
2327 static MSVCP_bool basic_filebuf_char__Endwrite(basic_filebuf_char *this)
2329 TRACE("(%p)\n", this);
2331 if(!this->wrotesome || !this->cvt)
2332 return TRUE;
2335 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2336 return FALSE;
2338 while(1) {
2339 /* TODO: check if we need a dynamic buffer here */
2340 char buf[128];
2341 char *next;
2342 int ret;
2344 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
2345 switch(ret) {
2346 case CODECVT_ok:
2347 this->wrotesome = FALSE;
2348 /* fall through */
2349 case CODECVT_partial:
2350 if(!fwrite(buf, next-buf, 1, this->file))
2351 return FALSE;
2352 if(this->wrotesome)
2353 break;
2354 /* fall through */
2355 case CODECVT_noconv:
2356 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2357 return FALSE;
2358 return TRUE;
2359 default:
2360 return FALSE;
2365 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2366 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2367 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2368 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2370 basic_filebuf_char *ret = this;
2372 TRACE("(%p)\n", this);
2374 if(!this->file)
2375 return NULL;
2377 /* TODO: handle exceptions */
2378 if(!basic_filebuf_char__Endwrite(this))
2379 ret = NULL;
2380 if(fclose(this->file))
2381 ret = NULL;
2383 basic_filebuf_char__Init(this, NULL, INITFL_close);
2384 return ret;
2387 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2388 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2389 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2390 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2392 TRACE("(%p %p)\n", this, file);
2394 basic_streambuf_char_ctor(&this->base);
2395 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2397 basic_filebuf_char__Init(this, file, INITFL_new);
2398 return this;
2401 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2402 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2403 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2404 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2406 return basic_filebuf_char_ctor_file(this, NULL);
2409 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2410 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2411 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2412 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2414 TRACE("(%p %d)\n", this, uninitialized);
2416 basic_streambuf_char_ctor(&this->base);
2417 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2418 return this;
2421 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2422 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2423 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2424 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2426 TRACE("(%p)\n", this);
2428 if(this->close)
2429 basic_filebuf_char_close(this);
2430 basic_streambuf_char_dtor(&this->base);
2433 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
2434 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2436 TRACE("(%p %x)\n", this, flags);
2437 if(flags & 2) {
2438 /* we have an array, with the number of elements stored before the first object */
2439 INT_PTR i, *ptr = (INT_PTR *)this-1;
2441 for(i=*ptr-1; i>=0; i--)
2442 basic_filebuf_char_dtor(this+i);
2443 MSVCRT_operator_delete(ptr);
2444 } else {
2445 basic_filebuf_char_dtor(this);
2446 if(flags & 1)
2447 MSVCRT_operator_delete(this);
2450 return this;
2453 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2454 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2455 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2456 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2458 TRACE("(%p)\n", this);
2459 return this->file != NULL;
2462 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
2463 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
2464 static FILE* _Fiopen_wchar(const wchar_t *name, int mode, int prot)
2466 static const wchar_t rW[] = {'r',0};
2467 static const struct {
2468 int mode;
2469 const wchar_t str[4];
2470 const wchar_t str_bin[4];
2471 } str_mode[] = {
2472 {OPENMODE_out, {'w',0}, {'w','b',0}},
2473 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
2474 {OPENMODE_app, {'a',0}, {'a','b',0}},
2475 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
2476 {OPENMODE_in, {'r',0}, {'r','b',0}},
2477 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
2478 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
2479 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
2480 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
2483 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2484 int mode_idx;
2485 FILE *f = NULL;
2487 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
2489 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
2490 if(str_mode[mode_idx].mode == real_mode)
2491 break;
2492 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
2493 return NULL;
2495 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
2496 return NULL;
2497 else if(f)
2498 fclose(f);
2500 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2501 && (f = _wfopen(name, rW))) {
2502 fclose(f);
2503 return NULL;
2506 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2507 : str_mode[mode_idx].str, prot);
2508 if(!f)
2509 return NULL;
2511 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2512 fclose(f);
2513 return NULL;
2516 return f;
2519 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
2520 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
2521 static FILE* _Fiopen(const char *name, int mode, int prot)
2523 wchar_t nameW[FILENAME_MAX];
2525 TRACE("(%s %d %d)\n", name, mode, prot);
2527 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2528 return NULL;
2529 return _Fiopen_wchar(nameW, mode, prot);
2532 /* ?__Fiopen@std@@YAPAU_iobuf@@PBDH@Z */
2533 /* ?__Fiopen@std@@YAPEAU_iobuf@@PEBDH@Z */
2534 FILE* __cdecl ___Fiopen(const char *name, int mode)
2536 TRACE("(%p %d)\n", name, mode);
2537 return _Fiopen(name, mode, _SH_DENYNO);
2540 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2541 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2542 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2543 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2544 static basic_filebuf_char* basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2546 FILE *f = NULL;
2548 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2550 if(basic_filebuf_char_is_open(this))
2551 return NULL;
2553 if(!(f = _Fiopen_wchar(name, mode, prot)))
2554 return NULL;
2556 basic_filebuf_char__Init(this, f, INITFL_open);
2557 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(this->base.loc));
2558 return this;
2561 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2562 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2563 static basic_filebuf_char* basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2565 wchar_t nameW[FILENAME_MAX];
2567 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
2569 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2570 return NULL;
2571 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
2574 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDF@Z */
2575 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDF@Z */
2576 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
2577 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
2579 TRACE("(%p %p %d)\n", this, name, mode);
2580 return basic_filebuf_char_open(this, name, mode, _SH_DENYNO);
2583 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDH@Z */
2584 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDH@Z */
2585 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
2586 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, int mode)
2588 TRACE("(%p %p %d)\n", this, name, mode);
2589 return basic_filebuf_char_open(this, name, mode, _SH_DENYNO);
2592 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2593 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2594 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
2595 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
2597 char buf[8], *dyn_buf;
2598 char ch = c, *to_next;
2599 const char *from_next;
2600 int ret, max_size;
2603 TRACE("(%p %d)\n", this, c);
2605 if(!basic_filebuf_char_is_open(this))
2606 return EOF;
2607 if(c == EOF)
2608 return !c;
2610 if(!this->cvt)
2611 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2613 from_next = &ch;
2614 do {
2615 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
2616 &from_next, buf, buf+sizeof(buf), &to_next);
2618 switch(ret) {
2619 case CODECVT_partial:
2620 if(to_next == buf)
2621 break;
2622 /* fall through */
2623 case CODECVT_ok:
2624 if(!fwrite(buf, to_next-buf, 1, this->file))
2625 return EOF;
2626 if(ret == CODECVT_partial)
2627 continue;
2628 return c;
2629 case CODECVT_noconv:
2630 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2631 default:
2632 return EOF;
2635 break;
2636 } while(1);
2638 max_size = codecvt_base_max_length(&this->cvt->base);
2639 dyn_buf = malloc(max_size);
2640 if(!dyn_buf)
2641 return EOF;
2643 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
2644 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
2646 switch(ret) {
2647 case CODECVT_ok:
2648 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
2649 free(dyn_buf);
2650 return ret ? c : EOF;
2651 case CODECVT_partial:
2652 ERR("buffer should be big enough to store all output\n");
2653 /* fall through */
2654 default:
2655 free(dyn_buf);
2656 return EOF;
2660 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2661 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2662 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
2663 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
2665 TRACE("(%p %d)\n", this, c);
2667 if(!basic_filebuf_char_is_open(this))
2668 return EOF;
2670 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
2671 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
2672 basic_streambuf_char__Gndec(&this->base);
2673 return c==EOF ? !c : c;
2674 }else if(c!=EOF && !this->cvt) {
2675 return ungetc(c, this->file);
2678 return EOF;
2681 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2682 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2683 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
2684 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
2686 char ch, buf[128], *to_next;
2687 const char *buf_next;
2688 int c, i;
2690 TRACE("(%p)\n", this);
2692 if(!basic_filebuf_char_is_open(this))
2693 return EOF;
2695 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2696 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
2698 c = fgetc(this->file);
2699 if(!this->cvt || c==EOF)
2700 return c;
2702 buf_next = buf;
2703 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
2704 buf[i] = c;
2706 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
2707 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
2708 case CODECVT_partial:
2709 case CODECVT_ok:
2710 if(to_next == &ch) {
2711 c = fgetc(this->file);
2712 if(c == EOF)
2713 return EOF;
2714 continue;
2717 for(i--; i>=buf_next-buf; i--)
2718 ungetc(buf[i], this->file);
2719 return ch;
2720 case CODECVT_noconv:
2721 return (unsigned char)buf[0];
2722 default:
2723 return EOF;
2727 FIXME("buffer is too small\n");
2728 return EOF;
2731 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2732 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2733 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
2734 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
2736 int ret;
2738 TRACE("(%p)\n", this);
2740 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2741 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
2743 ret = call_basic_streambuf_char_uflow(&this->base);
2744 if(ret != EOF)
2745 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
2746 return ret;
2749 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2750 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2751 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
2752 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
2753 fpos_int *ret, streamoff off, int way, int mode)
2755 fpos_t pos;
2757 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
2759 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
2760 || fseek(this->file, off, way)) {
2761 ret->off = 0;
2762 ret->pos = -1;
2763 ret->state = 0;
2764 return ret;
2767 fgetpos(this->file, &pos);
2768 ret->off = 0;
2769 ret->pos = pos;
2770 ret->state = this->state;
2771 return ret;
2774 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2775 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2776 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
2777 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
2778 fpos_int *ret, fpos_int pos, int mode)
2780 fpos_t fpos;
2782 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
2784 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
2785 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
2786 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
2787 ret->off = 0;
2788 ret->pos = -1;
2789 ret->state = 0;
2790 return ret;
2793 fgetpos(this->file, &fpos);
2794 ret->off = 0;
2795 ret->pos = fpos;
2796 ret->state = this->state;
2797 return ret;
2800 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
2801 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
2802 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
2803 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
2805 TRACE("(%p %p %ld)\n", this, buf, count);
2807 if(!basic_filebuf_char_is_open(this))
2808 return NULL;
2810 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
2811 return NULL;
2813 basic_filebuf_char__Init(this, this->file, INITFL_open);
2814 return &this->base;
2817 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2818 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2819 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
2820 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
2822 TRACE("(%p)\n", this);
2824 if(!basic_filebuf_char_is_open(this))
2825 return 0;
2827 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2828 return 0;
2829 return fflush(this->file);
2832 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
2833 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
2834 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
2835 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
2837 TRACE("(%p %p)\n", this, loc);
2838 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(loc));
2841 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2842 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2843 int basic_filebuf_short__Init__Stinit = 0;
2845 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2846 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2847 static void basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
2849 TRACE("(%p %p %d)\n", this, file, which);
2851 this->cvt = NULL;
2852 this->wrotesome = FALSE;
2853 this->state = 0;
2854 this->close = (which == INITFL_open);
2855 this->file = file;
2857 basic_streambuf_wchar__Init_empty(&this->base);
2860 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2861 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2862 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
2863 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
2865 TRACE("(%p %p %d)\n", this, file, which);
2867 this->cvt = NULL;
2868 this->wrotesome = FALSE;
2869 this->state = basic_filebuf_short__Init__Stinit;
2870 this->close = (which == INITFL_open);
2871 this->file = file;
2873 basic_streambuf_wchar__Init_empty(&this->base);
2876 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
2877 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
2878 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
2879 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
2880 static void basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
2882 TRACE("(%p %p)\n", this, cvt);
2884 if(codecvt_base_always_noconv(&cvt->base)) {
2885 this->cvt = NULL;
2886 }else {
2887 basic_streambuf_wchar__Init_empty(&this->base);
2888 this->cvt = cvt;
2892 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAE_NXZ */
2893 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAA_NXZ */
2894 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAE_NXZ */
2895 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAA_NXZ */
2896 static MSVCP_bool basic_filebuf_wchar__Endwrite(basic_filebuf_wchar *this)
2898 TRACE("(%p)\n", this);
2900 if(!this->wrotesome || !this->cvt)
2901 return TRUE;
2903 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
2904 return FALSE;
2906 while(1) {
2907 /* TODO: check if we need a dynamic buffer here */
2908 char buf[128];
2909 char *next;
2910 int ret;
2912 ret = codecvt_wchar_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
2913 switch(ret) {
2914 case CODECVT_ok:
2915 this->wrotesome = FALSE;
2916 /* fall through */
2917 case CODECVT_partial:
2918 if(!fwrite(buf, next-buf, 1, this->file))
2919 return FALSE;
2920 if(this->wrotesome)
2921 break;
2922 /* fall through */
2923 case CODECVT_noconv:
2924 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
2925 return FALSE;
2926 return TRUE;
2927 default:
2928 return FALSE;
2933 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
2934 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
2935 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
2936 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
2937 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
2938 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
2940 basic_filebuf_wchar *ret = this;
2942 TRACE("(%p)\n", this);
2944 if(!this->file)
2945 return NULL;
2947 /* TODO: handle exceptions */
2948 if(!basic_filebuf_wchar__Endwrite(this))
2949 ret = NULL;
2950 if(fclose(this->file))
2951 ret = NULL;
2953 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
2954 return ret;
2957 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
2958 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2959 static basic_filebuf_wchar* basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
2961 TRACE("(%p %p)\n", this, file);
2963 basic_streambuf_wchar_ctor(&this->base);
2964 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
2966 basic_filebuf_wchar__Init(this, file, INITFL_new);
2967 return this;
2970 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
2971 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2972 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
2973 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
2975 TRACE("(%p %p)\n", this, file);
2977 basic_streambuf_short_ctor(&this->base);
2978 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
2980 basic_filebuf_short__Init(this, file, INITFL_new);
2981 return this;
2984 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2985 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2986 static basic_filebuf_wchar* basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
2988 return basic_filebuf_wchar_ctor_file(this, NULL);
2991 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2992 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2993 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
2994 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
2996 return basic_filebuf_short_ctor_file(this, NULL);
2999 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3000 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3001 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3002 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3004 TRACE("(%p %d)\n", this, uninitialized);
3006 basic_streambuf_short_ctor(&this->base);
3007 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3008 return this;
3011 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3012 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3013 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3014 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3015 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3016 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3018 TRACE("(%p)\n", this);
3020 if(this->close)
3021 basic_filebuf_wchar_close(this);
3022 basic_streambuf_wchar_dtor(&this->base);
3025 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3026 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3028 TRACE("(%p %x)\n", this, flags);
3029 if(flags & 2) {
3030 /* we have an array, with the number of elements stored before the first object */
3031 INT_PTR i, *ptr = (INT_PTR *)this-1;
3033 for(i=*ptr-1; i>=0; i--)
3034 basic_filebuf_wchar_dtor(this+i);
3035 MSVCRT_operator_delete(ptr);
3036 } else {
3037 basic_filebuf_wchar_dtor(this);
3038 if(flags & 1)
3039 MSVCRT_operator_delete(this);
3042 return this;
3045 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3046 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3047 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3048 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3049 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3050 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3052 TRACE("(%p)\n", this);
3053 return this->file != NULL;
3056 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3057 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3058 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3059 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3060 static basic_filebuf_wchar* basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3062 FILE *f = NULL;
3064 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3066 if(basic_filebuf_wchar_is_open(this))
3067 return NULL;
3069 if(!(f = _Fiopen_wchar(name, mode, prot)))
3070 return NULL;
3072 basic_filebuf_wchar__Init(this, f, INITFL_open);
3073 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(this->base.loc));
3074 return this;
3077 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3078 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3079 static basic_filebuf_wchar* basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3081 wchar_t nameW[FILENAME_MAX];
3083 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3085 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3086 return NULL;
3087 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3090 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
3091 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
3092 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
3093 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
3095 TRACE("(%p %p %d)\n", this, name, mode);
3096 return basic_filebuf_wchar_open(this, name, mode, _SH_DENYNO);
3099 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
3100 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
3101 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3102 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, int mode)
3104 TRACE("(%p %p %d)\n", this, name, mode);
3105 return basic_filebuf_wchar_open(this, name, mode, _SH_DENYNO);
3108 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3109 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3110 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3111 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3112 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3113 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3115 char buf[8], *dyn_buf, *to_next;
3116 wchar_t ch = c;
3117 const wchar_t *from_next;
3118 int max_size;
3119 unsigned short ret;
3122 TRACE("(%p %d)\n", this, c);
3124 if(!basic_filebuf_wchar_is_open(this))
3125 return WEOF;
3126 if(c == WEOF)
3127 return !c;
3129 if(!this->cvt)
3130 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3132 from_next = &ch;
3133 do {
3134 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3135 &from_next, buf, buf+sizeof(buf), &to_next);
3137 switch(ret) {
3138 case CODECVT_partial:
3139 if(to_next == buf)
3140 break;
3141 /* fall through */
3142 case CODECVT_ok:
3143 if(!fwrite(buf, to_next-buf, 1, this->file))
3144 return WEOF;
3145 if(ret == CODECVT_partial)
3146 continue;
3147 return c;
3148 case CODECVT_noconv:
3149 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3150 default:
3151 return WEOF;
3154 break;
3155 } while(1);
3157 max_size = codecvt_base_max_length(&this->cvt->base);
3158 dyn_buf = malloc(max_size);
3159 if(!dyn_buf)
3160 return WEOF;
3162 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3163 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3165 switch(ret) {
3166 case CODECVT_ok:
3167 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3168 free(dyn_buf);
3169 return ret ? c : WEOF;
3170 case CODECVT_partial:
3171 ERR("buffer should be big enough to store all output\n");
3172 /* fall through */
3173 default:
3174 free(dyn_buf);
3175 return WEOF;
3179 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3180 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3181 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3182 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3183 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3184 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3186 TRACE("(%p %d)\n", this, c);
3188 if(!basic_filebuf_wchar_is_open(this))
3189 return WEOF;
3191 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3192 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3193 basic_streambuf_wchar__Gndec(&this->base);
3194 return c==WEOF ? !c : c;
3195 }else if(c!=WEOF && !this->cvt) {
3196 return ungetwc(c, this->file);
3197 }else if(c!=WEOF && basic_streambuf_wchar_gptr(&this->base)!=&this->putback) {
3198 this->putback = c;
3199 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback, &this->putback+1);
3200 return c;
3203 return WEOF;
3206 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3207 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3208 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3209 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3210 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
3211 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
3213 wchar_t ch, *to_next;
3214 char buf[128];
3215 const char *buf_next;
3216 int c, i;
3218 TRACE("(%p)\n", this);
3220 if(!basic_filebuf_wchar_is_open(this))
3221 return WEOF;
3223 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3224 return *basic_streambuf_wchar__Gninc(&this->base);
3226 if(!this->cvt)
3227 return fgetwc(this->file);
3229 buf_next = buf;
3230 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3231 if((c = fgetc(this->file)) == EOF)
3232 return WEOF;
3233 buf[i] = c;
3235 switch(codecvt_wchar_in(this->cvt, &this->state, buf_next,
3236 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3237 case CODECVT_partial:
3238 case CODECVT_ok:
3239 if(to_next == &ch)
3240 continue;
3242 for(i--; i>=buf_next-buf; i--)
3243 ungetc(buf[i], this->file);
3244 return ch;
3245 case CODECVT_noconv:
3246 if(i+1 < sizeof(wchar_t))
3247 continue;
3249 memcpy(&ch, buf, sizeof(wchar_t));
3250 return ch;
3251 default:
3252 return WEOF;
3256 FIXME("buffer is too small\n");
3257 return WEOF;
3260 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3261 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3262 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3263 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3264 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
3265 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
3267 unsigned short ret;
3269 TRACE("(%p)\n", this);
3271 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3272 return *basic_streambuf_wchar_gptr(&this->base);
3274 ret = call_basic_streambuf_wchar_uflow(&this->base);
3275 if(ret != WEOF)
3276 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
3277 return ret;
3280 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3281 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3282 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3283 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3284 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
3285 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
3286 fpos_int *ret, streamoff off, int way, int mode)
3288 fpos_t pos;
3290 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
3292 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback) {
3293 if(way == SEEKDIR_cur)
3294 off -= sizeof(wchar_t);
3296 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3299 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3300 || fseek(this->file, off, way)) {
3301 ret->off = 0;
3302 ret->pos = -1;
3303 ret->state = 0;
3304 return ret;
3307 fgetpos(this->file, &pos);
3308 ret->off = 0;
3309 ret->pos = pos;
3310 ret->state = this->state;
3311 return ret;
3314 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3315 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3316 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3317 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3318 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
3319 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
3320 fpos_int *ret, fpos_int pos, int mode)
3322 fpos_t fpos;
3324 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3326 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3327 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3328 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3329 ret->off = 0;
3330 ret->pos = -1;
3331 ret->state = 0;
3332 return ret;
3335 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback)
3336 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3338 fgetpos(this->file, &fpos);
3339 ret->off = 0;
3340 ret->pos = fpos;
3341 ret->state = this->state;
3342 return ret;
3345 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
3346 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
3347 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
3348 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3350 TRACE("(%p %p %ld)\n", this, buf, count);
3352 if(!basic_filebuf_wchar_is_open(this))
3353 return NULL;
3355 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3356 return NULL;
3358 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
3359 return &this->base;
3362 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
3363 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
3364 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
3365 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3367 TRACE("(%p %p %ld)\n", this, buf, count);
3369 if(!basic_filebuf_wchar_is_open(this))
3370 return NULL;
3372 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3373 return NULL;
3375 basic_filebuf_short__Init(this, this->file, INITFL_open);
3376 return &this->base;
3379 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
3380 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
3381 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
3382 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
3383 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
3384 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
3386 TRACE("(%p)\n", this);
3388 if(!basic_filebuf_wchar_is_open(this))
3389 return 0;
3391 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3392 return 0;
3393 return fflush(this->file);
3396 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
3397 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
3398 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
3399 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
3401 TRACE("(%p %p)\n", this, loc);
3402 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(loc));
3405 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
3406 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
3407 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
3408 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
3410 TRACE("(%p %p)\n", this, loc);
3411 basic_filebuf_wchar__Initcvt(this, codecvt_short_use_facet(loc));
3414 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3415 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3416 static int basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
3418 int state = 0;
3420 if(!(mode & OPENMODE_in))
3421 state |= STRINGBUF_no_read;
3423 if(!(mode & OPENMODE_out))
3424 state |= STRINGBUF_no_write;
3426 if(mode & OPENMODE_ate)
3427 state |= STRINGBUF_at_end;
3429 if(mode & OPENMODE_app)
3430 state |= STRINGBUF_append;
3432 return state;
3435 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
3436 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
3437 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
3438 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
3440 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
3442 basic_streambuf_char__Init_empty(&this->base);
3444 this->state = state;
3445 this->seekhigh = NULL;
3447 if(count && str) {
3448 char *buf = MSVCRT_operator_new(count);
3449 if(!buf) {
3450 ERR("Out of memory\n");
3451 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3454 memcpy(buf, str, count);
3455 this->seekhigh = buf + count;
3457 this->state |= STRINGBUF_allocated;
3459 if(!(state & STRINGBUF_no_read))
3460 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
3462 if(!(state & STRINGBUF_no_write)) {
3463 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3465 if(!basic_streambuf_char_gptr(&this->base))
3466 basic_streambuf_char_setg(&this->base, buf, 0, buf);
3471 /* ??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 */
3472 /* ??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 */
3473 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
3474 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
3475 const basic_string_char *str, IOSB_openmode mode)
3477 TRACE("(%p %p %d)\n", this, str, mode);
3479 basic_streambuf_char_ctor(&this->base);
3480 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3482 basic_stringbuf_char__Init(this, basic_string_char_c_str(str),
3483 str->size, basic_stringbuf_char__Getstate(this, mode));
3484 return this;
3487 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
3488 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
3489 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
3490 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
3491 basic_stringbuf_char *this, IOSB_openmode mode)
3493 TRACE("(%p %d)\n", this, mode);
3495 basic_streambuf_char_ctor(&this->base);
3496 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3498 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
3499 return this;
3502 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
3503 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
3504 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
3505 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
3507 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
3510 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
3511 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
3512 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
3513 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
3515 TRACE("(%p)\n", this);
3517 if(this->state & STRINGBUF_allocated) {
3518 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
3519 this->seekhigh = NULL;
3520 this->state &= ~STRINGBUF_allocated;
3523 basic_streambuf_char__Init_empty(&this->base);
3526 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
3527 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
3528 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
3529 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
3531 TRACE("(%p)\n", this);
3533 basic_stringbuf_char__Tidy(this);
3534 basic_streambuf_char_dtor(&this->base);
3537 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
3538 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
3540 TRACE("(%p %x)\n", this, flags);
3542 if(flags & 2) {
3543 /* we have an array, with the number of elements stored before the first object */
3544 INT_PTR i, *ptr = (INT_PTR *) this - 1;
3546 for (i = *ptr - 1; i >= 0; i--)
3547 basic_stringbuf_char_dtor(this+i);
3549 MSVCRT_operator_delete(ptr);
3550 }else {
3551 basic_stringbuf_char_dtor(this);
3553 if(flags & 1)
3554 MSVCRT_operator_delete(this);
3557 return this;
3560 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
3561 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
3562 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
3563 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
3565 MSVCP_size_t oldsize, size;
3566 char *ptr, *buf;
3568 TRACE("(%p %x)\n", this, meta);
3570 if(meta == EOF)
3571 return !EOF;
3572 if(this->state & STRINGBUF_no_write)
3573 return EOF;
3575 ptr = basic_streambuf_char_pptr(&this->base);
3576 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
3577 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
3578 this->seekhigh, basic_streambuf_char_epptr(&this->base));
3580 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
3581 return (*basic_streambuf_char__Pninc(&this->base) = meta);
3583 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
3584 size = oldsize|0xf;
3585 size += size/2;
3586 buf = MSVCRT_operator_new(size);
3587 if(!buf) {
3588 ERR("Out of memory\n");
3589 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3592 if(!oldsize) {
3593 this->seekhigh = buf;
3594 basic_streambuf_char_setp(&this->base, buf, buf+size);
3595 if(this->state & STRINGBUF_no_read)
3596 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
3597 else
3598 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
3600 this->state |= STRINGBUF_allocated;
3601 }else {
3602 ptr = basic_streambuf_char_eback(&this->base);
3603 memcpy(buf, ptr, oldsize);
3605 this->seekhigh = buf+(this->seekhigh-ptr);
3606 basic_streambuf_char_setp_next(&this->base, buf,
3607 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
3608 if(this->state & STRINGBUF_no_read)
3609 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
3610 else
3611 basic_streambuf_char_setg(&this->base, buf,
3612 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
3613 basic_streambuf_char_pptr(&this->base)+1);
3615 MSVCRT_operator_delete(ptr);
3618 return (*basic_streambuf_char__Pninc(&this->base) = meta);
3621 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
3622 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
3623 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
3624 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
3626 char *cur;
3628 TRACE("(%p %x)\n", this, c);
3630 cur = basic_streambuf_char_gptr(&this->base);
3631 if(!cur || cur==basic_streambuf_char_eback(&this->base)
3632 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
3633 return EOF;
3635 if(c != EOF)
3636 cur[-1] = c;
3637 basic_streambuf_char_gbump(&this->base, -1);
3638 return c==EOF ? !EOF : c;
3641 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
3642 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
3643 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
3644 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
3646 char *ptr, *cur;
3648 TRACE("(%p)\n", this);
3650 cur = basic_streambuf_char_gptr(&this->base);
3651 if(!cur || this->state&STRINGBUF_no_read)
3652 return EOF;
3654 ptr = basic_streambuf_char_pptr(&this->base);
3655 if(this->seekhigh < ptr)
3656 this->seekhigh = ptr;
3658 ptr = basic_streambuf_char_egptr(&this->base);
3659 if(this->seekhigh > ptr)
3660 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
3662 if(cur < this->seekhigh)
3663 return (unsigned char)*cur;
3664 return EOF;
3667 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3668 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3669 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
3670 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
3671 fpos_int *ret, streamoff off, int way, int mode)
3673 char *beg, *cur_r, *cur_w;
3675 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
3677 cur_w = basic_streambuf_char_pptr(&this->base);
3678 if(cur_w > this->seekhigh)
3679 this->seekhigh = cur_w;
3681 ret->off = 0;
3682 ret->state = 0;
3684 beg = basic_streambuf_char_eback(&this->base);
3685 cur_r = basic_streambuf_char_gptr(&this->base);
3686 if((mode & OPENMODE_in) && cur_r) {
3687 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
3688 off += cur_r-beg;
3689 else if(way == SEEKDIR_end)
3690 off += this->seekhigh-beg;
3691 else if(way != SEEKDIR_beg)
3692 off = -1;
3694 if(off<0 || off>this->seekhigh-beg) {
3695 off = -1;
3696 }else {
3697 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
3698 if((mode & OPENMODE_out) && cur_w) {
3699 basic_streambuf_char_setp_next(&this->base, beg,
3700 basic_streambuf_char_gptr(&this->base),
3701 basic_streambuf_char_epptr(&this->base));
3704 }else if((mode & OPENMODE_out) && cur_w) {
3705 if(way == SEEKDIR_cur)
3706 off += cur_w-beg;
3707 else if(way == SEEKDIR_end)
3708 off += this->seekhigh-beg;
3709 else if(way != SEEKDIR_beg)
3710 off = -1;
3712 if(off<0 || off>this->seekhigh-beg)
3713 off = -1;
3714 else
3715 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
3716 }else {
3717 off = -1;
3720 ret->pos = off;
3721 return ret;
3724 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3725 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3726 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
3727 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
3728 fpos_int *ret, fpos_int pos, int mode)
3730 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3732 if(pos.off==0 && pos.pos==-1 && pos.state==0) {
3733 *ret = pos;
3734 return ret;
3737 return basic_stringbuf_char_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
3740 /* ?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 */
3741 /* ?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 */
3742 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
3743 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
3745 TRACE("(%p %p)\n", this, str);
3747 basic_stringbuf_char__Tidy(this);
3748 basic_stringbuf_char__Init(this, basic_string_char_c_str(str), str->size, this->state);
3751 /* ?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 */
3752 /* ?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 */
3753 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
3754 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
3756 char *ptr;
3758 TRACE("(%p)\n", this);
3760 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
3761 char *pptr;
3763 ptr = basic_streambuf_char_pbase(&this->base);
3764 pptr = basic_streambuf_char_pptr(&this->base);
3766 return basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
3769 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
3770 ptr = basic_streambuf_char_eback(&this->base);
3771 return basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
3774 return basic_string_char_ctor(ret);
3777 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
3778 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
3779 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
3780 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
3781 static int basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
3783 int state = 0;
3785 if(!(mode & OPENMODE_in))
3786 state |= STRINGBUF_no_read;
3788 if(!(mode & OPENMODE_out))
3789 state |= STRINGBUF_no_write;
3791 if(mode & OPENMODE_ate)
3792 state |= STRINGBUF_at_end;
3794 if(mode & OPENMODE_app)
3795 state |= STRINGBUF_append;
3797 return state;
3800 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
3801 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
3802 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
3803 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
3804 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
3805 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
3807 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
3809 basic_streambuf_wchar__Init_empty(&this->base);
3811 this->state = state;
3812 this->seekhigh = NULL;
3814 if(count && str) {
3815 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
3816 if(!buf) {
3817 ERR("Out of memory\n");
3818 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3821 memcpy(buf, str, count*sizeof(wchar_t));
3822 this->seekhigh = buf + count;
3824 this->state |= STRINGBUF_allocated;
3826 if(!(state & STRINGBUF_no_read))
3827 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
3829 if(!(state & STRINGBUF_no_write)) {
3830 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3832 if(!basic_streambuf_wchar_gptr(&this->base))
3833 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
3838 /* ??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 */
3839 /* ??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 */
3840 static basic_stringbuf_wchar* basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
3841 const basic_string_wchar *str, IOSB_openmode mode)
3843 TRACE("(%p %p %d)\n", this, str, mode);
3845 basic_streambuf_wchar_ctor(&this->base);
3846 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
3848 basic_stringbuf_wchar__Init(this, basic_string_wchar_c_str(str),
3849 str->size, basic_stringbuf_wchar__Getstate(this, mode));
3850 return this;
3853 /* ??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 */
3854 /* ??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 */
3855 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
3856 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
3857 const basic_string_wchar *str, IOSB_openmode mode)
3859 basic_stringbuf_wchar_ctor_str(this, str, mode);
3860 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
3861 return this;
3864 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
3865 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
3866 static basic_stringbuf_wchar* basic_stringbuf_wchar_ctor_mode(
3867 basic_stringbuf_wchar *this, IOSB_openmode mode)
3869 TRACE("(%p %d)\n", this, mode);
3871 basic_streambuf_wchar_ctor(&this->base);
3872 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
3874 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
3875 return this;
3878 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
3879 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
3880 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
3881 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
3882 basic_stringbuf_wchar *this, IOSB_openmode mode)
3884 basic_stringbuf_wchar_ctor_mode(this, mode);
3885 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
3886 return this;
3889 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
3890 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
3891 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
3892 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
3894 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
3897 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
3898 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
3899 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
3900 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
3901 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
3902 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
3904 TRACE("(%p)\n", this);
3906 if(this->state & STRINGBUF_allocated) {
3907 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
3908 this->seekhigh = NULL;
3909 this->state &= ~STRINGBUF_allocated;
3912 basic_streambuf_wchar__Init_empty(&this->base);
3915 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
3916 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
3917 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
3918 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
3919 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
3920 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
3922 TRACE("(%p)\n", this);
3924 basic_stringbuf_wchar__Tidy(this);
3925 basic_streambuf_wchar_dtor(&this->base);
3928 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
3929 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
3931 TRACE("(%p %x)\n", this, flags);
3933 if(flags & 2) {
3934 /* we have an array, with the number of elements stored before the first object */
3935 INT_PTR i, *ptr = (INT_PTR *) this - 1;
3937 for (i = *ptr - 1; i >= 0; i--)
3938 basic_stringbuf_wchar_dtor(this+i);
3940 MSVCRT_operator_delete(ptr);
3941 }else {
3942 basic_stringbuf_wchar_dtor(this);
3944 if(flags & 1)
3945 MSVCRT_operator_delete(this);
3948 return this;
3951 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
3952 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
3953 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
3954 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
3955 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
3956 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
3958 MSVCP_size_t oldsize, size;
3959 wchar_t *ptr, *buf;
3961 TRACE("(%p %x)\n", this, meta);
3963 if(meta == WEOF)
3964 return !WEOF;
3965 if(this->state & STRINGBUF_no_write)
3966 return WEOF;
3968 ptr = basic_streambuf_wchar_pptr(&this->base);
3969 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
3970 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
3971 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
3973 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
3974 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
3976 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
3977 size = oldsize|0xf;
3978 size += size/2;
3979 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
3980 if(!buf) {
3981 ERR("Out of memory\n");
3982 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3985 if(!oldsize) {
3986 this->seekhigh = buf;
3987 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
3988 if(this->state & STRINGBUF_no_read)
3989 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
3990 else
3991 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
3993 this->state |= STRINGBUF_allocated;
3994 }else {
3995 ptr = basic_streambuf_wchar_eback(&this->base);
3996 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
3998 this->seekhigh = buf+(this->seekhigh-ptr);
3999 basic_streambuf_wchar_setp_next(&this->base, buf,
4000 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4001 if(this->state & STRINGBUF_no_read)
4002 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4003 else
4004 basic_streambuf_wchar_setg(&this->base, buf,
4005 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4006 basic_streambuf_wchar_pptr(&this->base)+1);
4008 MSVCRT_operator_delete(ptr);
4011 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4014 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4015 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4016 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4017 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4018 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4019 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4021 wchar_t *cur;
4023 TRACE("(%p %x)\n", this, c);
4025 cur = basic_streambuf_wchar_gptr(&this->base);
4026 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4027 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4028 return WEOF;
4030 if(c != WEOF)
4031 cur[-1] = c;
4032 basic_streambuf_wchar_gbump(&this->base, -1);
4033 return c==WEOF ? !WEOF : c;
4036 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4037 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4038 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4039 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4040 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4041 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4043 wchar_t *ptr, *cur;
4045 TRACE("(%p)\n", this);
4047 cur = basic_streambuf_wchar_gptr(&this->base);
4048 if(!cur || this->state&STRINGBUF_no_read)
4049 return WEOF;
4051 ptr = basic_streambuf_wchar_pptr(&this->base);
4052 if(this->seekhigh < ptr)
4053 this->seekhigh = ptr;
4055 ptr = basic_streambuf_wchar_egptr(&this->base);
4056 if(this->seekhigh > ptr)
4057 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4059 if(cur < this->seekhigh)
4060 return *cur;
4061 return WEOF;
4064 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4065 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4066 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4067 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4068 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4069 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4070 fpos_int *ret, streamoff off, int way, int mode)
4072 wchar_t *beg, *cur_r, *cur_w;
4074 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
4076 cur_w = basic_streambuf_wchar_pptr(&this->base);
4077 if(cur_w > this->seekhigh)
4078 this->seekhigh = cur_w;
4080 ret->off = 0;
4081 ret->state = 0;
4083 beg = basic_streambuf_wchar_eback(&this->base);
4084 cur_r = basic_streambuf_wchar_gptr(&this->base);
4085 if((mode & OPENMODE_in) && cur_r) {
4086 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4087 off += cur_r-beg;
4088 else if(way == SEEKDIR_end)
4089 off += this->seekhigh-beg;
4090 else if(way != SEEKDIR_beg)
4091 off = -1;
4093 if(off<0 || off>this->seekhigh-beg) {
4094 off = -1;
4095 }else {
4096 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4097 if((mode & OPENMODE_out) && cur_w) {
4098 basic_streambuf_wchar_setp_next(&this->base, beg,
4099 basic_streambuf_wchar_gptr(&this->base),
4100 basic_streambuf_wchar_epptr(&this->base));
4103 }else if((mode & OPENMODE_out) && cur_w) {
4104 if(way == SEEKDIR_cur)
4105 off += cur_w-beg;
4106 else if(way == SEEKDIR_end)
4107 off += this->seekhigh-beg;
4108 else if(way != SEEKDIR_beg)
4109 off = -1;
4111 if(off<0 || off>this->seekhigh-beg)
4112 off = -1;
4113 else
4114 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4115 }else {
4116 off = -1;
4119 ret->pos = off;
4120 return ret;
4123 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4124 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4125 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4126 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4127 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4128 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4129 fpos_int *ret, fpos_int pos, int mode)
4131 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4133 if(pos.off==0 && pos.pos==-1 && pos.state==0) {
4134 *ret = pos;
4135 return ret;
4138 return basic_stringbuf_wchar_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
4141 /* ?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 */
4142 /* ?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 */
4143 /* ?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 */
4144 /* ?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 */
4145 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4146 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4148 TRACE("(%p %p)\n", this, str);
4150 basic_stringbuf_wchar__Tidy(this);
4151 basic_stringbuf_wchar__Init(this, basic_string_wchar_c_str(str), str->size, this->state);
4154 /* ?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 */
4155 /* ?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 */
4156 /* ?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 */
4157 /* ?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 */
4158 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
4159 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
4161 wchar_t *ptr;
4163 TRACE("(%p)\n", this);
4165 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
4166 wchar_t *pptr;
4168 ptr = basic_streambuf_wchar_pbase(&this->base);
4169 pptr = basic_streambuf_wchar_pptr(&this->base);
4171 return basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4174 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
4175 ptr = basic_streambuf_wchar_eback(&this->base);
4176 return basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
4179 return basic_string_wchar_ctor(ret);
4182 /* ??0ios_base@std@@IAE@XZ */
4183 /* ??0ios_base@std@@IEAA@XZ */
4184 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
4185 ios_base* __thiscall ios_base_ctor(ios_base *this)
4187 TRACE("(%p)\n", this);
4188 this->vtable = &MSVCP_ios_base_vtable;
4189 return this;
4192 /* ??0ios_base@std@@QAE@ABV01@@Z */
4193 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
4194 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
4195 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
4197 TRACE("(%p %p)\n", this, copy);
4198 *this = *copy;
4199 this->vtable = &MSVCP_ios_base_vtable;
4200 return this;
4203 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
4204 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
4205 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
4206 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
4208 IOS_BASE_fnarray *cur;
4210 TRACE("(%p %x)\n", this, event);
4212 for(cur=this->calls; cur; cur=cur->next)
4213 cur->event_handler(event, this, cur->index);
4216 /* ?_Tidy@ios_base@std@@AAAXXZ */
4217 /* ?_Tidy@ios_base@std@@AEAAXXZ */
4218 void CDECL ios_base_Tidy(ios_base *this)
4220 IOS_BASE_iosarray *arr_cur, *arr_next;
4221 IOS_BASE_fnarray *event_cur, *event_next;
4223 TRACE("(%p)\n", this);
4225 ios_base_Callfns(this, EVENT_erase_event);
4227 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
4228 arr_next = arr_cur->next;
4229 MSVCRT_operator_delete(arr_cur);
4231 this->arr = NULL;
4233 for(event_cur=this->calls; event_cur; event_cur=event_next) {
4234 event_next = event_cur->next;
4235 MSVCRT_operator_delete(event_cur);
4237 this->calls = NULL;
4240 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
4241 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
4242 static void ios_base_Ios_base_dtor(ios_base *obj)
4244 TRACE("(%p)\n", obj);
4245 if(obj->loc) {
4246 locale_dtor(obj->loc);
4247 MSVCRT_operator_delete(obj->loc);
4249 ios_base_Tidy(obj);
4252 /* ??1ios_base@std@@UAE@XZ */
4253 /* ??1ios_base@std@@UEAA@XZ */
4254 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
4255 void __thiscall ios_base_dtor(ios_base *this)
4257 ios_base_Ios_base_dtor(this);
4260 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
4261 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
4263 TRACE("(%p %x)\n", this, flags);
4264 if(flags & 2) {
4265 /* we have an array, with the number of elements stored before the first object */
4266 INT_PTR i, *ptr = (INT_PTR *)this-1;
4268 for(i=*ptr-1; i>=0; i--)
4269 ios_base_dtor(this+i);
4270 MSVCRT_operator_delete(ptr);
4271 } else {
4272 ios_base_dtor(this);
4273 if(flags & 1)
4274 MSVCRT_operator_delete(this);
4277 return this;
4280 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
4281 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
4283 TRACE("(%p %x)\n", this, flags);
4284 if(flags & 2) {
4285 INT_PTR *ptr = (INT_PTR *)this-1;
4286 MSVCRT_operator_delete(ptr);
4287 } else {
4288 if(flags & 1)
4289 MSVCRT_operator_delete(this);
4292 return this;
4295 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
4296 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
4297 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
4298 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
4300 IOS_BASE_iosarray *p;
4302 TRACE("(%p %d)\n", this, index);
4304 for(p=this->arr; p; p=p->next) {
4305 if(p->index == index)
4306 return p;
4309 for(p=this->arr; p; p=p->next) {
4310 if(!p->long_val && !p->ptr_val) {
4311 p->index = index;
4312 return p;
4316 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
4317 p->next = this->arr;
4318 p->index = index;
4319 p->long_val = 0;
4320 p->ptr_val = NULL;
4321 this->arr = p;
4322 return p;
4325 /* ?iword@ios_base@std@@QAEAAJH@Z */
4326 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
4327 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
4328 LONG* __thiscall ios_base_iword(ios_base *this, int index)
4330 TRACE("(%p %d)\n", this, index);
4331 return &ios_base_Findarr(this, index)->long_val;
4334 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
4335 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
4336 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
4337 void** __thiscall ios_base_pword(ios_base *this, int index)
4339 TRACE("(%p %d)\n", this, index);
4340 return &ios_base_Findarr(this, index)->ptr_val;
4343 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
4344 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
4345 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
4346 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
4348 IOS_BASE_fnarray *event;
4350 TRACE("(%p %p %d)\n", this, callback, index);
4352 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
4353 event->next = this->calls;
4354 event->index = index;
4355 event->event_handler = callback;
4356 this->calls = event;
4359 /* ?clear@ios_base@std@@QAEXH_N@Z */
4360 /* ?clear@ios_base@std@@QEAAXH_N@Z */
4361 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
4362 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4364 TRACE("(%p %x %x)\n", this, state, reraise);
4366 this->state = state & IOSTATE_mask;
4367 if(!(this->state & this->except))
4368 return;
4370 if(reraise)
4371 throw_exception(EXCEPTION_RERAISE, NULL);
4372 else if(this->state & this->except & IOSTATE_eofbit)
4373 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
4374 else if(this->state & this->except & IOSTATE_failbit)
4375 throw_exception(EXCEPTION_FAILURE, "failbit is set");
4376 else if(this->state & this->except & IOSTATE_badbit)
4377 throw_exception(EXCEPTION_FAILURE, "badbit is set");
4378 else if(this->state & this->except & IOSTATE__Hardfail)
4379 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
4382 /* ?clear@ios_base@std@@QAEXH@Z */
4383 /* ?clear@ios_base@std@@QEAAXH@Z */
4384 static void ios_base_clear(ios_base *this, IOSB_iostate state)
4386 ios_base_clear_reraise(this, state, FALSE);
4389 /* ?exceptions@ios_base@std@@QAEXH@Z */
4390 /* ?exceptions@ios_base@std@@QEAAXH@Z */
4391 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
4392 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
4394 TRACE("(%p %x)\n", this, state);
4395 this->except = state & IOSTATE_mask;
4396 ios_base_clear(this, this->state);
4399 /* ?exceptions@ios_base@std@@QBEHXZ */
4400 /* ?exceptions@ios_base@std@@QEBAHXZ */
4401 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
4402 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
4404 TRACE("(%p)\n", this);
4405 return this->except;
4408 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
4409 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
4410 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
4411 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
4413 TRACE("(%p %p)\n", this, rhs);
4415 if(this != rhs) {
4416 IOS_BASE_iosarray *arr_cur;
4417 IOS_BASE_fnarray *event_cur;
4419 ios_base_Tidy(this);
4421 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
4422 if(arr_cur->long_val)
4423 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
4424 if(arr_cur->ptr_val)
4425 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
4427 this->stdstr = rhs->stdstr;
4428 this->fmtfl = rhs->fmtfl;
4429 this->prec = rhs->prec;
4430 this->wide = rhs->wide;
4431 locale_operator_assign(this->loc, rhs->loc);
4433 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
4434 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
4436 ios_base_Callfns(this, EVENT_copyfmt_event);
4437 ios_base_exceptions_set(this, rhs->except);
4440 return this;
4443 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
4444 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
4445 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
4446 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
4448 TRACE("(%p %p)\n", this, right);
4450 if(this != right) {
4451 this->state = right->state;
4452 ios_base_copyfmt(this, right);
4455 return this;
4458 /* ?fail@ios_base@std@@QBE_NXZ */
4459 /* ?fail@ios_base@std@@QEBA_NXZ */
4460 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
4461 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
4463 TRACE("(%p)\n", this);
4464 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
4467 /* ??7ios_base@std@@QBE_NXZ */
4468 /* ??7ios_base@std@@QEBA_NXZ */
4469 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
4470 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
4472 TRACE("(%p)\n", this);
4473 return ios_base_fail(this);
4476 /* ??Bios_base@std@@QBEPAXXZ */
4477 /* ??Bios_base@std@@QEBAPEAXXZ */
4478 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
4479 void* __thiscall ios_base_op_fail(const ios_base *this)
4481 TRACE("(%p)\n", this);
4482 return ios_base_fail(this) ? NULL : (void*)this;
4485 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
4486 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
4487 static void ios_base_Addstd(ios_base *add)
4489 FIXME("(%p) stub\n", add);
4492 /* ?_Init@ios_base@std@@IAEXXZ */
4493 /* ?_Init@ios_base@std@@IEAAXXZ */
4494 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
4495 void __thiscall ios_base__Init(ios_base *this)
4497 TRACE("(%p)\n", this);
4499 this->stdstr = 0;
4500 this->state = this->except = IOSTATE_goodbit;
4501 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
4502 this->prec = 6;
4503 this->wide = 0;
4504 this->arr = NULL;
4505 this->calls = NULL;
4506 this->loc = MSVCRT_operator_new(sizeof(locale));
4507 locale_ctor(this->loc);
4510 /* ?bad@ios_base@std@@QBE_NXZ */
4511 /* ?bad@ios_base@std@@QEBA_NXZ */
4512 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
4513 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
4515 TRACE("(%p)\n", this);
4516 return (this->state & IOSTATE_badbit) != 0;
4519 /* ?eof@ios_base@std@@QBE_NXZ */
4520 /* ?eof@ios_base@std@@QEBA_NXZ */
4521 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
4522 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
4524 TRACE("(%p)\n", this);
4525 return (this->state & IOSTATE_eofbit) != 0;
4528 /* ?flags@ios_base@std@@QAEHH@Z */
4529 /* ?flags@ios_base@std@@QEAAHH@Z */
4530 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
4531 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
4533 IOSB_fmtflags ret = this->fmtfl;
4535 TRACE("(%p %x)\n", this, flags);
4537 this->fmtfl = flags & FMTFLAG_mask;
4538 return ret;
4541 /* ?flags@ios_base@std@@QBEHXZ */
4542 /* ?flags@ios_base@std@@QEBAHXZ */
4543 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
4544 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
4546 TRACE("(%p)\n", this);
4547 return this->fmtfl;
4550 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
4551 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
4552 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
4553 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
4555 TRACE("(%p)\n", this);
4556 return locale_copy_ctor(ret, this->loc);
4559 /* ?good@ios_base@std@@QBE_NXZ */
4560 /* ?good@ios_base@std@@QEBA_NXZ */
4561 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
4562 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
4564 TRACE("(%p)\n", this);
4565 return this->state == IOSTATE_goodbit;
4568 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
4569 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
4570 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
4571 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
4573 TRACE("(%p %p)\n", this, loc);
4574 *ret = *this->loc;
4575 locale_copy_ctor(this->loc, loc);
4576 return ret;
4579 /* ?precision@ios_base@std@@QAEHH@Z */
4580 /* ?precision@ios_base@std@@QEAA_J_J@Z */
4581 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
4582 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
4584 streamsize ret = this->prec;
4586 TRACE("(%p %ld)\n", this, precision);
4588 this->prec = precision;
4589 return ret;
4592 /* ?precision@ios_base@std@@QBEHXZ */
4593 /* ?precision@ios_base@std@@QEBA_JXZ */
4594 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
4595 streamsize __thiscall ios_base_precision_get(const ios_base *this)
4597 TRACE("(%p)\n", this);
4598 return this->prec;
4601 /* ?rdstate@ios_base@std@@QBEHXZ */
4602 /* ?rdstate@ios_base@std@@QEBAHXZ */
4603 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
4604 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
4606 TRACE("(%p)\n", this);
4607 return this->state;
4610 /* ?setf@ios_base@std@@QAEHHH@Z */
4611 /* ?setf@ios_base@std@@QEAAHHH@Z */
4612 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
4613 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
4615 IOSB_fmtflags ret = this->fmtfl;
4617 TRACE("(%p %x %x)\n", this, flags, mask);
4619 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
4620 return ret;
4623 /* ?setf@ios_base@std@@QAEHH@Z */
4624 /* ?setf@ios_base@std@@QEAAHH@Z */
4625 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
4626 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
4628 return ios_base_setf_mask(this, flags, ~0);
4631 /* ?setstate@ios_base@std@@QAEXH_N@Z */
4632 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
4633 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
4634 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4636 TRACE("(%p %x %x)\n", this, state, reraise);
4638 if(state != IOSTATE_goodbit)
4639 ios_base_clear_reraise(this, this->state | state, reraise);
4642 /* ?setstate@ios_base@std@@QAEXH@Z */
4643 /* ?setstate@ios_base@std@@QEAAXH@Z */
4644 static void ios_base_setstate(ios_base *this, IOSB_iostate state)
4646 ios_base_setstate_reraise(this, state, FALSE);
4649 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
4650 MSVCP_bool CDECL ios_base_sync_with_stdio(MSVCP_bool sync)
4652 _Lockit lock;
4653 MSVCP_bool ret;
4655 TRACE("(%x)\n", sync);
4657 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
4658 ret = ios_base_Sync;
4659 ios_base_Sync = sync;
4660 _Lockit_dtor(&lock);
4661 return ret;
4664 /* ?unsetf@ios_base@std@@QAEXH@Z */
4665 /* ?unsetf@ios_base@std@@QEAAXH@Z */
4666 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
4667 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
4669 TRACE("(%p %x)\n", this, flags);
4670 this->fmtfl &= ~flags;
4673 /* ?width@ios_base@std@@QAEHH@Z */
4674 /* ?width@ios_base@std@@QEAA_J_J@Z */
4675 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
4676 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
4678 streamsize ret = this->wide;
4680 TRACE("(%p %ld)\n", this, width);
4682 this->wide = width;
4683 return ret;
4686 /* ?width@ios_base@std@@QBEHXZ */
4687 /* ?width@ios_base@std@@QEBA_JXZ */
4688 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
4689 streamsize __thiscall ios_base_width_get(ios_base *this)
4691 TRACE("(%p)\n", this);
4692 return this->wide;
4695 /* ?xalloc@ios_base@std@@SAHXZ */
4696 int CDECL ios_base_xalloc(void)
4698 _Lockit lock;
4699 int ret;
4701 TRACE("\n");
4703 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
4704 ret = ios_base_Index++;
4705 _Lockit_dtor(&lock);
4706 return ret;
4709 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
4710 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
4711 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
4712 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
4714 TRACE("(%p)\n", this);
4716 ios_base_ctor(&this->base);
4717 this->base.vtable = &MSVCP_basic_ios_char_vtable;
4718 return this;
4721 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
4722 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
4723 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
4724 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
4726 TRACE("(%p %p %x)\n", this, streambuf, isstd);
4727 ios_base__Init(&this->base);
4728 this->strbuf = streambuf;
4729 this->stream = NULL;
4730 this->fillch = ' ';
4732 if(!streambuf)
4733 ios_base_setstate(&this->base, IOSTATE_badbit);
4735 if(isstd)
4736 FIXME("standard streams not handled yet\n");
4739 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4740 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4741 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
4742 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
4744 TRACE("(%p %p)\n", this, strbuf);
4746 basic_ios_char_ctor(this);
4747 basic_ios_char_init(this, strbuf, FALSE);
4748 return this;
4751 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
4752 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
4753 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
4754 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
4756 TRACE("(%p)\n", this);
4757 ios_base_dtor(&this->base);
4760 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
4761 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
4763 TRACE("(%p %x)\n", this, flags);
4764 if(flags & 2) {
4765 /* we have an array, with the number of elements stored before the first object */
4766 INT_PTR i, *ptr = (INT_PTR *)this-1;
4768 for(i=*ptr-1; i>=0; i--)
4769 basic_ios_char_dtor(this+i);
4770 MSVCRT_operator_delete(ptr);
4771 } else {
4772 basic_ios_char_dtor(this);
4773 if(flags & 1)
4774 MSVCRT_operator_delete(this);
4777 return this;
4780 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
4781 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
4782 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
4783 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
4785 TRACE("(%p %x %x)\n", this, state, reraise);
4786 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
4789 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
4790 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
4791 static void basic_ios_char_clear(basic_ios_char *this, unsigned int state)
4793 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
4796 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
4797 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
4798 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
4799 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
4801 TRACE("(%p %p)\n", this, copy);
4802 if(this == copy)
4803 return this;
4805 this->stream = copy->stream;
4806 this->fillch = copy->fillch;
4807 ios_base_copyfmt(&this->base, &copy->base);
4808 return this;
4811 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
4812 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
4813 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
4814 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
4816 char ret = this->fillch;
4818 TRACE("(%p %c)\n", this, fill);
4820 this->fillch = fill;
4821 return ret;
4824 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
4825 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
4826 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
4827 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
4829 TRACE("(%p)\n", this);
4830 return this->fillch;
4833 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
4834 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
4835 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
4836 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
4838 TRACE("(%p %p %p)\n", this, ret, loc);
4840 if(this->strbuf) {
4841 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
4842 locale_dtor(ret);
4845 return ios_base_imbue(&this->base, ret, loc);
4848 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
4849 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
4850 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
4851 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
4853 TRACE("(%p %c %c)\n", this, ch, def);
4854 return ctype_char_narrow_ch(ctype_char_use_facet(this->strbuf->loc), ch, def);
4857 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
4858 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
4859 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
4860 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
4862 basic_streambuf_char *ret = this->strbuf;
4864 TRACE("(%p %p)\n", this, streambuf);
4866 this->strbuf = streambuf;
4867 basic_ios_char_clear(this, IOSTATE_goodbit);
4868 return ret;
4871 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
4872 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
4873 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
4874 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
4876 TRACE("(%p)\n", this);
4877 return this->strbuf;
4880 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
4881 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
4882 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
4883 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
4885 TRACE("(%p %x %x)\n", this, state, reraise);
4887 if(state != IOSTATE_goodbit)
4888 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
4891 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
4892 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
4893 static void basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
4895 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
4898 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
4899 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
4900 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
4901 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
4903 basic_ostream_char *ret = this->stream;
4905 TRACE("(%p %p)\n", this, ostream);
4907 this->stream = ostream;
4908 return ret;
4911 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
4912 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
4913 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
4914 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
4916 TRACE("(%p)\n", this);
4917 return this->stream;
4920 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
4921 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
4922 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
4923 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
4925 TRACE("(%p %c)\n", this, ch);
4926 return ctype_char_widen_ch(ctype_char_use_facet(this->strbuf->loc), ch);
4930 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
4931 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
4932 static basic_ios_wchar* basic_ios_wchar_ctor(basic_ios_wchar *this)
4934 TRACE("(%p)\n", this);
4936 ios_base_ctor(&this->base);
4937 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
4938 return this;
4941 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
4942 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
4943 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
4944 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
4946 basic_ios_wchar_ctor(this);
4947 this->base.vtable = &MSVCP_basic_ios_short_vtable;
4948 return this;
4951 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
4952 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
4953 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
4954 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
4955 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
4956 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
4958 TRACE("(%p %p %x)\n", this, streambuf, isstd);
4959 ios_base__Init(&this->base);
4960 this->strbuf = streambuf;
4961 this->stream = NULL;
4962 this->fillch = ' ';
4964 if(!streambuf)
4965 ios_base_setstate(&this->base, IOSTATE_badbit);
4967 if(isstd)
4968 FIXME("standard streams not handled yet\n");
4971 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
4972 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
4973 static basic_ios_wchar* basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
4975 TRACE("(%p %p)\n", this, strbuf);
4977 basic_ios_wchar_ctor(this);
4978 basic_ios_wchar_init(this, strbuf, FALSE);
4979 return this;
4982 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
4983 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
4984 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
4985 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
4987 basic_ios_wchar_ctor_streambuf(this, strbuf);
4988 this->base.vtable = &MSVCP_basic_ios_short_vtable;
4989 return this;
4992 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
4993 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
4994 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
4995 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
4996 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
4997 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
4999 TRACE("(%p)\n", this);
5000 ios_base_dtor(&this->base);
5003 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5004 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5006 TRACE("(%p %x)\n", this, flags);
5007 if(flags & 2) {
5008 /* we have an array, with the number of elements stored before the first object */
5009 INT_PTR i, *ptr = (INT_PTR *)this-1;
5011 for(i=*ptr-1; i>=0; i--)
5012 basic_ios_wchar_dtor(this+i);
5013 MSVCRT_operator_delete(ptr);
5014 } else {
5015 basic_ios_wchar_dtor(this);
5016 if(flags & 1)
5017 MSVCRT_operator_delete(this);
5020 return this;
5023 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5024 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5025 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5026 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5027 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5028 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5030 TRACE("(%p %x %x)\n", this, state, reraise);
5031 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5034 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5035 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5036 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5037 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5038 static void basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
5040 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
5043 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
5044 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5045 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
5046 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5047 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
5048 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
5050 TRACE("(%p %p)\n", this, copy);
5051 if(this == copy)
5052 return this;
5054 this->stream = copy->stream;
5055 this->fillch = copy->fillch;
5056 ios_base_copyfmt(&this->base, &copy->base);
5057 return this;
5060 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
5061 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
5062 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
5063 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
5064 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
5065 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
5067 wchar_t ret = this->fillch;
5069 TRACE("(%p %c)\n", this, fill);
5071 this->fillch = fill;
5072 return ret;
5075 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
5076 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
5077 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
5078 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
5079 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
5080 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
5082 TRACE("(%p)\n", this);
5083 return this->fillch;
5086 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5087 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5088 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5089 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5090 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
5091 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
5093 TRACE("(%p %p %p)\n", this, ret, loc);
5095 if(this->strbuf) {
5096 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
5097 locale_dtor(ret);
5100 return ios_base_imbue(&this->base, ret, loc);
5103 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
5104 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
5105 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
5106 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
5107 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
5108 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
5110 TRACE("(%p %c %c)\n", this, ch, def);
5111 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(this->strbuf->loc), ch, def);
5114 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5115 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5116 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
5117 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5118 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
5119 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
5121 basic_streambuf_wchar *ret = this->strbuf;
5123 TRACE("(%p %p)\n", this, streambuf);
5125 this->strbuf = streambuf;
5126 basic_ios_wchar_clear(this, IOSTATE_goodbit);
5127 return ret;
5130 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5131 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5132 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5133 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5134 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
5135 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
5137 TRACE("(%p)\n", this);
5138 return this->strbuf;
5141 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5142 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5143 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5144 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5145 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
5146 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5148 TRACE("(%p %x %x)\n", this, state, reraise);
5150 if(state != IOSTATE_goodbit)
5151 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
5154 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5155 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5156 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5157 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5158 static void basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
5160 basic_ios_wchar_setstate_reraise(this, state, FALSE);
5163 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5164 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5165 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
5166 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5167 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
5168 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
5170 basic_ostream_wchar *ret = this->stream;
5172 TRACE("(%p %p)\n", this, ostream);
5174 this->stream = ostream;
5175 return ret;
5178 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5179 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5180 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5181 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5182 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
5183 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
5185 TRACE("(%p)\n", this);
5186 return this->stream;
5189 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
5190 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
5191 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
5192 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
5193 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
5194 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
5196 TRACE("(%p %c)\n", this, ch);
5197 return ctype_wchar_widen_ch(ctype_wchar_use_facet(this->strbuf->loc), ch);
5200 /* Caution: basic_ostream uses virtual inheritance.
5201 * All constructors have additional parameter that says if base class should be initialized.
5202 * Base class needs to be accessed using vbtable.
5204 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
5206 return (basic_ios_char*)((char*)this+this->vbtable[1]);
5209 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
5211 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
5214 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
5216 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
5219 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5220 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5221 static basic_ostream_char* basic_ostream_char_ctor(basic_ostream_char *this,
5222 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
5224 basic_ios_char *base;
5226 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
5228 if(virt_init) {
5229 this->vbtable = basic_ostream_char_vbtable;
5230 base = basic_ostream_char_get_basic_ios(this);
5231 basic_ios_char_ctor(base);
5232 }else {
5233 base = basic_ostream_char_get_basic_ios(this);
5236 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5237 basic_ios_char_init(base, strbuf, isstd);
5238 return this;
5241 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
5242 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
5243 static basic_ostream_char* basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
5244 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
5246 basic_ios_char *base;
5248 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
5250 if(virt_init) {
5251 this->vbtable = basic_ostream_char_vbtable;
5252 base = basic_ostream_char_get_basic_ios(this);
5253 basic_ios_char_ctor(base);
5254 }else {
5255 base = basic_ostream_char_get_basic_ios(this);
5258 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5259 if(addstd)
5260 ios_base_Addstd(&base->base);
5261 return this;
5264 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5265 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5266 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
5267 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
5269 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5271 /* don't destroy virtual base here */
5272 TRACE("(%p)\n", this);
5275 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5276 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5277 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
5278 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
5280 TRACE("(%p)\n", this);
5281 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
5282 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
5285 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
5286 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5288 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5290 TRACE("(%p %x)\n", this, flags);
5292 if(flags & 2) {
5293 /* we have an array, with the number of elements stored before the first object */
5294 INT_PTR i, *ptr = (INT_PTR *)this-1;
5296 for(i=*ptr-1; i>=0; i--)
5297 basic_ostream_char_vbase_dtor(this+i);
5298 MSVCRT_operator_delete(ptr);
5299 } else {
5300 basic_ostream_char_vbase_dtor(this);
5301 if(flags & 1)
5302 MSVCRT_operator_delete(this);
5305 return this;
5308 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
5309 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
5310 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
5311 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
5313 /* this function is not matching C++ specification */
5314 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5316 TRACE("(%p)\n", this);
5318 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
5319 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
5320 basic_ios_char_setstate(base, IOSTATE_badbit);
5321 return this;
5324 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5325 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5326 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
5328 return basic_ostream_char_flush(ostream);
5331 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5332 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5333 static void basic_ostream_char__Osfx(basic_ostream_char *this)
5335 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5337 TRACE("(%p)\n", this);
5339 if(base->base.fmtfl & FMTFLAG_unitbuf)
5340 basic_ostream_char_flush(this);
5343 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5344 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5345 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
5346 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
5348 TRACE("(%p)\n", this);
5349 basic_ostream_char__Osfx(this);
5352 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
5354 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5356 if(basic_ios_char_rdbuf_get(base))
5357 basic_streambuf_char__Lock(base->strbuf);
5359 if(ios_base_good(&base->base) && base->stream)
5360 basic_ostream_char_flush(base->stream);
5362 return ios_base_good(&base->base);
5365 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
5367 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5369 if(ios_base_good(&base->base) && !__uncaught_exception())
5370 basic_ostream_char_osfx(ostr);
5372 if(basic_ios_char_rdbuf_get(base))
5373 basic_streambuf_char__Unlock(base->strbuf);
5376 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
5377 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
5378 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
5379 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
5381 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5383 TRACE("(%p)\n", this);
5385 if(ios_base_good(&base->base) && base->stream)
5386 basic_ostream_char_flush(base->stream);
5387 return ios_base_good(&base->base);
5390 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
5391 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
5392 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
5393 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
5395 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5397 TRACE("(%p %c)\n", this, ch);
5399 if(!basic_ostream_char_sentry_create(this)
5400 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
5401 basic_ostream_char_sentry_destroy(this);
5402 basic_ios_char_setstate(base, IOSTATE_badbit);
5403 return this;
5406 basic_ostream_char_sentry_destroy(this);
5407 return this;
5410 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
5411 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
5412 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
5413 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
5415 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5417 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
5419 if(!ios_base_fail(&base->base)) {
5420 fpos_int seek;
5422 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
5423 &seek, pos, OPENMODE_out);
5424 if(seek.off==0 && seek.pos==-1 && seek.state==0)
5425 basic_ios_char_setstate(base, IOSTATE_failbit);
5427 return this;
5430 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
5431 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
5432 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
5433 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
5435 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5437 TRACE("(%p)\n", this);
5439 if(!ios_base_fail(&base->base)) {
5440 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
5441 ret, 0, SEEKDIR_cur, OPENMODE_out);
5442 }else {
5443 ret->off = 0;
5444 ret->pos = -1;
5445 ret->state = 0;
5447 return ret;
5450 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
5451 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
5452 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
5453 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
5455 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5457 TRACE("(%p %s %ld)\n", this, debugstr_a(str), count);
5459 if(!basic_ostream_char_sentry_create(this)
5460 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
5461 basic_ostream_char_sentry_destroy(this);
5462 basic_ios_char_setstate(base, IOSTATE_badbit);
5463 return this;
5466 basic_ostream_char_sentry_destroy(this);
5467 return this;
5470 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
5471 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
5472 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
5473 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
5475 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5476 int state = IOSTATE_goodbit;
5478 TRACE("(%p %d)\n", this, val);
5480 if(basic_ostream_char_sentry_create(this)) {
5481 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5482 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5483 ostreambuf_iterator_char dest = {0, strbuf};
5485 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
5486 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
5487 ? (LONG)((unsigned short)val) : (LONG)val);
5489 basic_ostream_char_sentry_destroy(this);
5491 basic_ios_char_setstate(base, state);
5492 return this;
5495 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
5496 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
5497 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
5498 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
5500 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5501 int state = IOSTATE_goodbit;
5503 TRACE("(%p %u)\n", this, val);
5505 if(basic_ostream_char_sentry_create(this)) {
5506 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5507 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5508 ostreambuf_iterator_char dest = {0, strbuf};
5510 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5512 basic_ostream_char_sentry_destroy(this);
5514 basic_ios_char_setstate(base, state);
5515 return this;
5518 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
5519 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
5520 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
5521 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
5522 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
5523 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
5525 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5526 int state = IOSTATE_goodbit;
5528 TRACE("(%p %d)\n", this, val);
5530 if(basic_ostream_char_sentry_create(this)) {
5531 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5532 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5533 ostreambuf_iterator_char dest = {0, strbuf};
5535 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5537 basic_ostream_char_sentry_destroy(this);
5539 basic_ios_char_setstate(base, state);
5540 return this;
5543 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
5544 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
5545 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
5546 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
5547 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
5548 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
5550 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5551 int state = IOSTATE_goodbit;
5553 TRACE("(%p %u)\n", this, val);
5555 if(basic_ostream_char_sentry_create(this)) {
5556 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5557 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5558 ostreambuf_iterator_char dest = {0, strbuf};
5560 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5562 basic_ostream_char_sentry_destroy(this);
5564 basic_ios_char_setstate(base, state);
5565 return this;
5568 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
5569 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
5570 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
5571 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
5573 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5574 int state = IOSTATE_goodbit;
5576 TRACE("(%p %f)\n", this, val);
5578 if(basic_ostream_char_sentry_create(this)) {
5579 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5580 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5581 ostreambuf_iterator_char dest = {0, strbuf};
5583 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5585 basic_ostream_char_sentry_destroy(this);
5587 basic_ios_char_setstate(base, state);
5588 return this;
5591 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
5592 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
5593 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
5594 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
5596 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5597 int state = IOSTATE_goodbit;
5599 TRACE("(%p %lf)\n", this, val);
5601 if(basic_ostream_char_sentry_create(this)) {
5602 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5603 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5604 ostreambuf_iterator_char dest = {0, strbuf};
5606 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5608 basic_ostream_char_sentry_destroy(this);
5610 basic_ios_char_setstate(base, state);
5611 return this;
5614 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
5615 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
5616 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
5617 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
5619 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5620 int state = IOSTATE_goodbit;
5622 TRACE("(%p %lf)\n", this, val);
5624 if(basic_ostream_char_sentry_create(this)) {
5625 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5626 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5627 ostreambuf_iterator_char dest = {0, strbuf};
5629 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5631 basic_ostream_char_sentry_destroy(this);
5633 basic_ios_char_setstate(base, state);
5634 return this;
5637 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5638 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5639 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
5640 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
5642 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5643 IOSB_iostate state = IOSTATE_badbit;
5644 int c = '\n';
5646 TRACE("(%p %p)\n", this, val);
5648 if(basic_ostream_char_sentry_create(this)) {
5649 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
5650 c = basic_streambuf_char_snextc(val)) {
5651 state = IOSTATE_goodbit;
5653 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
5654 state = IOSTATE_badbit;
5655 break;
5658 }else {
5659 state = IOSTATE_badbit;
5661 basic_ostream_char_sentry_destroy(this);
5663 ios_base_width_set(&base->base, 0);
5664 basic_ios_char_setstate(base, state);
5665 return this;
5668 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
5669 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
5670 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
5671 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
5673 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5674 int state = IOSTATE_goodbit;
5676 TRACE("(%p %p)\n", this, val);
5678 if(basic_ostream_char_sentry_create(this)) {
5679 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5680 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5681 ostreambuf_iterator_char dest = {0, strbuf};
5683 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5685 basic_ostream_char_sentry_destroy(this);
5687 basic_ios_char_setstate(base, state);
5688 return this;
5691 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
5692 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
5693 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
5694 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
5696 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5697 int state = IOSTATE_goodbit;
5699 TRACE("(%p)\n", this);
5701 if(basic_ostream_char_sentry_create(this)) {
5702 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5703 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5704 ostreambuf_iterator_char dest = {0, strbuf};
5706 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5708 basic_ostream_char_sentry_destroy(this);
5710 basic_ios_char_setstate(base, state);
5711 return this;
5714 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
5715 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
5716 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
5717 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
5719 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5720 int state = IOSTATE_goodbit;
5722 TRACE("(%p)\n", this);
5724 if(basic_ostream_char_sentry_create(this)) {
5725 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5726 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5727 ostreambuf_iterator_char dest = {0, strbuf};
5729 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5731 basic_ostream_char_sentry_destroy(this);
5733 basic_ios_char_setstate(base, state);
5734 return this;
5737 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
5738 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
5739 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
5740 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
5742 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5743 int state = IOSTATE_goodbit;
5745 TRACE("(%p %x)\n", this, val);
5747 if(basic_ostream_char_sentry_create(this)) {
5748 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
5749 const num_put *numput = num_put_char_use_facet(strbuf->loc);
5750 ostreambuf_iterator_char dest = {0, strbuf};
5752 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
5754 basic_ostream_char_sentry_destroy(this);
5756 basic_ios_char_setstate(base, state);
5757 return this;
5760 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5761 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5762 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
5764 TRACE("(%p)\n", ostr);
5766 basic_ostream_char_put(ostr, '\n');
5767 basic_ostream_char_flush(ostr);
5768 return ostr;
5771 /* $?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 */
5772 /* ??$?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 */
5773 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
5775 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5776 IOSB_iostate state = IOSTATE_goodbit;
5778 TRACE("(%p %p)\n", ostr, str);
5780 if(basic_ostream_char_sentry_create(ostr)) {
5781 MSVCP_size_t len = basic_string_char_length(str);
5782 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
5784 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
5785 for(; pad!=0; pad--) {
5786 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
5787 state = IOSTATE_badbit;
5788 break;
5793 if(state == IOSTATE_goodbit) {
5794 if(basic_streambuf_char_sputn(base->strbuf, basic_string_char_c_str(str), len) != len)
5795 state = IOSTATE_badbit;
5798 if(state == IOSTATE_goodbit) {
5799 for(; pad!=0; pad--) {
5800 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
5801 state = IOSTATE_badbit;
5802 break;
5807 base->base.wide = 0;
5808 }else {
5809 state = IOSTATE_badbit;
5811 basic_ostream_char_sentry_destroy(ostr);
5813 basic_ios_char_setstate(base, state);
5814 return ostr;
5817 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
5818 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
5819 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
5820 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
5821 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
5822 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
5823 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
5825 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5826 IOSB_iostate state = IOSTATE_goodbit;
5828 TRACE("(%p %d)\n", ostr, ch);
5830 if(basic_ostream_char_sentry_create(ostr)) {
5831 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
5833 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
5834 for(; pad!=0; pad--) {
5835 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
5836 state = IOSTATE_badbit;
5837 break;
5842 if(state == IOSTATE_goodbit) {
5843 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
5844 state = IOSTATE_badbit;
5847 if(state == IOSTATE_goodbit) {
5848 for(; pad!=0; pad--) {
5849 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
5850 state = IOSTATE_badbit;
5851 break;
5856 base->base.wide = 0;
5857 }else {
5858 state = IOSTATE_badbit;
5860 basic_ostream_char_sentry_destroy(ostr);
5862 basic_ios_char_setstate(base, state);
5863 return ostr;
5866 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
5867 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
5868 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
5869 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
5870 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
5871 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
5872 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
5874 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5875 IOSB_iostate state = IOSTATE_goodbit;
5877 TRACE("(%p %s)\n", ostr, str);
5879 if(basic_ostream_char_sentry_create(ostr)) {
5880 MSVCP_size_t len = strlen(str);
5881 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
5883 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
5884 for(; pad!=0; pad--) {
5885 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
5886 state = IOSTATE_badbit;
5887 break;
5892 if(state == IOSTATE_goodbit) {
5893 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
5894 state = IOSTATE_badbit;
5897 if(state == IOSTATE_goodbit) {
5898 for(; pad!=0; pad--) {
5899 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
5900 state = IOSTATE_badbit;
5901 break;
5906 base->base.wide = 0;
5907 }else {
5908 state = IOSTATE_badbit;
5910 basic_ostream_char_sentry_destroy(ostr);
5912 basic_ios_char_setstate(base, state);
5913 return ostr;
5916 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
5917 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
5918 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
5919 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
5920 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
5922 TRACE("(%p %p)\n", this, pfunc);
5923 pfunc(this);
5924 return this;
5927 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
5928 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
5929 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
5930 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
5931 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
5933 TRACE("(%p %p)\n", this, pfunc);
5934 pfunc(basic_ostream_char_get_basic_ios(this));
5935 return this;
5938 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
5939 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
5940 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
5941 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
5942 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
5944 TRACE("(%p %p)\n", this, pfunc);
5945 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
5946 return this;
5949 /* Caution: basic_ostream uses virtual inheritance. */
5950 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
5952 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
5955 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
5957 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
5960 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
5962 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
5965 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
5966 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
5967 static basic_ostream_wchar* basic_ostream_wchar_ctor(basic_ostream_wchar *this,
5968 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
5970 basic_ios_wchar *base;
5972 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
5974 if(virt_init) {
5975 this->vbtable = basic_ostream_wchar_vbtable;
5976 base = basic_ostream_wchar_get_basic_ios(this);
5977 basic_ios_wchar_ctor(base);
5978 }else {
5979 base = basic_ostream_wchar_get_basic_ios(this);
5982 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
5983 basic_ios_wchar_init(base, strbuf, isstd);
5984 return this;
5987 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
5988 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
5989 static basic_ostream_wchar* basic_ostream_short_ctor(basic_ostream_wchar *this,
5990 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
5992 basic_ostream_wchar_ctor(this, strbuf, isstd, virt_init);
5993 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
5994 return this;
5997 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
5998 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
5999 static basic_ostream_wchar* basic_ostream_wchar_ctor_uninitialized(basic_ostream_wchar *this,
6000 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6002 basic_ios_wchar *base;
6004 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
6006 if(virt_init) {
6007 this->vbtable = basic_ostream_wchar_vbtable;
6008 base = basic_ostream_wchar_get_basic_ios(this);
6009 basic_ios_wchar_ctor(base);
6010 }else {
6011 base = basic_ostream_wchar_get_basic_ios(this);
6014 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
6015 if(addstd)
6016 ios_base_Addstd(&base->base);
6017 return this;
6020 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6021 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6022 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
6023 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6024 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
6025 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
6027 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6029 /* don't destroy virtual base here */
6030 TRACE("(%p)\n", this);
6033 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6034 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6035 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6036 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6037 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
6038 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
6040 TRACE("(%p)\n", this);
6041 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
6042 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
6045 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
6046 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
6048 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6050 TRACE("(%p %x)\n", this, flags);
6052 if(flags & 2) {
6053 /* we have an array, with the number of elements stored before the first object */
6054 INT_PTR i, *ptr = (INT_PTR *)this-1;
6056 for(i=*ptr-1; i>=0; i--)
6057 basic_ostream_wchar_vbase_dtor(this+i);
6058 MSVCRT_operator_delete(ptr);
6059 } else {
6060 basic_ostream_wchar_vbase_dtor(this);
6061 if(flags & 1)
6062 MSVCRT_operator_delete(this);
6065 return this;
6068 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
6069 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
6070 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
6071 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
6072 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
6073 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
6075 /* this function is not matching C++ specification */
6076 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6078 TRACE("(%p)\n", this);
6080 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
6081 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
6082 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6083 return this;
6086 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6087 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6088 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6089 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6090 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
6092 return basic_ostream_wchar_flush(ostream);
6095 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6096 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6097 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6098 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6099 static void basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
6101 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6103 TRACE("(%p)\n", this);
6105 if(base->base.fmtfl & FMTFLAG_unitbuf)
6106 basic_ostream_wchar_flush(this);
6109 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6110 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6111 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6112 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6113 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
6114 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
6116 TRACE("(%p)\n", this);
6117 basic_ostream_wchar__Osfx(this);
6120 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
6122 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6124 if(basic_ios_wchar_rdbuf_get(base))
6125 basic_streambuf_wchar__Lock(base->strbuf);
6127 if(ios_base_good(&base->base) && base->stream)
6128 basic_ostream_wchar_flush(base->stream);
6130 return ios_base_good(&base->base);
6133 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
6135 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6137 if(ios_base_good(&base->base) && !__uncaught_exception())
6138 basic_ostream_wchar_osfx(ostr);
6140 if(basic_ios_wchar_rdbuf_get(base))
6141 basic_streambuf_wchar__Unlock(base->strbuf);
6144 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
6145 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
6146 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
6147 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
6148 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
6149 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
6151 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6153 TRACE("(%p)\n", this);
6155 if(ios_base_good(&base->base) && base->stream)
6156 basic_ostream_wchar_flush(base->stream);
6157 return ios_base_good(&base->base);
6160 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
6161 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
6162 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
6163 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
6164 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
6165 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
6167 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6169 TRACE("(%p %c)\n", this, ch);
6171 if(!basic_ostream_wchar_sentry_create(this)
6172 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
6173 basic_ostream_wchar_sentry_destroy(this);
6174 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6175 return this;
6178 basic_ostream_wchar_sentry_destroy(this);
6179 return this;
6182 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6183 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6184 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6185 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6186 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
6187 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_int pos)
6189 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6191 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6193 if(!ios_base_fail(&base->base)) {
6194 fpos_int seek;
6196 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
6197 &seek, pos, OPENMODE_out);
6198 if(seek.off==0 && seek.pos==-1 && seek.state==0)
6199 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6201 return this;
6204 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6205 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6206 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6207 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6208 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
6209 fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_int *ret)
6211 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6213 TRACE("(%p)\n", this);
6215 if(!ios_base_fail(&base->base)) {
6216 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6217 ret, 0, SEEKDIR_cur, OPENMODE_out);
6218 }else {
6219 ret->off = 0;
6220 ret->pos = -1;
6221 ret->state = 0;
6223 return ret;
6226 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
6227 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
6228 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
6229 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
6230 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
6231 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
6233 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6235 TRACE("(%p %s %ld)\n", this, debugstr_w(str), count);
6237 if(!basic_ostream_wchar_sentry_create(this)
6238 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
6239 basic_ostream_wchar_sentry_destroy(this);
6240 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6241 return this;
6244 basic_ostream_wchar_sentry_destroy(this);
6245 return this;
6248 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
6250 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6251 int state = IOSTATE_goodbit;
6253 TRACE("(%p %d)\n", this, val);
6255 if(basic_ostream_wchar_sentry_create(this)) {
6256 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6257 ostreambuf_iterator_wchar dest = {0, strbuf};
6259 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
6260 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6261 ? (LONG)((unsigned short)val) : (LONG)val);
6263 basic_ostream_wchar_sentry_destroy(this);
6265 basic_ios_wchar_setstate(base, state);
6266 return this;
6269 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
6270 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
6271 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
6272 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
6274 return basic_ostream_print_short(this, val, num_put_short_use_facet(
6275 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6278 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
6280 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6281 int state = IOSTATE_goodbit;
6283 TRACE("(%p %d)\n", this, val);
6285 if(basic_ostream_wchar_sentry_create(this)) {
6286 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6287 ostreambuf_iterator_wchar dest = {0, strbuf};
6289 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6291 basic_ostream_wchar_sentry_destroy(this);
6293 basic_ios_wchar_setstate(base, state);
6294 return this;
6297 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
6298 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
6299 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
6300 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
6301 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
6302 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
6304 return basic_ostream_print_int(this, val, num_put_short_use_facet(
6305 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6308 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
6310 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6311 int state = IOSTATE_goodbit;
6313 TRACE("(%p %u)\n", this, val);
6315 if(basic_ostream_wchar_sentry_create(this)) {
6316 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6317 ostreambuf_iterator_wchar dest = {0, strbuf};
6319 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6321 basic_ostream_wchar_sentry_destroy(this);
6323 basic_ios_wchar_setstate(base, state);
6324 return this;
6327 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
6328 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
6329 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
6330 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
6331 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
6332 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
6334 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
6335 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6338 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
6340 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6341 int state = IOSTATE_goodbit;
6343 TRACE("(%p %f)\n", this, val);
6345 if(basic_ostream_wchar_sentry_create(this)) {
6346 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6347 ostreambuf_iterator_wchar dest = {0, strbuf};
6349 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6351 basic_ostream_wchar_sentry_destroy(this);
6353 basic_ios_wchar_setstate(base, state);
6354 return this;
6357 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
6358 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
6359 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
6360 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
6362 return basic_ostream_print_float(this, val, num_put_short_use_facet(
6363 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6366 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
6368 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6369 int state = IOSTATE_goodbit;
6371 TRACE("(%p %lf)\n", this, val);
6373 if(basic_ostream_wchar_sentry_create(this)) {
6374 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6375 ostreambuf_iterator_wchar dest = {0, strbuf};
6377 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6379 basic_ostream_wchar_sentry_destroy(this);
6381 basic_ios_wchar_setstate(base, state);
6382 return this;
6385 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
6386 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
6387 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
6388 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
6390 return basic_ostream_print_double(this, val, num_put_short_use_facet(
6391 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6394 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
6396 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6397 int state = IOSTATE_goodbit;
6399 TRACE("(%p %lf)\n", this, val);
6401 if(basic_ostream_wchar_sentry_create(this)) {
6402 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6403 ostreambuf_iterator_wchar dest = {0, strbuf};
6405 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6407 basic_ostream_wchar_sentry_destroy(this);
6409 basic_ios_wchar_setstate(base, state);
6410 return this;
6413 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
6414 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
6415 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
6416 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
6418 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
6419 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6422 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6423 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6424 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6425 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6426 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
6427 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
6429 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6430 IOSB_iostate state = IOSTATE_badbit;
6431 unsigned short c = '\n';
6433 TRACE("(%p %p)\n", this, val);
6435 if(basic_ostream_wchar_sentry_create(this)) {
6436 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
6437 c = basic_streambuf_wchar_snextc(val)) {
6438 state = IOSTATE_goodbit;
6440 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
6441 state = IOSTATE_badbit;
6442 break;
6445 }else {
6446 state = IOSTATE_badbit;
6448 basic_ostream_wchar_sentry_destroy(this);
6450 ios_base_width_set(&base->base, 0);
6451 basic_ios_wchar_setstate(base, state);
6452 return this;
6455 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
6457 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6458 int state = IOSTATE_goodbit;
6460 TRACE("(%p %p)\n", this, val);
6462 if(basic_ostream_wchar_sentry_create(this)) {
6463 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6464 ostreambuf_iterator_wchar dest = {0, strbuf};
6466 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6468 basic_ostream_wchar_sentry_destroy(this);
6470 basic_ios_wchar_setstate(base, state);
6471 return this;
6474 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
6475 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
6476 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
6477 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
6479 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
6480 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6483 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
6485 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6486 int state = IOSTATE_goodbit;
6488 TRACE("(%p)\n", this);
6490 if(basic_ostream_wchar_sentry_create(this)) {
6491 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6492 ostreambuf_iterator_wchar dest = {0, strbuf};
6494 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6496 basic_ostream_wchar_sentry_destroy(this);
6498 basic_ios_wchar_setstate(base, state);
6499 return this;
6502 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
6503 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
6504 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
6505 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
6507 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
6508 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6511 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
6513 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6514 int state = IOSTATE_goodbit;
6516 TRACE("(%p)\n", this);
6518 if(basic_ostream_wchar_sentry_create(this)) {
6519 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6520 ostreambuf_iterator_wchar dest = {0, strbuf};
6522 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6524 basic_ostream_wchar_sentry_destroy(this);
6526 basic_ios_wchar_setstate(base, state);
6527 return this;
6530 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
6531 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
6532 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
6533 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
6535 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
6536 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6539 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
6541 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6542 int state = IOSTATE_goodbit;
6544 TRACE("(%p %x)\n", this, val);
6546 if(basic_ostream_wchar_sentry_create(this)) {
6547 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6548 ostreambuf_iterator_wchar dest = {0, strbuf};
6550 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6552 basic_ostream_wchar_sentry_destroy(this);
6554 basic_ios_wchar_setstate(base, state);
6555 return this;
6558 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
6559 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
6560 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
6561 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
6563 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
6564 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6567 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6568 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6569 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6570 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6571 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
6573 TRACE("(%p)\n", ostr);
6575 basic_ostream_wchar_put(ostr, '\n');
6576 basic_ostream_wchar_flush(ostr);
6577 return ostr;
6580 /* ??$?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 */
6581 /* ??$?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 */
6582 /* ??$?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 */
6583 /* ??$?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 */
6584 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
6586 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6587 IOSB_iostate state = IOSTATE_goodbit;
6589 TRACE("(%p %p)\n", ostr, str);
6591 if(basic_ostream_wchar_sentry_create(ostr)) {
6592 MSVCP_size_t len = basic_string_wchar_length(str);
6593 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6595 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6596 for(; pad!=0; pad--) {
6597 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6598 state = IOSTATE_badbit;
6599 break;
6604 if(state == IOSTATE_goodbit) {
6605 if(basic_streambuf_wchar_sputn(base->strbuf, basic_string_wchar_c_str(str), len) != len)
6606 state = IOSTATE_badbit;
6609 if(state == IOSTATE_goodbit) {
6610 for(; pad!=0; pad--) {
6611 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6612 state = IOSTATE_badbit;
6613 break;
6618 base->base.wide = 0;
6619 }else {
6620 state = IOSTATE_badbit;
6622 basic_ostream_wchar_sentry_destroy(ostr);
6624 basic_ios_wchar_setstate(base, state);
6625 return ostr;
6628 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
6629 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
6630 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
6631 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
6632 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
6634 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6635 IOSB_iostate state = IOSTATE_goodbit;
6637 TRACE("(%p %d)\n", ostr, ch);
6639 if(basic_ostream_wchar_sentry_create(ostr)) {
6640 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6642 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6643 for(; pad!=0; pad--) {
6644 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6645 state = IOSTATE_badbit;
6646 break;
6651 if(state == IOSTATE_goodbit) {
6652 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
6653 state = IOSTATE_badbit;
6656 if(state == IOSTATE_goodbit) {
6657 for(; pad!=0; pad--) {
6658 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6659 state = IOSTATE_badbit;
6660 break;
6665 base->base.wide = 0;
6666 }else {
6667 state = IOSTATE_badbit;
6669 basic_ostream_wchar_sentry_destroy(ostr);
6671 basic_ios_wchar_setstate(base, state);
6672 return ostr;
6675 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
6676 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
6677 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
6678 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
6679 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
6681 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6682 IOSB_iostate state = IOSTATE_goodbit;
6684 TRACE("(%p %s)\n", ostr, debugstr_w(str));
6686 if(basic_ostream_wchar_sentry_create(ostr)) {
6687 MSVCP_size_t len = wcslen(str);
6688 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6690 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6691 for(; pad!=0; pad--) {
6692 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6693 state = IOSTATE_badbit;
6694 break;
6699 if(state == IOSTATE_goodbit) {
6700 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
6701 state = IOSTATE_badbit;
6704 if(state == IOSTATE_goodbit) {
6705 for(; pad!=0; pad--) {
6706 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
6707 state = IOSTATE_badbit;
6708 break;
6713 base->base.wide = 0;
6714 }else {
6715 state = IOSTATE_badbit;
6717 basic_ostream_wchar_sentry_destroy(ostr);
6719 basic_ios_wchar_setstate(base, state);
6720 return ostr;
6723 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6724 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6725 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6726 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6727 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
6728 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
6729 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
6731 TRACE("(%p %p)\n", this, pfunc);
6732 pfunc(this);
6733 return this;
6736 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
6737 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
6738 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
6739 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
6740 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
6741 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
6742 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
6744 TRACE("(%p %p)\n", this, pfunc);
6745 pfunc(basic_ostream_wchar_get_basic_ios(this));
6746 return this;
6749 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6750 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6751 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6752 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6753 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
6754 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
6755 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
6757 TRACE("(%p %p)\n", this, pfunc);
6758 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
6759 return this;
6762 /* Caution: basic_istream uses virtual inheritance. */
6763 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
6765 return (basic_ios_char*)((char*)this+this->vbtable[1]);
6768 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
6770 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
6773 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
6775 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
6778 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
6779 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
6780 static basic_istream_char* basic_istream_char_ctor_init(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
6782 basic_ios_char *base;
6784 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
6786 if(virt_init) {
6787 this->vbtable = basic_istream_char_vbtable;
6788 base = basic_istream_char_get_basic_ios(this);
6789 basic_ios_char_ctor(base);
6790 }else {
6791 base = basic_istream_char_get_basic_ios(this);
6794 base->base.vtable = &MSVCP_basic_istream_char_vtable;
6795 this->count = 0;
6796 if(!noinit)
6797 basic_ios_char_init(base, strbuf, isstd);
6798 return this;
6801 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6802 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6803 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
6804 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6806 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
6809 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
6810 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
6811 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
6812 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
6814 basic_ios_char *base;
6816 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
6818 if(virt_init) {
6819 this->vbtable = basic_istream_char_vbtable;
6820 base = basic_istream_char_get_basic_ios(this);
6821 basic_ios_char_ctor(base);
6822 }else {
6823 base = basic_istream_char_get_basic_ios(this);
6826 base->base.vtable = &MSVCP_basic_istream_char_vtable;
6827 ios_base_Addstd(&base->base);
6828 return this;
6831 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
6832 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
6833 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
6834 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
6836 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
6838 /* don't destroy virtual base here */
6839 TRACE("(%p)\n", this);
6842 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6843 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6844 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
6845 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
6847 TRACE("(%p)\n", this);
6848 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
6849 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
6852 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
6853 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
6855 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
6857 TRACE("(%p %x)\n", this, flags);
6859 if(flags & 2) {
6860 /* we have an array, with the number of elements stored before the first object */
6861 INT_PTR i, *ptr = (INT_PTR *)this-1;
6863 for(i=*ptr-1; i>=0; i--)
6864 basic_istream_char_vbase_dtor(this+i);
6865 MSVCRT_operator_delete(ptr);
6866 } else {
6867 basic_istream_char_vbase_dtor(this);
6868 if(flags & 1)
6869 MSVCRT_operator_delete(this);
6872 return this;
6875 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
6876 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
6877 static MSVCP_bool basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
6879 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
6881 TRACE("(%p %d)\n", this, noskip);
6883 if(ios_base_good(&base->base)) {
6884 if(basic_ios_char_tie_get(base))
6885 basic_ostream_char_flush(basic_ios_char_tie_get(base));
6887 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
6888 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6889 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
6890 int ch;
6892 for(ch = basic_streambuf_char_sgetc(strbuf); ;
6893 ch = basic_streambuf_char_snextc(strbuf)) {
6894 if(ch == EOF) {
6895 basic_ios_char_setstate(base, IOSTATE_eofbit);
6896 break;
6899 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
6900 break;
6905 if(!ios_base_good(&base->base)) {
6906 basic_ios_char_setstate(base, IOSTATE_failbit);
6907 return FALSE;
6910 return TRUE;
6913 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
6914 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
6915 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
6916 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
6918 return basic_istream_char__Ipfx(this, noskip);
6921 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6922 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6923 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
6924 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
6926 TRACE("(%p)\n", this);
6929 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
6931 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
6933 if(basic_ios_char_rdbuf_get(base))
6934 basic_streambuf_char__Lock(base->strbuf);
6936 return basic_istream_char_ipfx(istr, noskip);
6939 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
6941 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
6943 if(basic_ios_char_rdbuf_get(base))
6944 basic_streambuf_char__Unlock(base->strbuf);
6947 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
6948 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
6949 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
6950 int __thiscall basic_istream_char_gcount(const basic_istream_char *this)
6952 TRACE("(%p)\n", this);
6953 return this->count;
6956 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
6957 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
6958 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
6959 int __thiscall basic_istream_char_get(basic_istream_char *this)
6961 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
6962 int ret;
6964 TRACE("(%p)\n", this);
6966 this->count = 0;
6968 if(!basic_istream_char_sentry_create(this, TRUE)) {
6969 basic_istream_char_sentry_destroy(this);
6970 return EOF;
6973 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
6974 basic_istream_char_sentry_destroy(this);
6975 if(ret == EOF)
6976 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
6977 else
6978 this->count++;
6980 return ret;
6983 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
6984 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
6985 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
6986 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
6988 int ret;
6990 TRACE("(%p %p)\n", this, ch);
6992 ret = basic_istream_char_get(this);
6993 if(ret != EOF)
6994 *ch = (char)ret;
6995 return this;
6998 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
6999 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7000 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
7001 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7003 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7004 int ch = delim;
7006 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
7008 this->count = 0;
7010 if(basic_istream_char_sentry_create(this, TRUE)) {
7011 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7013 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
7014 ch = basic_streambuf_char_snextc(strbuf)) {
7015 if(ch==EOF || ch==delim)
7016 break;
7018 *str++ = ch;
7019 this->count++;
7020 count--;
7023 basic_istream_char_sentry_destroy(this);
7025 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7026 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7027 if(count > 0)
7028 *str = 0;
7029 return this;
7032 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7033 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7034 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
7035 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
7037 return basic_istream_char_get_str_delim(this, str, count, '\n');
7040 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7041 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7042 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
7043 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
7045 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7046 int ch = delim;
7048 TRACE("(%p %p %c)\n", this, strbuf, delim);
7050 this->count = 0;
7052 if(basic_istream_char_sentry_create(this, TRUE)) {
7053 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
7055 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
7056 ch = basic_streambuf_char_snextc(strbuf_read)) {
7057 if(ch==EOF || ch==delim)
7058 break;
7060 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
7061 break;
7062 this->count++;
7065 basic_istream_char_sentry_destroy(this);
7067 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7068 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7069 return this;
7072 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7073 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7074 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
7075 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
7077 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
7080 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7081 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7082 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
7083 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7085 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7086 int ch = (unsigned char)delim;
7088 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
7090 this->count = 0;
7092 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
7093 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7095 while(count > 1) {
7096 ch = basic_streambuf_char_sbumpc(strbuf);
7098 if(ch==EOF || ch==(unsigned char)delim)
7099 break;
7101 *str++ = ch;
7102 this->count++;
7103 count--;
7106 if(ch == (unsigned char)delim)
7107 this->count++;
7108 else if(ch != EOF) {
7109 ch = basic_streambuf_char_sgetc(strbuf);
7111 if(ch == (unsigned char)delim) {
7112 basic_streambuf_char__Gninc(strbuf);
7113 this->count++;
7117 basic_istream_char_sentry_destroy(this);
7119 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
7120 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
7121 if(count > 0)
7122 *str = 0;
7123 return this;
7126 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7127 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7128 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
7129 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
7131 return basic_istream_char_getline_delim(this, str, count, '\n');
7134 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
7135 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
7136 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
7137 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
7139 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7140 int ch = (unsigned char)delim;
7141 unsigned int state;
7143 TRACE("(%p %ld %d)\n", this, count, delim);
7145 this->count = 0;
7147 if(basic_istream_char_sentry_create(this, TRUE)) {
7148 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7149 state = IOSTATE_goodbit;
7151 while(count > 0) {
7152 ch = basic_streambuf_char_sbumpc(strbuf);
7154 if(ch==EOF) {
7155 state = IOSTATE_eofbit;
7156 break;
7159 if(ch==(unsigned char)delim)
7160 break;
7162 this->count++;
7163 if(count != INT_MAX)
7164 count--;
7166 }else
7167 state = IOSTATE_failbit;
7168 basic_istream_char_sentry_destroy(this);
7170 basic_ios_char_setstate(base, state);
7171 return this;
7174 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
7175 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
7176 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
7178 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
7179 int ch = '\n';
7181 TRACE("(%p)\n", istream);
7183 if(basic_istream_char_sentry_create(istream, TRUE)) {
7184 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7185 const ctype_char *ctype = ctype_char_use_facet(strbuf->loc);
7187 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
7188 ch = basic_streambuf_char_snextc(strbuf)) {
7189 if(ch == EOF)
7190 break;
7193 basic_istream_char_sentry_destroy(istream);
7195 if(ch == EOF)
7196 basic_ios_char_setstate(base, IOSTATE_eofbit);
7197 return istream;
7200 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7201 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7202 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
7203 int __thiscall basic_istream_char_peek(basic_istream_char *this)
7205 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7206 int ret = EOF;
7208 TRACE("(%p)\n", this);
7210 this->count = 0;
7212 if(basic_istream_char_sentry_create(this, TRUE))
7213 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
7214 basic_istream_char_sentry_destroy(this);
7215 return ret;
7218 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
7219 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
7220 static basic_istream_char* basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
7222 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7223 IOSB_iostate state = IOSTATE_goodbit;
7225 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
7227 if(basic_istream_char_sentry_create(this, TRUE)) {
7228 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7230 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
7231 if(this->count != count)
7232 state |= IOSTATE_failbit | IOSTATE_eofbit;
7233 }else {
7234 this->count = 0;
7236 basic_istream_char_sentry_destroy(this);
7238 basic_ios_char_setstate(base, state);
7239 return this;
7242 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7243 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7244 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
7245 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
7247 return basic_istream_char__Read_s(this, str, count, count);
7250 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
7251 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
7252 static streamsize basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
7254 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7255 IOSB_iostate state = IOSTATE_goodbit;
7257 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
7259 this->count = 0;
7261 if(basic_istream_char_sentry_create(this, TRUE)) {
7262 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
7263 if(avail > count)
7264 avail = count;
7266 if(avail == -1)
7267 state |= IOSTATE_eofbit;
7268 else if(avail > 0)
7269 basic_istream_char__Read_s(this, str, size, avail);
7270 }else {
7271 state |= IOSTATE_failbit;
7273 basic_istream_char_sentry_destroy(this);
7275 basic_ios_char_setstate(base, state);
7276 return this->count;
7279 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
7280 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
7281 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
7282 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
7284 return basic_istream_char__Readsome_s(this, str, count, count);
7287 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
7288 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
7289 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
7290 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
7292 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7293 IOSB_iostate state = IOSTATE_goodbit;
7295 TRACE("(%p %c)\n", this, ch);
7297 this->count = 0;
7299 if(basic_istream_char_sentry_create(this, TRUE)) {
7300 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7302 if(!ios_base_good(&base->base))
7303 state |= IOSTATE_failbit;
7304 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
7305 state |= IOSTATE_badbit;
7307 basic_istream_char_sentry_destroy(this);
7309 basic_ios_char_setstate(base, state);
7310 return this;
7313 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
7314 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
7315 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
7316 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
7318 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7319 IOSB_iostate state = IOSTATE_goodbit;
7321 TRACE("(%p)\n", this);
7323 this->count = 0;
7325 if(basic_istream_char_sentry_create(this, TRUE)) {
7326 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7328 if(!ios_base_good(&base->base))
7329 state |= IOSTATE_failbit;
7330 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
7331 state |= IOSTATE_badbit;
7333 basic_istream_char_sentry_destroy(this);
7335 basic_ios_char_setstate(base, state);
7336 return this;
7339 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7340 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7341 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
7342 int __thiscall basic_istream_char_sync(basic_istream_char *this)
7344 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7345 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7347 TRACE("(%p)\n", this);
7349 if(!strbuf)
7350 return -1;
7352 if(basic_istream_char_sentry_create(this, TRUE)) {
7353 if(basic_streambuf_char_pubsync(strbuf) != -1) {
7354 basic_istream_char_sentry_destroy(this);
7355 return 0;
7358 basic_istream_char_sentry_destroy(this);
7360 basic_ios_char_setstate(base, IOSTATE_badbit);
7361 return -1;
7364 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7365 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7366 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
7367 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
7369 TRACE("(%p %p)\n", this, ret);
7371 if(basic_istream_char_sentry_create(this, TRUE)) {
7372 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7373 if(!ios_base_fail(&base->base)) {
7374 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
7375 ret, 0, SEEKDIR_cur, OPENMODE_in);
7376 basic_istream_char_sentry_destroy(this);
7378 if(ret->off==0 && ret->pos==-1 && ret->state==0)
7379 basic_ios_char_setstate(base, IOSTATE_failbit);
7380 return ret;
7383 basic_istream_char_sentry_destroy(this);
7385 ret->off = 0;
7386 ret->pos = -1;
7387 ret->state = 0;
7388 return ret;
7391 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
7392 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
7393 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
7394 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
7396 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7398 TRACE("(%p %ld %d)\n", this, off, dir);
7400 if(!ios_base_fail(&base->base)) {
7401 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7402 fpos_int ret;
7404 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
7406 if(ret.off==0 && ret.pos==-1 && ret.state==0)
7407 basic_ios_char_setstate(base, IOSTATE_failbit);
7408 else
7409 basic_ios_char_clear(base, IOSTATE_goodbit);
7410 return this;
7411 }else
7412 basic_ios_char_clear(base, IOSTATE_goodbit);
7414 return this;
7417 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7418 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7419 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
7420 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
7422 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7424 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
7426 if(!ios_base_fail(&base->base)) {
7427 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7428 fpos_int ret;
7430 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
7431 basic_istream_char_sentry_destroy(this);
7433 if(ret.off==0 && ret.pos==-1 && ret.state==0)
7434 basic_ios_char_setstate(base, IOSTATE_failbit);
7435 else
7436 basic_ios_char_clear(base, IOSTATE_goodbit);
7437 return this;
7438 }else
7439 basic_ios_char_clear(base, IOSTATE_goodbit);
7441 return this;
7444 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
7445 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
7446 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
7447 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
7449 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7450 int state = IOSTATE_goodbit;
7452 TRACE("(%p %p)\n", this, v);
7454 if(basic_istream_char_sentry_create(this, FALSE)) {
7455 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7456 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7457 istreambuf_iterator_char first={0}, last={0};
7458 LONG tmp;
7460 first.strbuf = strbuf;
7461 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
7463 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
7464 *v = tmp;
7465 else
7466 state |= IOSTATE_failbit;
7468 basic_istream_char_sentry_destroy(this);
7470 basic_ios_char_setstate(base, state);
7471 return this;
7474 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
7475 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
7476 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
7477 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
7479 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7480 int state = IOSTATE_goodbit;
7482 TRACE("(%p %p)\n", this, v);
7484 if(basic_istream_char_sentry_create(this, FALSE)) {
7485 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7486 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7487 istreambuf_iterator_char first={0}, last={0};
7489 first.strbuf = strbuf;
7490 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
7492 basic_istream_char_sentry_destroy(this);
7494 basic_ios_char_setstate(base, state);
7495 return this;
7498 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
7499 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
7500 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
7501 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
7503 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7504 int state = IOSTATE_goodbit;
7506 TRACE("(%p %p)\n", this, v);
7508 if(basic_istream_char_sentry_create(this, FALSE)) {
7509 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7510 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7511 istreambuf_iterator_char first={0}, last={0};
7513 first.strbuf = strbuf;
7514 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
7516 basic_istream_char_sentry_destroy(this);
7518 basic_ios_char_setstate(base, state);
7519 return this;
7522 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
7523 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
7524 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
7525 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
7527 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7528 int state = IOSTATE_goodbit;
7530 TRACE("(%p %p)\n", this, v);
7532 if(basic_istream_char_sentry_create(this, FALSE)) {
7533 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7534 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7535 istreambuf_iterator_char first={0}, last={0};
7537 first.strbuf = strbuf;
7538 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
7540 basic_istream_char_sentry_destroy(this);
7542 basic_ios_char_setstate(base, state);
7543 return this;
7546 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
7547 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
7548 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
7549 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
7551 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7552 int state = IOSTATE_goodbit;
7554 TRACE("(%p %p)\n", this, v);
7556 if(basic_istream_char_sentry_create(this, FALSE)) {
7557 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7558 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7559 istreambuf_iterator_char first={0}, last={0};
7561 first.strbuf = strbuf;
7562 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
7564 basic_istream_char_sentry_destroy(this);
7566 basic_ios_char_setstate(base, state);
7567 return this;
7570 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
7571 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
7572 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
7573 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
7575 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7576 int state = IOSTATE_goodbit;
7578 TRACE("(%p %p)\n", this, v);
7580 if(basic_istream_char_sentry_create(this, FALSE)) {
7581 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7582 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7583 istreambuf_iterator_char first={0}, last={0};
7585 first.strbuf = strbuf;
7586 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
7588 basic_istream_char_sentry_destroy(this);
7590 basic_ios_char_setstate(base, state);
7591 return this;
7594 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
7595 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
7596 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
7597 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
7599 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7600 int state = IOSTATE_goodbit;
7602 TRACE("(%p %p)\n", this, v);
7604 if(basic_istream_char_sentry_create(this, FALSE)) {
7605 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7606 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7607 istreambuf_iterator_char first={0}, last={0};
7609 first.strbuf = strbuf;
7610 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
7612 basic_istream_char_sentry_destroy(this);
7614 basic_ios_char_setstate(base, state);
7615 return this;
7618 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
7619 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
7620 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
7621 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
7623 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7624 int state = IOSTATE_goodbit;
7626 TRACE("(%p %p)\n", this, v);
7628 if(basic_istream_char_sentry_create(this, FALSE)) {
7629 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7630 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7631 istreambuf_iterator_char first={0}, last={0};
7633 first.strbuf = strbuf;
7634 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
7636 basic_istream_char_sentry_destroy(this);
7638 basic_ios_char_setstate(base, state);
7639 return this;
7642 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
7643 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
7644 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
7645 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
7647 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7648 int state = IOSTATE_goodbit;
7650 TRACE("(%p %p)\n", this, v);
7652 if(basic_istream_char_sentry_create(this, FALSE)) {
7653 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7654 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7655 istreambuf_iterator_char first={0}, last={0};
7657 first.strbuf = strbuf;
7658 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
7660 basic_istream_char_sentry_destroy(this);
7662 basic_ios_char_setstate(base, state);
7663 return this;
7666 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
7667 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
7668 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
7669 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
7671 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7672 int state = IOSTATE_goodbit;
7674 TRACE("(%p %p)\n", this, v);
7676 if(basic_istream_char_sentry_create(this, FALSE)) {
7677 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7678 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7679 istreambuf_iterator_char first={0}, last={0};
7681 first.strbuf = strbuf;
7682 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
7684 basic_istream_char_sentry_destroy(this);
7686 basic_ios_char_setstate(base, state);
7687 return this;
7690 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
7691 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
7692 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
7693 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
7695 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7696 int state = IOSTATE_goodbit;
7698 TRACE("(%p %p)\n", this, v);
7700 if(basic_istream_char_sentry_create(this, FALSE)) {
7701 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7702 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7703 istreambuf_iterator_char first={0}, last={0};
7705 first.strbuf = strbuf;
7706 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
7708 basic_istream_char_sentry_destroy(this);
7710 basic_ios_char_setstate(base, state);
7711 return this;
7714 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
7715 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
7716 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
7717 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
7719 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7720 int state = IOSTATE_goodbit;
7722 TRACE("(%p %p)\n", this, v);
7724 if(basic_istream_char_sentry_create(this, FALSE)) {
7725 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7726 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7727 istreambuf_iterator_char first={0}, last={0};
7729 first.strbuf = strbuf;
7730 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
7732 basic_istream_char_sentry_destroy(this);
7734 basic_ios_char_setstate(base, state);
7735 return this;
7738 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
7739 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
7740 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
7741 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
7743 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7744 int state = IOSTATE_goodbit;
7746 TRACE("(%p %p)\n", this, v);
7748 if(basic_istream_char_sentry_create(this, FALSE)) {
7749 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7750 const num_get *numget = num_get_char_use_facet(strbuf->loc);
7751 istreambuf_iterator_char first={0}, last={0};
7753 first.strbuf = strbuf;
7754 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
7756 basic_istream_char_sentry_destroy(this);
7758 basic_ios_char_setstate(base, state);
7759 return this;
7762 /* ??$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 */
7763 /* ??$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 */
7764 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
7765 basic_istream_char *istream, basic_string_char *str, char delim)
7767 IOSB_iostate state = IOSTATE_failbit;
7768 int c = (unsigned char)delim;
7770 TRACE("(%p %p %c)\n", istream, str, delim);
7772 if(basic_istream_char_sentry_create(istream, TRUE)) {
7773 basic_string_char_clear(str);
7775 c = basic_istream_char_get(istream);
7776 if(c != EOF)
7777 state = IOSTATE_goodbit;
7779 for(; c!=(unsigned char)delim && c!=EOF; c = basic_istream_char_get(istream)) {
7780 state = IOSTATE_goodbit;
7781 basic_string_char_append_ch(str, c);
7784 basic_istream_char_sentry_destroy(istream);
7786 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
7787 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7788 return istream;
7791 /* ??$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 */
7792 /* ??$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 */
7793 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
7794 basic_istream_char *istream, basic_string_char *str)
7796 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
7799 /* ??$?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 */
7800 /* ??$?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 */
7801 basic_istream_char* __cdecl basic_istream_char_read_bstr(
7802 basic_istream_char *istream, basic_string_char *str)
7804 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
7805 IOSB_iostate state = IOSTATE_failbit;
7806 int c = '\n';
7808 TRACE("(%p %p)\n", istream, str);
7810 if(basic_istream_char_sentry_create(istream, FALSE)) {
7811 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
7812 MSVCP_size_t count = ios_base_width_get(&base->base);
7814 if(!count)
7815 count = -1;
7817 basic_string_char_clear(str);
7819 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
7820 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
7821 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
7822 state = IOSTATE_goodbit;
7823 basic_string_char_append_ch(str, c);
7826 basic_istream_char_sentry_destroy(istream);
7828 ios_base_width_set(&base->base, 0);
7829 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7830 return istream;
7833 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
7834 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
7835 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
7836 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
7837 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
7838 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
7839 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
7841 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
7842 IOSB_iostate state = IOSTATE_failbit;
7843 int c = '\n';
7845 TRACE("(%p %p)\n", istream, str);
7847 if(basic_istream_char_sentry_create(istream, FALSE)) {
7848 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
7849 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
7851 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
7852 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
7853 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
7854 state = IOSTATE_goodbit;
7855 *str++ = c;
7858 basic_istream_char_sentry_destroy(istream);
7860 *str = 0;
7861 ios_base_width_set(&base->base, 0);
7862 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7863 return istream;
7866 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
7867 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
7868 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
7869 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
7870 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
7871 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
7872 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
7874 IOSB_iostate state = IOSTATE_failbit;
7875 int c = 0;
7877 TRACE("(%p %p)\n", istream, ch);
7879 if(basic_istream_char_sentry_create(istream, FALSE)) {
7880 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
7881 basic_istream_char_get_basic_ios(istream)));
7882 if(c != EOF) {
7883 state = IOSTATE_goodbit;
7884 *ch = c;
7887 basic_istream_char_sentry_destroy(istream);
7889 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
7890 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7891 return istream;
7894 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
7895 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
7896 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
7897 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
7898 basic_istream_char *this, basic_streambuf_char *streambuf)
7900 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7901 IOSB_iostate state = IOSTATE_failbit;
7902 int c = '\n';
7904 TRACE("(%p %p)\n", this, streambuf);
7906 if(basic_istream_char_sentry_create(this, FALSE)) {
7907 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
7908 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
7909 state = IOSTATE_goodbit;
7910 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
7911 break;
7914 basic_istream_char_sentry_destroy(this);
7916 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7917 return this;
7920 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7921 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7922 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
7923 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
7924 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
7926 TRACE("(%p %p)\n", this, pfunc);
7927 pfunc(this);
7928 return this;
7931 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
7932 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
7933 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
7934 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
7935 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
7937 TRACE("(%p %p)\n", this, pfunc);
7938 pfunc(basic_istream_char_get_basic_ios(this));
7939 return this;
7942 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7943 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7944 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
7945 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
7946 ios_base* (__cdecl *pfunc)(ios_base*))
7948 TRACE("(%p %p)\n", this, pfunc);
7949 pfunc(&basic_istream_char_get_basic_ios(this)->base);
7950 return this;
7953 /* Caution: basic_istream uses virtual inheritance. */
7954 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
7956 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
7959 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
7961 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
7964 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
7966 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
7969 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
7970 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
7971 static basic_istream_wchar* basic_istream_wchar_ctor_init(basic_istream_wchar *this,
7972 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
7974 basic_ios_wchar *base;
7976 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
7978 if(virt_init) {
7979 this->vbtable = basic_istream_wchar_vbtable;
7980 base = basic_istream_wchar_get_basic_ios(this);
7981 basic_ios_wchar_ctor(base);
7982 }else {
7983 base = basic_istream_wchar_get_basic_ios(this);
7986 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
7987 this->count = 0;
7988 if(!noinit)
7989 basic_ios_wchar_init(base, strbuf, isstd);
7990 return this;
7993 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
7994 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
7995 static basic_istream_wchar* basic_istream_short_ctor_init(basic_istream_wchar *this,
7996 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
7998 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
7999 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8000 return this;
8003 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8004 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8005 static basic_istream_wchar* basic_istream_wchar_ctor(basic_istream_wchar *this,
8006 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8008 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8011 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8012 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8013 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
8014 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
8015 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8017 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8020 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8021 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8022 static basic_istream_wchar* basic_istream_wchar_ctor_uninitialized(
8023 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8025 basic_ios_wchar *base;
8027 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
8029 if(virt_init) {
8030 this->vbtable = basic_istream_wchar_vbtable;
8031 base = basic_istream_wchar_get_basic_ios(this);
8032 basic_ios_wchar_ctor(base);
8033 }else {
8034 base = basic_istream_wchar_get_basic_ios(this);
8037 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
8038 ios_base_Addstd(&base->base);
8039 return this;
8042 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8043 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8044 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
8045 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
8046 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8048 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
8049 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8050 return this;
8053 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
8054 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
8055 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
8056 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
8057 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
8058 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
8060 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8062 /* don't destroy virtual base here */
8063 TRACE("(%p)\n", this);
8066 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
8067 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
8068 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
8069 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
8070 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
8071 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
8073 TRACE("(%p)\n", this);
8074 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
8075 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
8078 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
8079 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
8081 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8083 TRACE("(%p %x)\n", this, flags);
8085 if(flags & 2) {
8086 /* we have an array, with the number of elements stored before the first object */
8087 INT_PTR i, *ptr = (INT_PTR *)this-1;
8089 for(i=*ptr-1; i>=0; i--)
8090 basic_istream_wchar_vbase_dtor(this+i);
8091 MSVCRT_operator_delete(ptr);
8092 } else {
8093 basic_istream_wchar_vbase_dtor(this);
8094 if(flags & 1)
8095 MSVCRT_operator_delete(this);
8098 return this;
8101 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
8102 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
8103 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
8104 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
8105 static MSVCP_bool basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
8107 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8109 TRACE("(%p %d)\n", this, noskip);
8111 if(ios_base_good(&base->base)) {
8112 if(basic_ios_wchar_tie_get(base))
8113 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
8115 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
8116 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8117 const ctype_wchar *ctype = ctype_wchar_use_facet(base->strbuf->loc);
8118 int ch;
8120 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
8121 ch = basic_streambuf_wchar_snextc(strbuf)) {
8122 if(ch == WEOF) {
8123 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
8124 break;
8127 if(!ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
8128 break;
8133 if(!ios_base_good(&base->base)) {
8134 basic_ios_wchar_setstate(base, IOSTATE_failbit);
8135 return FALSE;
8137 return TRUE;
8140 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
8141 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
8142 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
8143 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
8144 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
8145 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
8147 return basic_istream_wchar__Ipfx(this, noskip);
8150 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
8151 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
8152 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
8153 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
8154 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
8155 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
8157 TRACE("(%p)\n", this);
8160 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
8162 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
8164 if(basic_ios_wchar_rdbuf_get(base))
8165 basic_streambuf_wchar__Lock(base->strbuf);
8167 return basic_istream_wchar_ipfx(istr, noskip);
8170 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
8172 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
8174 if(basic_ios_wchar_rdbuf_get(base))
8175 basic_streambuf_wchar__Unlock(base->strbuf);
8178 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
8179 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
8180 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
8181 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
8182 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
8183 int __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
8185 TRACE("(%p)\n", this);
8186 return this->count;
8189 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
8190 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
8191 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
8192 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
8193 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
8194 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
8196 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8197 int ret;
8199 TRACE("(%p)\n", this);
8201 this->count = 0;
8203 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
8204 basic_istream_wchar_sentry_destroy(this);
8205 return WEOF;
8208 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
8209 basic_istream_wchar_sentry_destroy(this);
8210 if(ret == WEOF)
8211 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
8212 else
8213 this->count++;
8215 return ret;
8218 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
8219 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
8220 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
8221 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
8222 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
8223 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
8225 unsigned short ret;
8227 TRACE("(%p %p)\n", this, ch);
8229 ret = basic_istream_wchar_get(this);
8230 if(ret != WEOF)
8231 *ch = (wchar_t)ret;
8232 return this;
8235 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
8236 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
8237 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
8238 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
8239 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
8240 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
8242 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8243 unsigned short ch = delim;
8245 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
8247 this->count = 0;
8249 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8250 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8252 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
8253 ch = basic_streambuf_wchar_snextc(strbuf)) {
8254 if(ch==WEOF || ch==delim)
8255 break;
8257 *str++ = ch;
8258 this->count++;
8259 count--;
8262 basic_istream_wchar_sentry_destroy(this);
8264 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8265 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8266 if(count > 0)
8267 *str = 0;
8268 return this;
8271 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8272 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8273 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8274 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8275 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
8276 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
8278 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
8281 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
8282 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
8283 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
8284 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
8285 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
8286 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
8288 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8289 unsigned short ch = delim;
8291 TRACE("(%p %p %c)\n", this, strbuf, delim);
8293 this->count = 0;
8295 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8296 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
8298 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
8299 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
8300 if(ch==WEOF || ch==delim)
8301 break;
8303 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
8304 break;
8305 this->count++;
8308 basic_istream_wchar_sentry_destroy(this);
8310 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8311 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8312 return this;
8315 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
8316 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
8317 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
8318 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
8319 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
8320 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
8322 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
8325 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
8326 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
8327 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
8328 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
8329 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
8330 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
8332 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8333 unsigned short ch = delim;
8335 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
8337 this->count = 0;
8339 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
8340 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8342 while(count > 1) {
8343 ch = basic_streambuf_wchar_sbumpc(strbuf);
8345 if(ch==WEOF || ch==delim)
8346 break;
8348 *str++ = ch;
8349 this->count++;
8350 count--;
8353 if(ch == delim)
8354 this->count++;
8355 else if(ch != WEOF) {
8356 ch = basic_streambuf_wchar_sgetc(strbuf);
8358 if(ch == delim) {
8359 basic_streambuf_wchar__Gninc(strbuf);
8360 this->count++;
8364 basic_istream_wchar_sentry_destroy(this);
8366 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8367 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8368 if(count > 0)
8369 *str = 0;
8370 return this;
8373 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8374 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8375 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8376 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8377 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
8378 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
8380 return basic_istream_wchar_getline_delim(this, str, count, '\n');
8383 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
8384 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
8385 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
8386 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
8387 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
8388 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
8390 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8391 unsigned short ch = delim;
8392 unsigned int state;
8394 TRACE("(%p %ld %d)\n", this, count, delim);
8396 this->count = 0;
8398 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8399 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8400 state = IOSTATE_goodbit;
8402 while(count > 0) {
8403 ch = basic_streambuf_wchar_sbumpc(strbuf);
8405 if(ch==WEOF) {
8406 state = IOSTATE_eofbit;
8407 break;
8410 if(ch==delim)
8411 break;
8413 this->count++;
8414 if(count != INT_MAX)
8415 count--;
8417 }else
8418 state = IOSTATE_failbit;
8419 basic_istream_wchar_sentry_destroy(this);
8421 basic_ios_wchar_setstate(base, state);
8422 return this;
8425 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
8426 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
8427 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
8428 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
8429 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
8431 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
8432 unsigned short ch = '\n';
8434 TRACE("(%p)\n", istream);
8436 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
8437 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8438 const ctype_wchar *ctype = ctype_wchar_use_facet(strbuf->loc);
8440 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
8441 ch = basic_streambuf_wchar_snextc(strbuf)) {
8442 if(ch == WEOF)
8443 break;
8446 basic_istream_wchar_sentry_destroy(istream);
8448 if(ch == WEOF)
8449 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
8450 return istream;
8453 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
8454 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
8455 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
8456 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
8457 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
8458 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
8460 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8461 unsigned short ret = WEOF;
8463 TRACE("(%p)\n", this);
8465 this->count = 0;
8467 if(basic_istream_wchar_sentry_create(this, TRUE))
8468 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
8469 basic_istream_wchar_sentry_destroy(this);
8470 return ret;
8473 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
8474 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
8475 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
8476 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
8477 static basic_istream_wchar* basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
8479 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8480 IOSB_iostate state = IOSTATE_goodbit;
8482 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
8484 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8485 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8487 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
8488 if(this->count != count)
8489 state |= IOSTATE_failbit | IOSTATE_eofbit;
8490 }else {
8491 this->count = 0;
8493 basic_istream_wchar_sentry_destroy(this);
8495 basic_ios_wchar_setstate(base, state);
8496 return this;
8499 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
8500 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
8501 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
8502 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
8503 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
8504 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
8506 return basic_istream_wchar__Read_s(this, str, count, count);
8509 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
8510 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
8511 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
8512 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
8513 static streamsize basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
8515 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8516 IOSB_iostate state = IOSTATE_goodbit;
8518 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
8520 this->count = 0;
8522 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8523 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
8524 if(avail > count)
8525 avail = count;
8527 if(avail == -1)
8528 state |= IOSTATE_eofbit;
8529 else if(avail > 0)
8530 basic_istream_wchar__Read_s(this, str, size, avail);
8531 }else {
8532 state |= IOSTATE_failbit;
8534 basic_istream_wchar_sentry_destroy(this);
8536 basic_ios_wchar_setstate(base, state);
8537 return this->count;
8540 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
8541 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
8542 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
8543 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
8544 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
8545 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
8547 return basic_istream_wchar__Readsome_s(this, str, count, count);
8550 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
8551 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
8552 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
8553 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
8554 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
8555 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
8557 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8558 IOSB_iostate state = IOSTATE_goodbit;
8560 TRACE("(%p %c)\n", this, ch);
8562 this->count = 0;
8564 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8565 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8567 if(!ios_base_good(&base->base))
8568 state |= IOSTATE_failbit;
8569 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
8570 state |= IOSTATE_badbit;
8572 basic_istream_wchar_sentry_destroy(this);
8574 basic_ios_wchar_setstate(base, state);
8575 return this;
8578 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
8579 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
8580 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
8581 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
8582 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
8583 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
8585 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8586 IOSB_iostate state = IOSTATE_goodbit;
8588 TRACE("(%p)\n", this);
8590 this->count = 0;
8592 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8593 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8595 if(!ios_base_good(&base->base))
8596 state |= IOSTATE_failbit;
8597 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
8598 state |= IOSTATE_badbit;
8600 basic_istream_wchar_sentry_destroy(this);
8602 basic_ios_wchar_setstate(base, state);
8603 return this;
8606 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
8607 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
8608 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
8609 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
8610 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
8611 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
8613 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8614 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8616 TRACE("(%p)\n", this);
8618 if(!strbuf)
8619 return -1;
8621 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8622 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
8623 basic_istream_wchar_sentry_destroy(this);
8624 return 0;
8627 basic_istream_wchar_sentry_destroy(this);
8629 basic_ios_wchar_setstate(base, IOSTATE_badbit);
8630 return -1;
8633 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8634 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8635 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8636 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8637 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
8638 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
8640 TRACE("(%p %p)\n", this, ret);
8642 if(basic_istream_wchar_sentry_create(this, TRUE)) {
8643 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8644 if(!ios_base_fail(&base->base)) {
8645 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
8646 ret, 0, SEEKDIR_cur, OPENMODE_in);
8647 basic_istream_wchar_sentry_destroy(this);
8649 if(ret->off==0 && ret->pos==-1 && ret->state==0)
8650 basic_ios_wchar_setstate(base, IOSTATE_failbit);
8651 return ret;
8654 basic_istream_wchar_sentry_destroy(this);
8656 ret->off = 0;
8657 ret->pos = -1;
8658 ret->state = 0;
8659 return ret;
8662 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
8663 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
8664 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
8665 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
8667 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8669 TRACE("(%p %ld %d)\n", this, off, dir);
8671 if(!ios_base_fail(&base->base)) {
8672 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8673 fpos_int ret;
8675 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8676 basic_istream_wchar_sentry_destroy(this);
8678 if(ret.off==0 && ret.pos==-1 && ret.state==0)
8679 basic_ios_wchar_setstate(base, IOSTATE_failbit);
8680 else
8681 basic_ios_wchar_clear(base, IOSTATE_goodbit);
8682 return this;
8683 }else
8684 basic_ios_wchar_clear(base, IOSTATE_goodbit);
8686 return this;
8689 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8690 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8691 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8692 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8693 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
8694 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
8696 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8698 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
8700 if(!ios_base_fail(&base->base)) {
8701 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8702 fpos_int ret;
8704 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8705 basic_istream_wchar_sentry_destroy(this);
8707 if(ret.off==0 && ret.pos==-1 && ret.state==0)
8708 basic_ios_wchar_setstate(base, IOSTATE_failbit);
8709 else
8710 basic_ios_wchar_clear(base, IOSTATE_goodbit);
8711 return this;
8712 }else
8713 basic_ios_wchar_clear(base, IOSTATE_goodbit);
8715 return this;
8718 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
8720 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8721 int state = IOSTATE_goodbit;
8723 TRACE("(%p %p)\n", this, v);
8725 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8726 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8727 istreambuf_iterator_wchar first={0}, last={0};
8728 LONG tmp;
8730 first.strbuf = strbuf;
8731 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8733 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8734 *v = tmp;
8735 else
8736 state |= IOSTATE_failbit;
8738 basic_istream_wchar_sentry_destroy(this);
8740 basic_ios_wchar_setstate(base, state);
8741 return this;
8744 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
8745 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
8746 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
8747 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
8749 return basic_istream_read_short(this, v, num_get_short_use_facet(
8750 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8753 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
8755 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8756 int state = IOSTATE_goodbit;
8758 TRACE("(%p %p)\n", this, v);
8760 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8761 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8762 istreambuf_iterator_wchar first={0}, last={0};
8764 first.strbuf = strbuf;
8765 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
8767 basic_istream_wchar_sentry_destroy(this);
8769 basic_ios_wchar_setstate(base, state);
8770 return this;
8773 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
8774 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
8775 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
8776 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
8778 return basic_istream_read_int(this, v, num_get_short_use_facet(
8779 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8782 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
8784 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8785 int state = IOSTATE_goodbit;
8787 TRACE("(%p %p)\n", this, v);
8789 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8790 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8791 istreambuf_iterator_wchar first={0}, last={0};
8793 first.strbuf = strbuf;
8794 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
8796 basic_istream_wchar_sentry_destroy(this);
8798 basic_ios_wchar_setstate(base, state);
8799 return this;
8802 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
8803 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
8804 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
8805 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
8807 return basic_istream_read_uint(this, v, num_get_short_use_facet(
8808 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8811 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
8813 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8814 int state = IOSTATE_goodbit;
8816 TRACE("(%p %p)\n", this, v);
8818 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8819 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8820 istreambuf_iterator_wchar first={0}, last={0};
8822 first.strbuf = strbuf;
8823 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
8825 basic_istream_wchar_sentry_destroy(this);
8827 basic_ios_wchar_setstate(base, state);
8828 return this;
8831 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
8832 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
8833 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
8834 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
8836 return basic_istream_read_long(this, v, num_get_short_use_facet(
8837 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8840 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
8842 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8843 int state = IOSTATE_goodbit;
8845 TRACE("(%p %p)\n", this, v);
8847 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8848 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8849 istreambuf_iterator_wchar first={0}, last={0};
8851 first.strbuf = strbuf;
8852 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
8854 basic_istream_wchar_sentry_destroy(this);
8856 basic_ios_wchar_setstate(base, state);
8857 return this;
8860 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
8861 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
8862 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
8863 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
8865 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
8866 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8869 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
8871 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8872 int state = IOSTATE_goodbit;
8874 TRACE("(%p %p)\n", this, v);
8876 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8877 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8878 istreambuf_iterator_wchar first={0}, last={0};
8880 first.strbuf = strbuf;
8881 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
8883 basic_istream_wchar_sentry_destroy(this);
8885 basic_ios_wchar_setstate(base, state);
8886 return this;
8889 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
8890 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
8891 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
8892 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
8894 return basic_istream_read_float(this, v, num_get_short_use_facet(
8895 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8898 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
8900 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8901 int state = IOSTATE_goodbit;
8903 TRACE("(%p %p)\n", this, v);
8905 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8906 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8907 istreambuf_iterator_wchar first={0}, last={0};
8909 first.strbuf = strbuf;
8910 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
8912 basic_istream_wchar_sentry_destroy(this);
8914 basic_ios_wchar_setstate(base, state);
8915 return this;
8918 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
8919 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
8920 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
8921 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
8923 return basic_istream_read_double(this, v, num_get_short_use_facet(
8924 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8927 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
8929 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8930 int state = IOSTATE_goodbit;
8932 TRACE("(%p %p)\n", this, v);
8934 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8935 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8936 istreambuf_iterator_wchar first={0}, last={0};
8938 first.strbuf = strbuf;
8939 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
8941 basic_istream_wchar_sentry_destroy(this);
8943 basic_ios_wchar_setstate(base, state);
8944 return this;
8947 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
8948 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
8949 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
8950 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
8952 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
8953 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8956 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
8958 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8959 int state = IOSTATE_goodbit;
8961 TRACE("(%p %p)\n", this, v);
8963 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8964 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8965 istreambuf_iterator_wchar first={0}, last={0};
8967 first.strbuf = strbuf;
8968 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
8970 basic_istream_wchar_sentry_destroy(this);
8972 basic_ios_wchar_setstate(base, state);
8973 return this;
8976 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
8977 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
8978 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
8979 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
8981 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
8982 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
8985 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
8987 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8988 int state = IOSTATE_goodbit;
8990 TRACE("(%p %p)\n", this, v);
8992 if(basic_istream_wchar_sentry_create(this, FALSE)) {
8993 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
8994 istreambuf_iterator_wchar first={0}, last={0};
8996 first.strbuf = strbuf;
8997 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
8999 basic_istream_wchar_sentry_destroy(this);
9001 basic_ios_wchar_setstate(base, state);
9002 return this;
9005 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
9006 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
9007 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
9008 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
9010 return basic_istream_read_int64(this, v, num_get_short_use_facet(
9011 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9014 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
9016 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9017 int state = IOSTATE_goodbit;
9019 TRACE("(%p %p)\n", this, v);
9021 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9022 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9023 istreambuf_iterator_wchar first={0}, last={0};
9025 first.strbuf = strbuf;
9026 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
9028 basic_istream_wchar_sentry_destroy(this);
9030 basic_ios_wchar_setstate(base, state);
9031 return this;
9034 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
9035 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
9036 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
9037 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
9039 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
9040 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9043 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
9045 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9046 int state = IOSTATE_goodbit;
9048 TRACE("(%p %p)\n", this, v);
9050 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9051 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9052 istreambuf_iterator_wchar first={0}, last={0};
9054 first.strbuf = strbuf;
9055 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
9057 basic_istream_wchar_sentry_destroy(this);
9059 basic_ios_wchar_setstate(base, state);
9060 return this;
9063 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
9064 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
9065 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
9066 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
9068 return basic_istream_read_bool(this, v, num_get_short_use_facet(
9069 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9072 /* ??$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 */
9073 /* ??$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 */
9074 /* ??$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 */
9075 /* ??$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 */
9076 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
9077 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
9079 IOSB_iostate state = IOSTATE_failbit;
9080 int c = delim;
9082 TRACE("(%p %p %c)\n", istream, str, delim);
9084 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
9085 basic_string_wchar_clear(str);
9087 c = basic_istream_wchar_get(istream);
9088 if(c != WEOF)
9089 state = IOSTATE_goodbit;
9091 for(; c!=delim && c!=WEOF; c = basic_istream_wchar_get(istream)) {
9092 state = IOSTATE_goodbit;
9093 basic_string_wchar_append_ch(str, c);
9096 basic_istream_wchar_sentry_destroy(istream);
9098 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
9099 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9100 return istream;
9103 /* ??$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 */
9104 /* ??$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 */
9105 /* ??$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 */
9106 /* ??$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 */
9107 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
9108 basic_istream_wchar *istream, basic_string_wchar *str)
9110 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
9113 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
9114 basic_string_wchar *str, const ctype_wchar *ctype)
9116 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9117 IOSB_iostate state = IOSTATE_failbit;
9118 int c = '\n';
9120 TRACE("(%p %p)\n", istream, str);
9122 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9123 MSVCP_size_t count = ios_base_width_get(&base->base);
9125 if(!count)
9126 count = -1;
9128 basic_string_wchar_clear(str);
9130 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9131 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9132 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
9133 state = IOSTATE_goodbit;
9134 basic_string_wchar_append_ch(str, c);
9137 basic_istream_wchar_sentry_destroy(istream);
9139 ios_base_width_set(&base->base, 0);
9140 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9141 return istream;
9144 /* ??$?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 */
9145 /* ??$?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 */
9146 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
9147 basic_istream_wchar *istream, basic_string_wchar *str)
9149 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
9150 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
9153 /* ??$?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 */
9154 /* ??$?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 */
9155 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
9156 basic_istream_wchar *istream, basic_string_wchar *str)
9158 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
9159 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
9162 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
9164 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9165 IOSB_iostate state = IOSTATE_failbit;
9166 unsigned short c = '\n';
9168 TRACE("(%p %p)\n", istream, str);
9170 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9171 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
9173 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9174 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9175 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
9176 state = IOSTATE_goodbit;
9177 *str++ = c;
9180 basic_istream_wchar_sentry_destroy(istream);
9182 *str = 0;
9183 ios_base_width_set(&base->base, 0);
9184 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9185 return istream;
9188 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
9189 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
9190 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
9192 return basic_istream_read_str(istream, str, ctype_short_use_facet(
9193 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
9196 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
9197 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
9198 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
9199 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
9200 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
9202 IOSB_iostate state = IOSTATE_failbit;
9203 unsigned short c = 0;
9205 TRACE("(%p %p)\n", istream, ch);
9207 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
9208 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
9209 basic_istream_wchar_get_basic_ios(istream)));
9210 if(c != WEOF) {
9211 state = IOSTATE_goodbit;
9212 *ch = c;
9215 basic_istream_wchar_sentry_destroy(istream);
9217 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
9218 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9219 return istream;
9222 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9223 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9224 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9225 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9226 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
9227 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
9228 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
9230 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9231 IOSB_iostate state = IOSTATE_failbit;
9232 unsigned short c = '\n';
9234 TRACE("(%p %p)\n", this, streambuf);
9236 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9237 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
9238 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
9239 state = IOSTATE_goodbit;
9240 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
9241 break;
9244 basic_istream_wchar_sentry_destroy(this);
9246 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9247 return this;
9250 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9251 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9252 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9253 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9254 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
9255 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
9256 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
9258 TRACE("(%p %p)\n", this, pfunc);
9259 pfunc(this);
9260 return this;
9263 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
9264 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
9265 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
9266 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
9267 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
9268 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
9269 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
9271 TRACE("(%p %p)\n", this, pfunc);
9272 pfunc(basic_istream_wchar_get_basic_ios(this));
9273 return this;
9276 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9277 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9278 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9279 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9280 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
9281 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
9282 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
9284 TRACE("(%p %p)\n", this, pfunc);
9285 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
9286 return this;
9289 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
9291 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
9294 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
9296 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
9299 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9300 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9301 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
9302 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
9304 basic_ios_char *basic_ios;
9306 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
9308 if(virt_init) {
9309 this->base1.vbtable = basic_iostream_char_vbtable1;
9310 this->base2.vbtable = basic_iostream_char_vbtable2;
9311 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
9312 basic_ios_char_ctor(basic_ios);
9313 }else {
9314 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
9317 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
9319 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
9320 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
9321 return this;
9324 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
9325 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
9326 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
9327 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
9329 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
9331 TRACE("(%p)\n", this);
9332 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
9333 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
9336 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9337 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9338 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
9339 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
9341 TRACE("(%p)\n", this);
9342 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
9343 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
9346 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
9347 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
9349 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
9351 TRACE("(%p %x)\n", this, flags);
9353 if(flags & 2) {
9354 /* we have an array, with the number of elements stored before the first object */
9355 INT_PTR i, *ptr = (INT_PTR *)this-1;
9357 for(i=*ptr-1; i>=0; i--)
9358 basic_iostream_char_vbase_dtor(this+i);
9359 MSVCRT_operator_delete(ptr);
9360 } else {
9361 basic_iostream_char_vbase_dtor(this);
9362 if(flags & 1)
9363 MSVCRT_operator_delete(this);
9366 return this;
9369 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
9371 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
9374 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9376 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
9379 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9380 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
9381 static basic_iostream_wchar* basic_iostream_wchar_ctor(basic_iostream_wchar *this,
9382 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
9384 basic_ios_wchar *basic_ios;
9386 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
9388 if(virt_init) {
9389 this->base1.vbtable = basic_iostream_wchar_vbtable1;
9390 this->base2.vbtable = basic_iostream_wchar_vbtable2;
9391 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
9392 basic_ios_wchar_ctor(basic_ios);
9393 }else {
9394 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
9397 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
9398 basic_ostream_wchar_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
9400 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
9401 return this;
9404 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9405 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
9406 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
9407 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
9408 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
9410 basic_iostream_wchar_ctor(this, strbuf, virt_init);
9411 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
9412 return this;
9415 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9416 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9417 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9418 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9419 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
9420 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
9422 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
9424 TRACE("(%p)\n", this);
9425 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
9426 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
9429 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9430 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9431 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9432 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9433 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
9434 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
9436 TRACE("(%p)\n", this);
9437 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
9438 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
9441 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
9442 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9444 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
9446 TRACE("(%p %x)\n", this, flags);
9448 if(flags & 2) {
9449 /* we have an array, with the number of elements stored before the first object */
9450 INT_PTR i, *ptr = (INT_PTR *)this-1;
9452 for(i=*ptr-1; i>=0; i--)
9453 basic_iostream_wchar_vbase_dtor(this+i);
9454 MSVCRT_operator_delete(ptr);
9455 } else {
9456 basic_iostream_wchar_vbase_dtor(this);
9457 if(flags & 1)
9458 MSVCRT_operator_delete(this);
9461 return this;
9464 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
9466 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
9469 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
9471 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
9474 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
9475 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
9476 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
9477 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
9479 basic_ios_char *basic_ios;
9481 TRACE("(%p %d)\n", this, virt_init);
9483 if(virt_init) {
9484 this->base.vbtable = basic_ofstream_char_vbtable;
9485 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9486 basic_ios_char_ctor(basic_ios);
9487 }else {
9488 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9491 basic_filebuf_char_ctor(&this->filebuf);
9492 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
9493 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
9494 return this;
9497 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
9498 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
9499 static basic_ofstream_char* basic_ofstream_char_ctor_file(
9500 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
9502 basic_ios_char *basic_ios;
9504 TRACE("(%p %p %d)\n", this, file, virt_init);
9506 if(virt_init) {
9507 this->base.vbtable = basic_ofstream_char_vbtable;
9508 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9509 basic_ios_char_ctor(basic_ios);
9510 }else {
9511 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9514 basic_filebuf_char_ctor_file(&this->filebuf, file);
9515 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
9516 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
9517 return this;
9520 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
9521 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
9522 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_copy_ctor, 12)
9523 basic_ofstream_char* __thiscall basic_ofstream_char_copy_ctor(basic_ofstream_char *this,
9524 basic_ofstream_char *copy, MSVCP_bool virt_init)
9526 TRACE("(%p %p %d)\n", this, copy, virt_init);
9527 return basic_ofstream_char_ctor_file(this, copy->filebuf.file, virt_init);
9530 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
9531 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
9532 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 16)
9533 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
9534 const char *name, int mode, MSVCP_bool virt_init)
9536 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
9538 basic_ofstream_char_ctor(this, virt_init);
9540 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
9541 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9542 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
9544 return this;
9547 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
9548 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
9549 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
9550 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
9552 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
9554 TRACE("(%p)\n", this);
9556 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
9557 basic_filebuf_char_dtor(&this->filebuf);
9560 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9561 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9562 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
9563 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
9565 TRACE("(%p)\n", this);
9567 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
9568 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
9571 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
9572 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
9574 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
9576 TRACE("(%p %x)\n", this, flags);
9578 if(flags & 2) {
9579 /* we have an array, with the number of elements stored before the first object */
9580 INT_PTR i, *ptr = (INT_PTR *)this-1;
9582 for(i=*ptr-1; i>=0; i--)
9583 basic_ofstream_char_vbase_dtor(this+i);
9584 MSVCRT_operator_delete(ptr);
9585 } else {
9586 basic_ofstream_char_vbase_dtor(this);
9587 if(flags & 1)
9588 MSVCRT_operator_delete(this);
9591 return this;
9594 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9595 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9596 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
9597 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
9599 TRACE("(%p)\n", this);
9601 if(!basic_filebuf_char_close(&this->filebuf)) {
9602 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9603 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
9607 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
9608 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
9609 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
9610 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
9612 TRACE("(%p)\n", this);
9613 return basic_filebuf_char_is_open(&this->filebuf);
9616 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
9617 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
9618 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 12)
9619 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
9620 const char *name, int mode)
9622 TRACE("(%p %s %d)\n", this, name, mode);
9624 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
9625 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
9626 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
9630 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
9631 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
9632 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
9633 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
9634 const char *name, short mode)
9636 basic_ofstream_char_open(this, name, mode);
9639 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
9640 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
9641 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
9642 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
9644 TRACE("(%p)\n", this);
9645 return (basic_filebuf_char*)&this->filebuf;
9648 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
9650 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
9653 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9655 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
9658 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
9659 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
9660 static basic_ofstream_wchar* basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
9662 basic_ios_wchar *basic_ios;
9664 TRACE("(%p %d)\n", this, virt_init);
9666 if(virt_init) {
9667 this->base.vbtable = basic_ofstream_wchar_vbtable;
9668 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
9669 basic_ios_wchar_ctor(basic_ios);
9670 }else {
9671 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
9674 basic_filebuf_wchar_ctor(&this->filebuf);
9675 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
9676 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
9677 return this;
9680 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
9681 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
9682 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
9683 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
9685 basic_ofstream_wchar_ctor(this, virt_init);
9686 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
9687 return this;
9690 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
9691 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
9692 static basic_ofstream_wchar* basic_ofstream_wchar_ctor_file(
9693 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
9695 basic_ios_wchar *basic_ios;
9697 TRACE("(%p %p %d)\n", this, file, virt_init);
9699 if(virt_init) {
9700 this->base.vbtable = basic_ofstream_wchar_vbtable;
9701 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
9702 basic_ios_wchar_ctor(basic_ios);
9703 }else {
9704 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
9707 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
9708 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
9709 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
9710 return this;
9713 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
9714 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
9715 static basic_ofstream_wchar* basic_ofstream_short_ctor_file(
9716 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
9718 basic_ofstream_wchar_ctor_file(this, file, virt_init);
9719 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
9720 return this;
9723 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
9724 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
9725 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_copy_ctor, 12)
9726 basic_ofstream_wchar* __thiscall basic_ofstream_short_copy_ctor(basic_ofstream_wchar *this,
9727 basic_ofstream_wchar *copy, MSVCP_bool virt_init)
9729 TRACE("(%p %p %d)\n", this, copy, virt_init);
9730 return basic_ofstream_short_ctor_file(this, copy->filebuf.file, virt_init);
9733 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
9734 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
9735 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 16)
9736 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
9737 const char *name, int mode, MSVCP_bool virt_init)
9739 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
9741 basic_ofstream_short_ctor(this, virt_init);
9743 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
9744 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
9745 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
9747 return this;
9750 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9751 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9752 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9753 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9754 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
9755 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
9757 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
9759 TRACE("(%p)\n", this);
9761 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
9762 basic_filebuf_wchar_dtor(&this->filebuf);
9765 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9766 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9767 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9768 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9769 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
9770 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
9772 TRACE("(%p)\n", this);
9774 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
9775 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
9778 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
9779 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9781 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
9783 TRACE("(%p %x)\n", this, flags);
9785 if(flags & 2) {
9786 /* we have an array, with the number of elements stored before the first object */
9787 INT_PTR i, *ptr = (INT_PTR *)this-1;
9789 for(i=*ptr-1; i>=0; i--)
9790 basic_ofstream_wchar_vbase_dtor(this+i);
9791 MSVCRT_operator_delete(ptr);
9792 } else {
9793 basic_ofstream_wchar_vbase_dtor(this);
9794 if(flags & 1)
9795 MSVCRT_operator_delete(this);
9798 return this;
9801 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9802 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9803 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9804 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9805 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
9806 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
9808 TRACE("(%p)\n", this);
9810 if(!basic_filebuf_wchar_close(&this->filebuf)) {
9811 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
9812 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
9816 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
9817 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
9818 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
9819 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
9820 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
9821 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
9823 TRACE("(%p)\n", this);
9824 return basic_filebuf_wchar_is_open(&this->filebuf);
9827 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
9828 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
9829 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 12)
9830 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
9831 const char *name, int mode)
9833 TRACE("(%p %s %d)\n", this, name, mode);
9835 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
9836 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
9837 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
9841 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
9842 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
9843 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
9844 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
9845 const char *name, int mode)
9847 basic_ofstream_wchar_open(this, name, mode);
9850 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
9851 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
9852 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
9853 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
9854 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
9855 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
9857 TRACE("(%p)\n", this);
9858 return (basic_filebuf_wchar*)&this->filebuf;
9861 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
9863 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
9866 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
9868 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
9871 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
9872 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
9873 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
9874 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
9876 basic_ios_char *basic_ios;
9878 TRACE("(%p %d)\n", this, virt_init);
9880 if(virt_init) {
9881 this->base.vbtable = basic_ifstream_char_vbtable;
9882 basic_ios = basic_istream_char_get_basic_ios(&this->base);
9883 basic_ios_char_ctor(basic_ios);
9884 }else {
9885 basic_ios = basic_istream_char_get_basic_ios(&this->base);
9888 basic_filebuf_char_ctor(&this->filebuf);
9889 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
9890 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
9891 return this;
9894 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
9895 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
9896 static basic_ifstream_char* basic_ifstream_char_ctor_file(
9897 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
9899 basic_ios_char *basic_ios;
9901 TRACE("(%p %p %d)\n", this, file, virt_init);
9903 if(virt_init) {
9904 this->base.vbtable = basic_ifstream_char_vbtable;
9905 basic_ios = basic_istream_char_get_basic_ios(&this->base);
9906 basic_ios_char_ctor(basic_ios);
9907 }else {
9908 basic_ios = basic_istream_char_get_basic_ios(&this->base);
9911 basic_filebuf_char_ctor_file(&this->filebuf, file);
9912 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
9913 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
9914 return this;
9917 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
9918 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
9919 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_copy_ctor, 12)
9920 basic_ifstream_char* __thiscall basic_ifstream_char_copy_ctor(basic_ifstream_char *this,
9921 const basic_ifstream_char *copy, MSVCP_bool virt_init)
9923 TRACE("(%p %p %d)\n", this, copy, virt_init);
9924 return basic_ifstream_char_ctor_file(this, copy->filebuf.file, virt_init);
9927 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
9928 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
9929 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 16)
9930 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
9931 const char *name, int mode, MSVCP_bool virt_init)
9933 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
9935 basic_ifstream_char_ctor(this, virt_init);
9937 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
9938 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
9939 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
9941 return this;
9944 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
9945 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
9946 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
9947 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
9949 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
9951 TRACE("(%p)\n", this);
9953 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
9954 basic_filebuf_char_dtor(&this->filebuf);
9957 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9958 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9959 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
9960 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
9962 TRACE("(%p)\n", this);
9964 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
9965 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
9968 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
9969 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
9971 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
9973 TRACE("(%p %x)\n", this, flags);
9975 if(flags & 2) {
9976 /* we have an array, with the number of elements stored before the first object */
9977 INT_PTR i, *ptr = (INT_PTR *)this-1;
9979 for(i=*ptr-1; i>=0; i--)
9980 basic_ifstream_char_vbase_dtor(this+i);
9981 MSVCRT_operator_delete(ptr);
9982 } else {
9983 basic_ifstream_char_vbase_dtor(this);
9984 if(flags & 1)
9985 MSVCRT_operator_delete(this);
9988 return this;
9991 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
9992 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
9993 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
9994 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
9996 TRACE("(%p)\n", this);
9998 if(!basic_filebuf_char_close(&this->filebuf)) {
9999 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10000 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10004 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10005 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10006 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
10007 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
10009 TRACE("(%p)\n", this);
10010 return basic_filebuf_char_is_open(&this->filebuf);
10013 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
10014 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
10015 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 12)
10016 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
10017 const char *name, int mode)
10019 TRACE("(%p %s %d)\n", this, name, mode);
10021 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
10022 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
10023 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10027 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
10028 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
10029 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
10030 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
10031 const char *name, short mode)
10033 basic_ifstream_char_open(this, name, mode);
10036 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10037 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10038 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
10039 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
10041 TRACE("(%p)\n", this);
10042 return (basic_filebuf_char*)&this->filebuf;
10045 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
10047 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
10050 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10052 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
10055 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10056 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10057 static basic_ifstream_wchar* basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
10059 basic_ios_wchar *basic_ios;
10061 TRACE("(%p %d)\n", this, virt_init);
10063 if(virt_init) {
10064 this->base.vbtable = basic_ifstream_wchar_vbtable;
10065 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10066 basic_ios_wchar_ctor(basic_ios);
10067 }else {
10068 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10071 basic_filebuf_wchar_ctor(&this->filebuf);
10072 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10073 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
10074 return this;
10077 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10078 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10079 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
10080 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
10082 basic_ifstream_wchar_ctor(this, virt_init);
10083 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10084 return this;
10087 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10088 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10089 static basic_ifstream_wchar* basic_ifstream_wchar_ctor_file(
10090 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10092 basic_ios_wchar *basic_ios;
10094 TRACE("(%p %p %d)\n", this, file, virt_init);
10096 if(virt_init) {
10097 this->base.vbtable = basic_ifstream_wchar_vbtable;
10098 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10099 basic_ios_wchar_ctor(basic_ios);
10100 }else {
10101 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10104 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10105 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10106 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
10107 return this;
10110 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10111 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10112 static basic_ifstream_wchar* basic_ifstream_short_ctor_file(
10113 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10115 basic_ifstream_wchar_ctor_file(this, file, virt_init);
10116 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
10117 return this;
10120 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
10121 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
10122 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_copy_ctor, 12)
10123 basic_ifstream_wchar* __thiscall basic_ifstream_short_copy_ctor(basic_ifstream_wchar *this,
10124 basic_ifstream_wchar *copy, MSVCP_bool virt_init)
10126 TRACE("(%p %p %d)\n", this, copy, virt_init);
10127 return basic_ifstream_short_ctor_file(this, copy->filebuf.file, virt_init);
10130 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
10131 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
10132 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 16)
10133 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
10134 const char *name, int mode, MSVCP_bool virt_init)
10136 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10138 basic_ifstream_short_ctor(this, virt_init);
10140 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
10141 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10142 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10144 return this;
10147 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10148 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10149 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10150 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10151 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
10152 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
10154 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
10156 TRACE("(%p)\n", this);
10158 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
10159 basic_filebuf_wchar_dtor(&this->filebuf);
10162 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10163 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10164 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10165 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10166 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
10167 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
10169 TRACE("(%p)\n", this);
10171 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
10172 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
10175 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
10176 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10178 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
10180 TRACE("(%p %x)\n", this, flags);
10182 if(flags & 2) {
10183 /* we have an array, with the number of elements stored before the first object */
10184 INT_PTR i, *ptr = (INT_PTR *)this-1;
10186 for(i=*ptr-1; i>=0; i--)
10187 basic_ifstream_wchar_vbase_dtor(this+i);
10188 MSVCRT_operator_delete(ptr);
10189 } else {
10190 basic_ifstream_wchar_vbase_dtor(this);
10191 if(flags & 1)
10192 MSVCRT_operator_delete(this);
10195 return this;
10198 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10199 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10200 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10201 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10202 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
10203 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
10205 TRACE("(%p)\n", this);
10207 if(!basic_filebuf_wchar_close(&this->filebuf)) {
10208 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10209 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10213 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
10214 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
10215 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
10216 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
10217 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
10218 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
10220 TRACE("(%p)\n", this);
10221 return basic_filebuf_wchar_is_open(&this->filebuf);
10224 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
10225 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
10226 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 12)
10227 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
10228 const char *name, int mode)
10230 TRACE("(%p %s %d)\n", this, name, mode);
10232 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
10233 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
10234 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10238 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
10239 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
10240 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
10241 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
10242 const char *name, short mode)
10244 basic_ifstream_wchar_open(this, name, mode);
10247 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10248 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10249 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10250 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10251 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
10252 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
10254 TRACE("(%p)\n", this);
10255 return (basic_filebuf_wchar*)&this->filebuf;
10258 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
10260 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
10263 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
10265 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
10268 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10269 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10270 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
10271 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
10273 basic_ios_char *basic_ios;
10275 TRACE("(%p %d)\n", this, virt_init);
10277 if(virt_init) {
10278 this->base.base1.vbtable = basic_fstream_char_vbtable1;
10279 this->base.base2.vbtable = basic_fstream_char_vbtable2;
10280 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10281 basic_ios_char_ctor(basic_ios);
10282 }else {
10283 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10286 basic_filebuf_char_ctor(&this->filebuf);
10287 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
10288 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
10289 return this;
10292 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10293 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10294 static basic_fstream_char* basic_fstream_char_ctor_file(basic_fstream_char *this,
10295 FILE *file, MSVCP_bool virt_init)
10297 basic_ios_char *basic_ios;
10299 TRACE("(%p %p %d)\n", this, file, virt_init);
10301 if(virt_init) {
10302 this->base.base1.vbtable = basic_fstream_char_vbtable1;
10303 this->base.base2.vbtable = basic_fstream_char_vbtable2;
10304 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10305 basic_ios_char_ctor(basic_ios);
10306 }else {
10307 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10310 basic_filebuf_char_ctor_file(&this->filebuf, file);
10311 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
10312 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
10313 return this;
10316 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
10317 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
10318 DEFINE_THISCALL_WRAPPER(basic_fstream_char_copy_ctor, 12)
10319 basic_fstream_char* __thiscall basic_fstream_char_copy_ctor(basic_fstream_char *this,
10320 basic_fstream_char *copy, MSVCP_bool virt_init)
10322 TRACE("(%p %p %d)\n", this, copy, virt_init);
10323 return basic_fstream_char_ctor_file(this, copy->filebuf.file, virt_init);
10326 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
10327 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
10328 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 16)
10329 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
10330 const char *name, int mode, MSVCP_bool virt_init)
10332 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10334 basic_fstream_char_ctor(this, virt_init);
10336 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
10337 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10338 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10340 return this;
10343 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10344 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10345 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
10346 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
10348 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
10350 TRACE("(%p)\n", this);
10352 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
10353 basic_filebuf_char_dtor(&this->filebuf);
10356 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10357 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10358 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
10359 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
10361 TRACE("(%p)\n", this);
10363 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
10364 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
10367 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
10368 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10370 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
10372 TRACE("(%p %x)\n", this, flags);
10374 if(flags & 2) {
10375 /* we have an array, with the number of elements stored before the first object */
10376 INT_PTR i, *ptr = (INT_PTR *)this-1;
10378 for(i=*ptr-1; i>=0; i--)
10379 basic_fstream_char_vbase_dtor(this+i);
10380 MSVCRT_operator_delete(ptr);
10381 } else {
10382 basic_fstream_char_vbase_dtor(this);
10383 if(flags & 1)
10384 MSVCRT_operator_delete(this);
10387 return this;
10390 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10391 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10392 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
10393 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
10395 TRACE("(%p)\n", this);
10397 if(!basic_filebuf_char_close(&this->filebuf)) {
10398 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10399 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10403 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10404 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10405 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
10406 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
10408 TRACE("(%p)\n", this);
10409 return basic_filebuf_char_is_open(&this->filebuf);
10412 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
10413 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
10414 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 12)
10415 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
10416 const char *name, int mode)
10418 TRACE("(%p %s %d)\n", this, name, mode);
10420 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
10421 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
10422 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10426 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
10427 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
10428 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
10429 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
10430 const char *name, int mode)
10432 basic_fstream_char_open(this, name, mode);
10435 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10436 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10437 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
10438 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
10440 TRACE("(%p)\n", this);
10441 return (basic_filebuf_char*)&this->filebuf;
10444 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
10446 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
10449 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10451 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
10454 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10455 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10456 static basic_fstream_wchar* basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
10458 basic_ios_wchar *basic_ios;
10460 TRACE("(%p %d)\n", this, virt_init);
10462 if(virt_init) {
10463 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
10464 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
10465 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10466 basic_ios_wchar_ctor(basic_ios);
10467 }else {
10468 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10471 basic_filebuf_wchar_ctor(&this->filebuf);
10472 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
10473 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
10474 return this;
10477 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10478 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10479 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
10480 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
10482 basic_fstream_wchar_ctor(this, virt_init);
10483 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
10484 return this;
10487 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10488 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10489 static basic_fstream_wchar* basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
10490 FILE *file, MSVCP_bool virt_init)
10492 basic_ios_wchar *basic_ios;
10494 TRACE("(%p %p %d)\n", this, file, virt_init);
10496 if(virt_init) {
10497 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
10498 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
10499 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10500 basic_ios_wchar_ctor(basic_ios);
10501 }else {
10502 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10505 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10506 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
10507 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
10508 return this;
10511 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10512 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10513 static basic_fstream_wchar* basic_fstream_short_ctor_file(basic_fstream_wchar *this,
10514 FILE *file, MSVCP_bool virt_init)
10516 basic_fstream_wchar_ctor_file(this, file, virt_init);
10517 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
10518 return this;
10521 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
10522 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
10523 DEFINE_THISCALL_WRAPPER(basic_fstream_short_copy_ctor, 12)
10524 basic_fstream_wchar* __thiscall basic_fstream_short_copy_ctor(basic_fstream_wchar *this,
10525 basic_fstream_wchar *copy, MSVCP_bool virt_init)
10527 TRACE("(%p %p %d)\n", this, copy, virt_init);
10528 return basic_fstream_short_ctor_file(this, copy->filebuf.file, virt_init);
10531 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
10532 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
10533 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 16)
10534 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
10535 const char *name, int mode, MSVCP_bool virt_init)
10537 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10539 basic_fstream_short_ctor(this, virt_init);
10541 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
10542 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10543 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10545 return this;
10548 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10549 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10550 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10551 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10552 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
10553 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
10555 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
10557 TRACE("(%p)\n", this);
10559 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
10560 basic_filebuf_wchar_dtor(&this->filebuf);
10563 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10564 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10565 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10566 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10567 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
10568 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
10570 TRACE("(%p)\n", this);
10572 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
10573 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
10576 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
10577 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10579 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
10581 TRACE("(%p %x)\n", this, flags);
10583 if(flags & 2) {
10584 /* we have an array, with the number of elements stored before the first object */
10585 INT_PTR i, *ptr = (INT_PTR *)this-1;
10587 for(i=*ptr-1; i>=0; i--)
10588 basic_fstream_wchar_vbase_dtor(this+i);
10589 MSVCRT_operator_delete(ptr);
10590 } else {
10591 basic_fstream_wchar_vbase_dtor(this);
10592 if(flags & 1)
10593 MSVCRT_operator_delete(this);
10596 return this;
10599 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10600 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10601 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10602 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10603 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
10604 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
10606 TRACE("(%p)\n", this);
10608 if(!basic_filebuf_wchar_close(&this->filebuf)) {
10609 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10610 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10614 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
10615 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
10616 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
10617 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
10618 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
10619 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
10621 TRACE("(%p)\n", this);
10622 return basic_filebuf_wchar_is_open(&this->filebuf);
10625 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
10626 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
10627 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 12)
10628 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
10629 const char *name, int mode)
10631 TRACE("(%p %s %d)\n", this, name, mode);
10633 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
10634 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
10635 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10639 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
10640 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
10641 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
10642 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
10643 const char *name, int mode)
10645 basic_fstream_wchar_open(this, name, mode);
10648 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10649 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
10650 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10651 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
10652 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
10653 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
10655 TRACE("(%p)\n", this);
10656 return (basic_filebuf_wchar*)&this->filebuf;
10659 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
10661 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
10664 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
10666 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
10669 /* ??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 */
10670 /* ??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 */
10671 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
10672 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
10673 const basic_string_char *str, int mode, MSVCP_bool virt_init)
10675 basic_ios_char *basic_ios;
10677 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
10679 if(virt_init) {
10680 this->base.vbtable = basic_ostringstream_char_vbtable;
10681 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10682 basic_ios_char_ctor(basic_ios);
10683 }else {
10684 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10687 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
10688 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
10689 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
10690 return this;
10693 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
10694 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
10695 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
10696 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
10697 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
10699 basic_ios_char *basic_ios;
10701 TRACE("(%p %d %d)\n", this, mode, virt_init);
10703 if(virt_init) {
10704 this->base.vbtable = basic_ostringstream_char_vbtable;
10705 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10706 basic_ios_char_ctor(basic_ios);
10707 }else {
10708 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10711 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
10712 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
10713 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
10714 return this;
10717 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
10718 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
10719 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 8)
10720 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
10721 basic_ostringstream_char *this, MSVCP_bool virt_init)
10723 return basic_ostringstream_char_ctor_mode(this, 0, virt_init);
10726 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
10727 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
10728 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
10729 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
10731 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
10733 TRACE("(%p)\n", this);
10735 basic_stringbuf_char_dtor(&this->strbuf);
10736 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
10739 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
10740 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
10741 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
10742 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
10744 TRACE("(%p)\n", this);
10746 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
10747 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
10750 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
10751 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10753 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
10755 TRACE("(%p %x)\n", this, flags);
10757 if(flags & 2) {
10758 /* we have an array, with the number of elements stored before the first object */
10759 INT_PTR i, *ptr = (INT_PTR *)this-1;
10761 for(i=*ptr-1; i>=0; i--)
10762 basic_ostringstream_char_vbase_dtor(this+i);
10763 MSVCRT_operator_delete(ptr);
10764 } else {
10765 basic_ostringstream_char_vbase_dtor(this);
10766 if(flags & 1)
10767 MSVCRT_operator_delete(this);
10770 return this;
10773 /* ?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 */
10774 /* ?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 */
10775 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
10776 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
10778 TRACE("(%p)\n", this);
10779 return (basic_stringbuf_char*)&this->strbuf;
10782 /* ?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 */
10783 /* ?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 */
10784 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
10785 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
10787 TRACE("(%p %p)\n", this, str);
10788 basic_stringbuf_char_str_set(&this->strbuf, str);
10791 /* ?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 */
10792 /* ?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 */
10793 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
10794 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
10796 TRACE("(%p %p)\n", this, ret);
10797 return basic_stringbuf_char_str_get(&this->strbuf, ret);
10800 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
10802 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
10805 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10807 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
10810 /* ??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 */
10811 /* ??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 */
10812 static basic_ostringstream_wchar* basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
10813 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
10815 basic_ios_wchar *basic_ios;
10817 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
10819 if(virt_init) {
10820 this->base.vbtable = basic_ostringstream_wchar_vbtable;
10821 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10822 basic_ios_wchar_ctor(basic_ios);
10823 }else {
10824 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10827 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
10828 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
10829 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
10830 return this;
10833 /* ??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 */
10834 /* ??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 */
10835 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
10836 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
10837 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
10839 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
10840 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
10841 return this;
10844 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
10845 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
10846 static basic_ostringstream_wchar* basic_ostringstream_wchar_ctor_mode(
10847 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
10849 basic_ios_wchar *basic_ios;
10851 TRACE("(%p %d %d)\n", this, mode, virt_init);
10853 if(virt_init) {
10854 this->base.vbtable = basic_ostringstream_wchar_vbtable;
10855 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10856 basic_ios_wchar_ctor(basic_ios);
10857 }else {
10858 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10861 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
10862 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
10863 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
10864 return this;
10867 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
10868 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
10869 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
10870 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
10871 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
10873 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
10874 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
10875 return this;
10878 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
10879 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
10880 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 8)
10881 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
10882 basic_ostringstream_wchar *this, MSVCP_bool virt_init)
10884 return basic_ostringstream_short_ctor_mode(this, 0, virt_init);
10887 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
10888 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
10889 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
10890 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
10891 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
10892 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
10894 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
10896 TRACE("(%p)\n", this);
10898 basic_stringbuf_wchar_dtor(&this->strbuf);
10899 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
10902 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
10903 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
10904 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
10905 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
10906 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
10907 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
10909 TRACE("(%p)\n", this);
10911 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
10912 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
10915 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
10916 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10918 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
10920 TRACE("(%p %x)\n", this, flags);
10922 if(flags & 2) {
10923 /* we have an array, with the number of elements stored before the first object */
10924 INT_PTR i, *ptr = (INT_PTR *)this-1;
10926 for(i=*ptr-1; i>=0; i--)
10927 basic_ostringstream_wchar_vbase_dtor(this+i);
10928 MSVCRT_operator_delete(ptr);
10929 } else {
10930 basic_ostringstream_wchar_vbase_dtor(this);
10931 if(flags & 1)
10932 MSVCRT_operator_delete(this);
10935 return this;
10938 /* ?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 */
10939 /* ?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 */
10940 /* ?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 */
10941 /* ?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 */
10942 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
10943 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
10945 TRACE("(%p)\n", this);
10946 return (basic_stringbuf_wchar*)&this->strbuf;
10949 /* ?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 */
10950 /* ?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 */
10951 /* ?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 */
10952 /* ?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 */
10953 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
10954 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
10956 TRACE("(%p %p)\n", this, str);
10957 basic_stringbuf_wchar_str_set(&this->strbuf, str);
10960 /* ?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 */
10961 /* ?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 */
10962 /* ?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 */
10963 /* ?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 */
10964 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
10965 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
10967 TRACE("(%p %p)\n", this, ret);
10968 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
10971 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
10973 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
10976 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
10978 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
10981 /* ??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 */
10982 /* ??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 */
10983 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
10984 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
10985 const basic_string_char *str, int mode, MSVCP_bool virt_init)
10987 basic_ios_char *basic_ios;
10989 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
10991 if(virt_init) {
10992 this->base.vbtable = basic_istringstream_char_vbtable;
10993 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10994 basic_ios_char_ctor(basic_ios);
10995 }else {
10996 basic_ios = basic_istream_char_get_basic_ios(&this->base);
10999 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
11000 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11001 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
11002 return this;
11005 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
11006 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
11007 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
11008 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
11009 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
11011 basic_ios_char *basic_ios;
11013 TRACE("(%p %d %d)\n", this, mode, virt_init);
11015 if(virt_init) {
11016 this->base.vbtable = basic_istringstream_char_vbtable;
11017 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11018 basic_ios_char_ctor(basic_ios);
11019 }else {
11020 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11023 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
11024 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11025 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
11026 return this;
11029 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11030 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11031 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 8)
11032 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
11033 basic_istringstream_char *this, MSVCP_bool virt_init)
11035 return basic_istringstream_char_ctor_mode(this, 0, virt_init);
11038 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
11039 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
11040 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
11041 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
11043 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
11045 TRACE("(%p)\n", this);
11047 basic_stringbuf_char_dtor(&this->strbuf);
11048 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11051 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11052 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11053 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
11054 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
11056 TRACE("(%p)\n", this);
11058 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
11059 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11062 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
11063 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11065 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
11067 TRACE("(%p %x)\n", this, flags);
11069 if(flags & 2) {
11070 /* we have an array, with the number of elements stored before the first object */
11071 INT_PTR i, *ptr = (INT_PTR *)this-1;
11073 for(i=*ptr-1; i>=0; i--)
11074 basic_istringstream_char_vbase_dtor(this+i);
11075 MSVCRT_operator_delete(ptr);
11076 } else {
11077 basic_istringstream_char_vbase_dtor(this);
11078 if(flags & 1)
11079 MSVCRT_operator_delete(this);
11082 return this;
11085 /* ?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 */
11086 /* ?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 */
11087 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
11088 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
11090 TRACE("(%p)\n", this);
11091 return (basic_stringbuf_char*)&this->strbuf;
11094 /* ?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 */
11095 /* ?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 */
11096 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
11097 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
11099 TRACE("(%p %p)\n", this, str);
11100 basic_stringbuf_char_str_set(&this->strbuf, str);
11103 /* ?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 */
11104 /* ?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 */
11105 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
11106 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
11108 TRACE("(%p %p)\n", this, ret);
11109 return basic_stringbuf_char_str_get(&this->strbuf, ret);
11112 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
11114 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
11117 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11119 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
11122 /* ??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 */
11123 /* ??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 */
11124 static basic_istringstream_wchar* basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
11125 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11127 basic_ios_wchar *basic_ios;
11129 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11131 if(virt_init) {
11132 this->base.vbtable = basic_istringstream_wchar_vbtable;
11133 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11134 basic_ios_wchar_ctor(basic_ios);
11135 }else {
11136 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11139 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
11140 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11141 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
11142 return this;
11145 /* ??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 */
11146 /* ??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 */
11147 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
11148 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
11149 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11151 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
11152 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
11153 return this;
11156 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
11157 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
11158 static basic_istringstream_wchar* basic_istringstream_wchar_ctor_mode(
11159 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
11161 basic_ios_wchar *basic_ios;
11163 TRACE("(%p %d %d)\n", this, mode, virt_init);
11165 if(virt_init) {
11166 this->base.vbtable = basic_istringstream_wchar_vbtable;
11167 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11168 basic_ios_wchar_ctor(basic_ios);
11169 }else {
11170 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11173 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
11174 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
11175 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
11176 return this;
11179 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
11180 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
11181 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
11182 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
11183 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
11185 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
11186 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
11187 return this;
11190 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11191 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11192 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 8)
11193 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
11194 basic_istringstream_wchar *this, MSVCP_bool virt_init)
11196 return basic_istringstream_short_ctor_mode(this, 0, virt_init);
11199 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
11200 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
11201 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
11202 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
11203 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
11204 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
11206 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
11208 TRACE("(%p)\n", this);
11210 basic_stringbuf_wchar_dtor(&this->strbuf);
11211 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
11214 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
11215 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
11216 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11217 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11218 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
11219 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
11221 TRACE("(%p)\n", this);
11223 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
11224 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
11227 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
11228 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11230 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
11232 TRACE("(%p %x)\n", this, flags);
11234 if(flags & 2) {
11235 /* we have an array, with the number of elements stored before the first object */
11236 INT_PTR i, *ptr = (INT_PTR *)this-1;
11238 for(i=*ptr-1; i>=0; i--)
11239 basic_istringstream_wchar_vbase_dtor(this+i);
11240 MSVCRT_operator_delete(ptr);
11241 } else {
11242 basic_istringstream_wchar_vbase_dtor(this);
11243 if(flags & 1)
11244 MSVCRT_operator_delete(this);
11247 return this;
11250 /* ?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 */
11251 /* ?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 */
11252 /* ?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 */
11253 /* ?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 */
11254 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
11255 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
11257 TRACE("(%p)\n", this);
11258 return (basic_stringbuf_wchar*)&this->strbuf;
11261 /* ?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 */
11262 /* ?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 */
11263 /* ?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 */
11264 /* ?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 */
11265 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
11266 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
11268 TRACE("(%p %p)\n", this, str);
11269 basic_stringbuf_wchar_str_set(&this->strbuf, str);
11272 /* ?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 */
11273 /* ?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 */
11274 /* ?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 */
11275 /* ?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 */
11276 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
11277 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
11279 TRACE("(%p %p)\n", this, ret);
11280 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
11283 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
11285 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
11288 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
11290 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
11293 /* ??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 */
11294 /* ??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 */
11295 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
11296 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
11297 const basic_string_char *str, int mode, MSVCP_bool virt_init)
11299 basic_ios_char *basic_ios;
11301 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11303 if(virt_init) {
11304 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
11305 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
11306 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11307 basic_ios_char_ctor(basic_ios);
11308 }else {
11309 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11312 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
11313 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
11314 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
11315 return this;
11318 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
11319 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
11320 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
11321 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
11322 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
11324 basic_ios_char *basic_ios;
11326 TRACE("(%p %d %d)\n", this, mode, virt_init);
11328 if(virt_init) {
11329 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
11330 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
11331 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11332 basic_ios_char_ctor(basic_ios);
11333 }else {
11334 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11337 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
11338 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
11339 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
11340 return this;
11343 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11344 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11345 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 8)
11346 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
11347 basic_stringstream_char *this, MSVCP_bool virt_init)
11349 return basic_stringstream_char_ctor_mode(
11350 this, OPENMODE_out|OPENMODE_in, virt_init);
11353 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
11354 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
11355 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
11356 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
11358 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
11360 TRACE("(%p)\n", this);
11362 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
11363 basic_stringbuf_char_dtor(&this->strbuf);
11366 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
11367 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
11368 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
11369 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
11371 TRACE("(%p)\n", this);
11373 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
11374 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
11377 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
11378 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11380 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
11382 TRACE("(%p %x)\n", this, flags);
11384 if(flags & 2) {
11385 /* we have an array, with the number of elements stored before the first object */
11386 INT_PTR i, *ptr = (INT_PTR *)this-1;
11388 for(i=*ptr-1; i>=0; i--)
11389 basic_stringstream_char_vbase_dtor(this+i);
11390 MSVCRT_operator_delete(ptr);
11391 } else {
11392 basic_stringstream_char_vbase_dtor(this);
11393 if(flags & 1)
11394 MSVCRT_operator_delete(this);
11397 return this;
11400 /* ?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 */
11401 /* ?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 */
11402 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
11403 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
11405 TRACE("(%p)\n", this);
11406 return (basic_stringbuf_char*)&this->strbuf;
11409 /* ?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 */
11410 /* ?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 */
11411 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
11412 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
11414 TRACE("(%p %p)\n", this, str);
11415 basic_stringbuf_char_str_set(&this->strbuf, str);
11418 /* ?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 */
11419 /* ?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 */
11420 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
11421 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
11423 TRACE("(%p %p)\n", this, ret);
11424 return basic_stringbuf_char_str_get(&this->strbuf, ret);
11427 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
11429 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
11432 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11434 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
11437 /* ??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 */
11438 /* ??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 */
11439 static basic_stringstream_wchar* basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
11440 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11442 basic_ios_wchar *basic_ios;
11444 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
11446 if(virt_init) {
11447 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
11448 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
11449 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11450 basic_ios_wchar_ctor(basic_ios);
11451 }else {
11452 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11455 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
11456 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
11457 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
11458 return this;
11461 /* ??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 */
11462 /* ??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 */
11463 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
11464 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
11465 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
11467 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
11468 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
11469 return this;
11472 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
11473 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
11474 static basic_stringstream_wchar* basic_stringstream_wchar_ctor_mode(
11475 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
11477 basic_ios_wchar *basic_ios;
11479 TRACE("(%p %d %d)\n", this, mode, virt_init);
11481 if(virt_init) {
11482 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
11483 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
11484 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11485 basic_ios_wchar_ctor(basic_ios);
11486 }else {
11487 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11490 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
11491 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
11492 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
11493 return this;
11496 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
11497 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
11498 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
11499 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
11500 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
11502 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
11503 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
11504 return this;
11507 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11508 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11509 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 8)
11510 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
11511 basic_stringstream_wchar *this, MSVCP_bool virt_init)
11513 return basic_stringstream_short_ctor_mode(
11514 this, OPENMODE_out|OPENMODE_in, virt_init);
11517 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
11518 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
11519 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
11520 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
11521 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
11522 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
11524 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
11526 TRACE("(%p)\n", this);
11528 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
11529 basic_stringbuf_wchar_dtor(&this->strbuf);
11532 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
11533 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
11534 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
11535 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
11536 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
11537 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
11539 TRACE("(%p)\n", this);
11541 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
11542 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
11545 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
11546 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11548 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
11550 TRACE("(%p %x)\n", this, flags);
11552 if(flags & 2) {
11553 /* we have an array, with the number of elements stored before the first object */
11554 INT_PTR i, *ptr = (INT_PTR *)this-1;
11556 for(i=*ptr-1; i>=0; i--)
11557 basic_stringstream_wchar_vbase_dtor(this+i);
11558 MSVCRT_operator_delete(ptr);
11559 } else {
11560 basic_stringstream_wchar_vbase_dtor(this);
11561 if(flags & 1)
11562 MSVCRT_operator_delete(this);
11565 return this;
11568 /* ?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 */
11569 /* ?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 */
11570 /* ?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 */
11571 /* ?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 */
11572 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
11573 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
11575 TRACE("(%p)\n", this);
11576 return (basic_stringbuf_wchar*)&this->strbuf;
11579 /* ?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 */
11580 /* ?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 */
11581 /* ?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 */
11582 /* ?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 */
11583 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
11584 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
11586 TRACE("(%p %p)\n", this, str);
11587 basic_stringbuf_wchar_str_set(&this->strbuf, str);
11590 /* ?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 */
11591 /* ?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 */
11592 /* ?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 */
11593 /* ?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 */
11594 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
11595 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
11597 TRACE("(%p %p)\n", this, ret);
11598 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
11601 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
11602 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
11603 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
11604 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
11606 TRACE("(%p %ld %p %p %d)\n", this, len, g, p, mode);
11608 this->minsize = 32;
11609 this->endsave = NULL;
11610 this->strmode = mode;
11611 this->palloc = NULL;
11612 this->pfree = NULL;
11614 if(!g) {
11615 this->strmode |= STRSTATE_Dynamic;
11616 if(len > this->minsize)
11617 this->minsize = len;
11618 this->seekhigh = NULL;
11619 return;
11622 if(len < 0)
11623 len = INT_MAX;
11624 else if(!len)
11625 len = strlen(g);
11627 this->seekhigh = g+len;
11628 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
11629 if(p)
11630 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
11633 /* ??0strstreambuf@std@@QAE@PACH0@Z */
11634 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
11635 /* ??0strstreambuf@std@@QAE@PADH0@Z */
11636 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
11637 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
11638 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
11639 static strstreambuf* strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
11641 TRACE("(%p %p %ld %p)\n", this, g, len, p);
11643 basic_streambuf_char_ctor(&this->base);
11644 this->base.vtable = &MSVCP_strstreambuf_vtable;
11646 strstreambuf__Init(this, len, g, p, 0);
11647 return this;
11650 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
11651 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
11652 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
11653 void __thiscall strstreambuf__Tidy(strstreambuf *this)
11655 TRACE("(%p)\n", this);
11657 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
11658 if(this->pfree)
11659 this->pfree(basic_streambuf_char_eback(&this->base));
11660 else
11661 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
11664 this->endsave = NULL;
11665 this->seekhigh = NULL;
11666 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
11667 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
11668 basic_streambuf_char_setp(&this->base, NULL, NULL);
11671 /* ??1strstreambuf@std@@UAE@XZ */
11672 /* ??1strstreambuf@std@@UEAA@XZ */
11673 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
11674 void __thiscall strstreambuf_dtor(strstreambuf *this)
11676 TRACE("(%p)\n", this);
11678 strstreambuf__Tidy(this);
11679 basic_streambuf_char_dtor(&this->base);
11682 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
11683 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
11685 TRACE("(%p %x)\n", this, flags);
11686 if(flags & 2) {
11687 /* we have an array, with the number of elements stored before the first object */
11688 INT_PTR i, *ptr = (INT_PTR *)this-1;
11690 for(i=*ptr-1; i>=0; i--)
11691 strstreambuf_dtor(this+i);
11692 MSVCRT_operator_delete(ptr);
11693 } else {
11694 strstreambuf_dtor(this);
11695 if(flags & 1)
11696 MSVCRT_operator_delete(this);
11699 return this;
11702 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
11703 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
11704 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
11705 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
11707 TRACE("(%p %d)\n", this, freeze);
11709 if(!freeze == !(this->strmode *STRSTATE_Frozen))
11710 return;
11712 if(freeze) {
11713 this->strmode |= STRSTATE_Frozen;
11714 this->endsave = basic_streambuf_char_epptr(&this->base);
11715 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
11716 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
11717 }else {
11718 this->strmode &= ~STRSTATE_Frozen;
11719 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
11720 basic_streambuf_char_pptr(&this->base), this->endsave);
11724 /* ?overflow@strstreambuf@std@@MAEHH@Z */
11725 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
11726 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
11727 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
11729 MSVCP_size_t old_size, size;
11730 char *ptr, *buf;
11732 TRACE("(%p %d)\n", this, c);
11734 if(c == EOF)
11735 return !EOF;
11737 if(this->strmode & STRSTATE_Frozen)
11738 return EOF;
11740 ptr = basic_streambuf_char_pptr(&this->base);
11741 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
11742 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
11744 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
11745 return EOF;
11747 ptr = basic_streambuf_char_eback(&this->base);
11748 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
11750 size = old_size + old_size/2;
11751 if(size < this->minsize)
11752 size = this->minsize;
11754 if(this->palloc)
11755 buf = this->palloc(size);
11756 else
11757 buf = MSVCRT_operator_new(size);
11758 if(!buf)
11759 return EOF;
11761 memcpy(buf, ptr, old_size);
11762 if(this->strmode & STRSTATE_Allocated) {
11763 if(this->pfree)
11764 this->pfree(ptr);
11765 else
11766 MSVCRT_operator_delete(ptr);
11769 this->strmode |= STRSTATE_Allocated;
11770 if(!old_size) {
11771 this->seekhigh = buf;
11772 basic_streambuf_char_setp(&this->base, buf, buf+size);
11773 basic_streambuf_char_setg(&this->base, buf, buf, buf);
11774 }else {
11775 this->seekhigh = this->seekhigh-ptr+buf;
11776 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
11777 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
11778 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
11779 basic_streambuf_char_pptr(&this->base));
11782 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
11785 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
11786 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
11787 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
11788 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
11790 char *ptr = basic_streambuf_char_gptr(&this->base);
11792 TRACE("(%p %d)\n", this, c);
11794 if(ptr<=basic_streambuf_char_eback(&this->base)
11795 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
11796 return EOF;
11798 basic_streambuf_char_gbump(&this->base, -1);
11799 if(c == EOF)
11800 return !EOF;
11801 if(this->strmode & STRSTATE_Constant)
11802 return (unsigned char)c;
11804 return (unsigned char)(ptr[0] = c);
11807 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
11808 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
11809 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
11810 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
11812 char *eback = basic_streambuf_char_eback(&this->base);
11813 char *pptr = basic_streambuf_char_pptr(&this->base);
11814 char *gptr = basic_streambuf_char_gptr(&this->base);
11816 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
11818 ret->off = 0;
11819 ret->state = 0;
11821 if(pptr > this->seekhigh)
11822 this->seekhigh = pptr;
11824 if((mode & OPENMODE_in) && gptr) {
11825 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
11826 off += gptr-eback;
11827 else if(way == SEEKDIR_end)
11828 off += this->seekhigh-eback;
11829 else if(way != SEEKDIR_beg)
11830 off = -1;
11832 if(off<0 || off>this->seekhigh-eback) {
11833 off = -1;
11834 }else {
11835 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
11836 if((mode & OPENMODE_out) && pptr) {
11837 basic_streambuf_char_setp_next(&this->base, eback,
11838 gptr, basic_streambuf_char_epptr(&this->base));
11841 }else if((mode & OPENMODE_out) && pptr) {
11842 if(way == SEEKDIR_cur)
11843 off += pptr-eback;
11844 else if(way == SEEKDIR_end)
11845 off += this->seekhigh-eback;
11846 else if(way != SEEKDIR_beg)
11847 off = -1;
11849 if(off<0 || off>this->seekhigh-eback)
11850 off = -1;
11851 else
11852 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
11853 }else {
11854 off = -1;
11857 ret->pos = off;
11858 return ret;
11861 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
11862 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
11863 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
11864 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
11866 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
11868 if(pos.off==0 && pos.pos==-1 && pos.state==0) {
11869 *ret = pos;
11870 return ret;
11873 return strstreambuf_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
11876 /* ?underflow@strstreambuf@std@@MAEHXZ */
11877 /* ?underflow@strstreambuf@std@@MEAAHXZ */
11878 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
11879 int __thiscall strstreambuf_underflow(strstreambuf *this)
11881 char *gptr = basic_streambuf_char_gptr(&this->base);
11882 char *pptr;
11884 TRACE("(%p)\n", this);
11886 if(!gptr)
11887 return EOF;
11889 if(gptr < basic_streambuf_char_egptr(&this->base))
11890 return (unsigned char)(*gptr);
11892 pptr = basic_streambuf_char_gptr(&this->base);
11893 if(pptr > this->seekhigh)
11894 this->seekhigh = pptr;
11896 if(this->seekhigh <= gptr)
11897 return EOF;
11899 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
11900 gptr, this->seekhigh);
11901 return (unsigned char)(*gptr);
11904 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
11906 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
11909 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
11911 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
11914 /* ??0ostrstream@std@@QAE@PADHH@Z */
11915 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
11916 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
11918 basic_ios_char *basic_ios;
11920 TRACE("(%p %p %ld %d %d)\n", this, buf, size, mode, virt_init);
11922 if(virt_init) {
11923 this->base.vbtable = ostrstream_vbtable;
11924 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11925 basic_ios_char_ctor(basic_ios);
11926 }else {
11927 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11930 strstreambuf_ctor_get_put(&this->buf, buf, size,
11931 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
11932 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, FALSE);
11933 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
11934 return this;
11937 /* ??1ostrstream@std@@UAE@XZ */
11938 /* ??1ostrstream@std@@UEAA@XZ */
11939 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
11940 void __thiscall ostrstream_dtor(basic_ios_char *base)
11942 ostrstream *this = ostrstream_from_basic_ios(base);
11944 TRACE("(%p)\n", this);
11946 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
11947 strstreambuf_dtor(&this->buf);
11950 static void ostrstream_vbase_dtor(ostrstream *this)
11952 TRACE("(%p)\n", this);
11954 ostrstream_dtor(ostrstream_to_basic_ios(this));
11955 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
11958 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
11959 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
11961 ostrstream *this = ostrstream_from_basic_ios(base);
11963 TRACE("(%p %x)\n", this, flags);
11965 if(flags & 2) {
11966 /* we have an array, with the number of elements stored before the first object */
11967 INT_PTR i, *ptr = (INT_PTR *)this-1;
11969 for(i=*ptr-1; i>=0; i--)
11970 ostrstream_vbase_dtor(this+i);
11971 MSVCRT_operator_delete(ptr);
11972 } else {
11973 ostrstream_vbase_dtor(this);
11974 if(flags & 1)
11975 MSVCRT_operator_delete(this);
11978 return this;
11981 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
11983 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
11986 /* ??1istrstream@std@@UAE@XZ */
11987 /* ??1istrstream@std@@UEAA@XZ */
11988 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
11989 void __thiscall istrstream_dtor(basic_ios_char *base)
11991 istrstream *this = istrstream_from_basic_ios(base);
11993 TRACE("(%p)\n", this);
11995 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11996 strstreambuf_dtor(&this->buf);
11999 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
12001 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
12004 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
12006 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
12009 /* ??0strstream@std@@QAE@PADHH@Z */
12010 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
12011 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
12012 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
12014 basic_ios_char *basic_ios;
12016 TRACE("(%p %p %ld %d %d)\n", this, buf, size, mode, virt_init);
12018 if(virt_init) {
12019 this->base.base1.vbtable = strstream_vbtable1;
12020 this->base.base2.vbtable = strstream_vbtable2;
12021 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12022 basic_ios_char_ctor(basic_ios);
12023 }else {
12024 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12027 strstreambuf_ctor_get_put(&this->buf, buf, size,
12028 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
12029 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
12030 basic_ios->base.vtable = &MSVCP_strstream_vtable;
12031 return this;
12034 /* ??1strstream@std@@UAE@XZ */
12035 /* ??1strstream@std@@UEAA@XZ */
12036 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
12037 void __thiscall strstream_dtor(basic_ios_char *base)
12039 strstream *this = strstream_from_basic_ios(base);
12041 TRACE("(%p)\n", this);
12043 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12044 strstreambuf_dtor(&this->buf);
12047 static void strstream_vbase_dtor(strstream *this)
12049 TRACE("(%p)\n", this);
12051 strstream_dtor(strstream_to_basic_ios(this));
12052 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
12055 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
12056 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
12058 strstream *this = strstream_from_basic_ios(base);
12060 TRACE("(%p %x)\n", this, flags);
12062 if(flags & 2) {
12063 /* we have an array, with the number of elements stored before the first object */
12064 INT_PTR i, *ptr = (INT_PTR *)this-1;
12066 for(i=*ptr-1; i>=0; i--)
12067 strstream_vbase_dtor(this+i);
12068 MSVCRT_operator_delete(ptr);
12069 } else {
12070 strstream_vbase_dtor(this);
12071 if(flags & 1)
12072 MSVCRT_operator_delete(this);
12075 return this;
12078 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
12080 ios_base_precision_set(base, prec);
12083 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
12084 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
12085 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
12087 TRACE("(%p %ld)\n", ret, prec);
12089 ret->pfunc = setprecision_func;
12090 ret->arg = prec;
12091 return ret;
12094 static void __cdecl setw_func(ios_base *base, streamsize width)
12096 ios_base_width_set(base, width);
12099 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
12100 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
12101 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
12103 TRACE("(%p %ld)\n", ret, width);
12105 ret->pfunc = setw_func;
12106 ret->arg = width;
12107 return ret;
12110 static void __cdecl resetioflags_func(ios_base *base, int mask)
12112 ios_base_setf_mask(base, 0, mask);
12115 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
12116 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
12118 TRACE("(%p %d)\n", ret, mask);
12120 ret->pfunc = resetioflags_func;
12121 ret->arg = mask;
12122 return ret;
12125 static void __cdecl setiosflags_func(ios_base *base, int mask)
12127 ios_base_setf_mask(base, FMTFLAG_mask, mask);
12130 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
12131 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
12133 TRACE("(%p %d)\n", ret, mask);
12135 ret->pfunc = setiosflags_func;
12136 ret->arg = mask;
12137 return ret;
12140 static void __cdecl setbase_func(ios_base *base, int set_base)
12142 if(set_base == 10)
12143 set_base = FMTFLAG_dec;
12144 else if(set_base == 8)
12145 set_base = FMTFLAG_oct;
12146 else if(set_base == 16)
12147 set_base = FMTFLAG_hex;
12148 else
12149 set_base = 0;
12151 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
12154 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
12155 manip_int* __cdecl setbase(manip_int *ret, int base)
12157 TRACE("(%p %d)\n", ret, base);
12159 ret->pfunc = setbase_func;
12160 ret->arg = base;
12161 return ret;
12164 static basic_filebuf_char filebuf_char_stdin;
12165 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
12166 struct {
12167 basic_istream_char obj;
12168 basic_ios_char vbase;
12169 } cin = { { 0 } };
12170 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
12171 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
12172 basic_istream_char *_Ptr_cin = &cin.obj;
12174 static basic_filebuf_wchar filebuf_short_stdin;
12175 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
12176 struct {
12177 basic_istream_wchar obj;
12178 basic_ios_wchar vbase;
12179 } ucin = { { 0 } };
12180 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
12181 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
12182 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
12184 static basic_filebuf_wchar filebuf_wchar_stdin;
12185 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
12186 struct {
12187 basic_istream_wchar obj;
12188 basic_ios_wchar vbase;
12189 } wcin = { { 0 } };
12190 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
12191 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
12192 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
12194 static basic_filebuf_char filebuf_char_stdout;
12195 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12196 struct {
12197 basic_ostream_char obj;
12198 basic_ios_char vbase;
12199 } cout = { { 0 } };
12200 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12201 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
12202 basic_ostream_char *_Ptr_cout = &cout.obj;
12204 static basic_filebuf_wchar filebuf_short_stdout;
12205 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12206 struct {
12207 basic_ostream_wchar obj;
12208 basic_ios_wchar vbase;
12209 } ucout = { { 0 } };
12210 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12211 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
12212 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
12214 static basic_filebuf_wchar filebuf_wchar_stdout;
12215 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12216 struct {
12217 basic_ostream_wchar obj;
12218 basic_ios_wchar vbase;
12219 } wcout = { { 0 } };
12220 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12221 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
12222 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
12224 static basic_filebuf_char filebuf_char_stderr;
12225 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12226 struct {
12227 basic_ostream_char obj;
12228 basic_ios_char vbase;
12229 } cerr = { { 0 } };
12230 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12231 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
12232 basic_ostream_char *_Ptr_cerr = &cerr.obj;
12234 static basic_filebuf_wchar filebuf_short_stderr;
12235 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12236 struct {
12237 basic_ostream_wchar obj;
12238 basic_ios_wchar vbase;
12239 } ucerr = { { 0 } };
12240 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12241 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
12242 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
12244 static basic_filebuf_wchar filebuf_wchar_stderr;
12245 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12246 struct {
12247 basic_ostream_wchar obj;
12248 basic_ios_wchar vbase;
12249 } wcerr = { { 0 } };
12250 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12251 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
12252 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
12254 static basic_filebuf_char filebuf_char_log;
12255 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12256 struct {
12257 basic_ostream_char obj;
12258 basic_ios_char vbase;
12259 } clog = { { 0 } };
12260 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
12261 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
12262 basic_ostream_char *_Ptr_clog = &clog.obj;
12264 static basic_filebuf_wchar filebuf_short_log;
12265 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12266 struct {
12267 basic_ostream_wchar obj;
12268 basic_ios_wchar vbase;
12269 } uclog = { { 0 } };
12270 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
12271 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
12272 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
12274 static basic_filebuf_wchar filebuf_wchar_log;
12275 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12276 struct {
12277 basic_ostream_wchar obj;
12278 basic_ios_wchar vbase;
12279 } wclog = { { 0 } };
12280 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
12281 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
12282 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
12284 /* ?_Init_cnt@Init@ios_base@std@@0HA */
12285 int ios_base_Init__Init_cnt = -1;
12287 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
12288 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
12289 static void ios_base_Init__Init_ctor(void *this)
12291 TRACE("(%p)\n", this);
12293 if(ios_base_Init__Init_cnt < 0)
12294 ios_base_Init__Init_cnt = 1;
12295 else
12296 ios_base_Init__Init_cnt++;
12299 /* ??0Init@ios_base@std@@QAE@XZ */
12300 /* ??0Init@ios_base@std@@QEAA@XZ */
12301 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
12302 void* __thiscall ios_base_Init_ctor(void *this)
12304 ios_base_Init__Init_ctor(this);
12305 return this;
12308 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
12309 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
12310 static void ios_base_Init__Init_dtor(void *this)
12312 TRACE("(%p)\n", this);
12314 ios_base_Init__Init_cnt--;
12315 if(!ios_base_Init__Init_cnt) {
12316 basic_ostream_char_flush(&cout.obj);
12317 basic_ostream_char_flush(&cerr.obj);
12318 basic_ostream_char_flush(&clog.obj);
12322 /* ??1Init@ios_base@std@@QAE@XZ */
12323 /* ??1Init@ios_base@std@@QEAA@XZ */
12324 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
12325 void __thiscall ios_base_Init_dtor(void *this)
12327 ios_base_Init__Init_dtor(this);
12330 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
12331 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
12332 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
12333 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
12335 TRACE("(%p %p)\n", this, rhs);
12336 return this;
12339 /* ?_Init_cnt@_Winit@std@@0HA */
12340 int _Winit__Init_cnt = -1;
12342 /* ??0_Winit@std@@QAE@XZ */
12343 /* ??0_Winit@std@@QEAA@XZ */
12344 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
12345 void* __thiscall _Winit_ctor(void *this)
12347 TRACE("(%p)\n", this);
12349 if(_Winit__Init_cnt < 0)
12350 _Winit__Init_cnt = 1;
12351 else
12352 _Winit__Init_cnt++;
12354 return this;
12357 /* ??1_Winit@std@@QAE@XZ */
12358 /* ??1_Winit@std@@QAE@XZ */
12359 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
12360 void __thiscall _Winit_dtor(void *this)
12362 TRACE("(%p)\n", this);
12364 _Winit__Init_cnt--;
12365 if(!_Winit__Init_cnt) {
12366 basic_ostream_wchar_flush(&wcout.obj);
12367 basic_ostream_wchar_flush(&wcerr.obj);
12368 basic_ostream_wchar_flush(&wclog.obj);
12372 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
12373 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
12374 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
12375 void* __thiscall _Winit_op_assign(void *this, void *rhs)
12377 TRACE("(%p %p)\n", this, rhs);
12378 return this;
12381 void init_io(void *base)
12383 #ifdef __x86_64__
12384 init_iosb_rtti(base);
12385 init_ios_base_rtti(base);
12386 init_basic_ios_char_rtti(base);
12387 init_basic_ios_wchar_rtti(base);
12388 init_basic_ios_short_rtti(base);
12389 init_basic_streambuf_char_rtti(base);
12390 init_basic_streambuf_wchar_rtti(base);
12391 init_basic_streambuf_short_rtti(base);
12392 init_basic_filebuf_char_rtti(base);
12393 init_basic_filebuf_wchar_rtti(base);
12394 init_basic_filebuf_short_rtti(base);
12395 init_basic_stringbuf_char_rtti(base);
12396 init_basic_stringbuf_wchar_rtti(base);
12397 init_basic_stringbuf_short_rtti(base);
12398 init_basic_ostream_char_rtti(base);
12399 init_basic_ostream_wchar_rtti(base);
12400 init_basic_ostream_short_rtti(base);
12401 init_basic_istream_char_rtti(base);
12402 init_basic_istream_wchar_rtti(base);
12403 init_basic_istream_short_rtti(base);
12404 init_basic_iostream_char_rtti(base);
12405 init_basic_iostream_wchar_rtti(base);
12406 init_basic_iostream_short_rtti(base);
12407 init_basic_ofstream_char_rtti(base);
12408 init_basic_ofstream_wchar_rtti(base);
12409 init_basic_ofstream_short_rtti(base);
12410 init_basic_ifstream_char_rtti(base);
12411 init_basic_ifstream_wchar_rtti(base);
12412 init_basic_ifstream_short_rtti(base);
12413 init_basic_fstream_char_rtti(base);
12414 init_basic_fstream_wchar_rtti(base);
12415 init_basic_fstream_short_rtti(base);
12416 init_basic_ostringstream_char_rtti(base);
12417 init_basic_ostringstream_wchar_rtti(base);
12418 init_basic_ostringstream_short_rtti(base);
12419 init_basic_istringstream_char_rtti(base);
12420 init_basic_istringstream_wchar_rtti(base);
12421 init_basic_istringstream_short_rtti(base);
12422 init_basic_stringstream_char_rtti(base);
12423 init_basic_stringstream_wchar_rtti(base);
12424 init_basic_stringstream_short_rtti(base);
12425 init_strstreambuf_rtti(base);
12426 init_strstream_rtti(base);
12427 init_ostrstream_rtti(base);
12428 #endif
12430 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
12431 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
12433 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
12434 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
12436 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
12437 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
12439 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
12440 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE);
12442 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
12443 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE);
12445 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
12446 basic_ostream_wchar_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE);
12448 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
12449 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE);
12451 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
12452 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE);
12454 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
12455 basic_ostream_wchar_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE);
12457 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
12458 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE);
12460 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
12461 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE);
12463 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
12464 basic_ostream_wchar_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE);
12467 void free_io(void)
12469 basic_istream_char_vbase_dtor(&cin.obj);
12470 basic_filebuf_char_dtor(&filebuf_char_stdin);
12472 basic_istream_wchar_vbase_dtor(&ucin.obj);
12473 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
12475 basic_istream_wchar_vbase_dtor(&wcin.obj);
12476 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
12478 basic_ostream_char_vbase_dtor(&cout.obj);
12479 basic_filebuf_char_dtor(&filebuf_char_stdout);
12481 basic_ostream_wchar_vbase_dtor(&ucout.obj);
12482 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
12484 basic_ostream_wchar_vbase_dtor(&wcout.obj);
12485 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
12487 basic_ostream_char_vbase_dtor(&cerr.obj);
12488 basic_filebuf_char_dtor(&filebuf_char_stderr);
12490 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
12491 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
12493 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
12494 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
12496 basic_ostream_char_vbase_dtor(&clog.obj);
12497 basic_filebuf_char_dtor(&filebuf_char_log);
12499 basic_ostream_wchar_vbase_dtor(&uclog.obj);
12500 basic_filebuf_wchar_dtor(&filebuf_short_log);
12502 basic_ostream_wchar_vbase_dtor(&wclog.obj);
12503 basic_filebuf_wchar_dtor(&filebuf_wchar_log);