include: Use the hard-float calling convention for Windows APIs on ARM
[wine.git] / dlls / msvcp90 / ios.c
blob5d2f0ca9c6c40a779a624e38348661a7b52ed59e
1 /*
2 * Copyright 2011 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include <limits.h>
24 #include <share.h>
26 #include "msvcp90.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winnls.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
34 #define SECSPERDAY 86400
35 /* 1601 to 1970 is 369 years plus 89 leap days */
36 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
37 #define TICKSPERSEC 10000000
38 #define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC)
40 #if _MSVCP_VER >= 140
41 FILE* __cdecl __acrt_iob_func(unsigned);
42 #undef stdin
43 #undef stdout
44 #undef stderr
45 #define stdin __acrt_iob_func(STDIN_FILENO)
46 #define stdout __acrt_iob_func(STDOUT_FILENO)
47 #define stderr __acrt_iob_func(STDERR_FILENO)
48 #endif
50 /* ?_Index@ios_base@std@@0HA */
51 int ios_base_Index = 0;
52 /* ?_Sync@ios_base@std@@0_NA */
53 MSVCP_bool ios_base_Sync = FALSE;
55 typedef struct {
56 streamoff off;
57 __int64 DECLSPEC_ALIGN(8) pos;
58 _Mbstatet state;
59 } fpos_mbstatet;
61 static inline const char* debugstr_fpos_mbstatet(fpos_mbstatet *fpos)
63 return wine_dbg_sprintf("fpos(%s %s %d)", wine_dbgstr_longlong(fpos->off),
64 wine_dbgstr_longlong(fpos->pos), MBSTATET_TO_INT(&fpos->state));
67 typedef struct {
68 void (__cdecl *pfunc)(ios_base*, streamsize);
69 streamsize arg;
70 } manip_streamsize;
72 typedef struct {
73 void (__cdecl *pfunc)(ios_base*, int);
74 int arg;
75 } manip_int;
77 typedef enum {
78 INITFL_new = 0,
79 INITFL_open = 1,
80 INITFL_close = 2
81 } basic_filebuf__Initfl;
83 typedef struct {
84 basic_streambuf_char base;
85 codecvt_char *cvt;
86 #if _MSVCP_VER < 80
87 int state0;
88 char putback;
89 basic_string_char *conv;
90 #else
91 char putback;
92 #endif
93 MSVCP_bool wrotesome;
94 _Mbstatet state;
95 MSVCP_bool close;
96 #if _MSVCP_VER == 70
97 locale loc;
98 #endif
99 FILE *file;
100 } basic_filebuf_char;
102 typedef struct {
103 basic_streambuf_wchar base;
104 codecvt_wchar *cvt;
105 #if _MSVCP_VER < 80
106 int state0;
107 wchar_t putback;
108 basic_string_char *conv;
109 #else
110 wchar_t putback;
111 #endif
112 MSVCP_bool wrotesome;
113 _Mbstatet state;
114 MSVCP_bool close;
115 #if _MSVCP_VER == 70
116 locale loc;
117 #endif
118 FILE *file;
119 } basic_filebuf_wchar;
121 typedef enum {
122 STRINGBUF_allocated = 1,
123 STRINGBUF_no_write = 2,
124 STRINGBUF_no_read = 4,
125 STRINGBUF_append = 8,
126 STRINGBUF_at_end = 16
127 } basic_stringbuf_state;
129 typedef struct {
130 basic_streambuf_char base;
131 char *seekhigh;
132 int state;
133 char allocator; /* empty struct */
134 } basic_stringbuf_char;
136 typedef struct {
137 basic_streambuf_wchar base;
138 wchar_t *seekhigh;
139 int state;
140 char allocator; /* empty struct */
141 } basic_stringbuf_wchar;
143 typedef struct {
144 ios_base base;
145 basic_streambuf_char *strbuf;
146 struct _basic_ostream_char *stream;
147 char fillch;
148 } basic_ios_char;
150 typedef struct {
151 ios_base base;
152 basic_streambuf_wchar *strbuf;
153 struct _basic_ostream_wchar *stream;
154 wchar_t fillch;
155 } basic_ios_wchar;
157 typedef struct _basic_ostream_char {
158 const int *vbtable;
159 /* virtual inheritance
160 * basic_ios_char basic_ios;
162 } basic_ostream_char;
164 typedef struct _basic_ostream_wchar {
165 const int *vbtable;
166 /* virtual inheritance
167 * basic_ios_wchar basic_ios;
169 } basic_ostream_wchar;
171 typedef struct {
172 const int *vbtable;
173 streamsize count;
174 /* virtual inheritance
175 * basic_ios_char basic_ios;
177 } basic_istream_char;
179 typedef struct {
180 const int *vbtable;
181 streamsize count;
182 /* virtual inheritance
183 * basic_ios_wchar basic_ios;
185 } basic_istream_wchar;
187 typedef struct {
188 basic_istream_char base1;
189 basic_ostream_char base2;
190 /* virtual inheritance
191 * basic_ios_char basic_ios;
193 } basic_iostream_char;
195 typedef struct {
196 basic_istream_wchar base1;
197 basic_ostream_wchar base2;
198 /* virtual inheritance
199 * basic_ios_wchar basic_ios;
201 } basic_iostream_wchar;
203 typedef struct {
204 basic_ostream_char base;
205 basic_filebuf_char filebuf;
206 /* virtual inheritance
207 * basic_ios_char basic_ios;
209 } basic_ofstream_char;
211 typedef struct {
212 basic_ostream_wchar base;
213 basic_filebuf_wchar filebuf;
214 /* virtual inheritance
215 * basic_ios_wchar basic_ios;
217 } basic_ofstream_wchar;
219 typedef struct {
220 basic_istream_char base;
221 basic_filebuf_char filebuf;
222 /* virtual inheritance
223 * basic_ios_char basic_ios;
225 } basic_ifstream_char;
227 typedef struct {
228 basic_istream_wchar base;
229 basic_filebuf_wchar filebuf;
230 /* virtual inheritance
231 * basic_ios_wchar basic_ios;
233 } basic_ifstream_wchar;
235 typedef struct {
236 basic_iostream_char base;
237 basic_filebuf_char filebuf;
238 /* virtual inheritance
239 * basic_ios_char basic_ios;
241 } basic_fstream_char;
243 typedef struct {
244 basic_iostream_wchar base;
245 basic_filebuf_wchar filebuf;
246 /* virtual inheritance
247 * basic_ios_char basic_ios;
249 } basic_fstream_wchar;
251 typedef struct {
252 basic_ostream_char base;
253 basic_stringbuf_char strbuf;
254 /* virtual inheritance
255 * basic_ios_char basic_ios;
257 } basic_ostringstream_char;
259 typedef struct {
260 basic_ostream_wchar base;
261 basic_stringbuf_wchar strbuf;
262 /* virtual inheritance
263 * basic_ios_wchar basic_ios;
265 } basic_ostringstream_wchar;
267 typedef struct {
268 basic_istream_char base;
269 basic_stringbuf_char strbuf;
270 /* virtual inheritance
271 * basic_ios_char basic_ios;
273 } basic_istringstream_char;
275 typedef struct {
276 basic_istream_wchar base;
277 basic_stringbuf_wchar strbuf;
278 /* virtual inheritance
279 * basic_ios_wchar basic_ios;
281 } basic_istringstream_wchar;
283 typedef struct {
284 basic_iostream_char base;
285 basic_stringbuf_char strbuf;
286 /* virtual inheritance
287 * basic_ios_char basic_ios;
289 } basic_stringstream_char;
291 typedef struct {
292 basic_iostream_wchar base;
293 basic_stringbuf_wchar strbuf;
294 /* virtual inheritance
295 * basic_ios_wchar basic_ios;
297 } basic_stringstream_wchar;
299 typedef enum {
300 STRSTATE_Allocated = 1,
301 STRSTATE_Constant = 2,
302 STRSTATE_Dynamic = 4,
303 STRSTATE_Frozen = 8
304 } strstreambuf__Strstate;
306 typedef struct {
307 basic_streambuf_char base;
308 streamsize minsize;
309 char *endsave;
310 char *seekhigh;
311 int strmode;
312 void* (__cdecl *palloc)(MSVCP_size_t);
313 void (__cdecl *pfree)(void*);
314 } strstreambuf;
316 typedef struct {
317 basic_ostream_char base;
318 strstreambuf buf;
319 /* virtual inheritance
320 * basic_ios_char basic_ios;
322 } ostrstream;
324 typedef struct {
325 basic_istream_char base;
326 strstreambuf buf;
327 /* virtual inheritance
328 * basic_ios_char basic_ios;
330 } istrstream;
332 typedef struct {
333 basic_iostream_char base;
334 strstreambuf buf;
335 /* virtual inheritance
336 * basic_ios_char basic_ios;
338 } strstream;
340 struct space_info {
341 ULONGLONG capacity;
342 ULONGLONG free;
343 ULONGLONG available;
346 enum file_type {
347 #if _MSVCP_VER < 140
348 status_unknown,
349 file_not_found,
350 #else
351 file_not_found = -1,
352 none_file,
353 #endif
354 regular_file,
355 directory_file,
356 symlink_file,
357 block_file,
358 character_file,
359 fifo_file,
360 socket_file,
361 #if _MSVCP_VER < 140
362 type_unknown,
363 #else
364 status_unknown
365 #endif
368 #if _MSVCP_VER >= 110
369 #define BASIC_IOS_VTORDISP 1
370 #define INIT_BASIC_IOS_VTORDISP(basic_ios) ((int*)basic_ios)[-1] = 0
371 #else
372 #define BASIC_IOS_VTORDISP 0
373 #define INIT_BASIC_IOS_VTORDISP(basic_ios)
374 #endif
376 #define VBTABLE_ENTRY(class, offset, vbase, vtordisp) ALIGNED_SIZE(sizeof(class)+vtordisp*sizeof(int), TYPE_ALIGNMENT(vbase))-offset
377 #define VBTABLE_BASIC_IOS_ENTRY(class, offset) VBTABLE_ENTRY(class, offset, basic_ios_char, BASIC_IOS_VTORDISP)
379 extern const vtable_ptr MSVCP_iosb_vtable;
381 /* ??_7ios_base@std@@6B@ */
382 extern const vtable_ptr MSVCP_ios_base_vtable;
384 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
385 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
387 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
388 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
390 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
391 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
393 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
394 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
396 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
397 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
399 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
400 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
402 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
403 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
405 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
406 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
408 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
409 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
411 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
412 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
414 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
415 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
417 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
418 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
420 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
421 const int basic_ostream_char_vbtable[] = {0,
422 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)};
423 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
424 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
426 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
427 const int basic_ostream_wchar_vbtable[] = {0,
428 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)};
429 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
430 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
432 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
433 const int basic_ostream_short_vbtable[] = {0,
434 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)};
435 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
436 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
438 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
439 const int basic_istream_char_vbtable[] = {0,
440 VBTABLE_BASIC_IOS_ENTRY(basic_istream_char, 0)};
441 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
442 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
444 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
445 const int basic_istream_wchar_vbtable[] = {0,
446 VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)};
447 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
448 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
450 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
451 const int basic_istream_short_vbtable[] = {0,
452 VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)};
453 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
454 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
456 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
457 const int basic_iostream_char_vbtable1[] = {0,
458 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_char, 0)};
459 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
460 const int basic_iostream_char_vbtable2[] = {0,
461 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_char, FIELD_OFFSET(basic_iostream_char, base2))};
462 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
463 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
465 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
466 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
467 const int basic_iostream_wchar_vbtable1[] = {0,
468 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_wchar, 0)};
469 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
470 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
471 const int basic_iostream_wchar_vbtable2[] = {0,
472 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_wchar, FIELD_OFFSET(basic_iostream_wchar, base2))};
473 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
474 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
475 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
476 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
478 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
479 const int basic_ofstream_char_vbtable[] = {0,
480 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_char, 0)};
481 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
482 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
484 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
485 const int basic_ofstream_wchar_vbtable[] = {0,
486 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_wchar, 0)};
487 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
488 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
490 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
491 const int basic_ofstream_short_vbtable[] = {0,
492 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_wchar, 0)};
493 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
494 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
496 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
497 const int basic_ifstream_char_vbtable[] = {0,
498 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_char, 0)};
499 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
500 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
502 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
503 const int basic_ifstream_wchar_vbtable[] = {0,
504 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_wchar, 0)};
505 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
506 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
508 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
509 const int basic_ifstream_short_vbtable[] = {0,
510 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_wchar, 0)};
511 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
512 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
514 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
515 const int basic_fstream_char_vbtable1[] = {0,
516 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_char, 0)};
517 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
518 const int basic_fstream_char_vbtable2[] = {0,
519 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_char, FIELD_OFFSET(basic_fstream_char, base.base2))};
520 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
521 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
523 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
524 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
525 const int basic_fstream_wchar_vbtable1[] = {0,
526 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_wchar, 0)};
527 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
528 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
529 const int basic_fstream_wchar_vbtable2[] = {0,
530 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_wchar, FIELD_OFFSET(basic_fstream_wchar, base.base2))};
531 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
532 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
533 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
534 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
536 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
537 const int basic_ostringstream_char_vbtable[] = {0,
538 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_char, 0)};
539 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
540 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
542 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
543 const int basic_ostringstream_wchar_vbtable[] = {0,
544 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_wchar, 0)};
545 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
546 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
548 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
549 const int basic_ostringstream_short_vbtable[] = {0,
550 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_wchar, 0)};
551 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
552 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
554 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
555 const int basic_istringstream_char_vbtable[] = {0,
556 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_char, 0)};
557 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
558 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
560 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
561 const int basic_istringstream_wchar_vbtable[] = {0,
562 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_wchar, 0)};
563 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
564 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
566 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
567 const int basic_istringstream_short_vbtable[] = {0,
568 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_wchar, 0)};
569 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
570 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
572 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
573 const int basic_stringstream_char_vbtable1[] = {0,
574 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_char, 0)};
575 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
576 const int basic_stringstream_char_vbtable2[] = {0,
577 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_char, FIELD_OFFSET(basic_stringstream_char, base.base2))};
578 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
579 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
581 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
582 const int basic_stringstream_wchar_vbtable1[] = {0,
583 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, 0)};
584 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
585 const int basic_stringstream_wchar_vbtable2[] = {0,
586 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, FIELD_OFFSET(basic_stringstream_wchar, base.base2))};
587 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
588 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
590 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
591 const int basic_stringstream_short_vbtable1[] = {0,
592 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, 0)};
593 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
594 const int basic_stringstream_short_vbtable2[] = {0,
595 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, FIELD_OFFSET(basic_stringstream_wchar, base.base2))};
596 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
597 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
599 /* ??_7strstreambuf@std@@6B */
600 extern const vtable_ptr MSVCP_strstreambuf_vtable;
602 static const int ostrstream_vbtable[] = {0, VBTABLE_BASIC_IOS_ENTRY(ostrstream, 0)};
603 extern const vtable_ptr MSVCP_ostrstream_vtable;
605 static const int istrstream_vbtable[] = {0, VBTABLE_BASIC_IOS_ENTRY(istrstream, 0)};
607 static const int strstream_vbtable1[] = {0, VBTABLE_BASIC_IOS_ENTRY(strstream, 0)};
608 static const int strstream_vbtable2[] = {0,
609 VBTABLE_BASIC_IOS_ENTRY(strstream, FIELD_OFFSET(strstream, base.base2))};
610 extern const vtable_ptr MSVCP_strstream_vtable;
612 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
613 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
614 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
615 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
616 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
617 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
618 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
619 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
620 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
621 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
622 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
623 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
624 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
625 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
626 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
627 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
628 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
629 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
630 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
631 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
632 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
633 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
634 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
635 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
636 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
637 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
638 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
639 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
640 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
641 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
642 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
643 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
644 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
645 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
646 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
647 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
648 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
649 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
650 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
651 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
652 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
653 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
654 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
655 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
656 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
657 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
658 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
659 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
660 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
661 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
662 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
663 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
664 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
665 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
666 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
667 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
668 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
669 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
670 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
671 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
672 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
673 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
674 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
675 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
676 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
677 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
678 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
679 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
680 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
681 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
682 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
683 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
684 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
685 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
686 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
687 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
688 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
689 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
690 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
691 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
692 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
693 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
694 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
695 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
696 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
697 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
698 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
699 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
700 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
701 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
702 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
703 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
704 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
705 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
706 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
707 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
708 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
709 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
710 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
711 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
712 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
713 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
714 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
715 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
716 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
717 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
718 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
719 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
720 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
721 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
722 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
723 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
724 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
725 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
726 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
727 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
728 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
729 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
730 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
731 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
732 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
733 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
734 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
735 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
736 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
737 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
738 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
739 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
740 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
741 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
742 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
743 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
744 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
745 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
746 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
747 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
748 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
749 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
750 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
751 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
752 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
753 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
754 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
755 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
756 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
757 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
758 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
759 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
760 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
761 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
762 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
763 "?AVostrstream@std@@")
764 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
765 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
766 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
767 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
768 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
769 "?AVstrstream@std@@")
771 #ifndef __GNUC__
772 void __asm_dummy_vtables(void) {
773 #endif
774 __ASM_VTABLE(iosb,
775 VTABLE_ADD_FUNC(iosb_vector_dtor));
776 __ASM_VTABLE(ios_base,
777 VTABLE_ADD_FUNC(ios_base_vector_dtor));
778 __ASM_VTABLE(basic_ios_char,
779 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor)
780 #if _MSVCP_VER == 110
781 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
782 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
783 #endif
785 __ASM_VTABLE(basic_ios_wchar,
786 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor)
787 #if _MSVCP_VER == 110
788 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
789 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
790 #endif
792 __ASM_VTABLE(basic_ios_short,
793 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor)
794 #if _MSVCP_VER == 110
795 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
796 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
797 #endif
799 __ASM_VTABLE(basic_streambuf_char,
800 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
801 #if _MSVCP_VER >= 100
802 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
803 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
804 #endif
805 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
806 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
807 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
808 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
809 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
810 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
811 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
812 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
813 #endif
814 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
815 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
816 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
817 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
818 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
819 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
820 __ASM_VTABLE(basic_streambuf_wchar,
821 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
822 #if _MSVCP_VER >= 100
823 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
824 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
825 #endif
826 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
827 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
828 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
829 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
830 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
831 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
832 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
833 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
834 #endif
835 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
836 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
837 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
838 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
839 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
840 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
841 __ASM_VTABLE(basic_streambuf_short,
842 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
843 #if _MSVCP_VER >= 100
844 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
845 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
846 #endif
847 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
848 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
849 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
850 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
851 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
852 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
853 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
854 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
855 #endif
856 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
857 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
858 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
859 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
860 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
861 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
862 __ASM_VTABLE(basic_filebuf_char,
863 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
864 #if _MSVCP_VER >= 100
865 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
866 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
867 #endif
868 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
869 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
870 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
871 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
872 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
873 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
874 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
875 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
876 #endif
877 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
878 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
879 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
880 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
881 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
882 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
883 __ASM_VTABLE(basic_filebuf_wchar,
884 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
885 #if _MSVCP_VER >= 100
886 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
887 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
888 #endif
889 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
890 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
891 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
892 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
893 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
894 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
895 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
896 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
897 #endif
898 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
899 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
900 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
901 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
902 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
903 VTABLE_ADD_FUNC(basic_filebuf_wchar_imbue));
904 __ASM_VTABLE(basic_filebuf_short,
905 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
906 #if _MSVCP_VER >= 100
907 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
908 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
909 #endif
910 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
911 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
912 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
913 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
914 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
915 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
916 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
917 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
918 #endif
919 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
920 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
921 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
922 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
923 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
924 VTABLE_ADD_FUNC(basic_filebuf_short_imbue));
925 __ASM_VTABLE(basic_stringbuf_char,
926 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
927 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
928 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
929 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
930 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
931 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
932 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
933 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
934 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
935 #endif
936 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
937 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
938 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
939 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
940 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
941 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
942 __ASM_VTABLE(basic_stringbuf_wchar,
943 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
944 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
945 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
946 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
947 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
948 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
949 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
950 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
951 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
952 #endif
953 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
954 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
955 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
956 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
957 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
958 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
959 __ASM_VTABLE(basic_stringbuf_short,
960 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
961 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
962 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
963 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
964 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
965 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
966 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
967 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
968 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
969 #endif
970 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
971 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
972 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
973 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
974 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
975 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
976 __ASM_VTABLE(basic_ostream_char,
977 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor)
978 #if _MSVCP_VER == 110
979 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
980 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
981 #endif
983 __ASM_VTABLE(basic_ostream_wchar,
984 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor)
985 #if _MSVCP_VER == 110
986 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
987 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
988 #endif
990 __ASM_VTABLE(basic_ostream_short,
991 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor)
992 #if _MSVCP_VER == 110
993 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
994 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
995 #endif
997 __ASM_VTABLE(basic_istream_char,
998 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor)
999 #if _MSVCP_VER == 110
1000 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1001 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1002 #endif
1004 __ASM_VTABLE(basic_istream_wchar,
1005 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor)
1006 #if _MSVCP_VER == 110
1007 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1008 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1009 #endif
1011 __ASM_VTABLE(basic_istream_short,
1012 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor)
1013 #if _MSVCP_VER == 110
1014 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1015 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1016 #endif
1018 __ASM_VTABLE(basic_iostream_char,
1019 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor)
1020 #if _MSVCP_VER == 110
1021 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1022 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1023 #endif
1025 __ASM_VTABLE(basic_iostream_wchar,
1026 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor)
1027 #if _MSVCP_VER == 110
1028 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1029 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1030 #endif
1032 __ASM_VTABLE(basic_iostream_short,
1033 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor)
1034 #if _MSVCP_VER == 110
1035 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1036 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1037 #endif
1039 __ASM_VTABLE(basic_ofstream_char,
1040 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor)
1041 #if _MSVCP_VER == 110
1042 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1043 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1044 #endif
1046 __ASM_VTABLE(basic_ofstream_wchar,
1047 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor)
1048 #if _MSVCP_VER == 110
1049 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1050 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1051 #endif
1053 __ASM_VTABLE(basic_ofstream_short,
1054 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor)
1055 #if _MSVCP_VER == 110
1056 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1057 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1058 #endif
1060 __ASM_VTABLE(basic_ifstream_char,
1061 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor)
1062 #if _MSVCP_VER == 110
1063 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1064 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1065 #endif
1067 __ASM_VTABLE(basic_ifstream_wchar,
1068 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor)
1069 #if _MSVCP_VER == 110
1070 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1071 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1072 #endif
1074 __ASM_VTABLE(basic_ifstream_short,
1075 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor)
1076 #if _MSVCP_VER == 110
1077 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1078 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1079 #endif
1081 __ASM_VTABLE(basic_fstream_char,
1082 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor)
1083 #if _MSVCP_VER == 110
1084 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1085 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1086 #endif
1088 __ASM_VTABLE(basic_fstream_wchar,
1089 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor)
1090 #if _MSVCP_VER == 110
1091 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1092 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1093 #endif
1095 __ASM_VTABLE(basic_fstream_short,
1096 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor)
1097 #if _MSVCP_VER == 110
1098 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1099 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1100 #endif
1102 __ASM_VTABLE(basic_ostringstream_char,
1103 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor)
1104 #if _MSVCP_VER == 110
1105 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1106 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1107 #endif
1109 __ASM_VTABLE(basic_ostringstream_wchar,
1110 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor)
1111 #if _MSVCP_VER == 110
1112 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1113 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1114 #endif
1116 __ASM_VTABLE(basic_ostringstream_short,
1117 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor)
1118 #if _MSVCP_VER == 110
1119 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1120 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1121 #endif
1123 __ASM_VTABLE(basic_istringstream_char,
1124 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor)
1125 #if _MSVCP_VER == 110
1126 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1127 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1128 #endif
1130 __ASM_VTABLE(basic_istringstream_wchar,
1131 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor)
1132 #if _MSVCP_VER == 110
1133 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1134 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1135 #endif
1137 __ASM_VTABLE(basic_istringstream_short,
1138 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor)
1139 #if _MSVCP_VER == 110
1140 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1141 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1142 #endif
1144 __ASM_VTABLE(basic_stringstream_char,
1145 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor)
1146 #if _MSVCP_VER == 110
1147 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1148 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1149 #endif
1151 __ASM_VTABLE(basic_stringstream_wchar,
1152 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor)
1153 #if _MSVCP_VER == 110
1154 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1155 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1156 #endif
1158 __ASM_VTABLE(basic_stringstream_short,
1159 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor)
1160 #if _MSVCP_VER == 110
1161 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1162 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1163 #endif
1165 __ASM_VTABLE(strstreambuf,
1166 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
1167 VTABLE_ADD_FUNC(strstreambuf_overflow)
1168 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
1169 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
1170 VTABLE_ADD_FUNC(strstreambuf_underflow)
1171 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
1172 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
1173 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1174 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
1175 #endif
1176 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
1177 VTABLE_ADD_FUNC(strstreambuf_seekoff)
1178 VTABLE_ADD_FUNC(strstreambuf_seekpos)
1179 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
1180 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
1181 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
1182 __ASM_VTABLE(ostrstream,
1183 VTABLE_ADD_FUNC(ostrstream_vector_dtor)
1184 #if _MSVCP_VER == 110
1185 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1186 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1187 #endif
1189 __ASM_VTABLE(strstream,
1190 VTABLE_ADD_FUNC(strstream_vector_dtor)
1191 #if _MSVCP_VER == 110
1192 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1193 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1194 #endif
1196 #ifndef __GNUC__
1198 #endif
1200 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1201 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1202 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
1203 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
1205 TRACE("(%p %p %p %p)\n", this, first, next, last);
1207 this->wbuf = first;
1208 this->wpos = next;
1209 this->wsize = last-next;
1212 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
1213 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
1214 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
1215 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
1217 basic_streambuf_char_setp_next(this, first, first, last);
1220 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1221 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1222 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
1223 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
1225 TRACE("(%p %p %p %p)\n", this, first, next, last);
1227 this->rbuf = first;
1228 this->rpos = next;
1229 this->rsize = last-next;
1232 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
1233 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
1234 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
1235 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
1237 TRACE("(%p)\n", this);
1239 this->prbuf = &this->rbuf;
1240 this->pwbuf = &this->wbuf;
1241 this->prpos = &this->rpos;
1242 this->pwpos = &this->wpos;
1243 this->prsize = &this->rsize;
1244 this->pwsize = &this->wsize;
1246 basic_streambuf_char_setp(this, NULL, NULL);
1247 basic_streambuf_char_setg(this, NULL, NULL, NULL);
1250 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1251 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1252 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
1253 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
1255 TRACE("(%p %d)\n", this, uninitialized);
1256 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1257 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1258 mutex_ctor(&this->lock);
1259 #endif
1260 return this;
1263 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
1264 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
1265 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
1266 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
1268 TRACE("(%p)\n", this);
1270 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1271 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1272 mutex_ctor(&this->lock);
1273 #endif
1274 #if _MSVCP_VER >= 70
1275 this->loc = MSVCRT_operator_new(sizeof(locale));
1276 #endif
1277 locale_ctor(IOS_LOCALE(this));
1278 basic_streambuf_char__Init_empty(this);
1280 return this;
1283 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
1284 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1285 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
1286 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
1288 TRACE("(%p)\n", this);
1290 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1291 mutex_dtor(&this->lock);
1292 #endif
1293 locale_dtor(IOS_LOCALE(this));
1294 #if _MSVCP_VER >= 70
1295 MSVCRT_operator_delete(this->loc);
1296 #endif
1299 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
1300 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
1302 TRACE("(%p %x)\n", this, flags);
1303 if(flags & 2) {
1304 /* we have an array, with the number of elements stored before the first object */
1305 INT_PTR i, *ptr = (INT_PTR *)this-1;
1307 for(i=*ptr-1; i>=0; i--)
1308 basic_streambuf_char_dtor(this+i);
1309 MSVCRT_operator_delete(ptr);
1310 } else {
1311 basic_streambuf_char_dtor(this);
1312 if(flags & 1)
1313 MSVCRT_operator_delete(this);
1316 return this;
1319 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1320 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1321 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
1322 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
1324 TRACE("(%p)\n", this);
1325 return *this->prpos ? *this->prsize : 0;
1328 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1329 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1330 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1331 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1333 TRACE("(%p)\n", this);
1334 (*this->prsize)++;
1335 (*this->prpos)--;
1336 return *this->prpos;
1339 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1340 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1341 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1342 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1344 TRACE("(%p)\n", this);
1345 (*this->prsize)--;
1346 return (*this->prpos)++;
1349 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1350 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1351 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1352 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1354 TRACE("(%p)\n", this);
1355 (*this->prsize)--;
1356 (*this->prpos)++;
1357 return *this->prpos;
1360 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1361 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1362 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1363 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1365 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1367 this->prbuf = gf;
1368 this->pwbuf = pf;
1369 this->prpos = gn;
1370 this->pwpos = pn;
1371 this->prsize = gc;
1372 this->pwsize = pc;
1375 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1376 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1377 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1378 #if _MSVCP_VER >= 100
1379 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1380 #else
1381 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1382 #endif
1383 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1385 TRACE("(%p)\n", this);
1386 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1387 mutex_lock(&this->lock);
1388 #endif
1391 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1392 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1393 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1394 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1396 TRACE("(%p)\n", this);
1397 return *this->pwpos ? *this->pwsize : 0;
1400 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1401 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1402 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1403 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1405 TRACE("(%p)\n", this);
1406 (*this->pwsize)--;
1407 return (*this->pwpos)++;
1410 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1411 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1412 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1413 #if _MSVCP_VER >= 100
1414 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1415 #else
1416 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1417 #endif
1418 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1420 TRACE("(%p)\n", this);
1421 return EOF;
1424 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1425 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1426 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1427 #if _MSVCP_VER >= 100
1428 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1429 #else
1430 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1431 #endif
1432 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1434 int ret;
1436 TRACE("(%p)\n", this);
1438 if(call_basic_streambuf_char_underflow(this)==EOF)
1439 return EOF;
1441 ret = (unsigned char)**this->prpos;
1442 (*this->prsize)--;
1443 (*this->prpos)++;
1444 return ret;
1447 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1448 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1449 #if STREAMSIZE_BITS == 64
1450 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1451 #else
1452 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1453 #endif
1454 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1455 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1456 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1457 #else
1458 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1459 #endif
1460 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1462 streamsize copied, chunk;
1463 int c;
1465 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1467 for(copied=0; copied<count && size;) {
1468 chunk = basic_streambuf_char__Gnavail(this);
1469 if(chunk > count-copied)
1470 chunk = count-copied;
1472 if(chunk > 0) {
1473 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1474 *this->prpos += chunk;
1475 *this->prsize -= chunk;
1476 copied += chunk;
1477 size -= chunk;
1478 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1479 ptr[copied] = c;
1480 copied++;
1481 size--;
1482 }else {
1483 break;
1487 return copied;
1490 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1491 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1492 #if STREAMSIZE_BITS == 64
1493 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1494 #else
1495 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1496 #endif
1497 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1499 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1500 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1503 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1504 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1505 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1506 #if _MSVCP_VER >= 100
1507 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1508 #else
1509 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1510 #endif
1511 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1513 TRACE("(%p)\n", this);
1514 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1515 mutex_unlock(&this->lock);
1516 #endif
1519 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1520 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1521 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1522 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1524 TRACE("(%p)\n", this);
1525 return *this->prbuf;
1528 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1529 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1530 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1531 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1533 TRACE("(%p)\n", this);
1534 return *this->prpos;
1537 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1538 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1539 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1540 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1542 TRACE("(%p)\n", this);
1543 return *this->prpos+*this->prsize;
1546 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1547 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1548 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1549 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1551 TRACE("(%p)\n", this);
1552 return *this->pwpos+*this->pwsize;
1555 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1556 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1557 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1558 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1560 TRACE("(%p %d)\n", this, off);
1561 *this->prpos += off;
1562 *this->prsize -= off;
1565 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@XZ */
1566 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1567 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@XZ */
1568 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1569 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1570 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
1572 TRACE("(%p)\n", this);
1573 return locale_copy_ctor(ret, IOS_LOCALE(this));
1576 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1577 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1578 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1579 #if _MSVCP_VER >= 100
1580 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_char*, const locale*), (this, loc))
1581 #elif _MSVCP_VER >= 80
1582 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_char*, const locale*), (this, loc))
1583 #else
1584 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_char*, const locale*), (this, loc))
1585 #endif
1586 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1588 TRACE("(%p %p)\n", this, loc);
1591 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1592 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1593 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1594 #if _MSVCP_VER >= 100
1595 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 12, int, (basic_streambuf_char*, int), (this, ch))
1596 #else
1597 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, int, (basic_streambuf_char*, int), (this, ch))
1598 #endif
1599 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1601 TRACE("(%p %d)\n", this, ch);
1602 return EOF;
1605 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1606 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1607 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1608 #if _MSVCP_VER >= 100
1609 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*, int), (this, ch))
1610 #else
1611 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, int, (basic_streambuf_char*, int), (this, ch))
1612 #endif
1613 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1615 TRACE("(%p %d)\n", this, ch);
1616 return EOF;
1619 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1620 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1621 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1622 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1624 TRACE("(%p)\n", this);
1625 return *this->pwbuf;
1628 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1629 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1630 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1631 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1633 TRACE("(%p %d)\n", this, off);
1634 *this->pwpos += off;
1635 *this->pwsize -= off;
1638 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1639 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1640 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1641 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1643 TRACE("(%p)\n", this);
1644 return *this->pwpos;
1647 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1648 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1649 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1650 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1652 TRACE("(%p %p)\n", this, loc);
1653 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
1654 call_basic_streambuf_char_imbue(this, loc);
1655 locale_copy_ctor(IOS_LOCALE(this), loc);
1656 return ret;
1659 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1660 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1661 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1662 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1663 #if STREAMOFF_BITS == 64
1664 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1665 #else
1666 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1667 #endif
1668 #if _MSVCP_VER >= 100
1669 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) \
1670 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
1671 #elif _MSVCP_VER >= 80
1672 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) \
1673 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
1674 #else
1675 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) \
1676 CALL_VTBL_FUNC(this, 32, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
1677 #endif
1678 fpos_mbstatet* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1679 fpos_mbstatet *ret, streamoff off, int way, int mode)
1681 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1682 ret->off = -1;
1683 ret->pos = 0;
1684 memset(&ret->state, 0, sizeof(ret->state));
1685 return ret;
1688 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1689 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1690 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
1691 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
1692 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1693 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1694 #if STREAMOFF_BITS == 64
1695 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1696 #else
1697 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1698 #endif
1699 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1700 fpos_mbstatet *ret, streamoff off, int way, int mode)
1702 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1703 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1706 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1707 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1708 #if STREAMOFF_BITS == 64
1709 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 24)
1710 #else
1711 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1712 #endif
1713 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1714 fpos_mbstatet *ret, streamoff off, unsigned int way, unsigned int mode)
1716 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1717 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1720 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1721 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1722 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1723 #if _MSVCP_VER >= 100
1724 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) \
1725 CALL_VTBL_FUNC(this, 44, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
1726 #elif _MSVCP_VER >= 80
1727 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) \
1728 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
1729 #else
1730 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) \
1731 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
1732 #endif
1733 fpos_mbstatet* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1734 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
1736 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
1737 ret->off = -1;
1738 ret->pos = 0;
1739 memset(&ret->state, 0, sizeof(ret->state));
1740 return ret;
1743 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1744 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1745 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1746 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1747 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
1749 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
1750 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1753 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1754 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1755 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1756 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1757 fpos_mbstatet *ret, fpos_mbstatet pos, unsigned int mode)
1759 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
1760 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1763 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1764 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1765 #if STREAMSIZE_BITS == 64
1766 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1767 #else
1768 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1769 #endif
1770 #if _MSVCP_VER >= 100
1771 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 48, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1772 #elif _MSVCP_VER >= 80
1773 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1774 #else
1775 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
1776 #endif
1777 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1779 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1780 return this;
1783 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1784 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1785 #if STREAMSIZE_BITS == 64
1786 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1787 #else
1788 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1789 #endif
1790 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1792 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1793 return call_basic_streambuf_char_setbuf(this, buf, count);
1796 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1797 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1798 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1799 #if _MSVCP_VER >= 100
1800 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1801 #elif _MSVCP_VER >= 80
1802 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1803 #else
1804 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1805 #endif
1806 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1808 TRACE("(%p)\n", this);
1809 return 0;
1812 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1813 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1814 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1815 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1817 TRACE("(%p)\n", this);
1818 return call_basic_streambuf_char_sync(this);
1821 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1822 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1823 #if STREAMSIZE_BITS == 64
1824 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1825 #else
1826 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1827 #endif
1828 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1830 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1831 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1834 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1835 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1836 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1837 #if _MSVCP_VER >= 100
1838 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1839 #else
1840 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1841 #endif
1842 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1844 TRACE("(%p)\n", this);
1845 return 0;
1848 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1849 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1850 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1851 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1853 streamsize ret;
1855 TRACE("(%p)\n", this);
1857 ret = basic_streambuf_char__Gnavail(this);
1858 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1861 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1862 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1863 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1864 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1866 TRACE("(%p %d)\n", this, ch);
1867 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1868 (*this->prsize)++;
1869 (*this->prpos)--;
1870 return (unsigned char)ch;
1873 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1876 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1877 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1878 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1879 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1881 TRACE("(%p %d)\n", this, ch);
1882 return basic_streambuf_char__Pnavail(this) ?
1883 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1884 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1887 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1888 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1889 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1890 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1892 TRACE("(%p)\n", this);
1893 if(*this->prpos && *this->prpos>*this->prbuf) {
1894 (*this->prsize)++;
1895 (*this->prpos)--;
1896 return (unsigned char)**this->prpos;
1899 return call_basic_streambuf_char_pbackfail(this, EOF);
1902 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1903 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1904 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1905 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1907 TRACE("(%p)\n", this);
1908 if(basic_streambuf_char__Gnavail(this))
1909 basic_streambuf_char__Gninc(this);
1910 else
1911 call_basic_streambuf_char_uflow(this);
1914 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1915 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1916 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1917 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1919 TRACE("(%p)\n", this);
1920 return basic_streambuf_char__Gnavail(this) ?
1921 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1924 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1925 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1926 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1927 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1929 TRACE("(%p)\n", this);
1930 return basic_streambuf_char__Gnavail(this) ?
1931 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1934 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1935 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1936 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1937 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1939 TRACE("(%p)\n", this);
1941 if(basic_streambuf_char__Gnavail(this) > 1)
1942 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1943 return basic_streambuf_char_sbumpc(this)==EOF ?
1944 EOF : basic_streambuf_char_sgetc(this);
1947 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1948 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1949 #if STREAMSIZE_BITS == 64
1950 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1951 #else
1952 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1953 #endif
1954 #if _MSVCP_VER >= 100
1955 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1956 #else
1957 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1958 #endif
1959 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1961 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1962 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1965 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1966 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1967 #if STREAMSIZE_BITS == 64
1968 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1969 #else
1970 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1971 #endif
1972 #if _MSVCP_VER >= 100
1973 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1974 #elif _MSVCP_VER >= 80
1975 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1976 #else
1977 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1978 #endif
1979 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1981 streamsize copied, chunk;
1983 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1985 for(copied=0; copied<count;) {
1986 chunk = basic_streambuf_char__Pnavail(this);
1987 if(chunk > count-copied)
1988 chunk = count-copied;
1990 if(chunk > 0) {
1991 memcpy(*this->pwpos, ptr+copied, chunk);
1992 *this->pwpos += chunk;
1993 *this->pwsize -= chunk;
1994 copied += chunk;
1995 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1996 copied++;
1997 }else {
1998 break;
2002 return copied;
2005 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
2006 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
2007 #if STREAMSIZE_BITS == 64
2008 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
2009 #else
2010 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
2011 #endif
2012 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
2014 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2015 return call_basic_streambuf_char_xsputn(this, ptr, count);
2018 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
2019 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
2020 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8)
2021 void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r)
2023 char *wfirst, *wnext, *wlast, *rfirst, *rnext, *rlast;
2024 #if _MSVCP_VER < 70
2025 locale loc;
2026 #else
2027 locale *loc;
2028 #endif
2030 TRACE("(%p %p)\n", this, r);
2032 if(this == r)
2033 return;
2035 wfirst = *this->pwbuf;
2036 wnext = *this->pwpos;
2037 wlast = *this->pwpos + *this->pwsize;
2038 rfirst = *this->prbuf;
2039 rnext = *this->prpos;
2040 rlast = *this->prpos + *this->prsize;
2041 loc = this->loc;
2043 basic_streambuf_char_setp_next(this, *r->pwbuf, *r->pwpos, *r->pwpos + *r->pwsize);
2044 basic_streambuf_char_setg(this, *r->prbuf, *r->prpos, *r->prpos + *r->prsize);
2045 this->loc = r->loc;
2047 basic_streambuf_char_setp_next(r, wfirst, wnext, wlast);
2048 basic_streambuf_char_setg(r, rfirst, rnext, rlast);
2049 r->loc = loc;
2052 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
2053 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
2054 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
2055 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
2056 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
2057 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
2059 TRACE("(%p %p %p %p)\n", this, first, next, last);
2061 this->wbuf = first;
2062 this->wpos = next;
2063 this->wsize = last-next;
2066 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
2067 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
2068 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
2069 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
2070 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
2071 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
2073 basic_streambuf_wchar_setp_next(this, first, first, last);
2076 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
2077 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
2078 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
2079 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
2080 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
2081 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
2083 TRACE("(%p %p %p %p)\n", this, first, next, last);
2085 this->rbuf = first;
2086 this->rpos = next;
2087 this->rsize = last-next;
2090 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
2091 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
2092 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
2093 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
2094 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
2095 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
2097 TRACE("(%p)\n", this);
2099 this->prbuf = &this->rbuf;
2100 this->pwbuf = &this->wbuf;
2101 this->prpos = &this->rpos;
2102 this->pwpos = &this->wpos;
2103 this->prsize = &this->rsize;
2104 this->pwsize = &this->wsize;
2106 basic_streambuf_wchar_setp(this, NULL, NULL);
2107 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
2110 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
2111 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
2112 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
2113 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
2115 TRACE("(%p %d)\n", this, uninitialized);
2116 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
2117 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2118 mutex_ctor(&this->lock);
2119 #endif
2120 return this;
2123 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
2124 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
2125 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
2126 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
2128 TRACE("(%p %d)\n", this, uninitialized);
2129 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
2130 this->vtable = &MSVCP_basic_streambuf_short_vtable;
2131 return this;
2134 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
2135 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
2136 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
2137 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
2139 TRACE("(%p)\n", this);
2141 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
2142 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2143 mutex_ctor(&this->lock);
2144 #endif
2145 #if _MSVCP_VER >= 70
2146 this->loc = MSVCRT_operator_new(sizeof(locale));
2147 #endif
2148 locale_ctor(IOS_LOCALE(this));
2149 basic_streambuf_wchar__Init_empty(this);
2151 return this;
2154 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
2155 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
2156 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
2157 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
2159 TRACE("(%p)\n", this);
2160 basic_streambuf_wchar_ctor(this);
2161 this->vtable = &MSVCP_basic_streambuf_short_vtable;
2162 return this;
2165 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
2166 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
2167 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
2168 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
2169 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
2170 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
2172 TRACE("(%p)\n", this);
2174 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2175 mutex_dtor(&this->lock);
2176 #endif
2177 locale_dtor(IOS_LOCALE(this));
2178 #if _MSVCP_VER >= 70
2179 MSVCRT_operator_delete(this->loc);
2180 #endif
2183 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
2184 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
2186 TRACE("(%p %x)\n", this, flags);
2187 if(flags & 2) {
2188 /* we have an array, with the number of elements stored before the first object */
2189 INT_PTR i, *ptr = (INT_PTR *)this-1;
2191 for(i=*ptr-1; i>=0; i--)
2192 basic_streambuf_wchar_dtor(this+i);
2193 MSVCRT_operator_delete(ptr);
2194 } else {
2195 basic_streambuf_wchar_dtor(this);
2196 if(flags & 1)
2197 MSVCRT_operator_delete(this);
2200 return this;
2203 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2204 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2205 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2206 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2207 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
2208 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
2210 TRACE("(%p)\n", this);
2211 return *this->prpos ? *this->prsize : 0;
2214 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2215 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2216 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2217 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2218 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
2219 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
2221 TRACE("(%p)\n", this);
2222 (*this->prsize)++;
2223 (*this->prpos)--;
2224 return *this->prpos;
2227 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2228 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2229 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2230 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2231 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
2232 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
2234 TRACE("(%p)\n", this);
2235 (*this->prsize)--;
2236 return (*this->prpos)++;
2239 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2240 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2241 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2242 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2243 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
2244 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
2246 TRACE("(%p)\n", this);
2247 (*this->prsize)--;
2248 (*this->prpos)++;
2249 return *this->prpos;
2252 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
2253 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
2254 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
2255 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
2256 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
2257 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)
2259 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
2261 this->prbuf = gf;
2262 this->pwbuf = pf;
2263 this->prpos = gn;
2264 this->pwpos = pn;
2265 this->prsize = gc;
2266 this->pwsize = pc;
2269 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2270 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2271 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2272 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2273 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
2274 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
2276 TRACE("(%p)\n", this);
2277 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2278 mutex_lock(&this->lock);
2279 #endif
2282 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2283 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2284 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2285 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2286 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
2287 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
2289 TRACE("(%p)\n", this);
2290 return *this->pwpos ? *this->pwsize : 0;
2293 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2294 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2295 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2296 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2297 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
2298 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
2300 TRACE("(%p)\n", this);
2301 (*this->pwsize)--;
2302 return (*this->pwpos)++;
2305 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2306 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2307 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2308 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2309 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
2310 #if _MSVCP_VER >= 100
2311 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
2312 #else
2313 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
2314 #endif
2315 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
2317 TRACE("(%p)\n", this);
2318 return WEOF;
2321 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2322 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2323 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2324 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2325 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
2326 #if _MSVCP_VER >= 100
2327 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
2328 #else
2329 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
2330 #endif
2331 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
2333 int ret;
2335 TRACE("(%p)\n", this);
2337 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
2338 return WEOF;
2340 ret = **this->prpos;
2341 (*this->prsize)--;
2342 (*this->prpos)++;
2343 return ret;
2346 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
2347 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
2348 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
2349 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
2350 #if STREAMSIZE_BITS == 64
2351 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
2352 #else
2353 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
2354 #endif
2355 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2356 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
2357 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
2358 #else
2359 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
2360 #endif
2361 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2363 streamsize copied, chunk;
2364 unsigned short c;
2366 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2368 for(copied=0; copied<count && size;) {
2369 chunk = basic_streambuf_wchar__Gnavail(this);
2370 if(chunk > count-copied)
2371 chunk = count-copied;
2373 if(chunk > 0) {
2374 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
2375 *this->prpos += chunk;
2376 *this->prsize -= chunk;
2377 copied += chunk;
2378 size -= chunk*sizeof(wchar_t);
2379 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
2380 ptr[copied] = c;
2381 copied++;
2382 size--;
2383 }else {
2384 break;
2388 return copied;
2391 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
2392 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
2393 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
2394 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
2395 #if STREAMSIZE_BITS == 64
2396 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
2397 #else
2398 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
2399 #endif
2400 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2402 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2403 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
2406 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2407 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2408 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2409 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2410 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
2411 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
2413 TRACE("(%p)\n", this);
2414 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2415 mutex_unlock(&this->lock);
2416 #endif
2419 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2420 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2421 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2422 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2423 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2424 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2426 TRACE("(%p)\n", this);
2427 return *this->prbuf;
2430 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2431 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2432 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2433 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2434 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2435 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2437 TRACE("(%p)\n", this);
2438 return *this->prpos;
2441 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2442 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2443 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2444 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2445 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2446 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2448 TRACE("(%p)\n", this);
2449 return *this->prpos+*this->prsize;
2452 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2453 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2454 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2455 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2456 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2457 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2459 TRACE("(%p)\n", this);
2460 return *this->pwpos+*this->pwsize;
2463 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2464 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2465 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2466 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2467 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2468 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2470 TRACE("(%p %d)\n", this, off);
2471 *this->prpos += off;
2472 *this->prsize -= off;
2475 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
2476 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
2477 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
2478 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
2479 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
2480 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
2482 TRACE("(%p)\n", this);
2483 return locale_copy_ctor(ret, IOS_LOCALE(this));
2486 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2487 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2488 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2489 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2490 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2491 #if _MSVCP_VER >= 100
2492 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2493 #elif _MSVCP_VER >= 80
2494 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2495 #else
2496 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2497 #endif
2498 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2500 TRACE("(%p %p)\n", this, loc);
2503 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2504 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2505 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2506 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2507 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2508 #if _MSVCP_VER >= 100
2509 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2510 #else
2511 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2512 #endif
2513 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2515 TRACE("(%p %d)\n", this, ch);
2516 return WEOF;
2519 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2520 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2521 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2522 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2523 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2524 #if _MSVCP_VER >= 100
2525 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2526 #else
2527 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2528 #endif
2529 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2531 TRACE("(%p %d)\n", this, ch);
2532 return WEOF;
2535 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2536 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2537 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2538 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2539 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2540 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2542 TRACE("(%p)\n", this);
2543 return *this->pwbuf;
2546 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2547 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2548 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2549 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2550 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2551 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2553 TRACE("(%p %d)\n", this, off);
2554 *this->pwpos += off;
2555 *this->pwsize -= off;
2558 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2559 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2560 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2561 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2562 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2563 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2565 TRACE("(%p)\n", this);
2566 return *this->pwpos;
2569 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2570 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2571 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2572 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2573 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2574 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2576 TRACE("(%p %p)\n", this, loc);
2577 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
2578 call_basic_streambuf_wchar_imbue(this, loc);
2579 locale_copy_ctor(IOS_LOCALE(this), loc);
2580 return ret;
2583 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2584 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
2585 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2586 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2587 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2588 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2589 #if STREAMOFF_BITS == 64
2590 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2591 #else
2592 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2593 #endif
2594 #if _MSVCP_VER >= 100
2595 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) \
2596 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
2597 #elif _MSVCP_VER >= 80
2598 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) \
2599 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
2600 #else
2601 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) \
2602 CALL_VTBL_FUNC(this, 32, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
2603 #endif
2604 fpos_mbstatet* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2605 fpos_mbstatet *ret, streamoff off, int way, int mode)
2607 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2608 ret->off = -1;
2609 ret->pos = 0;
2610 memset(&ret->state, 0, sizeof(ret->state));
2611 return ret;
2614 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2615 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2616 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2617 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2618 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
2619 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
2620 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2621 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ioos_base@2@H@Z */
2622 #if STREAMOFF_BITS == 64
2623 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2624 #else
2625 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2626 #endif
2627 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2628 fpos_mbstatet *ret, streamoff off, int way, int mode)
2630 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2631 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2634 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2635 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2636 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2637 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2638 #if STREAMOFF_BITS == 64
2639 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 24)
2640 #else
2641 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2642 #endif
2643 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2644 fpos_mbstatet *ret, streamoff off, unsigned int way, unsigned int mode)
2646 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2647 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2650 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2651 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2652 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2653 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2654 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2655 #if _MSVCP_VER >= 100
2656 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) \
2657 CALL_VTBL_FUNC(this, 44, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
2658 #elif _MSVCP_VER >= 80
2659 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) \
2660 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
2661 #else
2662 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) \
2663 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
2664 #endif
2665 fpos_mbstatet* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2666 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
2668 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
2669 ret->off = -1;
2670 ret->pos = 0;
2671 memset(&ret->state, 0, sizeof(ret->state));
2672 return ret;
2675 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2676 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2677 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2678 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2679 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2680 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2681 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
2683 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
2684 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2687 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2688 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2689 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2690 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2691 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2692 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2693 fpos_mbstatet *ret, fpos_mbstatet pos, unsigned int mode)
2695 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
2696 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2699 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2700 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2701 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2702 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2703 #if STREAMSIZE_BITS == 64
2704 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2705 #else
2706 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2707 #endif
2708 #if _MSVCP_VER >= 100
2709 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 48, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2710 #elif _MSVCP_VER >= 80
2711 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2712 #else
2713 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 40, basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
2714 #endif
2715 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2717 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2718 return this;
2721 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2722 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2723 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2724 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2725 #if STREAMSIZE_BITS == 64
2726 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2727 #else
2728 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2729 #endif
2730 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2732 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2733 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2736 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2737 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2738 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2739 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2740 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2741 #if _MSVCP_VER >= 100
2742 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2743 #elif _MSVCP_VER >= 80
2744 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2745 #else
2746 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2747 #endif
2748 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2750 TRACE("(%p)\n", this);
2751 return 0;
2754 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2755 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2756 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2757 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2758 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2759 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2761 TRACE("(%p)\n", this);
2762 return call_basic_streambuf_wchar_sync(this);
2765 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2766 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2767 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2768 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2769 #if STREAMSIZE_BITS == 64
2770 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2771 #else
2772 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2773 #endif
2774 #if _MSVCP_VER >= 100
2775 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2776 #else
2777 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2778 #endif
2779 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2781 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2782 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2785 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2786 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2787 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2788 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2789 #if STREAMSIZE_BITS == 64
2790 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2791 #else
2792 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2793 #endif
2794 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2796 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2797 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2800 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2801 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2802 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2803 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2804 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2805 #if _MSVCP_VER >= 100
2806 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2807 #else
2808 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2809 #endif
2810 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2812 TRACE("(%p)\n", this);
2813 return 0;
2816 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2817 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2818 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2819 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2820 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2821 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2823 streamsize ret;
2825 TRACE("(%p)\n", this);
2827 ret = basic_streambuf_wchar__Gnavail(this);
2828 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2831 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2832 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2833 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2834 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2835 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2836 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2838 TRACE("(%p %d)\n", this, ch);
2839 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2840 (*this->prsize)++;
2841 (*this->prpos)--;
2842 return ch;
2845 return call_basic_streambuf_wchar_pbackfail(this, ch);
2848 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2849 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2850 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2851 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2852 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2853 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2855 TRACE("(%p %d)\n", this, ch);
2856 return basic_streambuf_wchar__Pnavail(this) ?
2857 (*basic_streambuf_wchar__Pninc(this) = ch) :
2858 call_basic_streambuf_wchar_overflow(this, ch);
2861 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2862 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2863 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2864 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2865 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2866 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2868 TRACE("(%p)\n", this);
2869 if(*this->prpos && *this->prpos>*this->prbuf) {
2870 (*this->prsize)++;
2871 (*this->prpos)--;
2872 return **this->prpos;
2875 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2878 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2879 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2880 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2881 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2882 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2883 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2885 TRACE("(%p)\n", this);
2886 if(basic_streambuf_wchar__Gnavail(this))
2887 basic_streambuf_wchar__Gninc(this);
2888 else
2889 call_basic_streambuf_wchar_uflow(this);
2892 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2893 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2894 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2895 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2896 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2897 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2899 TRACE("(%p)\n", this);
2900 return basic_streambuf_wchar__Gnavail(this) ?
2901 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2904 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2905 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2906 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2907 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2908 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2909 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2911 TRACE("(%p)\n", this);
2912 return basic_streambuf_wchar__Gnavail(this) ?
2913 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2916 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2917 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2918 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2919 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2920 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2921 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2923 TRACE("(%p)\n", this);
2925 if(basic_streambuf_wchar__Gnavail(this) > 1)
2926 return *basic_streambuf_wchar__Gnpreinc(this);
2927 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2928 WEOF : basic_streambuf_wchar_sgetc(this);
2931 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2932 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2933 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2934 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2935 #if STREAMSIZE_BITS == 64
2936 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2937 #else
2938 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2939 #endif
2940 #if _MSVCP_VER >= 100
2941 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2942 #elif _MSVCP_VER >= 80
2943 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2944 #else
2945 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
2946 #endif
2947 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2949 streamsize copied, chunk;
2951 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2953 for(copied=0; copied<count;) {
2954 chunk = basic_streambuf_wchar__Pnavail(this);
2955 if(chunk > count-copied)
2956 chunk = count-copied;
2958 if(chunk > 0) {
2959 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2960 *this->pwpos += chunk;
2961 *this->pwsize -= chunk;
2962 copied += chunk;
2963 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2964 copied++;
2965 }else {
2966 break;
2970 return copied;
2973 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2974 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2975 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2976 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2977 #if STREAMSIZE_BITS == 64
2978 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2979 #else
2980 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2981 #endif
2982 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2984 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2985 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2988 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
2989 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
2990 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2991 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2992 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8)
2993 void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r)
2995 wchar_t *wfirst, *wnext, *wlast, *rfirst, *rnext, *rlast;
2996 #if _MSVCP_VER < 70
2997 locale loc;
2998 #else
2999 locale *loc;
3000 #endif
3002 TRACE("(%p %p)\n", this, r);
3004 if(this == r)
3005 return;
3007 wfirst = *this->pwbuf;
3008 wnext = *this->pwpos;
3009 wlast = *this->pwpos + *this->pwsize;
3010 rfirst = *this->prbuf;
3011 rnext = *this->prpos;
3012 rlast = *this->prpos + *this->prsize;
3013 loc = this->loc;
3015 basic_streambuf_wchar_setp_next(this, *r->pwbuf, *r->pwpos, *r->pwpos + *r->pwsize);
3016 basic_streambuf_wchar_setg(this, *r->prbuf, *r->prpos, *r->prpos + *r->prsize);
3017 this->loc = r->loc;
3019 basic_streambuf_wchar_setp_next(r, wfirst, wnext, wlast);
3020 basic_streambuf_wchar_setg(r, rfirst, rnext, rlast);
3021 r->loc = loc;
3024 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3025 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3026 #if _MSVCP_VER >= 140
3027 _Mbstatet basic_filebuf_char__Init__Stinit = {0};
3028 #else
3029 _Mbstatet basic_filebuf_char__Init__Stinit = 0;
3030 #endif
3032 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3033 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3034 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
3035 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
3037 TRACE("(%p %p %d)\n", this, file, which);
3039 this->cvt = NULL;
3040 this->wrotesome = FALSE;
3041 this->state = basic_filebuf_char__Init__Stinit;
3042 this->close = (which == INITFL_open);
3043 this->file = file;
3045 basic_streambuf_char__Init_empty(&this->base);
3046 if(file)
3047 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
3048 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
3051 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
3052 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
3053 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt_cvt, 8)
3054 void __thiscall basic_filebuf_char__Initcvt_cvt(basic_filebuf_char *this, codecvt_char *cvt)
3056 TRACE("(%p %p)\n", this, cvt);
3058 if(codecvt_base_always_noconv(&cvt->base)) {
3059 this->cvt = NULL;
3060 }else {
3061 basic_streambuf_char__Init_empty(&this->base);
3062 this->cvt = cvt;
3066 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
3067 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
3068 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 4)
3069 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this)
3071 codecvt_char *cvt = codecvt_char_use_facet(IOS_LOCALE(&this->base));
3072 basic_filebuf_char__Initcvt_cvt( this, cvt );
3075 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
3076 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
3077 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Endwrite, 4)
3078 MSVCP_bool __thiscall basic_filebuf_char__Endwrite(basic_filebuf_char *this)
3080 TRACE("(%p)\n", this);
3082 if(!this->wrotesome || !this->cvt)
3083 return TRUE;
3086 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3087 return FALSE;
3089 while(1) {
3090 /* TODO: check if we need a dynamic buffer here */
3091 char buf[128];
3092 char *next;
3093 int ret;
3095 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3096 switch(ret) {
3097 case CODECVT_ok:
3098 this->wrotesome = FALSE;
3099 /* fall through */
3100 case CODECVT_partial:
3101 if(!fwrite(buf, next-buf, 1, this->file))
3102 return FALSE;
3103 if(this->wrotesome)
3104 break;
3105 /* fall through */
3106 case CODECVT_noconv:
3107 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3108 return FALSE;
3109 return TRUE;
3110 default:
3111 return FALSE;
3116 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
3117 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
3118 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
3119 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
3121 basic_filebuf_char *ret = this;
3123 TRACE("(%p)\n", this);
3125 if(!this->file)
3126 return NULL;
3128 /* TODO: handle exceptions */
3129 if(!basic_filebuf_char__Endwrite(this))
3130 ret = NULL;
3131 if(fclose(this->file))
3132 ret = NULL;
3134 basic_filebuf_char__Init(this, NULL, INITFL_close);
3135 return ret;
3138 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
3139 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3140 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
3141 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
3143 TRACE("(%p %p)\n", this, file);
3145 basic_streambuf_char_ctor(&this->base);
3146 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
3148 basic_filebuf_char__Init(this, file, INITFL_new);
3149 return this;
3152 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
3153 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
3154 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
3155 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
3157 return basic_filebuf_char_ctor_file(this, NULL);
3160 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3161 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3162 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
3163 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
3165 TRACE("(%p %d)\n", this, uninitialized);
3167 basic_streambuf_char_ctor(&this->base);
3168 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
3169 return this;
3172 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
3173 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
3174 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
3175 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
3177 TRACE("(%p)\n", this);
3179 if(this->close)
3180 basic_filebuf_char_close(this);
3181 basic_streambuf_char_dtor(&this->base);
3184 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
3185 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
3187 TRACE("(%p %x)\n", this, flags);
3188 if(flags & 2) {
3189 /* we have an array, with the number of elements stored before the first object */
3190 INT_PTR i, *ptr = (INT_PTR *)this-1;
3192 for(i=*ptr-1; i>=0; i--)
3193 basic_filebuf_char_dtor(this+i);
3194 MSVCRT_operator_delete(ptr);
3195 } else {
3196 basic_filebuf_char_dtor(this);
3197 if(flags & 1)
3198 MSVCRT_operator_delete(this);
3201 return this;
3204 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
3205 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
3206 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
3207 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
3209 TRACE("(%p)\n", this);
3210 return this->file != NULL;
3213 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
3214 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
3215 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
3217 static const wchar_t rW[] = {'r',0};
3218 static const struct {
3219 int mode;
3220 const wchar_t str[4];
3221 const wchar_t str_bin[4];
3222 } str_mode[] = {
3223 {OPENMODE_out, {'w',0}, {'w','b',0}},
3224 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
3225 {OPENMODE_app, {'a',0}, {'a','b',0}},
3226 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
3227 {OPENMODE_in, {'r',0}, {'r','b',0}},
3228 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
3229 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
3230 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
3231 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
3234 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
3235 size_t mode_idx;
3236 FILE *f = NULL;
3238 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
3240 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
3241 if(str_mode[mode_idx].mode == real_mode)
3242 break;
3243 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
3244 return NULL;
3246 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
3247 return NULL;
3248 else if(f)
3249 fclose(f);
3251 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
3252 && (f = _wfopen(name, rW))) {
3253 fclose(f);
3254 return NULL;
3257 #if _MSVCP_VER < 80 /* msvcp60 - msvcp71 are ignoring prot argument */
3258 prot = SH_DENYNO;
3259 #endif
3261 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
3262 : str_mode[mode_idx].str, prot);
3263 if(!f)
3264 return NULL;
3266 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
3267 fclose(f);
3268 return NULL;
3271 return f;
3274 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
3275 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
3276 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
3278 wchar_t nameW[FILENAME_MAX];
3280 TRACE("(%s %d %d)\n", name, mode, prot);
3282 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3283 return NULL;
3284 return _Fiopen_wchar(nameW, mode, prot);
3287 /* ?__Fiopen@std@@YAPAU_iobuf@@PBDH@Z */
3288 /* ?__Fiopen@std@@YAPEAU_iobuf@@PEBDH@Z */
3289 FILE* __cdecl ___Fiopen(const char *name, int mode)
3291 TRACE("(%p %d)\n", name, mode);
3292 return _Fiopen(name, mode, _SH_DENYNO);
3295 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
3296 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3297 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
3298 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3299 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
3300 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
3302 FILE *f = NULL;
3304 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3306 if(basic_filebuf_char_is_open(this))
3307 return NULL;
3309 if(!(f = _Fiopen_wchar(name, mode, prot)))
3310 return NULL;
3312 basic_filebuf_char__Init(this, f, INITFL_open);
3313 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(IOS_LOCALE(&this->base)));
3314 return this;
3317 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
3318 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3319 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
3320 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
3321 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
3322 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
3324 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
3327 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
3328 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3329 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
3330 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
3332 wchar_t nameW[FILENAME_MAX];
3334 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3336 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3337 return NULL;
3338 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
3341 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDF@Z */
3342 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDF@Z */
3343 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
3344 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
3346 TRACE("(%p %p %d)\n", this, name, mode);
3347 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3350 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDH@Z */
3351 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDH@Z */
3352 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
3353 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
3354 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
3355 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
3357 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3360 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3361 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3362 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
3363 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
3365 char buf[8], *dyn_buf;
3366 char ch = c, *to_next;
3367 const char *from_next;
3368 int ret, max_size;
3371 TRACE("(%p %d)\n", this, c);
3373 if(!basic_filebuf_char_is_open(this))
3374 return EOF;
3375 if(c == EOF)
3376 return !c;
3378 if(!this->cvt)
3379 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3381 from_next = &ch;
3382 do {
3383 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3384 &from_next, buf, buf+sizeof(buf), &to_next);
3386 switch(ret) {
3387 case CODECVT_partial:
3388 if(to_next == buf)
3389 break;
3390 /* fall through */
3391 case CODECVT_ok:
3392 if(!fwrite(buf, to_next-buf, 1, this->file))
3393 return EOF;
3394 if(ret == CODECVT_partial)
3395 continue;
3396 return c;
3397 case CODECVT_noconv:
3398 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3399 default:
3400 return EOF;
3403 break;
3404 } while(1);
3406 max_size = codecvt_base_max_length(&this->cvt->base);
3407 dyn_buf = malloc(max_size);
3408 if(!dyn_buf)
3409 return EOF;
3411 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3412 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3414 switch(ret) {
3415 case CODECVT_ok:
3416 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3417 free(dyn_buf);
3418 return ret ? c : EOF;
3419 case CODECVT_partial:
3420 ERR("buffer should be big enough to store all output\n");
3421 /* fall through */
3422 default:
3423 free(dyn_buf);
3424 return EOF;
3428 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3429 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3430 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
3431 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
3433 TRACE("(%p %d)\n", this, c);
3435 if(!basic_filebuf_char_is_open(this))
3436 return EOF;
3438 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
3439 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
3440 basic_streambuf_char__Gndec(&this->base);
3441 return c==EOF ? !c : c;
3442 }else if(c!=EOF && !this->cvt) {
3443 return ungetc(c, this->file);
3446 return EOF;
3449 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3450 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3451 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
3452 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
3454 char ch, buf[128], *to_next;
3455 const char *buf_next;
3456 int c, j;
3457 size_t i;
3459 TRACE("(%p)\n", this);
3461 if(!basic_filebuf_char_is_open(this))
3462 return EOF;
3464 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3465 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
3467 c = fgetc(this->file);
3468 if(!this->cvt || c==EOF)
3469 return c;
3471 buf_next = buf;
3472 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3473 buf[i] = c;
3475 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
3476 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3477 case CODECVT_partial:
3478 case CODECVT_ok:
3479 if(to_next == &ch) {
3480 c = fgetc(this->file);
3481 if(c == EOF)
3482 return EOF;
3483 continue;
3486 for(j = --i; j >= buf_next-buf; j--)
3487 ungetc(buf[j], this->file);
3488 return ch;
3489 case CODECVT_noconv:
3490 return (unsigned char)buf[0];
3491 default:
3492 return EOF;
3496 FIXME("buffer is too small\n");
3497 return EOF;
3500 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3501 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3502 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
3503 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
3505 int ret;
3507 TRACE("(%p)\n", this);
3509 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3510 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
3512 ret = call_basic_streambuf_char_uflow(&this->base);
3513 if(ret != EOF)
3514 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
3515 return ret;
3518 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3519 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3520 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3521 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3522 #if STREAMOFF_BITS == 64
3523 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
3524 #else
3525 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
3526 #endif
3527 fpos_mbstatet* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
3528 fpos_mbstatet *ret, streamoff off, int way, int mode)
3530 fpos_t pos;
3532 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3534 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3535 || fseek(this->file, off, way)) {
3536 ret->off = -1;
3537 ret->pos = 0;
3538 memset(&ret->state, 0, sizeof(ret->state));
3539 return ret;
3542 fgetpos(this->file, &pos);
3543 ret->off = 0;
3544 ret->pos = pos;
3545 ret->state = this->state;
3546 return ret;
3549 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3550 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3551 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
3552 fpos_mbstatet* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
3553 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
3555 fpos_t fpos;
3557 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
3559 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3560 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3561 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3562 ret->off = -1;
3563 ret->pos = 0;
3564 memset(&ret->state, 0, sizeof(ret->state));
3565 return ret;
3568 fgetpos(this->file, &fpos);
3569 ret->off = 0;
3570 ret->pos = fpos;
3571 ret->state = this->state;
3572 return ret;
3575 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
3576 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
3577 #if STREAMSIZE_BITS == 64
3578 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
3579 #else
3580 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
3581 #endif
3582 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
3584 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3586 if(!basic_filebuf_char_is_open(this))
3587 return NULL;
3589 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3590 return NULL;
3592 basic_filebuf_char__Init(this, this->file, INITFL_open);
3593 return &this->base;
3596 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3597 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3598 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3599 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3601 TRACE("(%p)\n", this);
3603 if(!basic_filebuf_char_is_open(this))
3604 return 0;
3606 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3607 return 0;
3608 return fflush(this->file);
3611 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
3612 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
3613 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
3614 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
3616 TRACE("(%p %p)\n", this, loc);
3617 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(loc));
3620 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3621 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3622 #if _MSVCP_VER >= 140
3623 _Mbstatet basic_filebuf_wchar__Init__Stinit = {0};
3624 #else
3625 _Mbstatet basic_filebuf_wchar__Init__Stinit = 0;
3626 #endif
3628 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3629 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3630 #if _MSVCP_VER >= 140
3631 _Mbstatet basic_filebuf_short__Init__Stinit = {0};
3632 #else
3633 _Mbstatet basic_filebuf_short__Init__Stinit = 0;
3634 #endif
3636 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3637 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3638 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3639 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3641 TRACE("(%p %p %d)\n", this, file, which);
3643 this->cvt = NULL;
3644 this->wrotesome = FALSE;
3645 this->state = basic_filebuf_wchar__Init__Stinit;
3646 this->close = (which == INITFL_open);
3647 this->file = file;
3649 basic_streambuf_wchar__Init_empty(&this->base);
3652 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3653 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3654 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3655 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3657 TRACE("(%p %p %d)\n", this, file, which);
3659 this->cvt = NULL;
3660 this->wrotesome = FALSE;
3661 this->state = basic_filebuf_short__Init__Stinit;
3662 this->close = (which == INITFL_open);
3663 this->file = file;
3665 basic_streambuf_wchar__Init_empty(&this->base);
3668 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
3669 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
3670 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
3671 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
3672 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt_cvt, 8)
3673 void __thiscall basic_filebuf_wchar__Initcvt_cvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
3675 TRACE("(%p %p)\n", this, cvt);
3677 if(codecvt_base_always_noconv(&cvt->base)) {
3678 this->cvt = NULL;
3679 }else {
3680 basic_streambuf_wchar__Init_empty(&this->base);
3681 this->cvt = cvt;
3685 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
3686 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
3687 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 4)
3688 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this)
3690 codecvt_wchar *cvt = codecvt_wchar_use_facet(IOS_LOCALE(&this->base));
3691 basic_filebuf_wchar__Initcvt_cvt( this, cvt );
3694 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAE_NXZ */
3695 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAA_NXZ */
3696 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAE_NXZ */
3697 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAA_NXZ */
3698 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Endwrite, 4)
3699 MSVCP_bool __thiscall basic_filebuf_wchar__Endwrite(basic_filebuf_wchar *this)
3701 TRACE("(%p)\n", this);
3703 if(!this->wrotesome || !this->cvt)
3704 return TRUE;
3706 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3707 return FALSE;
3709 while(1) {
3710 /* TODO: check if we need a dynamic buffer here */
3711 char buf[128];
3712 char *next;
3713 int ret;
3715 ret = codecvt_wchar_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3716 switch(ret) {
3717 case CODECVT_ok:
3718 this->wrotesome = FALSE;
3719 /* fall through */
3720 case CODECVT_partial:
3721 if(!fwrite(buf, next-buf, 1, this->file))
3722 return FALSE;
3723 if(this->wrotesome)
3724 break;
3725 /* fall through */
3726 case CODECVT_noconv:
3727 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3728 return FALSE;
3729 return TRUE;
3730 default:
3731 return FALSE;
3736 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3737 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3738 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3739 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3740 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3741 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3743 basic_filebuf_wchar *ret = this;
3745 TRACE("(%p)\n", this);
3747 if(!this->file)
3748 return NULL;
3750 /* TODO: handle exceptions */
3751 if(!basic_filebuf_wchar__Endwrite(this))
3752 ret = NULL;
3753 if(fclose(this->file))
3754 ret = NULL;
3756 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3757 return ret;
3760 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3761 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3762 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3763 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3765 TRACE("(%p %p)\n", this, file);
3767 basic_streambuf_wchar_ctor(&this->base);
3768 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3770 basic_filebuf_wchar__Init(this, file, INITFL_new);
3771 return this;
3774 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3775 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3776 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3777 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3779 TRACE("(%p %p)\n", this, file);
3781 basic_streambuf_short_ctor(&this->base);
3782 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3784 basic_filebuf_short__Init(this, file, INITFL_new);
3785 return this;
3788 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3789 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3790 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3791 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3793 return basic_filebuf_wchar_ctor_file(this, NULL);
3796 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3797 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3798 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3799 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3801 return basic_filebuf_short_ctor_file(this, NULL);
3804 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3805 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3806 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3807 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3809 TRACE("(%p %d)\n", this, uninitialized);
3811 basic_streambuf_wchar_ctor(&this->base);
3812 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3813 return this;
3816 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3817 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3818 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3819 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3821 TRACE("(%p %d)\n", this, uninitialized);
3823 basic_streambuf_short_ctor(&this->base);
3824 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3825 return this;
3828 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3829 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3830 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3831 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3832 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3833 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3835 TRACE("(%p)\n", this);
3837 if(this->close)
3838 basic_filebuf_wchar_close(this);
3839 basic_streambuf_wchar_dtor(&this->base);
3842 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3843 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3845 TRACE("(%p %x)\n", this, flags);
3846 if(flags & 2) {
3847 /* we have an array, with the number of elements stored before the first object */
3848 INT_PTR i, *ptr = (INT_PTR *)this-1;
3850 for(i=*ptr-1; i>=0; i--)
3851 basic_filebuf_wchar_dtor(this+i);
3852 MSVCRT_operator_delete(ptr);
3853 } else {
3854 basic_filebuf_wchar_dtor(this);
3855 if(flags & 1)
3856 MSVCRT_operator_delete(this);
3859 return this;
3862 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3863 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3864 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3865 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3866 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3867 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3869 TRACE("(%p)\n", this);
3870 return this->file != NULL;
3873 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3874 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3875 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3876 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3877 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3878 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3880 FILE *f = NULL;
3882 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3884 if(basic_filebuf_wchar_is_open(this))
3885 return NULL;
3887 if(!(f = _Fiopen_wchar(name, mode, prot)))
3888 return NULL;
3890 basic_filebuf_wchar__Init(this, f, INITFL_open);
3891 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(IOS_LOCALE(&this->base)));
3892 return this;
3895 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3896 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3897 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3898 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3899 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3900 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3902 FILE *f = NULL;
3904 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3906 if(basic_filebuf_wchar_is_open(this))
3907 return NULL;
3909 if(!(f = _Fiopen_wchar(name, mode, prot)))
3910 return NULL;
3912 basic_filebuf_short__Init(this, f, INITFL_open);
3913 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(IOS_LOCALE(&this->base)));
3914 return this;
3917 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3918 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3919 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3920 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3921 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3922 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3924 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3927 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3928 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3929 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3930 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3931 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3932 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3934 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3937 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3938 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3939 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3940 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3942 wchar_t nameW[FILENAME_MAX];
3944 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3946 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3947 return NULL;
3948 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3951 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3952 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3953 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3954 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3956 wchar_t nameW[FILENAME_MAX];
3958 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3960 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3961 return NULL;
3962 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3965 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
3966 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
3967 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
3968 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
3970 TRACE("(%p %p %d)\n", this, name, mode);
3971 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3974 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
3975 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
3976 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3977 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3978 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3979 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3981 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3984 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3985 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3986 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3987 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3989 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3992 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3993 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3994 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3995 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3996 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3997 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3999 char buf[8], *dyn_buf, *to_next;
4000 wchar_t ch = c;
4001 const wchar_t *from_next;
4002 int max_size;
4003 unsigned short ret;
4006 TRACE("(%p %d)\n", this, c);
4008 if(!basic_filebuf_wchar_is_open(this))
4009 return WEOF;
4010 if(c == WEOF)
4011 return !c;
4013 if(!this->cvt)
4014 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
4016 from_next = &ch;
4017 do {
4018 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
4019 &from_next, buf, buf+sizeof(buf), &to_next);
4021 switch(ret) {
4022 case CODECVT_partial:
4023 if(to_next == buf)
4024 break;
4025 /* fall through */
4026 case CODECVT_ok:
4027 if(!fwrite(buf, to_next-buf, 1, this->file))
4028 return WEOF;
4029 if(ret == CODECVT_partial)
4030 continue;
4031 return c;
4032 case CODECVT_noconv:
4033 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
4034 default:
4035 return WEOF;
4038 break;
4039 } while(1);
4041 max_size = codecvt_base_max_length(&this->cvt->base);
4042 dyn_buf = malloc(max_size);
4043 if(!dyn_buf)
4044 return WEOF;
4046 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
4047 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
4049 switch(ret) {
4050 case CODECVT_ok:
4051 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
4052 free(dyn_buf);
4053 return ret ? c : WEOF;
4054 case CODECVT_partial:
4055 ERR("buffer should be big enough to store all output\n");
4056 /* fall through */
4057 default:
4058 free(dyn_buf);
4059 return WEOF;
4063 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
4064 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
4065 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
4066 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
4067 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
4068 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
4070 TRACE("(%p %d)\n", this, c);
4072 if(!basic_filebuf_wchar_is_open(this))
4073 return WEOF;
4075 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
4076 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
4077 basic_streambuf_wchar__Gndec(&this->base);
4078 return c==WEOF ? !c : c;
4079 }else if(c!=WEOF && !this->cvt) {
4080 return ungetwc(c, this->file);
4081 }else if(c!=WEOF && basic_streambuf_wchar_gptr(&this->base)!=&this->putback) {
4082 this->putback = c;
4083 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback, &this->putback+1);
4084 return c;
4087 return WEOF;
4090 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
4091 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
4092 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
4093 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
4094 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
4095 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
4097 wchar_t ch, *to_next;
4098 char buf[128];
4099 const char *buf_next;
4100 int c, j;
4101 size_t i;
4103 TRACE("(%p)\n", this);
4105 if(!basic_filebuf_wchar_is_open(this))
4106 return WEOF;
4108 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
4109 return *basic_streambuf_wchar__Gninc(&this->base);
4111 if(!this->cvt)
4112 return fgetwc(this->file);
4114 buf_next = buf;
4115 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
4116 if((c = fgetc(this->file)) == EOF)
4117 return WEOF;
4118 buf[i] = c;
4120 switch(codecvt_wchar_in(this->cvt, &this->state, buf_next,
4121 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
4122 case CODECVT_partial:
4123 case CODECVT_ok:
4124 if(to_next == &ch)
4125 continue;
4127 for(j = --i; j >= buf_next-buf; j--)
4128 ungetc(buf[j], this->file);
4129 return ch;
4130 case CODECVT_noconv:
4131 if(i+1 < sizeof(wchar_t))
4132 continue;
4134 memcpy(&ch, buf, sizeof(wchar_t));
4135 return ch;
4136 default:
4137 return WEOF;
4141 FIXME("buffer is too small\n");
4142 return WEOF;
4145 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
4146 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
4147 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
4148 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
4149 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
4150 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
4152 unsigned short ret;
4154 TRACE("(%p)\n", this);
4156 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
4157 return *basic_streambuf_wchar_gptr(&this->base);
4159 ret = call_basic_streambuf_wchar_uflow(&this->base);
4160 if(ret != WEOF)
4161 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
4162 return ret;
4165 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4166 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4167 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4168 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4169 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4170 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4171 #if STREAMOFF_BITS == 64
4172 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
4173 #else
4174 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
4175 #endif
4176 fpos_mbstatet* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
4177 fpos_mbstatet *ret, streamoff off, int way, int mode)
4179 fpos_t pos;
4181 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4183 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback) {
4184 if(way == SEEKDIR_cur)
4185 off -= sizeof(wchar_t);
4187 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
4190 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
4191 || fseek(this->file, off, way)) {
4192 ret->off = -1;
4193 ret->pos = 0;
4194 memset(&ret->state, 0, sizeof(ret->state));
4195 return ret;
4198 fgetpos(this->file, &pos);
4199 ret->off = 0;
4200 ret->pos = pos;
4201 ret->state = this->state;
4202 return ret;
4205 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4206 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4207 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4208 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4209 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
4210 fpos_mbstatet* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
4211 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
4213 fpos_t fpos;
4215 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
4217 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
4218 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
4219 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
4220 ret->off = -1;
4221 ret->pos = 0;
4222 memset(&ret->state, 0, sizeof(ret->state));
4223 return ret;
4226 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback)
4227 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
4229 fgetpos(this->file, &fpos);
4230 ret->off = 0;
4231 ret->pos = fpos;
4232 ret->state = this->state;
4233 return ret;
4236 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
4237 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
4238 #if STREAMSIZE_BITS == 64
4239 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
4240 #else
4241 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
4242 #endif
4243 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
4245 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
4247 if(!basic_filebuf_wchar_is_open(this))
4248 return NULL;
4250 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
4251 return NULL;
4253 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
4254 return &this->base;
4257 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
4258 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
4259 #if STREAMSIZE_BITS == 64
4260 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
4261 #else
4262 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
4263 #endif
4264 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
4266 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
4268 if(!basic_filebuf_wchar_is_open(this))
4269 return NULL;
4271 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
4272 return NULL;
4274 basic_filebuf_short__Init(this, this->file, INITFL_open);
4275 return &this->base;
4278 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
4279 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
4280 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
4281 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
4282 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
4283 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
4285 TRACE("(%p)\n", this);
4287 if(!basic_filebuf_wchar_is_open(this))
4288 return 0;
4290 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
4291 return 0;
4292 return fflush(this->file);
4295 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
4296 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
4297 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
4298 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
4300 TRACE("(%p %p)\n", this, loc);
4301 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(loc));
4304 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
4305 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
4306 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
4307 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
4309 TRACE("(%p %p)\n", this, loc);
4310 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(loc));
4313 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
4314 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
4315 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
4316 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
4317 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
4318 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
4320 int state = 0;
4322 if(!(mode & OPENMODE_in))
4323 state |= STRINGBUF_no_read;
4325 if(!(mode & OPENMODE_out))
4326 state |= STRINGBUF_no_write;
4328 if(mode & OPENMODE_ate)
4329 state |= STRINGBUF_at_end;
4331 if(mode & OPENMODE_app)
4332 state |= STRINGBUF_append;
4334 return state;
4337 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
4338 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
4339 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
4340 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
4342 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
4344 basic_streambuf_char__Init_empty(&this->base);
4346 this->state = state;
4347 this->seekhigh = NULL;
4349 if(count && str) {
4350 char *buf = MSVCRT_operator_new(count);
4351 if(!buf) {
4352 ERR("Out of memory\n");
4353 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4356 memcpy(buf, str, count);
4357 this->seekhigh = buf + count;
4359 this->state |= STRINGBUF_allocated;
4361 if(!(state & STRINGBUF_no_read))
4362 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
4364 if(!(state & STRINGBUF_no_write)) {
4365 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4367 if(!basic_streambuf_char_gptr(&this->base))
4368 basic_streambuf_char_setg(&this->base, buf, 0, buf);
4373 /* ??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 */
4374 /* ??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 */
4375 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
4376 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
4377 const basic_string_char *str, IOSB_openmode mode)
4379 TRACE("(%p %p %d)\n", this, str, mode);
4381 basic_streambuf_char_ctor(&this->base);
4382 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4384 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
4385 str->size, basic_stringbuf_char__Getstate(this, mode));
4386 return this;
4389 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
4390 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
4391 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
4392 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
4393 basic_stringbuf_char *this, IOSB_openmode mode)
4395 TRACE("(%p %d)\n", this, mode);
4397 basic_streambuf_char_ctor(&this->base);
4398 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4400 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
4401 return this;
4404 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
4405 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
4406 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
4407 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
4409 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4412 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
4413 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
4414 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
4415 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
4417 TRACE("(%p)\n", this);
4419 if(this->state & STRINGBUF_allocated) {
4420 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
4421 this->seekhigh = NULL;
4422 this->state &= ~STRINGBUF_allocated;
4425 basic_streambuf_char__Init_empty(&this->base);
4428 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
4429 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
4430 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
4431 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
4433 TRACE("(%p)\n", this);
4435 basic_stringbuf_char__Tidy(this);
4436 basic_streambuf_char_dtor(&this->base);
4439 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
4440 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
4442 TRACE("(%p %x)\n", this, flags);
4444 if(flags & 2) {
4445 /* we have an array, with the number of elements stored before the first object */
4446 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4448 for (i = *ptr - 1; i >= 0; i--)
4449 basic_stringbuf_char_dtor(this+i);
4451 MSVCRT_operator_delete(ptr);
4452 }else {
4453 basic_stringbuf_char_dtor(this);
4455 if(flags & 1)
4456 MSVCRT_operator_delete(this);
4459 return this;
4462 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4463 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4464 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
4465 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
4467 MSVCP_size_t oldsize, size;
4468 char *ptr, *buf;
4470 TRACE("(%p %x)\n", this, meta);
4472 if(meta == EOF)
4473 return !EOF;
4474 if(this->state & STRINGBUF_no_write)
4475 return EOF;
4477 ptr = basic_streambuf_char_pptr(&this->base);
4478 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4479 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
4480 this->seekhigh, basic_streambuf_char_epptr(&this->base));
4482 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
4483 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4485 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
4486 size = oldsize|0xf;
4487 size += size/2;
4488 buf = MSVCRT_operator_new(size);
4489 if(!buf) {
4490 ERR("Out of memory\n");
4491 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4494 if(!oldsize) {
4495 this->seekhigh = buf;
4496 basic_streambuf_char_setp(&this->base, buf, buf+size);
4497 if(this->state & STRINGBUF_no_read)
4498 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4499 else
4500 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
4502 this->state |= STRINGBUF_allocated;
4503 }else {
4504 ptr = basic_streambuf_char_eback(&this->base);
4505 memcpy(buf, ptr, oldsize);
4507 this->seekhigh = buf+(this->seekhigh-ptr);
4508 basic_streambuf_char_setp_next(&this->base, buf,
4509 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
4510 if(this->state & STRINGBUF_no_read)
4511 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4512 else
4513 basic_streambuf_char_setg(&this->base, buf,
4514 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
4515 basic_streambuf_char_pptr(&this->base)+1);
4517 MSVCRT_operator_delete(ptr);
4520 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4523 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4524 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4525 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
4526 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
4528 char *cur;
4530 TRACE("(%p %x)\n", this, c);
4532 cur = basic_streambuf_char_gptr(&this->base);
4533 if(!cur || cur==basic_streambuf_char_eback(&this->base)
4534 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4535 return EOF;
4537 if(c != EOF)
4538 cur[-1] = c;
4539 basic_streambuf_char_gbump(&this->base, -1);
4540 return c==EOF ? !EOF : c;
4543 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
4544 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
4545 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
4546 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
4548 char *ptr, *cur;
4550 TRACE("(%p)\n", this);
4552 cur = basic_streambuf_char_gptr(&this->base);
4553 if(!cur || this->state&STRINGBUF_no_read)
4554 return EOF;
4556 ptr = basic_streambuf_char_pptr(&this->base);
4557 if(this->seekhigh < ptr)
4558 this->seekhigh = ptr;
4560 ptr = basic_streambuf_char_egptr(&this->base);
4561 if(this->seekhigh > ptr)
4562 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
4564 if(cur < this->seekhigh)
4565 return (unsigned char)*cur;
4566 return EOF;
4569 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4570 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4571 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4572 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4573 #if STREAMOFF_BITS == 64
4574 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
4575 #else
4576 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
4577 #endif
4578 fpos_mbstatet* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
4579 fpos_mbstatet *ret, streamoff off, int way, int mode)
4581 char *beg, *cur_r, *cur_w;
4583 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4585 cur_w = basic_streambuf_char_pptr(&this->base);
4586 if(cur_w > this->seekhigh)
4587 this->seekhigh = cur_w;
4589 ret->off = 0;
4590 ret->pos = 0;
4591 memset(&ret->state, 0, sizeof(ret->state));
4593 beg = basic_streambuf_char_eback(&this->base);
4594 cur_r = basic_streambuf_char_gptr(&this->base);
4595 if((mode & OPENMODE_in) && cur_r) {
4596 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4597 off += cur_r-beg;
4598 else if(way == SEEKDIR_end)
4599 off += this->seekhigh-beg;
4600 else if(way != SEEKDIR_beg)
4601 off = -1;
4603 if(off<0 || off>this->seekhigh-beg) {
4604 off = -1;
4605 }else {
4606 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
4607 if((mode & OPENMODE_out) && cur_w) {
4608 basic_streambuf_char_setp_next(&this->base, beg,
4609 basic_streambuf_char_gptr(&this->base),
4610 basic_streambuf_char_epptr(&this->base));
4613 }else if((mode & OPENMODE_out) && cur_w) {
4614 if(way == SEEKDIR_cur)
4615 off += cur_w-beg;
4616 else if(way == SEEKDIR_end)
4617 off += this->seekhigh-beg;
4618 else if(way != SEEKDIR_beg)
4619 off = -1;
4621 if(off<0 || off>this->seekhigh-beg)
4622 off = -1;
4623 else
4624 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
4625 }else {
4626 off = -1;
4629 ret->off = off;
4630 return ret;
4633 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4634 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4635 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
4636 fpos_mbstatet* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
4637 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
4639 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
4641 if(pos.off==-1 && pos.pos==0 && MBSTATET_TO_INT(&pos.state)==0) {
4642 *ret = pos;
4643 return ret;
4646 return basic_stringbuf_char_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4649 /* ?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 */
4650 /* ?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 */
4651 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
4652 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
4654 TRACE("(%p %p)\n", this, str);
4656 basic_stringbuf_char__Tidy(this);
4657 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
4660 /* ?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 */
4661 /* ?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 */
4662 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
4663 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
4665 char *ptr;
4667 TRACE("(%p)\n", this);
4669 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
4670 char *pptr;
4672 ptr = basic_streambuf_char_pbase(&this->base);
4673 pptr = basic_streambuf_char_pptr(&this->base);
4675 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4678 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
4679 ptr = basic_streambuf_char_eback(&this->base);
4680 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
4683 return MSVCP_basic_string_char_ctor(ret);
4686 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
4687 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
4688 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4689 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4690 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4691 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4692 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
4693 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
4695 int state = 0;
4697 if(!(mode & OPENMODE_in))
4698 state |= STRINGBUF_no_read;
4700 if(!(mode & OPENMODE_out))
4701 state |= STRINGBUF_no_write;
4703 if(mode & OPENMODE_ate)
4704 state |= STRINGBUF_at_end;
4706 if(mode & OPENMODE_app)
4707 state |= STRINGBUF_append;
4709 return state;
4712 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
4713 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
4714 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
4715 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
4716 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
4717 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
4719 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
4721 basic_streambuf_wchar__Init_empty(&this->base);
4723 this->state = state;
4724 this->seekhigh = NULL;
4726 if(count && str) {
4727 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
4728 if(!buf) {
4729 ERR("Out of memory\n");
4730 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4733 memcpy(buf, str, count*sizeof(wchar_t));
4734 this->seekhigh = buf + count;
4736 this->state |= STRINGBUF_allocated;
4738 if(!(state & STRINGBUF_no_read))
4739 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
4741 if(!(state & STRINGBUF_no_write)) {
4742 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4744 if(!basic_streambuf_wchar_gptr(&this->base))
4745 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
4750 /* ??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 */
4751 /* ??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 */
4752 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
4753 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
4754 const basic_string_wchar *str, IOSB_openmode mode)
4756 TRACE("(%p %p %d)\n", this, str, mode);
4758 basic_streambuf_wchar_ctor(&this->base);
4759 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4761 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
4762 str->size, basic_stringbuf_wchar__Getstate(this, mode));
4763 return this;
4766 /* ??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 */
4767 /* ??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 */
4768 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
4769 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
4770 const basic_string_wchar *str, IOSB_openmode mode)
4772 basic_stringbuf_wchar_ctor_str(this, str, mode);
4773 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4774 return this;
4777 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4778 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4779 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4780 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4781 basic_stringbuf_wchar *this, IOSB_openmode mode)
4783 TRACE("(%p %d)\n", this, mode);
4785 basic_streambuf_wchar_ctor(&this->base);
4786 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4788 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4789 return this;
4792 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4793 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4794 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4795 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4796 basic_stringbuf_wchar *this, IOSB_openmode mode)
4798 basic_stringbuf_wchar_ctor_mode(this, mode);
4799 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4800 return this;
4803 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4804 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4805 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4806 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4808 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4811 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4812 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4813 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4814 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4816 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4819 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4820 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4821 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4822 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4823 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4824 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4826 TRACE("(%p)\n", this);
4828 if(this->state & STRINGBUF_allocated) {
4829 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4830 this->seekhigh = NULL;
4831 this->state &= ~STRINGBUF_allocated;
4834 basic_streambuf_wchar__Init_empty(&this->base);
4837 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4838 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4839 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4840 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4841 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4842 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4844 TRACE("(%p)\n", this);
4846 basic_stringbuf_wchar__Tidy(this);
4847 basic_streambuf_wchar_dtor(&this->base);
4850 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4851 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4853 TRACE("(%p %x)\n", this, flags);
4855 if(flags & 2) {
4856 /* we have an array, with the number of elements stored before the first object */
4857 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4859 for (i = *ptr - 1; i >= 0; i--)
4860 basic_stringbuf_wchar_dtor(this+i);
4862 MSVCRT_operator_delete(ptr);
4863 }else {
4864 basic_stringbuf_wchar_dtor(this);
4866 if(flags & 1)
4867 MSVCRT_operator_delete(this);
4870 return this;
4873 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4874 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4875 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4876 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4877 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4878 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4880 MSVCP_size_t oldsize, size;
4881 wchar_t *ptr, *buf;
4883 TRACE("(%p %x)\n", this, meta);
4885 if(meta == WEOF)
4886 return !WEOF;
4887 if(this->state & STRINGBUF_no_write)
4888 return WEOF;
4890 ptr = basic_streambuf_wchar_pptr(&this->base);
4891 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4892 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4893 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4895 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4896 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4898 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4899 size = oldsize|0xf;
4900 size += size/2;
4901 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4902 if(!buf) {
4903 ERR("Out of memory\n");
4904 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4907 if(!oldsize) {
4908 this->seekhigh = buf;
4909 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4910 if(this->state & STRINGBUF_no_read)
4911 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4912 else
4913 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4915 this->state |= STRINGBUF_allocated;
4916 }else {
4917 ptr = basic_streambuf_wchar_eback(&this->base);
4918 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4920 this->seekhigh = buf+(this->seekhigh-ptr);
4921 basic_streambuf_wchar_setp_next(&this->base, buf,
4922 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4923 if(this->state & STRINGBUF_no_read)
4924 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4925 else
4926 basic_streambuf_wchar_setg(&this->base, buf,
4927 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4928 basic_streambuf_wchar_pptr(&this->base)+1);
4930 MSVCRT_operator_delete(ptr);
4933 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4936 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4937 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4938 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4939 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4940 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4941 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4943 wchar_t *cur;
4945 TRACE("(%p %x)\n", this, c);
4947 cur = basic_streambuf_wchar_gptr(&this->base);
4948 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4949 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4950 return WEOF;
4952 if(c != WEOF)
4953 cur[-1] = c;
4954 basic_streambuf_wchar_gbump(&this->base, -1);
4955 return c==WEOF ? !WEOF : c;
4958 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4959 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4960 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4961 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4962 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4963 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4965 wchar_t *ptr, *cur;
4967 TRACE("(%p)\n", this);
4969 cur = basic_streambuf_wchar_gptr(&this->base);
4970 if(!cur || this->state&STRINGBUF_no_read)
4971 return WEOF;
4973 ptr = basic_streambuf_wchar_pptr(&this->base);
4974 if(this->seekhigh < ptr)
4975 this->seekhigh = ptr;
4977 ptr = basic_streambuf_wchar_egptr(&this->base);
4978 if(this->seekhigh > ptr)
4979 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4981 if(cur < this->seekhigh)
4982 return *cur;
4983 return WEOF;
4986 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4987 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4988 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4989 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4990 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4991 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4992 #if STREAMOFF_BITS == 64
4993 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4994 #else
4995 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4996 #endif
4997 fpos_mbstatet* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4998 fpos_mbstatet *ret, streamoff off, int way, int mode)
5000 wchar_t *beg, *cur_r, *cur_w;
5002 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
5004 cur_w = basic_streambuf_wchar_pptr(&this->base);
5005 if(cur_w > this->seekhigh)
5006 this->seekhigh = cur_w;
5008 ret->off = 0;
5009 ret->pos = 0;
5010 memset(&ret->state, 0, sizeof(ret->state));
5012 beg = basic_streambuf_wchar_eback(&this->base);
5013 cur_r = basic_streambuf_wchar_gptr(&this->base);
5014 if((mode & OPENMODE_in) && cur_r) {
5015 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
5016 off += cur_r-beg;
5017 else if(way == SEEKDIR_end)
5018 off += this->seekhigh-beg;
5019 else if(way != SEEKDIR_beg)
5020 off = -1;
5022 if(off<0 || off>this->seekhigh-beg) {
5023 off = -1;
5024 }else {
5025 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
5026 if((mode & OPENMODE_out) && cur_w) {
5027 basic_streambuf_wchar_setp_next(&this->base, beg,
5028 basic_streambuf_wchar_gptr(&this->base),
5029 basic_streambuf_wchar_epptr(&this->base));
5032 }else if((mode & OPENMODE_out) && cur_w) {
5033 if(way == SEEKDIR_cur)
5034 off += cur_w-beg;
5035 else if(way == SEEKDIR_end)
5036 off += this->seekhigh-beg;
5037 else if(way != SEEKDIR_beg)
5038 off = -1;
5040 if(off<0 || off>this->seekhigh-beg)
5041 off = -1;
5042 else
5043 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
5044 }else {
5045 off = -1;
5048 ret->off = off;
5049 return ret;
5052 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
5053 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
5054 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
5055 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
5056 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
5057 fpos_mbstatet* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
5058 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
5060 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
5062 if(pos.off==-1 && pos.pos==0 && MBSTATET_TO_INT(&pos.state)==0) {
5063 *ret = pos;
5064 return ret;
5067 return basic_stringbuf_wchar_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
5070 /* ?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 */
5071 /* ?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 */
5072 /* ?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 */
5073 /* ?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 */
5074 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
5075 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
5077 TRACE("(%p %p)\n", this, str);
5079 basic_stringbuf_wchar__Tidy(this);
5080 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
5083 /* ?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 */
5084 /* ?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 */
5085 /* ?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 */
5086 /* ?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 */
5087 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
5088 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
5090 wchar_t *ptr;
5092 TRACE("(%p)\n", this);
5094 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
5095 wchar_t *pptr;
5097 ptr = basic_streambuf_wchar_pbase(&this->base);
5098 pptr = basic_streambuf_wchar_pptr(&this->base);
5100 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
5103 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
5104 ptr = basic_streambuf_wchar_eback(&this->base);
5105 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
5108 return MSVCP_basic_string_wchar_ctor(ret);
5111 /* ??0ios_base@std@@IAE@XZ */
5112 /* ??0ios_base@std@@IEAA@XZ */
5113 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
5114 ios_base* __thiscall ios_base_ctor(ios_base *this)
5116 TRACE("(%p)\n", this);
5117 this->vtable = &MSVCP_ios_base_vtable;
5118 return this;
5121 /* ??0ios_base@std@@QAE@ABV01@@Z */
5122 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
5123 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
5124 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
5126 TRACE("(%p %p)\n", this, copy);
5127 *this = *copy;
5128 this->vtable = &MSVCP_ios_base_vtable;
5129 return this;
5132 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
5133 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
5134 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
5135 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
5137 IOS_BASE_fnarray *cur;
5139 TRACE("(%p %x)\n", this, event);
5141 for(cur=this->calls; cur; cur=cur->next)
5142 cur->event_handler(event, this, cur->index);
5145 /* ?_Tidy@ios_base@std@@AAAXXZ */
5146 /* ?_Tidy@ios_base@std@@AEAAXXZ */
5147 void __cdecl ios_base_Tidy(ios_base *this)
5149 IOS_BASE_iosarray *arr_cur, *arr_next;
5150 IOS_BASE_fnarray *event_cur, *event_next;
5152 TRACE("(%p)\n", this);
5154 ios_base_Callfns(this, EVENT_erase_event);
5156 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
5157 arr_next = arr_cur->next;
5158 MSVCRT_operator_delete(arr_cur);
5160 this->arr = NULL;
5162 for(event_cur=this->calls; event_cur; event_cur=event_next) {
5163 event_next = event_cur->next;
5164 MSVCRT_operator_delete(event_cur);
5166 this->calls = NULL;
5169 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
5170 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
5171 void __cdecl ios_base_Ios_base_dtor(ios_base *obj)
5173 TRACE("(%p)\n", obj);
5174 locale_dtor(IOS_LOCALE(obj));
5175 #if _MSVCP_VER >= 70
5176 MSVCRT_operator_delete(obj->loc);
5177 #endif
5178 ios_base_Tidy(obj);
5181 /* ??1ios_base@std@@UAE@XZ */
5182 /* ??1ios_base@std@@UEAA@XZ */
5183 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
5184 void __thiscall ios_base_dtor(ios_base *this)
5186 ios_base_Ios_base_dtor(this);
5189 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
5190 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
5192 TRACE("(%p %x)\n", this, flags);
5193 if(flags & 2) {
5194 /* we have an array, with the number of elements stored before the first object */
5195 INT_PTR i, *ptr = (INT_PTR *)this-1;
5197 for(i=*ptr-1; i>=0; i--)
5198 ios_base_dtor(this+i);
5199 MSVCRT_operator_delete(ptr);
5200 } else {
5201 ios_base_dtor(this);
5202 if(flags & 1)
5203 MSVCRT_operator_delete(this);
5206 return this;
5209 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
5210 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
5212 TRACE("(%p %x)\n", this, flags);
5213 if(flags & 2) {
5214 INT_PTR *ptr = (INT_PTR *)this-1;
5215 MSVCRT_operator_delete(ptr);
5216 } else {
5217 if(flags & 1)
5218 MSVCRT_operator_delete(this);
5221 return this;
5224 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
5225 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
5226 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
5227 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
5229 IOS_BASE_iosarray *p;
5231 TRACE("(%p %d)\n", this, index);
5233 for(p=this->arr; p; p=p->next) {
5234 if(p->index == index)
5235 return p;
5238 for(p=this->arr; p; p=p->next) {
5239 if(!p->long_val && !p->ptr_val) {
5240 p->index = index;
5241 return p;
5245 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
5246 p->next = this->arr;
5247 p->index = index;
5248 p->long_val = 0;
5249 p->ptr_val = NULL;
5250 this->arr = p;
5251 return p;
5254 /* ?iword@ios_base@std@@QAEAAJH@Z */
5255 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
5256 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
5257 LONG* __thiscall ios_base_iword(ios_base *this, int index)
5259 TRACE("(%p %d)\n", this, index);
5260 return &ios_base_Findarr(this, index)->long_val;
5263 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
5264 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
5265 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
5266 void** __thiscall ios_base_pword(ios_base *this, int index)
5268 TRACE("(%p %d)\n", this, index);
5269 return &ios_base_Findarr(this, index)->ptr_val;
5272 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
5273 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
5274 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
5275 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
5277 IOS_BASE_fnarray *event;
5279 TRACE("(%p %p %d)\n", this, callback, index);
5281 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
5282 event->next = this->calls;
5283 event->index = index;
5284 event->event_handler = callback;
5285 this->calls = event;
5288 /* ?clear@ios_base@std@@QAEXH_N@Z */
5289 /* ?clear@ios_base@std@@QEAAXH_N@Z */
5290 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
5291 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5293 TRACE("(%p %x %x)\n", this, state, reraise);
5295 this->state = state & IOSTATE_mask;
5296 if(!(this->state & this->except))
5297 return;
5299 if(reraise)
5300 throw_exception(EXCEPTION_RERAISE, NULL);
5301 else if(this->state & this->except & IOSTATE_eofbit)
5302 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
5303 else if(this->state & this->except & IOSTATE_failbit)
5304 throw_exception(EXCEPTION_FAILURE, "failbit is set");
5305 else if(this->state & this->except & IOSTATE_badbit)
5306 throw_exception(EXCEPTION_FAILURE, "badbit is set");
5307 else if(this->state & this->except & IOSTATE__Hardfail)
5308 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
5311 /* ?clear@ios_base@std@@QAEXH@Z */
5312 /* ?clear@ios_base@std@@QEAAXH@Z */
5313 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
5314 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
5316 ios_base_clear_reraise(this, state, FALSE);
5319 /* ?clear@ios_base@std@@QAEXI@Z */
5320 /* ?clear@ios_base@std@@QEAAXI@Z */
5321 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
5322 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
5324 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
5327 /* ?exceptions@ios_base@std@@QAEXH@Z */
5328 /* ?exceptions@ios_base@std@@QEAAXH@Z */
5329 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
5330 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
5332 TRACE("(%p %x)\n", this, state);
5333 this->except = state & IOSTATE_mask;
5334 ios_base_clear(this, this->state);
5337 /* ?exceptions@ios_base@std@@QAEXI@Z */
5338 /* ?exceptions@ios_base@std@@QEAAXI@Z */
5339 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
5340 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
5342 TRACE("(%p %x)\n", this, state);
5343 ios_base_exceptions_set(this, state);
5346 /* ?exceptions@ios_base@std@@QBEHXZ */
5347 /* ?exceptions@ios_base@std@@QEBAHXZ */
5348 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
5349 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
5351 TRACE("(%p)\n", this);
5352 return this->except;
5355 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
5356 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
5357 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
5358 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
5360 TRACE("(%p %p)\n", this, rhs);
5362 if(this != rhs) {
5363 IOS_BASE_iosarray *arr_cur;
5364 IOS_BASE_fnarray *event_cur;
5366 ios_base_Tidy(this);
5368 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
5369 if(arr_cur->long_val)
5370 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
5371 if(arr_cur->ptr_val)
5372 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
5374 this->stdstr = rhs->stdstr;
5375 this->fmtfl = rhs->fmtfl;
5376 this->prec = rhs->prec;
5377 this->wide = rhs->wide;
5378 locale_operator_assign(IOS_LOCALE(this), IOS_LOCALE(rhs));
5380 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
5381 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
5383 ios_base_Callfns(this, EVENT_copyfmt_event);
5384 ios_base_exceptions_set(this, rhs->except);
5387 return this;
5390 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
5391 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
5392 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
5393 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
5395 TRACE("(%p %p)\n", this, right);
5397 if(this != right) {
5398 this->state = right->state;
5399 ios_base_copyfmt(this, right);
5402 return this;
5405 /* ?fail@ios_base@std@@QBE_NXZ */
5406 /* ?fail@ios_base@std@@QEBA_NXZ */
5407 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
5408 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
5410 TRACE("(%p)\n", this);
5411 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
5414 /* ??7ios_base@std@@QBE_NXZ */
5415 /* ??7ios_base@std@@QEBA_NXZ */
5416 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
5417 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
5419 TRACE("(%p)\n", this);
5420 return ios_base_fail(this);
5423 /* ??Bios_base@std@@QBEPAXXZ */
5424 /* ??Bios_base@std@@QEBAPEAXXZ */
5425 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
5426 void* __thiscall ios_base_op_fail(const ios_base *this)
5428 TRACE("(%p)\n", this);
5429 return ios_base_fail(this) ? NULL : (void*)this;
5432 /* ??Bios_base@std@@QBA_NXZ */
5433 /* ??Bios_base@std@@QBE_NXZ */
5434 /* ??Bios_base@std@@QEBA_NXZ */
5435 DEFINE_THISCALL_WRAPPER(ios_base_operator_bool, 4)
5436 MSVCP_bool __thiscall ios_base_operator_bool(const ios_base *this)
5438 TRACE("(%p)\n", this);
5439 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) == 0;
5442 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
5443 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
5444 void __cdecl ios_base_Addstd(ios_base *add)
5446 FIXME("(%p) stub\n", add);
5449 /* ?_Index_func@ios_base@std@@CAAAHXZ */
5450 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
5451 int* __cdecl ios_base_Index_func(void)
5453 TRACE("\n");
5454 return &ios_base_Index;
5457 /* ?_Init@ios_base@std@@IAEXXZ */
5458 /* ?_Init@ios_base@std@@IEAAXXZ */
5459 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
5460 void __thiscall ios_base__Init(ios_base *this)
5462 TRACE("(%p)\n", this);
5464 this->stdstr = 0;
5465 this->state = this->except = IOSTATE_goodbit;
5466 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
5467 this->prec = 6;
5468 this->wide = 0;
5469 this->arr = NULL;
5470 this->calls = NULL;
5471 #if _MSVCP_VER >= 70
5472 this->loc = MSVCRT_operator_new(sizeof(locale));
5473 #endif
5474 locale_ctor(IOS_LOCALE(this));
5477 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
5478 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
5479 MSVCP_bool* __cdecl ios_base_Sync_func(void)
5481 TRACE("\n");
5482 return &ios_base_Sync;
5485 /* ?bad@ios_base@std@@QBE_NXZ */
5486 /* ?bad@ios_base@std@@QEBA_NXZ */
5487 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
5488 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
5490 TRACE("(%p)\n", this);
5491 return (this->state & IOSTATE_badbit) != 0;
5494 /* ?eof@ios_base@std@@QBE_NXZ */
5495 /* ?eof@ios_base@std@@QEBA_NXZ */
5496 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
5497 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
5499 TRACE("(%p)\n", this);
5500 return (this->state & IOSTATE_eofbit) != 0;
5503 /* ?flags@ios_base@std@@QAEHH@Z */
5504 /* ?flags@ios_base@std@@QEAAHH@Z */
5505 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
5506 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
5508 IOSB_fmtflags ret = this->fmtfl;
5510 TRACE("(%p %x)\n", this, flags);
5512 this->fmtfl = flags & FMTFLAG_mask;
5513 return ret;
5516 /* ?flags@ios_base@std@@QBEHXZ */
5517 /* ?flags@ios_base@std@@QEBAHXZ */
5518 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
5519 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
5521 TRACE("(%p)\n", this);
5522 return this->fmtfl;
5525 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
5526 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
5527 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
5528 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
5530 TRACE("(%p)\n", this);
5531 return locale_copy_ctor(ret, IOS_LOCALE(this));
5534 /* ?good@ios_base@std@@QBE_NXZ */
5535 /* ?good@ios_base@std@@QEBA_NXZ */
5536 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
5537 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
5539 TRACE("(%p)\n", this);
5540 return this->state == IOSTATE_goodbit;
5543 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
5544 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
5545 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
5546 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
5548 TRACE("(%p %p)\n", this, loc);
5549 *ret = *IOS_LOCALE(this);
5550 locale_copy_ctor(IOS_LOCALE(this), loc);
5551 return ret;
5554 /* ?precision@ios_base@std@@QAEHH@Z */
5555 /* ?precision@ios_base@std@@QEAA_J_J@Z */
5556 #if STREAMSIZE_BITS == 64
5557 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
5558 #else
5559 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
5560 #endif
5561 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
5563 streamsize ret = this->prec;
5565 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
5567 this->prec = precision;
5568 return ret;
5571 /* ?precision@ios_base@std@@QBEHXZ */
5572 /* ?precision@ios_base@std@@QEBA_JXZ */
5573 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
5574 streamsize __thiscall ios_base_precision_get(const ios_base *this)
5576 TRACE("(%p)\n", this);
5577 return this->prec;
5580 /* ?rdstate@ios_base@std@@QBEHXZ */
5581 /* ?rdstate@ios_base@std@@QEBAHXZ */
5582 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
5583 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
5585 TRACE("(%p)\n", this);
5586 return this->state;
5589 /* ?setf@ios_base@std@@QAEHHH@Z */
5590 /* ?setf@ios_base@std@@QEAAHHH@Z */
5591 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
5592 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
5594 IOSB_fmtflags ret = this->fmtfl;
5596 TRACE("(%p %x %x)\n", this, flags, mask);
5598 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
5599 return ret;
5602 /* ?setf@ios_base@std@@QAEHH@Z */
5603 /* ?setf@ios_base@std@@QEAAHH@Z */
5604 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
5605 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
5607 IOSB_fmtflags ret = this->fmtfl;
5609 TRACE("(%p %x)\n", this, flags);
5611 this->fmtfl |= flags & FMTFLAG_mask;
5612 return ret;
5615 /* ?setstate@ios_base@std@@QAEXH_N@Z */
5616 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
5617 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
5618 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5620 TRACE("(%p %x %x)\n", this, state, reraise);
5622 if(state != IOSTATE_goodbit)
5623 ios_base_clear_reraise(this, this->state | state, reraise);
5626 /* ?setstate@ios_base@std@@QAEXH@Z */
5627 /* ?setstate@ios_base@std@@QEAAXH@Z */
5628 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
5629 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
5631 ios_base_setstate_reraise(this, state, FALSE);
5634 /* ?setstate@ios_base@std@@QAEXI@Z */
5635 /* ?setstate@ios_base@std@@QEAAXI@Z */
5636 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
5637 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
5639 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5642 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
5643 MSVCP_bool __cdecl ios_base_sync_with_stdio(MSVCP_bool sync)
5645 _Lockit lock;
5646 MSVCP_bool ret;
5648 TRACE("(%x)\n", sync);
5650 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5651 ret = ios_base_Sync;
5652 ios_base_Sync = sync;
5653 _Lockit_dtor(&lock);
5654 return ret;
5657 /* ?unsetf@ios_base@std@@QAEXH@Z */
5658 /* ?unsetf@ios_base@std@@QEAAXH@Z */
5659 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
5660 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
5662 TRACE("(%p %x)\n", this, flags);
5663 this->fmtfl &= ~flags;
5666 /* ?width@ios_base@std@@QAEHH@Z */
5667 /* ?width@ios_base@std@@QEAA_J_J@Z */
5668 #if STREAMSIZE_BITS == 64
5669 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
5670 #else
5671 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
5672 #endif
5673 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
5675 streamsize ret = this->wide;
5677 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
5679 this->wide = width;
5680 return ret;
5683 /* ?width@ios_base@std@@QBEHXZ */
5684 /* ?width@ios_base@std@@QEBA_JXZ */
5685 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
5686 streamsize __thiscall ios_base_width_get(ios_base *this)
5688 TRACE("(%p)\n", this);
5689 return this->wide;
5692 /* ?xalloc@ios_base@std@@SAHXZ */
5693 int __cdecl ios_base_xalloc(void)
5695 _Lockit lock;
5696 int ret;
5698 TRACE("\n");
5700 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5701 ret = ios_base_Index++;
5702 _Lockit_dtor(&lock);
5703 return ret;
5706 /* ?swap@ios_base@std@@QAEXAAV12@@Z */
5707 /* ?swap@ios_base@std@@QEAAXAEAV12@@Z */
5708 DEFINE_THISCALL_WRAPPER(ios_base_swap, 8)
5709 void __thiscall ios_base_swap(ios_base *this, ios_base *r)
5711 ios_base tmp;
5713 TRACE("(%p %p)\n", this, r);
5715 if(this == r)
5716 return;
5718 tmp = *this;
5719 *this = *r;
5720 this->vtable = tmp.vtable;
5721 tmp.vtable = r->vtable;
5722 *r = tmp;
5725 DEFINE_THISCALL_WRAPPER(basic_ios__Add_vtordisp1, 4)
5726 void __thiscall basic_ios__Add_vtordisp1(void *this)
5728 WARN("should not be called (%p)\n", this);
5731 DEFINE_THISCALL_WRAPPER(basic_ios__Add_vtordisp2, 4)
5732 void __thiscall basic_ios__Add_vtordisp2(void *this)
5734 WARN("should not be called (%p)\n", this);
5737 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
5738 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
5739 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
5740 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
5742 TRACE("(%p)\n", this);
5744 ios_base_ctor(&this->base);
5745 this->base.vtable = &MSVCP_basic_ios_char_vtable;
5746 return this;
5749 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5750 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5751 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
5752 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
5754 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5755 ios_base__Init(&this->base);
5756 this->strbuf = streambuf;
5757 this->stream = NULL;
5758 this->fillch = ' ';
5760 if(!streambuf)
5761 ios_base_setstate(&this->base, IOSTATE_badbit);
5763 if(isstd)
5764 FIXME("standard streams not handled yet\n");
5767 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5768 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5769 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
5770 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
5772 TRACE("(%p %p)\n", this, strbuf);
5774 basic_ios_char_ctor(this);
5775 basic_ios_char_init(this, strbuf, FALSE);
5776 return this;
5779 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
5780 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5781 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
5782 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
5784 TRACE("(%p)\n", this);
5785 ios_base_dtor(&this->base);
5788 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
5789 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
5791 TRACE("(%p %x)\n", this, flags);
5792 if(flags & 2) {
5793 /* we have an array, with the number of elements stored before the first object */
5794 INT_PTR i, *ptr = (INT_PTR *)this-1;
5796 for(i=*ptr-1; i>=0; i--)
5797 basic_ios_char_dtor(this+i);
5798 MSVCRT_operator_delete(ptr);
5799 } else {
5800 basic_ios_char_dtor(this);
5801 if(flags & 1)
5802 MSVCRT_operator_delete(this);
5805 return this;
5808 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5809 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5810 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5811 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5813 TRACE("(%p %x %x)\n", this, state, reraise);
5814 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5817 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5818 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5819 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5820 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5822 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5825 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5826 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5827 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5828 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5830 TRACE("(%p %p)\n", this, copy);
5831 if(this == copy)
5832 return this;
5834 this->stream = copy->stream;
5835 this->fillch = copy->fillch;
5836 ios_base_copyfmt(&this->base, &copy->base);
5837 return this;
5840 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5841 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5842 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5843 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5845 char ret = this->fillch;
5847 TRACE("(%p %c)\n", this, fill);
5849 this->fillch = fill;
5850 return ret;
5853 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5854 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5855 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5856 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5858 TRACE("(%p)\n", this);
5859 return this->fillch;
5862 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5863 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5864 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5865 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5867 TRACE("(%p %p %p)\n", this, ret, loc);
5869 if(this->strbuf) {
5870 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5871 locale_dtor(ret);
5874 return ios_base_imbue(&this->base, ret, loc);
5877 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5878 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5879 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5880 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5882 TRACE("(%p %c %c)\n", this, ch, def);
5883 return ctype_char_narrow_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5886 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5887 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5888 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5889 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5891 basic_streambuf_char *ret = this->strbuf;
5893 TRACE("(%p %p)\n", this, streambuf);
5895 this->strbuf = streambuf;
5896 basic_ios_char_clear(this, IOSTATE_goodbit);
5897 return ret;
5900 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5901 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5902 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5903 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5905 TRACE("(%p)\n", this);
5906 return this->strbuf;
5909 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5910 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5911 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5912 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5914 TRACE("(%p %x %x)\n", this, state, reraise);
5916 if(state != IOSTATE_goodbit)
5917 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5920 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5921 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5922 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5923 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5925 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5928 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5929 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5930 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5931 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5933 basic_ostream_char *ret = this->stream;
5935 TRACE("(%p %p)\n", this, ostream);
5937 this->stream = ostream;
5938 return ret;
5941 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5942 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5943 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5944 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5946 TRACE("(%p)\n", this);
5947 return this->stream;
5950 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5951 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5952 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5953 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5955 TRACE("(%p %c)\n", this, ch);
5956 return ctype_char_widen_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch);
5959 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
5960 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
5961 DEFINE_THISCALL_WRAPPER(basic_ios_char_swap, 8)
5962 void __thiscall basic_ios_char_swap(basic_ios_char *this, basic_ios_char *r)
5964 void *swap_ptr;
5966 TRACE("(%p %p)\n", this, r);
5968 if(this == r)
5969 return;
5971 ios_base_swap(&this->base, &r->base);
5972 swap_ptr = this->stream;
5973 this->stream = r->stream;
5974 r->stream = swap_ptr;
5975 this->fillch ^= r->fillch;
5976 r->fillch ^= this->fillch;
5977 this->fillch ^= r->fillch;
5980 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5981 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5982 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5983 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5985 TRACE("(%p)\n", this);
5987 ios_base_ctor(&this->base);
5988 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5989 return this;
5992 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5993 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5994 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5995 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5997 basic_ios_wchar_ctor(this);
5998 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5999 return this;
6002 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
6003 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
6004 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
6005 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
6006 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
6007 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
6009 TRACE("(%p %p %x)\n", this, streambuf, isstd);
6010 ios_base__Init(&this->base);
6011 this->strbuf = streambuf;
6012 this->stream = NULL;
6013 this->fillch = ' ';
6015 if(!streambuf)
6016 ios_base_setstate(&this->base, IOSTATE_badbit);
6018 if(isstd)
6019 FIXME("standard streams not handled yet\n");
6022 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6023 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6024 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
6025 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
6027 TRACE("(%p %p)\n", this, strbuf);
6029 basic_ios_wchar_ctor(this);
6030 basic_ios_wchar_init(this, strbuf, FALSE);
6031 return this;
6034 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6035 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6036 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
6037 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
6039 basic_ios_wchar_ctor_streambuf(this, strbuf);
6040 this->base.vtable = &MSVCP_basic_ios_short_vtable;
6041 return this;
6044 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6045 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6046 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
6047 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6048 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
6049 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
6051 TRACE("(%p)\n", this);
6052 ios_base_dtor(&this->base);
6055 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
6056 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
6058 TRACE("(%p %x)\n", this, flags);
6059 if(flags & 2) {
6060 /* we have an array, with the number of elements stored before the first object */
6061 INT_PTR i, *ptr = (INT_PTR *)this-1;
6063 for(i=*ptr-1; i>=0; i--)
6064 basic_ios_wchar_dtor(this+i);
6065 MSVCRT_operator_delete(ptr);
6066 } else {
6067 basic_ios_wchar_dtor(this);
6068 if(flags & 1)
6069 MSVCRT_operator_delete(this);
6072 return this;
6075 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
6076 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
6077 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
6078 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
6079 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
6080 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
6082 TRACE("(%p %x %x)\n", this, state, reraise);
6083 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
6086 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
6087 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
6088 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
6089 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
6090 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
6091 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
6093 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
6096 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
6097 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
6098 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
6099 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
6100 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
6101 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
6103 TRACE("(%p %p)\n", this, copy);
6104 if(this == copy)
6105 return this;
6107 this->stream = copy->stream;
6108 this->fillch = copy->fillch;
6109 ios_base_copyfmt(&this->base, &copy->base);
6110 return this;
6113 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
6114 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
6115 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
6116 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
6117 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
6118 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
6120 wchar_t ret = this->fillch;
6122 TRACE("(%p %c)\n", this, fill);
6124 this->fillch = fill;
6125 return ret;
6128 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
6129 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
6130 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
6131 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
6132 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
6133 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
6135 TRACE("(%p)\n", this);
6136 return this->fillch;
6139 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
6140 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
6141 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
6142 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
6143 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
6144 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
6146 TRACE("(%p %p %p)\n", this, ret, loc);
6148 if(this->strbuf) {
6149 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
6150 locale_dtor(ret);
6153 return ios_base_imbue(&this->base, ret, loc);
6156 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
6157 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
6158 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
6159 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
6160 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
6161 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
6163 TRACE("(%p %c %c)\n", this, ch, def);
6164 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
6167 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
6168 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
6169 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
6170 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
6171 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
6172 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
6174 basic_streambuf_wchar *ret = this->strbuf;
6176 TRACE("(%p %p)\n", this, streambuf);
6178 this->strbuf = streambuf;
6179 basic_ios_wchar_clear(this, IOSTATE_goodbit);
6180 return ret;
6183 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
6184 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
6185 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
6186 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
6187 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
6188 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
6190 TRACE("(%p)\n", this);
6191 return this->strbuf;
6194 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
6195 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
6196 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
6197 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
6198 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
6199 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
6201 TRACE("(%p %x %x)\n", this, state, reraise);
6203 if(state != IOSTATE_goodbit)
6204 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
6207 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
6208 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
6209 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
6210 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
6211 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
6212 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
6214 basic_ios_wchar_setstate_reraise(this, state, FALSE);
6217 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
6218 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
6219 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
6220 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
6221 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
6222 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
6224 basic_ostream_wchar *ret = this->stream;
6226 TRACE("(%p %p)\n", this, ostream);
6228 this->stream = ostream;
6229 return ret;
6232 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
6233 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
6234 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
6235 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
6236 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
6237 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
6239 TRACE("(%p)\n", this);
6240 return this->stream;
6243 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
6244 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
6245 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
6246 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
6247 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
6248 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
6250 TRACE("(%p %c)\n", this, ch);
6251 return ctype_wchar_widen_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch);
6254 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
6255 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
6256 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
6257 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
6258 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_swap, 8)
6259 void __thiscall basic_ios_wchar_swap(basic_ios_wchar *this, basic_ios_wchar *r)
6261 void *swap_ptr;
6263 TRACE("(%p %p)\n", this, r);
6265 if(this == r)
6266 return;
6268 ios_base_swap(&this->base, &r->base);
6269 swap_ptr = this->stream;
6270 this->stream = r->stream;
6271 r->stream = swap_ptr;
6272 this->fillch ^= r->fillch;
6273 r->fillch ^= this->fillch;
6274 this->fillch ^= r->fillch;
6277 /* Caution: basic_ostream uses virtual inheritance.
6278 * All constructors have additional parameter that says if base class should be initialized.
6279 * Base class needs to be accessed using vbtable.
6281 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
6283 return (basic_ios_char*)((char*)this+this->vbtable[1]);
6286 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
6288 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
6291 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
6293 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
6296 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6297 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6298 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 16)
6299 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
6300 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6302 basic_ios_char *base;
6304 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6306 if(virt_init) {
6307 this->vbtable = basic_ostream_char_vbtable;
6308 base = basic_ostream_char_get_basic_ios(this);
6309 INIT_BASIC_IOS_VTORDISP(base);
6310 basic_ios_char_ctor(base);
6311 }else {
6312 base = basic_ostream_char_get_basic_ios(this);
6315 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
6316 basic_ios_char_init(base, strbuf, isstd);
6317 return this;
6320 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6321 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6322 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 16)
6323 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
6324 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6326 basic_ios_char *base;
6328 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
6330 if(virt_init) {
6331 this->vbtable = basic_ostream_char_vbtable;
6332 base = basic_ostream_char_get_basic_ios(this);
6333 INIT_BASIC_IOS_VTORDISP(base);
6334 basic_ios_char_ctor(base);
6335 }else {
6336 base = basic_ostream_char_get_basic_ios(this);
6339 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
6340 if(addstd)
6341 ios_base_Addstd(&base->base);
6342 return this;
6345 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
6346 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
6347 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
6348 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
6350 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
6352 /* don't destroy virtual base here */
6353 TRACE("(%p)\n", this);
6356 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6357 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6358 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
6359 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
6361 basic_ios_char *base = basic_ostream_char_to_basic_ios(this);
6363 TRACE("(%p)\n", this);
6365 basic_ostream_char_dtor(base);
6366 basic_ios_char_dtor(base);
6369 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
6370 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
6372 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
6374 TRACE("(%p %x)\n", this, flags);
6376 if(flags & 2) {
6377 /* we have an array, with the number of elements stored before the first object */
6378 INT_PTR i, *ptr = (INT_PTR *)this-1;
6380 for(i=*ptr-1; i>=0; i--)
6381 basic_ostream_char_vbase_dtor(this+i);
6382 MSVCRT_operator_delete(ptr);
6383 } else {
6384 basic_ostream_char_vbase_dtor(this);
6385 if(flags & 1)
6386 MSVCRT_operator_delete(this);
6389 return this;
6392 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
6393 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
6394 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
6395 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
6397 /* this function is not matching C++ specification */
6398 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6400 TRACE("(%p)\n", this);
6402 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
6403 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
6404 basic_ios_char_setstate(base, IOSTATE_badbit);
6405 return this;
6408 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6409 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6410 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
6412 return basic_ostream_char_flush(ostream);
6415 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6416 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6417 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
6418 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
6420 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6422 TRACE("(%p)\n", this);
6424 if(base->base.fmtfl & FMTFLAG_unitbuf)
6425 basic_ostream_char_flush(this);
6428 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6429 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6430 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
6431 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
6433 TRACE("(%p)\n", this);
6434 basic_ostream_char__Osfx(this);
6437 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
6439 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6441 if(basic_ios_char_rdbuf_get(base))
6442 call_basic_streambuf_char__Lock(base->strbuf);
6444 if(ios_base_good(&base->base) && base->stream)
6445 basic_ostream_char_flush(base->stream);
6447 return ios_base_good(&base->base);
6450 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
6452 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6454 if(ios_base_good(&base->base) && !__uncaught_exception())
6455 basic_ostream_char_osfx(ostr);
6457 if(basic_ios_char_rdbuf_get(base))
6458 call_basic_streambuf_char__Unlock(base->strbuf);
6461 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
6462 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
6463 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
6464 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
6466 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6468 TRACE("(%p)\n", this);
6470 if(ios_base_good(&base->base) && base->stream)
6471 basic_ostream_char_flush(base->stream);
6472 return ios_base_good(&base->base);
6475 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
6476 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
6477 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
6478 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
6480 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6482 TRACE("(%p %c)\n", this, ch);
6484 if(!basic_ostream_char_sentry_create(this)
6485 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
6486 basic_ostream_char_sentry_destroy(this);
6487 basic_ios_char_setstate(base, IOSTATE_badbit);
6488 return this;
6491 basic_ostream_char_sentry_destroy(this);
6492 return this;
6495 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
6496 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
6497 #if STREAMOFF_BITS == 64
6498 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 16)
6499 #else
6500 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
6501 #endif
6502 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
6504 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6506 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6508 if(!ios_base_fail(&base->base)) {
6509 fpos_mbstatet seek;
6511 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6512 &seek, off, way, OPENMODE_out);
6513 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
6514 basic_ios_char_setstate(base, IOSTATE_failbit);
6516 return this;
6519 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6520 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6521 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
6522 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_mbstatet pos)
6524 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6526 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
6528 if(!ios_base_fail(&base->base)) {
6529 fpos_mbstatet seek;
6531 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
6532 &seek, pos, OPENMODE_out);
6533 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
6534 basic_ios_char_setstate(base, IOSTATE_failbit);
6536 return this;
6539 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6540 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6541 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
6542 fpos_mbstatet* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_mbstatet *ret)
6544 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6546 TRACE("(%p)\n", this);
6548 if(!ios_base_fail(&base->base)) {
6549 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6550 ret, 0, SEEKDIR_cur, OPENMODE_out);
6551 }else {
6552 ret->off = -1;
6553 ret->pos = 0;
6554 memset(&ret->state, 0, sizeof(ret->state));
6556 return ret;
6559 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
6560 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
6561 #if STREAMSIZE_BITS == 64
6562 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
6563 #else
6564 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
6565 #endif
6566 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
6568 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6570 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
6572 if(!basic_ostream_char_sentry_create(this)
6573 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
6574 basic_ostream_char_sentry_destroy(this);
6575 basic_ios_char_setstate(base, IOSTATE_badbit);
6576 return this;
6579 basic_ostream_char_sentry_destroy(this);
6580 return this;
6583 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
6584 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
6585 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
6586 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
6588 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6589 int state = IOSTATE_goodbit;
6591 TRACE("(%p %d)\n", this, val);
6593 if(basic_ostream_char_sentry_create(this)) {
6594 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6595 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6596 ostreambuf_iterator_char dest;
6598 memset(&dest, 0, sizeof(dest));
6599 dest.strbuf = strbuf;
6600 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
6601 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6602 ? (LONG)((unsigned short)val) : (LONG)val);
6604 basic_ostream_char_sentry_destroy(this);
6606 basic_ios_char_setstate(base, state);
6607 return this;
6610 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
6611 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
6612 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
6613 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
6615 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6616 int state = IOSTATE_goodbit;
6618 TRACE("(%p %u)\n", this, val);
6620 if(basic_ostream_char_sentry_create(this)) {
6621 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6622 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6623 ostreambuf_iterator_char dest;
6625 memset(&dest, 0, sizeof(dest));
6626 dest.strbuf = strbuf;
6627 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6629 basic_ostream_char_sentry_destroy(this);
6631 basic_ios_char_setstate(base, state);
6632 return this;
6635 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
6636 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
6637 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
6638 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
6639 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
6640 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
6642 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6643 int state = IOSTATE_goodbit;
6645 TRACE("(%p %d)\n", this, val);
6647 if(basic_ostream_char_sentry_create(this)) {
6648 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6649 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6650 ostreambuf_iterator_char dest;
6652 memset(&dest, 0, sizeof(dest));
6653 dest.strbuf = strbuf;
6654 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6656 basic_ostream_char_sentry_destroy(this);
6658 basic_ios_char_setstate(base, state);
6659 return this;
6662 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
6663 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
6664 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
6665 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
6666 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
6667 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
6669 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6670 int state = IOSTATE_goodbit;
6672 TRACE("(%p %u)\n", this, val);
6674 if(basic_ostream_char_sentry_create(this)) {
6675 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6676 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6677 ostreambuf_iterator_char dest;
6679 memset(&dest, 0, sizeof(dest));
6680 dest.strbuf = strbuf;
6681 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6683 basic_ostream_char_sentry_destroy(this);
6685 basic_ios_char_setstate(base, state);
6686 return this;
6689 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
6690 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
6691 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
6692 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
6694 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6695 int state = IOSTATE_goodbit;
6697 TRACE("(%p %f)\n", this, val);
6699 if(basic_ostream_char_sentry_create(this)) {
6700 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6701 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6702 ostreambuf_iterator_char dest;
6704 memset(&dest, 0, sizeof(dest));
6705 dest.strbuf = strbuf;
6706 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6708 basic_ostream_char_sentry_destroy(this);
6710 basic_ios_char_setstate(base, state);
6711 return this;
6714 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
6715 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
6716 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
6717 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
6719 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6720 int state = IOSTATE_goodbit;
6722 TRACE("(%p %lf)\n", this, val);
6724 if(basic_ostream_char_sentry_create(this)) {
6725 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6726 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6727 ostreambuf_iterator_char dest;
6729 memset(&dest, 0, sizeof(dest));
6730 dest.strbuf = strbuf;
6731 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6733 basic_ostream_char_sentry_destroy(this);
6735 basic_ios_char_setstate(base, state);
6736 return this;
6739 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
6740 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
6741 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
6742 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
6744 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6745 int state = IOSTATE_goodbit;
6747 TRACE("(%p %lf)\n", this, val);
6749 if(basic_ostream_char_sentry_create(this)) {
6750 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6751 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6752 ostreambuf_iterator_char dest;
6754 memset(&dest, 0, sizeof(dest));
6755 dest.strbuf = strbuf;
6756 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6758 basic_ostream_char_sentry_destroy(this);
6760 basic_ios_char_setstate(base, state);
6761 return this;
6764 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6765 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6766 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
6767 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
6769 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6770 IOSB_iostate state = IOSTATE_badbit;
6771 int c = '\n';
6773 TRACE("(%p %p)\n", this, val);
6775 if(basic_ostream_char_sentry_create(this)) {
6776 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
6777 c = basic_streambuf_char_snextc(val)) {
6778 state = IOSTATE_goodbit;
6780 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
6781 state = IOSTATE_badbit;
6782 break;
6785 }else {
6786 state = IOSTATE_badbit;
6788 basic_ostream_char_sentry_destroy(this);
6790 ios_base_width_set(&base->base, 0);
6791 basic_ios_char_setstate(base, state);
6792 return this;
6795 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
6796 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
6797 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
6798 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
6800 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6801 int state = IOSTATE_goodbit;
6803 TRACE("(%p %p)\n", this, val);
6805 if(basic_ostream_char_sentry_create(this)) {
6806 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6807 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6808 ostreambuf_iterator_char dest;
6810 memset(&dest, 0, sizeof(dest));
6811 dest.strbuf = strbuf;
6812 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6814 basic_ostream_char_sentry_destroy(this);
6816 basic_ios_char_setstate(base, state);
6817 return this;
6820 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
6821 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
6822 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
6823 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
6825 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6826 int state = IOSTATE_goodbit;
6828 TRACE("(%p)\n", this);
6830 if(basic_ostream_char_sentry_create(this)) {
6831 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6832 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6833 ostreambuf_iterator_char dest;
6835 memset(&dest, 0, sizeof(dest));
6836 dest.strbuf = strbuf;
6837 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6839 basic_ostream_char_sentry_destroy(this);
6841 basic_ios_char_setstate(base, state);
6842 return this;
6845 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
6846 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
6847 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
6848 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
6850 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6851 int state = IOSTATE_goodbit;
6853 TRACE("(%p)\n", this);
6855 if(basic_ostream_char_sentry_create(this)) {
6856 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6857 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6858 ostreambuf_iterator_char dest;
6860 memset(&dest, 0, sizeof(dest));
6861 dest.strbuf = strbuf;
6862 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6864 basic_ostream_char_sentry_destroy(this);
6866 basic_ios_char_setstate(base, state);
6867 return this;
6870 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
6871 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
6872 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
6873 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
6875 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6876 int state = IOSTATE_goodbit;
6878 TRACE("(%p %x)\n", this, val);
6880 if(basic_ostream_char_sentry_create(this)) {
6881 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6882 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6883 ostreambuf_iterator_char dest;
6885 memset(&dest, 0, sizeof(dest));
6886 dest.strbuf = strbuf;
6887 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6889 basic_ostream_char_sentry_destroy(this);
6891 basic_ios_char_setstate(base, state);
6892 return this;
6895 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6896 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6897 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6899 TRACE("(%p)\n", ostr);
6901 basic_ostream_char_put(ostr, 0);
6902 return ostr;
6905 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6906 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6907 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6909 TRACE("(%p)\n", ostr);
6911 basic_ostream_char_put(ostr, '\n');
6912 basic_ostream_char_flush(ostr);
6913 return ostr;
6916 /* ??$?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 */
6917 /* ??$?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 */
6918 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6920 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6921 IOSB_iostate state = IOSTATE_goodbit;
6923 TRACE("(%p %p)\n", ostr, str);
6925 if(basic_ostream_char_sentry_create(ostr)) {
6926 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6927 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6929 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6930 for(; pad!=0; pad--) {
6931 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6932 state = IOSTATE_badbit;
6933 break;
6938 if(state == IOSTATE_goodbit) {
6939 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6940 state = IOSTATE_badbit;
6943 if(state == IOSTATE_goodbit) {
6944 for(; pad!=0; pad--) {
6945 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6946 state = IOSTATE_badbit;
6947 break;
6952 base->base.wide = 0;
6953 }else {
6954 state = IOSTATE_badbit;
6956 basic_ostream_char_sentry_destroy(ostr);
6958 basic_ios_char_setstate(base, state);
6959 return ostr;
6962 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6963 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6964 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6965 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6966 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6967 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6968 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6970 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6971 IOSB_iostate state = IOSTATE_goodbit;
6973 TRACE("(%p %d)\n", ostr, ch);
6975 if(basic_ostream_char_sentry_create(ostr)) {
6976 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6978 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6979 for(; pad!=0; pad--) {
6980 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6981 state = IOSTATE_badbit;
6982 break;
6987 if(state == IOSTATE_goodbit) {
6988 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6989 state = IOSTATE_badbit;
6992 if(state == IOSTATE_goodbit) {
6993 for(; pad!=0; pad--) {
6994 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6995 state = IOSTATE_badbit;
6996 break;
7001 base->base.wide = 0;
7002 }else {
7003 state = IOSTATE_badbit;
7005 basic_ostream_char_sentry_destroy(ostr);
7007 basic_ios_char_setstate(base, state);
7008 return ostr;
7011 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
7012 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
7013 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
7014 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
7015 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
7016 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
7017 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
7019 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
7020 IOSB_iostate state = IOSTATE_goodbit;
7022 TRACE("(%p %s)\n", ostr, str);
7024 if(basic_ostream_char_sentry_create(ostr)) {
7025 MSVCP_size_t len = strlen(str);
7026 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7028 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7029 for(; pad!=0; pad--) {
7030 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
7031 state = IOSTATE_badbit;
7032 break;
7037 if(state == IOSTATE_goodbit) {
7038 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
7039 state = IOSTATE_badbit;
7042 if(state == IOSTATE_goodbit) {
7043 for(; pad!=0; pad--) {
7044 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
7045 state = IOSTATE_badbit;
7046 break;
7051 base->base.wide = 0;
7052 }else {
7053 state = IOSTATE_badbit;
7055 basic_ostream_char_sentry_destroy(ostr);
7057 basic_ios_char_setstate(base, state);
7058 return ostr;
7061 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7062 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7063 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
7064 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
7065 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
7067 TRACE("(%p %p)\n", this, pfunc);
7068 pfunc(this);
7069 return this;
7072 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
7073 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
7074 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
7075 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
7076 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
7078 TRACE("(%p %p)\n", this, pfunc);
7079 pfunc(basic_ostream_char_get_basic_ios(this));
7080 return this;
7083 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7084 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7085 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
7086 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
7087 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
7089 TRACE("(%p %p)\n", this, pfunc);
7090 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
7091 return this;
7094 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
7095 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
7096 DEFINE_THISCALL_WRAPPER(basic_ostream_char_swap, 8)
7097 void __thiscall basic_ostream_char_swap(basic_ostream_char *this, basic_ostream_char *r)
7099 TRACE("(%p %p)\n", this, r);
7101 if(this == r)
7102 return;
7104 basic_ios_char_swap(basic_ostream_char_get_basic_ios(this),
7105 basic_ostream_char_get_basic_ios(r));
7108 /* Caution: basic_ostream uses virtual inheritance. */
7109 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
7111 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
7114 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
7116 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
7119 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
7121 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
7124 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
7125 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
7126 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor, 16)
7127 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor(basic_ostream_wchar *this,
7128 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7130 basic_ios_wchar *base;
7132 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
7134 if(virt_init) {
7135 this->vbtable = basic_ostream_wchar_vbtable;
7136 base = basic_ostream_wchar_get_basic_ios(this);
7137 INIT_BASIC_IOS_VTORDISP(base);
7138 basic_ios_wchar_ctor(base);
7139 }else {
7140 base = basic_ostream_wchar_get_basic_ios(this);
7143 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
7144 basic_ios_wchar_init(base, strbuf, isstd);
7145 return this;
7148 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
7149 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
7150 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 16)
7151 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
7152 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7154 basic_ostream_wchar_ctor(this, strbuf, isstd, virt_init);
7155 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
7156 return this;
7159 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
7160 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
7161 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor_uninitialized, 16)
7162 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor_uninitialized(basic_ostream_wchar *this,
7163 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
7165 basic_ios_wchar *base;
7167 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
7169 if(virt_init) {
7170 this->vbtable = basic_ostream_wchar_vbtable;
7171 base = basic_ostream_wchar_get_basic_ios(this);
7172 INIT_BASIC_IOS_VTORDISP(base);
7173 basic_ios_wchar_ctor(base);
7174 }else {
7175 base = basic_ostream_wchar_get_basic_ios(this);
7178 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
7179 if(addstd)
7180 ios_base_Addstd(&base->base);
7181 return this;
7184 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
7185 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
7186 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 16)
7187 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
7188 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
7190 basic_ostream_wchar_ctor_uninitialized(this, uninitialized, addstd, virt_init);
7191 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
7192 return this;
7195 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
7196 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
7197 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
7198 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
7199 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
7200 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
7202 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
7204 /* don't destroy virtual base here */
7205 TRACE("(%p)\n", this);
7208 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7209 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7210 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7211 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7212 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
7213 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
7215 basic_ios_wchar *base = basic_ostream_wchar_to_basic_ios(this);
7217 TRACE("(%p)\n", this);
7219 basic_ostream_wchar_dtor(base);
7220 basic_ios_wchar_dtor(base);
7223 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
7224 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
7226 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
7228 TRACE("(%p %x)\n", this, flags);
7230 if(flags & 2) {
7231 /* we have an array, with the number of elements stored before the first object */
7232 INT_PTR i, *ptr = (INT_PTR *)this-1;
7234 for(i=*ptr-1; i>=0; i--)
7235 basic_ostream_wchar_vbase_dtor(this+i);
7236 MSVCRT_operator_delete(ptr);
7237 } else {
7238 basic_ostream_wchar_vbase_dtor(this);
7239 if(flags & 1)
7240 MSVCRT_operator_delete(this);
7243 return this;
7246 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
7247 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
7248 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
7249 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
7250 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
7251 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
7253 /* this function is not matching C++ specification */
7254 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7256 TRACE("(%p)\n", this);
7258 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
7259 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
7260 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7261 return this;
7264 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7265 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7266 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7267 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7268 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
7270 return basic_ostream_wchar_flush(ostream);
7273 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7274 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7275 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7276 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7277 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
7278 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
7280 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7282 TRACE("(%p)\n", this);
7284 if(base->base.fmtfl & FMTFLAG_unitbuf)
7285 basic_ostream_wchar_flush(this);
7288 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7289 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7290 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7291 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7292 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
7293 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
7295 TRACE("(%p)\n", this);
7296 basic_ostream_wchar__Osfx(this);
7299 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
7301 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7303 if(basic_ios_wchar_rdbuf_get(base))
7304 basic_streambuf_wchar__Lock(base->strbuf);
7306 if(ios_base_good(&base->base) && base->stream)
7307 basic_ostream_wchar_flush(base->stream);
7309 return ios_base_good(&base->base);
7312 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
7314 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7316 if(ios_base_good(&base->base) && !__uncaught_exception())
7317 basic_ostream_wchar_osfx(ostr);
7319 if(basic_ios_wchar_rdbuf_get(base))
7320 basic_streambuf_wchar__Unlock(base->strbuf);
7323 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
7324 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
7325 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
7326 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
7327 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
7328 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
7330 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7332 TRACE("(%p)\n", this);
7334 if(ios_base_good(&base->base) && base->stream)
7335 basic_ostream_wchar_flush(base->stream);
7336 return ios_base_good(&base->base);
7339 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
7340 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
7341 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
7342 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
7343 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
7344 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
7346 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7348 TRACE("(%p %c)\n", this, ch);
7350 if(!basic_ostream_wchar_sentry_create(this)
7351 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
7352 basic_ostream_wchar_sentry_destroy(this);
7353 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7354 return this;
7357 basic_ostream_wchar_sentry_destroy(this);
7358 return this;
7361 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
7362 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
7363 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
7364 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
7365 #if STREAMOFF_BITS == 64
7366 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 16)
7367 #else
7368 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
7369 #endif
7370 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
7372 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7374 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
7376 if(!ios_base_fail(&base->base)) {
7377 fpos_mbstatet seek;
7379 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
7380 &seek, off, way, OPENMODE_out);
7381 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
7382 basic_ios_wchar_setstate(base, IOSTATE_failbit);
7384 return this;
7387 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7388 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7389 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7390 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7391 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
7392 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_mbstatet pos)
7394 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7396 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
7398 if(!ios_base_fail(&base->base)) {
7399 fpos_mbstatet seek;
7401 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
7402 &seek, pos, OPENMODE_out);
7403 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
7404 basic_ios_wchar_setstate(base, IOSTATE_failbit);
7406 return this;
7409 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7410 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7411 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7412 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7413 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
7414 fpos_mbstatet* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_mbstatet *ret)
7416 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7418 TRACE("(%p)\n", this);
7420 if(!ios_base_fail(&base->base)) {
7421 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
7422 ret, 0, SEEKDIR_cur, OPENMODE_out);
7423 }else {
7424 ret->off = -1;
7425 ret->pos = 0;
7426 memset(&ret->state, 0, sizeof(ret->state));
7428 return ret;
7431 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
7432 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
7433 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
7434 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
7435 #if STREAMSIZE_BITS == 64
7436 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
7437 #else
7438 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
7439 #endif
7440 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
7442 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7444 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
7446 if(!basic_ostream_wchar_sentry_create(this)
7447 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
7448 basic_ostream_wchar_sentry_destroy(this);
7449 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7450 return this;
7453 basic_ostream_wchar_sentry_destroy(this);
7454 return this;
7457 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
7459 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7460 int state = IOSTATE_goodbit;
7462 TRACE("(%p %d)\n", this, val);
7464 if(basic_ostream_wchar_sentry_create(this)) {
7465 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7466 ostreambuf_iterator_wchar dest;
7468 memset(&dest, 0, sizeof(dest));
7469 dest.strbuf = strbuf;
7470 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
7471 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
7472 ? (LONG)((unsigned short)val) : (LONG)val);
7474 basic_ostream_wchar_sentry_destroy(this);
7476 basic_ios_wchar_setstate(base, state);
7477 return this;
7480 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
7481 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
7482 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
7483 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
7485 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
7486 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7489 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
7490 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
7491 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
7492 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
7494 return basic_ostream_print_short(this, val, num_put_short_use_facet(
7495 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7498 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
7500 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7501 int state = IOSTATE_goodbit;
7503 TRACE("(%p %d)\n", this, val);
7505 if(basic_ostream_wchar_sentry_create(this)) {
7506 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7507 ostreambuf_iterator_wchar dest;
7509 memset(&dest, 0, sizeof(dest));
7510 dest.strbuf = strbuf;
7511 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7513 basic_ostream_wchar_sentry_destroy(this);
7515 basic_ios_wchar_setstate(base, state);
7516 return this;
7519 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
7520 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
7521 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
7522 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
7524 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
7525 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7528 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
7529 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
7530 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
7531 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
7533 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
7534 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7537 /* ??6std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7538 /* ??6std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7539 basic_ostream_wchar* __cdecl basic_ostream_short_print_ushort_global(basic_ostream_wchar *ostr, unsigned short val)
7541 return basic_ostream_print_ushort(ostr, val, num_put_short_use_facet(
7542 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(ostr)))));
7545 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
7547 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7548 int state = IOSTATE_goodbit;
7550 TRACE("(%p %d)\n", this, val);
7552 if(basic_ostream_wchar_sentry_create(this)) {
7553 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7554 ostreambuf_iterator_wchar dest;
7556 memset(&dest, 0, sizeof(dest));
7557 dest.strbuf = strbuf;
7558 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7560 basic_ostream_wchar_sentry_destroy(this);
7562 basic_ios_wchar_setstate(base, state);
7563 return this;
7566 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
7567 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
7568 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
7569 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
7570 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
7571 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
7573 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
7574 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7577 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
7578 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
7579 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
7580 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
7581 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
7582 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
7584 return basic_ostream_print_int(this, val, num_put_short_use_facet(
7585 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7588 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
7590 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7591 int state = IOSTATE_goodbit;
7593 TRACE("(%p %u)\n", this, val);
7595 if(basic_ostream_wchar_sentry_create(this)) {
7596 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7597 ostreambuf_iterator_wchar dest;
7599 memset(&dest, 0, sizeof(dest));
7600 dest.strbuf = strbuf;
7601 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7603 basic_ostream_wchar_sentry_destroy(this);
7605 basic_ios_wchar_setstate(base, state);
7606 return this;
7609 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
7610 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
7611 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
7612 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
7613 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
7614 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
7616 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
7617 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7620 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
7621 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
7622 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
7623 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
7624 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
7625 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
7627 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
7628 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7631 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
7633 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7634 int state = IOSTATE_goodbit;
7636 TRACE("(%p %f)\n", this, val);
7638 if(basic_ostream_wchar_sentry_create(this)) {
7639 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7640 ostreambuf_iterator_wchar dest;
7642 memset(&dest, 0, sizeof(dest));
7643 dest.strbuf = strbuf;
7644 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7646 basic_ostream_wchar_sentry_destroy(this);
7648 basic_ios_wchar_setstate(base, state);
7649 return this;
7652 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
7653 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
7654 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
7655 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
7657 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
7658 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7661 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
7662 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
7663 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
7664 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
7666 return basic_ostream_print_float(this, val, num_put_short_use_facet(
7667 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7670 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
7672 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7673 int state = IOSTATE_goodbit;
7675 TRACE("(%p %lf)\n", this, val);
7677 if(basic_ostream_wchar_sentry_create(this)) {
7678 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7679 ostreambuf_iterator_wchar dest;
7681 memset(&dest, 0, sizeof(dest));
7682 dest.strbuf = strbuf;
7683 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7685 basic_ostream_wchar_sentry_destroy(this);
7687 basic_ios_wchar_setstate(base, state);
7688 return this;
7691 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
7692 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
7693 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
7694 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
7696 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
7697 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7700 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
7701 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
7702 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
7703 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
7705 return basic_ostream_print_double(this, val, num_put_short_use_facet(
7706 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7709 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
7711 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7712 int state = IOSTATE_goodbit;
7714 TRACE("(%p %lf)\n", this, val);
7716 if(basic_ostream_wchar_sentry_create(this)) {
7717 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7718 ostreambuf_iterator_wchar dest;
7720 memset(&dest, 0, sizeof(dest));
7721 dest.strbuf = strbuf;
7722 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7724 basic_ostream_wchar_sentry_destroy(this);
7726 basic_ios_wchar_setstate(base, state);
7727 return this;
7730 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
7731 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
7732 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
7733 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
7735 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
7736 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7739 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
7740 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
7741 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
7742 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
7744 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
7745 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7748 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7749 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7750 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7751 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7752 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
7753 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
7755 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7756 IOSB_iostate state = IOSTATE_badbit;
7757 unsigned short c = '\n';
7759 TRACE("(%p %p)\n", this, val);
7761 if(basic_ostream_wchar_sentry_create(this)) {
7762 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
7763 c = basic_streambuf_wchar_snextc(val)) {
7764 state = IOSTATE_goodbit;
7766 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
7767 state = IOSTATE_badbit;
7768 break;
7771 }else {
7772 state = IOSTATE_badbit;
7774 basic_ostream_wchar_sentry_destroy(this);
7776 ios_base_width_set(&base->base, 0);
7777 basic_ios_wchar_setstate(base, state);
7778 return this;
7781 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
7783 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7784 int state = IOSTATE_goodbit;
7786 TRACE("(%p %p)\n", this, val);
7788 if(basic_ostream_wchar_sentry_create(this)) {
7789 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7790 ostreambuf_iterator_wchar dest;
7792 memset(&dest, 0, sizeof(dest));
7793 dest.strbuf = strbuf;
7794 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7796 basic_ostream_wchar_sentry_destroy(this);
7798 basic_ios_wchar_setstate(base, state);
7799 return this;
7802 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
7803 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
7804 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
7805 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
7807 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
7808 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7811 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
7812 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
7813 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
7814 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
7816 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
7817 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7820 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
7822 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7823 int state = IOSTATE_goodbit;
7825 TRACE("(%p)\n", this);
7827 if(basic_ostream_wchar_sentry_create(this)) {
7828 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7829 ostreambuf_iterator_wchar dest;
7831 memset(&dest, 0, sizeof(dest));
7832 dest.strbuf = strbuf;
7833 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7835 basic_ostream_wchar_sentry_destroy(this);
7837 basic_ios_wchar_setstate(base, state);
7838 return this;
7841 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
7842 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
7843 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
7844 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
7846 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
7847 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7850 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
7851 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
7852 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
7853 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
7855 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
7856 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7859 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
7861 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7862 int state = IOSTATE_goodbit;
7864 TRACE("(%p)\n", this);
7866 if(basic_ostream_wchar_sentry_create(this)) {
7867 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7868 ostreambuf_iterator_wchar dest;
7870 memset(&dest, 0, sizeof(dest));
7871 dest.strbuf = strbuf;
7872 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7874 basic_ostream_wchar_sentry_destroy(this);
7876 basic_ios_wchar_setstate(base, state);
7877 return this;
7880 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
7881 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
7882 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
7883 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7885 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
7886 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7889 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
7890 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
7891 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
7892 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7894 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
7895 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7898 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
7900 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7901 int state = IOSTATE_goodbit;
7903 TRACE("(%p %x)\n", this, val);
7905 if(basic_ostream_wchar_sentry_create(this)) {
7906 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7907 ostreambuf_iterator_wchar dest;
7909 memset(&dest, 0, sizeof(dest));
7910 dest.strbuf = strbuf;
7911 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7913 basic_ostream_wchar_sentry_destroy(this);
7915 basic_ios_wchar_setstate(base, state);
7916 return this;
7919 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
7920 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
7921 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
7922 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7924 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
7925 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7928 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
7929 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
7930 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
7931 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7933 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
7934 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7937 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7938 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7939 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7940 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7941 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
7943 TRACE("(%p)\n", ostr);
7945 basic_ostream_wchar_put(ostr, 0);
7946 return ostr;
7949 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7950 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7951 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7952 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7953 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
7955 TRACE("(%p)\n", ostr);
7957 basic_ostream_wchar_put(ostr, '\n');
7958 basic_ostream_wchar_flush(ostr);
7959 return ostr;
7962 /* ??$?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 */
7963 /* ??$?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 */
7964 /* ??$?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 */
7965 /* ??$?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 */
7966 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
7968 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7969 IOSB_iostate state = IOSTATE_goodbit;
7971 TRACE("(%p %p)\n", ostr, str);
7973 if(basic_ostream_wchar_sentry_create(ostr)) {
7974 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
7975 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7977 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7978 for(; pad!=0; pad--) {
7979 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7980 state = IOSTATE_badbit;
7981 break;
7986 if(state == IOSTATE_goodbit) {
7987 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7988 state = IOSTATE_badbit;
7991 if(state == IOSTATE_goodbit) {
7992 for(; pad!=0; pad--) {
7993 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7994 state = IOSTATE_badbit;
7995 break;
8000 base->base.wide = 0;
8001 }else {
8002 state = IOSTATE_badbit;
8004 basic_ostream_wchar_sentry_destroy(ostr);
8006 basic_ios_wchar_setstate(base, state);
8007 return ostr;
8010 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
8011 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
8012 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
8013 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
8014 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
8016 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
8017 IOSB_iostate state = IOSTATE_goodbit;
8019 TRACE("(%p %d)\n", ostr, ch);
8021 if(basic_ostream_wchar_sentry_create(ostr)) {
8022 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
8024 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
8025 for(; pad!=0; pad--) {
8026 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8027 state = IOSTATE_badbit;
8028 break;
8033 if(state == IOSTATE_goodbit) {
8034 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
8035 state = IOSTATE_badbit;
8038 if(state == IOSTATE_goodbit) {
8039 for(; pad!=0; pad--) {
8040 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8041 state = IOSTATE_badbit;
8042 break;
8047 base->base.wide = 0;
8048 }else {
8049 state = IOSTATE_badbit;
8051 basic_ostream_wchar_sentry_destroy(ostr);
8053 basic_ios_wchar_setstate(base, state);
8054 return ostr;
8057 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
8058 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
8059 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
8060 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
8061 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
8063 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
8064 IOSB_iostate state = IOSTATE_goodbit;
8066 TRACE("(%p %s)\n", ostr, debugstr_w(str));
8068 if(basic_ostream_wchar_sentry_create(ostr)) {
8069 MSVCP_size_t len = wcslen(str);
8070 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
8072 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
8073 for(; pad!=0; pad--) {
8074 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8075 state = IOSTATE_badbit;
8076 break;
8081 if(state == IOSTATE_goodbit) {
8082 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
8083 state = IOSTATE_badbit;
8086 if(state == IOSTATE_goodbit) {
8087 for(; pad!=0; pad--) {
8088 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8089 state = IOSTATE_badbit;
8090 break;
8095 base->base.wide = 0;
8096 }else {
8097 state = IOSTATE_badbit;
8099 basic_ostream_wchar_sentry_destroy(ostr);
8101 basic_ios_wchar_setstate(base, state);
8102 return ostr;
8105 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8106 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8107 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8108 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8109 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
8110 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
8111 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
8113 TRACE("(%p %p)\n", this, pfunc);
8114 pfunc(this);
8115 return this;
8118 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
8119 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
8120 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
8121 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
8122 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
8123 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
8124 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
8126 TRACE("(%p %p)\n", this, pfunc);
8127 pfunc(basic_ostream_wchar_get_basic_ios(this));
8128 return this;
8131 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8132 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8133 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8134 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8135 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
8136 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
8137 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
8139 TRACE("(%p %p)\n", this, pfunc);
8140 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
8141 return this;
8144 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
8145 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
8146 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
8147 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IEAAXAEAV12@@Z */
8148 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_swap, 8)
8149 void __thiscall basic_ostream_wchar_swap(basic_ostream_wchar *this, basic_ostream_wchar *r)
8151 TRACE("(%p %p)\n", this, r);
8153 if(this == r)
8154 return;
8156 basic_ios_wchar_swap(basic_ostream_wchar_get_basic_ios(this),
8157 basic_ostream_wchar_get_basic_ios(r));
8160 /* Caution: basic_istream uses virtual inheritance. */
8161 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
8163 return (basic_ios_char*)((char*)this+this->vbtable[1]);
8166 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
8168 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
8171 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
8173 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
8176 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
8177 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
8178 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
8179 basic_istream_char* __thiscall basic_istream_char_ctor_init(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
8181 basic_ios_char *base;
8183 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
8185 if(virt_init) {
8186 this->vbtable = basic_istream_char_vbtable;
8187 base = basic_istream_char_get_basic_ios(this);
8188 INIT_BASIC_IOS_VTORDISP(base);
8189 basic_ios_char_ctor(base);
8190 }else {
8191 base = basic_istream_char_get_basic_ios(this);
8194 base->base.vtable = &MSVCP_basic_istream_char_vtable;
8195 this->count = 0;
8196 if(!noinit)
8197 basic_ios_char_init(base, strbuf, isstd);
8198 return this;
8201 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
8202 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
8203 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
8204 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8206 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8209 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8210 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8211 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
8212 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
8214 basic_ios_char *base;
8216 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
8218 if(virt_init) {
8219 this->vbtable = basic_istream_char_vbtable;
8220 base = basic_istream_char_get_basic_ios(this);
8221 INIT_BASIC_IOS_VTORDISP(base);
8222 basic_ios_char_ctor(base);
8223 }else {
8224 base = basic_istream_char_get_basic_ios(this);
8227 base->base.vtable = &MSVCP_basic_istream_char_vtable;
8228 ios_base_Addstd(&base->base);
8229 return this;
8232 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
8233 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
8234 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
8235 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
8237 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
8239 /* don't destroy virtual base here */
8240 TRACE("(%p)\n", this);
8243 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
8244 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
8245 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
8246 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
8248 basic_ios_char *base = basic_istream_char_to_basic_ios(this);
8250 TRACE("(%p)\n", this);
8252 basic_istream_char_dtor(base);
8253 basic_ios_char_dtor(base);
8256 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
8257 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
8259 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
8261 TRACE("(%p %x)\n", this, flags);
8263 if(flags & 2) {
8264 /* we have an array, with the number of elements stored before the first object */
8265 INT_PTR i, *ptr = (INT_PTR *)this-1;
8267 for(i=*ptr-1; i>=0; i--)
8268 basic_istream_char_vbase_dtor(this+i);
8269 MSVCRT_operator_delete(ptr);
8270 } else {
8271 basic_istream_char_vbase_dtor(this);
8272 if(flags & 1)
8273 MSVCRT_operator_delete(this);
8276 return this;
8279 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
8280 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
8281 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
8282 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
8284 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8286 TRACE("(%p %d)\n", this, noskip);
8288 if(ios_base_good(&base->base)) {
8289 if(basic_ios_char_tie_get(base))
8290 basic_ostream_char_flush(basic_ios_char_tie_get(base));
8292 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
8293 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8294 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8295 int ch;
8297 for(ch = basic_streambuf_char_sgetc(strbuf); ;
8298 ch = basic_streambuf_char_snextc(strbuf)) {
8299 if(ch == EOF) {
8300 basic_ios_char_setstate(base, IOSTATE_eofbit);
8301 break;
8304 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
8305 break;
8310 if(!ios_base_good(&base->base)) {
8311 basic_ios_char_setstate(base, IOSTATE_failbit);
8312 return FALSE;
8315 return TRUE;
8318 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
8319 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
8320 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
8321 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
8323 return basic_istream_char__Ipfx(this, noskip);
8326 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
8327 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
8328 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
8329 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
8331 TRACE("(%p)\n", this);
8334 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
8336 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
8338 if(basic_ios_char_rdbuf_get(base))
8339 call_basic_streambuf_char__Lock(base->strbuf);
8341 return basic_istream_char_ipfx(istr, noskip);
8344 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
8346 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
8348 if(basic_ios_char_rdbuf_get(base))
8349 call_basic_streambuf_char__Unlock(base->strbuf);
8352 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
8353 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
8354 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
8355 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
8356 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
8357 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
8359 TRACE("(%p)\n", this);
8360 return this->count;
8363 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8364 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8365 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
8366 int __thiscall basic_istream_char_get(basic_istream_char *this)
8368 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8369 int ret;
8371 TRACE("(%p)\n", this);
8373 this->count = 0;
8375 if(!basic_istream_char_sentry_create(this, TRUE)) {
8376 basic_istream_char_sentry_destroy(this);
8377 return EOF;
8380 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
8381 basic_istream_char_sentry_destroy(this);
8382 if(ret == EOF)
8383 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
8384 else
8385 this->count++;
8387 return ret;
8390 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
8391 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
8392 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
8393 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
8395 int ret;
8397 TRACE("(%p %p)\n", this, ch);
8399 ret = basic_istream_char_get(this);
8400 if(ret != EOF)
8401 *ch = (char)ret;
8402 return this;
8405 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8406 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8407 #if STREAMSIZE_BITS == 64
8408 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
8409 #else
8410 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
8411 #endif
8412 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8414 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8415 int ch = delim;
8417 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
8419 this->count = 0;
8421 if(basic_istream_char_sentry_create(this, TRUE)) {
8422 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8424 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
8425 ch = basic_streambuf_char_snextc(strbuf)) {
8426 if(ch==EOF || ch==delim)
8427 break;
8429 *str++ = ch;
8430 this->count++;
8431 count--;
8434 basic_istream_char_sentry_destroy(this);
8436 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8437 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8438 if(count > 0)
8439 *str = 0;
8440 return this;
8443 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8444 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8445 #if STREAMSIZE_BITS == 64
8446 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
8447 #else
8448 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
8449 #endif
8450 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
8452 return basic_istream_char_get_str_delim(this, str, count, '\n');
8455 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8456 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8457 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
8458 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
8460 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8461 int ch = delim;
8463 TRACE("(%p %p %c)\n", this, strbuf, delim);
8465 this->count = 0;
8467 if(basic_istream_char_sentry_create(this, TRUE)) {
8468 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
8470 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
8471 ch = basic_streambuf_char_snextc(strbuf_read)) {
8472 if(ch==EOF || ch==delim)
8473 break;
8475 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
8476 break;
8477 this->count++;
8480 basic_istream_char_sentry_destroy(this);
8482 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8483 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8484 return this;
8487 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8488 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8489 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
8490 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
8492 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
8495 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8496 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8497 #if STREAMSIZE_BITS == 64
8498 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
8499 #else
8500 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
8501 #endif
8502 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8504 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8505 int ch = (unsigned char)delim;
8507 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
8509 this->count = 0;
8511 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
8512 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8514 while(count > 1) {
8515 ch = basic_streambuf_char_sbumpc(strbuf);
8517 if(ch==EOF || ch==(unsigned char)delim)
8518 break;
8520 *str++ = ch;
8521 this->count++;
8522 count--;
8525 if(ch == (unsigned char)delim)
8526 this->count++;
8527 else if(ch != EOF) {
8528 ch = basic_streambuf_char_sgetc(strbuf);
8530 if(ch == (unsigned char)delim) {
8531 basic_streambuf_char__Gninc(strbuf);
8532 this->count++;
8536 basic_istream_char_sentry_destroy(this);
8538 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8539 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8540 if(count > 0)
8541 *str = 0;
8542 return this;
8545 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8546 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8547 #if STREAMSIZE_BITS == 64
8548 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
8549 #else
8550 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
8551 #endif
8552 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
8554 return basic_istream_char_getline_delim(this, str, count, '\n');
8557 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
8558 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8559 #if STREAMSIZE_BITS == 64
8560 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
8561 #else
8562 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
8563 #endif
8564 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
8566 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8567 int ch = (unsigned char)delim;
8568 unsigned int state;
8570 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8572 this->count = 0;
8574 if(basic_istream_char_sentry_create(this, TRUE)) {
8575 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8576 state = IOSTATE_goodbit;
8578 while(count > 0) {
8579 ch = basic_streambuf_char_sbumpc(strbuf);
8581 if(ch==EOF) {
8582 state = IOSTATE_eofbit;
8583 break;
8586 if(ch==(unsigned char)delim)
8587 break;
8589 this->count++;
8590 if(count != INT_MAX)
8591 count--;
8593 }else
8594 state = IOSTATE_failbit;
8595 basic_istream_char_sentry_destroy(this);
8597 basic_ios_char_setstate(base, state);
8598 return this;
8601 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
8602 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
8603 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
8605 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8606 int ch = '\n';
8608 TRACE("(%p)\n", istream);
8610 if(basic_istream_char_sentry_create(istream, TRUE)) {
8611 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8612 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(strbuf));
8614 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
8615 ch = basic_streambuf_char_snextc(strbuf)) {
8616 if(ch == EOF)
8617 break;
8620 basic_istream_char_sentry_destroy(istream);
8622 if(ch == EOF)
8623 basic_ios_char_setstate(base, IOSTATE_eofbit);
8624 return istream;
8627 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8628 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8629 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
8630 int __thiscall basic_istream_char_peek(basic_istream_char *this)
8632 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8633 int ret = EOF;
8635 TRACE("(%p)\n", this);
8637 this->count = 0;
8639 if(basic_istream_char_sentry_create(this, TRUE))
8640 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8641 basic_istream_char_sentry_destroy(this);
8643 if (ret == EOF)
8644 basic_ios_char_setstate(base, IOSTATE_eofbit);
8646 return ret;
8649 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
8650 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
8651 #if STREAMSIZE_BITS == 64
8652 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
8653 #else
8654 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
8655 #endif
8656 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8658 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8659 IOSB_iostate state = IOSTATE_goodbit;
8661 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8663 if(basic_istream_char_sentry_create(this, TRUE)) {
8664 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8666 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
8667 if(this->count != count)
8668 state |= IOSTATE_failbit | IOSTATE_eofbit;
8669 }else {
8670 this->count = 0;
8672 basic_istream_char_sentry_destroy(this);
8674 basic_ios_char_setstate(base, state);
8675 return this;
8678 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8679 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8680 #if STREAMSIZE_BITS == 64
8681 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
8682 #else
8683 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
8684 #endif
8685 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
8687 return basic_istream_char__Read_s(this, str, -1, count);
8690 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
8691 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
8692 #if STREAMSIZE_BITS == 64
8693 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
8694 #else
8695 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
8696 #endif
8697 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8699 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8700 IOSB_iostate state = IOSTATE_goodbit;
8702 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8704 this->count = 0;
8706 if(basic_istream_char_sentry_create(this, TRUE)) {
8707 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
8708 if(avail > count)
8709 avail = count;
8711 if(avail == -1)
8712 state |= IOSTATE_eofbit;
8713 else if(avail > 0)
8714 basic_istream_char__Read_s(this, str, size, avail);
8715 }else {
8716 state |= IOSTATE_failbit;
8718 basic_istream_char_sentry_destroy(this);
8720 basic_ios_char_setstate(base, state);
8721 return this->count;
8724 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
8725 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
8726 #if STREAMSIZE_BITS == 64
8727 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
8728 #else
8729 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
8730 #endif
8731 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
8733 return basic_istream_char__Readsome_s(this, str, count, count);
8736 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
8737 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
8738 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
8739 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
8741 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8742 IOSB_iostate state = IOSTATE_goodbit;
8744 TRACE("(%p %c)\n", this, ch);
8746 this->count = 0;
8748 if(basic_istream_char_sentry_create(this, TRUE)) {
8749 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8751 if(!ios_base_good(&base->base))
8752 state |= IOSTATE_failbit;
8753 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
8754 state |= IOSTATE_badbit;
8756 basic_istream_char_sentry_destroy(this);
8758 basic_ios_char_setstate(base, state);
8759 return this;
8762 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
8763 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
8764 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
8765 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
8767 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8768 IOSB_iostate state = IOSTATE_goodbit;
8770 TRACE("(%p)\n", this);
8772 this->count = 0;
8774 if(basic_istream_char_sentry_create(this, TRUE)) {
8775 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8777 if(!ios_base_good(&base->base))
8778 state |= IOSTATE_failbit;
8779 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
8780 state |= IOSTATE_badbit;
8782 basic_istream_char_sentry_destroy(this);
8784 basic_ios_char_setstate(base, state);
8785 return this;
8788 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8789 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8790 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
8791 int __thiscall basic_istream_char_sync(basic_istream_char *this)
8793 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8794 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8796 TRACE("(%p)\n", this);
8798 if(!strbuf)
8799 return -1;
8801 if(basic_istream_char_sentry_create(this, TRUE)) {
8802 if(basic_streambuf_char_pubsync(strbuf) != -1) {
8803 basic_istream_char_sentry_destroy(this);
8804 return 0;
8807 basic_istream_char_sentry_destroy(this);
8809 basic_ios_char_setstate(base, IOSTATE_badbit);
8810 return -1;
8813 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8814 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8815 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
8816 fpos_mbstatet* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_mbstatet *ret)
8818 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8820 TRACE("(%p %p)\n", this, ret);
8822 #if _MSVCP_VER >= 110
8823 if(basic_istream_char_sentry_create(this, TRUE)) {
8824 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8825 ret, 0, SEEKDIR_cur, OPENMODE_in);
8827 if(ret->off==-1 && ret->pos==0 && MBSTATET_TO_INT(&ret->state)==0)
8828 basic_ios_char_setstate(base, IOSTATE_failbit);
8829 }else {
8830 ret->off = -1;
8831 ret->pos = 0;
8832 memset(&ret->state, 0, sizeof(ret->state));
8834 basic_istream_char_sentry_destroy(this);
8835 #else
8836 if(ios_base_fail(&base->base)) {
8837 ret->off = -1;
8838 ret->pos = 0;
8839 memset(&ret->state, 0, sizeof(ret->state));
8840 return ret;
8843 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8844 ret, 0, SEEKDIR_cur, OPENMODE_in);
8846 if(ret->off==-1 && ret->pos==0 && MBSTATET_TO_INT(&ret->state)==0)
8847 basic_ios_char_setstate(base, IOSTATE_failbit);
8848 #endif
8850 return ret;
8853 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
8854 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
8855 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
8856 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8857 #if STREAMOFF_BITS == 64
8858 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
8859 #else
8860 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
8861 #endif
8862 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
8864 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8865 #if _MSVCP_VER >= 110
8866 IOSB_iostate state;
8868 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8870 state = ios_base_rdstate(&base->base);
8871 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
8873 if(basic_istream_char_sentry_create(this, TRUE)) {
8874 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8875 fpos_mbstatet ret;
8877 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8879 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8880 basic_ios_char_setstate(base, IOSTATE_failbit);
8882 basic_istream_char_sentry_destroy(this);
8883 #else
8884 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8886 if(!ios_base_fail(&base->base)) {
8887 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8888 fpos_mbstatet ret;
8890 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8892 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8893 basic_ios_char_setstate(base, IOSTATE_failbit);
8894 else
8895 basic_ios_char_clear(base, IOSTATE_goodbit);
8896 return this;
8897 }else
8898 basic_ios_char_clear(base, IOSTATE_goodbit);
8899 #endif
8900 return this;
8903 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8904 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8905 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
8906 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_mbstatet pos)
8908 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8909 #if _MSVCP_VER >= 110
8910 IOSB_iostate state;
8912 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
8914 state = ios_base_rdstate(&base->base);
8915 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
8917 if(basic_istream_char_sentry_create(this, TRUE)) {
8918 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8919 fpos_mbstatet ret;
8921 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8923 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8924 basic_ios_char_setstate(base, IOSTATE_failbit);
8926 basic_istream_char_sentry_destroy(this);
8927 #else
8928 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
8930 if(!ios_base_fail(&base->base)) {
8931 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8932 fpos_mbstatet ret;
8934 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8936 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8937 basic_ios_char_setstate(base, IOSTATE_failbit);
8938 else
8939 basic_ios_char_clear(base, IOSTATE_goodbit);
8940 return this;
8941 }else
8942 basic_ios_char_clear(base, IOSTATE_goodbit);
8943 #endif
8944 return this;
8947 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
8948 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
8949 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
8950 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
8952 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8953 int state = IOSTATE_goodbit;
8955 TRACE("(%p %p)\n", this, v);
8957 if(basic_istream_char_sentry_create(this, FALSE)) {
8958 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8959 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8960 istreambuf_iterator_char first={0}, last={0};
8961 LONG tmp;
8963 first.strbuf = strbuf;
8964 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8966 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8967 *v = tmp;
8968 else
8969 state |= IOSTATE_failbit;
8971 basic_istream_char_sentry_destroy(this);
8973 basic_ios_char_setstate(base, state);
8974 return this;
8977 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
8978 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
8979 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
8980 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
8982 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8983 int state = IOSTATE_goodbit;
8985 TRACE("(%p %p)\n", this, v);
8987 if(basic_istream_char_sentry_create(this, FALSE)) {
8988 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8989 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8990 istreambuf_iterator_char first={0}, last={0};
8992 first.strbuf = strbuf;
8993 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
8995 basic_istream_char_sentry_destroy(this);
8997 basic_ios_char_setstate(base, state);
8998 return this;
9001 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
9002 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
9003 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
9004 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
9006 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9007 int state = IOSTATE_goodbit;
9009 TRACE("(%p %p)\n", this, v);
9011 if(basic_istream_char_sentry_create(this, FALSE)) {
9012 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9013 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9014 istreambuf_iterator_char first={0}, last={0};
9016 first.strbuf = strbuf;
9017 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
9019 basic_istream_char_sentry_destroy(this);
9021 basic_ios_char_setstate(base, state);
9022 return this;
9025 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
9026 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
9027 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
9028 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
9030 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9031 int state = IOSTATE_goodbit;
9033 TRACE("(%p %p)\n", this, v);
9035 if(basic_istream_char_sentry_create(this, FALSE)) {
9036 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9037 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9038 istreambuf_iterator_char first={0}, last={0};
9040 first.strbuf = strbuf;
9041 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
9043 basic_istream_char_sentry_destroy(this);
9045 basic_ios_char_setstate(base, state);
9046 return this;
9049 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
9050 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
9051 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
9052 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
9054 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9055 int state = IOSTATE_goodbit;
9057 TRACE("(%p %p)\n", this, v);
9059 if(basic_istream_char_sentry_create(this, FALSE)) {
9060 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9061 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9062 istreambuf_iterator_char first={0}, last={0};
9064 first.strbuf = strbuf;
9065 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
9067 basic_istream_char_sentry_destroy(this);
9069 basic_ios_char_setstate(base, state);
9070 return this;
9073 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
9074 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
9075 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
9076 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
9078 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9079 int state = IOSTATE_goodbit;
9081 TRACE("(%p %p)\n", this, v);
9083 if(basic_istream_char_sentry_create(this, FALSE)) {
9084 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9085 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9086 istreambuf_iterator_char first={0}, last={0};
9088 first.strbuf = strbuf;
9089 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
9091 basic_istream_char_sentry_destroy(this);
9093 basic_ios_char_setstate(base, state);
9094 return this;
9097 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
9098 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
9099 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
9100 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
9102 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9103 int state = IOSTATE_goodbit;
9105 TRACE("(%p %p)\n", this, v);
9107 if(basic_istream_char_sentry_create(this, FALSE)) {
9108 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9109 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9110 istreambuf_iterator_char first={0}, last={0};
9112 first.strbuf = strbuf;
9113 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
9115 basic_istream_char_sentry_destroy(this);
9117 basic_ios_char_setstate(base, state);
9118 return this;
9121 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
9122 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
9123 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
9124 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
9126 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9127 int state = IOSTATE_goodbit;
9129 TRACE("(%p %p)\n", this, v);
9131 if(basic_istream_char_sentry_create(this, FALSE)) {
9132 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9133 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9134 istreambuf_iterator_char first={0}, last={0};
9136 first.strbuf = strbuf;
9137 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
9139 basic_istream_char_sentry_destroy(this);
9141 basic_ios_char_setstate(base, state);
9142 return this;
9145 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
9146 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
9147 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
9148 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
9150 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9151 int state = IOSTATE_goodbit;
9153 TRACE("(%p %p)\n", this, v);
9155 if(basic_istream_char_sentry_create(this, FALSE)) {
9156 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9157 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9158 istreambuf_iterator_char first={0}, last={0};
9160 first.strbuf = strbuf;
9161 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
9163 basic_istream_char_sentry_destroy(this);
9165 basic_ios_char_setstate(base, state);
9166 return this;
9169 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
9170 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
9171 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
9172 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
9174 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9175 int state = IOSTATE_goodbit;
9177 TRACE("(%p %p)\n", this, v);
9179 if(basic_istream_char_sentry_create(this, FALSE)) {
9180 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9181 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9182 istreambuf_iterator_char first={0}, last={0};
9184 first.strbuf = strbuf;
9185 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
9187 basic_istream_char_sentry_destroy(this);
9189 basic_ios_char_setstate(base, state);
9190 return this;
9193 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
9194 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
9195 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
9196 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
9198 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9199 int state = IOSTATE_goodbit;
9201 TRACE("(%p %p)\n", this, v);
9203 if(basic_istream_char_sentry_create(this, FALSE)) {
9204 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9205 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9206 istreambuf_iterator_char first={0}, last={0};
9208 first.strbuf = strbuf;
9209 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
9211 basic_istream_char_sentry_destroy(this);
9213 basic_ios_char_setstate(base, state);
9214 return this;
9217 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
9218 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
9219 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
9220 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
9222 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9223 int state = IOSTATE_goodbit;
9225 TRACE("(%p %p)\n", this, v);
9227 if(basic_istream_char_sentry_create(this, FALSE)) {
9228 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9229 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9230 istreambuf_iterator_char first={0}, last={0};
9232 first.strbuf = strbuf;
9233 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
9235 basic_istream_char_sentry_destroy(this);
9237 basic_ios_char_setstate(base, state);
9238 return this;
9241 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
9242 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
9243 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
9244 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
9246 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9247 int state = IOSTATE_goodbit;
9249 TRACE("(%p %p)\n", this, v);
9251 if(basic_istream_char_sentry_create(this, FALSE)) {
9252 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9253 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9254 istreambuf_iterator_char first={0}, last={0};
9256 first.strbuf = strbuf;
9257 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
9259 basic_istream_char_sentry_destroy(this);
9261 basic_ios_char_setstate(base, state);
9262 return this;
9265 /* ??$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 */
9266 /* ??$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 */
9267 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
9268 basic_istream_char *istream, basic_string_char *str, char delim)
9270 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9271 IOSB_iostate state = IOSTATE_goodbit;
9272 int c = (unsigned char)delim;
9274 TRACE("(%p %p %c)\n", istream, str, delim);
9276 if(basic_istream_char_sentry_create(istream, TRUE)) {
9277 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9278 MSVCP_basic_string_char_clear(str);
9280 c = basic_streambuf_char_sgetc(strbuf);
9281 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
9282 MSVCP_basic_string_char_append_ch(str, c);
9283 if(c==EOF) state |= IOSTATE_eofbit;
9284 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
9286 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
9288 basic_istream_char_sentry_destroy(istream);
9290 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
9291 return istream;
9294 /* ??$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 */
9295 /* ??$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 */
9296 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
9297 basic_istream_char *istream, basic_string_char *str)
9299 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
9302 /* ??$?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 */
9303 /* ??$?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 */
9304 basic_istream_char* __cdecl basic_istream_char_read_bstr(
9305 basic_istream_char *istream, basic_string_char *str)
9307 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9308 IOSB_iostate state = IOSTATE_failbit;
9309 int c = '\n';
9311 TRACE("(%p %p)\n", istream, str);
9313 if(basic_istream_char_sentry_create(istream, FALSE)) {
9314 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
9315 MSVCP_size_t count = ios_base_width_get(&base->base);
9317 if(!count)
9318 count = -1;
9320 MSVCP_basic_string_char_clear(str);
9322 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
9323 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9324 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
9325 state = IOSTATE_goodbit;
9326 MSVCP_basic_string_char_append_ch(str, c);
9329 basic_istream_char_sentry_destroy(istream);
9331 ios_base_width_set(&base->base, 0);
9332 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9333 return istream;
9336 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
9337 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
9338 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
9339 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
9340 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
9341 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
9342 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
9344 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9345 IOSB_iostate state = IOSTATE_failbit;
9346 int c = '\n';
9348 TRACE("(%p %p)\n", istream, str);
9350 if(basic_istream_char_sentry_create(istream, FALSE)) {
9351 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
9352 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
9354 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
9355 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9356 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
9357 state = IOSTATE_goodbit;
9358 *str++ = c;
9361 basic_istream_char_sentry_destroy(istream);
9363 *str = 0;
9364 ios_base_width_set(&base->base, 0);
9365 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9366 return istream;
9369 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
9370 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
9371 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
9372 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
9373 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
9374 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
9375 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
9377 IOSB_iostate state = IOSTATE_failbit;
9378 int c = 0;
9380 TRACE("(%p %p)\n", istream, ch);
9382 if(basic_istream_char_sentry_create(istream, FALSE)) {
9383 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
9384 basic_istream_char_get_basic_ios(istream)));
9385 if(c != EOF) {
9386 state = IOSTATE_goodbit;
9387 *ch = c;
9390 basic_istream_char_sentry_destroy(istream);
9392 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
9393 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9394 return istream;
9397 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9398 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9399 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
9400 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
9401 basic_istream_char *this, basic_streambuf_char *streambuf)
9403 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9404 IOSB_iostate state = IOSTATE_failbit;
9405 int c = '\n';
9407 TRACE("(%p %p)\n", this, streambuf);
9409 if(basic_istream_char_sentry_create(this, FALSE)) {
9410 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
9411 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
9412 state = IOSTATE_goodbit;
9413 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
9414 break;
9417 basic_istream_char_sentry_destroy(this);
9419 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9420 return this;
9423 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9424 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9425 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
9426 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
9427 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
9429 TRACE("(%p %p)\n", this, pfunc);
9430 pfunc(this);
9431 return this;
9434 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
9435 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
9436 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
9437 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
9438 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
9440 TRACE("(%p %p)\n", this, pfunc);
9441 pfunc(basic_istream_char_get_basic_ios(this));
9442 return this;
9445 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9446 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9447 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
9448 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
9449 ios_base* (__cdecl *pfunc)(ios_base*))
9451 TRACE("(%p %p)\n", this, pfunc);
9452 pfunc(&basic_istream_char_get_basic_ios(this)->base);
9453 return this;
9456 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@M@0@@Z */
9457 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@M@0@@Z */
9458 basic_istream_char* __cdecl basic_istream_char_read_complex_float(basic_istream_char *this, complex_float *v)
9460 float r;
9461 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9463 TRACE("(%p %p)\n", this, v);
9465 ws_basic_istream_char(this);
9466 if(basic_istream_char_peek(this) == '(') {
9467 char c;
9468 basic_istream_char_get(this);
9469 basic_istream_char_read_float(this, &r);
9471 if(ios_base_fail(&base->base))
9472 return this;
9474 ws_basic_istream_char(this);
9475 c = basic_istream_char_peek(this);
9476 if(c == ',') {
9477 float i;
9478 basic_istream_char_get(this);
9479 basic_istream_char_read_float(this, &i);
9481 if(ios_base_fail(&base->base))
9482 return this;
9484 ws_basic_istream_char(this);
9485 c = basic_istream_char_peek(this);
9486 if(c == ')') { /* supported format: (real, imag) */
9487 basic_istream_char_get(this);
9488 v->real = r;
9489 v->imag = i;
9490 }else {
9491 basic_ios_char_setstate(base, IOSTATE_failbit);
9492 return this;
9494 }else if(c == ')') { /* supported format: (real) */
9495 basic_istream_char_get(this);
9496 v->real = r;
9497 v->imag = 0;
9498 }else {
9499 basic_ios_char_setstate(base, IOSTATE_failbit);
9500 return this;
9502 }else { /* supported format: real */
9503 basic_istream_char_read_float(this, &r);
9505 if(ios_base_fail(&base->base))
9506 return this;
9508 v->real = r;
9509 v->imag = 0;
9512 return this;
9515 /* ??$?5NDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@N@0@@Z */
9516 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@N@0@@Z */
9517 basic_istream_char* __cdecl basic_istream_char_read_complex_double(basic_istream_char *this, complex_double *v)
9519 double r;
9520 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9522 TRACE("(%p %p)\n", this, v);
9524 ws_basic_istream_char(this);
9525 if(basic_istream_char_peek(this) == '(') {
9526 char c;
9527 basic_istream_char_get(this);
9528 basic_istream_char_read_double(this, &r);
9530 if(ios_base_fail(&base->base))
9531 return this;
9533 ws_basic_istream_char(this);
9534 c = basic_istream_char_peek(this);
9535 if(c == ',') {
9536 double i;
9537 basic_istream_char_get(this);
9538 basic_istream_char_read_double(this, &i);
9540 if(ios_base_fail(&base->base))
9541 return this;
9543 ws_basic_istream_char(this);
9544 c = basic_istream_char_peek(this);
9545 if(c == ')') { /* supported format: (real, imag) */
9546 basic_istream_char_get(this);
9547 v->real = r;
9548 v->imag = i;
9549 }else {
9550 basic_ios_char_setstate(base, IOSTATE_failbit);
9551 return this;
9553 }else if(c == ')') { /* supported format: (real) */
9554 basic_istream_char_get(this);
9555 v->real = r;
9556 v->imag = 0;
9557 }else {
9558 basic_ios_char_setstate(base, IOSTATE_failbit);
9559 return this;
9561 }else { /* supported format: real */
9562 basic_istream_char_read_double(this, &r);
9564 if(ios_base_fail(&base->base))
9565 return this;
9567 v->real = r;
9568 v->imag = 0;
9571 return this;
9574 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@O@0@@Z */
9575 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@O@0@@Z */
9576 basic_istream_char* __cdecl basic_istream_char_read_complex_ldouble(basic_istream_char *this, complex_double *v)
9578 double r;
9579 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9581 TRACE("(%p %p)\n", this, v);
9583 ws_basic_istream_char(this);
9584 if(basic_istream_char_peek(this) == '(') {
9585 char c;
9586 basic_istream_char_get(this);
9587 basic_istream_char_read_ldouble(this, &r);
9589 if(ios_base_fail(&base->base))
9590 return this;
9592 ws_basic_istream_char(this);
9593 c = basic_istream_char_peek(this);
9594 if(c == ',') {
9595 double i;
9596 basic_istream_char_get(this);
9597 basic_istream_char_read_ldouble(this, &i);
9599 if(ios_base_fail(&base->base))
9600 return this;
9602 ws_basic_istream_char(this);
9603 c = basic_istream_char_peek(this);
9604 if(c == ')') { /* supported format: (real, imag) */
9605 basic_istream_char_get(this);
9606 v->real = r;
9607 v->imag = i;
9608 }else {
9609 basic_ios_char_setstate(base, IOSTATE_failbit);
9610 return this;
9612 }else if(c == ')') { /* supported format: (real) */
9613 basic_istream_char_get(this);
9614 v->real = r;
9615 v->imag = 0;
9616 }else {
9617 basic_ios_char_setstate(base, IOSTATE_failbit);
9618 return this;
9620 }else { /* supported format: real */
9621 basic_istream_char_read_ldouble(this, &r);
9623 if(ios_base_fail(&base->base))
9624 return this;
9626 v->real = r;
9627 v->imag = 0;
9630 return this;
9633 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
9634 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
9635 DEFINE_THISCALL_WRAPPER(basic_istream_char_swap, 8)
9636 void __thiscall basic_istream_char_swap(basic_istream_char *this, basic_istream_char *r)
9638 TRACE("(%p %p)\n", this, r);
9640 if(this == r)
9641 return;
9643 basic_ios_char_swap(basic_istream_char_get_basic_ios(this),
9644 basic_istream_char_get_basic_ios(r));
9645 this->count ^= r->count;
9646 r->count ^= this->count;
9647 this->count ^= r->count;
9650 /* Caution: basic_istream uses virtual inheritance. */
9651 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
9653 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
9656 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
9658 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
9661 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9663 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
9666 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9667 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9668 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
9669 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
9670 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9672 basic_ios_wchar *base;
9674 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
9676 if(virt_init) {
9677 this->vbtable = basic_istream_wchar_vbtable;
9678 base = basic_istream_wchar_get_basic_ios(this);
9679 INIT_BASIC_IOS_VTORDISP(base);
9680 basic_ios_wchar_ctor(base);
9681 }else {
9682 base = basic_istream_wchar_get_basic_ios(this);
9685 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9686 this->count = 0;
9687 if(!noinit)
9688 basic_ios_wchar_init(base, strbuf, isstd);
9689 return this;
9692 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9693 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9694 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
9695 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
9696 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9698 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
9699 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9700 return this;
9703 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9704 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9705 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
9706 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
9707 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9709 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9712 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9713 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9714 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
9715 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
9716 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9718 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9721 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9722 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9723 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
9724 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
9725 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9727 basic_ios_wchar *base;
9729 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
9731 if(virt_init) {
9732 this->vbtable = basic_istream_wchar_vbtable;
9733 base = basic_istream_wchar_get_basic_ios(this);
9734 INIT_BASIC_IOS_VTORDISP(base);
9735 basic_ios_wchar_ctor(base);
9736 }else {
9737 base = basic_istream_wchar_get_basic_ios(this);
9740 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9741 ios_base_Addstd(&base->base);
9742 return this;
9745 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9746 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9747 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
9748 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
9749 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9751 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
9752 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9753 return this;
9756 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9757 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9758 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9759 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9760 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
9761 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
9763 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9765 /* don't destroy virtual base here */
9766 TRACE("(%p)\n", this);
9769 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9770 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9771 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9772 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9773 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
9774 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
9776 basic_ios_wchar *base = basic_istream_wchar_to_basic_ios(this);
9778 TRACE("(%p)\n", this);
9780 basic_istream_wchar_dtor(base);
9781 basic_ios_wchar_dtor(base);
9784 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
9785 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9787 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9789 TRACE("(%p %x)\n", this, flags);
9791 if(flags & 2) {
9792 /* we have an array, with the number of elements stored before the first object */
9793 INT_PTR i, *ptr = (INT_PTR *)this-1;
9795 for(i=*ptr-1; i>=0; i--)
9796 basic_istream_wchar_vbase_dtor(this+i);
9797 MSVCRT_operator_delete(ptr);
9798 } else {
9799 basic_istream_wchar_vbase_dtor(this);
9800 if(flags & 1)
9801 MSVCRT_operator_delete(this);
9804 return this;
9807 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9808 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9809 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9810 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9811 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
9812 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9814 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9816 TRACE("(%p %d)\n", this, noskip);
9818 if(ios_base_good(&base->base)) {
9819 if(basic_ios_wchar_tie_get(base))
9820 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
9822 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
9823 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9824 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(base->strbuf));
9825 int ch;
9827 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
9828 ch = basic_streambuf_wchar_snextc(strbuf)) {
9829 if(ch == WEOF) {
9830 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9831 break;
9834 if(!ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
9835 break;
9840 if(!ios_base_good(&base->base)) {
9841 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9842 return FALSE;
9844 return TRUE;
9847 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9848 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9849 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9850 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9851 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
9852 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9854 return basic_istream_wchar__Ipfx(this, noskip);
9857 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9858 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9859 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9860 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9861 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
9862 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
9864 TRACE("(%p)\n", this);
9867 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
9869 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9871 if(basic_ios_wchar_rdbuf_get(base))
9872 basic_streambuf_wchar__Lock(base->strbuf);
9874 return basic_istream_wchar_ipfx(istr, noskip);
9877 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
9879 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9881 if(basic_ios_wchar_rdbuf_get(base))
9882 basic_streambuf_wchar__Unlock(base->strbuf);
9885 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
9886 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
9887 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
9888 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
9889 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
9890 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
9891 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
9892 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
9893 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
9894 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
9896 TRACE("(%p)\n", this);
9897 return this->count;
9900 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9901 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9902 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9903 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9904 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
9905 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
9907 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9908 int ret;
9910 TRACE("(%p)\n", this);
9912 this->count = 0;
9914 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
9915 basic_istream_wchar_sentry_destroy(this);
9916 return WEOF;
9919 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
9920 basic_istream_wchar_sentry_destroy(this);
9921 if(ret == WEOF)
9922 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
9923 else
9924 this->count++;
9926 return ret;
9929 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
9930 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
9931 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
9932 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
9933 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
9934 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
9936 unsigned short ret;
9938 TRACE("(%p %p)\n", this, ch);
9940 ret = basic_istream_wchar_get(this);
9941 if(ret != WEOF)
9942 *ch = (wchar_t)ret;
9943 return this;
9946 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9947 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9948 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9949 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9950 #if STREAMSIZE_BITS == 64
9951 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
9952 #else
9953 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
9954 #endif
9955 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9957 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9958 unsigned short ch = delim;
9960 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
9962 this->count = 0;
9964 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9965 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9967 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
9968 ch = basic_streambuf_wchar_snextc(strbuf)) {
9969 if(ch==WEOF || ch==delim)
9970 break;
9972 *str++ = ch;
9973 this->count++;
9974 count--;
9977 basic_istream_wchar_sentry_destroy(this);
9979 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9980 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9981 if(count > 0)
9982 *str = 0;
9983 return this;
9986 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9987 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9988 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9989 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9990 #if STREAMSIZE_BITS == 64
9991 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
9992 #else
9993 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
9994 #endif
9995 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
9997 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
10000 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
10001 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
10002 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
10003 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
10004 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
10005 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
10007 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10008 unsigned short ch = delim;
10010 TRACE("(%p %p %c)\n", this, strbuf, delim);
10012 this->count = 0;
10014 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10015 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
10017 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
10018 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
10019 if(ch==WEOF || ch==delim)
10020 break;
10022 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
10023 break;
10024 this->count++;
10027 basic_istream_wchar_sentry_destroy(this);
10029 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
10030 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10031 return this;
10034 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
10035 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
10036 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
10037 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
10038 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
10039 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
10041 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
10044 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
10045 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
10046 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
10047 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
10048 #if STREAMSIZE_BITS == 64
10049 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
10050 #else
10051 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
10052 #endif
10053 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
10055 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10056 unsigned short ch = delim;
10058 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
10060 this->count = 0;
10062 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
10063 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10065 while(count > 1) {
10066 ch = basic_streambuf_wchar_sbumpc(strbuf);
10068 if(ch==WEOF || ch==delim)
10069 break;
10071 *str++ = ch;
10072 this->count++;
10073 count--;
10076 if(ch == delim)
10077 this->count++;
10078 else if(ch != WEOF) {
10079 ch = basic_streambuf_wchar_sgetc(strbuf);
10081 if(ch == delim) {
10082 basic_streambuf_wchar__Gninc(strbuf);
10083 this->count++;
10087 basic_istream_wchar_sentry_destroy(this);
10089 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
10090 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
10091 if(count > 0)
10092 *str = 0;
10093 return this;
10096 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
10097 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
10098 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
10099 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
10100 #if STREAMSIZE_BITS == 64
10101 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
10102 #else
10103 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
10104 #endif
10105 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
10107 return basic_istream_wchar_getline_delim(this, str, count, '\n');
10110 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
10111 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
10112 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
10113 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
10114 #if STREAMSIZE_BITS == 64
10115 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
10116 #else
10117 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
10118 #endif
10119 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
10121 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10122 unsigned short ch = delim;
10123 unsigned int state;
10125 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
10127 this->count = 0;
10129 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10130 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10131 state = IOSTATE_goodbit;
10133 while(count > 0) {
10134 ch = basic_streambuf_wchar_sbumpc(strbuf);
10136 if(ch==WEOF) {
10137 state = IOSTATE_eofbit;
10138 break;
10141 if(ch==delim)
10142 break;
10144 this->count++;
10145 if(count != INT_MAX)
10146 count--;
10148 }else
10149 state = IOSTATE_failbit;
10150 basic_istream_wchar_sentry_destroy(this);
10152 basic_ios_wchar_setstate(base, state);
10153 return this;
10156 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
10157 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
10158 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
10159 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
10160 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
10162 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10163 unsigned short ch = '\n';
10165 TRACE("(%p)\n", istream);
10167 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10168 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10169 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(strbuf));
10171 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
10172 ch = basic_streambuf_wchar_snextc(strbuf)) {
10173 if(ch == WEOF)
10174 break;
10177 basic_istream_wchar_sentry_destroy(istream);
10179 if(ch == WEOF)
10180 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
10181 return istream;
10184 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
10185 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
10186 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
10187 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
10188 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
10189 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
10191 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10192 unsigned short ret = WEOF;
10194 TRACE("(%p)\n", this);
10196 this->count = 0;
10198 if(basic_istream_wchar_sentry_create(this, TRUE))
10199 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10200 basic_istream_wchar_sentry_destroy(this);
10202 if (ret == WEOF)
10203 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
10205 return ret;
10208 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
10209 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
10210 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
10211 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
10212 #if STREAMSIZE_BITS == 64
10213 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
10214 #else
10215 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
10216 #endif
10217 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
10219 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10220 IOSB_iostate state = IOSTATE_goodbit;
10222 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
10224 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10225 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10227 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
10228 if(this->count != count)
10229 state |= IOSTATE_failbit | IOSTATE_eofbit;
10230 }else {
10231 this->count = 0;
10233 basic_istream_wchar_sentry_destroy(this);
10235 basic_ios_wchar_setstate(base, state);
10236 return this;
10239 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
10240 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
10241 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
10242 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
10243 #if STREAMSIZE_BITS == 64
10244 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
10245 #else
10246 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
10247 #endif
10248 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
10250 return basic_istream_wchar__Read_s(this, str, -1, count);
10253 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
10254 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
10255 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
10256 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
10257 #if STREAMSIZE_BITS == 64
10258 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
10259 #else
10260 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
10261 #endif
10262 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
10264 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10265 IOSB_iostate state = IOSTATE_goodbit;
10267 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
10269 this->count = 0;
10271 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10272 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
10273 if(avail > count)
10274 avail = count;
10276 if(avail == -1)
10277 state |= IOSTATE_eofbit;
10278 else if(avail > 0)
10279 basic_istream_wchar__Read_s(this, str, size, avail);
10280 }else {
10281 state |= IOSTATE_failbit;
10283 basic_istream_wchar_sentry_destroy(this);
10285 basic_ios_wchar_setstate(base, state);
10286 return this->count;
10289 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
10290 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
10291 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
10292 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
10293 #if STREAMSIZE_BITS == 64
10294 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
10295 #else
10296 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
10297 #endif
10298 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
10300 return basic_istream_wchar__Readsome_s(this, str, count, count);
10303 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
10304 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
10305 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
10306 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
10307 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
10308 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
10310 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10311 IOSB_iostate state = IOSTATE_goodbit;
10313 TRACE("(%p %c)\n", this, ch);
10315 this->count = 0;
10317 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10318 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10320 if(!ios_base_good(&base->base))
10321 state |= IOSTATE_failbit;
10322 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
10323 state |= IOSTATE_badbit;
10325 basic_istream_wchar_sentry_destroy(this);
10327 basic_ios_wchar_setstate(base, state);
10328 return this;
10331 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
10332 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
10333 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
10334 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
10335 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
10336 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
10338 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10339 IOSB_iostate state = IOSTATE_goodbit;
10341 TRACE("(%p)\n", this);
10343 this->count = 0;
10345 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10346 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10348 if(!ios_base_good(&base->base))
10349 state |= IOSTATE_failbit;
10350 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
10351 state |= IOSTATE_badbit;
10353 basic_istream_wchar_sentry_destroy(this);
10355 basic_ios_wchar_setstate(base, state);
10356 return this;
10359 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
10360 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
10361 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
10362 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
10363 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
10364 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
10366 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10367 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10369 TRACE("(%p)\n", this);
10371 if(!strbuf)
10372 return -1;
10374 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10375 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
10376 basic_istream_wchar_sentry_destroy(this);
10377 return 0;
10380 basic_istream_wchar_sentry_destroy(this);
10382 basic_ios_wchar_setstate(base, IOSTATE_badbit);
10383 return -1;
10386 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
10387 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
10388 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
10389 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
10390 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
10391 fpos_mbstatet* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_mbstatet *ret)
10393 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10395 TRACE("(%p %p)\n", this, ret);
10397 #if _MSVCP_VER >= 110
10398 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10399 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
10400 ret, 0, SEEKDIR_cur, OPENMODE_in);
10402 if(ret->off==-1 && ret->pos==0 && MBSTATET_TO_INT(&ret->state)==0)
10403 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10404 }else {
10405 ret->off = -1;
10406 ret->pos = 0;
10407 memset(&ret->state, 0, sizeof(ret->state));
10409 basic_istream_wchar_sentry_destroy(this);
10410 #else
10411 if(ios_base_fail(&base->base)) {
10412 ret->off = -1;
10413 ret->pos = 0;
10414 memset(&ret->state, 0, sizeof(ret->state));
10415 return ret;
10418 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
10419 ret, 0, SEEKDIR_cur, OPENMODE_in);
10420 if(ret->off==-1 && ret->pos==0 && MBSTATET_TO_INT(&ret->state)==0)
10421 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10422 #endif
10423 return ret;
10426 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
10427 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
10428 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
10429 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
10430 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
10431 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
10432 #if STREAMOFF_BITS == 64
10433 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
10434 #else
10435 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
10436 #endif
10437 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
10439 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10440 #if _MSVCP_VER >= 110
10441 IOSB_iostate state;
10443 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
10445 state = ios_base_rdstate(&base->base);
10446 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
10448 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10449 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10450 fpos_mbstatet ret;
10452 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
10454 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10455 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10457 basic_istream_wchar_sentry_destroy(this);
10458 #else
10459 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
10461 if(!ios_base_fail(&base->base)) {
10462 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10463 fpos_mbstatet ret;
10465 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
10467 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10468 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10469 else
10470 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10471 return this;
10472 }else
10473 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10474 #endif
10475 return this;
10478 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
10479 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
10480 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
10481 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
10482 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
10483 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_mbstatet pos)
10485 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10486 #if _MSVCP_VER >= 110
10487 IOSB_iostate state;
10489 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
10491 state = ios_base_rdstate(&base->base);
10492 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
10494 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10495 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10496 fpos_mbstatet ret;
10498 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
10500 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10501 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10503 basic_istream_wchar_sentry_destroy(this);
10504 #else
10505 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
10507 if(!ios_base_fail(&base->base)) {
10508 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10509 fpos_mbstatet ret;
10511 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
10513 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10514 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10515 else
10516 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10517 return this;
10518 }else
10519 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10520 #endif
10521 return this;
10524 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
10526 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10527 int state = IOSTATE_goodbit;
10529 TRACE("(%p %p)\n", this, v);
10531 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10532 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10533 istreambuf_iterator_wchar first={0}, last={0};
10534 LONG tmp;
10536 first.strbuf = strbuf;
10537 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
10539 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
10540 *v = tmp;
10541 else
10542 state |= IOSTATE_failbit;
10544 basic_istream_wchar_sentry_destroy(this);
10546 basic_ios_wchar_setstate(base, state);
10547 return this;
10550 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
10551 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
10552 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
10553 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
10555 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
10556 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10559 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
10560 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
10561 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
10562 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
10564 return basic_istream_read_short(this, v, num_get_short_use_facet(
10565 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10568 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
10569 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
10570 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
10571 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
10573 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10574 int state = IOSTATE_goodbit;
10576 TRACE("(%p %p)\n", this, v);
10578 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10579 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10580 const num_get *numget = num_get_wchar_use_facet(IOS_LOCALE(strbuf));
10581 istreambuf_iterator_wchar first={0}, last={0};
10583 first.strbuf = strbuf;
10584 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
10586 basic_istream_wchar_sentry_destroy(this);
10588 basic_ios_wchar_setstate(base, state);
10589 return this;
10592 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
10594 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10595 int state = IOSTATE_goodbit;
10597 TRACE("(%p %p)\n", this, v);
10599 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10600 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10601 istreambuf_iterator_wchar first={0}, last={0};
10603 first.strbuf = strbuf;
10604 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10606 basic_istream_wchar_sentry_destroy(this);
10608 basic_ios_wchar_setstate(base, state);
10609 return this;
10612 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAH@Z */
10613 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
10614 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
10615 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
10617 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
10618 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10621 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
10622 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
10623 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
10624 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
10626 return basic_istream_read_int(this, v, num_get_short_use_facet(
10627 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10630 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
10632 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10633 int state = IOSTATE_goodbit;
10635 TRACE("(%p %p)\n", this, v);
10637 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10638 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10639 istreambuf_iterator_wchar first={0}, last={0};
10641 first.strbuf = strbuf;
10642 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
10644 basic_istream_wchar_sentry_destroy(this);
10646 basic_ios_wchar_setstate(base, state);
10647 return this;
10650 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
10651 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
10652 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
10653 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
10655 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
10656 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10659 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
10660 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
10661 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
10662 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
10664 return basic_istream_read_uint(this, v, num_get_short_use_facet(
10665 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10668 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
10670 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10671 int state = IOSTATE_goodbit;
10673 TRACE("(%p %p)\n", this, v);
10675 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10676 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10677 istreambuf_iterator_wchar first={0}, last={0};
10679 first.strbuf = strbuf;
10680 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10682 basic_istream_wchar_sentry_destroy(this);
10684 basic_ios_wchar_setstate(base, state);
10685 return this;
10688 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10689 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10690 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
10691 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
10693 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
10694 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10697 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10698 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10699 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
10700 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
10702 return basic_istream_read_long(this, v, num_get_short_use_facet(
10703 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10706 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
10708 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10709 int state = IOSTATE_goodbit;
10711 TRACE("(%p %p)\n", this, v);
10713 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10714 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10715 istreambuf_iterator_wchar first={0}, last={0};
10717 first.strbuf = strbuf;
10718 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
10720 basic_istream_wchar_sentry_destroy(this);
10722 basic_ios_wchar_setstate(base, state);
10723 return this;
10726 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
10727 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
10728 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
10729 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
10731 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
10732 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10735 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
10736 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
10737 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
10738 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
10740 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
10741 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10744 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
10746 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10747 int state = IOSTATE_goodbit;
10749 TRACE("(%p %p)\n", this, v);
10751 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10752 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10753 istreambuf_iterator_wchar first={0}, last={0};
10755 first.strbuf = strbuf;
10756 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
10758 basic_istream_wchar_sentry_destroy(this);
10760 basic_ios_wchar_setstate(base, state);
10761 return this;
10764 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
10765 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
10766 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
10767 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
10769 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
10770 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10773 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
10774 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
10775 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
10776 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
10778 return basic_istream_read_float(this, v, num_get_short_use_facet(
10779 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10782 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
10784 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10785 int state = IOSTATE_goodbit;
10787 TRACE("(%p %p)\n", this, v);
10789 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10790 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10791 istreambuf_iterator_wchar first={0}, last={0};
10793 first.strbuf = strbuf;
10794 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
10796 basic_istream_wchar_sentry_destroy(this);
10798 basic_ios_wchar_setstate(base, state);
10799 return this;
10802 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
10803 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
10804 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
10805 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
10807 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
10808 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10811 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
10812 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
10813 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
10814 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
10816 return basic_istream_read_double(this, v, num_get_short_use_facet(
10817 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10820 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
10822 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10823 int state = IOSTATE_goodbit;
10825 TRACE("(%p %p)\n", this, v);
10827 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10828 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10829 istreambuf_iterator_wchar first={0}, last={0};
10831 first.strbuf = strbuf;
10832 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
10834 basic_istream_wchar_sentry_destroy(this);
10836 basic_ios_wchar_setstate(base, state);
10837 return this;
10840 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
10841 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
10842 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
10843 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
10845 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
10846 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10849 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
10850 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
10851 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
10852 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
10854 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
10855 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10858 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
10860 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10861 int state = IOSTATE_goodbit;
10863 TRACE("(%p %p)\n", this, v);
10865 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10866 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10867 istreambuf_iterator_wchar first={0}, last={0};
10869 first.strbuf = strbuf;
10870 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
10872 basic_istream_wchar_sentry_destroy(this);
10874 basic_ios_wchar_setstate(base, state);
10875 return this;
10878 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
10879 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10880 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
10881 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
10883 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
10884 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10887 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
10888 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10889 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
10890 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
10892 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
10893 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10896 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
10898 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10899 int state = IOSTATE_goodbit;
10901 TRACE("(%p %p)\n", this, v);
10903 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10904 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10905 istreambuf_iterator_wchar first={0}, last={0};
10907 first.strbuf = strbuf;
10908 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
10910 basic_istream_wchar_sentry_destroy(this);
10912 basic_ios_wchar_setstate(base, state);
10913 return this;
10916 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
10917 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
10918 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
10919 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
10921 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
10922 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10925 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
10926 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
10927 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
10928 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
10930 return basic_istream_read_int64(this, v, num_get_short_use_facet(
10931 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10934 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
10936 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10937 int state = IOSTATE_goodbit;
10939 TRACE("(%p %p)\n", this, v);
10941 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10942 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10943 istreambuf_iterator_wchar first={0}, last={0};
10945 first.strbuf = strbuf;
10946 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
10948 basic_istream_wchar_sentry_destroy(this);
10950 basic_ios_wchar_setstate(base, state);
10951 return this;
10954 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
10955 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
10956 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
10957 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10959 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
10960 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10963 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
10964 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
10965 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
10966 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10968 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
10969 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10972 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
10974 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10975 int state = IOSTATE_goodbit;
10977 TRACE("(%p %p)\n", this, v);
10979 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10980 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10981 istreambuf_iterator_wchar first={0}, last={0};
10983 first.strbuf = strbuf;
10984 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
10986 basic_istream_wchar_sentry_destroy(this);
10988 basic_ios_wchar_setstate(base, state);
10989 return this;
10992 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
10993 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
10994 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
10995 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10997 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
10998 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
11001 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
11002 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
11003 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
11004 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
11006 return basic_istream_read_bool(this, v, num_get_short_use_facet(
11007 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
11010 /* ??$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 */
11011 /* ??$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 */
11012 /* ??$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 */
11013 /* ??$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 */
11014 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
11015 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
11017 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
11018 IOSB_iostate state = IOSTATE_goodbit;
11019 int c = delim;
11021 TRACE("(%p %p %c)\n", istream, str, delim);
11023 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
11024 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
11025 MSVCP_basic_string_wchar_clear(str);
11027 c = basic_streambuf_wchar_sgetc(strbuf);
11028 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
11029 MSVCP_basic_string_wchar_append_ch(str, c);
11030 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
11031 else if(c==WEOF) state |= IOSTATE_eofbit;
11033 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
11035 basic_istream_wchar_sentry_destroy(istream);
11037 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
11038 return istream;
11041 /* ??$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 */
11042 /* ??$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 */
11043 /* ??$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 */
11044 /* ??$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 */
11045 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
11046 basic_istream_wchar *istream, basic_string_wchar *str)
11048 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
11051 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
11052 basic_string_wchar *str, const ctype_wchar *ctype)
11054 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
11055 IOSB_iostate state = IOSTATE_failbit;
11056 int c = '\n';
11058 TRACE("(%p %p)\n", istream, str);
11060 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
11061 MSVCP_size_t count = ios_base_width_get(&base->base);
11063 if(!count)
11064 count = -1;
11066 MSVCP_basic_string_wchar_clear(str);
11068 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
11069 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
11070 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
11071 state = IOSTATE_goodbit;
11072 MSVCP_basic_string_wchar_append_ch(str, c);
11075 basic_istream_wchar_sentry_destroy(istream);
11077 ios_base_width_set(&base->base, 0);
11078 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11079 return istream;
11082 /* ??$?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 */
11083 /* ??$?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 */
11084 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
11085 basic_istream_wchar *istream, basic_string_wchar *str)
11087 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
11088 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11091 /* ??$?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 */
11092 /* ??$?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 */
11093 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
11094 basic_istream_wchar *istream, basic_string_wchar *str)
11096 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
11097 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11100 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
11102 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
11103 IOSB_iostate state = IOSTATE_failbit;
11104 unsigned short c = '\n';
11106 TRACE("(%p %p)\n", istream, str);
11108 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
11109 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
11111 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
11112 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
11113 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
11114 state = IOSTATE_goodbit;
11115 *str++ = c;
11118 basic_istream_wchar_sentry_destroy(istream);
11120 *str = 0;
11121 ios_base_width_set(&base->base, 0);
11122 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11123 return istream;
11126 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
11127 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
11128 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
11130 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
11131 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11134 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
11135 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
11136 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
11138 return basic_istream_read_str(istream, str, ctype_short_use_facet(
11139 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11142 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
11143 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
11144 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
11145 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
11146 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
11148 IOSB_iostate state = IOSTATE_failbit;
11149 unsigned short c = 0;
11151 TRACE("(%p %p)\n", istream, ch);
11153 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
11154 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
11155 basic_istream_wchar_get_basic_ios(istream)));
11156 if(c != WEOF) {
11157 state = IOSTATE_goodbit;
11158 *ch = c;
11161 basic_istream_wchar_sentry_destroy(istream);
11163 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
11164 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11165 return istream;
11168 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11169 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11170 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11171 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11172 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
11173 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
11174 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
11176 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
11177 IOSB_iostate state = IOSTATE_failbit;
11178 unsigned short c = '\n';
11180 TRACE("(%p %p)\n", this, streambuf);
11182 if(basic_istream_wchar_sentry_create(this, FALSE)) {
11183 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
11184 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
11185 state = IOSTATE_goodbit;
11186 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
11187 break;
11190 basic_istream_wchar_sentry_destroy(this);
11192 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11193 return this;
11196 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
11197 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
11198 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
11199 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
11200 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
11201 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
11202 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
11204 TRACE("(%p %p)\n", this, pfunc);
11205 pfunc(this);
11206 return this;
11209 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
11210 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
11211 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
11212 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
11213 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
11214 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
11215 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
11217 TRACE("(%p %p)\n", this, pfunc);
11218 pfunc(basic_istream_wchar_get_basic_ios(this));
11219 return this;
11222 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
11223 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
11224 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
11225 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
11226 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
11227 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
11228 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
11230 TRACE("(%p %p)\n", this, pfunc);
11231 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
11232 return this;
11235 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
11236 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
11237 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
11238 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
11239 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_swap, 8)
11240 void __thiscall basic_istream_wchar_swap(basic_istream_wchar *this, basic_istream_wchar *r)
11242 TRACE("(%p %p)\n", this, r);
11244 if(this == r)
11245 return;
11247 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(this),
11248 basic_istream_wchar_get_basic_ios(r));
11249 this->count ^= r->count;
11250 r->count ^= this->count;
11251 this->count ^= r->count;
11254 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
11256 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
11259 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
11261 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
11264 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
11265 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
11266 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
11267 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
11269 basic_ios_char *basic_ios;
11271 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
11273 if(virt_init) {
11274 this->base1.vbtable = basic_iostream_char_vbtable1;
11275 this->base2.vbtable = basic_iostream_char_vbtable2;
11276 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
11277 INIT_BASIC_IOS_VTORDISP(basic_ios);
11278 basic_ios_char_ctor(basic_ios);
11279 }else {
11280 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
11283 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
11284 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
11285 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
11286 return this;
11289 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11290 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11291 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
11292 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
11294 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
11296 TRACE("(%p)\n", this);
11297 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
11298 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
11301 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11302 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11303 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
11304 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
11306 basic_ios_char *base = basic_iostream_char_to_basic_ios(this);
11308 TRACE("(%p)\n", this);
11310 basic_iostream_char_dtor(base);
11311 basic_ios_char_dtor(base);
11314 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
11315 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11317 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
11319 TRACE("(%p %x)\n", this, flags);
11321 if(flags & 2) {
11322 /* we have an array, with the number of elements stored before the first object */
11323 INT_PTR i, *ptr = (INT_PTR *)this-1;
11325 for(i=*ptr-1; i>=0; i--)
11326 basic_iostream_char_vbase_dtor(this+i);
11327 MSVCRT_operator_delete(ptr);
11328 } else {
11329 basic_iostream_char_vbase_dtor(this);
11330 if(flags & 1)
11331 MSVCRT_operator_delete(this);
11334 return this;
11337 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
11338 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
11339 DEFINE_THISCALL_WRAPPER(basic_iostream_char_swap, 8)
11340 void __thiscall basic_iostream_char_swap(basic_iostream_char *this, basic_iostream_char *r)
11342 TRACE("(%p %p)\n", this, r);
11344 if(this == r)
11345 return;
11347 basic_ios_char_swap(basic_istream_char_get_basic_ios(&this->base1),
11348 basic_istream_char_get_basic_ios(&r->base1));
11351 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
11353 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
11356 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11358 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
11361 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11362 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11363 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
11364 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
11365 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
11367 basic_ios_wchar *basic_ios;
11369 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
11371 if(virt_init) {
11372 this->base1.vbtable = basic_iostream_wchar_vbtable1;
11373 this->base2.vbtable = basic_iostream_wchar_vbtable2;
11374 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
11375 INIT_BASIC_IOS_VTORDISP(basic_ios);
11376 basic_ios_wchar_ctor(basic_ios);
11377 }else {
11378 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
11381 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
11382 basic_ostream_wchar_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
11384 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
11385 return this;
11388 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11389 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11390 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
11391 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
11392 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
11394 basic_iostream_wchar_ctor(this, strbuf, virt_init);
11395 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
11396 return this;
11399 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11400 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11401 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11402 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11403 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
11404 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
11406 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
11408 TRACE("(%p)\n", this);
11409 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
11410 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
11413 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11414 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11415 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11416 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11417 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
11418 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
11420 basic_ios_wchar *base = basic_iostream_wchar_to_basic_ios(this);
11422 TRACE("(%p)\n", this);
11424 basic_iostream_wchar_dtor(base);
11425 basic_ios_wchar_dtor(base);
11428 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
11429 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11431 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
11433 TRACE("(%p %x)\n", this, flags);
11435 if(flags & 2) {
11436 /* we have an array, with the number of elements stored before the first object */
11437 INT_PTR i, *ptr = (INT_PTR *)this-1;
11439 for(i=*ptr-1; i>=0; i--)
11440 basic_iostream_wchar_vbase_dtor(this+i);
11441 MSVCRT_operator_delete(ptr);
11442 } else {
11443 basic_iostream_wchar_vbase_dtor(this);
11444 if(flags & 1)
11445 MSVCRT_operator_delete(this);
11448 return this;
11451 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
11452 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
11453 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
11454 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
11455 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_swap, 8)
11456 void __thiscall basic_iostream_wchar_swap(basic_iostream_wchar *this, basic_iostream_wchar *r)
11458 TRACE("(%p %p)\n", this, r);
11460 if(this == r)
11461 return;
11463 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(&this->base1),
11464 basic_istream_wchar_get_basic_ios(&r->base1));
11467 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
11469 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
11472 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
11474 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
11477 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11478 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11479 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
11480 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
11482 basic_ios_char *basic_ios;
11484 TRACE("(%p %d)\n", this, virt_init);
11486 if(virt_init) {
11487 this->base.vbtable = basic_ofstream_char_vbtable;
11488 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11489 INIT_BASIC_IOS_VTORDISP(basic_ios);
11490 basic_ios_char_ctor(basic_ios);
11491 }else {
11492 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11495 basic_filebuf_char_ctor(&this->filebuf);
11496 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11497 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
11498 return this;
11501 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11502 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11503 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
11504 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
11505 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
11507 basic_ios_char *basic_ios;
11509 TRACE("(%p %p %d)\n", this, file, virt_init);
11511 if(virt_init) {
11512 this->base.vbtable = basic_ofstream_char_vbtable;
11513 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11514 INIT_BASIC_IOS_VTORDISP(basic_ios);
11515 basic_ios_char_ctor(basic_ios);
11516 }else {
11517 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11520 basic_filebuf_char_ctor_file(&this->filebuf, file);
11521 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11522 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
11523 return this;
11526 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11527 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11528 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 20)
11529 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
11530 const char *name, int mode, int prot, MSVCP_bool virt_init)
11532 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11534 basic_ofstream_char_ctor(this, virt_init);
11536 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11537 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11538 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11540 return this;
11543 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11544 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11545 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11546 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11547 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name_wchar, 20)
11548 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name_wchar(basic_ofstream_char *this,
11549 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11551 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11553 basic_ofstream_char_ctor(this, virt_init);
11555 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11556 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11557 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11559 return this;
11562 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11563 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11564 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
11565 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
11567 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
11569 TRACE("(%p)\n", this);
11571 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
11572 basic_filebuf_char_dtor(&this->filebuf);
11575 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11576 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11577 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
11578 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
11580 basic_ios_char *base = basic_ofstream_char_to_basic_ios(this);
11582 TRACE("(%p)\n", this);
11584 basic_ofstream_char_dtor(base);
11585 basic_ios_char_dtor(base);
11588 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
11589 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11591 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
11593 TRACE("(%p %x)\n", this, flags);
11595 if(flags & 2) {
11596 /* we have an array, with the number of elements stored before the first object */
11597 INT_PTR i, *ptr = (INT_PTR *)this-1;
11599 for(i=*ptr-1; i>=0; i--)
11600 basic_ofstream_char_vbase_dtor(this+i);
11601 MSVCRT_operator_delete(ptr);
11602 } else {
11603 basic_ofstream_char_vbase_dtor(this);
11604 if(flags & 1)
11605 MSVCRT_operator_delete(this);
11608 return this;
11611 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11612 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11613 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
11614 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
11616 TRACE("(%p)\n", this);
11618 if(!basic_filebuf_char_close(&this->filebuf)) {
11619 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11620 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11624 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11625 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11626 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
11627 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
11629 TRACE("(%p)\n", this);
11630 return basic_filebuf_char_is_open(&this->filebuf);
11633 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11634 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11635 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 16)
11636 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
11637 const char *name, int mode, int prot)
11639 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11641 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11642 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11643 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11647 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11648 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11649 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
11650 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
11651 const char *name, unsigned int mode)
11653 basic_ofstream_char_open(this, name, mode, _SH_DENYNO);
11656 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11657 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11658 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11659 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11660 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar, 16)
11661 void __thiscall basic_ofstream_char_open_wchar(basic_ofstream_char *this,
11662 const wchar_t *name, int mode, int prot)
11664 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11666 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11667 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11668 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11672 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11673 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11674 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11675 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11676 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar_old, 12)
11677 void __thiscall basic_ofstream_char_open_wchar_old(basic_ofstream_char *this,
11678 const wchar_t *name, unsigned int mode)
11680 basic_ofstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11683 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11684 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11685 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
11686 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
11688 TRACE("(%p)\n", this);
11689 return (basic_filebuf_char*)&this->filebuf;
11692 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
11694 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
11697 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11699 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
11702 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11703 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11704 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
11705 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11707 basic_ios_wchar *basic_ios;
11709 TRACE("(%p %d)\n", this, virt_init);
11711 if(virt_init) {
11712 this->base.vbtable = basic_ofstream_wchar_vbtable;
11713 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11714 INIT_BASIC_IOS_VTORDISP(basic_ios);
11715 basic_ios_wchar_ctor(basic_ios);
11716 }else {
11717 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11720 basic_filebuf_wchar_ctor(&this->filebuf);
11721 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11722 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11723 return this;
11726 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11727 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11728 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
11729 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11731 basic_ofstream_wchar_ctor(this, virt_init);
11732 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11733 return this;
11736 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11737 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11738 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
11739 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
11740 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11742 basic_ios_wchar *basic_ios;
11744 TRACE("(%p %p %d)\n", this, file, virt_init);
11746 if(virt_init) {
11747 this->base.vbtable = basic_ofstream_wchar_vbtable;
11748 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11749 INIT_BASIC_IOS_VTORDISP(basic_ios);
11750 basic_ios_wchar_ctor(basic_ios);
11751 }else {
11752 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11755 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11756 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11757 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11758 return this;
11761 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11762 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11763 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
11764 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
11765 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11767 basic_ofstream_wchar_ctor_file(this, file, virt_init);
11768 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11769 return this;
11772 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
11773 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
11774 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name, 20)
11775 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name(basic_ofstream_wchar *this,
11776 const char *name, int mode, int prot, MSVCP_bool virt_init)
11778 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11780 basic_ofstream_wchar_ctor(this, virt_init);
11782 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11783 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11784 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11786 return this;
11789 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
11790 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
11791 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 20)
11792 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
11793 const char *name, int mode, int prot, MSVCP_bool virt_init)
11795 basic_ofstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11796 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11797 return this;
11800 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11801 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11802 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11803 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11804 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name_wchar, 20)
11805 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name_wchar(basic_ofstream_wchar *this,
11806 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11808 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11810 basic_ofstream_wchar_ctor(this, virt_init);
11812 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11813 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11814 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11816 return this;
11819 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11820 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11821 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11822 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11823 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name_wchar, 20)
11824 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name_wchar(basic_ofstream_wchar *this,
11825 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11827 basic_ofstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11828 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11829 return this;
11832 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11833 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11834 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11835 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11836 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
11837 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
11839 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11841 TRACE("(%p)\n", this);
11843 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11844 basic_filebuf_wchar_dtor(&this->filebuf);
11847 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11848 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11849 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11850 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11851 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
11852 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
11854 basic_ios_wchar *base = basic_ofstream_wchar_to_basic_ios(this);
11856 TRACE("(%p)\n", this);
11858 basic_ofstream_wchar_dtor(base);
11859 basic_ios_wchar_dtor(base);
11862 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
11863 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11865 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11867 TRACE("(%p %x)\n", this, flags);
11869 if(flags & 2) {
11870 /* we have an array, with the number of elements stored before the first object */
11871 INT_PTR i, *ptr = (INT_PTR *)this-1;
11873 for(i=*ptr-1; i>=0; i--)
11874 basic_ofstream_wchar_vbase_dtor(this+i);
11875 MSVCRT_operator_delete(ptr);
11876 } else {
11877 basic_ofstream_wchar_vbase_dtor(this);
11878 if(flags & 1)
11879 MSVCRT_operator_delete(this);
11882 return this;
11885 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11886 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11887 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11888 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11889 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
11890 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
11892 TRACE("(%p)\n", this);
11894 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11895 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11896 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11900 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11901 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11902 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11903 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11904 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
11905 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
11907 TRACE("(%p)\n", this);
11908 return basic_filebuf_wchar_is_open(&this->filebuf);
11911 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
11912 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
11913 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
11914 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
11915 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 16)
11916 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
11917 const char *name, int mode, int prot)
11919 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11921 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11922 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11923 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11927 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
11928 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
11929 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
11930 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
11931 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
11932 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
11933 const char *name, unsigned int mode)
11935 basic_ofstream_wchar_open(this, name, mode, _SH_DENYNO);
11938 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11939 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11940 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11941 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11942 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11943 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11944 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11945 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11946 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar, 16)
11947 void __thiscall basic_ofstream_wchar_open_wchar(basic_ofstream_wchar *this,
11948 const wchar_t *name, int mode, int prot)
11950 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11952 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11953 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11954 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11958 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11959 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11960 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11961 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11962 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11963 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11964 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11965 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11966 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar_old, 12)
11967 void __thiscall basic_ofstream_wchar_open_wchar_old(basic_ofstream_wchar *this,
11968 const wchar_t *name, unsigned int mode)
11970 basic_ofstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11973 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11974 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11975 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11976 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11977 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
11978 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
11980 TRACE("(%p)\n", this);
11981 return (basic_filebuf_wchar*)&this->filebuf;
11984 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
11986 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
11989 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
11991 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
11994 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11995 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11996 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
11997 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
11999 basic_ios_char *basic_ios;
12001 TRACE("(%p %d)\n", this, virt_init);
12003 if(virt_init) {
12004 this->base.vbtable = basic_ifstream_char_vbtable;
12005 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12006 INIT_BASIC_IOS_VTORDISP(basic_ios);
12007 basic_ios_char_ctor(basic_ios);
12008 }else {
12009 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12012 basic_filebuf_char_ctor(&this->filebuf);
12013 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12014 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
12015 return this;
12018 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
12019 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12020 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
12021 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
12022 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
12024 basic_ios_char *basic_ios;
12026 TRACE("(%p %p %d)\n", this, file, virt_init);
12028 if(virt_init) {
12029 this->base.vbtable = basic_ifstream_char_vbtable;
12030 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12031 INIT_BASIC_IOS_VTORDISP(basic_ios);
12032 basic_ios_char_ctor(basic_ios);
12033 }else {
12034 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12037 basic_filebuf_char_ctor_file(&this->filebuf, file);
12038 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12039 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
12040 return this;
12043 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
12044 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
12045 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 20)
12046 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
12047 const char *name, int mode, int prot, MSVCP_bool virt_init)
12049 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12051 basic_ifstream_char_ctor(this, virt_init);
12053 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12054 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12055 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12057 return this;
12060 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
12061 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
12062 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_old, 16)
12063 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_old(basic_ifstream_char *this,
12064 const char *name, int mode, MSVCP_bool virt_init)
12066 return basic_ifstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12069 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
12070 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
12071 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
12072 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
12073 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_wchar, 20)
12074 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_wchar(basic_ifstream_char *this,
12075 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12077 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12079 basic_ifstream_char_ctor(this, virt_init);
12081 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12082 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12083 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12085 return this;
12088 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
12089 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
12090 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
12091 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
12093 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
12095 TRACE("(%p)\n", this);
12097 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
12098 basic_filebuf_char_dtor(&this->filebuf);
12101 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12102 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12103 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
12104 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
12106 basic_ios_char *base = basic_ifstream_char_to_basic_ios(this);
12108 TRACE("(%p)\n", this);
12110 basic_ifstream_char_dtor(base);
12111 basic_ios_char_dtor(base);
12114 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
12115 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12117 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
12119 TRACE("(%p %x)\n", this, flags);
12121 if(flags & 2) {
12122 /* we have an array, with the number of elements stored before the first object */
12123 INT_PTR i, *ptr = (INT_PTR *)this-1;
12125 for(i=*ptr-1; i>=0; i--)
12126 basic_ifstream_char_vbase_dtor(this+i);
12127 MSVCRT_operator_delete(ptr);
12128 } else {
12129 basic_ifstream_char_vbase_dtor(this);
12130 if(flags & 1)
12131 MSVCRT_operator_delete(this);
12134 return this;
12137 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12138 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12139 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
12140 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
12142 TRACE("(%p)\n", this);
12144 if(!basic_filebuf_char_close(&this->filebuf)) {
12145 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12146 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12150 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
12151 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
12152 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
12153 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
12155 TRACE("(%p)\n", this);
12156 return basic_filebuf_char_is_open(&this->filebuf);
12159 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
12160 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
12161 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 16)
12162 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
12163 const char *name, int mode, int prot)
12165 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12167 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12168 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12169 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12173 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
12174 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
12175 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
12176 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
12177 const char *name, unsigned int mode)
12179 basic_ifstream_char_open(this, name, mode, _SH_DENYNO);
12182 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
12183 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
12184 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
12185 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
12186 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar, 16)
12187 void __thiscall basic_ifstream_char_open_wchar(basic_ifstream_char *this,
12188 const wchar_t *name, int mode, int prot)
12190 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12192 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12193 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12194 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12198 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
12199 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
12200 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
12201 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
12202 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar_old, 12)
12203 void __thiscall basic_ifstream_char_open_wchar_old(basic_ifstream_char *this,
12204 const wchar_t *name, unsigned int mode)
12206 basic_ifstream_char_open_wchar(this, name, mode, _SH_DENYNO);
12209 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12210 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12211 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
12212 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
12214 TRACE("(%p)\n", this);
12215 return (basic_filebuf_char*)&this->filebuf;
12218 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
12220 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
12223 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12225 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
12228 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
12229 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
12230 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
12231 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
12233 basic_ios_wchar *basic_ios;
12235 TRACE("(%p %d)\n", this, virt_init);
12237 if(virt_init) {
12238 this->base.vbtable = basic_ifstream_wchar_vbtable;
12239 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12240 INIT_BASIC_IOS_VTORDISP(basic_ios);
12241 basic_ios_wchar_ctor(basic_ios);
12242 }else {
12243 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12246 basic_filebuf_wchar_ctor(&this->filebuf);
12247 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12248 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
12249 return this;
12252 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
12253 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
12254 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
12255 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
12257 basic_ifstream_wchar_ctor(this, virt_init);
12258 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12259 return this;
12262 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
12263 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12264 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
12265 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
12266 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
12268 basic_ios_wchar *basic_ios;
12270 TRACE("(%p %p %d)\n", this, file, virt_init);
12272 if(virt_init) {
12273 this->base.vbtable = basic_ifstream_wchar_vbtable;
12274 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12275 INIT_BASIC_IOS_VTORDISP(basic_ios);
12276 basic_ios_wchar_ctor(basic_ios);
12277 }else {
12278 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12281 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
12282 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12283 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
12284 return this;
12287 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
12288 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12289 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
12290 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
12291 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
12293 basic_ifstream_wchar_ctor_file(this, file, virt_init);
12294 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12295 return this;
12298 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
12299 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
12300 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name, 20)
12301 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name(basic_ifstream_wchar *this,
12302 const char *name, int mode, int prot, MSVCP_bool virt_init)
12304 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12306 basic_ifstream_wchar_ctor(this, virt_init);
12308 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12309 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12310 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12312 return this;
12315 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
12316 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
12317 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 20)
12318 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
12319 const char *name, int mode, int prot, MSVCP_bool virt_init)
12321 basic_ifstream_wchar_ctor_name(this, name, mode, prot, virt_init);
12322 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12323 return this;
12326 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
12327 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDH@Z */
12328 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_old, 16)
12329 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_old(basic_ifstream_wchar *this,
12330 const char *name, int mode, MSVCP_bool virt_init)
12332 return basic_ifstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12335 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
12336 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
12337 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_old, 16)
12338 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_old(basic_ifstream_wchar *this,
12339 const char *name, int mode, MSVCP_bool virt_init)
12341 return basic_ifstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12344 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
12345 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
12346 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12347 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12348 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_wchar, 20)
12349 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_wchar(basic_ifstream_wchar *this,
12350 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12352 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12354 basic_ifstream_wchar_ctor(this, virt_init);
12356 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12357 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12358 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12360 return this;
12363 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12364 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12365 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
12366 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
12367 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_wchar, 20)
12368 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_wchar(basic_ifstream_wchar *this,
12369 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12371 basic_ifstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
12372 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12373 return this;
12376 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
12377 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
12378 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
12379 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
12380 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
12381 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
12383 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
12385 TRACE("(%p)\n", this);
12387 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12388 basic_filebuf_wchar_dtor(&this->filebuf);
12391 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12392 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12393 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12394 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12395 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
12396 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
12398 basic_ios_wchar *base = basic_ifstream_wchar_to_basic_ios(this);
12400 TRACE("(%p)\n", this);
12402 basic_ifstream_wchar_dtor(base);
12403 basic_ios_wchar_dtor(base);
12406 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
12407 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12409 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
12411 TRACE("(%p %x)\n", this, flags);
12413 if(flags & 2) {
12414 /* we have an array, with the number of elements stored before the first object */
12415 INT_PTR i, *ptr = (INT_PTR *)this-1;
12417 for(i=*ptr-1; i>=0; i--)
12418 basic_ifstream_wchar_vbase_dtor(this+i);
12419 MSVCRT_operator_delete(ptr);
12420 } else {
12421 basic_ifstream_wchar_vbase_dtor(this);
12422 if(flags & 1)
12423 MSVCRT_operator_delete(this);
12426 return this;
12429 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12430 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12431 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12432 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12433 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
12434 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
12436 TRACE("(%p)\n", this);
12438 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12439 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12440 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12444 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12445 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12446 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12447 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12448 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
12449 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
12451 TRACE("(%p)\n", this);
12452 return basic_filebuf_wchar_is_open(&this->filebuf);
12455 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
12456 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
12457 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
12458 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
12459 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 16)
12460 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
12461 const char *name, int mode, int prot)
12463 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12465 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12466 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12467 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12471 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
12472 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
12473 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
12474 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
12475 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
12476 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
12477 const char *name, unsigned int mode)
12479 basic_ifstream_wchar_open(this, name, mode, _SH_DENYNO);
12482 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
12483 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
12484 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
12485 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
12486 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
12487 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
12488 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
12489 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
12490 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar, 16)
12491 void __thiscall basic_ifstream_wchar_open_wchar(basic_ifstream_wchar *this,
12492 const wchar_t *name, int mode, int prot)
12494 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12496 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12497 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12498 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12502 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
12503 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
12504 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
12505 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
12506 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
12507 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
12508 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
12509 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
12510 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar_old, 12)
12511 void __thiscall basic_ifstream_wchar_open_wchar_old(basic_ifstream_wchar *this,
12512 const wchar_t *name, unsigned int mode)
12514 basic_ifstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
12517 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12518 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12519 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12520 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12521 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
12522 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
12524 TRACE("(%p)\n", this);
12525 return (basic_filebuf_wchar*)&this->filebuf;
12528 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
12530 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
12533 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
12535 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
12538 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
12539 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
12540 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
12541 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
12543 basic_ios_char *basic_ios;
12545 TRACE("(%p %d)\n", this, virt_init);
12547 if(virt_init) {
12548 this->base.base1.vbtable = basic_fstream_char_vbtable1;
12549 this->base.base2.vbtable = basic_fstream_char_vbtable2;
12550 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12551 INIT_BASIC_IOS_VTORDISP(basic_ios);
12552 basic_ios_char_ctor(basic_ios);
12553 }else {
12554 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12557 basic_filebuf_char_ctor(&this->filebuf);
12558 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
12559 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
12560 return this;
12563 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
12564 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12565 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
12566 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
12567 FILE *file, MSVCP_bool virt_init)
12569 basic_ios_char *basic_ios;
12571 TRACE("(%p %p %d)\n", this, file, virt_init);
12573 if(virt_init) {
12574 this->base.base1.vbtable = basic_fstream_char_vbtable1;
12575 this->base.base2.vbtable = basic_fstream_char_vbtable2;
12576 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12577 INIT_BASIC_IOS_VTORDISP(basic_ios);
12578 basic_ios_char_ctor(basic_ios);
12579 }else {
12580 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12583 basic_filebuf_char_ctor_file(&this->filebuf, file);
12584 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
12585 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
12586 return this;
12589 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
12590 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
12591 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 20)
12592 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
12593 const char *name, int mode, int prot, MSVCP_bool virt_init)
12595 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12597 basic_fstream_char_ctor(this, virt_init);
12599 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
12600 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12601 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12603 return this;
12606 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
12607 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
12608 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_noprot, 16)
12609 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_noprot(basic_fstream_char *this,
12610 const char *name, int mode, MSVCP_bool virt_init)
12612 return basic_fstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12615 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
12616 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
12617 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
12618 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
12619 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_wchar, 20)
12620 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_wchar(basic_fstream_char *this,
12621 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12623 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12625 basic_fstream_char_ctor(this, virt_init);
12627 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
12628 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12629 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12631 return this;
12634 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
12635 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
12636 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
12637 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
12639 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
12641 TRACE("(%p)\n", this);
12643 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12644 basic_filebuf_char_dtor(&this->filebuf);
12647 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12648 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12649 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
12650 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
12652 basic_ios_char *base = basic_fstream_char_to_basic_ios(this);
12654 TRACE("(%p)\n", this);
12656 basic_fstream_char_dtor(base);
12657 basic_ios_char_dtor(base);
12660 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
12661 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12663 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
12665 TRACE("(%p %x)\n", this, flags);
12667 if(flags & 2) {
12668 /* we have an array, with the number of elements stored before the first object */
12669 INT_PTR i, *ptr = (INT_PTR *)this-1;
12671 for(i=*ptr-1; i>=0; i--)
12672 basic_fstream_char_vbase_dtor(this+i);
12673 MSVCRT_operator_delete(ptr);
12674 } else {
12675 basic_fstream_char_vbase_dtor(this);
12676 if(flags & 1)
12677 MSVCRT_operator_delete(this);
12680 return this;
12683 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12684 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12685 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
12686 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
12688 TRACE("(%p)\n", this);
12690 if(!basic_filebuf_char_close(&this->filebuf)) {
12691 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12692 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12696 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
12697 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
12698 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
12699 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
12701 TRACE("(%p)\n", this);
12702 return basic_filebuf_char_is_open(&this->filebuf);
12705 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
12706 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
12707 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 16)
12708 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
12709 const char *name, int mode, int prot)
12711 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12713 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
12714 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12715 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12719 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
12720 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
12721 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
12722 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
12723 const char *name, unsigned int mode)
12725 basic_fstream_char_open(this, name, mode, _SH_DENYNO);
12728 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
12729 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
12730 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
12731 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
12732 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar, 16)
12733 void __thiscall basic_fstream_char_open_wchar(basic_fstream_char *this,
12734 const wchar_t *name, int mode, int prot)
12736 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12738 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
12739 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12740 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12744 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
12745 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
12746 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
12747 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
12748 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar_old, 12)
12749 void __thiscall basic_fstream_char_open_wchar_old(basic_fstream_char *this,
12750 const wchar_t *name, unsigned int mode)
12752 basic_fstream_char_open_wchar(this, name, mode, _SH_DENYNO);
12755 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12756 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12757 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
12758 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
12760 TRACE("(%p)\n", this);
12761 return (basic_filebuf_char*)&this->filebuf;
12764 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
12766 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
12769 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12771 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
12774 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
12775 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
12776 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
12777 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12779 basic_ios_wchar *basic_ios;
12781 TRACE("(%p %d)\n", this, virt_init);
12783 if(virt_init) {
12784 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12785 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12786 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12787 INIT_BASIC_IOS_VTORDISP(basic_ios);
12788 basic_ios_wchar_ctor(basic_ios);
12789 }else {
12790 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12793 basic_filebuf_wchar_ctor(&this->filebuf);
12794 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12795 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12796 return this;
12799 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
12800 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
12801 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
12802 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12804 basic_fstream_wchar_ctor(this, virt_init);
12805 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12806 return this;
12809 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
12810 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12811 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
12812 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
12813 FILE *file, MSVCP_bool virt_init)
12815 basic_ios_wchar *basic_ios;
12817 TRACE("(%p %p %d)\n", this, file, virt_init);
12819 if(virt_init) {
12820 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12821 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12822 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12823 INIT_BASIC_IOS_VTORDISP(basic_ios);
12824 basic_ios_wchar_ctor(basic_ios);
12825 }else {
12826 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12829 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
12830 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12831 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12832 return this;
12835 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
12836 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12837 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
12838 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
12839 FILE *file, MSVCP_bool virt_init)
12841 basic_fstream_wchar_ctor_file(this, file, virt_init);
12842 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12843 return this;
12846 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12847 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12848 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name, 20)
12849 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name(basic_fstream_wchar *this,
12850 const char *name, int mode, int prot, MSVCP_bool virt_init)
12852 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12854 basic_fstream_wchar_ctor(this, virt_init);
12856 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
12857 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12858 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12860 return this;
12863 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12864 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12865 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 20)
12866 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
12867 const char *name, int mode, int prot, MSVCP_bool virt_init)
12869 basic_fstream_wchar_ctor_name(this, name, mode, prot, virt_init);
12870 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12871 return this;
12874 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
12875 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_noprot, 16)
12876 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_noprot(basic_fstream_wchar *this,
12877 const char *name, int mode, MSVCP_bool virt_init)
12879 return basic_fstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12882 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
12883 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
12884 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_noprot, 16)
12885 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_noprot(basic_fstream_wchar *this,
12886 const char *name, int mode, MSVCP_bool virt_init)
12888 return basic_fstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12891 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
12892 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
12893 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12894 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12895 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_wchar, 20)
12896 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_wchar(basic_fstream_wchar *this,
12897 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12899 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12901 basic_fstream_wchar_ctor(this, virt_init);
12903 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
12904 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12905 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12907 return this;
12910 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12911 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12912 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
12913 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
12914 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_wchar, 20)
12915 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_wchar(basic_fstream_wchar *this,
12916 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12918 basic_fstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
12919 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12920 return this;
12923 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
12924 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
12925 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
12926 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
12927 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
12928 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
12930 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12932 TRACE("(%p)\n", this);
12934 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
12935 basic_filebuf_wchar_dtor(&this->filebuf);
12938 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12939 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12940 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12941 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12942 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
12943 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
12945 basic_ios_wchar *base = basic_fstream_wchar_to_basic_ios(this);
12947 TRACE("(%p)\n", this);
12949 basic_fstream_wchar_dtor(base);
12950 basic_ios_wchar_dtor(base);
12953 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
12954 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12956 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12958 TRACE("(%p %x)\n", this, flags);
12960 if(flags & 2) {
12961 /* we have an array, with the number of elements stored before the first object */
12962 INT_PTR i, *ptr = (INT_PTR *)this-1;
12964 for(i=*ptr-1; i>=0; i--)
12965 basic_fstream_wchar_vbase_dtor(this+i);
12966 MSVCRT_operator_delete(ptr);
12967 } else {
12968 basic_fstream_wchar_vbase_dtor(this);
12969 if(flags & 1)
12970 MSVCRT_operator_delete(this);
12973 return this;
12976 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12977 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12978 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12979 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12980 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
12981 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
12983 TRACE("(%p)\n", this);
12985 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12986 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12987 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12991 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12992 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12993 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12994 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12995 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
12996 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
12998 TRACE("(%p)\n", this);
12999 return basic_filebuf_wchar_is_open(&this->filebuf);
13002 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
13003 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
13004 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
13005 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
13006 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 16)
13007 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
13008 const char *name, int mode, int prot)
13010 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
13012 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
13013 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13014 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
13018 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
13019 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
13020 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
13021 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
13022 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
13023 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
13024 const char *name, unsigned int mode)
13026 basic_fstream_wchar_open(this, name, mode, _SH_DENYNO);
13029 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
13030 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
13031 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
13032 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
13033 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
13034 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
13035 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
13036 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
13037 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar, 16)
13038 void __thiscall basic_fstream_wchar_open_wchar(basic_fstream_wchar *this,
13039 const wchar_t *name, int mode, int prot)
13041 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
13043 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
13044 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13045 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
13049 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
13050 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
13051 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
13052 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
13053 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
13054 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
13055 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
13056 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
13057 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar_old, 12)
13058 void __thiscall basic_fstream_wchar_open_wchar_old(basic_fstream_wchar *this,
13059 const wchar_t *name, unsigned int mode)
13061 basic_fstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
13064 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
13065 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
13066 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
13067 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
13068 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
13069 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
13071 TRACE("(%p)\n", this);
13072 return (basic_filebuf_wchar*)&this->filebuf;
13075 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
13077 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
13080 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
13082 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
13085 /* ??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 */
13086 /* ??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 */
13087 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
13088 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
13089 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13091 basic_ios_char *basic_ios;
13093 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13095 if(virt_init) {
13096 this->base.vbtable = basic_ostringstream_char_vbtable;
13097 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13098 INIT_BASIC_IOS_VTORDISP(basic_ios);
13099 basic_ios_char_ctor(basic_ios);
13100 }else {
13101 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13104 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
13105 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13106 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
13107 return this;
13110 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13111 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13112 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
13113 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
13114 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
13116 basic_ios_char *basic_ios;
13118 TRACE("(%p %d %d)\n", this, mode, virt_init);
13120 if(virt_init) {
13121 this->base.vbtable = basic_ostringstream_char_vbtable;
13122 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13123 INIT_BASIC_IOS_VTORDISP(basic_ios);
13124 basic_ios_char_ctor(basic_ios);
13125 }else {
13126 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13129 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
13130 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13131 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
13132 return this;
13135 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13136 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13137 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
13138 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
13139 basic_ostringstream_char *this)
13141 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
13144 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13145 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13146 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
13147 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
13149 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
13151 TRACE("(%p)\n", this);
13153 basic_stringbuf_char_dtor(&this->strbuf);
13154 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
13157 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13158 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13159 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
13160 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
13162 basic_ios_char *base = basic_ostringstream_char_to_basic_ios(this);
13164 TRACE("(%p)\n", this);
13166 basic_ostringstream_char_dtor(base);
13167 basic_ios_char_dtor(base);
13170 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
13171 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13173 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
13175 TRACE("(%p %x)\n", this, flags);
13177 if(flags & 2) {
13178 /* we have an array, with the number of elements stored before the first object */
13179 INT_PTR i, *ptr = (INT_PTR *)this-1;
13181 for(i=*ptr-1; i>=0; i--)
13182 basic_ostringstream_char_vbase_dtor(this+i);
13183 MSVCRT_operator_delete(ptr);
13184 } else {
13185 basic_ostringstream_char_vbase_dtor(this);
13186 if(flags & 1)
13187 MSVCRT_operator_delete(this);
13190 return this;
13193 /* ?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 */
13194 /* ?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 */
13195 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
13196 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
13198 TRACE("(%p)\n", this);
13199 return (basic_stringbuf_char*)&this->strbuf;
13202 /* ?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 */
13203 /* ?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 */
13204 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
13205 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
13207 TRACE("(%p %p)\n", this, str);
13208 basic_stringbuf_char_str_set(&this->strbuf, str);
13211 /* ?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 */
13212 /* ?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 */
13213 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
13214 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
13216 TRACE("(%p %p)\n", this, ret);
13217 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13220 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
13222 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
13225 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13227 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
13230 /* ??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 */
13231 /* ??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 */
13232 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
13233 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
13234 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13236 basic_ios_wchar *basic_ios;
13238 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13240 if(virt_init) {
13241 this->base.vbtable = basic_ostringstream_wchar_vbtable;
13242 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13243 INIT_BASIC_IOS_VTORDISP(basic_ios);
13244 basic_ios_wchar_ctor(basic_ios);
13245 }else {
13246 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13249 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
13250 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13251 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
13252 return this;
13255 /* ??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 */
13256 /* ??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 */
13257 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
13258 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
13259 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13261 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
13262 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
13263 return this;
13266 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13267 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13268 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
13269 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
13270 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
13272 basic_ios_wchar *basic_ios;
13274 TRACE("(%p %d %d)\n", this, mode, virt_init);
13276 if(virt_init) {
13277 this->base.vbtable = basic_ostringstream_wchar_vbtable;
13278 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13279 INIT_BASIC_IOS_VTORDISP(basic_ios);
13280 basic_ios_wchar_ctor(basic_ios);
13281 }else {
13282 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13285 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
13286 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13287 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
13288 return this;
13291 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13292 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13293 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
13294 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
13295 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
13297 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
13298 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
13299 return this;
13302 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13303 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13304 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
13305 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
13306 basic_ostringstream_wchar *this)
13308 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
13311 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13312 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13313 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
13314 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
13315 basic_ostringstream_wchar *this)
13317 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
13320 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13321 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13322 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13323 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13324 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
13325 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
13327 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
13329 TRACE("(%p)\n", this);
13331 basic_stringbuf_wchar_dtor(&this->strbuf);
13332 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
13335 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13336 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13337 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13338 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13339 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
13340 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
13342 basic_ios_wchar *base = basic_ostringstream_wchar_to_basic_ios(this);
13344 TRACE("(%p)\n", this);
13346 basic_ostringstream_wchar_dtor(base);
13347 basic_ios_wchar_dtor(base);
13350 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
13351 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13353 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
13355 TRACE("(%p %x)\n", this, flags);
13357 if(flags & 2) {
13358 /* we have an array, with the number of elements stored before the first object */
13359 INT_PTR i, *ptr = (INT_PTR *)this-1;
13361 for(i=*ptr-1; i>=0; i--)
13362 basic_ostringstream_wchar_vbase_dtor(this+i);
13363 MSVCRT_operator_delete(ptr);
13364 } else {
13365 basic_ostringstream_wchar_vbase_dtor(this);
13366 if(flags & 1)
13367 MSVCRT_operator_delete(this);
13370 return this;
13373 /* ?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 */
13374 /* ?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 */
13375 /* ?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 */
13376 /* ?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 */
13377 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
13378 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
13380 TRACE("(%p)\n", this);
13381 return (basic_stringbuf_wchar*)&this->strbuf;
13384 /* ?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 */
13385 /* ?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 */
13386 /* ?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 */
13387 /* ?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 */
13388 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
13389 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
13391 TRACE("(%p %p)\n", this, str);
13392 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13395 /* ?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 */
13396 /* ?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 */
13397 /* ?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 */
13398 /* ?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 */
13399 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
13400 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
13402 TRACE("(%p %p)\n", this, ret);
13403 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13406 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
13408 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
13411 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
13413 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
13416 /* ??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 */
13417 /* ??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 */
13418 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
13419 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
13420 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13422 basic_ios_char *basic_ios;
13424 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13426 if(virt_init) {
13427 this->base.vbtable = basic_istringstream_char_vbtable;
13428 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13429 INIT_BASIC_IOS_VTORDISP(basic_ios);
13430 basic_ios_char_ctor(basic_ios);
13431 }else {
13432 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13435 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
13436 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13437 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
13438 return this;
13441 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13442 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13443 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
13444 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
13445 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
13447 basic_ios_char *basic_ios;
13449 TRACE("(%p %d %d)\n", this, mode, virt_init);
13451 if(virt_init) {
13452 this->base.vbtable = basic_istringstream_char_vbtable;
13453 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13454 INIT_BASIC_IOS_VTORDISP(basic_ios);
13455 basic_ios_char_ctor(basic_ios);
13456 }else {
13457 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13460 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
13461 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13462 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
13463 return this;
13466 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13467 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13468 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
13469 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
13470 basic_istringstream_char *this)
13472 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
13475 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13476 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13477 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
13478 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
13480 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
13482 TRACE("(%p)\n", this);
13484 basic_stringbuf_char_dtor(&this->strbuf);
13485 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
13488 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13489 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13490 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
13491 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
13493 basic_ios_char *base = basic_istringstream_char_to_basic_ios(this);
13495 TRACE("(%p)\n", this);
13497 basic_istringstream_char_dtor(base);
13498 basic_ios_char_dtor(base);
13501 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
13502 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13504 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
13506 TRACE("(%p %x)\n", this, flags);
13508 if(flags & 2) {
13509 /* we have an array, with the number of elements stored before the first object */
13510 INT_PTR i, *ptr = (INT_PTR *)this-1;
13512 for(i=*ptr-1; i>=0; i--)
13513 basic_istringstream_char_vbase_dtor(this+i);
13514 MSVCRT_operator_delete(ptr);
13515 } else {
13516 basic_istringstream_char_vbase_dtor(this);
13517 if(flags & 1)
13518 MSVCRT_operator_delete(this);
13521 return this;
13524 /* ?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 */
13525 /* ?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 */
13526 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
13527 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
13529 TRACE("(%p)\n", this);
13530 return (basic_stringbuf_char*)&this->strbuf;
13533 /* ?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 */
13534 /* ?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 */
13535 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
13536 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
13538 TRACE("(%p %p)\n", this, str);
13539 basic_stringbuf_char_str_set(&this->strbuf, str);
13542 /* ?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 */
13543 /* ?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 */
13544 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
13545 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
13547 TRACE("(%p %p)\n", this, ret);
13548 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13551 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
13553 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
13556 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13558 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
13561 /* ??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 */
13562 /* ??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 */
13563 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
13564 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
13565 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13567 basic_ios_wchar *basic_ios;
13569 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13571 if(virt_init) {
13572 this->base.vbtable = basic_istringstream_wchar_vbtable;
13573 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13574 INIT_BASIC_IOS_VTORDISP(basic_ios);
13575 basic_ios_wchar_ctor(basic_ios);
13576 }else {
13577 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13580 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
13581 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13582 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
13583 return this;
13586 /* ??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 */
13587 /* ??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 */
13588 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
13589 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
13590 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13592 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
13593 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
13594 return this;
13597 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13598 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13599 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
13600 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
13601 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
13603 basic_ios_wchar *basic_ios;
13605 TRACE("(%p %d %d)\n", this, mode, virt_init);
13607 if(virt_init) {
13608 this->base.vbtable = basic_istringstream_wchar_vbtable;
13609 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13610 INIT_BASIC_IOS_VTORDISP(basic_ios);
13611 basic_ios_wchar_ctor(basic_ios);
13612 }else {
13613 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13616 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
13617 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13618 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
13619 return this;
13622 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13623 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13624 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
13625 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
13626 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
13628 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
13629 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
13630 return this;
13633 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13634 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13635 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
13636 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
13637 basic_istringstream_wchar *this)
13639 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
13642 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13643 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13644 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
13645 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
13646 basic_istringstream_wchar *this)
13648 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
13651 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13652 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13653 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13654 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13655 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
13656 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
13658 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
13660 TRACE("(%p)\n", this);
13662 basic_stringbuf_wchar_dtor(&this->strbuf);
13663 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
13666 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13667 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13668 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13669 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13670 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
13671 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
13673 basic_ios_wchar *base = basic_istringstream_wchar_to_basic_ios(this);
13675 TRACE("(%p)\n", this);
13677 basic_istringstream_wchar_dtor(base);
13678 basic_ios_wchar_dtor(base);
13681 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
13682 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13684 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
13686 TRACE("(%p %x)\n", this, flags);
13688 if(flags & 2) {
13689 /* we have an array, with the number of elements stored before the first object */
13690 INT_PTR i, *ptr = (INT_PTR *)this-1;
13692 for(i=*ptr-1; i>=0; i--)
13693 basic_istringstream_wchar_vbase_dtor(this+i);
13694 MSVCRT_operator_delete(ptr);
13695 } else {
13696 basic_istringstream_wchar_vbase_dtor(this);
13697 if(flags & 1)
13698 MSVCRT_operator_delete(this);
13701 return this;
13704 /* ?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 */
13705 /* ?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 */
13706 /* ?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 */
13707 /* ?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 */
13708 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
13709 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
13711 TRACE("(%p)\n", this);
13712 return (basic_stringbuf_wchar*)&this->strbuf;
13715 /* ?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 */
13716 /* ?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 */
13717 /* ?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 */
13718 /* ?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 */
13719 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
13720 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
13722 TRACE("(%p %p)\n", this, str);
13723 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13726 /* ?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 */
13727 /* ?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 */
13728 /* ?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 */
13729 /* ?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 */
13730 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
13731 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
13733 TRACE("(%p %p)\n", this, ret);
13734 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13737 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
13739 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
13742 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
13744 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
13747 /* ??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 */
13748 /* ??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 */
13749 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
13750 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
13751 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13753 basic_ios_char *basic_ios;
13755 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13757 if(virt_init) {
13758 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
13759 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
13760 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13761 INIT_BASIC_IOS_VTORDISP(basic_ios);
13762 basic_ios_char_ctor(basic_ios);
13763 }else {
13764 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13767 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
13768 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
13769 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
13770 return this;
13773 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13774 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13775 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
13776 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
13777 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
13779 basic_ios_char *basic_ios;
13781 TRACE("(%p %d %d)\n", this, mode, virt_init);
13783 if(virt_init) {
13784 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
13785 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
13786 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13787 INIT_BASIC_IOS_VTORDISP(basic_ios);
13788 basic_ios_char_ctor(basic_ios);
13789 }else {
13790 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13793 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
13794 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
13795 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
13796 return this;
13799 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13800 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13801 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
13802 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
13803 basic_stringstream_char *this)
13805 return basic_stringstream_char_ctor_mode(
13806 this, OPENMODE_out|OPENMODE_in, TRUE);
13809 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13810 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13811 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
13812 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
13814 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13816 TRACE("(%p)\n", this);
13818 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13819 basic_stringbuf_char_dtor(&this->strbuf);
13822 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13823 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13824 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
13825 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
13827 basic_ios_char *base = basic_stringstream_char_to_basic_ios(this);
13829 TRACE("(%p)\n", this);
13831 basic_stringstream_char_dtor(base);
13832 basic_ios_char_dtor(base);
13835 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
13836 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13838 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13840 TRACE("(%p %x)\n", this, flags);
13842 if(flags & 2) {
13843 /* we have an array, with the number of elements stored before the first object */
13844 INT_PTR i, *ptr = (INT_PTR *)this-1;
13846 for(i=*ptr-1; i>=0; i--)
13847 basic_stringstream_char_vbase_dtor(this+i);
13848 MSVCRT_operator_delete(ptr);
13849 } else {
13850 basic_stringstream_char_vbase_dtor(this);
13851 if(flags & 1)
13852 MSVCRT_operator_delete(this);
13855 return this;
13858 /* ?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 */
13859 /* ?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 */
13860 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
13861 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
13863 TRACE("(%p)\n", this);
13864 return (basic_stringbuf_char*)&this->strbuf;
13867 /* ?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 */
13868 /* ?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 */
13869 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
13870 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
13872 TRACE("(%p %p)\n", this, str);
13873 basic_stringbuf_char_str_set(&this->strbuf, str);
13876 /* ?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 */
13877 /* ?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 */
13878 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
13879 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
13881 TRACE("(%p %p)\n", this, ret);
13882 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13885 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
13887 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
13890 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13892 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
13895 /* ??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 */
13896 /* ??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 */
13897 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
13898 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
13899 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13901 basic_ios_wchar *basic_ios;
13903 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13905 if(virt_init) {
13906 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13907 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13908 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13909 INIT_BASIC_IOS_VTORDISP(basic_ios);
13910 basic_ios_wchar_ctor(basic_ios);
13911 }else {
13912 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13915 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
13916 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13917 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13918 return this;
13921 /* ??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 */
13922 /* ??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 */
13923 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
13924 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
13925 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13927 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
13928 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13929 return this;
13932 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13933 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13934 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
13935 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
13936 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13938 basic_ios_wchar *basic_ios;
13940 TRACE("(%p %d %d)\n", this, mode, virt_init);
13942 if(virt_init) {
13943 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13944 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13945 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13946 INIT_BASIC_IOS_VTORDISP(basic_ios);
13947 basic_ios_wchar_ctor(basic_ios);
13948 }else {
13949 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13952 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
13953 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13954 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13955 return this;
13958 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13959 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13960 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
13961 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
13962 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13964 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
13965 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13966 return this;
13969 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13970 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13971 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
13972 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
13973 basic_stringstream_wchar *this)
13975 return basic_stringstream_wchar_ctor_mode(
13976 this, OPENMODE_out|OPENMODE_in, TRUE);
13979 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13980 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13981 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
13982 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
13983 basic_stringstream_wchar *this)
13985 return basic_stringstream_short_ctor_mode(
13986 this, OPENMODE_out|OPENMODE_in, TRUE);
13989 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13990 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13991 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13992 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13993 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
13994 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
13996 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13998 TRACE("(%p)\n", this);
14000 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
14001 basic_stringbuf_wchar_dtor(&this->strbuf);
14004 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
14005 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
14006 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
14007 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
14008 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
14009 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
14011 basic_ios_wchar *base = basic_stringstream_wchar_to_basic_ios(this);
14013 TRACE("(%p)\n", this);
14015 basic_stringstream_wchar_dtor(base);
14016 basic_ios_wchar_dtor(base);
14019 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
14020 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
14022 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
14024 TRACE("(%p %x)\n", this, flags);
14026 if(flags & 2) {
14027 /* we have an array, with the number of elements stored before the first object */
14028 INT_PTR i, *ptr = (INT_PTR *)this-1;
14030 for(i=*ptr-1; i>=0; i--)
14031 basic_stringstream_wchar_vbase_dtor(this+i);
14032 MSVCRT_operator_delete(ptr);
14033 } else {
14034 basic_stringstream_wchar_vbase_dtor(this);
14035 if(flags & 1)
14036 MSVCRT_operator_delete(this);
14039 return this;
14042 /* ?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 */
14043 /* ?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 */
14044 /* ?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 */
14045 /* ?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 */
14046 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
14047 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
14049 TRACE("(%p)\n", this);
14050 return (basic_stringbuf_wchar*)&this->strbuf;
14053 /* ?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 */
14054 /* ?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 */
14055 /* ?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 */
14056 /* ?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 */
14057 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
14058 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
14060 TRACE("(%p %p)\n", this, str);
14061 basic_stringbuf_wchar_str_set(&this->strbuf, str);
14064 /* ?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 */
14065 /* ?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 */
14066 /* ?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 */
14067 /* ?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 */
14068 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
14069 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
14071 TRACE("(%p %p)\n", this, ret);
14072 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
14075 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
14076 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
14077 #if STREAMSIZE_BITS == 64
14078 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
14079 #else
14080 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
14081 #endif
14082 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
14084 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
14086 this->minsize = 32;
14087 this->endsave = NULL;
14088 this->strmode = mode;
14089 this->palloc = NULL;
14090 this->pfree = NULL;
14092 if(!g) {
14093 this->strmode |= STRSTATE_Dynamic;
14094 if(len > this->minsize)
14095 this->minsize = len;
14096 this->seekhigh = NULL;
14097 return;
14100 if(len < 0)
14101 len = INT_MAX;
14102 else if(!len)
14103 len = strlen(g);
14105 this->seekhigh = g+len;
14106 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
14107 if(p)
14108 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
14111 /* ??0strstreambuf@std@@QAE@PACH0@Z */
14112 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
14113 /* ??0strstreambuf@std@@QAE@PADH0@Z */
14114 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
14115 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
14116 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
14117 #if STREAMSIZE_BITS == 64
14118 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
14119 #else
14120 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
14121 #endif
14122 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
14124 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
14126 basic_streambuf_char_ctor(&this->base);
14127 this->base.vtable = &MSVCP_strstreambuf_vtable;
14129 strstreambuf__Init(this, len, g, p, 0);
14130 return this;
14133 /* ??0strstreambuf@std@@QAE@H@Z */
14134 /* ??0strstreambuf@std@@QEAA@_J@Z */
14135 #if STREAMSIZE_BITS == 64
14136 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 12)
14137 #else
14138 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
14139 #endif
14140 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
14142 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
14145 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
14146 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
14147 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
14148 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(MSVCP_size_t), void (__cdecl *pfree)(void*))
14150 TRACE("(%p %p %p)\n", this, palloc, pfree);
14152 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
14153 this->palloc = palloc;
14154 this->pfree = pfree;
14155 return this;
14158 /* ??0strstreambuf@std@@QAE@PBCH@Z */
14159 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
14160 /* ??0strstreambuf@std@@QAE@PBDH@Z */
14161 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
14162 /* ??0strstreambuf@std@@QAE@PBEH@Z */
14163 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
14164 #if STREAMSIZE_BITS == 64
14165 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 16)
14166 #else
14167 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
14168 #endif
14169 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
14171 TRACE("(%p %p %s)\n", this, g, wine_dbgstr_longlong(len));
14173 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
14174 this->strmode |= STRSTATE_Constant;
14175 return this;
14178 /* ??_Fstrstreambuf@std@@QAEXXZ */
14179 /* ??_Fstrstreambuf@std@@QEAAXXZ */
14180 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
14181 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
14183 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
14186 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
14187 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
14188 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
14189 void __thiscall strstreambuf__Tidy(strstreambuf *this)
14191 TRACE("(%p)\n", this);
14193 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
14194 if(this->pfree)
14195 this->pfree(basic_streambuf_char_eback(&this->base));
14196 else
14197 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
14200 this->endsave = NULL;
14201 this->seekhigh = NULL;
14202 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
14203 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
14204 basic_streambuf_char_setp(&this->base, NULL, NULL);
14207 /* ??1strstreambuf@std@@UAE@XZ */
14208 /* ??1strstreambuf@std@@UEAA@XZ */
14209 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
14210 void __thiscall strstreambuf_dtor(strstreambuf *this)
14212 TRACE("(%p)\n", this);
14214 strstreambuf__Tidy(this);
14215 basic_streambuf_char_dtor(&this->base);
14218 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
14219 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
14221 TRACE("(%p %x)\n", this, flags);
14222 if(flags & 2) {
14223 /* we have an array, with the number of elements stored before the first object */
14224 INT_PTR i, *ptr = (INT_PTR *)this-1;
14226 for(i=*ptr-1; i>=0; i--)
14227 strstreambuf_dtor(this+i);
14228 MSVCRT_operator_delete(ptr);
14229 } else {
14230 strstreambuf_dtor(this);
14231 if(flags & 1)
14232 MSVCRT_operator_delete(this);
14235 return this;
14238 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
14239 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
14240 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
14241 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
14243 TRACE("(%p %d)\n", this, freeze);
14245 if(!freeze == !(this->strmode & STRSTATE_Frozen))
14246 return;
14248 if(freeze) {
14249 this->strmode |= STRSTATE_Frozen;
14250 this->endsave = basic_streambuf_char_epptr(&this->base);
14251 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
14252 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
14253 }else {
14254 this->strmode &= ~STRSTATE_Frozen;
14255 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
14256 basic_streambuf_char_pptr(&this->base), this->endsave);
14260 /* ?str@strstreambuf@std@@QAEPADXZ */
14261 /* ?str@strstreambuf@std@@QEAAPEADXZ */
14262 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
14263 char* __thiscall strstreambuf_str(strstreambuf *this)
14265 TRACE("(%p)\n", this);
14267 strstreambuf_freeze(this, TRUE);
14268 return basic_streambuf_char_gptr(&this->base);
14271 /* ?pcount@strstreambuf@std@@QBEHXZ */
14272 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
14273 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
14274 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
14276 char *ppos = basic_streambuf_char_pptr(&this->base);
14278 TRACE("(%p)\n", this);
14280 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
14283 /* ?overflow@strstreambuf@std@@MAEHH@Z */
14284 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
14285 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
14286 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
14288 MSVCP_size_t old_size, size;
14289 char *ptr, *buf;
14291 TRACE("(%p %d)\n", this, c);
14293 if(c == EOF)
14294 return !EOF;
14296 if(this->strmode & STRSTATE_Frozen)
14297 return EOF;
14299 ptr = basic_streambuf_char_pptr(&this->base);
14300 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
14301 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
14303 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
14304 return EOF;
14306 ptr = basic_streambuf_char_eback(&this->base);
14307 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
14309 size = old_size + old_size/2;
14310 if(size < this->minsize)
14311 size = this->minsize;
14313 if(this->palloc)
14314 buf = this->palloc(size);
14315 else
14316 buf = MSVCRT_operator_new(size);
14317 if(!buf)
14318 return EOF;
14320 memcpy(buf, ptr, old_size);
14321 if(this->strmode & STRSTATE_Allocated) {
14322 if(this->pfree)
14323 this->pfree(ptr);
14324 else
14325 MSVCRT_operator_delete(ptr);
14328 this->strmode |= STRSTATE_Allocated;
14329 if(!old_size) {
14330 this->seekhigh = buf;
14331 basic_streambuf_char_setp(&this->base, buf, buf+size);
14332 basic_streambuf_char_setg(&this->base, buf, buf, buf);
14333 }else {
14334 this->seekhigh = this->seekhigh-ptr+buf;
14335 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
14336 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
14337 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
14338 basic_streambuf_char_pptr(&this->base));
14341 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
14344 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
14345 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
14346 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
14347 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
14349 char *ptr = basic_streambuf_char_gptr(&this->base);
14351 TRACE("(%p %d)\n", this, c);
14353 if(ptr<=basic_streambuf_char_eback(&this->base)
14354 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
14355 return EOF;
14357 basic_streambuf_char_gbump(&this->base, -1);
14358 if(c == EOF)
14359 return !EOF;
14360 if(this->strmode & STRSTATE_Constant)
14361 return (unsigned char)c;
14363 return (unsigned char)(ptr[0] = c);
14366 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
14367 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
14368 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
14369 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
14370 #if STREAMOFF_BITS == 64
14371 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
14372 #else
14373 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
14374 #endif
14375 fpos_mbstatet* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_mbstatet *ret, streamoff off, int way, int mode)
14377 char *eback = basic_streambuf_char_eback(&this->base);
14378 char *pptr = basic_streambuf_char_pptr(&this->base);
14379 char *gptr = basic_streambuf_char_gptr(&this->base);
14381 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
14383 ret->off = 0;
14384 memset(&ret->state, 0, sizeof(ret->state));
14386 if(pptr > this->seekhigh)
14387 this->seekhigh = pptr;
14389 if((mode & OPENMODE_in) && gptr) {
14390 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
14391 off += gptr-eback;
14392 else if(way == SEEKDIR_end)
14393 off += this->seekhigh-eback;
14394 else if(way != SEEKDIR_beg)
14395 off = -1;
14397 if(off<0 || off>this->seekhigh-eback) {
14398 off = -1;
14399 }else {
14400 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
14401 if((mode & OPENMODE_out) && pptr) {
14402 basic_streambuf_char_setp_next(&this->base, eback,
14403 gptr, basic_streambuf_char_epptr(&this->base));
14406 }else if((mode & OPENMODE_out) && pptr) {
14407 if(way == SEEKDIR_cur)
14408 off += pptr-eback;
14409 else if(way == SEEKDIR_end)
14410 off += this->seekhigh-eback;
14411 else if(way != SEEKDIR_beg)
14412 off = -1;
14414 if(off<0 || off>this->seekhigh-eback)
14415 off = -1;
14416 else
14417 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
14418 }else {
14419 off = -1;
14422 ret->pos = off;
14423 return ret;
14426 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
14427 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
14428 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
14429 fpos_mbstatet* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
14431 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
14433 if(pos.off==-1 && pos.pos==0 && MBSTATET_TO_INT(&pos.state)==0) {
14434 *ret = pos;
14435 return ret;
14438 return strstreambuf_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
14441 /* ?underflow@strstreambuf@std@@MAEHXZ */
14442 /* ?underflow@strstreambuf@std@@MEAAHXZ */
14443 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
14444 int __thiscall strstreambuf_underflow(strstreambuf *this)
14446 char *gptr = basic_streambuf_char_gptr(&this->base);
14447 char *pptr;
14449 TRACE("(%p)\n", this);
14451 if(!gptr)
14452 return EOF;
14454 if(gptr < basic_streambuf_char_egptr(&this->base))
14455 return (unsigned char)(*gptr);
14457 pptr = basic_streambuf_char_gptr(&this->base);
14458 if(pptr > this->seekhigh)
14459 this->seekhigh = pptr;
14461 if(this->seekhigh <= gptr)
14462 return EOF;
14464 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
14465 gptr, this->seekhigh);
14466 return (unsigned char)(*gptr);
14469 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
14471 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
14474 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
14476 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
14479 /* ??0ostrstream@std@@QAE@PADHH@Z */
14480 #if STREAMSIZE_BITS == 64
14481 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
14482 #else
14483 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
14484 #endif
14485 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
14487 basic_ios_char *basic_ios;
14489 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
14491 if(virt_init) {
14492 this->base.vbtable = ostrstream_vbtable;
14493 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
14494 INIT_BASIC_IOS_VTORDISP(basic_ios);
14495 basic_ios_char_ctor(basic_ios);
14496 }else {
14497 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
14500 strstreambuf_ctor_get_put(&this->buf, buf, size,
14501 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
14502 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, FALSE);
14503 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
14504 return this;
14507 /* ??1ostrstream@std@@UAE@XZ */
14508 /* ??1ostrstream@std@@UEAA@XZ */
14509 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
14510 void __thiscall ostrstream_dtor(basic_ios_char *base)
14512 ostrstream *this = ostrstream_from_basic_ios(base);
14514 TRACE("(%p)\n", this);
14516 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
14517 strstreambuf_dtor(&this->buf);
14520 static void ostrstream_vbase_dtor(ostrstream *this)
14522 basic_ios_char *base = ostrstream_to_basic_ios(this);
14524 TRACE("(%p)\n", this);
14526 ostrstream_dtor(base);
14527 basic_ios_char_dtor(base);
14530 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
14531 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
14533 ostrstream *this = ostrstream_from_basic_ios(base);
14535 TRACE("(%p %x)\n", this, flags);
14537 if(flags & 2) {
14538 /* we have an array, with the number of elements stored before the first object */
14539 INT_PTR i, *ptr = (INT_PTR *)this-1;
14541 for(i=*ptr-1; i>=0; i--)
14542 ostrstream_vbase_dtor(this+i);
14543 MSVCRT_operator_delete(ptr);
14544 } else {
14545 ostrstream_vbase_dtor(this);
14546 if(flags & 1)
14547 MSVCRT_operator_delete(this);
14550 return this;
14553 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
14555 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
14558 /* ??1istrstream@std@@UAE@XZ */
14559 /* ??1istrstream@std@@UEAA@XZ */
14560 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
14561 void __thiscall istrstream_dtor(basic_ios_char *base)
14563 istrstream *this = istrstream_from_basic_ios(base);
14565 TRACE("(%p)\n", this);
14567 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
14568 strstreambuf_dtor(&this->buf);
14571 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
14573 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
14576 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
14578 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
14581 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@M@0@@Z */
14582 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@M@0@@Z */
14583 basic_ostream_char* __cdecl basic_ostream_char_print_complex_float(basic_ostream_char *ostr, const complex_float *val)
14585 struct {
14586 basic_ostringstream_char obj;
14587 basic_ios_char vbase;
14588 } oss;
14589 ios_base *ostringstream_ios_base, *ostream_ios_base;
14590 locale loc;
14591 basic_string_char str;
14592 basic_ostringstream_char_ctor(&oss.obj);
14593 ostringstream_ios_base = &oss.vbase.base;
14594 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14595 TRACE("(%p %p)\n", ostr, val);
14597 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14598 locale_dtor(&loc);
14599 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14600 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14602 basic_ostream_char_print_ch(&oss.obj.base, '(');
14603 basic_ostream_char_print_float(&oss.obj.base, val->real);
14604 basic_ostream_char_print_ch(&oss.obj.base, ',');
14605 basic_ostream_char_print_float(&oss.obj.base, val->imag);
14606 basic_ostream_char_print_ch(&oss.obj.base, ')');
14608 basic_ostringstream_char_str_get(&oss.obj, &str);
14609 basic_ostringstream_char_dtor(&oss.vbase);
14610 basic_ostream_char_print_bstr(ostr, &str);
14611 MSVCP_basic_string_char_dtor(&str);
14612 return ostr;
14615 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@N@0@@Z */
14616 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@N@0@@Z */
14617 basic_ostream_char* __cdecl basic_ostream_char_print_complex_double(basic_ostream_char *ostr, const complex_double *val)
14619 struct {
14620 basic_ostringstream_char obj;
14621 basic_ios_char vbase;
14622 } oss;
14623 ios_base *ostringstream_ios_base, *ostream_ios_base;
14624 locale loc;
14625 basic_string_char str;
14626 basic_ostringstream_char_ctor(&oss.obj);
14627 ostringstream_ios_base = &oss.vbase.base;
14628 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14629 TRACE("(%p %p)\n", ostr, val);
14631 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14632 locale_dtor(&loc);
14633 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14634 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14636 basic_ostream_char_print_ch(&oss.obj.base, '(');
14637 basic_ostream_char_print_double(&oss.obj.base, val->real);
14638 basic_ostream_char_print_ch(&oss.obj.base, ',');
14639 basic_ostream_char_print_double(&oss.obj.base, val->imag);
14640 basic_ostream_char_print_ch(&oss.obj.base, ')');
14642 basic_ostringstream_char_str_get(&oss.obj, &str);
14643 basic_ostringstream_char_dtor(&oss.vbase);
14644 basic_ostream_char_print_bstr(ostr, &str);
14645 MSVCP_basic_string_char_dtor(&str);
14646 return ostr;
14649 /* ??$?6odu?$char_traits@d@std@@@std@@yaaav?$basic_ostream@du?$char_traits@d@std@@@0@aav10@abv?$complex@o@0@@Z */
14650 /* ??$?6ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@O@0@@Z */
14651 basic_ostream_char* __cdecl basic_ostream_char_print_complex_ldouble(basic_ostream_char *ostr, const complex_double *val)
14653 struct {
14654 basic_ostringstream_char obj;
14655 basic_ios_char vbase;
14656 } oss;
14657 ios_base *ostringstream_ios_base, *ostream_ios_base;
14658 locale loc;
14659 basic_string_char str;
14660 basic_ostringstream_char_ctor(&oss.obj);
14661 ostringstream_ios_base = &oss.vbase.base;
14662 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14663 TRACE("(%p %p)\n", ostr, val);
14665 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14666 locale_dtor(&loc);
14667 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14668 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14670 basic_ostream_char_print_ch(&oss.obj.base, '(');
14671 basic_ostream_char_print_ldouble(&oss.obj.base, val->real);
14672 basic_ostream_char_print_ch(&oss.obj.base, ',');
14673 basic_ostream_char_print_ldouble(&oss.obj.base, val->imag);
14674 basic_ostream_char_print_ch(&oss.obj.base, ')');
14676 basic_ostringstream_char_str_get(&oss.obj, &str);
14677 basic_ostringstream_char_dtor(&oss.vbase);
14678 basic_ostream_char_print_bstr(ostr, &str);
14679 MSVCP_basic_string_char_dtor(&str);
14680 return ostr;
14683 /* ?_File_size@sys@tr2@std@@YA_KPBD@Z */
14684 /* ?_File_size@sys@tr2@std@@YA_KPEBD@Z */
14685 ULONGLONG __cdecl tr2_sys__File_size(char const* path)
14687 WIN32_FILE_ATTRIBUTE_DATA fad;
14689 TRACE("(%s)\n", debugstr_a(path));
14690 if(!GetFileAttributesExA(path, GetFileExInfoStandard, &fad))
14691 return 0;
14693 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
14696 /* ?_Equivalent@sys@tr2@std@@YAHPBD0@Z */
14697 /* ?_Equivalent@sys@tr2@std@@YAHPEBD0@Z */
14698 int __cdecl tr2_sys__Equivalent(char const* path1, char const* path2)
14700 HANDLE h1, h2;
14701 int ret;
14702 BY_HANDLE_FILE_INFORMATION info1, info2;
14703 TRACE("(%s %s)\n", debugstr_a(path1), debugstr_a(path2));
14705 h1 = CreateFileA(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14706 NULL, OPEN_EXISTING, 0, 0);
14707 h2 = CreateFileA(path2, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14708 NULL, OPEN_EXISTING, 0, 0);
14709 if(h1 == INVALID_HANDLE_VALUE) {
14710 if(h2 == INVALID_HANDLE_VALUE) {
14711 return -1;
14712 }else {
14713 CloseHandle(h2);
14714 return 0;
14716 }else if(h2 == INVALID_HANDLE_VALUE) {
14717 CloseHandle(h1);
14718 return 0;
14721 ret = GetFileInformationByHandle(h1, &info1) && GetFileInformationByHandle(h2, &info2);
14722 CloseHandle(h1);
14723 CloseHandle(h2);
14724 if(!ret)
14725 return -1;
14726 return (info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber
14727 && info1.nFileIndexHigh == info2.nFileIndexHigh
14728 && info1.nFileIndexLow == info2.nFileIndexLow
14732 /* ?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z */
14733 /* ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z */
14734 char* __cdecl tr2_sys__Current_get(char *current_path)
14736 TRACE("(%s)\n", debugstr_a(current_path));
14738 if(!GetCurrentDirectoryA(MAX_PATH, current_path))
14739 return NULL;
14740 return current_path;
14743 /* ?_Current_set@sys@tr2@std@@YA_NPBD@Z */
14744 /* ?_Current_set@sys@tr2@std@@YA_NPEBD@Z */
14745 MSVCP_bool __cdecl tr2_sys__Current_set(char const* path)
14747 TRACE("(%s)\n", debugstr_a(path));
14748 return SetCurrentDirectoryA(path) != 0;
14751 /* ?_Make_dir@sys@tr2@std@@YAHPBD@Z */
14752 /* ?_Make_dir@sys@tr2@std@@YAHPEBD@Z */
14753 int __cdecl tr2_sys__Make_dir(char const* path)
14755 TRACE("(%s)\n", debugstr_a(path));
14757 if(!CreateDirectoryA(path, NULL)) {
14758 if(GetLastError() == ERROR_ALREADY_EXISTS)
14759 return 0;
14760 else
14761 return -1;
14764 return 1;
14767 /* ?_Remove_dir@sys@tr2@std@@YA_NPBD@Z */
14768 /* ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z */
14769 MSVCP_bool __cdecl tr2_sys__Remove_dir(char const* path)
14771 TRACE("(%s)\n", debugstr_a(path));
14772 return RemoveDirectoryA(path) != 0;
14775 /* ?_Copy_file@sys@tr2@std@@YAHPBD0_N@Z */
14776 /* ?_Copy_file@sys@tr2@std@@YAHPEBD0_N@Z */
14777 int __cdecl tr2_sys__Copy_file(char const* source, char const* dest, MSVCP_bool fail_if_exists)
14779 TRACE("(%s %s %x)\n", debugstr_a(source), debugstr_a(dest), fail_if_exists);
14781 if(CopyFileA(source, dest, fail_if_exists))
14782 return ERROR_SUCCESS;
14783 return GetLastError();
14786 /* ?_Rename@sys@tr2@std@@YAHPBD0@Z */
14787 /* ?_Rename@sys@tr2@std@@YAHPEBD0@Z */
14788 int __cdecl tr2_sys__Rename(char const* old_path, char const* new_path)
14790 TRACE("(%s %s)\n", debugstr_a(old_path), debugstr_a(new_path));
14792 if(!old_path || !new_path)
14793 return ERROR_INVALID_PARAMETER;
14795 if(MoveFileExA(old_path, new_path, MOVEFILE_COPY_ALLOWED))
14796 return ERROR_SUCCESS;
14797 return GetLastError();
14800 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z */
14801 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z */
14802 struct space_info* __cdecl tr2_sys__Statvfs(struct space_info *ret, const char* path)
14804 ULARGE_INTEGER available, total, free;
14806 TRACE("(%s)\n", debugstr_a(path));
14808 if(!path || !GetDiskFreeSpaceExA(path, &available, &total, &free)) {
14809 ret->capacity = ret->free = ret->available = 0;
14810 }else {
14811 ret->capacity = total.QuadPart;
14812 ret->free = free.QuadPart;
14813 ret->available = available.QuadPart;
14815 return ret;
14818 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */
14819 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z */
14820 enum file_type __cdecl tr2_sys__Stat(char const* path, int* err_code)
14822 DWORD attr;
14823 TRACE("(%s %p)\n", debugstr_a(path), err_code);
14824 if(!path) {
14825 *err_code = ERROR_INVALID_PARAMETER;
14826 return status_unknown;
14829 attr=GetFileAttributesA(path);
14830 if(attr == INVALID_FILE_ATTRIBUTES) {
14831 enum file_type ret;
14832 switch(GetLastError()) {
14833 case ERROR_FILE_NOT_FOUND:
14834 case ERROR_BAD_NETPATH:
14835 case ERROR_INVALID_NAME:
14836 case ERROR_BAD_PATHNAME:
14837 case ERROR_PATH_NOT_FOUND:
14838 ret = file_not_found;
14839 *err_code = ERROR_SUCCESS;
14840 break;
14841 default:
14842 ret = status_unknown;
14843 *err_code = GetLastError();
14845 return ret;
14848 *err_code = ERROR_SUCCESS;
14849 return (attr & FILE_ATTRIBUTE_DIRECTORY)?directory_file:regular_file;
14852 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */
14853 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z */
14854 enum file_type __cdecl tr2_sys__Lstat(char const* path, int* err_code)
14856 return tr2_sys__Stat(path, err_code);
14859 /* ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z */
14860 /* ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z */
14861 __int64 __cdecl tr2_sys__Last_write_time(char const* path)
14863 HANDLE handle;
14864 FILETIME lwt;
14865 int ret;
14866 __int64 last_write_time;
14867 TRACE("(%s)\n", debugstr_a(path));
14869 handle = CreateFileA(path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14870 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14871 if(handle == INVALID_HANDLE_VALUE)
14872 return 0;
14874 ret = GetFileTime(handle, 0, 0, &lwt);
14875 CloseHandle(handle);
14876 if(!ret)
14877 return 0;
14879 last_write_time = (((__int64)lwt.dwHighDateTime)<< 32) + lwt.dwLowDateTime;
14880 last_write_time -= TICKS_1601_TO_1970;
14881 last_write_time /= TICKSPERSEC;
14882 return last_write_time;
14885 /* ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z */
14886 /* ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z */
14887 void __cdecl tr2_sys__Last_write_time_set(char const* path, __int64 newtime)
14889 HANDLE handle;
14890 FILETIME lwt;
14891 TRACE("(%s)\n", debugstr_a(path));
14893 handle = CreateFileA(path, FILE_WRITE_ATTRIBUTES,
14894 FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14895 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14896 if(handle == INVALID_HANDLE_VALUE)
14897 return;
14899 /* This is the implementation based on the test of msvcp110.
14900 * According to the test of msvcp120,
14901 * msvcp120's implementation does nothing. Obviously, this is a bug of windows.
14904 newtime *= TICKSPERSEC;
14905 newtime += TICKS_1601_TO_1970;
14906 lwt.dwLowDateTime = (DWORD)(newtime);
14907 lwt.dwHighDateTime = (DWORD)(newtime >> 32);
14908 SetFileTime(handle, 0, 0, &lwt);
14909 CloseHandle(handle);
14912 /* ??_Open_dir@sys@tr2@std@@YAPAXPA_WPB_WAAHAAW4file_type@123@@Z */
14913 /* ??_Open_dir@sys@tr2@std@@YAPEAXPEA_WPEB_WAEAHAEAW4file_type@123@@Z */
14914 void* __cdecl tr2_sys__Open_dir_wchar(wchar_t* target, wchar_t const* dest, int* err_code, enum file_type* type)
14916 HANDLE handle;
14917 WIN32_FIND_DATAW data;
14918 wchar_t temppath[MAX_PATH];
14919 static const wchar_t dot[] = {'.', 0};
14920 static const wchar_t dotdot[] = {'.', '.', 0};
14921 static const wchar_t asterisk[] = {'\\', '*', 0};
14923 TRACE("(%p %s %p %p)\n", target, debugstr_w(dest), err_code, type);
14924 if(wcslen(dest) > MAX_PATH - 3) {
14925 *err_code = ERROR_BAD_PATHNAME;
14926 return NULL;
14928 wcscpy(temppath, dest);
14929 wcscat(temppath, asterisk);
14931 handle = FindFirstFileW(temppath, &data);
14932 if(handle == INVALID_HANDLE_VALUE) {
14933 *err_code = GetLastError();
14934 return NULL;
14936 while(!wcscmp(data.cFileName, dot) || !wcscmp(data.cFileName, dotdot)) {
14937 if(!FindNextFileW(handle, &data)) {
14938 *err_code = ERROR_SUCCESS;
14939 *type = status_unknown;
14940 FindClose(handle);
14941 return NULL;
14945 wcscpy(target, data.cFileName);
14946 *err_code = ERROR_SUCCESS;
14947 if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
14948 *type = directory_file;
14949 else
14950 *type = regular_file;
14951 return handle;
14954 /* ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z */
14955 /* ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z */
14956 void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, enum file_type* type)
14958 void *handle;
14959 wchar_t target_w[MAX_PATH];
14960 wchar_t dest_w[MAX_PATH];
14962 TRACE("(%p %s %p %p)\n", target, debugstr_a(dest), err_code, type);
14964 if (dest && !MultiByteToWideChar(CP_ACP, 0, dest, -1, dest_w, MAX_PATH))
14966 WARN("Failed to convert input string.\n");
14967 *err_code = ERROR_BAD_PATHNAME;
14968 return NULL;
14971 handle = tr2_sys__Open_dir_wchar(target_w, dest ? dest_w : NULL, err_code, type);
14973 if (handle)
14974 WideCharToMultiByte(CP_ACP, 0, target_w, -1, target, MAX_PATH, NULL, NULL);
14976 return handle;
14979 /* ??_Read_dir@sys@tr2@std@@YAPA_WPA_WPAXAAW4file_type@123@@Z */
14980 /* ??_Read_dir@sys@tr2@std@@YAPEA_WPEA_WPEAXAEAW4file_type@123@@Z */
14981 wchar_t* __cdecl tr2_sys__Read_dir_wchar(wchar_t* target, void* handle, enum file_type* type)
14983 WIN32_FIND_DATAW data;
14984 static const wchar_t dot[] = {'.', 0};
14985 static const wchar_t dotdot[] = {'.', '.', 0};
14987 TRACE("(%p %p %p)\n", target, handle, type);
14989 do {
14990 if(!FindNextFileW(handle, &data)) {
14991 *type = status_unknown;
14992 *target = '\0';
14993 return target;
14995 } while(!wcscmp(data.cFileName, dot) || !wcscmp(data.cFileName, dotdot));
14997 wcscpy(target, data.cFileName);
14998 if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
14999 *type = directory_file;
15000 else
15001 *type = regular_file;
15002 return target;
15005 /* ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z */
15006 /* ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z */
15007 char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type)
15009 wchar_t target_w[MAX_PATH];
15011 tr2_sys__Read_dir_wchar(target_w, handle, type);
15012 WideCharToMultiByte(CP_ACP, 0, target_w, -1, target, MAX_PATH, NULL, NULL);
15014 return target;
15017 /* ?_Close_dir@sys@tr2@std@@YAXPAX@Z */
15018 /* ?_Close_dir@sys@tr2@std@@YAXPEAX@Z */
15019 void __cdecl tr2_sys__Close_dir(void* handle)
15021 TRACE("(%p)\n", handle);
15023 FindClose(handle);
15026 /* ?_Link@sys@tr2@std@@YAHPBD0@Z */
15027 /* ?_Link@sys@tr2@std@@YAHPEBD0@Z */
15028 int __cdecl tr2_sys__Link(char const* existing_path, char const* new_path)
15030 TRACE("(%s %s)\n", debugstr_a(existing_path), debugstr_a(new_path));
15031 if(!existing_path || !new_path)
15032 return ERROR_INVALID_PARAMETER;
15034 if(CreateHardLinkA(new_path, existing_path, NULL))
15035 return ERROR_SUCCESS;
15036 return GetLastError();
15039 /* ?_Link@sys@tr2@std@@YAHPB_W0@Z */
15040 /* ?_Link@sys@tr2@std@@YAHPEB_W0@Z */
15041 /* _Link */
15042 int __cdecl tr2_sys__Link_wchar(WCHAR const* existing_path, WCHAR const* new_path)
15044 TRACE("(%s %s)\n", debugstr_w(existing_path), debugstr_w(new_path));
15045 if(!existing_path || !new_path)
15046 return ERROR_INVALID_PARAMETER;
15048 if(CreateHardLinkW(new_path, existing_path, NULL))
15049 return ERROR_SUCCESS;
15050 return GetLastError();
15053 /* ?_Symlink@sys@tr2@std@@YAHPBD0@Z */
15054 /* ?_Symlink@sys@tr2@std@@YAHPEBD0@Z */
15055 int __cdecl tr2_sys__Symlink(char const* existing_file_name, char const* file_name)
15057 TRACE("(%s %s)\n", debugstr_a(existing_file_name), debugstr_a(file_name));
15058 if(!existing_file_name || !file_name)
15059 return ERROR_INVALID_PARAMETER;
15061 if(CreateSymbolicLinkA(file_name, existing_file_name, 0))
15062 return ERROR_SUCCESS;
15063 return GetLastError();
15066 /* ?_Symlink@sys@tr2@std@@YAHPB_W0@Z */
15067 /* ?_Symlink@sys@tr2@std@@YAHPEB_W0@Z */
15068 /* _Symlink */
15069 int __cdecl tr2_sys__Symlink_wchar(WCHAR const* existing_file_name, WCHAR const* file_name)
15071 TRACE("(%s %s)\n", debugstr_w(existing_file_name), debugstr_w(file_name));
15072 if(!existing_file_name || !file_name)
15073 return ERROR_INVALID_PARAMETER;
15075 if(CreateSymbolicLinkW(file_name, existing_file_name, 0))
15076 return ERROR_SUCCESS;
15077 return GetLastError();
15080 /* ?_Unlink@sys@tr2@std@@YAHPBD@Z */
15081 /* ?_Unlink@sys@tr2@std@@YAHPEBD@Z */
15082 int __cdecl tr2_sys__Unlink(char const* path)
15084 TRACE("(%s)\n", debugstr_a(path));
15086 if(DeleteFileA(path))
15087 return ERROR_SUCCESS;
15088 return GetLastError();
15091 /* ?_Unlink@sys@tr2@std@@YAHPB_W@Z */
15092 /* ?_Unlink@sys@tr2@std@@YAHPEB_W@Z */
15093 /* _Unlink */
15094 int __cdecl tr2_sys__Unlink_wchar(WCHAR const* path)
15096 TRACE("(%s)\n", debugstr_w(path));
15098 if(DeleteFileW(path))
15099 return ERROR_SUCCESS;
15100 return GetLastError();
15103 /* ??0strstream@std@@QAE@PADHH@Z */
15104 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
15105 #if STREAMSIZE_BITS == 64
15106 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
15107 #else
15108 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
15109 #endif
15110 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
15112 basic_ios_char *basic_ios;
15114 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
15116 if(virt_init) {
15117 this->base.base1.vbtable = strstream_vbtable1;
15118 this->base.base2.vbtable = strstream_vbtable2;
15119 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
15120 INIT_BASIC_IOS_VTORDISP(basic_ios);
15121 basic_ios_char_ctor(basic_ios);
15122 }else {
15123 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
15126 strstreambuf_ctor_get_put(&this->buf, buf, size,
15127 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
15128 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
15129 basic_ios->base.vtable = &MSVCP_strstream_vtable;
15130 return this;
15133 /* ??1strstream@std@@UAE@XZ */
15134 /* ??1strstream@std@@UEAA@XZ */
15135 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
15136 void __thiscall strstream_dtor(basic_ios_char *base)
15138 strstream *this = strstream_from_basic_ios(base);
15140 TRACE("(%p)\n", this);
15142 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
15143 strstreambuf_dtor(&this->buf);
15146 static void strstream_vbase_dtor(strstream *this)
15148 basic_ios_char *base = strstream_to_basic_ios(this);
15150 TRACE("(%p)\n", this);
15152 strstream_dtor(base);
15153 basic_ios_char_dtor(base);
15156 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
15157 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
15159 strstream *this = strstream_from_basic_ios(base);
15161 TRACE("(%p %x)\n", this, flags);
15163 if(flags & 2) {
15164 /* we have an array, with the number of elements stored before the first object */
15165 INT_PTR i, *ptr = (INT_PTR *)this-1;
15167 for(i=*ptr-1; i>=0; i--)
15168 strstream_vbase_dtor(this+i);
15169 MSVCRT_operator_delete(ptr);
15170 } else {
15171 strstream_vbase_dtor(this);
15172 if(flags & 1)
15173 MSVCRT_operator_delete(this);
15176 return this;
15179 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
15181 ios_base_precision_set(base, prec);
15184 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
15185 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
15186 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
15188 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
15190 ret->pfunc = setprecision_func;
15191 ret->arg = prec;
15192 return ret;
15195 static void __cdecl setw_func(ios_base *base, streamsize width)
15197 ios_base_width_set(base, width);
15200 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
15201 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
15202 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
15204 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
15206 ret->pfunc = setw_func;
15207 ret->arg = width;
15208 return ret;
15211 static void __cdecl resetioflags_func(ios_base *base, int mask)
15213 ios_base_setf_mask(base, 0, mask);
15216 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
15217 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
15219 TRACE("(%p %d)\n", ret, mask);
15221 ret->pfunc = resetioflags_func;
15222 ret->arg = mask;
15223 return ret;
15226 static void __cdecl setiosflags_func(ios_base *base, int mask)
15228 ios_base_setf_mask(base, FMTFLAG_mask, mask);
15231 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
15232 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
15234 TRACE("(%p %d)\n", ret, mask);
15236 ret->pfunc = setiosflags_func;
15237 ret->arg = mask;
15238 return ret;
15241 static void __cdecl setbase_func(ios_base *base, int set_base)
15243 if(set_base == 10)
15244 set_base = FMTFLAG_dec;
15245 else if(set_base == 8)
15246 set_base = FMTFLAG_oct;
15247 else if(set_base == 16)
15248 set_base = FMTFLAG_hex;
15249 else
15250 set_base = 0;
15252 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
15255 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
15256 manip_int* __cdecl setbase(manip_int *ret, int base)
15258 TRACE("(%p %d)\n", ret, base);
15260 ret->pfunc = setbase_func;
15261 ret->arg = base;
15262 return ret;
15265 static basic_filebuf_char filebuf_char_stdin;
15266 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
15267 struct {
15268 basic_istream_char obj;
15269 #if _MSVCP_VER >= 110
15270 int vtordisp;
15271 #endif
15272 basic_ios_char vbase;
15273 } cin = { { 0 } };
15274 C_ASSERT(sizeof(cin) == VBTABLE_BASIC_IOS_ENTRY(basic_istream_char, 0)+sizeof(basic_ios_char));
15275 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
15276 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
15277 basic_istream_char *_Ptr_cin = &cin.obj;
15279 static basic_filebuf_wchar filebuf_short_stdin;
15280 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
15281 struct {
15282 basic_istream_wchar obj;
15283 #if _MSVCP_VER >= 110
15284 int vtordisp;
15285 #endif
15286 basic_ios_wchar vbase;
15287 } ucin = { { 0 } };
15288 C_ASSERT(sizeof(ucin) == VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)+sizeof(basic_ios_wchar));
15289 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
15290 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
15291 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
15293 static basic_filebuf_wchar filebuf_wchar_stdin;
15294 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
15295 struct {
15296 basic_istream_wchar obj;
15297 #if _MSVCP_VER >= 110
15298 int vtordisp;
15299 #endif
15300 basic_ios_wchar vbase;
15301 } wcin = { { 0 } };
15302 C_ASSERT(sizeof(wcin) == VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)+sizeof(basic_ios_wchar));
15303 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
15304 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
15305 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
15307 static basic_filebuf_char filebuf_char_stdout;
15308 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15309 struct {
15310 basic_ostream_char obj;
15311 #if _MSVCP_VER >= 110
15312 int vtordisp;
15313 #endif
15314 basic_ios_char vbase;
15315 } cout = { { 0 } };
15316 C_ASSERT(sizeof(cout) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)+sizeof(basic_ios_char));
15317 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15318 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15319 basic_ostream_char *_Ptr_cout = &cout.obj;
15321 static basic_filebuf_wchar filebuf_short_stdout;
15322 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15323 struct {
15324 basic_ostream_wchar obj;
15325 #if _MSVCP_VER >= 110
15326 int vtordisp;
15327 #endif
15328 basic_ios_wchar vbase;
15329 } ucout = { { 0 } };
15330 C_ASSERT(sizeof(ucout) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15331 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15332 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15333 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
15335 static basic_filebuf_wchar filebuf_wchar_stdout;
15336 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15337 struct {
15338 basic_ostream_wchar obj;
15339 #if _MSVCP_VER >= 110
15340 int vtordisp;
15341 #endif
15342 basic_ios_wchar vbase;
15343 } wcout = { { 0 } };
15344 C_ASSERT(sizeof(wcout) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15345 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15346 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15347 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
15349 static basic_filebuf_char filebuf_char_stderr;
15350 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15351 struct {
15352 basic_ostream_char obj;
15353 #if _MSVCP_VER >= 110
15354 int vtordisp;
15355 #endif
15356 basic_ios_char vbase;
15357 } cerr = { { 0 } };
15358 C_ASSERT(sizeof(cerr) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)+sizeof(basic_ios_char));
15359 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15360 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15361 basic_ostream_char *_Ptr_cerr = &cerr.obj;
15363 static basic_filebuf_wchar filebuf_short_stderr;
15364 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15365 struct {
15366 basic_ostream_wchar obj;
15367 #if _MSVCP_VER >= 110
15368 int vtordisp;
15369 #endif
15370 basic_ios_wchar vbase;
15371 } ucerr = { { 0 } };
15372 C_ASSERT(sizeof(ucerr) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15373 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15374 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15375 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
15377 static basic_filebuf_wchar filebuf_wchar_stderr;
15378 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15379 struct {
15380 basic_ostream_wchar obj;
15381 #if _MSVCP_VER >= 110
15382 int vtordisp;
15383 #endif
15384 basic_ios_wchar vbase;
15385 } wcerr = { { 0 } };
15386 C_ASSERT(sizeof(wcerr) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15387 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15388 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15389 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
15391 static basic_filebuf_char filebuf_char_log;
15392 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15393 struct {
15394 basic_ostream_char obj;
15395 #if _MSVCP_VER >= 110
15396 int vtordisp;
15397 #endif
15398 basic_ios_char vbase;
15399 } clog = { { 0 } };
15400 C_ASSERT(sizeof(clog) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)+sizeof(basic_ios_char));
15401 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15402 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15403 basic_ostream_char *_Ptr_clog = &clog.obj;
15405 static basic_filebuf_wchar filebuf_short_log;
15406 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15407 struct {
15408 basic_ostream_wchar obj;
15409 #if _MSVCP_VER >= 110
15410 int vtordisp;
15411 #endif
15412 basic_ios_wchar vbase;
15413 } uclog = { { 0 } };
15414 C_ASSERT(sizeof(uclog) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15415 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15416 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15417 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
15419 static basic_filebuf_wchar filebuf_wchar_log;
15420 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15421 struct {
15422 basic_ostream_wchar obj;
15423 #if _MSVCP_VER >= 110
15424 int vtordisp;
15425 #endif
15426 basic_ios_wchar vbase;
15427 } wclog = { { 0 } };
15428 C_ASSERT(sizeof(wclog) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15429 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15430 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15431 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
15433 /* ?_Init_cnt@Init@ios_base@std@@0HA */
15434 int ios_base_Init__Init_cnt = -1;
15436 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
15437 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
15438 int* __cdecl ios_base_Init__Init_cnt_func(void)
15440 return &ios_base_Init__Init_cnt;
15443 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
15444 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
15445 void __cdecl ios_base_Init__Init_ctor(void *this)
15447 TRACE("(%p)\n", this);
15449 if(ios_base_Init__Init_cnt < 0)
15450 ios_base_Init__Init_cnt = 1;
15451 else
15452 ios_base_Init__Init_cnt++;
15455 /* ??0Init@ios_base@std@@QAE@XZ */
15456 /* ??0Init@ios_base@std@@QEAA@XZ */
15457 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
15458 void* __thiscall ios_base_Init_ctor(void *this)
15460 ios_base_Init__Init_ctor(this);
15461 return this;
15464 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
15465 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
15466 void __cdecl ios_base_Init__Init_dtor(void *this)
15468 TRACE("(%p)\n", this);
15470 ios_base_Init__Init_cnt--;
15471 if(!ios_base_Init__Init_cnt) {
15472 basic_ostream_char_flush(&cout.obj);
15473 basic_ostream_char_flush(&cerr.obj);
15474 basic_ostream_char_flush(&clog.obj);
15478 /* ??1Init@ios_base@std@@QAE@XZ */
15479 /* ??1Init@ios_base@std@@QEAA@XZ */
15480 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
15481 void __thiscall ios_base_Init_dtor(void *this)
15483 ios_base_Init__Init_dtor(this);
15486 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
15487 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
15488 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
15489 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
15491 TRACE("(%p %p)\n", this, rhs);
15492 return this;
15495 /* ?_Init_cnt@_Winit@std@@0HA */
15496 int _Winit__Init_cnt = -1;
15498 /* ??0_Winit@std@@QAE@XZ */
15499 /* ??0_Winit@std@@QEAA@XZ */
15500 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
15501 void* __thiscall _Winit_ctor(void *this)
15503 TRACE("(%p)\n", this);
15505 if(_Winit__Init_cnt < 0)
15506 _Winit__Init_cnt = 1;
15507 else
15508 _Winit__Init_cnt++;
15510 return this;
15513 /* ?_File_size@sys@tr2@std@@YA_KPB_W@Z */
15514 /* ?_File_size@sys@tr2@std@@YA_KPEB_W@Z */
15515 ULONGLONG __cdecl tr2_sys__File_size_wchar(WCHAR const* path)
15517 WIN32_FILE_ATTRIBUTE_DATA fad;
15519 TRACE("(%s)\n", debugstr_w(path));
15520 if(!GetFileAttributesExW(path, GetFileExInfoStandard, &fad))
15521 return 0;
15523 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
15526 /* _File_size, msvcp140 version. Different error handling. */
15527 ULONGLONG __cdecl _File_size(WCHAR const* path)
15529 WIN32_FILE_ATTRIBUTE_DATA fad;
15531 TRACE("(%s)\n", debugstr_w(path));
15532 if(!GetFileAttributesExW(path, GetFileExInfoStandard, &fad))
15533 return ~(ULONGLONG)0;
15535 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
15538 /* ?_Equivalent@sys@tr2@std@@YAHPB_W0@Z */
15539 /* ?_Equivalent@sys@tr2@std@@YAHPEB_W0@Z */
15540 int __cdecl tr2_sys__Equivalent_wchar(WCHAR const* path1, WCHAR const* path2)
15542 HANDLE h1, h2;
15543 int ret;
15544 BY_HANDLE_FILE_INFORMATION info1, info2;
15545 TRACE("(%s %s)\n", debugstr_w(path1), debugstr_w(path2));
15547 h1 = CreateFileW(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15548 NULL, OPEN_EXISTING, 0, 0);
15549 h2 = CreateFileW(path2, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15550 NULL, OPEN_EXISTING, 0, 0);
15551 if(h1 == INVALID_HANDLE_VALUE) {
15552 if(h2 == INVALID_HANDLE_VALUE) {
15553 return -1;
15554 }else {
15555 CloseHandle(h2);
15556 return 0;
15558 }else if(h2 == INVALID_HANDLE_VALUE) {
15559 CloseHandle(h1);
15560 return 0;
15563 ret = GetFileInformationByHandle(h1, &info1) && GetFileInformationByHandle(h2, &info2);
15564 CloseHandle(h1);
15565 CloseHandle(h2);
15566 if(!ret)
15567 return -1;
15568 return (info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber
15569 && info1.nFileIndexHigh == info2.nFileIndexHigh
15570 && info1.nFileIndexLow == info2.nFileIndexLow
15574 /* ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z */
15575 /* ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z */
15576 WCHAR* __cdecl tr2_sys__Current_get_wchar(WCHAR *current_path)
15578 TRACE("(%s)\n", debugstr_w(current_path));
15580 if(!GetCurrentDirectoryW(MAX_PATH, current_path))
15581 return NULL;
15582 return current_path;
15585 /* _Current_get, msvcp140 version */
15586 BOOL __cdecl _Current_get(WCHAR *current_path)
15588 TRACE("(%s)\n", debugstr_w(current_path));
15590 if(!GetCurrentDirectoryW(MAX_PATH, current_path))
15591 return FALSE;
15592 return TRUE;
15595 /* ?_Current_set@sys@tr2@std@@YA_NPB_W@Z */
15596 /* ?_Current_set@sys@tr2@std@@YA_NPEB_W@Z */
15597 MSVCP_bool __cdecl tr2_sys__Current_set_wchar(WCHAR const* path)
15599 TRACE("(%s)\n", debugstr_w(path));
15600 return SetCurrentDirectoryW(path) != 0;
15603 /* ?_Make_dir@sys@tr2@std@@YAHPB_W@Z */
15604 /* ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z */
15605 int __cdecl tr2_sys__Make_dir_wchar(WCHAR const* path)
15607 TRACE("(%s)\n", debugstr_w(path));
15609 if(!CreateDirectoryW(path, NULL)) {
15610 if(GetLastError() == ERROR_ALREADY_EXISTS)
15611 return 0;
15612 else
15613 return -1;
15616 return 1;
15619 /* ?_Remove_dir@sys@tr2@std@@YA_NPB_W@Z */
15620 /* ?_Remove_dir@sys@tr2@std@@YA_NPEB_W@Z */
15621 MSVCP_bool __cdecl tr2_sys__Remove_dir_wchar(WCHAR const* path)
15623 TRACE("(%s)\n", debugstr_w(path));
15624 return RemoveDirectoryW(path) != 0;
15627 /* ?_Copy_file@sys@tr2@std@@YAHPB_W0_N@Z */
15628 /* ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z */
15629 int __cdecl tr2_sys__Copy_file_wchar(WCHAR const* source, WCHAR const* dest, MSVCP_bool fail_if_exists)
15631 TRACE("(%s %s %x)\n", debugstr_w(source), debugstr_w(dest), fail_if_exists);
15633 if(CopyFileW(source, dest, fail_if_exists))
15634 return ERROR_SUCCESS;
15635 return GetLastError();
15638 /* ?_Rename@sys@tr2@std@@YAHPB_W0@Z */
15639 /* ?_Rename@sys@tr2@std@@YAHPEB_W0@Z */
15640 int __cdecl tr2_sys__Rename_wchar(WCHAR const* old_path, WCHAR const* new_path)
15642 TRACE("(%s %s)\n", debugstr_w(old_path), debugstr_w(new_path));
15644 if(!old_path || !new_path)
15645 return ERROR_INVALID_PARAMETER;
15647 if(MoveFileExW(old_path, new_path, MOVEFILE_COPY_ALLOWED))
15648 return ERROR_SUCCESS;
15649 return GetLastError();
15652 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z */
15653 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z */
15654 struct space_info* __cdecl tr2_sys__Statvfs_wchar(struct space_info *ret, const WCHAR* path)
15656 ULARGE_INTEGER available, total, free;
15658 TRACE("(%s)\n", debugstr_w(path));
15660 if(!path || !GetDiskFreeSpaceExW(path, &available, &total, &free)) {
15661 ret->capacity = ret->free = ret->available = 0;
15662 }else {
15663 ret->capacity = total.QuadPart;
15664 ret->free = free.QuadPart;
15665 ret->available = available.QuadPart;
15667 return ret;
15670 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z */
15671 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z */
15672 enum file_type __cdecl tr2_sys__Stat_wchar(WCHAR const* path, int* err_code)
15674 DWORD attr;
15675 TRACE("(%s %p)\n", debugstr_w(path), err_code);
15676 if(!path) {
15677 *err_code = ERROR_INVALID_PARAMETER;
15678 return status_unknown;
15681 attr=GetFileAttributesW(path);
15682 if(attr == INVALID_FILE_ATTRIBUTES) {
15683 enum file_type ret;
15684 switch(GetLastError()) {
15685 case ERROR_FILE_NOT_FOUND:
15686 case ERROR_BAD_NETPATH:
15687 case ERROR_INVALID_NAME:
15688 case ERROR_BAD_PATHNAME:
15689 case ERROR_PATH_NOT_FOUND:
15690 ret = file_not_found;
15691 *err_code = ERROR_SUCCESS;
15692 break;
15693 default:
15694 ret = status_unknown;
15695 *err_code = GetLastError();
15697 return ret;
15700 *err_code = ERROR_SUCCESS;
15701 return (attr & FILE_ATTRIBUTE_DIRECTORY)?directory_file:regular_file;
15704 /* _Stat, msvcp140 version */
15705 enum file_type __cdecl _Stat(WCHAR const* path, int* permissions)
15707 DWORD attr;
15708 TRACE("(%s %p)\n", debugstr_w(path), permissions);
15709 if(!path) {
15710 return file_not_found;
15713 attr=GetFileAttributesW(path);
15714 if(attr == INVALID_FILE_ATTRIBUTES) {
15715 enum file_type ret;
15716 switch(GetLastError()) {
15717 case ERROR_FILE_NOT_FOUND:
15718 case ERROR_BAD_NETPATH:
15719 case ERROR_INVALID_NAME:
15720 case ERROR_BAD_PATHNAME:
15721 case ERROR_PATH_NOT_FOUND:
15722 ret = file_not_found;
15723 break;
15724 default:
15725 ret = status_unknown;
15727 return ret;
15730 if (permissions)
15731 *permissions = (attr & FILE_ATTRIBUTE_READONLY) ? 0555 : 0777;
15732 return (attr & FILE_ATTRIBUTE_DIRECTORY) ? directory_file : regular_file;
15735 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z */
15736 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z */
15737 enum file_type __cdecl tr2_sys__Lstat_wchar(WCHAR const* path, int* err_code)
15739 return tr2_sys__Stat_wchar(path, err_code);
15742 /* _Lstat, msvcp140 version */
15743 enum file_type __cdecl _Lstat(WCHAR const* path, int* permissions)
15745 return _Stat(path, permissions);
15748 /* ??1_Winit@std@@QAE@XZ */
15749 /* ??1_Winit@std@@QAE@XZ */
15750 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
15751 void __thiscall _Winit_dtor(void *this)
15753 TRACE("(%p)\n", this);
15755 _Winit__Init_cnt--;
15756 if(!_Winit__Init_cnt) {
15757 basic_ostream_wchar_flush(&wcout.obj);
15758 basic_ostream_wchar_flush(&wcerr.obj);
15759 basic_ostream_wchar_flush(&wclog.obj);
15763 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
15764 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
15765 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
15766 void* __thiscall _Winit_op_assign(void *this, void *rhs)
15768 TRACE("(%p %p)\n", this, rhs);
15769 return this;
15772 void init_io(void *base)
15774 #ifdef __x86_64__
15775 init_iosb_rtti(base);
15776 init_ios_base_rtti(base);
15777 init_basic_ios_char_rtti(base);
15778 init_basic_ios_wchar_rtti(base);
15779 init_basic_ios_short_rtti(base);
15780 init_basic_streambuf_char_rtti(base);
15781 init_basic_streambuf_wchar_rtti(base);
15782 init_basic_streambuf_short_rtti(base);
15783 init_basic_filebuf_char_rtti(base);
15784 init_basic_filebuf_wchar_rtti(base);
15785 init_basic_filebuf_short_rtti(base);
15786 init_basic_stringbuf_char_rtti(base);
15787 init_basic_stringbuf_wchar_rtti(base);
15788 init_basic_stringbuf_short_rtti(base);
15789 init_basic_ostream_char_rtti(base);
15790 init_basic_ostream_wchar_rtti(base);
15791 init_basic_ostream_short_rtti(base);
15792 init_basic_istream_char_rtti(base);
15793 init_basic_istream_wchar_rtti(base);
15794 init_basic_istream_short_rtti(base);
15795 init_basic_iostream_char_rtti(base);
15796 init_basic_iostream_wchar_rtti(base);
15797 init_basic_iostream_short_rtti(base);
15798 init_basic_ofstream_char_rtti(base);
15799 init_basic_ofstream_wchar_rtti(base);
15800 init_basic_ofstream_short_rtti(base);
15801 init_basic_ifstream_char_rtti(base);
15802 init_basic_ifstream_wchar_rtti(base);
15803 init_basic_ifstream_short_rtti(base);
15804 init_basic_fstream_char_rtti(base);
15805 init_basic_fstream_wchar_rtti(base);
15806 init_basic_fstream_short_rtti(base);
15807 init_basic_ostringstream_char_rtti(base);
15808 init_basic_ostringstream_wchar_rtti(base);
15809 init_basic_ostringstream_short_rtti(base);
15810 init_basic_istringstream_char_rtti(base);
15811 init_basic_istringstream_wchar_rtti(base);
15812 init_basic_istringstream_short_rtti(base);
15813 init_basic_stringstream_char_rtti(base);
15814 init_basic_stringstream_wchar_rtti(base);
15815 init_basic_stringstream_short_rtti(base);
15816 init_strstreambuf_rtti(base);
15817 init_strstream_rtti(base);
15818 init_ostrstream_rtti(base);
15819 #endif
15821 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
15822 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
15824 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
15825 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
15827 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
15828 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
15830 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
15831 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE);
15833 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
15834 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE);
15836 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
15837 basic_ostream_wchar_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE);
15839 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
15840 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE);
15842 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
15843 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE);
15845 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
15846 basic_ostream_wchar_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE);
15848 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
15849 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE);
15851 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
15852 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE);
15854 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
15855 basic_ostream_wchar_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE);
15858 void free_io(void)
15860 basic_istream_char_vbase_dtor(&cin.obj);
15861 basic_filebuf_char_dtor(&filebuf_char_stdin);
15863 basic_istream_wchar_vbase_dtor(&ucin.obj);
15864 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
15866 basic_istream_wchar_vbase_dtor(&wcin.obj);
15867 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
15869 basic_ostream_char_vbase_dtor(&cout.obj);
15870 basic_filebuf_char_dtor(&filebuf_char_stdout);
15872 basic_ostream_wchar_vbase_dtor(&ucout.obj);
15873 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
15875 basic_ostream_wchar_vbase_dtor(&wcout.obj);
15876 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
15878 basic_ostream_char_vbase_dtor(&cerr.obj);
15879 basic_filebuf_char_dtor(&filebuf_char_stderr);
15881 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
15882 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
15884 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
15885 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
15887 basic_ostream_char_vbase_dtor(&clog.obj);
15888 basic_filebuf_char_dtor(&filebuf_char_log);
15890 basic_ostream_wchar_vbase_dtor(&uclog.obj);
15891 basic_filebuf_wchar_dtor(&filebuf_short_log);
15893 basic_ostream_wchar_vbase_dtor(&wclog.obj);
15894 basic_filebuf_wchar_dtor(&filebuf_wchar_log);