makefiles: Explicitly create destination dirs when installing symlinks.
[wine/zf.git] / dlls / msvcp90 / ios.c
blob32dce89fd4582af69fdcc03426cc4adc15163906
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 <stdarg.h>
20 #include <stdio.h>
21 #include <limits.h>
22 #include <share.h>
24 #include "msvcp90.h"
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winnls.h"
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
32 #define SECSPERDAY 86400
33 /* 1601 to 1970 is 369 years plus 89 leap days */
34 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
35 #define TICKSPERSEC 10000000
36 #define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC)
38 /* ?_Index@ios_base@std@@0HA */
39 int ios_base_Index = 0;
40 /* ?_Sync@ios_base@std@@0_NA */
41 MSVCP_bool ios_base_Sync = FALSE;
43 typedef struct {
44 streamoff off;
45 __int64 DECLSPEC_ALIGN(8) pos;
46 _Mbstatet state;
47 } fpos_mbstatet;
49 static inline const char* debugstr_fpos_mbstatet(fpos_mbstatet *fpos)
51 return wine_dbg_sprintf("fpos(%s %s %d)", wine_dbgstr_longlong(fpos->off),
52 wine_dbgstr_longlong(fpos->pos), MBSTATET_TO_INT(&fpos->state));
55 typedef struct {
56 void (__cdecl *pfunc)(ios_base*, streamsize);
57 streamsize arg;
58 } manip_streamsize;
60 typedef struct {
61 void (__cdecl *pfunc)(ios_base*, int);
62 int arg;
63 } manip_int;
65 typedef enum {
66 INITFL_new = 0,
67 INITFL_open = 1,
68 INITFL_close = 2
69 } basic_filebuf__Initfl;
71 typedef struct {
72 basic_streambuf_char base;
73 codecvt_char *cvt;
74 #if _MSVCP_VER < 80
75 int state0;
76 char putback;
77 basic_string_char *conv;
78 #else
79 char putback;
80 #endif
81 MSVCP_bool wrotesome;
82 _Mbstatet state;
83 MSVCP_bool close;
84 #if _MSVCP_VER == 70
85 locale loc;
86 #endif
87 FILE *file;
88 } basic_filebuf_char;
90 typedef struct {
91 basic_streambuf_wchar base;
92 codecvt_wchar *cvt;
93 #if _MSVCP_VER < 80
94 int state0;
95 wchar_t putback;
96 basic_string_char *conv;
97 #else
98 wchar_t putback;
99 #endif
100 MSVCP_bool wrotesome;
101 _Mbstatet state;
102 MSVCP_bool close;
103 #if _MSVCP_VER == 70
104 locale loc;
105 #endif
106 FILE *file;
107 } basic_filebuf_wchar;
109 typedef enum {
110 STRINGBUF_allocated = 1,
111 STRINGBUF_no_write = 2,
112 STRINGBUF_no_read = 4,
113 STRINGBUF_append = 8,
114 STRINGBUF_at_end = 16
115 } basic_stringbuf_state;
117 typedef struct {
118 basic_streambuf_char base;
119 char *seekhigh;
120 int state;
121 char allocator; /* empty struct */
122 } basic_stringbuf_char;
124 typedef struct {
125 basic_streambuf_wchar base;
126 wchar_t *seekhigh;
127 int state;
128 char allocator; /* empty struct */
129 } basic_stringbuf_wchar;
131 typedef struct {
132 ios_base base;
133 basic_streambuf_char *strbuf;
134 struct _basic_ostream_char *stream;
135 char fillch;
136 } basic_ios_char;
138 typedef struct {
139 ios_base base;
140 basic_streambuf_wchar *strbuf;
141 struct _basic_ostream_wchar *stream;
142 wchar_t fillch;
143 } basic_ios_wchar;
145 typedef struct _basic_ostream_char {
146 const int *vbtable;
147 /* virtual inheritance
148 * basic_ios_char basic_ios;
150 } basic_ostream_char;
152 typedef struct _basic_ostream_wchar {
153 const int *vbtable;
154 /* virtual inheritance
155 * basic_ios_wchar basic_ios;
157 } basic_ostream_wchar;
159 typedef struct {
160 const int *vbtable;
161 streamsize count;
162 /* virtual inheritance
163 * basic_ios_char basic_ios;
165 } basic_istream_char;
167 typedef struct {
168 const int *vbtable;
169 streamsize count;
170 /* virtual inheritance
171 * basic_ios_wchar basic_ios;
173 } basic_istream_wchar;
175 typedef struct {
176 basic_istream_char base1;
177 basic_ostream_char base2;
178 /* virtual inheritance
179 * basic_ios_char basic_ios;
181 } basic_iostream_char;
183 typedef struct {
184 basic_istream_wchar base1;
185 basic_ostream_wchar base2;
186 /* virtual inheritance
187 * basic_ios_wchar basic_ios;
189 } basic_iostream_wchar;
191 typedef struct {
192 basic_ostream_char base;
193 basic_filebuf_char filebuf;
194 /* virtual inheritance
195 * basic_ios_char basic_ios;
197 } basic_ofstream_char;
199 typedef struct {
200 basic_ostream_wchar base;
201 basic_filebuf_wchar filebuf;
202 /* virtual inheritance
203 * basic_ios_wchar basic_ios;
205 } basic_ofstream_wchar;
207 typedef struct {
208 basic_istream_char base;
209 basic_filebuf_char filebuf;
210 /* virtual inheritance
211 * basic_ios_char basic_ios;
213 } basic_ifstream_char;
215 typedef struct {
216 basic_istream_wchar base;
217 basic_filebuf_wchar filebuf;
218 /* virtual inheritance
219 * basic_ios_wchar basic_ios;
221 } basic_ifstream_wchar;
223 typedef struct {
224 basic_iostream_char base;
225 basic_filebuf_char filebuf;
226 /* virtual inheritance
227 * basic_ios_char basic_ios;
229 } basic_fstream_char;
231 typedef struct {
232 basic_iostream_wchar base;
233 basic_filebuf_wchar filebuf;
234 /* virtual inheritance
235 * basic_ios_char basic_ios;
237 } basic_fstream_wchar;
239 typedef struct {
240 basic_ostream_char base;
241 basic_stringbuf_char strbuf;
242 /* virtual inheritance
243 * basic_ios_char basic_ios;
245 } basic_ostringstream_char;
247 typedef struct {
248 basic_ostream_wchar base;
249 basic_stringbuf_wchar strbuf;
250 /* virtual inheritance
251 * basic_ios_wchar basic_ios;
253 } basic_ostringstream_wchar;
255 typedef struct {
256 basic_istream_char base;
257 basic_stringbuf_char strbuf;
258 /* virtual inheritance
259 * basic_ios_char basic_ios;
261 } basic_istringstream_char;
263 typedef struct {
264 basic_istream_wchar base;
265 basic_stringbuf_wchar strbuf;
266 /* virtual inheritance
267 * basic_ios_wchar basic_ios;
269 } basic_istringstream_wchar;
271 typedef struct {
272 basic_iostream_char base;
273 basic_stringbuf_char strbuf;
274 /* virtual inheritance
275 * basic_ios_char basic_ios;
277 } basic_stringstream_char;
279 typedef struct {
280 basic_iostream_wchar base;
281 basic_stringbuf_wchar strbuf;
282 /* virtual inheritance
283 * basic_ios_wchar basic_ios;
285 } basic_stringstream_wchar;
287 typedef enum {
288 STRSTATE_Allocated = 1,
289 STRSTATE_Constant = 2,
290 STRSTATE_Dynamic = 4,
291 STRSTATE_Frozen = 8
292 } strstreambuf__Strstate;
294 typedef struct {
295 basic_streambuf_char base;
296 streamsize minsize;
297 char *endsave;
298 char *seekhigh;
299 int strmode;
300 void* (__cdecl *palloc)(MSVCP_size_t);
301 void (__cdecl *pfree)(void*);
302 } strstreambuf;
304 typedef struct {
305 basic_ostream_char base;
306 strstreambuf buf;
307 /* virtual inheritance
308 * basic_ios_char basic_ios;
310 } ostrstream;
312 typedef struct {
313 basic_istream_char base;
314 strstreambuf buf;
315 /* virtual inheritance
316 * basic_ios_char basic_ios;
318 } istrstream;
320 typedef struct {
321 basic_iostream_char base;
322 strstreambuf buf;
323 /* virtual inheritance
324 * basic_ios_char basic_ios;
326 } strstream;
328 struct space_info {
329 ULONGLONG capacity;
330 ULONGLONG free;
331 ULONGLONG available;
334 enum file_type {
335 #if _MSVCP_VER < 140
336 status_unknown,
337 file_not_found,
338 #else
339 file_not_found = -1,
340 none_file,
341 #endif
342 regular_file,
343 directory_file,
344 symlink_file,
345 block_file,
346 character_file,
347 fifo_file,
348 socket_file,
349 #if _MSVCP_VER < 140
350 type_unknown,
351 #else
352 status_unknown
353 #endif
356 #if _MSVCP_VER >= 110
357 #define BASIC_IOS_VTORDISP 1
358 #define INIT_BASIC_IOS_VTORDISP(basic_ios) ((int*)basic_ios)[-1] = 0
359 #else
360 #define BASIC_IOS_VTORDISP 0
361 #define INIT_BASIC_IOS_VTORDISP(basic_ios)
362 #endif
364 #define VBTABLE_ENTRY(class, offset, vbase, vtordisp) ALIGNED_SIZE(sizeof(class)+vtordisp*sizeof(int), TYPE_ALIGNMENT(vbase))-offset
365 #define VBTABLE_BASIC_IOS_ENTRY(class, offset) VBTABLE_ENTRY(class, offset, basic_ios_char, BASIC_IOS_VTORDISP)
367 extern const vtable_ptr MSVCP_iosb_vtable;
369 /* ??_7ios_base@std@@6B@ */
370 extern const vtable_ptr MSVCP_ios_base_vtable;
372 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
373 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
375 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
376 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
378 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
379 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
381 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
382 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
384 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
385 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
387 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
388 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
390 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
391 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
393 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
394 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
396 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
397 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
399 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
400 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
402 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
403 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
405 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
406 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
408 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
409 const int basic_ostream_char_vbtable[] = {0,
410 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)};
411 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
412 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
414 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
415 const int basic_ostream_wchar_vbtable[] = {0,
416 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)};
417 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
418 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
420 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
421 const int basic_ostream_short_vbtable[] = {0,
422 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)};
423 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
424 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
426 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
427 const int basic_istream_char_vbtable[] = {0,
428 VBTABLE_BASIC_IOS_ENTRY(basic_istream_char, 0)};
429 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
430 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
432 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
433 const int basic_istream_wchar_vbtable[] = {0,
434 VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)};
435 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
436 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
438 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
439 const int basic_istream_short_vbtable[] = {0,
440 VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)};
441 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
442 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
444 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
445 const int basic_iostream_char_vbtable1[] = {0,
446 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_char, 0)};
447 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
448 const int basic_iostream_char_vbtable2[] = {0,
449 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_char, FIELD_OFFSET(basic_iostream_char, base2))};
450 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
451 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
453 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
454 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
455 const int basic_iostream_wchar_vbtable1[] = {0,
456 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_wchar, 0)};
457 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
458 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
459 const int basic_iostream_wchar_vbtable2[] = {0,
460 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_wchar, FIELD_OFFSET(basic_iostream_wchar, base2))};
461 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
462 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
463 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
464 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
466 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
467 const int basic_ofstream_char_vbtable[] = {0,
468 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_char, 0)};
469 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
470 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
472 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
473 const int basic_ofstream_wchar_vbtable[] = {0,
474 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_wchar, 0)};
475 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
476 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
478 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
479 const int basic_ofstream_short_vbtable[] = {0,
480 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_wchar, 0)};
481 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
482 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
484 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
485 const int basic_ifstream_char_vbtable[] = {0,
486 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_char, 0)};
487 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
488 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
490 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
491 const int basic_ifstream_wchar_vbtable[] = {0,
492 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_wchar, 0)};
493 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
494 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
496 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
497 const int basic_ifstream_short_vbtable[] = {0,
498 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_wchar, 0)};
499 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
500 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
502 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
503 const int basic_fstream_char_vbtable1[] = {0,
504 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_char, 0)};
505 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
506 const int basic_fstream_char_vbtable2[] = {0,
507 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_char, FIELD_OFFSET(basic_fstream_char, base.base2))};
508 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
509 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
511 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
512 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
513 const int basic_fstream_wchar_vbtable1[] = {0,
514 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_wchar, 0)};
515 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
516 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
517 const int basic_fstream_wchar_vbtable2[] = {0,
518 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_wchar, FIELD_OFFSET(basic_fstream_wchar, base.base2))};
519 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
520 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
521 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
522 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
524 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
525 const int basic_ostringstream_char_vbtable[] = {0,
526 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_char, 0)};
527 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
528 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
530 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
531 const int basic_ostringstream_wchar_vbtable[] = {0,
532 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_wchar, 0)};
533 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
534 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
536 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
537 const int basic_ostringstream_short_vbtable[] = {0,
538 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_wchar, 0)};
539 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
540 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
542 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
543 const int basic_istringstream_char_vbtable[] = {0,
544 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_char, 0)};
545 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
546 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
548 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
549 const int basic_istringstream_wchar_vbtable[] = {0,
550 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_wchar, 0)};
551 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
552 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
554 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
555 const int basic_istringstream_short_vbtable[] = {0,
556 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_wchar, 0)};
557 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
558 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
560 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
561 const int basic_stringstream_char_vbtable1[] = {0,
562 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_char, 0)};
563 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
564 const int basic_stringstream_char_vbtable2[] = {0,
565 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_char, FIELD_OFFSET(basic_stringstream_char, base.base2))};
566 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
567 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
569 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
570 const int basic_stringstream_wchar_vbtable1[] = {0,
571 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, 0)};
572 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
573 const int basic_stringstream_wchar_vbtable2[] = {0,
574 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, FIELD_OFFSET(basic_stringstream_wchar, base.base2))};
575 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
576 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
578 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
579 const int basic_stringstream_short_vbtable1[] = {0,
580 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, 0)};
581 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
582 const int basic_stringstream_short_vbtable2[] = {0,
583 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, FIELD_OFFSET(basic_stringstream_wchar, base.base2))};
584 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
585 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
587 /* ??_7strstreambuf@std@@6B */
588 extern const vtable_ptr MSVCP_strstreambuf_vtable;
590 static const int ostrstream_vbtable[] = {0, VBTABLE_BASIC_IOS_ENTRY(ostrstream, 0)};
591 extern const vtable_ptr MSVCP_ostrstream_vtable;
593 static const int istrstream_vbtable[] = {0, VBTABLE_BASIC_IOS_ENTRY(istrstream, 0)};
595 static const int strstream_vbtable1[] = {0, VBTABLE_BASIC_IOS_ENTRY(strstream, 0)};
596 static const int strstream_vbtable2[] = {0,
597 VBTABLE_BASIC_IOS_ENTRY(strstream, FIELD_OFFSET(strstream, base.base2))};
598 extern const vtable_ptr MSVCP_strstream_vtable;
600 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
601 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
602 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
603 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
604 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
605 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
606 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
607 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
608 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
609 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
610 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
611 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
612 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
613 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
614 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
615 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
616 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
617 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
618 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
619 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
620 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
621 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
622 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
623 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
624 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
625 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
626 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
627 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
628 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
629 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
630 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
631 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
632 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
633 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
634 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
635 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
636 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
637 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
638 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
639 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
640 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
641 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
642 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
643 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
644 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
645 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
646 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
647 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
648 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
649 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
650 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
651 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
652 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
653 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
654 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
655 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
656 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
657 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
658 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
659 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
660 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
661 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
662 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
663 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
664 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
665 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
666 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
667 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
668 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
669 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
670 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
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_ofstream@GU?$char_traits@G@std@@@std@@")
674 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
675 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
676 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
677 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
678 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
679 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
680 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
681 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
682 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
683 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
684 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
685 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
686 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_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 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
690 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
691 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
692 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
693 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
694 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
695 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
696 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
697 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
698 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
699 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
700 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
701 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
702 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
703 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
704 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
705 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
706 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
707 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
708 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
709 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
710 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
711 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
712 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
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_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
716 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_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_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
720 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_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_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
724 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_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_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
728 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
729 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
730 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
731 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
732 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
733 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
734 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
735 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
736 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
737 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
738 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
739 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
740 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
741 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
742 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
743 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
744 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
745 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
746 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
747 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
748 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
749 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
750 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
751 "?AVostrstream@std@@")
752 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
753 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
754 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
755 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
756 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
757 "?AVstrstream@std@@")
759 __ASM_BLOCK_BEGIN(ios_vtables)
760 __ASM_VTABLE(iosb,
761 VTABLE_ADD_FUNC(iosb_vector_dtor));
762 __ASM_VTABLE(ios_base,
763 VTABLE_ADD_FUNC(ios_base_vector_dtor));
764 __ASM_VTABLE(basic_ios_char,
765 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor)
766 #if _MSVCP_VER == 110
767 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
768 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
769 #endif
771 __ASM_VTABLE(basic_ios_wchar,
772 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor)
773 #if _MSVCP_VER == 110
774 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
775 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
776 #endif
778 __ASM_VTABLE(basic_ios_short,
779 VTABLE_ADD_FUNC(basic_ios_wchar_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_streambuf_char,
786 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
787 #if _MSVCP_VER >= 100
788 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
789 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
790 #endif
791 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
792 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
793 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
794 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
795 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
796 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
797 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
798 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
799 #endif
800 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
801 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
802 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
803 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
804 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
805 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
806 __ASM_VTABLE(basic_streambuf_wchar,
807 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
808 #if _MSVCP_VER >= 100
809 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
810 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
811 #endif
812 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
813 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
814 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
815 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
816 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
817 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
818 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
819 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
820 #endif
821 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
822 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
823 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
824 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
825 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
826 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
827 __ASM_VTABLE(basic_streambuf_short,
828 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
829 #if _MSVCP_VER >= 100
830 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
831 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
832 #endif
833 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
834 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
835 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
836 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
837 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
838 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
839 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
840 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
841 #endif
842 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
843 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
844 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
845 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
846 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
847 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
848 __ASM_VTABLE(basic_filebuf_char,
849 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
850 #if _MSVCP_VER >= 100
851 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
852 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
853 #endif
854 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
855 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
856 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
857 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
858 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
859 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
860 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
861 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
862 #endif
863 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
864 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
865 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
866 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
867 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
868 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
869 __ASM_VTABLE(basic_filebuf_wchar,
870 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
871 #if _MSVCP_VER >= 100
872 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
873 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
874 #endif
875 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
876 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
877 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
878 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
879 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
880 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
881 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
882 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
883 #endif
884 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
885 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
886 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
887 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
888 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
889 VTABLE_ADD_FUNC(basic_filebuf_wchar_imbue));
890 __ASM_VTABLE(basic_filebuf_short,
891 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
892 #if _MSVCP_VER >= 100
893 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
894 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
895 #endif
896 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
897 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
898 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
899 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
900 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
901 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
902 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
903 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
904 #endif
905 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
906 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
907 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
908 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
909 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
910 VTABLE_ADD_FUNC(basic_filebuf_short_imbue));
911 __ASM_VTABLE(basic_stringbuf_char,
912 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
913 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
914 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
915 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
916 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
917 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
918 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
919 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
920 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
921 #endif
922 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
923 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
924 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
925 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
926 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
927 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
928 __ASM_VTABLE(basic_stringbuf_wchar,
929 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
930 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
931 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
932 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
933 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
934 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
935 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
936 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
937 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
938 #endif
939 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
940 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
941 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
942 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
943 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
944 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
945 __ASM_VTABLE(basic_stringbuf_short,
946 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
947 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
948 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
949 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
950 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
951 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
952 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
953 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
954 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
955 #endif
956 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
957 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
958 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
959 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
960 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
961 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
962 __ASM_VTABLE(basic_ostream_char,
963 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor)
964 #if _MSVCP_VER == 110
965 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
966 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
967 #endif
969 __ASM_VTABLE(basic_ostream_wchar,
970 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor)
971 #if _MSVCP_VER == 110
972 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
973 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
974 #endif
976 __ASM_VTABLE(basic_ostream_short,
977 VTABLE_ADD_FUNC(basic_ostream_wchar_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_istream_char,
984 VTABLE_ADD_FUNC(basic_istream_char_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_istream_wchar,
991 VTABLE_ADD_FUNC(basic_istream_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_short,
998 VTABLE_ADD_FUNC(basic_istream_wchar_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_iostream_char,
1005 VTABLE_ADD_FUNC(basic_iostream_char_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_iostream_wchar,
1012 VTABLE_ADD_FUNC(basic_iostream_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_short,
1019 VTABLE_ADD_FUNC(basic_iostream_wchar_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_ofstream_char,
1026 VTABLE_ADD_FUNC(basic_ofstream_char_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_ofstream_wchar,
1033 VTABLE_ADD_FUNC(basic_ofstream_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_short,
1040 VTABLE_ADD_FUNC(basic_ofstream_wchar_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_ifstream_char,
1047 VTABLE_ADD_FUNC(basic_ifstream_char_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_ifstream_wchar,
1054 VTABLE_ADD_FUNC(basic_ifstream_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_short,
1061 VTABLE_ADD_FUNC(basic_ifstream_wchar_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_fstream_char,
1068 VTABLE_ADD_FUNC(basic_fstream_char_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_fstream_wchar,
1075 VTABLE_ADD_FUNC(basic_fstream_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_short,
1082 VTABLE_ADD_FUNC(basic_fstream_wchar_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_ostringstream_char,
1089 VTABLE_ADD_FUNC(basic_ostringstream_char_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_ostringstream_wchar,
1096 VTABLE_ADD_FUNC(basic_ostringstream_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_short,
1103 VTABLE_ADD_FUNC(basic_ostringstream_wchar_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_istringstream_char,
1110 VTABLE_ADD_FUNC(basic_istringstream_char_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_istringstream_wchar,
1117 VTABLE_ADD_FUNC(basic_istringstream_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_short,
1124 VTABLE_ADD_FUNC(basic_istringstream_wchar_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_stringstream_char,
1131 VTABLE_ADD_FUNC(basic_stringstream_char_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_stringstream_wchar,
1138 VTABLE_ADD_FUNC(basic_stringstream_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_short,
1145 VTABLE_ADD_FUNC(basic_stringstream_wchar_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(strstreambuf,
1152 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
1153 VTABLE_ADD_FUNC(strstreambuf_overflow)
1154 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
1155 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
1156 VTABLE_ADD_FUNC(strstreambuf_underflow)
1157 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
1158 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
1159 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1160 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
1161 #endif
1162 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
1163 VTABLE_ADD_FUNC(strstreambuf_seekoff)
1164 VTABLE_ADD_FUNC(strstreambuf_seekpos)
1165 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
1166 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
1167 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
1168 __ASM_VTABLE(ostrstream,
1169 VTABLE_ADD_FUNC(ostrstream_vector_dtor)
1170 #if _MSVCP_VER == 110
1171 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1172 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1173 #endif
1175 __ASM_VTABLE(strstream,
1176 VTABLE_ADD_FUNC(strstream_vector_dtor)
1177 #if _MSVCP_VER == 110
1178 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1179 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1180 #endif
1182 __ASM_BLOCK_END
1184 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1185 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1186 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
1187 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
1189 TRACE("(%p %p %p %p)\n", this, first, next, last);
1191 this->wbuf = first;
1192 this->wpos = next;
1193 this->wsize = last-next;
1196 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
1197 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
1198 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
1199 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
1201 basic_streambuf_char_setp_next(this, first, first, last);
1204 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1205 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1206 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
1207 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
1209 TRACE("(%p %p %p %p)\n", this, first, next, last);
1211 this->rbuf = first;
1212 this->rpos = next;
1213 this->rsize = last-next;
1216 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
1217 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
1218 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
1219 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
1221 TRACE("(%p)\n", this);
1223 this->prbuf = &this->rbuf;
1224 this->pwbuf = &this->wbuf;
1225 this->prpos = &this->rpos;
1226 this->pwpos = &this->wpos;
1227 this->prsize = &this->rsize;
1228 this->pwsize = &this->wsize;
1230 basic_streambuf_char_setp(this, NULL, NULL);
1231 basic_streambuf_char_setg(this, NULL, NULL, NULL);
1234 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1235 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1236 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
1237 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
1239 TRACE("(%p %d)\n", this, uninitialized);
1240 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1241 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1242 mutex_ctor(&this->lock);
1243 #endif
1244 return this;
1247 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
1248 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
1249 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
1250 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
1252 TRACE("(%p)\n", this);
1254 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1255 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1256 mutex_ctor(&this->lock);
1257 #endif
1258 #if _MSVCP_VER >= 70
1259 this->loc = MSVCRT_operator_new(sizeof(locale));
1260 #endif
1261 locale_ctor(IOS_LOCALE(this));
1262 basic_streambuf_char__Init_empty(this);
1264 return this;
1267 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
1268 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1269 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
1270 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
1272 TRACE("(%p)\n", this);
1274 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1275 mutex_dtor(&this->lock);
1276 #endif
1277 locale_dtor(IOS_LOCALE(this));
1278 #if _MSVCP_VER >= 70
1279 MSVCRT_operator_delete(this->loc);
1280 #endif
1283 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
1284 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
1286 TRACE("(%p %x)\n", this, flags);
1287 if(flags & 2) {
1288 /* we have an array, with the number of elements stored before the first object */
1289 INT_PTR i, *ptr = (INT_PTR *)this-1;
1291 for(i=*ptr-1; i>=0; i--)
1292 basic_streambuf_char_dtor(this+i);
1293 MSVCRT_operator_delete(ptr);
1294 } else {
1295 basic_streambuf_char_dtor(this);
1296 if(flags & 1)
1297 MSVCRT_operator_delete(this);
1300 return this;
1303 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1304 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1305 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
1306 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
1308 TRACE("(%p)\n", this);
1309 return *this->prpos ? *this->prsize : 0;
1312 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1313 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1314 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1315 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1317 TRACE("(%p)\n", this);
1318 (*this->prsize)++;
1319 (*this->prpos)--;
1320 return *this->prpos;
1323 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1324 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1325 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1326 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1328 TRACE("(%p)\n", this);
1329 (*this->prsize)--;
1330 return (*this->prpos)++;
1333 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1334 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1335 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1336 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1338 TRACE("(%p)\n", this);
1339 (*this->prsize)--;
1340 (*this->prpos)++;
1341 return *this->prpos;
1344 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1345 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1346 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1347 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1349 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1351 this->prbuf = gf;
1352 this->pwbuf = pf;
1353 this->prpos = gn;
1354 this->pwpos = pn;
1355 this->prsize = gc;
1356 this->pwsize = pc;
1359 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1360 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1361 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1362 #if _MSVCP_VER >= 100
1363 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1364 #else
1365 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1366 #endif
1367 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1369 TRACE("(%p)\n", this);
1370 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1371 mutex_lock(&this->lock);
1372 #endif
1375 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1376 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1377 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1378 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1380 TRACE("(%p)\n", this);
1381 return *this->pwpos ? *this->pwsize : 0;
1384 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1385 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1386 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1387 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1389 TRACE("(%p)\n", this);
1390 (*this->pwsize)--;
1391 return (*this->pwpos)++;
1394 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1395 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1396 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1397 #if _MSVCP_VER >= 100
1398 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1399 #else
1400 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1401 #endif
1402 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1404 TRACE("(%p)\n", this);
1405 return EOF;
1408 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1409 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1410 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1411 #if _MSVCP_VER >= 100
1412 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1413 #else
1414 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1415 #endif
1416 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1418 int ret;
1420 TRACE("(%p)\n", this);
1422 if(call_basic_streambuf_char_underflow(this)==EOF)
1423 return EOF;
1425 ret = (unsigned char)**this->prpos;
1426 (*this->prsize)--;
1427 (*this->prpos)++;
1428 return ret;
1431 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1432 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1433 #if STREAMSIZE_BITS == 64
1434 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1435 #else
1436 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1437 #endif
1438 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1439 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1440 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1441 #else
1442 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1443 #endif
1444 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1446 streamsize copied, chunk;
1447 int c;
1449 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1451 for(copied=0; copied<count && size;) {
1452 chunk = basic_streambuf_char__Gnavail(this);
1453 if(chunk > count-copied)
1454 chunk = count-copied;
1456 if(chunk > 0) {
1457 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1458 *this->prpos += chunk;
1459 *this->prsize -= chunk;
1460 copied += chunk;
1461 size -= chunk;
1462 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1463 ptr[copied] = c;
1464 copied++;
1465 size--;
1466 }else {
1467 break;
1471 return copied;
1474 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1475 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1476 #if STREAMSIZE_BITS == 64
1477 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1478 #else
1479 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1480 #endif
1481 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1483 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1484 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1487 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1488 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1489 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1490 #if _MSVCP_VER >= 100
1491 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1492 #else
1493 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1494 #endif
1495 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1497 TRACE("(%p)\n", this);
1498 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1499 mutex_unlock(&this->lock);
1500 #endif
1503 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1504 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1505 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1506 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1508 TRACE("(%p)\n", this);
1509 return *this->prbuf;
1512 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1513 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1514 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1515 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1517 TRACE("(%p)\n", this);
1518 return *this->prpos;
1521 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1522 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1523 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1524 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1526 TRACE("(%p)\n", this);
1527 return *this->prpos+*this->prsize;
1530 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1531 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1532 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1533 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1535 TRACE("(%p)\n", this);
1536 return *this->pwpos+*this->pwsize;
1539 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1540 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1541 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1542 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1544 TRACE("(%p %d)\n", this, off);
1545 *this->prpos += off;
1546 *this->prsize -= off;
1549 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@XZ */
1550 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1551 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@XZ */
1552 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1553 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1554 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
1556 TRACE("(%p)\n", this);
1557 return locale_copy_ctor(ret, IOS_LOCALE(this));
1560 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1561 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1562 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1563 #if _MSVCP_VER >= 100
1564 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_char*, const locale*), (this, loc))
1565 #elif _MSVCP_VER >= 80
1566 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_char*, const locale*), (this, loc))
1567 #else
1568 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_char*, const locale*), (this, loc))
1569 #endif
1570 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1572 TRACE("(%p %p)\n", this, loc);
1575 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1576 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1577 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1578 #if _MSVCP_VER >= 100
1579 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 12, int, (basic_streambuf_char*, int), (this, ch))
1580 #else
1581 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, int, (basic_streambuf_char*, int), (this, ch))
1582 #endif
1583 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1585 TRACE("(%p %d)\n", this, ch);
1586 return EOF;
1589 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1590 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1591 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1592 #if _MSVCP_VER >= 100
1593 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*, int), (this, ch))
1594 #else
1595 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, int, (basic_streambuf_char*, int), (this, ch))
1596 #endif
1597 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1599 TRACE("(%p %d)\n", this, ch);
1600 return EOF;
1603 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1604 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1605 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1606 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1608 TRACE("(%p)\n", this);
1609 return *this->pwbuf;
1612 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1613 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1614 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1615 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1617 TRACE("(%p %d)\n", this, off);
1618 *this->pwpos += off;
1619 *this->pwsize -= off;
1622 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1623 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1624 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1625 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1627 TRACE("(%p)\n", this);
1628 return *this->pwpos;
1631 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1632 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1633 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1634 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1636 TRACE("(%p %p)\n", this, loc);
1637 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
1638 call_basic_streambuf_char_imbue(this, loc);
1639 locale_copy_ctor(IOS_LOCALE(this), loc);
1640 return ret;
1643 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1644 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1645 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1646 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1647 #if STREAMOFF_BITS == 64
1648 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1649 #else
1650 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1651 #endif
1652 #if _MSVCP_VER >= 100
1653 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) \
1654 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
1655 #elif _MSVCP_VER >= 80
1656 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) \
1657 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
1658 #else
1659 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) \
1660 CALL_VTBL_FUNC(this, 32, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
1661 #endif
1662 fpos_mbstatet* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1663 fpos_mbstatet *ret, streamoff off, int way, int mode)
1665 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1666 ret->off = -1;
1667 ret->pos = 0;
1668 memset(&ret->state, 0, sizeof(ret->state));
1669 return ret;
1672 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1673 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1674 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
1675 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
1676 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1677 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1678 #if STREAMOFF_BITS == 64
1679 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1680 #else
1681 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1682 #endif
1683 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1684 fpos_mbstatet *ret, streamoff off, int way, int mode)
1686 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1687 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1690 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1691 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1692 #if STREAMOFF_BITS == 64
1693 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 24)
1694 #else
1695 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1696 #endif
1697 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1698 fpos_mbstatet *ret, streamoff off, unsigned int way, unsigned int mode)
1700 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1701 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1704 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1705 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1706 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1707 #if _MSVCP_VER >= 100
1708 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) \
1709 CALL_VTBL_FUNC(this, 44, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
1710 #elif _MSVCP_VER >= 80
1711 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) \
1712 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
1713 #else
1714 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) \
1715 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_char*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
1716 #endif
1717 fpos_mbstatet* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1718 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
1720 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
1721 ret->off = -1;
1722 ret->pos = 0;
1723 memset(&ret->state, 0, sizeof(ret->state));
1724 return ret;
1727 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1728 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1729 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1730 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1731 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
1733 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
1734 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1737 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1738 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1739 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1740 fpos_mbstatet* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1741 fpos_mbstatet *ret, fpos_mbstatet pos, unsigned int mode)
1743 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
1744 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1747 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1748 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1749 #if STREAMSIZE_BITS == 64
1750 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1751 #else
1752 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1753 #endif
1754 #if _MSVCP_VER >= 100
1755 #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))
1756 #elif _MSVCP_VER >= 80
1757 #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))
1758 #else
1759 #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))
1760 #endif
1761 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1763 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1764 return this;
1767 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1768 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1769 #if STREAMSIZE_BITS == 64
1770 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1771 #else
1772 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1773 #endif
1774 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1776 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1777 return call_basic_streambuf_char_setbuf(this, buf, count);
1780 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1781 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1782 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1783 #if _MSVCP_VER >= 100
1784 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1785 #elif _MSVCP_VER >= 80
1786 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1787 #else
1788 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1789 #endif
1790 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1792 TRACE("(%p)\n", this);
1793 return 0;
1796 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1797 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1798 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1799 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1801 TRACE("(%p)\n", this);
1802 return call_basic_streambuf_char_sync(this);
1805 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1806 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1807 #if STREAMSIZE_BITS == 64
1808 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1809 #else
1810 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1811 #endif
1812 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1814 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1815 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1818 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1819 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1820 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1821 #if _MSVCP_VER >= 100
1822 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1823 #else
1824 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1825 #endif
1826 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1828 TRACE("(%p)\n", this);
1829 return 0;
1832 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1833 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1834 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1835 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1837 streamsize ret;
1839 TRACE("(%p)\n", this);
1841 ret = basic_streambuf_char__Gnavail(this);
1842 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1845 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1846 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1847 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1848 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1850 TRACE("(%p %d)\n", this, ch);
1851 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1852 (*this->prsize)++;
1853 (*this->prpos)--;
1854 return (unsigned char)ch;
1857 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1860 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1861 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1862 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1863 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1865 TRACE("(%p %d)\n", this, ch);
1866 return basic_streambuf_char__Pnavail(this) ?
1867 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1868 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1871 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1872 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1873 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1874 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1876 TRACE("(%p)\n", this);
1877 if(*this->prpos && *this->prpos>*this->prbuf) {
1878 (*this->prsize)++;
1879 (*this->prpos)--;
1880 return (unsigned char)**this->prpos;
1883 return call_basic_streambuf_char_pbackfail(this, EOF);
1886 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1887 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1888 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1889 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1891 TRACE("(%p)\n", this);
1892 if(basic_streambuf_char__Gnavail(this))
1893 basic_streambuf_char__Gninc(this);
1894 else
1895 call_basic_streambuf_char_uflow(this);
1898 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1899 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1900 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1901 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1903 TRACE("(%p)\n", this);
1904 return basic_streambuf_char__Gnavail(this) ?
1905 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1908 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1909 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1910 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1911 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1913 TRACE("(%p)\n", this);
1914 return basic_streambuf_char__Gnavail(this) ?
1915 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1918 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1919 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1920 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1921 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1923 TRACE("(%p)\n", this);
1925 if(basic_streambuf_char__Gnavail(this) > 1)
1926 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1927 return basic_streambuf_char_sbumpc(this)==EOF ?
1928 EOF : basic_streambuf_char_sgetc(this);
1931 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1932 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1933 #if STREAMSIZE_BITS == 64
1934 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1935 #else
1936 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1937 #endif
1938 #if _MSVCP_VER >= 100
1939 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1940 #else
1941 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1942 #endif
1943 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1945 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1946 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1949 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1950 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1951 #if STREAMSIZE_BITS == 64
1952 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1953 #else
1954 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1955 #endif
1956 #if _MSVCP_VER >= 100
1957 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1958 #elif _MSVCP_VER >= 80
1959 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1960 #else
1961 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1962 #endif
1963 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1965 streamsize copied, chunk;
1967 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1969 for(copied=0; copied<count;) {
1970 chunk = basic_streambuf_char__Pnavail(this);
1971 if(chunk > count-copied)
1972 chunk = count-copied;
1974 if(chunk > 0) {
1975 memcpy(*this->pwpos, ptr+copied, chunk);
1976 *this->pwpos += chunk;
1977 *this->pwsize -= chunk;
1978 copied += chunk;
1979 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1980 copied++;
1981 }else {
1982 break;
1986 return copied;
1989 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1990 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1991 #if STREAMSIZE_BITS == 64
1992 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
1993 #else
1994 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1995 #endif
1996 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1998 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1999 return call_basic_streambuf_char_xsputn(this, ptr, count);
2002 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
2003 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
2004 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8)
2005 void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r)
2007 char *wfirst, *wnext, *wlast, *rfirst, *rnext, *rlast;
2008 #if _MSVCP_VER < 70
2009 locale loc;
2010 #else
2011 locale *loc;
2012 #endif
2014 TRACE("(%p %p)\n", this, r);
2016 if(this == r)
2017 return;
2019 wfirst = *this->pwbuf;
2020 wnext = *this->pwpos;
2021 wlast = *this->pwpos + *this->pwsize;
2022 rfirst = *this->prbuf;
2023 rnext = *this->prpos;
2024 rlast = *this->prpos + *this->prsize;
2025 loc = this->loc;
2027 basic_streambuf_char_setp_next(this, *r->pwbuf, *r->pwpos, *r->pwpos + *r->pwsize);
2028 basic_streambuf_char_setg(this, *r->prbuf, *r->prpos, *r->prpos + *r->prsize);
2029 this->loc = r->loc;
2031 basic_streambuf_char_setp_next(r, wfirst, wnext, wlast);
2032 basic_streambuf_char_setg(r, rfirst, rnext, rlast);
2033 r->loc = loc;
2036 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
2037 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
2038 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
2039 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
2040 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
2041 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
2043 TRACE("(%p %p %p %p)\n", this, first, next, last);
2045 this->wbuf = first;
2046 this->wpos = next;
2047 this->wsize = last-next;
2050 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
2051 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
2052 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
2053 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
2054 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
2055 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
2057 basic_streambuf_wchar_setp_next(this, first, first, last);
2060 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
2061 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
2062 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
2063 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
2064 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
2065 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
2067 TRACE("(%p %p %p %p)\n", this, first, next, last);
2069 this->rbuf = first;
2070 this->rpos = next;
2071 this->rsize = last-next;
2074 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
2075 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
2076 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
2077 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
2078 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
2079 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
2081 TRACE("(%p)\n", this);
2083 this->prbuf = &this->rbuf;
2084 this->pwbuf = &this->wbuf;
2085 this->prpos = &this->rpos;
2086 this->pwpos = &this->wpos;
2087 this->prsize = &this->rsize;
2088 this->pwsize = &this->wsize;
2090 basic_streambuf_wchar_setp(this, NULL, NULL);
2091 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
2094 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
2095 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
2096 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
2097 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
2099 TRACE("(%p %d)\n", this, uninitialized);
2100 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
2101 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2102 mutex_ctor(&this->lock);
2103 #endif
2104 return this;
2107 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
2108 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
2109 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
2110 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
2112 TRACE("(%p %d)\n", this, uninitialized);
2113 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
2114 this->vtable = &MSVCP_basic_streambuf_short_vtable;
2115 return this;
2118 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
2119 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
2120 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
2121 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
2123 TRACE("(%p)\n", this);
2125 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
2126 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2127 mutex_ctor(&this->lock);
2128 #endif
2129 #if _MSVCP_VER >= 70
2130 this->loc = MSVCRT_operator_new(sizeof(locale));
2131 #endif
2132 locale_ctor(IOS_LOCALE(this));
2133 basic_streambuf_wchar__Init_empty(this);
2135 return this;
2138 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
2139 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
2140 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
2141 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
2143 TRACE("(%p)\n", this);
2144 basic_streambuf_wchar_ctor(this);
2145 this->vtable = &MSVCP_basic_streambuf_short_vtable;
2146 return this;
2149 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
2150 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
2151 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
2152 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
2153 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
2154 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
2156 TRACE("(%p)\n", this);
2158 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2159 mutex_dtor(&this->lock);
2160 #endif
2161 locale_dtor(IOS_LOCALE(this));
2162 #if _MSVCP_VER >= 70
2163 MSVCRT_operator_delete(this->loc);
2164 #endif
2167 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
2168 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
2170 TRACE("(%p %x)\n", this, flags);
2171 if(flags & 2) {
2172 /* we have an array, with the number of elements stored before the first object */
2173 INT_PTR i, *ptr = (INT_PTR *)this-1;
2175 for(i=*ptr-1; i>=0; i--)
2176 basic_streambuf_wchar_dtor(this+i);
2177 MSVCRT_operator_delete(ptr);
2178 } else {
2179 basic_streambuf_wchar_dtor(this);
2180 if(flags & 1)
2181 MSVCRT_operator_delete(this);
2184 return this;
2187 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2188 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2189 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2190 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2191 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
2192 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
2194 TRACE("(%p)\n", this);
2195 return *this->prpos ? *this->prsize : 0;
2198 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2199 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2200 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2201 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2202 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
2203 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
2205 TRACE("(%p)\n", this);
2206 (*this->prsize)++;
2207 (*this->prpos)--;
2208 return *this->prpos;
2211 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2212 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2213 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2214 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2215 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
2216 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
2218 TRACE("(%p)\n", this);
2219 (*this->prsize)--;
2220 return (*this->prpos)++;
2223 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2224 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2225 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2226 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2227 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
2228 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
2230 TRACE("(%p)\n", this);
2231 (*this->prsize)--;
2232 (*this->prpos)++;
2233 return *this->prpos;
2236 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
2237 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
2238 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
2239 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
2240 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
2241 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)
2243 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
2245 this->prbuf = gf;
2246 this->pwbuf = pf;
2247 this->prpos = gn;
2248 this->pwpos = pn;
2249 this->prsize = gc;
2250 this->pwsize = pc;
2253 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2254 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2255 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2256 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2257 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
2258 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
2260 TRACE("(%p)\n", this);
2261 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2262 mutex_lock(&this->lock);
2263 #endif
2266 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2267 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2268 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2269 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2270 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
2271 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
2273 TRACE("(%p)\n", this);
2274 return *this->pwpos ? *this->pwsize : 0;
2277 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2278 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2279 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2280 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2281 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
2282 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
2284 TRACE("(%p)\n", this);
2285 (*this->pwsize)--;
2286 return (*this->pwpos)++;
2289 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2290 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2291 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2292 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2293 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
2294 #if _MSVCP_VER >= 100
2295 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
2296 #else
2297 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
2298 #endif
2299 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
2301 TRACE("(%p)\n", this);
2302 return WEOF;
2305 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2306 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2307 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2308 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2309 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
2310 #if _MSVCP_VER >= 100
2311 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
2312 #else
2313 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
2314 #endif
2315 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
2317 int ret;
2319 TRACE("(%p)\n", this);
2321 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
2322 return WEOF;
2324 ret = **this->prpos;
2325 (*this->prsize)--;
2326 (*this->prpos)++;
2327 return ret;
2330 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
2331 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
2332 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
2333 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
2334 #if STREAMSIZE_BITS == 64
2335 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
2336 #else
2337 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
2338 #endif
2339 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2340 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
2341 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
2342 #else
2343 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
2344 #endif
2345 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2347 streamsize copied, chunk;
2348 unsigned short c;
2350 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2352 for(copied=0; copied<count && size;) {
2353 chunk = basic_streambuf_wchar__Gnavail(this);
2354 if(chunk > count-copied)
2355 chunk = count-copied;
2357 if(chunk > 0) {
2358 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
2359 *this->prpos += chunk;
2360 *this->prsize -= chunk;
2361 copied += chunk;
2362 size -= chunk*sizeof(wchar_t);
2363 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
2364 ptr[copied] = c;
2365 copied++;
2366 size--;
2367 }else {
2368 break;
2372 return copied;
2375 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
2376 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
2377 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
2378 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
2379 #if STREAMSIZE_BITS == 64
2380 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
2381 #else
2382 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
2383 #endif
2384 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2386 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2387 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
2390 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2391 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2392 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2393 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2394 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
2395 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
2397 TRACE("(%p)\n", this);
2398 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2399 mutex_unlock(&this->lock);
2400 #endif
2403 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2404 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2405 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2406 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2407 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2408 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2410 TRACE("(%p)\n", this);
2411 return *this->prbuf;
2414 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2415 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2416 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2417 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2418 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2419 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2421 TRACE("(%p)\n", this);
2422 return *this->prpos;
2425 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2426 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2427 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2428 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2429 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2430 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2432 TRACE("(%p)\n", this);
2433 return *this->prpos+*this->prsize;
2436 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2437 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2438 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2439 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2440 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2441 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2443 TRACE("(%p)\n", this);
2444 return *this->pwpos+*this->pwsize;
2447 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2448 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2449 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2450 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2451 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2452 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2454 TRACE("(%p %d)\n", this, off);
2455 *this->prpos += off;
2456 *this->prsize -= off;
2459 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
2460 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
2461 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
2462 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
2463 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
2464 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
2466 TRACE("(%p)\n", this);
2467 return locale_copy_ctor(ret, IOS_LOCALE(this));
2470 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2471 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2472 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2473 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2474 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2475 #if _MSVCP_VER >= 100
2476 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2477 #elif _MSVCP_VER >= 80
2478 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2479 #else
2480 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2481 #endif
2482 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2484 TRACE("(%p %p)\n", this, loc);
2487 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2488 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2489 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2490 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2491 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2492 #if _MSVCP_VER >= 100
2493 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2494 #else
2495 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2496 #endif
2497 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2499 TRACE("(%p %d)\n", this, ch);
2500 return WEOF;
2503 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2504 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2505 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2506 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2507 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2508 #if _MSVCP_VER >= 100
2509 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2510 #else
2511 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2512 #endif
2513 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2515 TRACE("(%p %d)\n", this, ch);
2516 return WEOF;
2519 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2520 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2521 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2522 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2523 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2524 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2526 TRACE("(%p)\n", this);
2527 return *this->pwbuf;
2530 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2531 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2532 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2533 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2534 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2535 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2537 TRACE("(%p %d)\n", this, off);
2538 *this->pwpos += off;
2539 *this->pwsize -= off;
2542 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2543 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2544 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2545 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2546 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2547 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2549 TRACE("(%p)\n", this);
2550 return *this->pwpos;
2553 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2554 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2555 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2556 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2557 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2558 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2560 TRACE("(%p %p)\n", this, loc);
2561 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
2562 call_basic_streambuf_wchar_imbue(this, loc);
2563 locale_copy_ctor(IOS_LOCALE(this), loc);
2564 return ret;
2567 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2568 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
2569 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2570 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2571 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2572 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2573 #if STREAMOFF_BITS == 64
2574 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2575 #else
2576 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2577 #endif
2578 #if _MSVCP_VER >= 100
2579 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) \
2580 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
2581 #elif _MSVCP_VER >= 80
2582 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) \
2583 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
2584 #else
2585 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) \
2586 CALL_VTBL_FUNC(this, 32, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, streamoff, int, int), (this, ret, off, way, mode))
2587 #endif
2588 fpos_mbstatet* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2589 fpos_mbstatet *ret, streamoff off, int way, int mode)
2591 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2592 ret->off = -1;
2593 ret->pos = 0;
2594 memset(&ret->state, 0, sizeof(ret->state));
2595 return ret;
2598 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2599 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2600 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2601 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2602 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
2603 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
2604 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2605 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ioos_base@2@H@Z */
2606 #if STREAMOFF_BITS == 64
2607 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2608 #else
2609 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2610 #endif
2611 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2612 fpos_mbstatet *ret, streamoff off, int way, int mode)
2614 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2615 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2618 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2619 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2620 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2621 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2622 #if STREAMOFF_BITS == 64
2623 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 24)
2624 #else
2625 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2626 #endif
2627 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2628 fpos_mbstatet *ret, streamoff off, unsigned int way, unsigned int mode)
2630 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2631 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2634 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2635 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2636 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2637 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2638 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2639 #if _MSVCP_VER >= 100
2640 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) \
2641 CALL_VTBL_FUNC(this, 44, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
2642 #elif _MSVCP_VER >= 80
2643 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) \
2644 CALL_VTBL_FUNC(this, 40, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
2645 #else
2646 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) \
2647 CALL_VTBL_FUNC(this, 36, fpos_mbstatet*, (basic_streambuf_wchar*, fpos_mbstatet*, fpos_mbstatet, int), (this, ret, pos, mode))
2648 #endif
2649 fpos_mbstatet* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2650 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
2652 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
2653 ret->off = -1;
2654 ret->pos = 0;
2655 memset(&ret->state, 0, sizeof(ret->state));
2656 return ret;
2659 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2660 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2661 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2662 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2663 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2664 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2665 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
2667 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
2668 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2671 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2672 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2673 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2674 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2675 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2676 fpos_mbstatet* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2677 fpos_mbstatet *ret, fpos_mbstatet pos, unsigned int mode)
2679 TRACE("(%p %s %d)\n", this, debugstr_fpos_mbstatet(&pos), mode);
2680 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2683 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2684 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2685 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2686 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2687 #if STREAMSIZE_BITS == 64
2688 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2689 #else
2690 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2691 #endif
2692 #if _MSVCP_VER >= 100
2693 #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))
2694 #elif _MSVCP_VER >= 80
2695 #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))
2696 #else
2697 #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))
2698 #endif
2699 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2701 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2702 return this;
2705 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2706 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2707 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2708 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2709 #if STREAMSIZE_BITS == 64
2710 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2711 #else
2712 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2713 #endif
2714 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2716 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2717 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2720 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2721 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2722 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2723 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2724 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2725 #if _MSVCP_VER >= 100
2726 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2727 #elif _MSVCP_VER >= 80
2728 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2729 #else
2730 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2731 #endif
2732 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2734 TRACE("(%p)\n", this);
2735 return 0;
2738 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2739 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2740 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2741 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2742 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2743 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2745 TRACE("(%p)\n", this);
2746 return call_basic_streambuf_wchar_sync(this);
2749 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2750 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2751 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2752 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2753 #if STREAMSIZE_BITS == 64
2754 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2755 #else
2756 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2757 #endif
2758 #if _MSVCP_VER >= 100
2759 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2760 #else
2761 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2762 #endif
2763 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2765 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2766 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2769 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2770 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2771 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2772 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2773 #if STREAMSIZE_BITS == 64
2774 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2775 #else
2776 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2777 #endif
2778 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2780 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2781 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2784 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2785 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2786 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2787 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2788 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2789 #if _MSVCP_VER >= 100
2790 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2791 #else
2792 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2793 #endif
2794 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2796 TRACE("(%p)\n", this);
2797 return 0;
2800 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2801 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2802 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2803 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2804 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2805 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2807 streamsize ret;
2809 TRACE("(%p)\n", this);
2811 ret = basic_streambuf_wchar__Gnavail(this);
2812 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2815 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2816 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2817 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2818 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2819 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2820 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2822 TRACE("(%p %d)\n", this, ch);
2823 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2824 (*this->prsize)++;
2825 (*this->prpos)--;
2826 return ch;
2829 return call_basic_streambuf_wchar_pbackfail(this, ch);
2832 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2833 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2834 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2835 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2836 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2837 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2839 TRACE("(%p %d)\n", this, ch);
2840 return basic_streambuf_wchar__Pnavail(this) ?
2841 (*basic_streambuf_wchar__Pninc(this) = ch) :
2842 call_basic_streambuf_wchar_overflow(this, ch);
2845 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2846 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2847 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2848 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2849 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2850 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2852 TRACE("(%p)\n", this);
2853 if(*this->prpos && *this->prpos>*this->prbuf) {
2854 (*this->prsize)++;
2855 (*this->prpos)--;
2856 return **this->prpos;
2859 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2862 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2863 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2864 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2865 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2866 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2867 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2869 TRACE("(%p)\n", this);
2870 if(basic_streambuf_wchar__Gnavail(this))
2871 basic_streambuf_wchar__Gninc(this);
2872 else
2873 call_basic_streambuf_wchar_uflow(this);
2876 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2877 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2878 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2879 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2880 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2881 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2883 TRACE("(%p)\n", this);
2884 return basic_streambuf_wchar__Gnavail(this) ?
2885 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2888 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2889 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2890 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2891 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2892 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2893 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2895 TRACE("(%p)\n", this);
2896 return basic_streambuf_wchar__Gnavail(this) ?
2897 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2900 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2901 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2902 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2903 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2904 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2905 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2907 TRACE("(%p)\n", this);
2909 if(basic_streambuf_wchar__Gnavail(this) > 1)
2910 return *basic_streambuf_wchar__Gnpreinc(this);
2911 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2912 WEOF : basic_streambuf_wchar_sgetc(this);
2915 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2916 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2917 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2918 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2919 #if STREAMSIZE_BITS == 64
2920 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2921 #else
2922 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2923 #endif
2924 #if _MSVCP_VER >= 100
2925 #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))
2926 #elif _MSVCP_VER >= 80
2927 #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))
2928 #else
2929 #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))
2930 #endif
2931 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2933 streamsize copied, chunk;
2935 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2937 for(copied=0; copied<count;) {
2938 chunk = basic_streambuf_wchar__Pnavail(this);
2939 if(chunk > count-copied)
2940 chunk = count-copied;
2942 if(chunk > 0) {
2943 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2944 *this->pwpos += chunk;
2945 *this->pwsize -= chunk;
2946 copied += chunk;
2947 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2948 copied++;
2949 }else {
2950 break;
2954 return copied;
2957 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2958 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2959 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2960 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2961 #if STREAMSIZE_BITS == 64
2962 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2963 #else
2964 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2965 #endif
2966 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2968 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2969 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2972 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
2973 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
2974 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2975 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2976 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8)
2977 void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r)
2979 wchar_t *wfirst, *wnext, *wlast, *rfirst, *rnext, *rlast;
2980 #if _MSVCP_VER < 70
2981 locale loc;
2982 #else
2983 locale *loc;
2984 #endif
2986 TRACE("(%p %p)\n", this, r);
2988 if(this == r)
2989 return;
2991 wfirst = *this->pwbuf;
2992 wnext = *this->pwpos;
2993 wlast = *this->pwpos + *this->pwsize;
2994 rfirst = *this->prbuf;
2995 rnext = *this->prpos;
2996 rlast = *this->prpos + *this->prsize;
2997 loc = this->loc;
2999 basic_streambuf_wchar_setp_next(this, *r->pwbuf, *r->pwpos, *r->pwpos + *r->pwsize);
3000 basic_streambuf_wchar_setg(this, *r->prbuf, *r->prpos, *r->prpos + *r->prsize);
3001 this->loc = r->loc;
3003 basic_streambuf_wchar_setp_next(r, wfirst, wnext, wlast);
3004 basic_streambuf_wchar_setg(r, rfirst, rnext, rlast);
3005 r->loc = loc;
3008 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3009 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3010 #if _MSVCP_VER >= 140
3011 _Mbstatet basic_filebuf_char__Init__Stinit = {0};
3012 #else
3013 _Mbstatet basic_filebuf_char__Init__Stinit = 0;
3014 #endif
3016 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3017 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3018 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
3019 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
3021 TRACE("(%p %p %d)\n", this, file, which);
3023 this->cvt = NULL;
3024 this->wrotesome = FALSE;
3025 this->state = basic_filebuf_char__Init__Stinit;
3026 this->close = (which == INITFL_open);
3027 this->file = file;
3029 basic_streambuf_char__Init_empty(&this->base);
3030 if(file)
3031 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
3032 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
3035 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
3036 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
3037 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt_cvt, 8)
3038 void __thiscall basic_filebuf_char__Initcvt_cvt(basic_filebuf_char *this, codecvt_char *cvt)
3040 TRACE("(%p %p)\n", this, cvt);
3042 if(codecvt_base_always_noconv(&cvt->base)) {
3043 this->cvt = NULL;
3044 }else {
3045 basic_streambuf_char__Init_empty(&this->base);
3046 this->cvt = cvt;
3050 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
3051 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
3052 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 4)
3053 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this)
3055 codecvt_char *cvt = codecvt_char_use_facet(IOS_LOCALE(&this->base));
3056 basic_filebuf_char__Initcvt_cvt( this, cvt );
3059 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
3060 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
3061 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Endwrite, 4)
3062 MSVCP_bool __thiscall basic_filebuf_char__Endwrite(basic_filebuf_char *this)
3064 TRACE("(%p)\n", this);
3066 if(!this->wrotesome || !this->cvt)
3067 return TRUE;
3070 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3071 return FALSE;
3073 while(1) {
3074 /* TODO: check if we need a dynamic buffer here */
3075 char buf[128];
3076 char *next;
3077 int ret;
3079 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3080 switch(ret) {
3081 case CODECVT_ok:
3082 this->wrotesome = FALSE;
3083 /* fall through */
3084 case CODECVT_partial:
3085 if(!fwrite(buf, next-buf, 1, this->file))
3086 return FALSE;
3087 if(this->wrotesome)
3088 break;
3089 /* fall through */
3090 case CODECVT_noconv:
3091 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3092 return FALSE;
3093 return TRUE;
3094 default:
3095 return FALSE;
3100 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
3101 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
3102 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
3103 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
3105 basic_filebuf_char *ret = this;
3107 TRACE("(%p)\n", this);
3109 if(!this->file)
3110 return NULL;
3112 /* TODO: handle exceptions */
3113 if(!basic_filebuf_char__Endwrite(this))
3114 ret = NULL;
3115 if(fclose(this->file))
3116 ret = NULL;
3118 basic_filebuf_char__Init(this, NULL, INITFL_close);
3119 return ret;
3122 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
3123 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3124 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
3125 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
3127 TRACE("(%p %p)\n", this, file);
3129 basic_streambuf_char_ctor(&this->base);
3130 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
3132 basic_filebuf_char__Init(this, file, INITFL_new);
3133 return this;
3136 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
3137 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
3138 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
3139 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
3141 return basic_filebuf_char_ctor_file(this, NULL);
3144 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3145 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3146 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
3147 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
3149 TRACE("(%p %d)\n", this, uninitialized);
3151 basic_streambuf_char_ctor(&this->base);
3152 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
3153 return this;
3156 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
3157 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
3158 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
3159 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
3161 TRACE("(%p)\n", this);
3163 if(this->close)
3164 basic_filebuf_char_close(this);
3165 basic_streambuf_char_dtor(&this->base);
3168 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
3169 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
3171 TRACE("(%p %x)\n", this, flags);
3172 if(flags & 2) {
3173 /* we have an array, with the number of elements stored before the first object */
3174 INT_PTR i, *ptr = (INT_PTR *)this-1;
3176 for(i=*ptr-1; i>=0; i--)
3177 basic_filebuf_char_dtor(this+i);
3178 MSVCRT_operator_delete(ptr);
3179 } else {
3180 basic_filebuf_char_dtor(this);
3181 if(flags & 1)
3182 MSVCRT_operator_delete(this);
3185 return this;
3188 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
3189 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
3190 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
3191 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
3193 TRACE("(%p)\n", this);
3194 return this->file != NULL;
3197 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
3198 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
3199 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
3201 static const wchar_t rW[] = {'r',0};
3202 static const struct {
3203 int mode;
3204 const wchar_t str[4];
3205 const wchar_t str_bin[4];
3206 } str_mode[] = {
3207 {OPENMODE_out, {'w',0}, {'w','b',0}},
3208 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
3209 {OPENMODE_app, {'a',0}, {'a','b',0}},
3210 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
3211 {OPENMODE_in, {'r',0}, {'r','b',0}},
3212 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
3213 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
3214 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
3215 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
3218 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
3219 size_t mode_idx;
3220 FILE *f = NULL;
3222 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
3224 for(mode_idx=0; mode_idx<ARRAY_SIZE(str_mode); mode_idx++)
3225 if(str_mode[mode_idx].mode == real_mode)
3226 break;
3227 if(mode_idx == ARRAY_SIZE(str_mode))
3228 return NULL;
3230 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
3231 return NULL;
3232 else if(f)
3233 fclose(f);
3235 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
3236 && (f = _wfopen(name, rW))) {
3237 fclose(f);
3238 return NULL;
3241 #if _MSVCP_VER < 80 /* msvcp60 - msvcp71 are ignoring prot argument */
3242 prot = SH_DENYNO;
3243 #endif
3245 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
3246 : str_mode[mode_idx].str, prot);
3247 if(!f)
3248 return NULL;
3250 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
3251 fclose(f);
3252 return NULL;
3255 return f;
3258 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
3259 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
3260 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
3262 wchar_t nameW[FILENAME_MAX];
3264 TRACE("(%s %d %d)\n", name, mode, prot);
3266 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3267 return NULL;
3268 return _Fiopen_wchar(nameW, mode, prot);
3271 /* ?__Fiopen@std@@YAPAU_iobuf@@PBDH@Z */
3272 /* ?__Fiopen@std@@YAPEAU_iobuf@@PEBDH@Z */
3273 FILE* __cdecl ___Fiopen(const char *name, int mode)
3275 TRACE("(%p %d)\n", name, mode);
3276 return _Fiopen(name, mode, _SH_DENYNO);
3279 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
3280 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3281 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
3282 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3283 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
3284 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
3286 FILE *f = NULL;
3288 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3290 if(basic_filebuf_char_is_open(this))
3291 return NULL;
3293 if(!(f = _Fiopen_wchar(name, mode, prot)))
3294 return NULL;
3296 basic_filebuf_char__Init(this, f, INITFL_open);
3297 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(IOS_LOCALE(&this->base)));
3298 return this;
3301 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
3302 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3303 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
3304 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
3305 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
3306 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
3308 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
3311 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
3312 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3313 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
3314 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
3316 wchar_t nameW[FILENAME_MAX];
3318 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3320 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3321 return NULL;
3322 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
3325 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDF@Z */
3326 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDF@Z */
3327 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
3328 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
3330 TRACE("(%p %p %d)\n", this, name, mode);
3331 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3334 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDH@Z */
3335 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDH@Z */
3336 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
3337 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
3338 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
3339 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
3341 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3344 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3345 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3346 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
3347 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
3349 char buf[8], *dyn_buf;
3350 char ch = c, *to_next;
3351 const char *from_next;
3352 int ret, max_size;
3355 TRACE("(%p %d)\n", this, c);
3357 if(!basic_filebuf_char_is_open(this))
3358 return EOF;
3359 if(c == EOF)
3360 return !c;
3362 if(!this->cvt)
3363 return fputc(ch, this->file);
3365 from_next = &ch;
3366 do {
3367 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3368 &from_next, buf, buf+sizeof(buf), &to_next);
3370 switch(ret) {
3371 case CODECVT_partial:
3372 if(to_next == buf)
3373 break;
3374 /* fall through */
3375 case CODECVT_ok:
3376 if(!fwrite(buf, to_next-buf, 1, this->file))
3377 return EOF;
3378 if(ret == CODECVT_partial)
3379 continue;
3380 return c;
3381 case CODECVT_noconv:
3382 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3383 default:
3384 return EOF;
3387 break;
3388 } while(1);
3390 max_size = codecvt_base_max_length(&this->cvt->base);
3391 dyn_buf = malloc(max_size);
3392 if(!dyn_buf)
3393 return EOF;
3395 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3396 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3398 switch(ret) {
3399 case CODECVT_ok:
3400 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3401 free(dyn_buf);
3402 return ret ? c : EOF;
3403 case CODECVT_partial:
3404 ERR("buffer should be big enough to store all output\n");
3405 /* fall through */
3406 default:
3407 free(dyn_buf);
3408 return EOF;
3412 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3413 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3414 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
3415 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
3417 TRACE("(%p %d)\n", this, c);
3419 if(!basic_filebuf_char_is_open(this))
3420 return EOF;
3422 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
3423 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
3424 basic_streambuf_char__Gndec(&this->base);
3425 return c==EOF ? !c : c;
3426 }else if(c!=EOF && !this->cvt) {
3427 return ungetc(c, this->file);
3430 return EOF;
3433 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3434 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3435 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
3436 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
3438 char ch, buf[128], *to_next;
3439 const char *buf_next;
3440 int c, j;
3441 size_t i;
3443 TRACE("(%p)\n", this);
3445 if(!basic_filebuf_char_is_open(this))
3446 return EOF;
3448 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3449 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
3451 c = fgetc(this->file);
3452 if(!this->cvt || c==EOF)
3453 return c;
3455 buf_next = buf;
3456 for(i=0; i < ARRAY_SIZE(buf); i++) {
3457 buf[i] = c;
3459 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
3460 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3461 case CODECVT_partial:
3462 case CODECVT_ok:
3463 if(to_next == &ch) {
3464 c = fgetc(this->file);
3465 if(c == EOF)
3466 return EOF;
3467 continue;
3470 for(j = --i; j >= buf_next-buf; j--)
3471 ungetc(buf[j], this->file);
3472 return ch;
3473 case CODECVT_noconv:
3474 return (unsigned char)buf[0];
3475 default:
3476 return EOF;
3480 FIXME("buffer is too small\n");
3481 return EOF;
3484 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3485 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3486 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
3487 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
3489 int ret;
3491 TRACE("(%p)\n", this);
3493 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3494 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
3496 ret = call_basic_streambuf_char_uflow(&this->base);
3497 if(ret != EOF)
3498 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
3499 return ret;
3502 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3503 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3504 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3505 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3506 #if STREAMOFF_BITS == 64
3507 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
3508 #else
3509 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
3510 #endif
3511 fpos_mbstatet* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
3512 fpos_mbstatet *ret, streamoff off, int way, int mode)
3514 fpos_t pos;
3516 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3518 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3519 || fseek(this->file, off, way)) {
3520 ret->off = -1;
3521 ret->pos = 0;
3522 memset(&ret->state, 0, sizeof(ret->state));
3523 return ret;
3526 fgetpos(this->file, &pos);
3527 ret->off = 0;
3528 ret->pos = pos;
3529 ret->state = this->state;
3530 return ret;
3533 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3534 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3535 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
3536 fpos_mbstatet* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
3537 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
3539 fpos_t fpos;
3541 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
3543 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3544 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3545 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3546 ret->off = -1;
3547 ret->pos = 0;
3548 memset(&ret->state, 0, sizeof(ret->state));
3549 return ret;
3552 fgetpos(this->file, &fpos);
3553 ret->off = 0;
3554 ret->pos = fpos;
3555 ret->state = this->state;
3556 return ret;
3559 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
3560 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
3561 #if STREAMSIZE_BITS == 64
3562 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
3563 #else
3564 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
3565 #endif
3566 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
3568 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3570 if(!basic_filebuf_char_is_open(this))
3571 return NULL;
3573 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3574 return NULL;
3576 basic_filebuf_char__Init(this, this->file, INITFL_open);
3577 return &this->base;
3580 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3581 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3582 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3583 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3585 TRACE("(%p)\n", this);
3587 if(!basic_filebuf_char_is_open(this))
3588 return 0;
3590 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3591 return 0;
3592 return fflush(this->file);
3595 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
3596 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
3597 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
3598 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
3600 TRACE("(%p %p)\n", this, loc);
3601 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(loc));
3604 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3605 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3606 #if _MSVCP_VER >= 140
3607 _Mbstatet basic_filebuf_wchar__Init__Stinit = {0};
3608 #else
3609 _Mbstatet basic_filebuf_wchar__Init__Stinit = 0;
3610 #endif
3612 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3613 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3614 #if _MSVCP_VER >= 140
3615 _Mbstatet basic_filebuf_short__Init__Stinit = {0};
3616 #else
3617 _Mbstatet basic_filebuf_short__Init__Stinit = 0;
3618 #endif
3620 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3621 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3622 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3623 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3625 TRACE("(%p %p %d)\n", this, file, which);
3627 this->cvt = NULL;
3628 this->wrotesome = FALSE;
3629 this->state = basic_filebuf_wchar__Init__Stinit;
3630 this->close = (which == INITFL_open);
3631 this->file = file;
3633 basic_streambuf_wchar__Init_empty(&this->base);
3636 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3637 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3638 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3639 void __thiscall basic_filebuf_short__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_short__Init__Stinit;
3646 this->close = (which == INITFL_open);
3647 this->file = file;
3649 basic_streambuf_wchar__Init_empty(&this->base);
3652 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
3653 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
3654 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
3655 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
3656 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt_cvt, 8)
3657 void __thiscall basic_filebuf_wchar__Initcvt_cvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
3659 TRACE("(%p %p)\n", this, cvt);
3661 if(codecvt_base_always_noconv(&cvt->base)) {
3662 this->cvt = NULL;
3663 }else {
3664 basic_streambuf_wchar__Init_empty(&this->base);
3665 this->cvt = cvt;
3669 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
3670 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
3671 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 4)
3672 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this)
3674 codecvt_wchar *cvt = codecvt_wchar_use_facet(IOS_LOCALE(&this->base));
3675 basic_filebuf_wchar__Initcvt_cvt( this, cvt );
3678 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAE_NXZ */
3679 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAA_NXZ */
3680 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAE_NXZ */
3681 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAA_NXZ */
3682 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Endwrite, 4)
3683 MSVCP_bool __thiscall basic_filebuf_wchar__Endwrite(basic_filebuf_wchar *this)
3685 TRACE("(%p)\n", this);
3687 if(!this->wrotesome || !this->cvt)
3688 return TRUE;
3690 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3691 return FALSE;
3693 while(1) {
3694 /* TODO: check if we need a dynamic buffer here */
3695 char buf[128];
3696 char *next;
3697 int ret;
3699 ret = codecvt_wchar_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3700 switch(ret) {
3701 case CODECVT_ok:
3702 this->wrotesome = FALSE;
3703 /* fall through */
3704 case CODECVT_partial:
3705 if(!fwrite(buf, next-buf, 1, this->file))
3706 return FALSE;
3707 if(this->wrotesome)
3708 break;
3709 /* fall through */
3710 case CODECVT_noconv:
3711 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3712 return FALSE;
3713 return TRUE;
3714 default:
3715 return FALSE;
3720 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3721 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3722 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3723 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3724 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3725 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3727 basic_filebuf_wchar *ret = this;
3729 TRACE("(%p)\n", this);
3731 if(!this->file)
3732 return NULL;
3734 /* TODO: handle exceptions */
3735 if(!basic_filebuf_wchar__Endwrite(this))
3736 ret = NULL;
3737 if(fclose(this->file))
3738 ret = NULL;
3740 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3741 return ret;
3744 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3745 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3746 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3747 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3749 TRACE("(%p %p)\n", this, file);
3751 basic_streambuf_wchar_ctor(&this->base);
3752 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3754 basic_filebuf_wchar__Init(this, file, INITFL_new);
3755 return this;
3758 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3759 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3760 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3761 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3763 TRACE("(%p %p)\n", this, file);
3765 basic_streambuf_short_ctor(&this->base);
3766 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3768 basic_filebuf_short__Init(this, file, INITFL_new);
3769 return this;
3772 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3773 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3774 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3775 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3777 return basic_filebuf_wchar_ctor_file(this, NULL);
3780 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3781 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3782 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3783 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3785 return basic_filebuf_short_ctor_file(this, NULL);
3788 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3789 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3790 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3791 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3793 TRACE("(%p %d)\n", this, uninitialized);
3795 basic_streambuf_wchar_ctor(&this->base);
3796 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3797 return this;
3800 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3801 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3802 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3803 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3805 TRACE("(%p %d)\n", this, uninitialized);
3807 basic_streambuf_short_ctor(&this->base);
3808 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3809 return this;
3812 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3813 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3814 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3815 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3816 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3817 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3819 TRACE("(%p)\n", this);
3821 if(this->close)
3822 basic_filebuf_wchar_close(this);
3823 basic_streambuf_wchar_dtor(&this->base);
3826 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3827 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3829 TRACE("(%p %x)\n", this, flags);
3830 if(flags & 2) {
3831 /* we have an array, with the number of elements stored before the first object */
3832 INT_PTR i, *ptr = (INT_PTR *)this-1;
3834 for(i=*ptr-1; i>=0; i--)
3835 basic_filebuf_wchar_dtor(this+i);
3836 MSVCRT_operator_delete(ptr);
3837 } else {
3838 basic_filebuf_wchar_dtor(this);
3839 if(flags & 1)
3840 MSVCRT_operator_delete(this);
3843 return this;
3846 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3847 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3848 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3849 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3850 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3851 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3853 TRACE("(%p)\n", this);
3854 return this->file != NULL;
3857 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3858 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3859 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3860 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3861 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3862 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3864 FILE *f = NULL;
3866 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3868 if(basic_filebuf_wchar_is_open(this))
3869 return NULL;
3871 if(!(f = _Fiopen_wchar(name, mode, prot)))
3872 return NULL;
3874 basic_filebuf_wchar__Init(this, f, INITFL_open);
3875 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(IOS_LOCALE(&this->base)));
3876 return this;
3879 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3880 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3881 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3882 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3883 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3884 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3886 FILE *f = NULL;
3888 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3890 if(basic_filebuf_wchar_is_open(this))
3891 return NULL;
3893 if(!(f = _Fiopen_wchar(name, mode, prot)))
3894 return NULL;
3896 basic_filebuf_short__Init(this, f, INITFL_open);
3897 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(IOS_LOCALE(&this->base)));
3898 return this;
3901 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3902 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3903 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3904 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3905 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3906 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3908 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3911 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3912 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3913 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3914 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3915 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3916 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3918 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3921 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3922 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3923 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3924 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3926 wchar_t nameW[FILENAME_MAX];
3928 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3930 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3931 return NULL;
3932 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3935 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3936 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3937 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3938 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3940 wchar_t nameW[FILENAME_MAX];
3942 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3944 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3945 return NULL;
3946 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3949 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
3950 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
3951 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
3952 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
3954 TRACE("(%p %p %d)\n", this, name, mode);
3955 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3958 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
3959 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
3960 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3961 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3962 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3963 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3965 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3968 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3969 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3970 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3971 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3973 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3976 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3977 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3978 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3979 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3980 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3981 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3983 char buf[8], *dyn_buf, *to_next;
3984 wchar_t ch = c;
3985 const wchar_t *from_next;
3986 int max_size;
3987 unsigned short ret;
3990 TRACE("(%p %d)\n", this, c);
3992 if(!basic_filebuf_wchar_is_open(this))
3993 return WEOF;
3994 if(c == WEOF)
3995 return !c;
3997 if(!this->cvt)
3998 return fputwc(ch, this->file);
4000 from_next = &ch;
4001 do {
4002 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
4003 &from_next, buf, buf+sizeof(buf), &to_next);
4005 switch(ret) {
4006 case CODECVT_partial:
4007 if(to_next == buf)
4008 break;
4009 /* fall through */
4010 case CODECVT_ok:
4011 if(!fwrite(buf, to_next-buf, 1, this->file))
4012 return WEOF;
4013 if(ret == CODECVT_partial)
4014 continue;
4015 return c;
4016 case CODECVT_noconv:
4017 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
4018 default:
4019 return WEOF;
4022 break;
4023 } while(1);
4025 max_size = codecvt_base_max_length(&this->cvt->base);
4026 dyn_buf = malloc(max_size);
4027 if(!dyn_buf)
4028 return WEOF;
4030 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
4031 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
4033 switch(ret) {
4034 case CODECVT_ok:
4035 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
4036 free(dyn_buf);
4037 return ret ? c : WEOF;
4038 case CODECVT_partial:
4039 ERR("buffer should be big enough to store all output\n");
4040 /* fall through */
4041 default:
4042 free(dyn_buf);
4043 return WEOF;
4047 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
4048 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
4049 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
4050 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
4051 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
4052 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
4054 TRACE("(%p %d)\n", this, c);
4056 if(!basic_filebuf_wchar_is_open(this))
4057 return WEOF;
4059 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
4060 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
4061 basic_streambuf_wchar__Gndec(&this->base);
4062 return c==WEOF ? !c : c;
4063 }else if(c!=WEOF && !this->cvt) {
4064 return ungetwc(c, this->file);
4065 }else if(c!=WEOF && basic_streambuf_wchar_gptr(&this->base)!=&this->putback) {
4066 this->putback = c;
4067 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback, &this->putback+1);
4068 return c;
4071 return WEOF;
4074 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
4075 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
4076 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
4077 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
4078 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
4079 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
4081 wchar_t ch, *to_next;
4082 char buf[128];
4083 const char *buf_next;
4084 int c, j;
4085 size_t i;
4087 TRACE("(%p)\n", this);
4089 if(!basic_filebuf_wchar_is_open(this))
4090 return WEOF;
4092 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
4093 return *basic_streambuf_wchar__Gninc(&this->base);
4095 if(!this->cvt)
4096 return fgetwc(this->file);
4098 buf_next = buf;
4099 for(i=0; i < ARRAY_SIZE(buf); i++) {
4100 if((c = fgetc(this->file)) == EOF)
4101 return WEOF;
4102 buf[i] = c;
4104 switch(codecvt_wchar_in(this->cvt, &this->state, buf_next,
4105 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
4106 case CODECVT_partial:
4107 case CODECVT_ok:
4108 if(to_next == &ch)
4109 continue;
4111 for(j = --i; j >= buf_next-buf; j--)
4112 ungetc(buf[j], this->file);
4113 return ch;
4114 case CODECVT_noconv:
4115 if(i+1 < sizeof(wchar_t))
4116 continue;
4118 memcpy(&ch, buf, sizeof(wchar_t));
4119 return ch;
4120 default:
4121 return WEOF;
4125 FIXME("buffer is too small\n");
4126 return WEOF;
4129 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
4130 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
4131 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
4132 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
4133 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
4134 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
4136 unsigned short ret;
4138 TRACE("(%p)\n", this);
4140 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
4141 return *basic_streambuf_wchar_gptr(&this->base);
4143 ret = call_basic_streambuf_wchar_uflow(&this->base);
4144 if(ret != WEOF)
4145 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
4146 return ret;
4149 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4150 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4151 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4152 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4153 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4154 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4155 #if STREAMOFF_BITS == 64
4156 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
4157 #else
4158 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
4159 #endif
4160 fpos_mbstatet* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
4161 fpos_mbstatet *ret, streamoff off, int way, int mode)
4163 fpos_t pos;
4165 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4167 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback) {
4168 if(way == SEEKDIR_cur)
4169 off -= sizeof(wchar_t);
4171 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
4174 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
4175 || fseek(this->file, off, way)) {
4176 ret->off = -1;
4177 ret->pos = 0;
4178 memset(&ret->state, 0, sizeof(ret->state));
4179 return ret;
4182 fgetpos(this->file, &pos);
4183 ret->off = 0;
4184 ret->pos = pos;
4185 ret->state = this->state;
4186 return ret;
4189 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4190 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4191 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4192 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4193 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
4194 fpos_mbstatet* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
4195 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
4197 fpos_t fpos;
4199 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
4201 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
4202 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
4203 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
4204 ret->off = -1;
4205 ret->pos = 0;
4206 memset(&ret->state, 0, sizeof(ret->state));
4207 return ret;
4210 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback)
4211 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
4213 fgetpos(this->file, &fpos);
4214 ret->off = 0;
4215 ret->pos = fpos;
4216 ret->state = this->state;
4217 return ret;
4220 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
4221 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
4222 #if STREAMSIZE_BITS == 64
4223 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
4224 #else
4225 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
4226 #endif
4227 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
4229 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
4231 if(!basic_filebuf_wchar_is_open(this))
4232 return NULL;
4234 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
4235 return NULL;
4237 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
4238 return &this->base;
4241 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
4242 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
4243 #if STREAMSIZE_BITS == 64
4244 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
4245 #else
4246 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
4247 #endif
4248 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
4250 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
4252 if(!basic_filebuf_wchar_is_open(this))
4253 return NULL;
4255 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
4256 return NULL;
4258 basic_filebuf_short__Init(this, this->file, INITFL_open);
4259 return &this->base;
4262 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
4263 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
4264 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
4265 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
4266 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
4267 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
4269 TRACE("(%p)\n", this);
4271 if(!basic_filebuf_wchar_is_open(this))
4272 return 0;
4274 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
4275 return 0;
4276 return fflush(this->file);
4279 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
4280 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
4281 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
4282 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
4284 TRACE("(%p %p)\n", this, loc);
4285 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(loc));
4288 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
4289 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
4290 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
4291 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
4293 TRACE("(%p %p)\n", this, loc);
4294 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(loc));
4297 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
4298 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
4299 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
4300 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
4301 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
4302 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
4304 int state = 0;
4306 if(!(mode & OPENMODE_in))
4307 state |= STRINGBUF_no_read;
4309 if(!(mode & OPENMODE_out))
4310 state |= STRINGBUF_no_write;
4312 if(mode & OPENMODE_ate)
4313 state |= STRINGBUF_at_end;
4315 if(mode & OPENMODE_app)
4316 state |= STRINGBUF_append;
4318 return state;
4321 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
4322 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
4323 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
4324 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
4326 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
4328 basic_streambuf_char__Init_empty(&this->base);
4330 this->state = state;
4331 this->seekhigh = NULL;
4333 if(count && str) {
4334 char *buf = MSVCRT_operator_new(count);
4335 if(!buf) {
4336 ERR("Out of memory\n");
4337 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4340 memcpy(buf, str, count);
4341 this->seekhigh = buf + count;
4343 this->state |= STRINGBUF_allocated;
4345 if(!(state & STRINGBUF_no_read))
4346 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
4348 if(!(state & STRINGBUF_no_write)) {
4349 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4351 if(!basic_streambuf_char_gptr(&this->base))
4352 basic_streambuf_char_setg(&this->base, buf, 0, buf);
4357 /* ??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 */
4358 /* ??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 */
4359 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
4360 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
4361 const basic_string_char *str, IOSB_openmode mode)
4363 TRACE("(%p %p %d)\n", this, str, mode);
4365 basic_streambuf_char_ctor(&this->base);
4366 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4368 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
4369 str->size, basic_stringbuf_char__Getstate(this, mode));
4370 return this;
4373 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
4374 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
4375 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
4376 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
4377 basic_stringbuf_char *this, IOSB_openmode mode)
4379 TRACE("(%p %d)\n", this, mode);
4381 basic_streambuf_char_ctor(&this->base);
4382 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4384 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
4385 return this;
4388 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
4389 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
4390 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
4391 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
4393 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4396 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
4397 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
4398 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
4399 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
4401 TRACE("(%p)\n", this);
4403 if(this->state & STRINGBUF_allocated) {
4404 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
4405 this->seekhigh = NULL;
4406 this->state &= ~STRINGBUF_allocated;
4409 basic_streambuf_char__Init_empty(&this->base);
4412 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
4413 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
4414 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
4415 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
4417 TRACE("(%p)\n", this);
4419 basic_stringbuf_char__Tidy(this);
4420 basic_streambuf_char_dtor(&this->base);
4423 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
4424 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
4426 TRACE("(%p %x)\n", this, flags);
4428 if(flags & 2) {
4429 /* we have an array, with the number of elements stored before the first object */
4430 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4432 for (i = *ptr - 1; i >= 0; i--)
4433 basic_stringbuf_char_dtor(this+i);
4435 MSVCRT_operator_delete(ptr);
4436 }else {
4437 basic_stringbuf_char_dtor(this);
4439 if(flags & 1)
4440 MSVCRT_operator_delete(this);
4443 return this;
4446 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4447 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4448 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
4449 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
4451 MSVCP_size_t oldsize, size;
4452 char *ptr, *buf;
4454 TRACE("(%p %x)\n", this, meta);
4456 if(meta == EOF)
4457 return !EOF;
4458 if(this->state & STRINGBUF_no_write)
4459 return EOF;
4461 ptr = basic_streambuf_char_pptr(&this->base);
4462 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4463 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
4464 this->seekhigh, basic_streambuf_char_epptr(&this->base));
4466 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
4467 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4469 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
4470 size = oldsize|0xf;
4471 size += size/2;
4472 buf = MSVCRT_operator_new(size);
4473 if(!buf) {
4474 ERR("Out of memory\n");
4475 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4478 if(!oldsize) {
4479 this->seekhigh = buf;
4480 basic_streambuf_char_setp(&this->base, buf, buf+size);
4481 if(this->state & STRINGBUF_no_read)
4482 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4483 else
4484 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
4486 this->state |= STRINGBUF_allocated;
4487 }else {
4488 ptr = basic_streambuf_char_eback(&this->base);
4489 memcpy(buf, ptr, oldsize);
4491 this->seekhigh = buf+(this->seekhigh-ptr);
4492 basic_streambuf_char_setp_next(&this->base, buf,
4493 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
4494 if(this->state & STRINGBUF_no_read)
4495 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4496 else
4497 basic_streambuf_char_setg(&this->base, buf,
4498 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
4499 basic_streambuf_char_pptr(&this->base)+1);
4501 MSVCRT_operator_delete(ptr);
4504 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4507 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4508 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4509 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
4510 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
4512 char *cur;
4514 TRACE("(%p %x)\n", this, c);
4516 cur = basic_streambuf_char_gptr(&this->base);
4517 if(!cur || cur==basic_streambuf_char_eback(&this->base)
4518 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4519 return EOF;
4521 if(c != EOF)
4522 cur[-1] = c;
4523 basic_streambuf_char_gbump(&this->base, -1);
4524 return c==EOF ? !EOF : c;
4527 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
4528 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
4529 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
4530 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
4532 char *ptr, *cur;
4534 TRACE("(%p)\n", this);
4536 cur = basic_streambuf_char_gptr(&this->base);
4537 if(!cur || this->state&STRINGBUF_no_read)
4538 return EOF;
4540 ptr = basic_streambuf_char_pptr(&this->base);
4541 if(this->seekhigh < ptr)
4542 this->seekhigh = ptr;
4544 ptr = basic_streambuf_char_egptr(&this->base);
4545 if(this->seekhigh > ptr)
4546 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
4548 if(cur < this->seekhigh)
4549 return (unsigned char)*cur;
4550 return EOF;
4553 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4554 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4555 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4556 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4557 #if STREAMOFF_BITS == 64
4558 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
4559 #else
4560 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
4561 #endif
4562 fpos_mbstatet* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
4563 fpos_mbstatet *ret, streamoff off, int way, int mode)
4565 char *beg, *cur_r, *cur_w;
4567 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4569 cur_w = basic_streambuf_char_pptr(&this->base);
4570 if(cur_w > this->seekhigh)
4571 this->seekhigh = cur_w;
4573 ret->off = 0;
4574 ret->pos = 0;
4575 memset(&ret->state, 0, sizeof(ret->state));
4577 beg = basic_streambuf_char_eback(&this->base);
4578 cur_r = basic_streambuf_char_gptr(&this->base);
4579 if((mode & OPENMODE_in) && cur_r) {
4580 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4581 off += cur_r-beg;
4582 else if(way == SEEKDIR_end)
4583 off += this->seekhigh-beg;
4584 else if(way != SEEKDIR_beg)
4585 off = -1;
4587 if(off<0 || off>this->seekhigh-beg) {
4588 off = -1;
4589 }else {
4590 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
4591 if((mode & OPENMODE_out) && cur_w) {
4592 basic_streambuf_char_setp_next(&this->base, beg,
4593 basic_streambuf_char_gptr(&this->base),
4594 basic_streambuf_char_epptr(&this->base));
4597 }else if((mode & OPENMODE_out) && cur_w) {
4598 if(way == SEEKDIR_cur)
4599 off += cur_w-beg;
4600 else if(way == SEEKDIR_end)
4601 off += this->seekhigh-beg;
4602 else if(way != SEEKDIR_beg)
4603 off = -1;
4605 if(off<0 || off>this->seekhigh-beg)
4606 off = -1;
4607 else
4608 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
4609 }else {
4610 off = -1;
4613 ret->off = off;
4614 return ret;
4617 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4618 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4619 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
4620 fpos_mbstatet* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
4621 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
4623 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
4625 if(pos.off==-1 && pos.pos==0 && MBSTATET_TO_INT(&pos.state)==0) {
4626 *ret = pos;
4627 return ret;
4630 return basic_stringbuf_char_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4633 /* ?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 */
4634 /* ?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 */
4635 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
4636 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
4638 TRACE("(%p %p)\n", this, str);
4640 basic_stringbuf_char__Tidy(this);
4641 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
4644 /* ?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 */
4645 /* ?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 */
4646 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
4647 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
4649 char *ptr;
4651 TRACE("(%p)\n", this);
4653 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
4654 char *pptr;
4656 ptr = basic_streambuf_char_pbase(&this->base);
4657 pptr = basic_streambuf_char_pptr(&this->base);
4659 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4662 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
4663 ptr = basic_streambuf_char_eback(&this->base);
4664 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
4667 return MSVCP_basic_string_char_ctor(ret);
4670 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
4671 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
4672 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4673 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4674 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4675 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4676 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
4677 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
4679 int state = 0;
4681 if(!(mode & OPENMODE_in))
4682 state |= STRINGBUF_no_read;
4684 if(!(mode & OPENMODE_out))
4685 state |= STRINGBUF_no_write;
4687 if(mode & OPENMODE_ate)
4688 state |= STRINGBUF_at_end;
4690 if(mode & OPENMODE_app)
4691 state |= STRINGBUF_append;
4693 return state;
4696 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
4697 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
4698 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
4699 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
4700 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
4701 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
4703 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
4705 basic_streambuf_wchar__Init_empty(&this->base);
4707 this->state = state;
4708 this->seekhigh = NULL;
4710 if(count && str) {
4711 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
4712 if(!buf) {
4713 ERR("Out of memory\n");
4714 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4717 memcpy(buf, str, count*sizeof(wchar_t));
4718 this->seekhigh = buf + count;
4720 this->state |= STRINGBUF_allocated;
4722 if(!(state & STRINGBUF_no_read))
4723 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
4725 if(!(state & STRINGBUF_no_write)) {
4726 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4728 if(!basic_streambuf_wchar_gptr(&this->base))
4729 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
4734 /* ??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 */
4735 /* ??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 */
4736 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
4737 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
4738 const basic_string_wchar *str, IOSB_openmode mode)
4740 TRACE("(%p %p %d)\n", this, str, mode);
4742 basic_streambuf_wchar_ctor(&this->base);
4743 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4745 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
4746 str->size, basic_stringbuf_wchar__Getstate(this, mode));
4747 return this;
4750 /* ??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 */
4751 /* ??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 */
4752 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
4753 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
4754 const basic_string_wchar *str, IOSB_openmode mode)
4756 basic_stringbuf_wchar_ctor_str(this, str, mode);
4757 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4758 return this;
4761 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4762 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4763 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4764 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4765 basic_stringbuf_wchar *this, IOSB_openmode mode)
4767 TRACE("(%p %d)\n", this, mode);
4769 basic_streambuf_wchar_ctor(&this->base);
4770 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4772 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4773 return this;
4776 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4777 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4778 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4779 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4780 basic_stringbuf_wchar *this, IOSB_openmode mode)
4782 basic_stringbuf_wchar_ctor_mode(this, mode);
4783 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4784 return this;
4787 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4788 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4789 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4790 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4792 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4795 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4796 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4797 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4798 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4800 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4803 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4804 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4805 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4806 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4807 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4808 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4810 TRACE("(%p)\n", this);
4812 if(this->state & STRINGBUF_allocated) {
4813 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4814 this->seekhigh = NULL;
4815 this->state &= ~STRINGBUF_allocated;
4818 basic_streambuf_wchar__Init_empty(&this->base);
4821 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4822 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4823 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4824 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4825 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4826 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4828 TRACE("(%p)\n", this);
4830 basic_stringbuf_wchar__Tidy(this);
4831 basic_streambuf_wchar_dtor(&this->base);
4834 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4835 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4837 TRACE("(%p %x)\n", this, flags);
4839 if(flags & 2) {
4840 /* we have an array, with the number of elements stored before the first object */
4841 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4843 for (i = *ptr - 1; i >= 0; i--)
4844 basic_stringbuf_wchar_dtor(this+i);
4846 MSVCRT_operator_delete(ptr);
4847 }else {
4848 basic_stringbuf_wchar_dtor(this);
4850 if(flags & 1)
4851 MSVCRT_operator_delete(this);
4854 return this;
4857 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4858 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4859 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4860 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4861 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4862 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4864 MSVCP_size_t oldsize, size;
4865 wchar_t *ptr, *buf;
4867 TRACE("(%p %x)\n", this, meta);
4869 if(meta == WEOF)
4870 return !WEOF;
4871 if(this->state & STRINGBUF_no_write)
4872 return WEOF;
4874 ptr = basic_streambuf_wchar_pptr(&this->base);
4875 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4876 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4877 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4879 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4880 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4882 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4883 size = oldsize|0xf;
4884 size += size/2;
4885 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4886 if(!buf) {
4887 ERR("Out of memory\n");
4888 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4891 if(!oldsize) {
4892 this->seekhigh = buf;
4893 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4894 if(this->state & STRINGBUF_no_read)
4895 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4896 else
4897 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4899 this->state |= STRINGBUF_allocated;
4900 }else {
4901 ptr = basic_streambuf_wchar_eback(&this->base);
4902 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4904 this->seekhigh = buf+(this->seekhigh-ptr);
4905 basic_streambuf_wchar_setp_next(&this->base, buf,
4906 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4907 if(this->state & STRINGBUF_no_read)
4908 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4909 else
4910 basic_streambuf_wchar_setg(&this->base, buf,
4911 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4912 basic_streambuf_wchar_pptr(&this->base)+1);
4914 MSVCRT_operator_delete(ptr);
4917 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4920 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4921 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4922 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4923 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4924 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4925 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4927 wchar_t *cur;
4929 TRACE("(%p %x)\n", this, c);
4931 cur = basic_streambuf_wchar_gptr(&this->base);
4932 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4933 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4934 return WEOF;
4936 if(c != WEOF)
4937 cur[-1] = c;
4938 basic_streambuf_wchar_gbump(&this->base, -1);
4939 return c==WEOF ? !WEOF : c;
4942 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4943 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4944 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4945 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4946 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4947 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4949 wchar_t *ptr, *cur;
4951 TRACE("(%p)\n", this);
4953 cur = basic_streambuf_wchar_gptr(&this->base);
4954 if(!cur || this->state&STRINGBUF_no_read)
4955 return WEOF;
4957 ptr = basic_streambuf_wchar_pptr(&this->base);
4958 if(this->seekhigh < ptr)
4959 this->seekhigh = ptr;
4961 ptr = basic_streambuf_wchar_egptr(&this->base);
4962 if(this->seekhigh > ptr)
4963 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4965 if(cur < this->seekhigh)
4966 return *cur;
4967 return WEOF;
4970 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4971 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4972 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4973 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4974 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4975 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4976 #if STREAMOFF_BITS == 64
4977 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4978 #else
4979 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4980 #endif
4981 fpos_mbstatet* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4982 fpos_mbstatet *ret, streamoff off, int way, int mode)
4984 wchar_t *beg, *cur_r, *cur_w;
4986 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4988 cur_w = basic_streambuf_wchar_pptr(&this->base);
4989 if(cur_w > this->seekhigh)
4990 this->seekhigh = cur_w;
4992 ret->off = 0;
4993 ret->pos = 0;
4994 memset(&ret->state, 0, sizeof(ret->state));
4996 beg = basic_streambuf_wchar_eback(&this->base);
4997 cur_r = basic_streambuf_wchar_gptr(&this->base);
4998 if((mode & OPENMODE_in) && cur_r) {
4999 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
5000 off += cur_r-beg;
5001 else if(way == SEEKDIR_end)
5002 off += this->seekhigh-beg;
5003 else if(way != SEEKDIR_beg)
5004 off = -1;
5006 if(off<0 || off>this->seekhigh-beg) {
5007 off = -1;
5008 }else {
5009 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
5010 if((mode & OPENMODE_out) && cur_w) {
5011 basic_streambuf_wchar_setp_next(&this->base, beg,
5012 basic_streambuf_wchar_gptr(&this->base),
5013 basic_streambuf_wchar_epptr(&this->base));
5016 }else if((mode & OPENMODE_out) && cur_w) {
5017 if(way == SEEKDIR_cur)
5018 off += cur_w-beg;
5019 else if(way == SEEKDIR_end)
5020 off += this->seekhigh-beg;
5021 else if(way != SEEKDIR_beg)
5022 off = -1;
5024 if(off<0 || off>this->seekhigh-beg)
5025 off = -1;
5026 else
5027 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
5028 }else {
5029 off = -1;
5032 ret->off = off;
5033 return ret;
5036 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
5037 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
5038 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
5039 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
5040 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
5041 fpos_mbstatet* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
5042 fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
5044 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
5046 if(pos.off==-1 && pos.pos==0 && MBSTATET_TO_INT(&pos.state)==0) {
5047 *ret = pos;
5048 return ret;
5051 return basic_stringbuf_wchar_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
5054 /* ?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 */
5055 /* ?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 */
5056 /* ?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 */
5057 /* ?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 */
5058 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
5059 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
5061 TRACE("(%p %p)\n", this, str);
5063 basic_stringbuf_wchar__Tidy(this);
5064 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
5067 /* ?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 */
5068 /* ?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 */
5069 /* ?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 */
5070 /* ?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 */
5071 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
5072 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
5074 wchar_t *ptr;
5076 TRACE("(%p)\n", this);
5078 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
5079 wchar_t *pptr;
5081 ptr = basic_streambuf_wchar_pbase(&this->base);
5082 pptr = basic_streambuf_wchar_pptr(&this->base);
5084 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
5087 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
5088 ptr = basic_streambuf_wchar_eback(&this->base);
5089 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
5092 return MSVCP_basic_string_wchar_ctor(ret);
5095 /* ??0ios_base@std@@IAE@XZ */
5096 /* ??0ios_base@std@@IEAA@XZ */
5097 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
5098 ios_base* __thiscall ios_base_ctor(ios_base *this)
5100 TRACE("(%p)\n", this);
5101 this->vtable = &MSVCP_ios_base_vtable;
5102 return this;
5105 /* ??0ios_base@std@@QAE@ABV01@@Z */
5106 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
5107 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
5108 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
5110 TRACE("(%p %p)\n", this, copy);
5111 *this = *copy;
5112 this->vtable = &MSVCP_ios_base_vtable;
5113 return this;
5116 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
5117 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
5118 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
5119 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
5121 IOS_BASE_fnarray *cur;
5123 TRACE("(%p %x)\n", this, event);
5125 for(cur=this->calls; cur; cur=cur->next)
5126 cur->event_handler(event, this, cur->index);
5129 /* ?_Tidy@ios_base@std@@AAAXXZ */
5130 /* ?_Tidy@ios_base@std@@AEAAXXZ */
5131 void __cdecl ios_base_Tidy(ios_base *this)
5133 IOS_BASE_iosarray *arr_cur, *arr_next;
5134 IOS_BASE_fnarray *event_cur, *event_next;
5136 TRACE("(%p)\n", this);
5138 ios_base_Callfns(this, EVENT_erase_event);
5140 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
5141 arr_next = arr_cur->next;
5142 MSVCRT_operator_delete(arr_cur);
5144 this->arr = NULL;
5146 for(event_cur=this->calls; event_cur; event_cur=event_next) {
5147 event_next = event_cur->next;
5148 MSVCRT_operator_delete(event_cur);
5150 this->calls = NULL;
5153 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
5154 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
5155 void __cdecl ios_base_Ios_base_dtor(ios_base *obj)
5157 TRACE("(%p)\n", obj);
5158 locale_dtor(IOS_LOCALE(obj));
5159 #if _MSVCP_VER >= 70
5160 MSVCRT_operator_delete(obj->loc);
5161 #endif
5162 ios_base_Tidy(obj);
5165 /* ??1ios_base@std@@UAE@XZ */
5166 /* ??1ios_base@std@@UEAA@XZ */
5167 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
5168 void __thiscall ios_base_dtor(ios_base *this)
5170 ios_base_Ios_base_dtor(this);
5173 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
5174 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
5176 TRACE("(%p %x)\n", this, flags);
5177 if(flags & 2) {
5178 /* we have an array, with the number of elements stored before the first object */
5179 INT_PTR i, *ptr = (INT_PTR *)this-1;
5181 for(i=*ptr-1; i>=0; i--)
5182 ios_base_dtor(this+i);
5183 MSVCRT_operator_delete(ptr);
5184 } else {
5185 ios_base_dtor(this);
5186 if(flags & 1)
5187 MSVCRT_operator_delete(this);
5190 return this;
5193 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
5194 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
5196 TRACE("(%p %x)\n", this, flags);
5197 if(flags & 2) {
5198 INT_PTR *ptr = (INT_PTR *)this-1;
5199 MSVCRT_operator_delete(ptr);
5200 } else {
5201 if(flags & 1)
5202 MSVCRT_operator_delete(this);
5205 return this;
5208 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
5209 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
5210 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
5211 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
5213 IOS_BASE_iosarray *p;
5215 TRACE("(%p %d)\n", this, index);
5217 for(p=this->arr; p; p=p->next) {
5218 if(p->index == index)
5219 return p;
5222 for(p=this->arr; p; p=p->next) {
5223 if(!p->long_val && !p->ptr_val) {
5224 p->index = index;
5225 return p;
5229 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
5230 p->next = this->arr;
5231 p->index = index;
5232 p->long_val = 0;
5233 p->ptr_val = NULL;
5234 this->arr = p;
5235 return p;
5238 /* ?iword@ios_base@std@@QAEAAJH@Z */
5239 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
5240 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
5241 LONG* __thiscall ios_base_iword(ios_base *this, int index)
5243 TRACE("(%p %d)\n", this, index);
5244 return &ios_base_Findarr(this, index)->long_val;
5247 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
5248 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
5249 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
5250 void** __thiscall ios_base_pword(ios_base *this, int index)
5252 TRACE("(%p %d)\n", this, index);
5253 return &ios_base_Findarr(this, index)->ptr_val;
5256 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
5257 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
5258 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
5259 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
5261 IOS_BASE_fnarray *event;
5263 TRACE("(%p %p %d)\n", this, callback, index);
5265 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
5266 event->next = this->calls;
5267 event->index = index;
5268 event->event_handler = callback;
5269 this->calls = event;
5272 /* ?clear@ios_base@std@@QAEXH_N@Z */
5273 /* ?clear@ios_base@std@@QEAAXH_N@Z */
5274 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
5275 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5277 TRACE("(%p %x %x)\n", this, state, reraise);
5279 this->state = state & IOSTATE_mask;
5280 if(!(this->state & this->except))
5281 return;
5283 if(reraise)
5284 throw_exception(EXCEPTION_RERAISE, NULL);
5285 else if(this->state & this->except & IOSTATE_eofbit)
5286 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
5287 else if(this->state & this->except & IOSTATE_failbit)
5288 throw_exception(EXCEPTION_FAILURE, "failbit is set");
5289 else if(this->state & this->except & IOSTATE_badbit)
5290 throw_exception(EXCEPTION_FAILURE, "badbit is set");
5291 else if(this->state & this->except & IOSTATE__Hardfail)
5292 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
5295 /* ?clear@ios_base@std@@QAEXH@Z */
5296 /* ?clear@ios_base@std@@QEAAXH@Z */
5297 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
5298 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
5300 ios_base_clear_reraise(this, state, FALSE);
5303 /* ?clear@ios_base@std@@QAEXI@Z */
5304 /* ?clear@ios_base@std@@QEAAXI@Z */
5305 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
5306 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
5308 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
5311 /* ?exceptions@ios_base@std@@QAEXH@Z */
5312 /* ?exceptions@ios_base@std@@QEAAXH@Z */
5313 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
5314 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
5316 TRACE("(%p %x)\n", this, state);
5317 this->except = state & IOSTATE_mask;
5318 ios_base_clear(this, this->state);
5321 /* ?exceptions@ios_base@std@@QAEXI@Z */
5322 /* ?exceptions@ios_base@std@@QEAAXI@Z */
5323 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
5324 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
5326 TRACE("(%p %x)\n", this, state);
5327 ios_base_exceptions_set(this, state);
5330 /* ?exceptions@ios_base@std@@QBEHXZ */
5331 /* ?exceptions@ios_base@std@@QEBAHXZ */
5332 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
5333 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
5335 TRACE("(%p)\n", this);
5336 return this->except;
5339 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
5340 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
5341 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
5342 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
5344 TRACE("(%p %p)\n", this, rhs);
5346 if(this != rhs) {
5347 IOS_BASE_iosarray *arr_cur;
5348 IOS_BASE_fnarray *event_cur;
5350 ios_base_Tidy(this);
5352 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
5353 if(arr_cur->long_val)
5354 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
5355 if(arr_cur->ptr_val)
5356 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
5358 this->stdstr = rhs->stdstr;
5359 this->fmtfl = rhs->fmtfl;
5360 this->prec = rhs->prec;
5361 this->wide = rhs->wide;
5362 locale_operator_assign(IOS_LOCALE(this), IOS_LOCALE(rhs));
5364 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
5365 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
5367 ios_base_Callfns(this, EVENT_copyfmt_event);
5368 ios_base_exceptions_set(this, rhs->except);
5371 return this;
5374 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
5375 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
5376 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
5377 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
5379 TRACE("(%p %p)\n", this, right);
5381 if(this != right) {
5382 this->state = right->state;
5383 ios_base_copyfmt(this, right);
5386 return this;
5389 /* ?fail@ios_base@std@@QBE_NXZ */
5390 /* ?fail@ios_base@std@@QEBA_NXZ */
5391 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
5392 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
5394 TRACE("(%p)\n", this);
5395 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
5398 /* ??7ios_base@std@@QBE_NXZ */
5399 /* ??7ios_base@std@@QEBA_NXZ */
5400 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
5401 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
5403 TRACE("(%p)\n", this);
5404 return ios_base_fail(this);
5407 /* ??Bios_base@std@@QBEPAXXZ */
5408 /* ??Bios_base@std@@QEBAPEAXXZ */
5409 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
5410 void* __thiscall ios_base_op_fail(const ios_base *this)
5412 TRACE("(%p)\n", this);
5413 return ios_base_fail(this) ? NULL : (void*)this;
5416 /* ??Bios_base@std@@QBA_NXZ */
5417 /* ??Bios_base@std@@QBE_NXZ */
5418 /* ??Bios_base@std@@QEBA_NXZ */
5419 DEFINE_THISCALL_WRAPPER(ios_base_operator_bool, 4)
5420 MSVCP_bool __thiscall ios_base_operator_bool(const ios_base *this)
5422 TRACE("(%p)\n", this);
5423 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) == 0;
5426 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
5427 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
5428 void __cdecl ios_base_Addstd(ios_base *add)
5430 FIXME("(%p) stub\n", add);
5433 /* ?_Index_func@ios_base@std@@CAAAHXZ */
5434 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
5435 int* __cdecl ios_base_Index_func(void)
5437 TRACE("\n");
5438 return &ios_base_Index;
5441 /* ?_Init@ios_base@std@@IAEXXZ */
5442 /* ?_Init@ios_base@std@@IEAAXXZ */
5443 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
5444 void __thiscall ios_base__Init(ios_base *this)
5446 TRACE("(%p)\n", this);
5448 this->stdstr = 0;
5449 this->state = this->except = IOSTATE_goodbit;
5450 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
5451 this->prec = 6;
5452 this->wide = 0;
5453 this->arr = NULL;
5454 this->calls = NULL;
5455 #if _MSVCP_VER >= 70
5456 this->loc = MSVCRT_operator_new(sizeof(locale));
5457 #endif
5458 locale_ctor(IOS_LOCALE(this));
5461 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
5462 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
5463 MSVCP_bool* __cdecl ios_base_Sync_func(void)
5465 TRACE("\n");
5466 return &ios_base_Sync;
5469 /* ?bad@ios_base@std@@QBE_NXZ */
5470 /* ?bad@ios_base@std@@QEBA_NXZ */
5471 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
5472 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
5474 TRACE("(%p)\n", this);
5475 return (this->state & IOSTATE_badbit) != 0;
5478 /* ?eof@ios_base@std@@QBE_NXZ */
5479 /* ?eof@ios_base@std@@QEBA_NXZ */
5480 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
5481 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
5483 TRACE("(%p)\n", this);
5484 return (this->state & IOSTATE_eofbit) != 0;
5487 /* ?flags@ios_base@std@@QAEHH@Z */
5488 /* ?flags@ios_base@std@@QEAAHH@Z */
5489 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
5490 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
5492 IOSB_fmtflags ret = this->fmtfl;
5494 TRACE("(%p %x)\n", this, flags);
5496 this->fmtfl = flags & FMTFLAG_mask;
5497 return ret;
5500 /* ?flags@ios_base@std@@QBEHXZ */
5501 /* ?flags@ios_base@std@@QEBAHXZ */
5502 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
5503 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
5505 TRACE("(%p)\n", this);
5506 return this->fmtfl;
5509 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
5510 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
5511 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
5512 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
5514 TRACE("(%p)\n", this);
5515 return locale_copy_ctor(ret, IOS_LOCALE(this));
5518 /* ?good@ios_base@std@@QBE_NXZ */
5519 /* ?good@ios_base@std@@QEBA_NXZ */
5520 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
5521 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
5523 TRACE("(%p)\n", this);
5524 return this->state == IOSTATE_goodbit;
5527 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
5528 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
5529 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
5530 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
5532 TRACE("(%p %p)\n", this, loc);
5533 *ret = *IOS_LOCALE(this);
5534 locale_copy_ctor(IOS_LOCALE(this), loc);
5535 return ret;
5538 /* ?precision@ios_base@std@@QAEHH@Z */
5539 /* ?precision@ios_base@std@@QEAA_J_J@Z */
5540 #if STREAMSIZE_BITS == 64
5541 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
5542 #else
5543 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
5544 #endif
5545 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
5547 streamsize ret = this->prec;
5549 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
5551 this->prec = precision;
5552 return ret;
5555 /* ?precision@ios_base@std@@QBEHXZ */
5556 /* ?precision@ios_base@std@@QEBA_JXZ */
5557 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
5558 streamsize __thiscall ios_base_precision_get(const ios_base *this)
5560 TRACE("(%p)\n", this);
5561 return this->prec;
5564 /* ?rdstate@ios_base@std@@QBEHXZ */
5565 /* ?rdstate@ios_base@std@@QEBAHXZ */
5566 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
5567 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
5569 TRACE("(%p)\n", this);
5570 return this->state;
5573 /* ?setf@ios_base@std@@QAEHHH@Z */
5574 /* ?setf@ios_base@std@@QEAAHHH@Z */
5575 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
5576 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
5578 IOSB_fmtflags ret = this->fmtfl;
5580 TRACE("(%p %x %x)\n", this, flags, mask);
5582 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
5583 return ret;
5586 /* ?setf@ios_base@std@@QAEHH@Z */
5587 /* ?setf@ios_base@std@@QEAAHH@Z */
5588 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
5589 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
5591 IOSB_fmtflags ret = this->fmtfl;
5593 TRACE("(%p %x)\n", this, flags);
5595 this->fmtfl |= flags & FMTFLAG_mask;
5596 return ret;
5599 /* ?setstate@ios_base@std@@QAEXH_N@Z */
5600 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
5601 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
5602 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5604 TRACE("(%p %x %x)\n", this, state, reraise);
5606 if(state != IOSTATE_goodbit)
5607 ios_base_clear_reraise(this, this->state | state, reraise);
5610 /* ?setstate@ios_base@std@@QAEXH@Z */
5611 /* ?setstate@ios_base@std@@QEAAXH@Z */
5612 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
5613 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
5615 ios_base_setstate_reraise(this, state, FALSE);
5618 /* ?setstate@ios_base@std@@QAEXI@Z */
5619 /* ?setstate@ios_base@std@@QEAAXI@Z */
5620 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
5621 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
5623 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5626 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
5627 MSVCP_bool __cdecl ios_base_sync_with_stdio(MSVCP_bool sync)
5629 _Lockit lock;
5630 MSVCP_bool ret;
5632 TRACE("(%x)\n", sync);
5634 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5635 ret = ios_base_Sync;
5636 ios_base_Sync = sync;
5637 _Lockit_dtor(&lock);
5638 return ret;
5641 /* ?unsetf@ios_base@std@@QAEXH@Z */
5642 /* ?unsetf@ios_base@std@@QEAAXH@Z */
5643 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
5644 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
5646 TRACE("(%p %x)\n", this, flags);
5647 this->fmtfl &= ~flags;
5650 /* ?width@ios_base@std@@QAEHH@Z */
5651 /* ?width@ios_base@std@@QEAA_J_J@Z */
5652 #if STREAMSIZE_BITS == 64
5653 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
5654 #else
5655 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
5656 #endif
5657 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
5659 streamsize ret = this->wide;
5661 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
5663 this->wide = width;
5664 return ret;
5667 /* ?width@ios_base@std@@QBEHXZ */
5668 /* ?width@ios_base@std@@QEBA_JXZ */
5669 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
5670 streamsize __thiscall ios_base_width_get(ios_base *this)
5672 TRACE("(%p)\n", this);
5673 return this->wide;
5676 /* ?xalloc@ios_base@std@@SAHXZ */
5677 int __cdecl ios_base_xalloc(void)
5679 _Lockit lock;
5680 int ret;
5682 TRACE("\n");
5684 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5685 ret = ios_base_Index++;
5686 _Lockit_dtor(&lock);
5687 return ret;
5690 /* ?swap@ios_base@std@@QAEXAAV12@@Z */
5691 /* ?swap@ios_base@std@@QEAAXAEAV12@@Z */
5692 DEFINE_THISCALL_WRAPPER(ios_base_swap, 8)
5693 void __thiscall ios_base_swap(ios_base *this, ios_base *r)
5695 ios_base tmp;
5697 TRACE("(%p %p)\n", this, r);
5699 if(this == r)
5700 return;
5702 tmp = *this;
5703 *this = *r;
5704 this->vtable = tmp.vtable;
5705 tmp.vtable = r->vtable;
5706 *r = tmp;
5709 DEFINE_THISCALL_WRAPPER(basic_ios__Add_vtordisp1, 4)
5710 void __thiscall basic_ios__Add_vtordisp1(void *this)
5712 WARN("should not be called (%p)\n", this);
5715 DEFINE_THISCALL_WRAPPER(basic_ios__Add_vtordisp2, 4)
5716 void __thiscall basic_ios__Add_vtordisp2(void *this)
5718 WARN("should not be called (%p)\n", this);
5721 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
5722 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
5723 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
5724 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
5726 TRACE("(%p)\n", this);
5728 ios_base_ctor(&this->base);
5729 this->base.vtable = &MSVCP_basic_ios_char_vtable;
5730 return this;
5733 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5734 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5735 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
5736 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
5738 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5739 ios_base__Init(&this->base);
5740 this->strbuf = streambuf;
5741 this->stream = NULL;
5742 this->fillch = ' ';
5744 if(!streambuf)
5745 ios_base_setstate(&this->base, IOSTATE_badbit);
5747 if(isstd)
5748 FIXME("standard streams not handled yet\n");
5751 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5752 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5753 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
5754 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
5756 TRACE("(%p %p)\n", this, strbuf);
5758 basic_ios_char_ctor(this);
5759 basic_ios_char_init(this, strbuf, FALSE);
5760 return this;
5763 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
5764 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5765 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
5766 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
5768 TRACE("(%p)\n", this);
5769 ios_base_dtor(&this->base);
5772 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
5773 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
5775 TRACE("(%p %x)\n", this, flags);
5776 if(flags & 2) {
5777 /* we have an array, with the number of elements stored before the first object */
5778 INT_PTR i, *ptr = (INT_PTR *)this-1;
5780 for(i=*ptr-1; i>=0; i--)
5781 basic_ios_char_dtor(this+i);
5782 MSVCRT_operator_delete(ptr);
5783 } else {
5784 basic_ios_char_dtor(this);
5785 if(flags & 1)
5786 MSVCRT_operator_delete(this);
5789 return this;
5792 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5793 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5794 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5795 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5797 TRACE("(%p %x %x)\n", this, state, reraise);
5798 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5801 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5802 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5803 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5804 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5806 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5809 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5810 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5811 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5812 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5814 TRACE("(%p %p)\n", this, copy);
5815 if(this == copy)
5816 return this;
5818 this->stream = copy->stream;
5819 this->fillch = copy->fillch;
5820 ios_base_copyfmt(&this->base, &copy->base);
5821 return this;
5824 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5825 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5826 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5827 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5829 char ret = this->fillch;
5831 TRACE("(%p %c)\n", this, fill);
5833 this->fillch = fill;
5834 return ret;
5837 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5838 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5839 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5840 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5842 TRACE("(%p)\n", this);
5843 return this->fillch;
5846 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5847 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5848 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5849 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5851 TRACE("(%p %p %p)\n", this, ret, loc);
5853 if(this->strbuf) {
5854 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5855 locale_dtor(ret);
5858 return ios_base_imbue(&this->base, ret, loc);
5861 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5862 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5863 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5864 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5866 TRACE("(%p %c %c)\n", this, ch, def);
5867 return ctype_char_narrow_ch(ctype_char_use_facet(IOS_LOCALE(&this->base)), ch, def);
5870 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5871 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5872 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5873 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5875 basic_streambuf_char *ret = this->strbuf;
5877 TRACE("(%p %p)\n", this, streambuf);
5879 this->strbuf = streambuf;
5880 basic_ios_char_clear(this, IOSTATE_goodbit);
5881 return ret;
5884 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5885 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5886 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5887 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5889 TRACE("(%p)\n", this);
5890 return this->strbuf;
5893 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5894 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5895 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5896 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5898 TRACE("(%p %x %x)\n", this, state, reraise);
5900 if(state != IOSTATE_goodbit)
5901 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5904 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5905 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5906 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5907 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5909 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5912 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5913 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5914 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5915 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5917 basic_ostream_char *ret = this->stream;
5919 TRACE("(%p %p)\n", this, ostream);
5921 this->stream = ostream;
5922 return ret;
5925 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5926 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5927 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5928 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5930 TRACE("(%p)\n", this);
5931 return this->stream;
5934 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5935 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5936 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5937 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5939 TRACE("(%p %c)\n", this, ch);
5940 return ctype_char_widen_ch(ctype_char_use_facet(IOS_LOCALE(&this->base)), ch);
5943 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
5944 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
5945 DEFINE_THISCALL_WRAPPER(basic_ios_char_swap, 8)
5946 void __thiscall basic_ios_char_swap(basic_ios_char *this, basic_ios_char *r)
5948 void *swap_ptr;
5950 TRACE("(%p %p)\n", this, r);
5952 if(this == r)
5953 return;
5955 ios_base_swap(&this->base, &r->base);
5956 swap_ptr = this->stream;
5957 this->stream = r->stream;
5958 r->stream = swap_ptr;
5959 this->fillch ^= r->fillch;
5960 r->fillch ^= this->fillch;
5961 this->fillch ^= r->fillch;
5964 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5965 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5966 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5967 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5969 TRACE("(%p)\n", this);
5971 ios_base_ctor(&this->base);
5972 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5973 return this;
5976 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5977 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5978 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5979 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5981 basic_ios_wchar_ctor(this);
5982 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5983 return this;
5986 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5987 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5988 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5989 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5990 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5991 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
5993 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5994 ios_base__Init(&this->base);
5995 this->strbuf = streambuf;
5996 this->stream = NULL;
5997 this->fillch = ' ';
5999 if(!streambuf)
6000 ios_base_setstate(&this->base, IOSTATE_badbit);
6002 if(isstd)
6003 FIXME("standard streams not handled yet\n");
6006 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6007 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
6008 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
6009 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
6011 TRACE("(%p %p)\n", this, strbuf);
6013 basic_ios_wchar_ctor(this);
6014 basic_ios_wchar_init(this, strbuf, FALSE);
6015 return this;
6018 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6019 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
6020 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
6021 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
6023 basic_ios_wchar_ctor_streambuf(this, strbuf);
6024 this->base.vtable = &MSVCP_basic_ios_short_vtable;
6025 return this;
6028 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6029 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6030 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
6031 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6032 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
6033 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
6035 TRACE("(%p)\n", this);
6036 ios_base_dtor(&this->base);
6039 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
6040 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
6042 TRACE("(%p %x)\n", this, flags);
6043 if(flags & 2) {
6044 /* we have an array, with the number of elements stored before the first object */
6045 INT_PTR i, *ptr = (INT_PTR *)this-1;
6047 for(i=*ptr-1; i>=0; i--)
6048 basic_ios_wchar_dtor(this+i);
6049 MSVCRT_operator_delete(ptr);
6050 } else {
6051 basic_ios_wchar_dtor(this);
6052 if(flags & 1)
6053 MSVCRT_operator_delete(this);
6056 return this;
6059 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
6060 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
6061 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
6062 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
6063 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
6064 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
6066 TRACE("(%p %x %x)\n", this, state, reraise);
6067 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
6070 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
6071 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
6072 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
6073 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
6074 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
6075 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
6077 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
6080 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
6081 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
6082 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
6083 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
6084 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
6085 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
6087 TRACE("(%p %p)\n", this, copy);
6088 if(this == copy)
6089 return this;
6091 this->stream = copy->stream;
6092 this->fillch = copy->fillch;
6093 ios_base_copyfmt(&this->base, &copy->base);
6094 return this;
6097 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
6098 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
6099 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
6100 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
6101 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
6102 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
6104 wchar_t ret = this->fillch;
6106 TRACE("(%p %c)\n", this, fill);
6108 this->fillch = fill;
6109 return ret;
6112 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
6113 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
6114 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
6115 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
6116 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
6117 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
6119 TRACE("(%p)\n", this);
6120 return this->fillch;
6123 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
6124 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
6125 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
6126 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
6127 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
6128 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
6130 TRACE("(%p %p %p)\n", this, ret, loc);
6132 if(this->strbuf) {
6133 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
6134 locale_dtor(ret);
6137 return ios_base_imbue(&this->base, ret, loc);
6140 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
6141 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
6142 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
6143 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
6144 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
6145 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
6147 TRACE("(%p %c %c)\n", this, ch, def);
6148 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(IOS_LOCALE(&this->base)), ch, def);
6151 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
6152 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
6153 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
6154 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
6155 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
6156 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
6158 basic_streambuf_wchar *ret = this->strbuf;
6160 TRACE("(%p %p)\n", this, streambuf);
6162 this->strbuf = streambuf;
6163 basic_ios_wchar_clear(this, IOSTATE_goodbit);
6164 return ret;
6167 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
6168 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
6169 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
6170 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
6171 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
6172 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
6174 TRACE("(%p)\n", this);
6175 return this->strbuf;
6178 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
6179 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
6180 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
6181 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
6182 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
6183 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
6185 TRACE("(%p %x %x)\n", this, state, reraise);
6187 if(state != IOSTATE_goodbit)
6188 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
6191 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
6192 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
6193 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
6194 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
6195 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
6196 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
6198 basic_ios_wchar_setstate_reraise(this, state, FALSE);
6201 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
6202 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
6203 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
6204 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
6205 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
6206 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
6208 basic_ostream_wchar *ret = this->stream;
6210 TRACE("(%p %p)\n", this, ostream);
6212 this->stream = ostream;
6213 return ret;
6216 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
6217 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
6218 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
6219 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
6220 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
6221 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
6223 TRACE("(%p)\n", this);
6224 return this->stream;
6227 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
6228 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
6229 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
6230 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
6231 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
6232 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
6234 TRACE("(%p %c)\n", this, ch);
6235 return ctype_wchar_widen_ch(ctype_wchar_use_facet(IOS_LOCALE(&this->base)), ch);
6238 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
6239 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
6240 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
6241 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
6242 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_swap, 8)
6243 void __thiscall basic_ios_wchar_swap(basic_ios_wchar *this, basic_ios_wchar *r)
6245 void *swap_ptr;
6247 TRACE("(%p %p)\n", this, r);
6249 if(this == r)
6250 return;
6252 ios_base_swap(&this->base, &r->base);
6253 swap_ptr = this->stream;
6254 this->stream = r->stream;
6255 r->stream = swap_ptr;
6256 this->fillch ^= r->fillch;
6257 r->fillch ^= this->fillch;
6258 this->fillch ^= r->fillch;
6261 /* Caution: basic_ostream uses virtual inheritance.
6262 * All constructors have additional parameter that says if base class should be initialized.
6263 * Base class needs to be accessed using vbtable.
6265 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
6267 return (basic_ios_char*)((char*)this+this->vbtable[1]);
6270 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
6272 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
6275 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
6277 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
6280 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6281 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6282 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 16)
6283 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
6284 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6286 basic_ios_char *base;
6288 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6290 if(virt_init) {
6291 this->vbtable = basic_ostream_char_vbtable;
6292 base = basic_ostream_char_get_basic_ios(this);
6293 INIT_BASIC_IOS_VTORDISP(base);
6294 basic_ios_char_ctor(base);
6295 }else {
6296 base = basic_ostream_char_get_basic_ios(this);
6299 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
6300 basic_ios_char_init(base, strbuf, isstd);
6301 return this;
6304 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6305 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6306 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 16)
6307 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
6308 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6310 basic_ios_char *base;
6312 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
6314 if(virt_init) {
6315 this->vbtable = basic_ostream_char_vbtable;
6316 base = basic_ostream_char_get_basic_ios(this);
6317 INIT_BASIC_IOS_VTORDISP(base);
6318 basic_ios_char_ctor(base);
6319 }else {
6320 base = basic_ostream_char_get_basic_ios(this);
6323 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
6324 if(addstd)
6325 ios_base_Addstd(&base->base);
6326 return this;
6329 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
6330 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
6331 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
6332 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
6334 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
6336 /* don't destroy virtual base here */
6337 TRACE("(%p)\n", this);
6340 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6341 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6342 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
6343 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
6345 basic_ios_char *base = basic_ostream_char_to_basic_ios(this);
6347 TRACE("(%p)\n", this);
6349 basic_ostream_char_dtor(base);
6350 basic_ios_char_dtor(base);
6353 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
6354 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
6356 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
6358 TRACE("(%p %x)\n", this, flags);
6360 if(flags & 2) {
6361 /* we have an array, with the number of elements stored before the first object */
6362 INT_PTR i, *ptr = (INT_PTR *)this-1;
6364 for(i=*ptr-1; i>=0; i--)
6365 basic_ostream_char_vbase_dtor(this+i);
6366 MSVCRT_operator_delete(ptr);
6367 } else {
6368 basic_ostream_char_vbase_dtor(this);
6369 if(flags & 1)
6370 MSVCRT_operator_delete(this);
6373 return this;
6376 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
6377 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
6378 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
6379 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
6381 /* this function is not matching C++ specification */
6382 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6384 TRACE("(%p)\n", this);
6386 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
6387 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
6388 basic_ios_char_setstate(base, IOSTATE_badbit);
6389 return this;
6392 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6393 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6394 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
6396 return basic_ostream_char_flush(ostream);
6399 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6400 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6401 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
6402 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
6404 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6406 TRACE("(%p)\n", this);
6408 if(base->base.fmtfl & FMTFLAG_unitbuf)
6409 basic_ostream_char_flush(this);
6412 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6413 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6414 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
6415 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
6417 TRACE("(%p)\n", this);
6418 basic_ostream_char__Osfx(this);
6421 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
6423 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6425 if(basic_ios_char_rdbuf_get(base))
6426 call_basic_streambuf_char__Lock(base->strbuf);
6428 if(ios_base_good(&base->base) && base->stream)
6429 basic_ostream_char_flush(base->stream);
6431 return ios_base_good(&base->base);
6434 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
6436 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6438 if(ios_base_good(&base->base) && !__uncaught_exception())
6439 basic_ostream_char_osfx(ostr);
6441 if(basic_ios_char_rdbuf_get(base))
6442 call_basic_streambuf_char__Unlock(base->strbuf);
6445 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
6446 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
6447 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
6448 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
6450 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6452 TRACE("(%p)\n", this);
6454 if(ios_base_good(&base->base) && base->stream)
6455 basic_ostream_char_flush(base->stream);
6456 return ios_base_good(&base->base);
6459 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
6460 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
6461 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
6462 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
6464 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6466 TRACE("(%p %c)\n", this, ch);
6468 if(!basic_ostream_char_sentry_create(this)
6469 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
6470 basic_ostream_char_sentry_destroy(this);
6471 basic_ios_char_setstate(base, IOSTATE_badbit);
6472 return this;
6475 basic_ostream_char_sentry_destroy(this);
6476 return this;
6479 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
6480 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
6481 #if STREAMOFF_BITS == 64
6482 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 16)
6483 #else
6484 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
6485 #endif
6486 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
6488 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6490 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6492 if(!ios_base_fail(&base->base)) {
6493 fpos_mbstatet seek;
6495 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6496 &seek, off, way, OPENMODE_out);
6497 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
6498 basic_ios_char_setstate(base, IOSTATE_failbit);
6500 return this;
6503 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6504 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6505 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
6506 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_mbstatet pos)
6508 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6510 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
6512 if(!ios_base_fail(&base->base)) {
6513 fpos_mbstatet seek;
6515 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
6516 &seek, pos, OPENMODE_out);
6517 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
6518 basic_ios_char_setstate(base, IOSTATE_failbit);
6520 return this;
6523 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6524 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6525 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
6526 fpos_mbstatet* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_mbstatet *ret)
6528 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6530 TRACE("(%p)\n", this);
6532 if(!ios_base_fail(&base->base)) {
6533 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6534 ret, 0, SEEKDIR_cur, OPENMODE_out);
6535 }else {
6536 ret->off = -1;
6537 ret->pos = 0;
6538 memset(&ret->state, 0, sizeof(ret->state));
6540 return ret;
6543 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
6544 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
6545 #if STREAMSIZE_BITS == 64
6546 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
6547 #else
6548 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
6549 #endif
6550 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
6552 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6554 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
6556 if(!basic_ostream_char_sentry_create(this)
6557 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
6558 basic_ostream_char_sentry_destroy(this);
6559 basic_ios_char_setstate(base, IOSTATE_badbit);
6560 return this;
6563 basic_ostream_char_sentry_destroy(this);
6564 return this;
6567 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
6568 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
6569 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
6570 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
6572 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6573 int state = IOSTATE_goodbit;
6575 TRACE("(%p %d)\n", this, val);
6577 if(basic_ostream_char_sentry_create(this)) {
6578 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6579 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6580 ostreambuf_iterator_char dest;
6582 memset(&dest, 0, sizeof(dest));
6583 dest.strbuf = strbuf;
6584 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
6585 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6586 ? (LONG)((unsigned short)val) : (LONG)val);
6588 basic_ostream_char_sentry_destroy(this);
6590 basic_ios_char_setstate(base, state);
6591 return this;
6594 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
6595 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
6596 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
6597 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
6599 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6600 int state = IOSTATE_goodbit;
6602 TRACE("(%p %u)\n", this, val);
6604 if(basic_ostream_char_sentry_create(this)) {
6605 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6606 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6607 ostreambuf_iterator_char dest;
6609 memset(&dest, 0, sizeof(dest));
6610 dest.strbuf = strbuf;
6611 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6613 basic_ostream_char_sentry_destroy(this);
6615 basic_ios_char_setstate(base, state);
6616 return this;
6619 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
6620 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
6621 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
6622 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
6623 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
6624 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
6626 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6627 int state = IOSTATE_goodbit;
6629 TRACE("(%p %d)\n", this, val);
6631 if(basic_ostream_char_sentry_create(this)) {
6632 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6633 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6634 ostreambuf_iterator_char dest;
6636 memset(&dest, 0, sizeof(dest));
6637 dest.strbuf = strbuf;
6638 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6640 basic_ostream_char_sentry_destroy(this);
6642 basic_ios_char_setstate(base, state);
6643 return this;
6646 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
6647 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
6648 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
6649 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
6650 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
6651 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
6653 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6654 int state = IOSTATE_goodbit;
6656 TRACE("(%p %u)\n", this, val);
6658 if(basic_ostream_char_sentry_create(this)) {
6659 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6660 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6661 ostreambuf_iterator_char dest;
6663 memset(&dest, 0, sizeof(dest));
6664 dest.strbuf = strbuf;
6665 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6667 basic_ostream_char_sentry_destroy(this);
6669 basic_ios_char_setstate(base, state);
6670 return this;
6673 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
6674 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
6675 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
6676 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
6678 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6679 int state = IOSTATE_goodbit;
6681 TRACE("(%p %f)\n", this, val);
6683 if(basic_ostream_char_sentry_create(this)) {
6684 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6685 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6686 ostreambuf_iterator_char dest;
6688 memset(&dest, 0, sizeof(dest));
6689 dest.strbuf = strbuf;
6690 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6692 basic_ostream_char_sentry_destroy(this);
6694 basic_ios_char_setstate(base, state);
6695 return this;
6698 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
6699 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
6700 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
6701 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
6703 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6704 int state = IOSTATE_goodbit;
6706 TRACE("(%p %lf)\n", this, val);
6708 if(basic_ostream_char_sentry_create(this)) {
6709 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6710 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6711 ostreambuf_iterator_char dest;
6713 memset(&dest, 0, sizeof(dest));
6714 dest.strbuf = strbuf;
6715 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6717 basic_ostream_char_sentry_destroy(this);
6719 basic_ios_char_setstate(base, state);
6720 return this;
6723 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
6724 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
6725 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
6726 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
6728 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6729 int state = IOSTATE_goodbit;
6731 TRACE("(%p %lf)\n", this, val);
6733 if(basic_ostream_char_sentry_create(this)) {
6734 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6735 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6736 ostreambuf_iterator_char dest;
6738 memset(&dest, 0, sizeof(dest));
6739 dest.strbuf = strbuf;
6740 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6742 basic_ostream_char_sentry_destroy(this);
6744 basic_ios_char_setstate(base, state);
6745 return this;
6748 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6749 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6750 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
6751 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
6753 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6754 IOSB_iostate state = IOSTATE_badbit;
6755 int c = '\n';
6757 TRACE("(%p %p)\n", this, val);
6759 if(basic_ostream_char_sentry_create(this)) {
6760 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
6761 c = basic_streambuf_char_snextc(val)) {
6762 state = IOSTATE_goodbit;
6764 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
6765 state = IOSTATE_badbit;
6766 break;
6769 }else {
6770 state = IOSTATE_badbit;
6772 basic_ostream_char_sentry_destroy(this);
6774 ios_base_width_set(&base->base, 0);
6775 basic_ios_char_setstate(base, state);
6776 return this;
6779 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
6780 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
6781 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
6782 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
6784 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6785 int state = IOSTATE_goodbit;
6787 TRACE("(%p %p)\n", this, val);
6789 if(basic_ostream_char_sentry_create(this)) {
6790 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6791 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6792 ostreambuf_iterator_char dest;
6794 memset(&dest, 0, sizeof(dest));
6795 dest.strbuf = strbuf;
6796 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6798 basic_ostream_char_sentry_destroy(this);
6800 basic_ios_char_setstate(base, state);
6801 return this;
6804 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
6805 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
6806 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
6807 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
6809 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6810 int state = IOSTATE_goodbit;
6812 TRACE("(%p)\n", this);
6814 if(basic_ostream_char_sentry_create(this)) {
6815 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6816 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6817 ostreambuf_iterator_char dest;
6819 memset(&dest, 0, sizeof(dest));
6820 dest.strbuf = strbuf;
6821 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6823 basic_ostream_char_sentry_destroy(this);
6825 basic_ios_char_setstate(base, state);
6826 return this;
6829 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
6830 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
6831 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
6832 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
6834 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6835 int state = IOSTATE_goodbit;
6837 TRACE("(%p)\n", this);
6839 if(basic_ostream_char_sentry_create(this)) {
6840 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6841 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6842 ostreambuf_iterator_char dest;
6844 memset(&dest, 0, sizeof(dest));
6845 dest.strbuf = strbuf;
6846 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6848 basic_ostream_char_sentry_destroy(this);
6850 basic_ios_char_setstate(base, state);
6851 return this;
6854 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
6855 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
6856 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
6857 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
6859 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6860 int state = IOSTATE_goodbit;
6862 TRACE("(%p %x)\n", this, val);
6864 if(basic_ostream_char_sentry_create(this)) {
6865 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6866 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6867 ostreambuf_iterator_char dest;
6869 memset(&dest, 0, sizeof(dest));
6870 dest.strbuf = strbuf;
6871 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6873 basic_ostream_char_sentry_destroy(this);
6875 basic_ios_char_setstate(base, state);
6876 return this;
6879 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6880 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6881 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6883 TRACE("(%p)\n", ostr);
6885 basic_ostream_char_put(ostr, 0);
6886 return ostr;
6889 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6890 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6891 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6893 TRACE("(%p)\n", ostr);
6895 basic_ostream_char_put(ostr, '\n');
6896 basic_ostream_char_flush(ostr);
6897 return ostr;
6900 /* ??$?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 */
6901 /* ??$?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 */
6902 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6904 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6905 IOSB_iostate state = IOSTATE_goodbit;
6907 TRACE("(%p %p)\n", ostr, str);
6909 if(basic_ostream_char_sentry_create(ostr)) {
6910 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6911 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6913 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6914 for(; pad!=0; pad--) {
6915 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6916 state = IOSTATE_badbit;
6917 break;
6922 if(state == IOSTATE_goodbit) {
6923 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6924 state = IOSTATE_badbit;
6927 if(state == IOSTATE_goodbit) {
6928 for(; pad!=0; pad--) {
6929 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6930 state = IOSTATE_badbit;
6931 break;
6936 base->base.wide = 0;
6937 }else {
6938 state = IOSTATE_badbit;
6940 basic_ostream_char_sentry_destroy(ostr);
6942 basic_ios_char_setstate(base, state);
6943 return ostr;
6946 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6947 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6948 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6949 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6950 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6951 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6952 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6954 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6955 IOSB_iostate state = IOSTATE_goodbit;
6957 TRACE("(%p %d)\n", ostr, ch);
6959 if(basic_ostream_char_sentry_create(ostr)) {
6960 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6962 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6963 for(; pad!=0; pad--) {
6964 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6965 state = IOSTATE_badbit;
6966 break;
6971 if(state == IOSTATE_goodbit) {
6972 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6973 state = IOSTATE_badbit;
6976 if(state == IOSTATE_goodbit) {
6977 for(; pad!=0; pad--) {
6978 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6979 state = IOSTATE_badbit;
6980 break;
6985 base->base.wide = 0;
6986 }else {
6987 state = IOSTATE_badbit;
6989 basic_ostream_char_sentry_destroy(ostr);
6991 basic_ios_char_setstate(base, state);
6992 return ostr;
6995 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6996 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6997 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6998 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6999 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
7000 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
7001 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
7003 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
7004 IOSB_iostate state = IOSTATE_goodbit;
7006 TRACE("(%p %s)\n", ostr, str);
7008 if(basic_ostream_char_sentry_create(ostr)) {
7009 MSVCP_size_t len = strlen(str);
7010 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7012 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7013 for(; pad!=0; pad--) {
7014 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
7015 state = IOSTATE_badbit;
7016 break;
7021 if(state == IOSTATE_goodbit) {
7022 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
7023 state = IOSTATE_badbit;
7026 if(state == IOSTATE_goodbit) {
7027 for(; pad!=0; pad--) {
7028 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
7029 state = IOSTATE_badbit;
7030 break;
7035 base->base.wide = 0;
7036 }else {
7037 state = IOSTATE_badbit;
7039 basic_ostream_char_sentry_destroy(ostr);
7041 basic_ios_char_setstate(base, state);
7042 return ostr;
7045 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7046 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7047 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
7048 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
7049 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
7051 TRACE("(%p %p)\n", this, pfunc);
7052 pfunc(this);
7053 return this;
7056 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
7057 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
7058 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
7059 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
7060 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
7062 TRACE("(%p %p)\n", this, pfunc);
7063 pfunc(basic_ostream_char_get_basic_ios(this));
7064 return this;
7067 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7068 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7069 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
7070 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
7071 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
7073 TRACE("(%p %p)\n", this, pfunc);
7074 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
7075 return this;
7078 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
7079 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
7080 DEFINE_THISCALL_WRAPPER(basic_ostream_char_swap, 8)
7081 void __thiscall basic_ostream_char_swap(basic_ostream_char *this, basic_ostream_char *r)
7083 TRACE("(%p %p)\n", this, r);
7085 if(this == r)
7086 return;
7088 basic_ios_char_swap(basic_ostream_char_get_basic_ios(this),
7089 basic_ostream_char_get_basic_ios(r));
7092 /* Caution: basic_ostream uses virtual inheritance. */
7093 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
7095 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
7098 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
7100 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
7103 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
7105 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
7108 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
7109 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
7110 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor, 16)
7111 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor(basic_ostream_wchar *this,
7112 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7114 basic_ios_wchar *base;
7116 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
7118 if(virt_init) {
7119 this->vbtable = basic_ostream_wchar_vbtable;
7120 base = basic_ostream_wchar_get_basic_ios(this);
7121 INIT_BASIC_IOS_VTORDISP(base);
7122 basic_ios_wchar_ctor(base);
7123 }else {
7124 base = basic_ostream_wchar_get_basic_ios(this);
7127 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
7128 basic_ios_wchar_init(base, strbuf, isstd);
7129 return this;
7132 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
7133 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
7134 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 16)
7135 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
7136 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7138 basic_ostream_wchar_ctor(this, strbuf, isstd, virt_init);
7139 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
7140 return this;
7143 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
7144 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
7145 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor_uninitialized, 16)
7146 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor_uninitialized(basic_ostream_wchar *this,
7147 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
7149 basic_ios_wchar *base;
7151 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
7153 if(virt_init) {
7154 this->vbtable = basic_ostream_wchar_vbtable;
7155 base = basic_ostream_wchar_get_basic_ios(this);
7156 INIT_BASIC_IOS_VTORDISP(base);
7157 basic_ios_wchar_ctor(base);
7158 }else {
7159 base = basic_ostream_wchar_get_basic_ios(this);
7162 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
7163 if(addstd)
7164 ios_base_Addstd(&base->base);
7165 return this;
7168 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
7169 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
7170 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 16)
7171 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
7172 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
7174 basic_ostream_wchar_ctor_uninitialized(this, uninitialized, addstd, virt_init);
7175 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
7176 return this;
7179 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
7180 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
7181 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
7182 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
7183 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
7184 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
7186 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
7188 /* don't destroy virtual base here */
7189 TRACE("(%p)\n", this);
7192 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7193 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7194 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7195 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7196 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
7197 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
7199 basic_ios_wchar *base = basic_ostream_wchar_to_basic_ios(this);
7201 TRACE("(%p)\n", this);
7203 basic_ostream_wchar_dtor(base);
7204 basic_ios_wchar_dtor(base);
7207 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
7208 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
7210 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
7212 TRACE("(%p %x)\n", this, flags);
7214 if(flags & 2) {
7215 /* we have an array, with the number of elements stored before the first object */
7216 INT_PTR i, *ptr = (INT_PTR *)this-1;
7218 for(i=*ptr-1; i>=0; i--)
7219 basic_ostream_wchar_vbase_dtor(this+i);
7220 MSVCRT_operator_delete(ptr);
7221 } else {
7222 basic_ostream_wchar_vbase_dtor(this);
7223 if(flags & 1)
7224 MSVCRT_operator_delete(this);
7227 return this;
7230 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
7231 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
7232 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
7233 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
7234 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
7235 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
7237 /* this function is not matching C++ specification */
7238 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7240 TRACE("(%p)\n", this);
7242 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
7243 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
7244 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7245 return this;
7248 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7249 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7250 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7251 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7252 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
7254 return basic_ostream_wchar_flush(ostream);
7257 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7258 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7259 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7260 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7261 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
7262 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
7264 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7266 TRACE("(%p)\n", this);
7268 if(base->base.fmtfl & FMTFLAG_unitbuf)
7269 basic_ostream_wchar_flush(this);
7272 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7273 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7274 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7275 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7276 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
7277 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
7279 TRACE("(%p)\n", this);
7280 basic_ostream_wchar__Osfx(this);
7283 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
7285 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7287 if(basic_ios_wchar_rdbuf_get(base))
7288 basic_streambuf_wchar__Lock(base->strbuf);
7290 if(ios_base_good(&base->base) && base->stream)
7291 basic_ostream_wchar_flush(base->stream);
7293 return ios_base_good(&base->base);
7296 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
7298 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7300 if(ios_base_good(&base->base) && !__uncaught_exception())
7301 basic_ostream_wchar_osfx(ostr);
7303 if(basic_ios_wchar_rdbuf_get(base))
7304 basic_streambuf_wchar__Unlock(base->strbuf);
7307 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
7308 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
7309 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
7310 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
7311 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
7312 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
7314 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7316 TRACE("(%p)\n", this);
7318 if(ios_base_good(&base->base) && base->stream)
7319 basic_ostream_wchar_flush(base->stream);
7320 return ios_base_good(&base->base);
7323 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
7324 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
7325 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
7326 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
7327 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
7328 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
7330 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7332 TRACE("(%p %c)\n", this, ch);
7334 if(!basic_ostream_wchar_sentry_create(this)
7335 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
7336 basic_ostream_wchar_sentry_destroy(this);
7337 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7338 return this;
7341 basic_ostream_wchar_sentry_destroy(this);
7342 return this;
7345 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
7346 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
7347 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
7348 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
7349 #if STREAMOFF_BITS == 64
7350 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 16)
7351 #else
7352 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
7353 #endif
7354 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
7356 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7358 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
7360 if(!ios_base_fail(&base->base)) {
7361 fpos_mbstatet seek;
7363 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
7364 &seek, off, way, OPENMODE_out);
7365 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
7366 basic_ios_wchar_setstate(base, IOSTATE_failbit);
7368 return this;
7371 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7372 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7373 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7374 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7375 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
7376 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_mbstatet pos)
7378 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7380 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
7382 if(!ios_base_fail(&base->base)) {
7383 fpos_mbstatet seek;
7385 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
7386 &seek, pos, OPENMODE_out);
7387 if(seek.off==-1 && seek.pos==0 && MBSTATET_TO_INT(&seek.state)==0)
7388 basic_ios_wchar_setstate(base, IOSTATE_failbit);
7390 return this;
7393 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7394 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7395 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7396 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7397 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
7398 fpos_mbstatet* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_mbstatet *ret)
7400 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7402 TRACE("(%p)\n", this);
7404 if(!ios_base_fail(&base->base)) {
7405 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
7406 ret, 0, SEEKDIR_cur, OPENMODE_out);
7407 }else {
7408 ret->off = -1;
7409 ret->pos = 0;
7410 memset(&ret->state, 0, sizeof(ret->state));
7412 return ret;
7415 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
7416 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
7417 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
7418 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
7419 #if STREAMSIZE_BITS == 64
7420 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
7421 #else
7422 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
7423 #endif
7424 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
7426 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7428 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
7430 if(!basic_ostream_wchar_sentry_create(this)
7431 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
7432 basic_ostream_wchar_sentry_destroy(this);
7433 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7434 return this;
7437 basic_ostream_wchar_sentry_destroy(this);
7438 return this;
7441 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
7443 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7444 int state = IOSTATE_goodbit;
7446 TRACE("(%p %d)\n", this, val);
7448 if(basic_ostream_wchar_sentry_create(this)) {
7449 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7450 ostreambuf_iterator_wchar dest;
7452 memset(&dest, 0, sizeof(dest));
7453 dest.strbuf = strbuf;
7454 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
7455 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
7456 ? (LONG)((unsigned short)val) : (LONG)val);
7458 basic_ostream_wchar_sentry_destroy(this);
7460 basic_ios_wchar_setstate(base, state);
7461 return this;
7464 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
7465 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
7466 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
7467 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
7469 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
7470 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7473 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
7474 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
7475 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
7476 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
7478 return basic_ostream_print_short(this, val, num_put_short_use_facet(
7479 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7482 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
7484 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7485 int state = IOSTATE_goodbit;
7487 TRACE("(%p %d)\n", this, val);
7489 if(basic_ostream_wchar_sentry_create(this)) {
7490 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7491 ostreambuf_iterator_wchar dest;
7493 memset(&dest, 0, sizeof(dest));
7494 dest.strbuf = strbuf;
7495 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7497 basic_ostream_wchar_sentry_destroy(this);
7499 basic_ios_wchar_setstate(base, state);
7500 return this;
7503 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
7504 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
7505 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
7506 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
7508 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
7509 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7512 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
7513 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
7514 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
7515 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
7517 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
7518 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7521 /* ??6std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7522 /* ??6std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7523 basic_ostream_wchar* __cdecl basic_ostream_short_print_ushort_global(basic_ostream_wchar *ostr, unsigned short val)
7525 return basic_ostream_print_ushort(ostr, val, num_put_short_use_facet(
7526 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(ostr)))));
7529 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
7531 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7532 int state = IOSTATE_goodbit;
7534 TRACE("(%p %d)\n", this, val);
7536 if(basic_ostream_wchar_sentry_create(this)) {
7537 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7538 ostreambuf_iterator_wchar dest;
7540 memset(&dest, 0, sizeof(dest));
7541 dest.strbuf = strbuf;
7542 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7544 basic_ostream_wchar_sentry_destroy(this);
7546 basic_ios_wchar_setstate(base, state);
7547 return this;
7550 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
7551 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
7552 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
7553 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
7554 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
7555 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
7557 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
7558 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7561 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
7562 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
7563 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
7564 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
7565 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
7566 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
7568 return basic_ostream_print_int(this, val, num_put_short_use_facet(
7569 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7572 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
7574 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7575 int state = IOSTATE_goodbit;
7577 TRACE("(%p %u)\n", this, val);
7579 if(basic_ostream_wchar_sentry_create(this)) {
7580 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7581 ostreambuf_iterator_wchar dest;
7583 memset(&dest, 0, sizeof(dest));
7584 dest.strbuf = strbuf;
7585 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7587 basic_ostream_wchar_sentry_destroy(this);
7589 basic_ios_wchar_setstate(base, state);
7590 return this;
7593 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
7594 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
7595 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
7596 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
7597 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
7598 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
7600 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
7601 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7604 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
7605 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
7606 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
7607 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
7608 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
7609 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
7611 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
7612 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7615 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
7617 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7618 int state = IOSTATE_goodbit;
7620 TRACE("(%p %f)\n", this, val);
7622 if(basic_ostream_wchar_sentry_create(this)) {
7623 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7624 ostreambuf_iterator_wchar dest;
7626 memset(&dest, 0, sizeof(dest));
7627 dest.strbuf = strbuf;
7628 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7630 basic_ostream_wchar_sentry_destroy(this);
7632 basic_ios_wchar_setstate(base, state);
7633 return this;
7636 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
7637 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
7638 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
7639 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
7641 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
7642 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7645 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
7646 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
7647 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
7648 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
7650 return basic_ostream_print_float(this, val, num_put_short_use_facet(
7651 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7654 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
7656 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7657 int state = IOSTATE_goodbit;
7659 TRACE("(%p %lf)\n", this, val);
7661 if(basic_ostream_wchar_sentry_create(this)) {
7662 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7663 ostreambuf_iterator_wchar dest;
7665 memset(&dest, 0, sizeof(dest));
7666 dest.strbuf = strbuf;
7667 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7669 basic_ostream_wchar_sentry_destroy(this);
7671 basic_ios_wchar_setstate(base, state);
7672 return this;
7675 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
7676 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
7677 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
7678 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
7680 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
7681 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7684 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
7685 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
7686 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
7687 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
7689 return basic_ostream_print_double(this, val, num_put_short_use_facet(
7690 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7693 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
7695 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7696 int state = IOSTATE_goodbit;
7698 TRACE("(%p %lf)\n", this, val);
7700 if(basic_ostream_wchar_sentry_create(this)) {
7701 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7702 ostreambuf_iterator_wchar dest;
7704 memset(&dest, 0, sizeof(dest));
7705 dest.strbuf = strbuf;
7706 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7708 basic_ostream_wchar_sentry_destroy(this);
7710 basic_ios_wchar_setstate(base, state);
7711 return this;
7714 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
7715 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
7716 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
7717 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
7719 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
7720 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7723 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
7724 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
7725 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
7726 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
7728 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
7729 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7732 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7733 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7734 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7735 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7736 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
7737 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
7739 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7740 IOSB_iostate state = IOSTATE_badbit;
7741 unsigned short c = '\n';
7743 TRACE("(%p %p)\n", this, val);
7745 if(basic_ostream_wchar_sentry_create(this)) {
7746 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
7747 c = basic_streambuf_wchar_snextc(val)) {
7748 state = IOSTATE_goodbit;
7750 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
7751 state = IOSTATE_badbit;
7752 break;
7755 }else {
7756 state = IOSTATE_badbit;
7758 basic_ostream_wchar_sentry_destroy(this);
7760 ios_base_width_set(&base->base, 0);
7761 basic_ios_wchar_setstate(base, state);
7762 return this;
7765 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
7767 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7768 int state = IOSTATE_goodbit;
7770 TRACE("(%p %p)\n", this, val);
7772 if(basic_ostream_wchar_sentry_create(this)) {
7773 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7774 ostreambuf_iterator_wchar dest;
7776 memset(&dest, 0, sizeof(dest));
7777 dest.strbuf = strbuf;
7778 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7780 basic_ostream_wchar_sentry_destroy(this);
7782 basic_ios_wchar_setstate(base, state);
7783 return this;
7786 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
7787 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
7788 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
7789 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
7791 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
7792 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7795 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
7796 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
7797 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
7798 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
7800 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
7801 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7804 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
7806 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7807 int state = IOSTATE_goodbit;
7809 TRACE("(%p)\n", this);
7811 if(basic_ostream_wchar_sentry_create(this)) {
7812 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7813 ostreambuf_iterator_wchar dest;
7815 memset(&dest, 0, sizeof(dest));
7816 dest.strbuf = strbuf;
7817 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7819 basic_ostream_wchar_sentry_destroy(this);
7821 basic_ios_wchar_setstate(base, state);
7822 return this;
7825 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
7826 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
7827 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
7828 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
7830 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
7831 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7834 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
7835 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
7836 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
7837 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
7839 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
7840 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7843 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
7845 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7846 int state = IOSTATE_goodbit;
7848 TRACE("(%p)\n", this);
7850 if(basic_ostream_wchar_sentry_create(this)) {
7851 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7852 ostreambuf_iterator_wchar dest;
7854 memset(&dest, 0, sizeof(dest));
7855 dest.strbuf = strbuf;
7856 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7858 basic_ostream_wchar_sentry_destroy(this);
7860 basic_ios_wchar_setstate(base, state);
7861 return this;
7864 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
7865 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
7866 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
7867 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7869 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
7870 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7873 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
7874 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
7875 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
7876 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7878 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
7879 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7882 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
7884 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7885 int state = IOSTATE_goodbit;
7887 TRACE("(%p %x)\n", this, val);
7889 if(basic_ostream_wchar_sentry_create(this)) {
7890 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7891 ostreambuf_iterator_wchar dest;
7893 memset(&dest, 0, sizeof(dest));
7894 dest.strbuf = strbuf;
7895 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7897 basic_ostream_wchar_sentry_destroy(this);
7899 basic_ios_wchar_setstate(base, state);
7900 return this;
7903 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
7904 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
7905 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
7906 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7908 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
7909 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7912 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
7913 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
7914 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
7915 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7917 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
7918 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7921 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7922 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7923 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7924 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7925 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
7927 TRACE("(%p)\n", ostr);
7929 basic_ostream_wchar_put(ostr, 0);
7930 return ostr;
7933 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7934 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7935 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7936 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7937 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
7939 TRACE("(%p)\n", ostr);
7941 basic_ostream_wchar_put(ostr, '\n');
7942 basic_ostream_wchar_flush(ostr);
7943 return ostr;
7946 /* ??$?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 */
7947 /* ??$?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 */
7948 /* ??$?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 */
7949 /* ??$?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 */
7950 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
7952 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7953 IOSB_iostate state = IOSTATE_goodbit;
7955 TRACE("(%p %p)\n", ostr, str);
7957 if(basic_ostream_wchar_sentry_create(ostr)) {
7958 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
7959 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7961 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7962 for(; pad!=0; pad--) {
7963 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7964 state = IOSTATE_badbit;
7965 break;
7970 if(state == IOSTATE_goodbit) {
7971 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7972 state = IOSTATE_badbit;
7975 if(state == IOSTATE_goodbit) {
7976 for(; pad!=0; pad--) {
7977 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7978 state = IOSTATE_badbit;
7979 break;
7984 base->base.wide = 0;
7985 }else {
7986 state = IOSTATE_badbit;
7988 basic_ostream_wchar_sentry_destroy(ostr);
7990 basic_ios_wchar_setstate(base, state);
7991 return ostr;
7994 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
7995 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
7996 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7997 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7998 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
8000 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
8001 IOSB_iostate state = IOSTATE_goodbit;
8003 TRACE("(%p %d)\n", ostr, ch);
8005 if(basic_ostream_wchar_sentry_create(ostr)) {
8006 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
8008 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
8009 for(; pad!=0; pad--) {
8010 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8011 state = IOSTATE_badbit;
8012 break;
8017 if(state == IOSTATE_goodbit) {
8018 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
8019 state = IOSTATE_badbit;
8022 if(state == IOSTATE_goodbit) {
8023 for(; pad!=0; pad--) {
8024 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8025 state = IOSTATE_badbit;
8026 break;
8031 base->base.wide = 0;
8032 }else {
8033 state = IOSTATE_badbit;
8035 basic_ostream_wchar_sentry_destroy(ostr);
8037 basic_ios_wchar_setstate(base, state);
8038 return ostr;
8041 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
8042 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
8043 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
8044 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
8045 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
8047 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
8048 IOSB_iostate state = IOSTATE_goodbit;
8050 TRACE("(%p %s)\n", ostr, debugstr_w(str));
8052 if(basic_ostream_wchar_sentry_create(ostr)) {
8053 MSVCP_size_t len = wcslen(str);
8054 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
8056 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
8057 for(; pad!=0; pad--) {
8058 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8059 state = IOSTATE_badbit;
8060 break;
8065 if(state == IOSTATE_goodbit) {
8066 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
8067 state = IOSTATE_badbit;
8070 if(state == IOSTATE_goodbit) {
8071 for(; pad!=0; pad--) {
8072 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8073 state = IOSTATE_badbit;
8074 break;
8079 base->base.wide = 0;
8080 }else {
8081 state = IOSTATE_badbit;
8083 basic_ostream_wchar_sentry_destroy(ostr);
8085 basic_ios_wchar_setstate(base, state);
8086 return ostr;
8089 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8090 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8091 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8092 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8093 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
8094 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
8095 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
8097 TRACE("(%p %p)\n", this, pfunc);
8098 pfunc(this);
8099 return this;
8102 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
8103 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
8104 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
8105 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
8106 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
8107 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
8108 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
8110 TRACE("(%p %p)\n", this, pfunc);
8111 pfunc(basic_ostream_wchar_get_basic_ios(this));
8112 return this;
8115 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8116 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8117 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8118 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8119 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
8120 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
8121 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
8123 TRACE("(%p %p)\n", this, pfunc);
8124 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
8125 return this;
8128 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
8129 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
8130 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
8131 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IEAAXAEAV12@@Z */
8132 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_swap, 8)
8133 void __thiscall basic_ostream_wchar_swap(basic_ostream_wchar *this, basic_ostream_wchar *r)
8135 TRACE("(%p %p)\n", this, r);
8137 if(this == r)
8138 return;
8140 basic_ios_wchar_swap(basic_ostream_wchar_get_basic_ios(this),
8141 basic_ostream_wchar_get_basic_ios(r));
8144 /* Caution: basic_istream uses virtual inheritance. */
8145 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
8147 return (basic_ios_char*)((char*)this+this->vbtable[1]);
8150 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
8152 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
8155 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
8157 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
8160 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
8161 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
8162 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
8163 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)
8165 basic_ios_char *base;
8167 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
8169 if(virt_init) {
8170 this->vbtable = basic_istream_char_vbtable;
8171 base = basic_istream_char_get_basic_ios(this);
8172 INIT_BASIC_IOS_VTORDISP(base);
8173 basic_ios_char_ctor(base);
8174 }else {
8175 base = basic_istream_char_get_basic_ios(this);
8178 base->base.vtable = &MSVCP_basic_istream_char_vtable;
8179 this->count = 0;
8180 if(!noinit)
8181 basic_ios_char_init(base, strbuf, isstd);
8182 return this;
8185 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
8186 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
8187 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
8188 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8190 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8193 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8194 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8195 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
8196 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
8198 basic_ios_char *base;
8200 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
8202 if(virt_init) {
8203 this->vbtable = basic_istream_char_vbtable;
8204 base = basic_istream_char_get_basic_ios(this);
8205 INIT_BASIC_IOS_VTORDISP(base);
8206 basic_ios_char_ctor(base);
8207 }else {
8208 base = basic_istream_char_get_basic_ios(this);
8211 base->base.vtable = &MSVCP_basic_istream_char_vtable;
8212 ios_base_Addstd(&base->base);
8213 return this;
8216 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
8217 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
8218 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
8219 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
8221 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
8223 /* don't destroy virtual base here */
8224 TRACE("(%p)\n", this);
8227 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
8228 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
8229 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
8230 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
8232 basic_ios_char *base = basic_istream_char_to_basic_ios(this);
8234 TRACE("(%p)\n", this);
8236 basic_istream_char_dtor(base);
8237 basic_ios_char_dtor(base);
8240 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
8241 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
8243 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
8245 TRACE("(%p %x)\n", this, flags);
8247 if(flags & 2) {
8248 /* we have an array, with the number of elements stored before the first object */
8249 INT_PTR i, *ptr = (INT_PTR *)this-1;
8251 for(i=*ptr-1; i>=0; i--)
8252 basic_istream_char_vbase_dtor(this+i);
8253 MSVCRT_operator_delete(ptr);
8254 } else {
8255 basic_istream_char_vbase_dtor(this);
8256 if(flags & 1)
8257 MSVCRT_operator_delete(this);
8260 return this;
8263 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
8264 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
8265 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
8266 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
8268 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8270 TRACE("(%p %d)\n", this, noskip);
8272 if(ios_base_good(&base->base)) {
8273 if(basic_ios_char_tie_get(base))
8274 basic_ostream_char_flush(basic_ios_char_tie_get(base));
8276 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
8277 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8278 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8279 int ch;
8281 for(ch = basic_streambuf_char_sgetc(strbuf); ;
8282 ch = basic_streambuf_char_snextc(strbuf)) {
8283 if(ch == EOF) {
8284 basic_ios_char_setstate(base, IOSTATE_eofbit);
8285 break;
8288 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
8289 break;
8294 if(!ios_base_good(&base->base)) {
8295 basic_ios_char_setstate(base, IOSTATE_failbit);
8296 return FALSE;
8299 return TRUE;
8302 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
8303 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
8304 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
8305 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
8307 return basic_istream_char__Ipfx(this, noskip);
8310 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
8311 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
8312 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
8313 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
8315 TRACE("(%p)\n", this);
8318 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
8320 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
8322 if(basic_ios_char_rdbuf_get(base))
8323 call_basic_streambuf_char__Lock(base->strbuf);
8325 return basic_istream_char_ipfx(istr, noskip);
8328 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
8330 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
8332 if(basic_ios_char_rdbuf_get(base))
8333 call_basic_streambuf_char__Unlock(base->strbuf);
8336 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
8337 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
8338 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
8339 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
8340 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
8341 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
8343 TRACE("(%p)\n", this);
8344 return this->count;
8347 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8348 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8349 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
8350 int __thiscall basic_istream_char_get(basic_istream_char *this)
8352 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8353 int ret;
8355 TRACE("(%p)\n", this);
8357 this->count = 0;
8359 if(!basic_istream_char_sentry_create(this, TRUE)) {
8360 basic_istream_char_sentry_destroy(this);
8361 return EOF;
8364 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
8365 basic_istream_char_sentry_destroy(this);
8366 if(ret == EOF)
8367 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
8368 else
8369 this->count++;
8371 return ret;
8374 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
8375 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
8376 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
8377 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
8379 int ret;
8381 TRACE("(%p %p)\n", this, ch);
8383 ret = basic_istream_char_get(this);
8384 if(ret != EOF)
8385 *ch = (char)ret;
8386 return this;
8389 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8390 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8391 #if STREAMSIZE_BITS == 64
8392 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
8393 #else
8394 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
8395 #endif
8396 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8398 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8399 int ch = delim;
8401 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_an(&delim, 1));
8403 this->count = 0;
8405 if(basic_istream_char_sentry_create(this, TRUE)) {
8406 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8408 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
8409 ch = basic_streambuf_char_snextc(strbuf)) {
8410 if(ch==EOF || ch==delim)
8411 break;
8413 *str++ = ch;
8414 this->count++;
8415 count--;
8418 basic_istream_char_sentry_destroy(this);
8420 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8421 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8422 if(count > 0)
8423 *str = 0;
8424 return this;
8427 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8428 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8429 #if STREAMSIZE_BITS == 64
8430 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
8431 #else
8432 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
8433 #endif
8434 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
8436 return basic_istream_char_get_str_delim(this, str, count, '\n');
8439 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8440 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8441 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
8442 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
8444 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8445 int ch = delim;
8447 TRACE("(%p %p %s)\n", this, strbuf, debugstr_an(&delim, 1));
8449 this->count = 0;
8451 if(basic_istream_char_sentry_create(this, TRUE)) {
8452 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
8454 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
8455 ch = basic_streambuf_char_snextc(strbuf_read)) {
8456 if(ch==EOF || ch==delim)
8457 break;
8459 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
8460 break;
8461 this->count++;
8464 basic_istream_char_sentry_destroy(this);
8466 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8467 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8468 return this;
8471 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8472 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8473 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
8474 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
8476 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
8479 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8480 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8481 #if STREAMSIZE_BITS == 64
8482 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
8483 #else
8484 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
8485 #endif
8486 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8488 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8489 int ch = (unsigned char)delim;
8491 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_an(&delim, 1));
8493 this->count = 0;
8495 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
8496 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8498 while(count > 1) {
8499 ch = basic_streambuf_char_sbumpc(strbuf);
8501 if(ch==EOF || ch==(unsigned char)delim)
8502 break;
8504 *str++ = ch;
8505 this->count++;
8506 count--;
8509 if(ch == (unsigned char)delim)
8510 this->count++;
8511 else if(ch != EOF) {
8512 ch = basic_streambuf_char_sgetc(strbuf);
8514 if(ch == (unsigned char)delim) {
8515 basic_streambuf_char__Gninc(strbuf);
8516 this->count++;
8520 basic_istream_char_sentry_destroy(this);
8522 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8523 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8524 if(count > 0)
8525 *str = 0;
8526 return this;
8529 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8530 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8531 #if STREAMSIZE_BITS == 64
8532 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
8533 #else
8534 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
8535 #endif
8536 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
8538 return basic_istream_char_getline_delim(this, str, count, '\n');
8541 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
8542 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8543 #if STREAMSIZE_BITS == 64
8544 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
8545 #else
8546 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
8547 #endif
8548 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
8550 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8551 int ch = (unsigned char)delim;
8552 unsigned int state;
8554 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8556 this->count = 0;
8558 if(basic_istream_char_sentry_create(this, TRUE)) {
8559 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8560 state = IOSTATE_goodbit;
8562 while(count > 0) {
8563 ch = basic_streambuf_char_sbumpc(strbuf);
8565 if(ch==EOF) {
8566 state = IOSTATE_eofbit;
8567 break;
8570 if(ch==delim)
8571 break;
8573 this->count++;
8574 if(count != INT_MAX)
8575 count--;
8577 }else
8578 state = IOSTATE_failbit;
8579 basic_istream_char_sentry_destroy(this);
8581 basic_ios_char_setstate(base, state);
8582 return this;
8585 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
8586 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
8587 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
8589 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8590 int ch = '\n';
8592 TRACE("(%p)\n", istream);
8594 if(basic_istream_char_sentry_create(istream, TRUE)) {
8595 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8596 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(strbuf));
8598 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
8599 ch = basic_streambuf_char_snextc(strbuf)) {
8600 if(ch == EOF)
8601 break;
8604 basic_istream_char_sentry_destroy(istream);
8606 if(ch == EOF)
8607 basic_ios_char_setstate(base, IOSTATE_eofbit);
8608 return istream;
8611 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8612 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8613 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
8614 int __thiscall basic_istream_char_peek(basic_istream_char *this)
8616 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8617 int ret = EOF;
8619 TRACE("(%p)\n", this);
8621 this->count = 0;
8623 if(basic_istream_char_sentry_create(this, TRUE))
8624 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8625 basic_istream_char_sentry_destroy(this);
8627 if (ret == EOF)
8628 basic_ios_char_setstate(base, IOSTATE_eofbit);
8630 return ret;
8633 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
8634 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
8635 #if STREAMSIZE_BITS == 64
8636 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
8637 #else
8638 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
8639 #endif
8640 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8642 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8643 IOSB_iostate state = IOSTATE_goodbit;
8645 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8647 if(basic_istream_char_sentry_create(this, TRUE)) {
8648 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8650 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
8651 if(this->count != count)
8652 state |= IOSTATE_failbit | IOSTATE_eofbit;
8653 }else {
8654 this->count = 0;
8656 basic_istream_char_sentry_destroy(this);
8658 basic_ios_char_setstate(base, state);
8659 return this;
8662 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8663 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8664 #if STREAMSIZE_BITS == 64
8665 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
8666 #else
8667 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
8668 #endif
8669 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
8671 return basic_istream_char__Read_s(this, str, -1, count);
8674 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
8675 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
8676 #if STREAMSIZE_BITS == 64
8677 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
8678 #else
8679 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
8680 #endif
8681 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8683 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8684 IOSB_iostate state = IOSTATE_goodbit;
8686 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8688 this->count = 0;
8690 if(basic_istream_char_sentry_create(this, TRUE)) {
8691 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
8692 if(avail > count)
8693 avail = count;
8695 if(avail == -1)
8696 state |= IOSTATE_eofbit;
8697 else if(avail > 0)
8698 basic_istream_char__Read_s(this, str, size, avail);
8699 }else {
8700 state |= IOSTATE_failbit;
8702 basic_istream_char_sentry_destroy(this);
8704 basic_ios_char_setstate(base, state);
8705 return this->count;
8708 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
8709 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
8710 #if STREAMSIZE_BITS == 64
8711 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
8712 #else
8713 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
8714 #endif
8715 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
8717 return basic_istream_char__Readsome_s(this, str, count, count);
8720 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
8721 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
8722 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
8723 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
8725 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8726 IOSB_iostate state = IOSTATE_goodbit;
8728 TRACE("(%p %c)\n", this, ch);
8730 this->count = 0;
8732 if(basic_istream_char_sentry_create(this, TRUE)) {
8733 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8735 if(!ios_base_good(&base->base))
8736 state |= IOSTATE_failbit;
8737 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
8738 state |= IOSTATE_badbit;
8740 basic_istream_char_sentry_destroy(this);
8742 basic_ios_char_setstate(base, state);
8743 return this;
8746 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
8747 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
8748 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
8749 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
8751 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8752 IOSB_iostate state = IOSTATE_goodbit;
8754 TRACE("(%p)\n", this);
8756 this->count = 0;
8758 if(basic_istream_char_sentry_create(this, TRUE)) {
8759 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8761 if(!ios_base_good(&base->base))
8762 state |= IOSTATE_failbit;
8763 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
8764 state |= IOSTATE_badbit;
8766 basic_istream_char_sentry_destroy(this);
8768 basic_ios_char_setstate(base, state);
8769 return this;
8772 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8773 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8774 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
8775 int __thiscall basic_istream_char_sync(basic_istream_char *this)
8777 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8778 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8780 TRACE("(%p)\n", this);
8782 if(!strbuf)
8783 return -1;
8785 if(basic_istream_char_sentry_create(this, TRUE)) {
8786 if(basic_streambuf_char_pubsync(strbuf) != -1) {
8787 basic_istream_char_sentry_destroy(this);
8788 return 0;
8791 basic_istream_char_sentry_destroy(this);
8793 basic_ios_char_setstate(base, IOSTATE_badbit);
8794 return -1;
8797 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8798 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8799 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
8800 fpos_mbstatet* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_mbstatet *ret)
8802 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8804 TRACE("(%p %p)\n", this, ret);
8806 #if _MSVCP_VER >= 110
8807 if(basic_istream_char_sentry_create(this, TRUE)) {
8808 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8809 ret, 0, SEEKDIR_cur, OPENMODE_in);
8810 }else {
8811 ret->off = -1;
8812 ret->pos = 0;
8813 memset(&ret->state, 0, sizeof(ret->state));
8815 basic_istream_char_sentry_destroy(this);
8816 #else
8817 if(ios_base_fail(&base->base)) {
8818 ret->off = -1;
8819 ret->pos = 0;
8820 memset(&ret->state, 0, sizeof(ret->state));
8821 return ret;
8824 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8825 ret, 0, SEEKDIR_cur, OPENMODE_in);
8826 #endif
8828 return ret;
8831 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
8832 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
8833 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
8834 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8835 #if STREAMOFF_BITS == 64
8836 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
8837 #else
8838 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
8839 #endif
8840 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
8842 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8843 #if _MSVCP_VER >= 110
8844 IOSB_iostate state;
8846 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8848 state = ios_base_rdstate(&base->base);
8849 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
8851 if(basic_istream_char_sentry_create(this, TRUE)) {
8852 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8853 fpos_mbstatet ret;
8855 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8857 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8858 basic_ios_char_setstate(base, IOSTATE_failbit);
8860 basic_istream_char_sentry_destroy(this);
8861 #else
8862 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8864 if(!ios_base_fail(&base->base)) {
8865 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8866 fpos_mbstatet ret;
8868 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8870 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8871 basic_ios_char_setstate(base, IOSTATE_failbit);
8872 else
8873 basic_ios_char_clear(base, IOSTATE_goodbit);
8874 return this;
8875 }else
8876 basic_ios_char_clear(base, IOSTATE_goodbit);
8877 #endif
8878 return this;
8881 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8882 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8883 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
8884 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_mbstatet pos)
8886 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8887 #if _MSVCP_VER >= 110
8888 IOSB_iostate state;
8890 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
8892 state = ios_base_rdstate(&base->base);
8893 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
8895 if(basic_istream_char_sentry_create(this, TRUE)) {
8896 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8897 fpos_mbstatet ret;
8899 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8901 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8902 basic_ios_char_setstate(base, IOSTATE_failbit);
8904 basic_istream_char_sentry_destroy(this);
8905 #else
8906 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
8908 if(!ios_base_fail(&base->base)) {
8909 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8910 fpos_mbstatet ret;
8912 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8914 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
8915 basic_ios_char_setstate(base, IOSTATE_failbit);
8916 else
8917 basic_ios_char_clear(base, IOSTATE_goodbit);
8918 return this;
8919 }else
8920 basic_ios_char_clear(base, IOSTATE_goodbit);
8921 #endif
8922 return this;
8925 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
8926 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
8927 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
8928 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
8930 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8931 int state = IOSTATE_goodbit;
8933 TRACE("(%p %p)\n", this, v);
8935 if(basic_istream_char_sentry_create(this, FALSE)) {
8936 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8937 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8938 istreambuf_iterator_char first={0}, last={0};
8939 LONG tmp;
8941 first.strbuf = strbuf;
8942 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8944 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8945 *v = tmp;
8946 else
8947 state |= IOSTATE_failbit;
8949 basic_istream_char_sentry_destroy(this);
8951 basic_ios_char_setstate(base, state);
8952 return this;
8955 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
8956 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
8957 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
8958 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
8960 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8961 int state = IOSTATE_goodbit;
8963 TRACE("(%p %p)\n", this, v);
8965 if(basic_istream_char_sentry_create(this, FALSE)) {
8966 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8967 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8968 istreambuf_iterator_char first={0}, last={0};
8970 first.strbuf = strbuf;
8971 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
8973 basic_istream_char_sentry_destroy(this);
8975 basic_ios_char_setstate(base, state);
8976 return this;
8979 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
8980 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
8981 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
8982 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
8984 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8985 int state = IOSTATE_goodbit;
8987 TRACE("(%p %p)\n", this, v);
8989 if(basic_istream_char_sentry_create(this, FALSE)) {
8990 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8991 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8992 istreambuf_iterator_char first={0}, last={0};
8994 first.strbuf = strbuf;
8995 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8997 basic_istream_char_sentry_destroy(this);
8999 basic_ios_char_setstate(base, state);
9000 return this;
9003 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
9004 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
9005 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
9006 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
9008 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9009 int state = IOSTATE_goodbit;
9011 TRACE("(%p %p)\n", this, v);
9013 if(basic_istream_char_sentry_create(this, FALSE)) {
9014 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9015 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9016 istreambuf_iterator_char first={0}, last={0};
9018 first.strbuf = strbuf;
9019 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
9021 basic_istream_char_sentry_destroy(this);
9023 basic_ios_char_setstate(base, state);
9024 return this;
9027 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
9028 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
9029 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
9030 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
9032 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9033 int state = IOSTATE_goodbit;
9035 TRACE("(%p %p)\n", this, v);
9037 if(basic_istream_char_sentry_create(this, FALSE)) {
9038 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9039 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9040 istreambuf_iterator_char first={0}, last={0};
9042 first.strbuf = strbuf;
9043 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
9045 basic_istream_char_sentry_destroy(this);
9047 basic_ios_char_setstate(base, state);
9048 return this;
9051 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
9052 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
9053 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
9054 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
9056 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9057 int state = IOSTATE_goodbit;
9059 TRACE("(%p %p)\n", this, v);
9061 if(basic_istream_char_sentry_create(this, FALSE)) {
9062 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9063 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9064 istreambuf_iterator_char first={0}, last={0};
9066 first.strbuf = strbuf;
9067 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
9069 basic_istream_char_sentry_destroy(this);
9071 basic_ios_char_setstate(base, state);
9072 return this;
9075 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
9076 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
9077 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
9078 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
9080 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9081 int state = IOSTATE_goodbit;
9083 TRACE("(%p %p)\n", this, v);
9085 if(basic_istream_char_sentry_create(this, FALSE)) {
9086 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9087 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9088 istreambuf_iterator_char first={0}, last={0};
9090 first.strbuf = strbuf;
9091 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
9093 basic_istream_char_sentry_destroy(this);
9095 basic_ios_char_setstate(base, state);
9096 return this;
9099 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
9100 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
9101 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
9102 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
9104 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9105 int state = IOSTATE_goodbit;
9107 TRACE("(%p %p)\n", this, v);
9109 if(basic_istream_char_sentry_create(this, FALSE)) {
9110 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9111 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9112 istreambuf_iterator_char first={0}, last={0};
9114 first.strbuf = strbuf;
9115 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
9117 basic_istream_char_sentry_destroy(this);
9119 basic_ios_char_setstate(base, state);
9120 return this;
9123 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
9124 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
9125 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
9126 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
9128 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9129 int state = IOSTATE_goodbit;
9131 TRACE("(%p %p)\n", this, v);
9133 if(basic_istream_char_sentry_create(this, FALSE)) {
9134 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9135 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9136 istreambuf_iterator_char first={0}, last={0};
9138 first.strbuf = strbuf;
9139 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
9141 basic_istream_char_sentry_destroy(this);
9143 basic_ios_char_setstate(base, state);
9144 return this;
9147 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
9148 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
9149 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
9150 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
9152 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9153 int state = IOSTATE_goodbit;
9155 TRACE("(%p %p)\n", this, v);
9157 if(basic_istream_char_sentry_create(this, FALSE)) {
9158 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9159 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9160 istreambuf_iterator_char first={0}, last={0};
9162 first.strbuf = strbuf;
9163 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
9165 basic_istream_char_sentry_destroy(this);
9167 basic_ios_char_setstate(base, state);
9168 return this;
9171 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
9172 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
9173 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
9174 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
9176 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9177 int state = IOSTATE_goodbit;
9179 TRACE("(%p %p)\n", this, v);
9181 if(basic_istream_char_sentry_create(this, FALSE)) {
9182 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9183 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9184 istreambuf_iterator_char first={0}, last={0};
9186 first.strbuf = strbuf;
9187 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
9189 basic_istream_char_sentry_destroy(this);
9191 basic_ios_char_setstate(base, state);
9192 return this;
9195 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
9196 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
9197 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
9198 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
9200 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9201 int state = IOSTATE_goodbit;
9203 TRACE("(%p %p)\n", this, v);
9205 if(basic_istream_char_sentry_create(this, FALSE)) {
9206 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9207 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9208 istreambuf_iterator_char first={0}, last={0};
9210 first.strbuf = strbuf;
9211 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
9213 basic_istream_char_sentry_destroy(this);
9215 basic_ios_char_setstate(base, state);
9216 return this;
9219 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
9220 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
9221 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
9222 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
9224 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9225 int state = IOSTATE_goodbit;
9227 TRACE("(%p %p)\n", this, v);
9229 if(basic_istream_char_sentry_create(this, FALSE)) {
9230 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9231 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9232 istreambuf_iterator_char first={0}, last={0};
9234 first.strbuf = strbuf;
9235 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
9237 basic_istream_char_sentry_destroy(this);
9239 basic_ios_char_setstate(base, state);
9240 return this;
9243 /* ??$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 */
9244 /* ??$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 */
9245 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
9246 basic_istream_char *istream, basic_string_char *str, char delim)
9248 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9249 IOSB_iostate state = IOSTATE_goodbit;
9250 int c = (unsigned char)delim;
9252 TRACE("(%p %p %s)\n", istream, str, debugstr_an(&delim, 1));
9254 if(basic_istream_char_sentry_create(istream, TRUE)) {
9255 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9256 MSVCP_basic_string_char_clear(str);
9258 c = basic_streambuf_char_sgetc(strbuf);
9259 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
9260 MSVCP_basic_string_char_append_ch(str, c);
9261 if(c==EOF) state |= IOSTATE_eofbit;
9262 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
9264 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
9266 basic_istream_char_sentry_destroy(istream);
9268 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
9269 return istream;
9272 /* ??$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 */
9273 /* ??$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 */
9274 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
9275 basic_istream_char *istream, basic_string_char *str)
9277 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
9280 /* ??$?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 */
9281 /* ??$?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 */
9282 basic_istream_char* __cdecl basic_istream_char_read_bstr(
9283 basic_istream_char *istream, basic_string_char *str)
9285 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9286 IOSB_iostate state = IOSTATE_failbit;
9287 int c = '\n';
9289 TRACE("(%p %p)\n", istream, str);
9291 if(basic_istream_char_sentry_create(istream, FALSE)) {
9292 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
9293 MSVCP_size_t count = ios_base_width_get(&base->base);
9295 if(!count)
9296 count = -1;
9298 MSVCP_basic_string_char_clear(str);
9300 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
9301 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9302 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
9303 state = IOSTATE_goodbit;
9304 MSVCP_basic_string_char_append_ch(str, c);
9307 basic_istream_char_sentry_destroy(istream);
9309 ios_base_width_set(&base->base, 0);
9310 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9311 return istream;
9314 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
9315 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
9316 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
9317 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
9318 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
9319 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
9320 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
9322 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9323 IOSB_iostate state = IOSTATE_failbit;
9324 int c = '\n';
9326 TRACE("(%p %p)\n", istream, str);
9328 if(basic_istream_char_sentry_create(istream, FALSE)) {
9329 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
9330 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
9332 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
9333 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9334 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
9335 state = IOSTATE_goodbit;
9336 *str++ = c;
9339 basic_istream_char_sentry_destroy(istream);
9341 *str = 0;
9342 ios_base_width_set(&base->base, 0);
9343 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9344 return istream;
9347 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
9348 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
9349 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
9350 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
9351 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
9352 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
9353 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
9355 IOSB_iostate state = IOSTATE_failbit;
9356 int c = 0;
9358 TRACE("(%p %p)\n", istream, ch);
9360 if(basic_istream_char_sentry_create(istream, FALSE)) {
9361 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
9362 basic_istream_char_get_basic_ios(istream)));
9363 if(c != EOF) {
9364 state = IOSTATE_goodbit;
9365 *ch = c;
9368 basic_istream_char_sentry_destroy(istream);
9370 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
9371 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9372 return istream;
9375 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9376 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9377 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
9378 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
9379 basic_istream_char *this, basic_streambuf_char *streambuf)
9381 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9382 IOSB_iostate state = IOSTATE_failbit;
9383 int c = '\n';
9385 TRACE("(%p %p)\n", this, streambuf);
9387 if(basic_istream_char_sentry_create(this, FALSE)) {
9388 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
9389 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
9390 state = IOSTATE_goodbit;
9391 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
9392 break;
9395 basic_istream_char_sentry_destroy(this);
9397 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9398 return this;
9401 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9402 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9403 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
9404 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
9405 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
9407 TRACE("(%p %p)\n", this, pfunc);
9408 pfunc(this);
9409 return this;
9412 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
9413 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
9414 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
9415 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
9416 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
9418 TRACE("(%p %p)\n", this, pfunc);
9419 pfunc(basic_istream_char_get_basic_ios(this));
9420 return this;
9423 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9424 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9425 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
9426 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
9427 ios_base* (__cdecl *pfunc)(ios_base*))
9429 TRACE("(%p %p)\n", this, pfunc);
9430 pfunc(&basic_istream_char_get_basic_ios(this)->base);
9431 return this;
9434 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@M@0@@Z */
9435 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@M@0@@Z */
9436 basic_istream_char* __cdecl basic_istream_char_read_complex_float(basic_istream_char *this, complex_float *v)
9438 float r;
9439 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9441 TRACE("(%p %p)\n", this, v);
9443 ws_basic_istream_char(this);
9444 if(basic_istream_char_peek(this) == '(') {
9445 char c;
9446 basic_istream_char_get(this);
9447 basic_istream_char_read_float(this, &r);
9449 if(ios_base_fail(&base->base))
9450 return this;
9452 ws_basic_istream_char(this);
9453 c = basic_istream_char_peek(this);
9454 if(c == ',') {
9455 float i;
9456 basic_istream_char_get(this);
9457 basic_istream_char_read_float(this, &i);
9459 if(ios_base_fail(&base->base))
9460 return this;
9462 ws_basic_istream_char(this);
9463 c = basic_istream_char_peek(this);
9464 if(c == ')') { /* supported format: (real, imag) */
9465 basic_istream_char_get(this);
9466 v->real = r;
9467 v->imag = i;
9468 }else {
9469 basic_ios_char_setstate(base, IOSTATE_failbit);
9470 return this;
9472 }else if(c == ')') { /* supported format: (real) */
9473 basic_istream_char_get(this);
9474 v->real = r;
9475 v->imag = 0;
9476 }else {
9477 basic_ios_char_setstate(base, IOSTATE_failbit);
9478 return this;
9480 }else { /* supported format: real */
9481 basic_istream_char_read_float(this, &r);
9483 if(ios_base_fail(&base->base))
9484 return this;
9486 v->real = r;
9487 v->imag = 0;
9490 return this;
9493 /* ??$?5NDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@N@0@@Z */
9494 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@N@0@@Z */
9495 basic_istream_char* __cdecl basic_istream_char_read_complex_double(basic_istream_char *this, complex_double *v)
9497 double r;
9498 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9500 TRACE("(%p %p)\n", this, v);
9502 ws_basic_istream_char(this);
9503 if(basic_istream_char_peek(this) == '(') {
9504 char c;
9505 basic_istream_char_get(this);
9506 basic_istream_char_read_double(this, &r);
9508 if(ios_base_fail(&base->base))
9509 return this;
9511 ws_basic_istream_char(this);
9512 c = basic_istream_char_peek(this);
9513 if(c == ',') {
9514 double i;
9515 basic_istream_char_get(this);
9516 basic_istream_char_read_double(this, &i);
9518 if(ios_base_fail(&base->base))
9519 return this;
9521 ws_basic_istream_char(this);
9522 c = basic_istream_char_peek(this);
9523 if(c == ')') { /* supported format: (real, imag) */
9524 basic_istream_char_get(this);
9525 v->real = r;
9526 v->imag = i;
9527 }else {
9528 basic_ios_char_setstate(base, IOSTATE_failbit);
9529 return this;
9531 }else if(c == ')') { /* supported format: (real) */
9532 basic_istream_char_get(this);
9533 v->real = r;
9534 v->imag = 0;
9535 }else {
9536 basic_ios_char_setstate(base, IOSTATE_failbit);
9537 return this;
9539 }else { /* supported format: real */
9540 basic_istream_char_read_double(this, &r);
9542 if(ios_base_fail(&base->base))
9543 return this;
9545 v->real = r;
9546 v->imag = 0;
9549 return this;
9552 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@O@0@@Z */
9553 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@O@0@@Z */
9554 basic_istream_char* __cdecl basic_istream_char_read_complex_ldouble(basic_istream_char *this, complex_double *v)
9556 double r;
9557 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9559 TRACE("(%p %p)\n", this, v);
9561 ws_basic_istream_char(this);
9562 if(basic_istream_char_peek(this) == '(') {
9563 char c;
9564 basic_istream_char_get(this);
9565 basic_istream_char_read_ldouble(this, &r);
9567 if(ios_base_fail(&base->base))
9568 return this;
9570 ws_basic_istream_char(this);
9571 c = basic_istream_char_peek(this);
9572 if(c == ',') {
9573 double i;
9574 basic_istream_char_get(this);
9575 basic_istream_char_read_ldouble(this, &i);
9577 if(ios_base_fail(&base->base))
9578 return this;
9580 ws_basic_istream_char(this);
9581 c = basic_istream_char_peek(this);
9582 if(c == ')') { /* supported format: (real, imag) */
9583 basic_istream_char_get(this);
9584 v->real = r;
9585 v->imag = i;
9586 }else {
9587 basic_ios_char_setstate(base, IOSTATE_failbit);
9588 return this;
9590 }else if(c == ')') { /* supported format: (real) */
9591 basic_istream_char_get(this);
9592 v->real = r;
9593 v->imag = 0;
9594 }else {
9595 basic_ios_char_setstate(base, IOSTATE_failbit);
9596 return this;
9598 }else { /* supported format: real */
9599 basic_istream_char_read_ldouble(this, &r);
9601 if(ios_base_fail(&base->base))
9602 return this;
9604 v->real = r;
9605 v->imag = 0;
9608 return this;
9611 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
9612 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
9613 DEFINE_THISCALL_WRAPPER(basic_istream_char_swap, 8)
9614 void __thiscall basic_istream_char_swap(basic_istream_char *this, basic_istream_char *r)
9616 TRACE("(%p %p)\n", this, r);
9618 if(this == r)
9619 return;
9621 basic_ios_char_swap(basic_istream_char_get_basic_ios(this),
9622 basic_istream_char_get_basic_ios(r));
9623 this->count ^= r->count;
9624 r->count ^= this->count;
9625 this->count ^= r->count;
9628 /* Caution: basic_istream uses virtual inheritance. */
9629 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
9631 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
9634 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
9636 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
9639 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9641 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
9644 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9645 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9646 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
9647 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
9648 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9650 basic_ios_wchar *base;
9652 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
9654 if(virt_init) {
9655 this->vbtable = basic_istream_wchar_vbtable;
9656 base = basic_istream_wchar_get_basic_ios(this);
9657 INIT_BASIC_IOS_VTORDISP(base);
9658 basic_ios_wchar_ctor(base);
9659 }else {
9660 base = basic_istream_wchar_get_basic_ios(this);
9663 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9664 this->count = 0;
9665 if(!noinit)
9666 basic_ios_wchar_init(base, strbuf, isstd);
9667 return this;
9670 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9671 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9672 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
9673 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
9674 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9676 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
9677 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9678 return this;
9681 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9682 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9683 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
9684 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
9685 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9687 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9690 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9691 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9692 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
9693 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
9694 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9696 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9699 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9700 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9701 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
9702 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
9703 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9705 basic_ios_wchar *base;
9707 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
9709 if(virt_init) {
9710 this->vbtable = basic_istream_wchar_vbtable;
9711 base = basic_istream_wchar_get_basic_ios(this);
9712 INIT_BASIC_IOS_VTORDISP(base);
9713 basic_ios_wchar_ctor(base);
9714 }else {
9715 base = basic_istream_wchar_get_basic_ios(this);
9718 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9719 ios_base_Addstd(&base->base);
9720 return this;
9723 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9724 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9725 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
9726 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
9727 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9729 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
9730 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9731 return this;
9734 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9735 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9736 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9737 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9738 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
9739 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
9741 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9743 /* don't destroy virtual base here */
9744 TRACE("(%p)\n", this);
9747 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9748 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9749 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9750 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9751 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
9752 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
9754 basic_ios_wchar *base = basic_istream_wchar_to_basic_ios(this);
9756 TRACE("(%p)\n", this);
9758 basic_istream_wchar_dtor(base);
9759 basic_ios_wchar_dtor(base);
9762 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
9763 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9765 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9767 TRACE("(%p %x)\n", this, flags);
9769 if(flags & 2) {
9770 /* we have an array, with the number of elements stored before the first object */
9771 INT_PTR i, *ptr = (INT_PTR *)this-1;
9773 for(i=*ptr-1; i>=0; i--)
9774 basic_istream_wchar_vbase_dtor(this+i);
9775 MSVCRT_operator_delete(ptr);
9776 } else {
9777 basic_istream_wchar_vbase_dtor(this);
9778 if(flags & 1)
9779 MSVCRT_operator_delete(this);
9782 return this;
9785 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9786 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9787 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9788 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9789 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
9790 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9792 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9794 TRACE("(%p %d)\n", this, noskip);
9796 if(ios_base_good(&base->base)) {
9797 if(basic_ios_wchar_tie_get(base))
9798 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
9800 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
9801 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9802 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(base->strbuf));
9803 int ch;
9805 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
9806 ch = basic_streambuf_wchar_snextc(strbuf)) {
9807 if(ch == WEOF) {
9808 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9809 break;
9812 if(!ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
9813 break;
9818 if(!ios_base_good(&base->base)) {
9819 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9820 return FALSE;
9822 return TRUE;
9825 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9826 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9827 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9828 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9829 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
9830 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9832 return basic_istream_wchar__Ipfx(this, noskip);
9835 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9836 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9837 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9838 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9839 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
9840 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
9842 TRACE("(%p)\n", this);
9845 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
9847 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9849 if(basic_ios_wchar_rdbuf_get(base))
9850 basic_streambuf_wchar__Lock(base->strbuf);
9852 return basic_istream_wchar_ipfx(istr, noskip);
9855 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
9857 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9859 if(basic_ios_wchar_rdbuf_get(base))
9860 basic_streambuf_wchar__Unlock(base->strbuf);
9863 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
9864 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
9865 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
9866 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
9867 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
9868 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
9869 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
9870 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
9871 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
9872 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
9874 TRACE("(%p)\n", this);
9875 return this->count;
9878 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9879 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9880 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9881 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9882 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
9883 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
9885 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9886 int ret;
9888 TRACE("(%p)\n", this);
9890 this->count = 0;
9892 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
9893 basic_istream_wchar_sentry_destroy(this);
9894 return WEOF;
9897 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
9898 basic_istream_wchar_sentry_destroy(this);
9899 if(ret == WEOF)
9900 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
9901 else
9902 this->count++;
9904 return ret;
9907 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
9908 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
9909 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
9910 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
9911 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
9912 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
9914 unsigned short ret;
9916 TRACE("(%p %p)\n", this, ch);
9918 ret = basic_istream_wchar_get(this);
9919 if(ret != WEOF)
9920 *ch = (wchar_t)ret;
9921 return this;
9924 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9925 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9926 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9927 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9928 #if STREAMSIZE_BITS == 64
9929 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
9930 #else
9931 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
9932 #endif
9933 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9935 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9936 unsigned short ch = delim;
9938 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_wn(&delim, 1));
9940 this->count = 0;
9942 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9943 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9945 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
9946 ch = basic_streambuf_wchar_snextc(strbuf)) {
9947 if(ch==WEOF || ch==delim)
9948 break;
9950 *str++ = ch;
9951 this->count++;
9952 count--;
9955 basic_istream_wchar_sentry_destroy(this);
9957 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9958 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9959 if(count > 0)
9960 *str = 0;
9961 return this;
9964 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9965 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9966 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9967 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9968 #if STREAMSIZE_BITS == 64
9969 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
9970 #else
9971 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
9972 #endif
9973 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
9975 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
9978 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9979 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9980 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9981 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9982 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
9983 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
9985 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9986 unsigned short ch = delim;
9988 TRACE("(%p %p %s)\n", this, strbuf, debugstr_wn(&delim, 1));
9990 this->count = 0;
9992 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9993 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
9995 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
9996 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
9997 if(ch==WEOF || ch==delim)
9998 break;
10000 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
10001 break;
10002 this->count++;
10005 basic_istream_wchar_sentry_destroy(this);
10007 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
10008 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10009 return this;
10012 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
10013 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
10014 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
10015 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
10016 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
10017 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
10019 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
10022 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
10023 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
10024 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
10025 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
10026 #if STREAMSIZE_BITS == 64
10027 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
10028 #else
10029 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
10030 #endif
10031 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
10033 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10034 unsigned short ch = delim;
10036 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_wn(&delim, 1));
10038 this->count = 0;
10040 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
10041 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10043 while(count > 1) {
10044 ch = basic_streambuf_wchar_sbumpc(strbuf);
10046 if(ch==WEOF || ch==delim)
10047 break;
10049 *str++ = ch;
10050 this->count++;
10051 count--;
10054 if(ch == delim)
10055 this->count++;
10056 else if(ch != WEOF) {
10057 ch = basic_streambuf_wchar_sgetc(strbuf);
10059 if(ch == delim) {
10060 basic_streambuf_wchar__Gninc(strbuf);
10061 this->count++;
10065 basic_istream_wchar_sentry_destroy(this);
10067 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
10068 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
10069 if(count > 0)
10070 *str = 0;
10071 return this;
10074 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
10075 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
10076 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
10077 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
10078 #if STREAMSIZE_BITS == 64
10079 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
10080 #else
10081 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
10082 #endif
10083 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
10085 return basic_istream_wchar_getline_delim(this, str, count, '\n');
10088 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
10089 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
10090 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
10091 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
10092 #if STREAMSIZE_BITS == 64
10093 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
10094 #else
10095 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
10096 #endif
10097 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
10099 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10100 unsigned short ch = delim;
10101 unsigned int state;
10103 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
10105 this->count = 0;
10107 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10108 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10109 state = IOSTATE_goodbit;
10111 while(count > 0) {
10112 ch = basic_streambuf_wchar_sbumpc(strbuf);
10114 if(ch==WEOF) {
10115 state = IOSTATE_eofbit;
10116 break;
10119 if(ch==delim)
10120 break;
10122 this->count++;
10123 if(count != INT_MAX)
10124 count--;
10126 }else
10127 state = IOSTATE_failbit;
10128 basic_istream_wchar_sentry_destroy(this);
10130 basic_ios_wchar_setstate(base, state);
10131 return this;
10134 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
10135 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
10136 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
10137 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
10138 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
10140 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10141 unsigned short ch = '\n';
10143 TRACE("(%p)\n", istream);
10145 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10146 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10147 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(strbuf));
10149 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
10150 ch = basic_streambuf_wchar_snextc(strbuf)) {
10151 if(ch == WEOF)
10152 break;
10155 basic_istream_wchar_sentry_destroy(istream);
10157 if(ch == WEOF)
10158 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
10159 return istream;
10162 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
10163 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
10164 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
10165 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
10166 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
10167 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
10169 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10170 unsigned short ret = WEOF;
10172 TRACE("(%p)\n", this);
10174 this->count = 0;
10176 if(basic_istream_wchar_sentry_create(this, TRUE))
10177 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10178 basic_istream_wchar_sentry_destroy(this);
10180 if (ret == WEOF)
10181 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
10183 return ret;
10186 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
10187 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
10188 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
10189 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
10190 #if STREAMSIZE_BITS == 64
10191 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
10192 #else
10193 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
10194 #endif
10195 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
10197 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10198 IOSB_iostate state = IOSTATE_goodbit;
10200 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
10202 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10203 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10205 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
10206 if(this->count != count)
10207 state |= IOSTATE_failbit | IOSTATE_eofbit;
10208 }else {
10209 this->count = 0;
10211 basic_istream_wchar_sentry_destroy(this);
10213 basic_ios_wchar_setstate(base, state);
10214 return this;
10217 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
10218 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
10219 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
10220 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
10221 #if STREAMSIZE_BITS == 64
10222 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
10223 #else
10224 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
10225 #endif
10226 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
10228 return basic_istream_wchar__Read_s(this, str, -1, count);
10231 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
10232 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
10233 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
10234 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
10235 #if STREAMSIZE_BITS == 64
10236 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
10237 #else
10238 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
10239 #endif
10240 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
10242 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10243 IOSB_iostate state = IOSTATE_goodbit;
10245 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
10247 this->count = 0;
10249 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10250 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
10251 if(avail > count)
10252 avail = count;
10254 if(avail == -1)
10255 state |= IOSTATE_eofbit;
10256 else if(avail > 0)
10257 basic_istream_wchar__Read_s(this, str, size, avail);
10258 }else {
10259 state |= IOSTATE_failbit;
10261 basic_istream_wchar_sentry_destroy(this);
10263 basic_ios_wchar_setstate(base, state);
10264 return this->count;
10267 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
10268 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
10269 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
10270 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
10271 #if STREAMSIZE_BITS == 64
10272 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
10273 #else
10274 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
10275 #endif
10276 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
10278 return basic_istream_wchar__Readsome_s(this, str, count, count);
10281 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
10282 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
10283 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
10284 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
10285 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
10286 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
10288 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10289 IOSB_iostate state = IOSTATE_goodbit;
10291 TRACE("(%p %c)\n", this, ch);
10293 this->count = 0;
10295 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10296 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10298 if(!ios_base_good(&base->base))
10299 state |= IOSTATE_failbit;
10300 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
10301 state |= IOSTATE_badbit;
10303 basic_istream_wchar_sentry_destroy(this);
10305 basic_ios_wchar_setstate(base, state);
10306 return this;
10309 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
10310 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
10311 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
10312 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
10313 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
10314 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
10316 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10317 IOSB_iostate state = IOSTATE_goodbit;
10319 TRACE("(%p)\n", this);
10321 this->count = 0;
10323 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10324 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10326 if(!ios_base_good(&base->base))
10327 state |= IOSTATE_failbit;
10328 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
10329 state |= IOSTATE_badbit;
10331 basic_istream_wchar_sentry_destroy(this);
10333 basic_ios_wchar_setstate(base, state);
10334 return this;
10337 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
10338 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
10339 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
10340 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
10341 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
10342 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
10344 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10345 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10347 TRACE("(%p)\n", this);
10349 if(!strbuf)
10350 return -1;
10352 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10353 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
10354 basic_istream_wchar_sentry_destroy(this);
10355 return 0;
10358 basic_istream_wchar_sentry_destroy(this);
10360 basic_ios_wchar_setstate(base, IOSTATE_badbit);
10361 return -1;
10364 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
10365 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
10366 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
10367 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
10368 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
10369 fpos_mbstatet* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_mbstatet *ret)
10371 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10373 TRACE("(%p %p)\n", this, ret);
10375 #if _MSVCP_VER >= 110
10376 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10377 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
10378 ret, 0, SEEKDIR_cur, OPENMODE_in);
10379 }else {
10380 ret->off = -1;
10381 ret->pos = 0;
10382 memset(&ret->state, 0, sizeof(ret->state));
10384 basic_istream_wchar_sentry_destroy(this);
10385 #else
10386 if(ios_base_fail(&base->base)) {
10387 ret->off = -1;
10388 ret->pos = 0;
10389 memset(&ret->state, 0, sizeof(ret->state));
10390 return ret;
10393 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
10394 ret, 0, SEEKDIR_cur, OPENMODE_in);
10395 #endif
10396 return ret;
10399 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
10400 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
10401 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
10402 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
10403 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
10404 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
10405 #if STREAMOFF_BITS == 64
10406 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
10407 #else
10408 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
10409 #endif
10410 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
10412 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10413 #if _MSVCP_VER >= 110
10414 IOSB_iostate state;
10416 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
10418 state = ios_base_rdstate(&base->base);
10419 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
10421 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10422 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10423 fpos_mbstatet ret;
10425 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
10427 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10428 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10430 basic_istream_wchar_sentry_destroy(this);
10431 #else
10432 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
10434 if(!ios_base_fail(&base->base)) {
10435 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10436 fpos_mbstatet ret;
10438 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
10440 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10441 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10442 else
10443 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10444 return this;
10445 }else
10446 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10447 #endif
10448 return this;
10451 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
10452 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
10453 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
10454 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
10455 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
10456 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_mbstatet pos)
10458 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10459 #if _MSVCP_VER >= 110
10460 IOSB_iostate state;
10462 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
10464 state = ios_base_rdstate(&base->base);
10465 ios_base_clear(&base->base, state & ~IOSTATE_eofbit);
10467 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10468 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10469 fpos_mbstatet ret;
10471 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
10473 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10474 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10476 basic_istream_wchar_sentry_destroy(this);
10477 #else
10478 TRACE("(%p %s)\n", this, debugstr_fpos_mbstatet(&pos));
10480 if(!ios_base_fail(&base->base)) {
10481 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10482 fpos_mbstatet ret;
10484 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
10486 if(ret.off==-1 && ret.pos==0 && MBSTATET_TO_INT(&ret.state)==0)
10487 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10488 else
10489 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10490 return this;
10491 }else
10492 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10493 #endif
10494 return this;
10497 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
10499 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10500 int state = IOSTATE_goodbit;
10502 TRACE("(%p %p)\n", this, v);
10504 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10505 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10506 istreambuf_iterator_wchar first={0}, last={0};
10507 LONG tmp;
10509 first.strbuf = strbuf;
10510 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
10512 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
10513 *v = tmp;
10514 else
10515 state |= IOSTATE_failbit;
10517 basic_istream_wchar_sentry_destroy(this);
10519 basic_ios_wchar_setstate(base, state);
10520 return this;
10523 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
10524 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
10525 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
10526 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
10528 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
10529 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10532 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
10533 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
10534 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
10535 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
10537 return basic_istream_read_short(this, v, num_get_short_use_facet(
10538 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10541 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
10542 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
10543 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
10544 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
10546 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10547 int state = IOSTATE_goodbit;
10549 TRACE("(%p %p)\n", this, v);
10551 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10552 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10553 const num_get *numget = num_get_wchar_use_facet(IOS_LOCALE(strbuf));
10554 istreambuf_iterator_wchar first={0}, last={0};
10556 first.strbuf = strbuf;
10557 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
10559 basic_istream_wchar_sentry_destroy(this);
10561 basic_ios_wchar_setstate(base, state);
10562 return this;
10565 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
10567 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10568 int state = IOSTATE_goodbit;
10570 TRACE("(%p %p)\n", this, v);
10572 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10573 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10574 istreambuf_iterator_wchar first={0}, last={0};
10576 first.strbuf = strbuf;
10577 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10579 basic_istream_wchar_sentry_destroy(this);
10581 basic_ios_wchar_setstate(base, state);
10582 return this;
10585 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAH@Z */
10586 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
10587 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
10588 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
10590 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
10591 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10594 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
10595 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
10596 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
10597 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
10599 return basic_istream_read_int(this, v, num_get_short_use_facet(
10600 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10603 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
10605 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10606 int state = IOSTATE_goodbit;
10608 TRACE("(%p %p)\n", this, v);
10610 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10611 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10612 istreambuf_iterator_wchar first={0}, last={0};
10614 first.strbuf = strbuf;
10615 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
10617 basic_istream_wchar_sentry_destroy(this);
10619 basic_ios_wchar_setstate(base, state);
10620 return this;
10623 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
10624 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
10625 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
10626 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
10628 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
10629 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10632 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
10633 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
10634 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
10635 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
10637 return basic_istream_read_uint(this, v, num_get_short_use_facet(
10638 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10641 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
10643 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10644 int state = IOSTATE_goodbit;
10646 TRACE("(%p %p)\n", this, v);
10648 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10649 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10650 istreambuf_iterator_wchar first={0}, last={0};
10652 first.strbuf = strbuf;
10653 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10655 basic_istream_wchar_sentry_destroy(this);
10657 basic_ios_wchar_setstate(base, state);
10658 return this;
10661 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10662 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10663 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
10664 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
10666 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
10667 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10670 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10671 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10672 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
10673 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
10675 return basic_istream_read_long(this, v, num_get_short_use_facet(
10676 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10679 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
10681 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10682 int state = IOSTATE_goodbit;
10684 TRACE("(%p %p)\n", this, v);
10686 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10687 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10688 istreambuf_iterator_wchar first={0}, last={0};
10690 first.strbuf = strbuf;
10691 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
10693 basic_istream_wchar_sentry_destroy(this);
10695 basic_ios_wchar_setstate(base, state);
10696 return this;
10699 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
10700 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
10701 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
10702 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
10704 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
10705 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10708 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
10709 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
10710 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
10711 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
10713 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
10714 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10717 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
10719 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10720 int state = IOSTATE_goodbit;
10722 TRACE("(%p %p)\n", this, v);
10724 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10725 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10726 istreambuf_iterator_wchar first={0}, last={0};
10728 first.strbuf = strbuf;
10729 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
10731 basic_istream_wchar_sentry_destroy(this);
10733 basic_ios_wchar_setstate(base, state);
10734 return this;
10737 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
10738 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
10739 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
10740 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
10742 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
10743 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10746 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
10747 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
10748 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
10749 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
10751 return basic_istream_read_float(this, v, num_get_short_use_facet(
10752 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10755 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
10757 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10758 int state = IOSTATE_goodbit;
10760 TRACE("(%p %p)\n", this, v);
10762 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10763 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10764 istreambuf_iterator_wchar first={0}, last={0};
10766 first.strbuf = strbuf;
10767 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
10769 basic_istream_wchar_sentry_destroy(this);
10771 basic_ios_wchar_setstate(base, state);
10772 return this;
10775 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
10776 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
10777 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
10778 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
10780 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
10781 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10784 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
10785 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
10786 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
10787 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
10789 return basic_istream_read_double(this, v, num_get_short_use_facet(
10790 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10793 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
10795 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10796 int state = IOSTATE_goodbit;
10798 TRACE("(%p %p)\n", this, v);
10800 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10801 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10802 istreambuf_iterator_wchar first={0}, last={0};
10804 first.strbuf = strbuf;
10805 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
10807 basic_istream_wchar_sentry_destroy(this);
10809 basic_ios_wchar_setstate(base, state);
10810 return this;
10813 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
10814 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
10815 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
10816 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
10818 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
10819 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10822 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
10823 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
10824 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
10825 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
10827 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
10828 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10831 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
10833 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10834 int state = IOSTATE_goodbit;
10836 TRACE("(%p %p)\n", this, v);
10838 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10839 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10840 istreambuf_iterator_wchar first={0}, last={0};
10842 first.strbuf = strbuf;
10843 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
10845 basic_istream_wchar_sentry_destroy(this);
10847 basic_ios_wchar_setstate(base, state);
10848 return this;
10851 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
10852 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10853 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
10854 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
10856 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
10857 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10860 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
10861 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10862 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
10863 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
10865 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
10866 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10869 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
10871 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10872 int state = IOSTATE_goodbit;
10874 TRACE("(%p %p)\n", this, v);
10876 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10877 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10878 istreambuf_iterator_wchar first={0}, last={0};
10880 first.strbuf = strbuf;
10881 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
10883 basic_istream_wchar_sentry_destroy(this);
10885 basic_ios_wchar_setstate(base, state);
10886 return this;
10889 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
10890 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
10891 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
10892 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
10894 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
10895 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10898 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
10899 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
10900 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
10901 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
10903 return basic_istream_read_int64(this, v, num_get_short_use_facet(
10904 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10907 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
10909 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10910 int state = IOSTATE_goodbit;
10912 TRACE("(%p %p)\n", this, v);
10914 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10915 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10916 istreambuf_iterator_wchar first={0}, last={0};
10918 first.strbuf = strbuf;
10919 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
10921 basic_istream_wchar_sentry_destroy(this);
10923 basic_ios_wchar_setstate(base, state);
10924 return this;
10927 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
10928 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
10929 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
10930 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10932 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
10933 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10936 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
10937 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
10938 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
10939 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10941 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
10942 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10945 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
10947 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10948 int state = IOSTATE_goodbit;
10950 TRACE("(%p %p)\n", this, v);
10952 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10953 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10954 istreambuf_iterator_wchar first={0}, last={0};
10956 first.strbuf = strbuf;
10957 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
10959 basic_istream_wchar_sentry_destroy(this);
10961 basic_ios_wchar_setstate(base, state);
10962 return this;
10965 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
10966 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
10967 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
10968 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10970 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
10971 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10974 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
10975 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
10976 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
10977 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10979 return basic_istream_read_bool(this, v, num_get_short_use_facet(
10980 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10983 /* ??$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 */
10984 /* ??$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 */
10985 /* ??$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 */
10986 /* ??$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 */
10987 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
10988 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
10990 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10991 IOSB_iostate state = IOSTATE_goodbit;
10992 int c = delim;
10994 TRACE("(%p %p %s)\n", istream, str, debugstr_wn(&delim, 1));
10996 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10997 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10998 MSVCP_basic_string_wchar_clear(str);
11000 c = basic_streambuf_wchar_sgetc(strbuf);
11001 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
11002 MSVCP_basic_string_wchar_append_ch(str, c);
11003 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
11004 else if(c==WEOF) state |= IOSTATE_eofbit;
11006 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
11008 basic_istream_wchar_sentry_destroy(istream);
11010 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
11011 return istream;
11014 /* ??$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 */
11015 /* ??$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 */
11016 /* ??$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 */
11017 /* ??$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 */
11018 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
11019 basic_istream_wchar *istream, basic_string_wchar *str)
11021 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
11024 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
11025 basic_string_wchar *str, const ctype_wchar *ctype)
11027 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
11028 IOSB_iostate state = IOSTATE_failbit;
11029 int c = '\n';
11031 TRACE("(%p %p)\n", istream, str);
11033 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
11034 MSVCP_size_t count = ios_base_width_get(&base->base);
11036 if(!count)
11037 count = -1;
11039 MSVCP_basic_string_wchar_clear(str);
11041 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
11042 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
11043 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
11044 state = IOSTATE_goodbit;
11045 MSVCP_basic_string_wchar_append_ch(str, c);
11048 basic_istream_wchar_sentry_destroy(istream);
11050 ios_base_width_set(&base->base, 0);
11051 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11052 return istream;
11055 /* ??$?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 */
11056 /* ??$?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 */
11057 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
11058 basic_istream_wchar *istream, basic_string_wchar *str)
11060 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
11061 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11064 /* ??$?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 */
11065 /* ??$?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 */
11066 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
11067 basic_istream_wchar *istream, basic_string_wchar *str)
11069 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
11070 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11073 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
11075 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
11076 IOSB_iostate state = IOSTATE_failbit;
11077 unsigned short c = '\n';
11079 TRACE("(%p %p)\n", istream, str);
11081 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
11082 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
11084 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
11085 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
11086 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
11087 state = IOSTATE_goodbit;
11088 *str++ = c;
11091 basic_istream_wchar_sentry_destroy(istream);
11093 *str = 0;
11094 ios_base_width_set(&base->base, 0);
11095 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11096 return istream;
11099 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
11100 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
11101 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
11103 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
11104 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11107 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
11108 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
11109 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
11111 return basic_istream_read_str(istream, str, ctype_short_use_facet(
11112 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
11115 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
11116 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
11117 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
11118 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
11119 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
11121 IOSB_iostate state = IOSTATE_failbit;
11122 unsigned short c = 0;
11124 TRACE("(%p %p)\n", istream, ch);
11126 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
11127 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
11128 basic_istream_wchar_get_basic_ios(istream)));
11129 if(c != WEOF) {
11130 state = IOSTATE_goodbit;
11131 *ch = c;
11134 basic_istream_wchar_sentry_destroy(istream);
11136 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
11137 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11138 return istream;
11141 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11142 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11143 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11144 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11145 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
11146 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
11147 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
11149 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
11150 IOSB_iostate state = IOSTATE_failbit;
11151 unsigned short c = '\n';
11153 TRACE("(%p %p)\n", this, streambuf);
11155 if(basic_istream_wchar_sentry_create(this, FALSE)) {
11156 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
11157 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
11158 state = IOSTATE_goodbit;
11159 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
11160 break;
11163 basic_istream_wchar_sentry_destroy(this);
11165 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
11166 return this;
11169 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
11170 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
11171 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
11172 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
11173 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
11174 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
11175 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
11177 TRACE("(%p %p)\n", this, pfunc);
11178 pfunc(this);
11179 return this;
11182 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
11183 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
11184 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
11185 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
11186 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
11187 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
11188 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
11190 TRACE("(%p %p)\n", this, pfunc);
11191 pfunc(basic_istream_wchar_get_basic_ios(this));
11192 return this;
11195 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
11196 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
11197 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
11198 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
11199 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
11200 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
11201 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
11203 TRACE("(%p %p)\n", this, pfunc);
11204 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
11205 return this;
11208 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
11209 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
11210 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
11211 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
11212 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_swap, 8)
11213 void __thiscall basic_istream_wchar_swap(basic_istream_wchar *this, basic_istream_wchar *r)
11215 TRACE("(%p %p)\n", this, r);
11217 if(this == r)
11218 return;
11220 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(this),
11221 basic_istream_wchar_get_basic_ios(r));
11222 this->count ^= r->count;
11223 r->count ^= this->count;
11224 this->count ^= r->count;
11227 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
11229 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
11232 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
11234 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
11237 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
11238 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
11239 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
11240 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
11242 basic_ios_char *basic_ios;
11244 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
11246 if(virt_init) {
11247 this->base1.vbtable = basic_iostream_char_vbtable1;
11248 this->base2.vbtable = basic_iostream_char_vbtable2;
11249 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
11250 INIT_BASIC_IOS_VTORDISP(basic_ios);
11251 basic_ios_char_ctor(basic_ios);
11252 }else {
11253 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
11256 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
11257 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
11258 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
11259 return this;
11262 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11263 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11264 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
11265 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
11267 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
11269 TRACE("(%p)\n", this);
11270 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
11271 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
11274 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11275 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11276 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
11277 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
11279 basic_ios_char *base = basic_iostream_char_to_basic_ios(this);
11281 TRACE("(%p)\n", this);
11283 basic_iostream_char_dtor(base);
11284 basic_ios_char_dtor(base);
11287 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
11288 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11290 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
11292 TRACE("(%p %x)\n", this, flags);
11294 if(flags & 2) {
11295 /* we have an array, with the number of elements stored before the first object */
11296 INT_PTR i, *ptr = (INT_PTR *)this-1;
11298 for(i=*ptr-1; i>=0; i--)
11299 basic_iostream_char_vbase_dtor(this+i);
11300 MSVCRT_operator_delete(ptr);
11301 } else {
11302 basic_iostream_char_vbase_dtor(this);
11303 if(flags & 1)
11304 MSVCRT_operator_delete(this);
11307 return this;
11310 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
11311 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
11312 DEFINE_THISCALL_WRAPPER(basic_iostream_char_swap, 8)
11313 void __thiscall basic_iostream_char_swap(basic_iostream_char *this, basic_iostream_char *r)
11315 TRACE("(%p %p)\n", this, r);
11317 if(this == r)
11318 return;
11320 basic_ios_char_swap(basic_istream_char_get_basic_ios(&this->base1),
11321 basic_istream_char_get_basic_ios(&r->base1));
11324 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
11326 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
11329 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11331 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
11334 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11335 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11336 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
11337 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
11338 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
11340 basic_ios_wchar *basic_ios;
11342 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
11344 if(virt_init) {
11345 this->base1.vbtable = basic_iostream_wchar_vbtable1;
11346 this->base2.vbtable = basic_iostream_wchar_vbtable2;
11347 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
11348 INIT_BASIC_IOS_VTORDISP(basic_ios);
11349 basic_ios_wchar_ctor(basic_ios);
11350 }else {
11351 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
11354 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
11355 basic_ostream_wchar_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
11357 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
11358 return this;
11361 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11362 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11363 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
11364 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
11365 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
11367 basic_iostream_wchar_ctor(this, strbuf, virt_init);
11368 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
11369 return this;
11372 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11373 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11374 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11375 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11376 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
11377 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
11379 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
11381 TRACE("(%p)\n", this);
11382 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
11383 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
11386 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11387 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11388 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11389 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11390 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
11391 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
11393 basic_ios_wchar *base = basic_iostream_wchar_to_basic_ios(this);
11395 TRACE("(%p)\n", this);
11397 basic_iostream_wchar_dtor(base);
11398 basic_ios_wchar_dtor(base);
11401 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
11402 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11404 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
11406 TRACE("(%p %x)\n", this, flags);
11408 if(flags & 2) {
11409 /* we have an array, with the number of elements stored before the first object */
11410 INT_PTR i, *ptr = (INT_PTR *)this-1;
11412 for(i=*ptr-1; i>=0; i--)
11413 basic_iostream_wchar_vbase_dtor(this+i);
11414 MSVCRT_operator_delete(ptr);
11415 } else {
11416 basic_iostream_wchar_vbase_dtor(this);
11417 if(flags & 1)
11418 MSVCRT_operator_delete(this);
11421 return this;
11424 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
11425 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
11426 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
11427 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
11428 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_swap, 8)
11429 void __thiscall basic_iostream_wchar_swap(basic_iostream_wchar *this, basic_iostream_wchar *r)
11431 TRACE("(%p %p)\n", this, r);
11433 if(this == r)
11434 return;
11436 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(&this->base1),
11437 basic_istream_wchar_get_basic_ios(&r->base1));
11440 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
11442 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
11445 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
11447 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
11450 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11451 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11452 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
11453 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
11455 basic_ios_char *basic_ios;
11457 TRACE("(%p %d)\n", this, virt_init);
11459 if(virt_init) {
11460 this->base.vbtable = basic_ofstream_char_vbtable;
11461 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11462 INIT_BASIC_IOS_VTORDISP(basic_ios);
11463 basic_ios_char_ctor(basic_ios);
11464 }else {
11465 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11468 basic_filebuf_char_ctor(&this->filebuf);
11469 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11470 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
11471 return this;
11474 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11475 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11476 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
11477 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
11478 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
11480 basic_ios_char *basic_ios;
11482 TRACE("(%p %p %d)\n", this, file, virt_init);
11484 if(virt_init) {
11485 this->base.vbtable = basic_ofstream_char_vbtable;
11486 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11487 INIT_BASIC_IOS_VTORDISP(basic_ios);
11488 basic_ios_char_ctor(basic_ios);
11489 }else {
11490 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11493 basic_filebuf_char_ctor_file(&this->filebuf, file);
11494 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11495 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
11496 return this;
11499 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11500 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11501 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 20)
11502 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
11503 const char *name, int mode, int prot, MSVCP_bool virt_init)
11505 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11507 basic_ofstream_char_ctor(this, virt_init);
11509 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11510 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11511 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11513 return this;
11516 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11517 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11518 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11519 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11520 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name_wchar, 20)
11521 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name_wchar(basic_ofstream_char *this,
11522 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11524 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11526 basic_ofstream_char_ctor(this, virt_init);
11528 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11529 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11530 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11532 return this;
11535 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11536 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11537 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
11538 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
11540 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
11542 TRACE("(%p)\n", this);
11544 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
11545 basic_filebuf_char_dtor(&this->filebuf);
11548 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11549 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11550 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
11551 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
11553 basic_ios_char *base = basic_ofstream_char_to_basic_ios(this);
11555 TRACE("(%p)\n", this);
11557 basic_ofstream_char_dtor(base);
11558 basic_ios_char_dtor(base);
11561 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
11562 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11564 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
11566 TRACE("(%p %x)\n", this, flags);
11568 if(flags & 2) {
11569 /* we have an array, with the number of elements stored before the first object */
11570 INT_PTR i, *ptr = (INT_PTR *)this-1;
11572 for(i=*ptr-1; i>=0; i--)
11573 basic_ofstream_char_vbase_dtor(this+i);
11574 MSVCRT_operator_delete(ptr);
11575 } else {
11576 basic_ofstream_char_vbase_dtor(this);
11577 if(flags & 1)
11578 MSVCRT_operator_delete(this);
11581 return this;
11584 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11585 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11586 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
11587 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
11589 TRACE("(%p)\n", this);
11591 if(!basic_filebuf_char_close(&this->filebuf)) {
11592 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11593 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11597 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11598 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11599 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
11600 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
11602 TRACE("(%p)\n", this);
11603 return basic_filebuf_char_is_open(&this->filebuf);
11606 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11607 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11608 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 16)
11609 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
11610 const char *name, int mode, int prot)
11612 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11614 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11615 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11616 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11620 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11621 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11622 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
11623 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
11624 const char *name, unsigned int mode)
11626 basic_ofstream_char_open(this, name, mode, _SH_DENYNO);
11629 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11630 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11631 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11632 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11633 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar, 16)
11634 void __thiscall basic_ofstream_char_open_wchar(basic_ofstream_char *this,
11635 const wchar_t *name, int mode, int prot)
11637 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11639 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11640 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11641 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11645 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11646 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11647 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11648 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11649 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar_old, 12)
11650 void __thiscall basic_ofstream_char_open_wchar_old(basic_ofstream_char *this,
11651 const wchar_t *name, unsigned int mode)
11653 basic_ofstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11656 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11657 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11658 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
11659 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
11661 TRACE("(%p)\n", this);
11662 return (basic_filebuf_char*)&this->filebuf;
11665 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
11667 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
11670 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11672 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
11675 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11676 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11677 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
11678 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11680 basic_ios_wchar *basic_ios;
11682 TRACE("(%p %d)\n", this, virt_init);
11684 if(virt_init) {
11685 this->base.vbtable = basic_ofstream_wchar_vbtable;
11686 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11687 INIT_BASIC_IOS_VTORDISP(basic_ios);
11688 basic_ios_wchar_ctor(basic_ios);
11689 }else {
11690 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11693 basic_filebuf_wchar_ctor(&this->filebuf);
11694 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11695 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11696 return this;
11699 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11700 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11701 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
11702 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11704 basic_ofstream_wchar_ctor(this, virt_init);
11705 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11706 return this;
11709 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11710 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11711 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
11712 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
11713 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11715 basic_ios_wchar *basic_ios;
11717 TRACE("(%p %p %d)\n", this, file, virt_init);
11719 if(virt_init) {
11720 this->base.vbtable = basic_ofstream_wchar_vbtable;
11721 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11722 INIT_BASIC_IOS_VTORDISP(basic_ios);
11723 basic_ios_wchar_ctor(basic_ios);
11724 }else {
11725 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11728 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11729 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11730 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11731 return this;
11734 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11735 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11736 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
11737 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
11738 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11740 basic_ofstream_wchar_ctor_file(this, file, virt_init);
11741 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11742 return this;
11745 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
11746 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
11747 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name, 20)
11748 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name(basic_ofstream_wchar *this,
11749 const char *name, int mode, int prot, MSVCP_bool virt_init)
11751 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11753 basic_ofstream_wchar_ctor(this, virt_init);
11755 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11756 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11757 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11759 return this;
11762 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
11763 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
11764 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 20)
11765 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
11766 const char *name, int mode, int prot, MSVCP_bool virt_init)
11768 basic_ofstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11769 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11770 return this;
11773 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11774 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11775 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11776 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11777 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name_wchar, 20)
11778 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name_wchar(basic_ofstream_wchar *this,
11779 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11781 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11783 basic_ofstream_wchar_ctor(this, virt_init);
11785 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11786 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11787 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11789 return this;
11792 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11793 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11794 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11795 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11796 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name_wchar, 20)
11797 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name_wchar(basic_ofstream_wchar *this,
11798 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11800 basic_ofstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11801 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11802 return this;
11805 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11806 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11807 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11808 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11809 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
11810 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
11812 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11814 TRACE("(%p)\n", this);
11816 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11817 basic_filebuf_wchar_dtor(&this->filebuf);
11820 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11821 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11822 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11823 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11824 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
11825 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
11827 basic_ios_wchar *base = basic_ofstream_wchar_to_basic_ios(this);
11829 TRACE("(%p)\n", this);
11831 basic_ofstream_wchar_dtor(base);
11832 basic_ios_wchar_dtor(base);
11835 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
11836 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11838 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11840 TRACE("(%p %x)\n", this, flags);
11842 if(flags & 2) {
11843 /* we have an array, with the number of elements stored before the first object */
11844 INT_PTR i, *ptr = (INT_PTR *)this-1;
11846 for(i=*ptr-1; i>=0; i--)
11847 basic_ofstream_wchar_vbase_dtor(this+i);
11848 MSVCRT_operator_delete(ptr);
11849 } else {
11850 basic_ofstream_wchar_vbase_dtor(this);
11851 if(flags & 1)
11852 MSVCRT_operator_delete(this);
11855 return this;
11858 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11859 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11860 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11861 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11862 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
11863 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
11865 TRACE("(%p)\n", this);
11867 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11868 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11869 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11873 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11874 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11875 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11876 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11877 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
11878 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
11880 TRACE("(%p)\n", this);
11881 return basic_filebuf_wchar_is_open(&this->filebuf);
11884 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
11885 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
11886 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
11887 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
11888 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 16)
11889 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
11890 const char *name, int mode, int prot)
11892 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11894 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11895 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11896 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11900 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
11901 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
11902 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
11903 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
11904 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
11905 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
11906 const char *name, unsigned int mode)
11908 basic_ofstream_wchar_open(this, name, mode, _SH_DENYNO);
11911 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11912 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11913 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11914 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11915 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11916 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11917 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11918 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11919 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar, 16)
11920 void __thiscall basic_ofstream_wchar_open_wchar(basic_ofstream_wchar *this,
11921 const wchar_t *name, int mode, int prot)
11923 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11925 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11926 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11927 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11931 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11932 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11933 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11934 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11935 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11936 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11937 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11938 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11939 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar_old, 12)
11940 void __thiscall basic_ofstream_wchar_open_wchar_old(basic_ofstream_wchar *this,
11941 const wchar_t *name, unsigned int mode)
11943 basic_ofstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11946 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11947 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11948 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11949 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11950 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
11951 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
11953 TRACE("(%p)\n", this);
11954 return (basic_filebuf_wchar*)&this->filebuf;
11957 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
11959 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
11962 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
11964 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
11967 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11968 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11969 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
11970 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
11972 basic_ios_char *basic_ios;
11974 TRACE("(%p %d)\n", this, virt_init);
11976 if(virt_init) {
11977 this->base.vbtable = basic_ifstream_char_vbtable;
11978 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11979 INIT_BASIC_IOS_VTORDISP(basic_ios);
11980 basic_ios_char_ctor(basic_ios);
11981 }else {
11982 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11985 basic_filebuf_char_ctor(&this->filebuf);
11986 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11987 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11988 return this;
11991 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11992 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11993 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
11994 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
11995 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
11997 basic_ios_char *basic_ios;
11999 TRACE("(%p %p %d)\n", this, file, virt_init);
12001 if(virt_init) {
12002 this->base.vbtable = basic_ifstream_char_vbtable;
12003 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12004 INIT_BASIC_IOS_VTORDISP(basic_ios);
12005 basic_ios_char_ctor(basic_ios);
12006 }else {
12007 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12010 basic_filebuf_char_ctor_file(&this->filebuf, file);
12011 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12012 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
12013 return this;
12016 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
12017 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
12018 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 20)
12019 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
12020 const char *name, int mode, int prot, MSVCP_bool virt_init)
12022 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12024 basic_ifstream_char_ctor(this, virt_init);
12026 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12027 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12028 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12030 return this;
12033 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
12034 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
12035 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_old, 16)
12036 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_old(basic_ifstream_char *this,
12037 const char *name, int mode, MSVCP_bool virt_init)
12039 return basic_ifstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12042 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
12043 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
12044 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
12045 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
12046 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_wchar, 20)
12047 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_wchar(basic_ifstream_char *this,
12048 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12050 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12052 basic_ifstream_char_ctor(this, virt_init);
12054 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12055 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12056 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12058 return this;
12061 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
12062 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
12063 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
12064 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
12066 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
12068 TRACE("(%p)\n", this);
12070 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
12071 basic_filebuf_char_dtor(&this->filebuf);
12074 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12075 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12076 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
12077 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
12079 basic_ios_char *base = basic_ifstream_char_to_basic_ios(this);
12081 TRACE("(%p)\n", this);
12083 basic_ifstream_char_dtor(base);
12084 basic_ios_char_dtor(base);
12087 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
12088 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12090 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
12092 TRACE("(%p %x)\n", this, flags);
12094 if(flags & 2) {
12095 /* we have an array, with the number of elements stored before the first object */
12096 INT_PTR i, *ptr = (INT_PTR *)this-1;
12098 for(i=*ptr-1; i>=0; i--)
12099 basic_ifstream_char_vbase_dtor(this+i);
12100 MSVCRT_operator_delete(ptr);
12101 } else {
12102 basic_ifstream_char_vbase_dtor(this);
12103 if(flags & 1)
12104 MSVCRT_operator_delete(this);
12107 return this;
12110 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12111 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12112 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
12113 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
12115 TRACE("(%p)\n", this);
12117 if(!basic_filebuf_char_close(&this->filebuf)) {
12118 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12119 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12123 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
12124 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
12125 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
12126 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
12128 TRACE("(%p)\n", this);
12129 return basic_filebuf_char_is_open(&this->filebuf);
12132 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
12133 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
12134 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 16)
12135 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
12136 const char *name, int mode, int prot)
12138 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12140 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12141 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12142 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12146 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
12147 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
12148 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
12149 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
12150 const char *name, unsigned int mode)
12152 basic_ifstream_char_open(this, name, mode, _SH_DENYNO);
12155 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
12156 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
12157 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
12158 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
12159 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar, 16)
12160 void __thiscall basic_ifstream_char_open_wchar(basic_ifstream_char *this,
12161 const wchar_t *name, int mode, int prot)
12163 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12165 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12166 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
12167 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12171 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
12172 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
12173 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
12174 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
12175 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar_old, 12)
12176 void __thiscall basic_ifstream_char_open_wchar_old(basic_ifstream_char *this,
12177 const wchar_t *name, unsigned int mode)
12179 basic_ifstream_char_open_wchar(this, name, mode, _SH_DENYNO);
12182 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12183 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12184 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
12185 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
12187 TRACE("(%p)\n", this);
12188 return (basic_filebuf_char*)&this->filebuf;
12191 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
12193 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
12196 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12198 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
12201 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
12202 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
12203 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
12204 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
12206 basic_ios_wchar *basic_ios;
12208 TRACE("(%p %d)\n", this, virt_init);
12210 if(virt_init) {
12211 this->base.vbtable = basic_ifstream_wchar_vbtable;
12212 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12213 INIT_BASIC_IOS_VTORDISP(basic_ios);
12214 basic_ios_wchar_ctor(basic_ios);
12215 }else {
12216 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12219 basic_filebuf_wchar_ctor(&this->filebuf);
12220 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12221 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
12222 return this;
12225 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
12226 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
12227 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
12228 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
12230 basic_ifstream_wchar_ctor(this, virt_init);
12231 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12232 return this;
12235 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
12236 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12237 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
12238 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
12239 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
12241 basic_ios_wchar *basic_ios;
12243 TRACE("(%p %p %d)\n", this, file, virt_init);
12245 if(virt_init) {
12246 this->base.vbtable = basic_ifstream_wchar_vbtable;
12247 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12248 INIT_BASIC_IOS_VTORDISP(basic_ios);
12249 basic_ios_wchar_ctor(basic_ios);
12250 }else {
12251 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12254 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
12255 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12256 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
12257 return this;
12260 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
12261 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12262 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
12263 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
12264 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
12266 basic_ifstream_wchar_ctor_file(this, file, virt_init);
12267 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12268 return this;
12271 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
12272 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
12273 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name, 20)
12274 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name(basic_ifstream_wchar *this,
12275 const char *name, int mode, int prot, MSVCP_bool virt_init)
12277 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12279 basic_ifstream_wchar_ctor(this, virt_init);
12281 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12282 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12283 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12285 return this;
12288 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
12289 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
12290 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 20)
12291 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
12292 const char *name, int mode, int prot, MSVCP_bool virt_init)
12294 basic_ifstream_wchar_ctor_name(this, name, mode, prot, virt_init);
12295 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12296 return this;
12299 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
12300 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDH@Z */
12301 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_old, 16)
12302 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_old(basic_ifstream_wchar *this,
12303 const char *name, int mode, MSVCP_bool virt_init)
12305 return basic_ifstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12308 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
12309 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
12310 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_old, 16)
12311 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_old(basic_ifstream_wchar *this,
12312 const char *name, int mode, MSVCP_bool virt_init)
12314 return basic_ifstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12317 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
12318 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
12319 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12320 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12321 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_wchar, 20)
12322 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_wchar(basic_ifstream_wchar *this,
12323 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12325 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12327 basic_ifstream_wchar_ctor(this, virt_init);
12329 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12330 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12331 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12333 return this;
12336 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12337 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12338 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
12339 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
12340 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_wchar, 20)
12341 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_wchar(basic_ifstream_wchar *this,
12342 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12344 basic_ifstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
12345 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12346 return this;
12349 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
12350 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
12351 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
12352 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
12353 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
12354 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
12356 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
12358 TRACE("(%p)\n", this);
12360 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12361 basic_filebuf_wchar_dtor(&this->filebuf);
12364 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12365 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12366 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12367 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12368 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
12369 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
12371 basic_ios_wchar *base = basic_ifstream_wchar_to_basic_ios(this);
12373 TRACE("(%p)\n", this);
12375 basic_ifstream_wchar_dtor(base);
12376 basic_ios_wchar_dtor(base);
12379 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
12380 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12382 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
12384 TRACE("(%p %x)\n", this, flags);
12386 if(flags & 2) {
12387 /* we have an array, with the number of elements stored before the first object */
12388 INT_PTR i, *ptr = (INT_PTR *)this-1;
12390 for(i=*ptr-1; i>=0; i--)
12391 basic_ifstream_wchar_vbase_dtor(this+i);
12392 MSVCRT_operator_delete(ptr);
12393 } else {
12394 basic_ifstream_wchar_vbase_dtor(this);
12395 if(flags & 1)
12396 MSVCRT_operator_delete(this);
12399 return this;
12402 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12403 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12404 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12405 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12406 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
12407 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
12409 TRACE("(%p)\n", this);
12411 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12412 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12413 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12417 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12418 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12419 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12420 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12421 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
12422 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
12424 TRACE("(%p)\n", this);
12425 return basic_filebuf_wchar_is_open(&this->filebuf);
12428 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
12429 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
12430 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
12431 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
12432 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 16)
12433 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
12434 const char *name, int mode, int prot)
12436 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12438 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12439 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12440 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12444 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
12445 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
12446 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
12447 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
12448 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
12449 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
12450 const char *name, unsigned int mode)
12452 basic_ifstream_wchar_open(this, name, mode, _SH_DENYNO);
12455 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
12456 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
12457 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
12458 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
12459 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
12460 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
12461 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
12462 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
12463 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar, 16)
12464 void __thiscall basic_ifstream_wchar_open_wchar(basic_ifstream_wchar *this,
12465 const wchar_t *name, int mode, int prot)
12467 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12469 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12470 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12471 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12475 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
12476 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
12477 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
12478 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
12479 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
12480 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
12481 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
12482 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
12483 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar_old, 12)
12484 void __thiscall basic_ifstream_wchar_open_wchar_old(basic_ifstream_wchar *this,
12485 const wchar_t *name, unsigned int mode)
12487 basic_ifstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
12490 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12491 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12492 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12493 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12494 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
12495 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
12497 TRACE("(%p)\n", this);
12498 return (basic_filebuf_wchar*)&this->filebuf;
12501 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
12503 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
12506 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
12508 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
12511 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
12512 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
12513 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
12514 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
12516 basic_ios_char *basic_ios;
12518 TRACE("(%p %d)\n", this, virt_init);
12520 if(virt_init) {
12521 this->base.base1.vbtable = basic_fstream_char_vbtable1;
12522 this->base.base2.vbtable = basic_fstream_char_vbtable2;
12523 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12524 INIT_BASIC_IOS_VTORDISP(basic_ios);
12525 basic_ios_char_ctor(basic_ios);
12526 }else {
12527 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12530 basic_filebuf_char_ctor(&this->filebuf);
12531 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
12532 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
12533 return this;
12536 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
12537 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12538 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
12539 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
12540 FILE *file, MSVCP_bool virt_init)
12542 basic_ios_char *basic_ios;
12544 TRACE("(%p %p %d)\n", this, file, virt_init);
12546 if(virt_init) {
12547 this->base.base1.vbtable = basic_fstream_char_vbtable1;
12548 this->base.base2.vbtable = basic_fstream_char_vbtable2;
12549 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12550 INIT_BASIC_IOS_VTORDISP(basic_ios);
12551 basic_ios_char_ctor(basic_ios);
12552 }else {
12553 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12556 basic_filebuf_char_ctor_file(&this->filebuf, file);
12557 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
12558 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
12559 return this;
12562 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
12563 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
12564 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 20)
12565 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
12566 const char *name, int mode, int prot, MSVCP_bool virt_init)
12568 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12570 basic_fstream_char_ctor(this, virt_init);
12572 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
12573 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12574 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12576 return this;
12579 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
12580 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
12581 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_noprot, 16)
12582 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_noprot(basic_fstream_char *this,
12583 const char *name, int mode, MSVCP_bool virt_init)
12585 return basic_fstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12588 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
12589 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
12590 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
12591 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
12592 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_wchar, 20)
12593 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_wchar(basic_fstream_char *this,
12594 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12596 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12598 basic_fstream_char_ctor(this, virt_init);
12600 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
12601 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12602 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12604 return this;
12607 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
12608 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
12609 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
12610 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
12612 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
12614 TRACE("(%p)\n", this);
12616 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12617 basic_filebuf_char_dtor(&this->filebuf);
12620 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12621 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12622 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
12623 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
12625 basic_ios_char *base = basic_fstream_char_to_basic_ios(this);
12627 TRACE("(%p)\n", this);
12629 basic_fstream_char_dtor(base);
12630 basic_ios_char_dtor(base);
12633 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
12634 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12636 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
12638 TRACE("(%p %x)\n", this, flags);
12640 if(flags & 2) {
12641 /* we have an array, with the number of elements stored before the first object */
12642 INT_PTR i, *ptr = (INT_PTR *)this-1;
12644 for(i=*ptr-1; i>=0; i--)
12645 basic_fstream_char_vbase_dtor(this+i);
12646 MSVCRT_operator_delete(ptr);
12647 } else {
12648 basic_fstream_char_vbase_dtor(this);
12649 if(flags & 1)
12650 MSVCRT_operator_delete(this);
12653 return this;
12656 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12657 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12658 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
12659 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
12661 TRACE("(%p)\n", this);
12663 if(!basic_filebuf_char_close(&this->filebuf)) {
12664 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12665 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12669 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
12670 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
12671 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
12672 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
12674 TRACE("(%p)\n", this);
12675 return basic_filebuf_char_is_open(&this->filebuf);
12678 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
12679 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
12680 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 16)
12681 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
12682 const char *name, int mode, int prot)
12684 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12686 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
12687 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12688 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12692 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
12693 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
12694 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
12695 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
12696 const char *name, unsigned int mode)
12698 basic_fstream_char_open(this, name, mode, _SH_DENYNO);
12701 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
12702 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
12703 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
12704 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
12705 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar, 16)
12706 void __thiscall basic_fstream_char_open_wchar(basic_fstream_char *this,
12707 const wchar_t *name, int mode, int prot)
12709 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12711 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
12712 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12713 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12717 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
12718 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
12719 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
12720 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
12721 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar_old, 12)
12722 void __thiscall basic_fstream_char_open_wchar_old(basic_fstream_char *this,
12723 const wchar_t *name, unsigned int mode)
12725 basic_fstream_char_open_wchar(this, name, mode, _SH_DENYNO);
12728 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12729 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12730 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
12731 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
12733 TRACE("(%p)\n", this);
12734 return (basic_filebuf_char*)&this->filebuf;
12737 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
12739 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
12742 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12744 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
12747 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
12748 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
12749 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
12750 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12752 basic_ios_wchar *basic_ios;
12754 TRACE("(%p %d)\n", this, virt_init);
12756 if(virt_init) {
12757 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12758 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12759 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12760 INIT_BASIC_IOS_VTORDISP(basic_ios);
12761 basic_ios_wchar_ctor(basic_ios);
12762 }else {
12763 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12766 basic_filebuf_wchar_ctor(&this->filebuf);
12767 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12768 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12769 return this;
12772 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
12773 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
12774 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
12775 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12777 basic_fstream_wchar_ctor(this, virt_init);
12778 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12779 return this;
12782 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
12783 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12784 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
12785 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
12786 FILE *file, MSVCP_bool virt_init)
12788 basic_ios_wchar *basic_ios;
12790 TRACE("(%p %p %d)\n", this, file, virt_init);
12792 if(virt_init) {
12793 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12794 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12795 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12796 INIT_BASIC_IOS_VTORDISP(basic_ios);
12797 basic_ios_wchar_ctor(basic_ios);
12798 }else {
12799 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12802 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
12803 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12804 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12805 return this;
12808 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
12809 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12810 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
12811 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
12812 FILE *file, MSVCP_bool virt_init)
12814 basic_fstream_wchar_ctor_file(this, file, virt_init);
12815 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12816 return this;
12819 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12820 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12821 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name, 20)
12822 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name(basic_fstream_wchar *this,
12823 const char *name, int mode, int prot, MSVCP_bool virt_init)
12825 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12827 basic_fstream_wchar_ctor(this, virt_init);
12829 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
12830 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12831 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12833 return this;
12836 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12837 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12838 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 20)
12839 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
12840 const char *name, int mode, int prot, MSVCP_bool virt_init)
12842 basic_fstream_wchar_ctor_name(this, name, mode, prot, virt_init);
12843 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12844 return this;
12847 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
12848 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_noprot, 16)
12849 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_noprot(basic_fstream_wchar *this,
12850 const char *name, int mode, MSVCP_bool virt_init)
12852 return basic_fstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12855 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
12856 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
12857 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_noprot, 16)
12858 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_noprot(basic_fstream_wchar *this,
12859 const char *name, int mode, MSVCP_bool virt_init)
12861 return basic_fstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12864 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
12865 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
12866 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12867 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12868 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_wchar, 20)
12869 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_wchar(basic_fstream_wchar *this,
12870 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12872 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12874 basic_fstream_wchar_ctor(this, virt_init);
12876 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
12877 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12878 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12880 return this;
12883 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12884 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12885 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
12886 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
12887 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_wchar, 20)
12888 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_wchar(basic_fstream_wchar *this,
12889 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12891 basic_fstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
12892 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12893 return this;
12896 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
12897 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
12898 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
12899 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
12900 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
12901 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
12903 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12905 TRACE("(%p)\n", this);
12907 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
12908 basic_filebuf_wchar_dtor(&this->filebuf);
12911 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12912 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12913 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12914 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12915 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
12916 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
12918 basic_ios_wchar *base = basic_fstream_wchar_to_basic_ios(this);
12920 TRACE("(%p)\n", this);
12922 basic_fstream_wchar_dtor(base);
12923 basic_ios_wchar_dtor(base);
12926 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
12927 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12929 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12931 TRACE("(%p %x)\n", this, flags);
12933 if(flags & 2) {
12934 /* we have an array, with the number of elements stored before the first object */
12935 INT_PTR i, *ptr = (INT_PTR *)this-1;
12937 for(i=*ptr-1; i>=0; i--)
12938 basic_fstream_wchar_vbase_dtor(this+i);
12939 MSVCRT_operator_delete(ptr);
12940 } else {
12941 basic_fstream_wchar_vbase_dtor(this);
12942 if(flags & 1)
12943 MSVCRT_operator_delete(this);
12946 return this;
12949 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12950 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12951 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12952 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12953 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
12954 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
12956 TRACE("(%p)\n", this);
12958 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12959 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12960 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12964 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12965 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12966 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12967 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12968 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
12969 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
12971 TRACE("(%p)\n", this);
12972 return basic_filebuf_wchar_is_open(&this->filebuf);
12975 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
12976 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
12977 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
12978 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
12979 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 16)
12980 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
12981 const char *name, int mode, int prot)
12983 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12985 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
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 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
12992 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
12993 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
12994 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
12995 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
12996 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
12997 const char *name, unsigned int mode)
12999 basic_fstream_wchar_open(this, name, mode, _SH_DENYNO);
13002 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
13003 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
13004 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
13005 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
13006 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
13007 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
13008 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
13009 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
13010 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar, 16)
13011 void __thiscall basic_fstream_wchar_open_wchar(basic_fstream_wchar *this,
13012 const wchar_t *name, int mode, int prot)
13014 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
13016 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
13017 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13018 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
13022 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
13023 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
13024 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
13025 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
13026 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
13027 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
13028 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
13029 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
13030 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar_old, 12)
13031 void __thiscall basic_fstream_wchar_open_wchar_old(basic_fstream_wchar *this,
13032 const wchar_t *name, unsigned int mode)
13034 basic_fstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
13037 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
13038 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
13039 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
13040 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
13041 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
13042 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
13044 TRACE("(%p)\n", this);
13045 return (basic_filebuf_wchar*)&this->filebuf;
13048 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
13050 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
13053 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
13055 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
13058 /* ??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 */
13059 /* ??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 */
13060 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
13061 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
13062 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13064 basic_ios_char *basic_ios;
13066 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13068 if(virt_init) {
13069 this->base.vbtable = basic_ostringstream_char_vbtable;
13070 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13071 INIT_BASIC_IOS_VTORDISP(basic_ios);
13072 basic_ios_char_ctor(basic_ios);
13073 }else {
13074 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13077 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
13078 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13079 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
13080 return this;
13083 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13084 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13085 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
13086 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
13087 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
13089 basic_ios_char *basic_ios;
13091 TRACE("(%p %d %d)\n", this, mode, virt_init);
13093 if(virt_init) {
13094 this->base.vbtable = basic_ostringstream_char_vbtable;
13095 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13096 INIT_BASIC_IOS_VTORDISP(basic_ios);
13097 basic_ios_char_ctor(basic_ios);
13098 }else {
13099 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13102 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
13103 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13104 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
13105 return this;
13108 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13109 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13110 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
13111 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
13112 basic_ostringstream_char *this)
13114 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
13117 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13118 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13119 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
13120 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
13122 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
13124 TRACE("(%p)\n", this);
13126 basic_stringbuf_char_dtor(&this->strbuf);
13127 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
13130 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13131 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13132 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
13133 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
13135 basic_ios_char *base = basic_ostringstream_char_to_basic_ios(this);
13137 TRACE("(%p)\n", this);
13139 basic_ostringstream_char_dtor(base);
13140 basic_ios_char_dtor(base);
13143 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
13144 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13146 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
13148 TRACE("(%p %x)\n", this, flags);
13150 if(flags & 2) {
13151 /* we have an array, with the number of elements stored before the first object */
13152 INT_PTR i, *ptr = (INT_PTR *)this-1;
13154 for(i=*ptr-1; i>=0; i--)
13155 basic_ostringstream_char_vbase_dtor(this+i);
13156 MSVCRT_operator_delete(ptr);
13157 } else {
13158 basic_ostringstream_char_vbase_dtor(this);
13159 if(flags & 1)
13160 MSVCRT_operator_delete(this);
13163 return this;
13166 /* ?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 */
13167 /* ?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 */
13168 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
13169 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
13171 TRACE("(%p)\n", this);
13172 return (basic_stringbuf_char*)&this->strbuf;
13175 /* ?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 */
13176 /* ?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 */
13177 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
13178 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
13180 TRACE("(%p %p)\n", this, str);
13181 basic_stringbuf_char_str_set(&this->strbuf, str);
13184 /* ?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 */
13185 /* ?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 */
13186 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
13187 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
13189 TRACE("(%p %p)\n", this, ret);
13190 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13193 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
13195 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
13198 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13200 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
13203 /* ??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 */
13204 /* ??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 */
13205 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
13206 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
13207 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13209 basic_ios_wchar *basic_ios;
13211 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13213 if(virt_init) {
13214 this->base.vbtable = basic_ostringstream_wchar_vbtable;
13215 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13216 INIT_BASIC_IOS_VTORDISP(basic_ios);
13217 basic_ios_wchar_ctor(basic_ios);
13218 }else {
13219 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13222 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
13223 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13224 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
13225 return this;
13228 /* ??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 */
13229 /* ??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 */
13230 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
13231 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
13232 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13234 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
13235 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
13236 return this;
13239 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13240 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13241 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
13242 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
13243 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
13245 basic_ios_wchar *basic_ios;
13247 TRACE("(%p %d %d)\n", this, mode, virt_init);
13249 if(virt_init) {
13250 this->base.vbtable = basic_ostringstream_wchar_vbtable;
13251 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13252 INIT_BASIC_IOS_VTORDISP(basic_ios);
13253 basic_ios_wchar_ctor(basic_ios);
13254 }else {
13255 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13258 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
13259 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13260 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
13261 return this;
13264 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13265 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13266 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
13267 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
13268 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
13270 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
13271 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
13272 return this;
13275 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13276 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13277 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
13278 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
13279 basic_ostringstream_wchar *this)
13281 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
13284 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13285 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13286 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
13287 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
13288 basic_ostringstream_wchar *this)
13290 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
13293 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13294 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13295 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13296 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13297 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
13298 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
13300 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
13302 TRACE("(%p)\n", this);
13304 basic_stringbuf_wchar_dtor(&this->strbuf);
13305 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
13308 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13309 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13310 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13311 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13312 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
13313 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
13315 basic_ios_wchar *base = basic_ostringstream_wchar_to_basic_ios(this);
13317 TRACE("(%p)\n", this);
13319 basic_ostringstream_wchar_dtor(base);
13320 basic_ios_wchar_dtor(base);
13323 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
13324 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13326 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
13328 TRACE("(%p %x)\n", this, flags);
13330 if(flags & 2) {
13331 /* we have an array, with the number of elements stored before the first object */
13332 INT_PTR i, *ptr = (INT_PTR *)this-1;
13334 for(i=*ptr-1; i>=0; i--)
13335 basic_ostringstream_wchar_vbase_dtor(this+i);
13336 MSVCRT_operator_delete(ptr);
13337 } else {
13338 basic_ostringstream_wchar_vbase_dtor(this);
13339 if(flags & 1)
13340 MSVCRT_operator_delete(this);
13343 return this;
13346 /* ?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 */
13347 /* ?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 */
13348 /* ?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 */
13349 /* ?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 */
13350 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
13351 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
13353 TRACE("(%p)\n", this);
13354 return (basic_stringbuf_wchar*)&this->strbuf;
13357 /* ?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 */
13358 /* ?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 */
13359 /* ?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 */
13360 /* ?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 */
13361 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
13362 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
13364 TRACE("(%p %p)\n", this, str);
13365 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13368 /* ?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 */
13369 /* ?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 */
13370 /* ?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 */
13371 /* ?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 */
13372 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
13373 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
13375 TRACE("(%p %p)\n", this, ret);
13376 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13379 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
13381 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
13384 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
13386 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
13389 /* ??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 */
13390 /* ??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 */
13391 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
13392 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
13393 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13395 basic_ios_char *basic_ios;
13397 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13399 if(virt_init) {
13400 this->base.vbtable = basic_istringstream_char_vbtable;
13401 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13402 INIT_BASIC_IOS_VTORDISP(basic_ios);
13403 basic_ios_char_ctor(basic_ios);
13404 }else {
13405 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13408 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
13409 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13410 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
13411 return this;
13414 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13415 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13416 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
13417 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
13418 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
13420 basic_ios_char *basic_ios;
13422 TRACE("(%p %d %d)\n", this, mode, virt_init);
13424 if(virt_init) {
13425 this->base.vbtable = basic_istringstream_char_vbtable;
13426 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13427 INIT_BASIC_IOS_VTORDISP(basic_ios);
13428 basic_ios_char_ctor(basic_ios);
13429 }else {
13430 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13433 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
13434 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13435 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
13436 return this;
13439 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13440 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13441 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
13442 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
13443 basic_istringstream_char *this)
13445 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
13448 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13449 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13450 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
13451 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
13453 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
13455 TRACE("(%p)\n", this);
13457 basic_stringbuf_char_dtor(&this->strbuf);
13458 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
13461 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13462 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13463 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
13464 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
13466 basic_ios_char *base = basic_istringstream_char_to_basic_ios(this);
13468 TRACE("(%p)\n", this);
13470 basic_istringstream_char_dtor(base);
13471 basic_ios_char_dtor(base);
13474 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
13475 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13477 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
13479 TRACE("(%p %x)\n", this, flags);
13481 if(flags & 2) {
13482 /* we have an array, with the number of elements stored before the first object */
13483 INT_PTR i, *ptr = (INT_PTR *)this-1;
13485 for(i=*ptr-1; i>=0; i--)
13486 basic_istringstream_char_vbase_dtor(this+i);
13487 MSVCRT_operator_delete(ptr);
13488 } else {
13489 basic_istringstream_char_vbase_dtor(this);
13490 if(flags & 1)
13491 MSVCRT_operator_delete(this);
13494 return this;
13497 /* ?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 */
13498 /* ?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 */
13499 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
13500 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
13502 TRACE("(%p)\n", this);
13503 return (basic_stringbuf_char*)&this->strbuf;
13506 /* ?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 */
13507 /* ?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 */
13508 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
13509 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
13511 TRACE("(%p %p)\n", this, str);
13512 basic_stringbuf_char_str_set(&this->strbuf, str);
13515 /* ?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 */
13516 /* ?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 */
13517 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
13518 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
13520 TRACE("(%p %p)\n", this, ret);
13521 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13524 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
13526 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
13529 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13531 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
13534 /* ??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 */
13535 /* ??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 */
13536 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
13537 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
13538 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13540 basic_ios_wchar *basic_ios;
13542 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13544 if(virt_init) {
13545 this->base.vbtable = basic_istringstream_wchar_vbtable;
13546 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13547 INIT_BASIC_IOS_VTORDISP(basic_ios);
13548 basic_ios_wchar_ctor(basic_ios);
13549 }else {
13550 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13553 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
13554 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13555 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
13556 return this;
13559 /* ??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 */
13560 /* ??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 */
13561 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
13562 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
13563 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13565 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
13566 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
13567 return this;
13570 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13571 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13572 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
13573 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
13574 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
13576 basic_ios_wchar *basic_ios;
13578 TRACE("(%p %d %d)\n", this, mode, virt_init);
13580 if(virt_init) {
13581 this->base.vbtable = basic_istringstream_wchar_vbtable;
13582 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13583 INIT_BASIC_IOS_VTORDISP(basic_ios);
13584 basic_ios_wchar_ctor(basic_ios);
13585 }else {
13586 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13589 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
13590 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13591 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
13592 return this;
13595 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13596 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13597 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
13598 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
13599 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
13601 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
13602 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
13603 return this;
13606 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13607 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13608 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
13609 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
13610 basic_istringstream_wchar *this)
13612 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
13615 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13616 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13617 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
13618 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
13619 basic_istringstream_wchar *this)
13621 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
13624 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13625 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13626 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13627 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13628 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
13629 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
13631 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
13633 TRACE("(%p)\n", this);
13635 basic_stringbuf_wchar_dtor(&this->strbuf);
13636 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
13639 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13640 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13641 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13642 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13643 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
13644 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
13646 basic_ios_wchar *base = basic_istringstream_wchar_to_basic_ios(this);
13648 TRACE("(%p)\n", this);
13650 basic_istringstream_wchar_dtor(base);
13651 basic_ios_wchar_dtor(base);
13654 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
13655 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13657 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
13659 TRACE("(%p %x)\n", this, flags);
13661 if(flags & 2) {
13662 /* we have an array, with the number of elements stored before the first object */
13663 INT_PTR i, *ptr = (INT_PTR *)this-1;
13665 for(i=*ptr-1; i>=0; i--)
13666 basic_istringstream_wchar_vbase_dtor(this+i);
13667 MSVCRT_operator_delete(ptr);
13668 } else {
13669 basic_istringstream_wchar_vbase_dtor(this);
13670 if(flags & 1)
13671 MSVCRT_operator_delete(this);
13674 return this;
13677 /* ?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 */
13678 /* ?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 */
13679 /* ?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 */
13680 /* ?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 */
13681 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
13682 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
13684 TRACE("(%p)\n", this);
13685 return (basic_stringbuf_wchar*)&this->strbuf;
13688 /* ?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 */
13689 /* ?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 */
13690 /* ?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 */
13691 /* ?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 */
13692 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
13693 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
13695 TRACE("(%p %p)\n", this, str);
13696 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13699 /* ?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 */
13700 /* ?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 */
13701 /* ?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 */
13702 /* ?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 */
13703 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
13704 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
13706 TRACE("(%p %p)\n", this, ret);
13707 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13710 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
13712 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
13715 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
13717 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
13720 /* ??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 */
13721 /* ??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 */
13722 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
13723 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
13724 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13726 basic_ios_char *basic_ios;
13728 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13730 if(virt_init) {
13731 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
13732 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
13733 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13734 INIT_BASIC_IOS_VTORDISP(basic_ios);
13735 basic_ios_char_ctor(basic_ios);
13736 }else {
13737 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13740 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
13741 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
13742 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
13743 return this;
13746 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13747 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13748 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
13749 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
13750 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
13752 basic_ios_char *basic_ios;
13754 TRACE("(%p %d %d)\n", this, mode, virt_init);
13756 if(virt_init) {
13757 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
13758 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
13759 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13760 INIT_BASIC_IOS_VTORDISP(basic_ios);
13761 basic_ios_char_ctor(basic_ios);
13762 }else {
13763 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13766 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
13767 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
13768 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
13769 return this;
13772 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13773 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13774 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
13775 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
13776 basic_stringstream_char *this)
13778 return basic_stringstream_char_ctor_mode(
13779 this, OPENMODE_out|OPENMODE_in, TRUE);
13782 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13783 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13784 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
13785 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
13787 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13789 TRACE("(%p)\n", this);
13791 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13792 basic_stringbuf_char_dtor(&this->strbuf);
13795 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13796 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13797 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
13798 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
13800 basic_ios_char *base = basic_stringstream_char_to_basic_ios(this);
13802 TRACE("(%p)\n", this);
13804 basic_stringstream_char_dtor(base);
13805 basic_ios_char_dtor(base);
13808 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
13809 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13811 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13813 TRACE("(%p %x)\n", this, flags);
13815 if(flags & 2) {
13816 /* we have an array, with the number of elements stored before the first object */
13817 INT_PTR i, *ptr = (INT_PTR *)this-1;
13819 for(i=*ptr-1; i>=0; i--)
13820 basic_stringstream_char_vbase_dtor(this+i);
13821 MSVCRT_operator_delete(ptr);
13822 } else {
13823 basic_stringstream_char_vbase_dtor(this);
13824 if(flags & 1)
13825 MSVCRT_operator_delete(this);
13828 return this;
13831 /* ?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 */
13832 /* ?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 */
13833 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
13834 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
13836 TRACE("(%p)\n", this);
13837 return (basic_stringbuf_char*)&this->strbuf;
13840 /* ?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 */
13841 /* ?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 */
13842 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
13843 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
13845 TRACE("(%p %p)\n", this, str);
13846 basic_stringbuf_char_str_set(&this->strbuf, str);
13849 /* ?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 */
13850 /* ?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 */
13851 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
13852 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
13854 TRACE("(%p %p)\n", this, ret);
13855 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13858 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
13860 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
13863 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13865 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
13868 /* ??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 */
13869 /* ??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 */
13870 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
13871 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
13872 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13874 basic_ios_wchar *basic_ios;
13876 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13878 if(virt_init) {
13879 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13880 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13881 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13882 INIT_BASIC_IOS_VTORDISP(basic_ios);
13883 basic_ios_wchar_ctor(basic_ios);
13884 }else {
13885 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13888 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
13889 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13890 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13891 return this;
13894 /* ??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 */
13895 /* ??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 */
13896 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
13897 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
13898 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13900 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
13901 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13902 return this;
13905 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13906 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13907 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
13908 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
13909 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13911 basic_ios_wchar *basic_ios;
13913 TRACE("(%p %d %d)\n", this, mode, virt_init);
13915 if(virt_init) {
13916 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13917 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13918 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13919 INIT_BASIC_IOS_VTORDISP(basic_ios);
13920 basic_ios_wchar_ctor(basic_ios);
13921 }else {
13922 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13925 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
13926 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13927 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13928 return this;
13931 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13932 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13933 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
13934 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
13935 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13937 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
13938 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13939 return this;
13942 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13943 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13944 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
13945 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
13946 basic_stringstream_wchar *this)
13948 return basic_stringstream_wchar_ctor_mode(
13949 this, OPENMODE_out|OPENMODE_in, TRUE);
13952 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13953 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13954 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
13955 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
13956 basic_stringstream_wchar *this)
13958 return basic_stringstream_short_ctor_mode(
13959 this, OPENMODE_out|OPENMODE_in, TRUE);
13962 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13963 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13964 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13965 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13966 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
13967 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
13969 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13971 TRACE("(%p)\n", this);
13973 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
13974 basic_stringbuf_wchar_dtor(&this->strbuf);
13977 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13978 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13979 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13980 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13981 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
13982 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
13984 basic_ios_wchar *base = basic_stringstream_wchar_to_basic_ios(this);
13986 TRACE("(%p)\n", this);
13988 basic_stringstream_wchar_dtor(base);
13989 basic_ios_wchar_dtor(base);
13992 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
13993 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13995 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13997 TRACE("(%p %x)\n", this, flags);
13999 if(flags & 2) {
14000 /* we have an array, with the number of elements stored before the first object */
14001 INT_PTR i, *ptr = (INT_PTR *)this-1;
14003 for(i=*ptr-1; i>=0; i--)
14004 basic_stringstream_wchar_vbase_dtor(this+i);
14005 MSVCRT_operator_delete(ptr);
14006 } else {
14007 basic_stringstream_wchar_vbase_dtor(this);
14008 if(flags & 1)
14009 MSVCRT_operator_delete(this);
14012 return this;
14015 /* ?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 */
14016 /* ?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 */
14017 /* ?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 */
14018 /* ?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 */
14019 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
14020 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
14022 TRACE("(%p)\n", this);
14023 return (basic_stringbuf_wchar*)&this->strbuf;
14026 /* ?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 */
14027 /* ?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 */
14028 /* ?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 */
14029 /* ?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 */
14030 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
14031 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
14033 TRACE("(%p %p)\n", this, str);
14034 basic_stringbuf_wchar_str_set(&this->strbuf, str);
14037 /* ?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 */
14038 /* ?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 */
14039 /* ?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 */
14040 /* ?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 */
14041 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
14042 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
14044 TRACE("(%p %p)\n", this, ret);
14045 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
14048 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
14049 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
14050 #if STREAMSIZE_BITS == 64
14051 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
14052 #else
14053 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
14054 #endif
14055 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
14057 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
14059 this->minsize = 32;
14060 this->endsave = NULL;
14061 this->strmode = mode;
14062 this->palloc = NULL;
14063 this->pfree = NULL;
14065 if(!g) {
14066 this->strmode |= STRSTATE_Dynamic;
14067 if(len > this->minsize)
14068 this->minsize = len;
14069 this->seekhigh = NULL;
14070 return;
14073 if(len < 0)
14074 len = INT_MAX;
14075 else if(!len)
14076 len = strlen(g);
14078 this->seekhigh = g+len;
14079 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
14080 if(p)
14081 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
14084 /* ??0strstreambuf@std@@QAE@PACH0@Z */
14085 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
14086 /* ??0strstreambuf@std@@QAE@PADH0@Z */
14087 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
14088 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
14089 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
14090 #if STREAMSIZE_BITS == 64
14091 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
14092 #else
14093 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
14094 #endif
14095 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
14097 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
14099 basic_streambuf_char_ctor(&this->base);
14100 this->base.vtable = &MSVCP_strstreambuf_vtable;
14102 strstreambuf__Init(this, len, g, p, 0);
14103 return this;
14106 /* ??0strstreambuf@std@@QAE@H@Z */
14107 /* ??0strstreambuf@std@@QEAA@_J@Z */
14108 #if STREAMSIZE_BITS == 64
14109 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 12)
14110 #else
14111 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
14112 #endif
14113 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
14115 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
14118 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
14119 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
14120 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
14121 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(MSVCP_size_t), void (__cdecl *pfree)(void*))
14123 TRACE("(%p %p %p)\n", this, palloc, pfree);
14125 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
14126 this->palloc = palloc;
14127 this->pfree = pfree;
14128 return this;
14131 /* ??0strstreambuf@std@@QAE@PBCH@Z */
14132 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
14133 /* ??0strstreambuf@std@@QAE@PBDH@Z */
14134 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
14135 /* ??0strstreambuf@std@@QAE@PBEH@Z */
14136 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
14137 #if STREAMSIZE_BITS == 64
14138 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 16)
14139 #else
14140 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
14141 #endif
14142 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
14144 TRACE("(%p %p %s)\n", this, g, wine_dbgstr_longlong(len));
14146 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
14147 this->strmode |= STRSTATE_Constant;
14148 return this;
14151 /* ??_Fstrstreambuf@std@@QAEXXZ */
14152 /* ??_Fstrstreambuf@std@@QEAAXXZ */
14153 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
14154 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
14156 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
14159 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
14160 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
14161 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
14162 void __thiscall strstreambuf__Tidy(strstreambuf *this)
14164 TRACE("(%p)\n", this);
14166 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
14167 if(this->pfree)
14168 this->pfree(basic_streambuf_char_eback(&this->base));
14169 else
14170 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
14173 this->endsave = NULL;
14174 this->seekhigh = NULL;
14175 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
14176 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
14177 basic_streambuf_char_setp(&this->base, NULL, NULL);
14180 /* ??1strstreambuf@std@@UAE@XZ */
14181 /* ??1strstreambuf@std@@UEAA@XZ */
14182 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
14183 void __thiscall strstreambuf_dtor(strstreambuf *this)
14185 TRACE("(%p)\n", this);
14187 strstreambuf__Tidy(this);
14188 basic_streambuf_char_dtor(&this->base);
14191 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
14192 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
14194 TRACE("(%p %x)\n", this, flags);
14195 if(flags & 2) {
14196 /* we have an array, with the number of elements stored before the first object */
14197 INT_PTR i, *ptr = (INT_PTR *)this-1;
14199 for(i=*ptr-1; i>=0; i--)
14200 strstreambuf_dtor(this+i);
14201 MSVCRT_operator_delete(ptr);
14202 } else {
14203 strstreambuf_dtor(this);
14204 if(flags & 1)
14205 MSVCRT_operator_delete(this);
14208 return this;
14211 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
14212 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
14213 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
14214 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
14216 TRACE("(%p %d)\n", this, freeze);
14218 if(!freeze == !(this->strmode & STRSTATE_Frozen))
14219 return;
14221 if(freeze) {
14222 this->strmode |= STRSTATE_Frozen;
14223 this->endsave = basic_streambuf_char_epptr(&this->base);
14224 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
14225 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
14226 }else {
14227 this->strmode &= ~STRSTATE_Frozen;
14228 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
14229 basic_streambuf_char_pptr(&this->base), this->endsave);
14233 /* ?str@strstreambuf@std@@QAEPADXZ */
14234 /* ?str@strstreambuf@std@@QEAAPEADXZ */
14235 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
14236 char* __thiscall strstreambuf_str(strstreambuf *this)
14238 TRACE("(%p)\n", this);
14240 strstreambuf_freeze(this, TRUE);
14241 return basic_streambuf_char_gptr(&this->base);
14244 /* ?pcount@strstreambuf@std@@QBEHXZ */
14245 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
14246 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
14247 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
14249 char *ppos = basic_streambuf_char_pptr(&this->base);
14251 TRACE("(%p)\n", this);
14253 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
14256 /* ?overflow@strstreambuf@std@@MAEHH@Z */
14257 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
14258 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
14259 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
14261 MSVCP_size_t old_size, size;
14262 char *ptr, *buf;
14264 TRACE("(%p %d)\n", this, c);
14266 if(c == EOF)
14267 return !EOF;
14269 if(this->strmode & STRSTATE_Frozen)
14270 return EOF;
14272 ptr = basic_streambuf_char_pptr(&this->base);
14273 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
14274 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
14276 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
14277 return EOF;
14279 ptr = basic_streambuf_char_eback(&this->base);
14280 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
14282 size = old_size + old_size/2;
14283 if(size < this->minsize)
14284 size = this->minsize;
14286 if(this->palloc)
14287 buf = this->palloc(size);
14288 else
14289 buf = MSVCRT_operator_new(size);
14290 if(!buf)
14291 return EOF;
14293 memcpy(buf, ptr, old_size);
14294 if(this->strmode & STRSTATE_Allocated) {
14295 if(this->pfree)
14296 this->pfree(ptr);
14297 else
14298 MSVCRT_operator_delete(ptr);
14301 this->strmode |= STRSTATE_Allocated;
14302 if(!old_size) {
14303 this->seekhigh = buf;
14304 basic_streambuf_char_setp(&this->base, buf, buf+size);
14305 basic_streambuf_char_setg(&this->base, buf, buf, buf);
14306 }else {
14307 this->seekhigh = this->seekhigh-ptr+buf;
14308 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
14309 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
14310 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
14311 basic_streambuf_char_pptr(&this->base));
14314 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
14317 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
14318 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
14319 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
14320 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
14322 char *ptr = basic_streambuf_char_gptr(&this->base);
14324 TRACE("(%p %d)\n", this, c);
14326 if(ptr<=basic_streambuf_char_eback(&this->base)
14327 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
14328 return EOF;
14330 basic_streambuf_char_gbump(&this->base, -1);
14331 if(c == EOF)
14332 return !EOF;
14333 if(this->strmode & STRSTATE_Constant)
14334 return (unsigned char)c;
14336 return (unsigned char)(ptr[0] = c);
14339 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
14340 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
14341 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
14342 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
14343 #if STREAMOFF_BITS == 64
14344 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
14345 #else
14346 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
14347 #endif
14348 fpos_mbstatet* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_mbstatet *ret, streamoff off, int way, int mode)
14350 char *eback = basic_streambuf_char_eback(&this->base);
14351 char *pptr = basic_streambuf_char_pptr(&this->base);
14352 char *gptr = basic_streambuf_char_gptr(&this->base);
14354 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
14356 ret->off = 0;
14357 memset(&ret->state, 0, sizeof(ret->state));
14359 if(pptr > this->seekhigh)
14360 this->seekhigh = pptr;
14362 if((mode & OPENMODE_in) && gptr) {
14363 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
14364 off += gptr-eback;
14365 else if(way == SEEKDIR_end)
14366 off += this->seekhigh-eback;
14367 else if(way != SEEKDIR_beg)
14368 off = -1;
14370 if(off<0 || off>this->seekhigh-eback) {
14371 off = -1;
14372 }else {
14373 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
14374 if((mode & OPENMODE_out) && pptr) {
14375 basic_streambuf_char_setp_next(&this->base, eback,
14376 gptr, basic_streambuf_char_epptr(&this->base));
14379 }else if((mode & OPENMODE_out) && pptr) {
14380 if(way == SEEKDIR_cur)
14381 off += pptr-eback;
14382 else if(way == SEEKDIR_end)
14383 off += this->seekhigh-eback;
14384 else if(way != SEEKDIR_beg)
14385 off = -1;
14387 if(off<0 || off>this->seekhigh-eback)
14388 off = -1;
14389 else
14390 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
14391 }else {
14392 off = -1;
14395 ret->pos = off;
14396 return ret;
14399 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
14400 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
14401 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
14402 fpos_mbstatet* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_mbstatet *ret, fpos_mbstatet pos, int mode)
14404 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_mbstatet(&pos), mode);
14406 if(pos.off==-1 && pos.pos==0 && MBSTATET_TO_INT(&pos.state)==0) {
14407 *ret = pos;
14408 return ret;
14411 return strstreambuf_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
14414 /* ?underflow@strstreambuf@std@@MAEHXZ */
14415 /* ?underflow@strstreambuf@std@@MEAAHXZ */
14416 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
14417 int __thiscall strstreambuf_underflow(strstreambuf *this)
14419 char *gptr = basic_streambuf_char_gptr(&this->base);
14420 char *pptr;
14422 TRACE("(%p)\n", this);
14424 if(!gptr)
14425 return EOF;
14427 if(gptr < basic_streambuf_char_egptr(&this->base))
14428 return (unsigned char)(*gptr);
14430 pptr = basic_streambuf_char_gptr(&this->base);
14431 if(pptr > this->seekhigh)
14432 this->seekhigh = pptr;
14434 if(this->seekhigh <= gptr)
14435 return EOF;
14437 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
14438 gptr, this->seekhigh);
14439 return (unsigned char)(*gptr);
14442 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
14444 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
14447 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
14449 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
14452 /* ??0ostrstream@std@@QAE@PADHH@Z */
14453 #if STREAMSIZE_BITS == 64
14454 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
14455 #else
14456 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
14457 #endif
14458 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
14460 basic_ios_char *basic_ios;
14462 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
14464 if(virt_init) {
14465 this->base.vbtable = ostrstream_vbtable;
14466 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
14467 INIT_BASIC_IOS_VTORDISP(basic_ios);
14468 basic_ios_char_ctor(basic_ios);
14469 }else {
14470 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
14473 strstreambuf_ctor_get_put(&this->buf, buf, size,
14474 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
14475 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, FALSE);
14476 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
14477 return this;
14480 /* ??1ostrstream@std@@UAE@XZ */
14481 /* ??1ostrstream@std@@UEAA@XZ */
14482 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
14483 void __thiscall ostrstream_dtor(basic_ios_char *base)
14485 ostrstream *this = ostrstream_from_basic_ios(base);
14487 TRACE("(%p)\n", this);
14489 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
14490 strstreambuf_dtor(&this->buf);
14493 static void ostrstream_vbase_dtor(ostrstream *this)
14495 basic_ios_char *base = ostrstream_to_basic_ios(this);
14497 TRACE("(%p)\n", this);
14499 ostrstream_dtor(base);
14500 basic_ios_char_dtor(base);
14503 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
14504 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
14506 ostrstream *this = ostrstream_from_basic_ios(base);
14508 TRACE("(%p %x)\n", this, flags);
14510 if(flags & 2) {
14511 /* we have an array, with the number of elements stored before the first object */
14512 INT_PTR i, *ptr = (INT_PTR *)this-1;
14514 for(i=*ptr-1; i>=0; i--)
14515 ostrstream_vbase_dtor(this+i);
14516 MSVCRT_operator_delete(ptr);
14517 } else {
14518 ostrstream_vbase_dtor(this);
14519 if(flags & 1)
14520 MSVCRT_operator_delete(this);
14523 return this;
14526 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
14528 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
14531 /* ??1istrstream@std@@UAE@XZ */
14532 /* ??1istrstream@std@@UEAA@XZ */
14533 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
14534 void __thiscall istrstream_dtor(basic_ios_char *base)
14536 istrstream *this = istrstream_from_basic_ios(base);
14538 TRACE("(%p)\n", this);
14540 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
14541 strstreambuf_dtor(&this->buf);
14544 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
14546 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
14549 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
14551 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
14554 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@M@0@@Z */
14555 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@M@0@@Z */
14556 basic_ostream_char* __cdecl basic_ostream_char_print_complex_float(basic_ostream_char *ostr, const complex_float *val)
14558 struct {
14559 basic_ostringstream_char obj;
14560 basic_ios_char vbase;
14561 } oss;
14562 ios_base *ostringstream_ios_base, *ostream_ios_base;
14563 locale loc;
14564 basic_string_char str;
14565 basic_ostringstream_char_ctor(&oss.obj);
14566 ostringstream_ios_base = &oss.vbase.base;
14567 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14568 TRACE("(%p %p)\n", ostr, val);
14570 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14571 locale_dtor(&loc);
14572 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14573 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14575 basic_ostream_char_print_ch(&oss.obj.base, '(');
14576 basic_ostream_char_print_float(&oss.obj.base, val->real);
14577 basic_ostream_char_print_ch(&oss.obj.base, ',');
14578 basic_ostream_char_print_float(&oss.obj.base, val->imag);
14579 basic_ostream_char_print_ch(&oss.obj.base, ')');
14581 basic_ostringstream_char_str_get(&oss.obj, &str);
14582 basic_ostringstream_char_dtor(&oss.vbase);
14583 basic_ostream_char_print_bstr(ostr, &str);
14584 MSVCP_basic_string_char_dtor(&str);
14585 return ostr;
14588 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@N@0@@Z */
14589 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@N@0@@Z */
14590 basic_ostream_char* __cdecl basic_ostream_char_print_complex_double(basic_ostream_char *ostr, const complex_double *val)
14592 struct {
14593 basic_ostringstream_char obj;
14594 basic_ios_char vbase;
14595 } oss;
14596 ios_base *ostringstream_ios_base, *ostream_ios_base;
14597 locale loc;
14598 basic_string_char str;
14599 basic_ostringstream_char_ctor(&oss.obj);
14600 ostringstream_ios_base = &oss.vbase.base;
14601 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14602 TRACE("(%p %p)\n", ostr, val);
14604 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14605 locale_dtor(&loc);
14606 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14607 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14609 basic_ostream_char_print_ch(&oss.obj.base, '(');
14610 basic_ostream_char_print_double(&oss.obj.base, val->real);
14611 basic_ostream_char_print_ch(&oss.obj.base, ',');
14612 basic_ostream_char_print_double(&oss.obj.base, val->imag);
14613 basic_ostream_char_print_ch(&oss.obj.base, ')');
14615 basic_ostringstream_char_str_get(&oss.obj, &str);
14616 basic_ostringstream_char_dtor(&oss.vbase);
14617 basic_ostream_char_print_bstr(ostr, &str);
14618 MSVCP_basic_string_char_dtor(&str);
14619 return ostr;
14622 /* ??$?6odu?$char_traits@d@std@@@std@@yaaav?$basic_ostream@du?$char_traits@d@std@@@0@aav10@abv?$complex@o@0@@Z */
14623 /* ??$?6ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@O@0@@Z */
14624 basic_ostream_char* __cdecl basic_ostream_char_print_complex_ldouble(basic_ostream_char *ostr, const complex_double *val)
14626 struct {
14627 basic_ostringstream_char obj;
14628 basic_ios_char vbase;
14629 } oss;
14630 ios_base *ostringstream_ios_base, *ostream_ios_base;
14631 locale loc;
14632 basic_string_char str;
14633 basic_ostringstream_char_ctor(&oss.obj);
14634 ostringstream_ios_base = &oss.vbase.base;
14635 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14636 TRACE("(%p %p)\n", ostr, val);
14638 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14639 locale_dtor(&loc);
14640 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14641 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14643 basic_ostream_char_print_ch(&oss.obj.base, '(');
14644 basic_ostream_char_print_ldouble(&oss.obj.base, val->real);
14645 basic_ostream_char_print_ch(&oss.obj.base, ',');
14646 basic_ostream_char_print_ldouble(&oss.obj.base, val->imag);
14647 basic_ostream_char_print_ch(&oss.obj.base, ')');
14649 basic_ostringstream_char_str_get(&oss.obj, &str);
14650 basic_ostringstream_char_dtor(&oss.vbase);
14651 basic_ostream_char_print_bstr(ostr, &str);
14652 MSVCP_basic_string_char_dtor(&str);
14653 return ostr;
14656 /* ?_File_size@sys@tr2@std@@YA_KPBD@Z */
14657 /* ?_File_size@sys@tr2@std@@YA_KPEBD@Z */
14658 ULONGLONG __cdecl tr2_sys__File_size(char const* path)
14660 WIN32_FILE_ATTRIBUTE_DATA fad;
14662 TRACE("(%s)\n", debugstr_a(path));
14663 if(!GetFileAttributesExA(path, GetFileExInfoStandard, &fad))
14664 return 0;
14666 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
14669 static int equivalent_handles(HANDLE h1, HANDLE h2)
14671 int ret;
14672 BY_HANDLE_FILE_INFORMATION info1, info2;
14674 if(h1 == INVALID_HANDLE_VALUE)
14675 return h2 == INVALID_HANDLE_VALUE ? -1 : 0;
14676 else if(h2 == INVALID_HANDLE_VALUE)
14677 return 0;
14679 ret = GetFileInformationByHandle(h1, &info1) && GetFileInformationByHandle(h2, &info2);
14680 if(!ret)
14681 return -1;
14682 return (info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber
14683 && info1.nFileIndexHigh == info2.nFileIndexHigh
14684 && info1.nFileIndexLow == info2.nFileIndexLow
14688 /* ?_Equivalent@sys@tr2@std@@YAHPBD0@Z */
14689 /* ?_Equivalent@sys@tr2@std@@YAHPEBD0@Z */
14690 int __cdecl tr2_sys__Equivalent(char const* path1, char const* path2)
14692 HANDLE h1, h2;
14693 int ret;
14695 TRACE("(%s %s)\n", debugstr_a(path1), debugstr_a(path2));
14697 h1 = CreateFileA(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14698 NULL, OPEN_EXISTING, 0, 0);
14699 h2 = CreateFileA(path2, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14700 NULL, OPEN_EXISTING, 0, 0);
14701 ret = equivalent_handles(h1, h2);
14702 CloseHandle(h1);
14703 CloseHandle(h2);
14704 return ret;
14707 /* ?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z */
14708 /* ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z */
14709 char* __cdecl tr2_sys__Current_get(char *current_path)
14711 TRACE("(%s)\n", debugstr_a(current_path));
14713 if(!GetCurrentDirectoryA(MAX_PATH, current_path))
14714 return NULL;
14715 return current_path;
14718 /* ?_Current_set@sys@tr2@std@@YA_NPBD@Z */
14719 /* ?_Current_set@sys@tr2@std@@YA_NPEBD@Z */
14720 MSVCP_bool __cdecl tr2_sys__Current_set(char const* path)
14722 TRACE("(%s)\n", debugstr_a(path));
14723 return SetCurrentDirectoryA(path) != 0;
14726 /* ?_Make_dir@sys@tr2@std@@YAHPBD@Z */
14727 /* ?_Make_dir@sys@tr2@std@@YAHPEBD@Z */
14728 int __cdecl tr2_sys__Make_dir(char const* path)
14730 TRACE("(%s)\n", debugstr_a(path));
14732 if(!CreateDirectoryA(path, NULL)) {
14733 if(GetLastError() == ERROR_ALREADY_EXISTS)
14734 return 0;
14735 else
14736 return -1;
14739 return 1;
14742 /* ?_Remove_dir@sys@tr2@std@@YA_NPBD@Z */
14743 /* ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z */
14744 MSVCP_bool __cdecl tr2_sys__Remove_dir(char const* path)
14746 TRACE("(%s)\n", debugstr_a(path));
14747 return RemoveDirectoryA(path) != 0;
14750 /* ?_Copy_file@sys@tr2@std@@YAHPBD0_N@Z */
14751 /* ?_Copy_file@sys@tr2@std@@YAHPEBD0_N@Z */
14752 int __cdecl tr2_sys__Copy_file(char const* source, char const* dest, MSVCP_bool fail_if_exists)
14754 TRACE("(%s %s %x)\n", debugstr_a(source), debugstr_a(dest), fail_if_exists);
14756 if(!source || !dest)
14757 return ERROR_INVALID_PARAMETER;
14759 if(CopyFileA(source, dest, fail_if_exists))
14760 return ERROR_SUCCESS;
14761 return GetLastError();
14764 /* ?_Rename@sys@tr2@std@@YAHPBD0@Z */
14765 /* ?_Rename@sys@tr2@std@@YAHPEBD0@Z */
14766 int __cdecl tr2_sys__Rename(char const* old_path, char const* new_path)
14768 TRACE("(%s %s)\n", debugstr_a(old_path), debugstr_a(new_path));
14770 if(!old_path || !new_path)
14771 return ERROR_INVALID_PARAMETER;
14773 if(MoveFileExA(old_path, new_path, MOVEFILE_COPY_ALLOWED))
14774 return ERROR_SUCCESS;
14775 return GetLastError();
14778 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z */
14779 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z */
14780 struct space_info* __cdecl tr2_sys__Statvfs(struct space_info *ret, const char* path)
14782 ULARGE_INTEGER available, total, free;
14784 TRACE("(%s)\n", debugstr_a(path));
14786 if(!path || !GetDiskFreeSpaceExA(path, &available, &total, &free)) {
14787 ret->capacity = ret->free = ret->available = 0;
14788 }else {
14789 ret->capacity = total.QuadPart;
14790 ret->free = free.QuadPart;
14791 ret->available = available.QuadPart;
14793 return ret;
14796 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */
14797 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z */
14798 enum file_type __cdecl tr2_sys__Stat(char const* path, int* err_code)
14800 DWORD attr;
14801 TRACE("(%s %p)\n", debugstr_a(path), err_code);
14802 if(!path) {
14803 *err_code = ERROR_INVALID_PARAMETER;
14804 return status_unknown;
14807 attr=GetFileAttributesA(path);
14808 if(attr == INVALID_FILE_ATTRIBUTES) {
14809 enum file_type ret;
14810 switch(GetLastError()) {
14811 case ERROR_FILE_NOT_FOUND:
14812 case ERROR_BAD_NETPATH:
14813 case ERROR_INVALID_NAME:
14814 case ERROR_BAD_PATHNAME:
14815 case ERROR_PATH_NOT_FOUND:
14816 ret = file_not_found;
14817 *err_code = ERROR_SUCCESS;
14818 break;
14819 default:
14820 ret = status_unknown;
14821 *err_code = GetLastError();
14823 return ret;
14826 *err_code = ERROR_SUCCESS;
14827 return (attr & FILE_ATTRIBUTE_DIRECTORY)?directory_file:regular_file;
14830 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */
14831 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z */
14832 enum file_type __cdecl tr2_sys__Lstat(char const* path, int* err_code)
14834 return tr2_sys__Stat(path, err_code);
14837 static __int64 get_last_write_time(HANDLE h)
14839 FILETIME wt;
14840 __int64 ret;
14842 if(!GetFileTime(h, 0, 0, &wt))
14843 return -1;
14845 ret = (((__int64)wt.dwHighDateTime)<< 32) + wt.dwLowDateTime;
14846 ret -= TICKS_1601_TO_1970;
14847 return ret;
14850 /* ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z */
14851 /* ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z */
14852 __int64 __cdecl tr2_sys__Last_write_time(char const* path)
14854 HANDLE handle;
14855 __int64 ret;
14857 TRACE("(%s)\n", debugstr_a(path));
14859 handle = CreateFileA(path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14860 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14861 if(handle == INVALID_HANDLE_VALUE)
14862 return 0;
14864 ret = get_last_write_time(handle);
14865 CloseHandle(handle);
14866 return ret / TICKSPERSEC;
14869 /* _Last_write_time */
14870 __int64 __cdecl _Last_write_time(const wchar_t *path)
14872 HANDLE handle;
14873 __int64 ret;
14875 TRACE("(%s)\n", debugstr_w(path));
14877 handle = CreateFileW(path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14878 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14879 if(handle == INVALID_HANDLE_VALUE)
14880 return -1;
14882 ret = get_last_write_time(handle);
14883 CloseHandle(handle);
14884 return ret;
14887 /* ?_Last_write_time@sys@tr2@std@@YA_JPB_W@Z */
14888 /* ?_Last_write_time@sys@tr2@std@@YA_JPEB_W@Z */
14889 __int64 __cdecl tr2_sys__Last_write_time_wchar(const wchar_t *path)
14891 TRACE("(%s)\n", debugstr_w(path));
14892 return _Last_write_time(path) / TICKSPERSEC;
14895 static int set_last_write_time(HANDLE h, __int64 time)
14897 FILETIME wt;
14899 time += TICKS_1601_TO_1970;
14900 wt.dwLowDateTime = (DWORD)time;
14901 wt.dwHighDateTime = (DWORD)(time >> 32);
14902 return SetFileTime(h, 0, 0, &wt);
14905 /* ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z */
14906 /* ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z */
14907 void __cdecl tr2_sys__Last_write_time_set(char const* path, __int64 newtime)
14909 HANDLE handle;
14911 TRACE("(%s)\n", debugstr_a(path));
14913 handle = CreateFileA(path, FILE_WRITE_ATTRIBUTES,
14914 FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14915 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14916 if(handle == INVALID_HANDLE_VALUE)
14917 return;
14919 /* This is the implementation based on the test of msvcp110.
14920 * According to the test of msvcp120,
14921 * msvcp120's implementation does nothing. Obviously, this is a bug of windows.
14923 set_last_write_time(handle, newtime * TICKSPERSEC);
14924 CloseHandle(handle);
14927 /* _Set_last_write_time */
14928 int __cdecl _Set_last_write_time(const wchar_t *path, __int64 time)
14930 HANDLE handle;
14931 int ret;
14933 TRACE("(%s)\n", debugstr_w(path));
14935 handle = CreateFileW(path, FILE_WRITE_ATTRIBUTES,
14936 FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14937 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14938 if(handle == INVALID_HANDLE_VALUE)
14939 return 0;
14941 ret = set_last_write_time(handle, time);
14942 CloseHandle(handle);
14943 return ret;
14946 /* ?_Last_write_time@sys@tr2@std@@YAXPB_W_J@Z */
14947 /* ?_Last_write_time@sys@tr2@std@@YAXPEB_W_J@Z */
14948 void __cdecl tr2_sys__Last_write_time_set_wchar(const wchar_t *path, __int64 time)
14950 TRACE("(%s)\n", debugstr_w(path));
14951 _Set_last_write_time(path, time * TICKSPERSEC);
14954 /* ??_Open_dir@sys@tr2@std@@YAPAXPA_WPB_WAAHAAW4file_type@123@@Z */
14955 /* ??_Open_dir@sys@tr2@std@@YAPEAXPEA_WPEB_WAEAHAEAW4file_type@123@@Z */
14956 void* __cdecl tr2_sys__Open_dir_wchar(wchar_t* target, wchar_t const* dest, int* err_code, enum file_type* type)
14958 HANDLE handle;
14959 WIN32_FIND_DATAW data;
14960 wchar_t temppath[MAX_PATH];
14961 static const wchar_t dot[] = {'.', 0};
14962 static const wchar_t dotdot[] = {'.', '.', 0};
14963 static const wchar_t asterisk[] = {'\\', '*', 0};
14965 TRACE("(%p %s %p %p)\n", target, debugstr_w(dest), err_code, type);
14966 if(wcslen(dest) > MAX_PATH - 3) {
14967 *err_code = ERROR_BAD_PATHNAME;
14968 *target = '\0';
14969 return NULL;
14971 wcscpy(temppath, dest);
14972 wcscat(temppath, asterisk);
14974 handle = FindFirstFileW(temppath, &data);
14975 if(handle == INVALID_HANDLE_VALUE) {
14976 *err_code = ERROR_BAD_PATHNAME;
14977 *target = '\0';
14978 return NULL;
14980 while(!wcscmp(data.cFileName, dot) || !wcscmp(data.cFileName, dotdot)) {
14981 if(!FindNextFileW(handle, &data)) {
14982 *err_code = ERROR_SUCCESS;
14983 *type = status_unknown;
14984 *target = '\0';
14985 FindClose(handle);
14986 return NULL;
14990 wcscpy(target, data.cFileName);
14991 *err_code = ERROR_SUCCESS;
14992 if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
14993 *type = directory_file;
14994 else
14995 *type = regular_file;
14996 return handle;
14999 /* ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z */
15000 /* ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z */
15001 void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, enum file_type* type)
15003 void *handle;
15004 wchar_t target_w[MAX_PATH];
15005 wchar_t dest_w[MAX_PATH];
15007 TRACE("(%p %s %p %p)\n", target, debugstr_a(dest), err_code, type);
15009 if (dest && !MultiByteToWideChar(CP_ACP, 0, dest, -1, dest_w, MAX_PATH))
15011 WARN("Failed to convert input string.\n");
15012 *err_code = ERROR_BAD_PATHNAME;
15013 return NULL;
15016 handle = tr2_sys__Open_dir_wchar(target_w, dest ? dest_w : NULL, err_code, type);
15018 WideCharToMultiByte(CP_ACP, 0, target_w, -1, target, MAX_PATH, NULL, NULL);
15020 return handle;
15023 /* ??_Read_dir@sys@tr2@std@@YAPA_WPA_WPAXAAW4file_type@123@@Z */
15024 /* ??_Read_dir@sys@tr2@std@@YAPEA_WPEA_WPEAXAEAW4file_type@123@@Z */
15025 wchar_t* __cdecl tr2_sys__Read_dir_wchar(wchar_t* target, void* handle, enum file_type* type)
15027 WIN32_FIND_DATAW data;
15028 static const wchar_t dot[] = {'.', 0};
15029 static const wchar_t dotdot[] = {'.', '.', 0};
15031 TRACE("(%p %p %p)\n", target, handle, type);
15033 do {
15034 if(!FindNextFileW(handle, &data)) {
15035 *type = status_unknown;
15036 *target = '\0';
15037 return target;
15039 } while(!wcscmp(data.cFileName, dot) || !wcscmp(data.cFileName, dotdot));
15041 wcscpy(target, data.cFileName);
15042 if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
15043 *type = directory_file;
15044 else
15045 *type = regular_file;
15046 return target;
15049 /* ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z */
15050 /* ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z */
15051 char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type)
15053 wchar_t target_w[MAX_PATH];
15055 tr2_sys__Read_dir_wchar(target_w, handle, type);
15056 WideCharToMultiByte(CP_ACP, 0, target_w, -1, target, MAX_PATH, NULL, NULL);
15058 return target;
15061 /* ?_Close_dir@sys@tr2@std@@YAXPAX@Z */
15062 /* ?_Close_dir@sys@tr2@std@@YAXPEAX@Z */
15063 void __cdecl tr2_sys__Close_dir(void* handle)
15065 TRACE("(%p)\n", handle);
15067 FindClose(handle);
15070 /* ?_Link@sys@tr2@std@@YAHPBD0@Z */
15071 /* ?_Link@sys@tr2@std@@YAHPEBD0@Z */
15072 int __cdecl tr2_sys__Link(char const* existing_path, char const* new_path)
15074 TRACE("(%s %s)\n", debugstr_a(existing_path), debugstr_a(new_path));
15075 if(!existing_path || !new_path)
15076 return ERROR_INVALID_PARAMETER;
15078 if(CreateHardLinkA(new_path, existing_path, NULL))
15079 return ERROR_SUCCESS;
15080 return GetLastError();
15083 /* ?_Link@sys@tr2@std@@YAHPB_W0@Z */
15084 /* ?_Link@sys@tr2@std@@YAHPEB_W0@Z */
15085 /* _Link */
15086 int __cdecl tr2_sys__Link_wchar(WCHAR const* existing_path, WCHAR const* new_path)
15088 TRACE("(%s %s)\n", debugstr_w(existing_path), debugstr_w(new_path));
15089 if(!existing_path || !new_path)
15090 return ERROR_INVALID_PARAMETER;
15092 if(CreateHardLinkW(new_path, existing_path, NULL))
15093 return ERROR_SUCCESS;
15094 return GetLastError();
15097 /* ?_Symlink@sys@tr2@std@@YAHPBD0@Z */
15098 /* ?_Symlink@sys@tr2@std@@YAHPEBD0@Z */
15099 int __cdecl tr2_sys__Symlink(char const* existing_file_name, char const* file_name)
15101 TRACE("(%s %s)\n", debugstr_a(existing_file_name), debugstr_a(file_name));
15102 if(!existing_file_name || !file_name)
15103 return ERROR_INVALID_PARAMETER;
15105 if(CreateSymbolicLinkA(file_name, existing_file_name, 0))
15106 return ERROR_SUCCESS;
15107 return GetLastError();
15110 /* ?_Symlink@sys@tr2@std@@YAHPB_W0@Z */
15111 /* ?_Symlink@sys@tr2@std@@YAHPEB_W0@Z */
15112 /* _Symlink */
15113 int __cdecl tr2_sys__Symlink_wchar(WCHAR const* existing_file_name, WCHAR const* file_name)
15115 TRACE("(%s %s)\n", debugstr_w(existing_file_name), debugstr_w(file_name));
15116 if(!existing_file_name || !file_name)
15117 return ERROR_INVALID_PARAMETER;
15119 if(CreateSymbolicLinkW(file_name, existing_file_name, 0))
15120 return ERROR_SUCCESS;
15121 return GetLastError();
15124 /* ?_Unlink@sys@tr2@std@@YAHPBD@Z */
15125 /* ?_Unlink@sys@tr2@std@@YAHPEBD@Z */
15126 int __cdecl tr2_sys__Unlink(char const* path)
15128 TRACE("(%s)\n", debugstr_a(path));
15130 if(DeleteFileA(path))
15131 return ERROR_SUCCESS;
15132 return GetLastError();
15135 /* ?_Unlink@sys@tr2@std@@YAHPB_W@Z */
15136 /* ?_Unlink@sys@tr2@std@@YAHPEB_W@Z */
15137 /* _Unlink */
15138 int __cdecl tr2_sys__Unlink_wchar(WCHAR const* path)
15140 TRACE("(%s)\n", debugstr_w(path));
15142 if(DeleteFileW(path))
15143 return ERROR_SUCCESS;
15144 return GetLastError();
15147 /* ??0strstream@std@@QAE@PADHH@Z */
15148 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
15149 #if STREAMSIZE_BITS == 64
15150 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
15151 #else
15152 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
15153 #endif
15154 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
15156 basic_ios_char *basic_ios;
15158 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
15160 if(virt_init) {
15161 this->base.base1.vbtable = strstream_vbtable1;
15162 this->base.base2.vbtable = strstream_vbtable2;
15163 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
15164 INIT_BASIC_IOS_VTORDISP(basic_ios);
15165 basic_ios_char_ctor(basic_ios);
15166 }else {
15167 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
15170 strstreambuf_ctor_get_put(&this->buf, buf, size,
15171 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
15172 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
15173 basic_ios->base.vtable = &MSVCP_strstream_vtable;
15174 return this;
15177 /* ??1strstream@std@@UAE@XZ */
15178 /* ??1strstream@std@@UEAA@XZ */
15179 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
15180 void __thiscall strstream_dtor(basic_ios_char *base)
15182 strstream *this = strstream_from_basic_ios(base);
15184 TRACE("(%p)\n", this);
15186 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
15187 strstreambuf_dtor(&this->buf);
15190 static void strstream_vbase_dtor(strstream *this)
15192 basic_ios_char *base = strstream_to_basic_ios(this);
15194 TRACE("(%p)\n", this);
15196 strstream_dtor(base);
15197 basic_ios_char_dtor(base);
15200 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
15201 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
15203 strstream *this = strstream_from_basic_ios(base);
15205 TRACE("(%p %x)\n", this, flags);
15207 if(flags & 2) {
15208 /* we have an array, with the number of elements stored before the first object */
15209 INT_PTR i, *ptr = (INT_PTR *)this-1;
15211 for(i=*ptr-1; i>=0; i--)
15212 strstream_vbase_dtor(this+i);
15213 MSVCRT_operator_delete(ptr);
15214 } else {
15215 strstream_vbase_dtor(this);
15216 if(flags & 1)
15217 MSVCRT_operator_delete(this);
15220 return this;
15223 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
15225 ios_base_precision_set(base, prec);
15228 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
15229 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
15230 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
15232 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
15234 ret->pfunc = setprecision_func;
15235 ret->arg = prec;
15236 return ret;
15239 static void __cdecl setw_func(ios_base *base, streamsize width)
15241 ios_base_width_set(base, width);
15244 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
15245 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
15246 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
15248 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
15250 ret->pfunc = setw_func;
15251 ret->arg = width;
15252 return ret;
15255 static void __cdecl resetioflags_func(ios_base *base, int mask)
15257 ios_base_setf_mask(base, 0, mask);
15260 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
15261 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
15263 TRACE("(%p %d)\n", ret, mask);
15265 ret->pfunc = resetioflags_func;
15266 ret->arg = mask;
15267 return ret;
15270 static void __cdecl setiosflags_func(ios_base *base, int mask)
15272 ios_base_setf_mask(base, FMTFLAG_mask, mask);
15275 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
15276 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
15278 TRACE("(%p %d)\n", ret, mask);
15280 ret->pfunc = setiosflags_func;
15281 ret->arg = mask;
15282 return ret;
15285 static void __cdecl setbase_func(ios_base *base, int set_base)
15287 if(set_base == 10)
15288 set_base = FMTFLAG_dec;
15289 else if(set_base == 8)
15290 set_base = FMTFLAG_oct;
15291 else if(set_base == 16)
15292 set_base = FMTFLAG_hex;
15293 else
15294 set_base = 0;
15296 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
15299 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
15300 manip_int* __cdecl setbase(manip_int *ret, int base)
15302 TRACE("(%p %d)\n", ret, base);
15304 ret->pfunc = setbase_func;
15305 ret->arg = base;
15306 return ret;
15309 static basic_filebuf_char filebuf_char_stdin;
15310 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
15311 struct {
15312 basic_istream_char obj;
15313 #if _MSVCP_VER >= 110
15314 int vtordisp;
15315 #endif
15316 basic_ios_char vbase;
15317 } cin = { { 0 } };
15318 C_ASSERT(sizeof(cin) == VBTABLE_BASIC_IOS_ENTRY(basic_istream_char, 0)+sizeof(basic_ios_char));
15319 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
15320 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
15321 basic_istream_char *_Ptr_cin = &cin.obj;
15323 static basic_filebuf_wchar filebuf_short_stdin;
15324 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
15325 struct {
15326 basic_istream_wchar obj;
15327 #if _MSVCP_VER >= 110
15328 int vtordisp;
15329 #endif
15330 basic_ios_wchar vbase;
15331 } ucin = { { 0 } };
15332 C_ASSERT(sizeof(ucin) == VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)+sizeof(basic_ios_wchar));
15333 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
15334 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
15335 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
15337 static basic_filebuf_wchar filebuf_wchar_stdin;
15338 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
15339 struct {
15340 basic_istream_wchar obj;
15341 #if _MSVCP_VER >= 110
15342 int vtordisp;
15343 #endif
15344 basic_ios_wchar vbase;
15345 } wcin = { { 0 } };
15346 C_ASSERT(sizeof(wcin) == VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)+sizeof(basic_ios_wchar));
15347 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
15348 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
15349 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
15351 static basic_filebuf_char filebuf_char_stdout;
15352 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15353 struct {
15354 basic_ostream_char obj;
15355 #if _MSVCP_VER >= 110
15356 int vtordisp;
15357 #endif
15358 basic_ios_char vbase;
15359 } cout = { { 0 } };
15360 C_ASSERT(sizeof(cout) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)+sizeof(basic_ios_char));
15361 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15362 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15363 basic_ostream_char *_Ptr_cout = &cout.obj;
15365 static basic_filebuf_wchar filebuf_short_stdout;
15366 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15367 struct {
15368 basic_ostream_wchar obj;
15369 #if _MSVCP_VER >= 110
15370 int vtordisp;
15371 #endif
15372 basic_ios_wchar vbase;
15373 } ucout = { { 0 } };
15374 C_ASSERT(sizeof(ucout) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15375 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15376 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15377 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
15379 static basic_filebuf_wchar filebuf_wchar_stdout;
15380 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15381 struct {
15382 basic_ostream_wchar obj;
15383 #if _MSVCP_VER >= 110
15384 int vtordisp;
15385 #endif
15386 basic_ios_wchar vbase;
15387 } wcout = { { 0 } };
15388 C_ASSERT(sizeof(wcout) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15389 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15390 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15391 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
15393 static basic_filebuf_char filebuf_char_stderr;
15394 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15395 struct {
15396 basic_ostream_char obj;
15397 #if _MSVCP_VER >= 110
15398 int vtordisp;
15399 #endif
15400 basic_ios_char vbase;
15401 } cerr = { { 0 } };
15402 C_ASSERT(sizeof(cerr) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)+sizeof(basic_ios_char));
15403 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15404 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15405 basic_ostream_char *_Ptr_cerr = &cerr.obj;
15407 static basic_filebuf_wchar filebuf_short_stderr;
15408 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15409 struct {
15410 basic_ostream_wchar obj;
15411 #if _MSVCP_VER >= 110
15412 int vtordisp;
15413 #endif
15414 basic_ios_wchar vbase;
15415 } ucerr = { { 0 } };
15416 C_ASSERT(sizeof(ucerr) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15417 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15418 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15419 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
15421 static basic_filebuf_wchar filebuf_wchar_stderr;
15422 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15423 struct {
15424 basic_ostream_wchar obj;
15425 #if _MSVCP_VER >= 110
15426 int vtordisp;
15427 #endif
15428 basic_ios_wchar vbase;
15429 } wcerr = { { 0 } };
15430 C_ASSERT(sizeof(wcerr) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15431 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15432 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15433 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
15435 static basic_filebuf_char filebuf_char_log;
15436 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15437 struct {
15438 basic_ostream_char obj;
15439 #if _MSVCP_VER >= 110
15440 int vtordisp;
15441 #endif
15442 basic_ios_char vbase;
15443 } MSVCP_clog = { { 0 } };
15444 C_ASSERT(sizeof(MSVCP_clog) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)+sizeof(basic_ios_char));
15445 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15446 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15447 basic_ostream_char *_Ptr_clog = &MSVCP_clog.obj;
15449 static basic_filebuf_wchar filebuf_short_log;
15450 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15451 struct {
15452 basic_ostream_wchar obj;
15453 #if _MSVCP_VER >= 110
15454 int vtordisp;
15455 #endif
15456 basic_ios_wchar vbase;
15457 } uclog = { { 0 } };
15458 C_ASSERT(sizeof(uclog) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15459 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15460 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15461 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
15463 static basic_filebuf_wchar filebuf_wchar_log;
15464 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15465 struct {
15466 basic_ostream_wchar obj;
15467 #if _MSVCP_VER >= 110
15468 int vtordisp;
15469 #endif
15470 basic_ios_wchar vbase;
15471 } wclog = { { 0 } };
15472 C_ASSERT(sizeof(wclog) == VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)+sizeof(basic_ios_wchar));
15473 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15474 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15475 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
15477 /* ?_Init_cnt@Init@ios_base@std@@0HA */
15478 int ios_base_Init__Init_cnt = -1;
15480 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
15481 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
15482 int* __cdecl ios_base_Init__Init_cnt_func(void)
15484 return &ios_base_Init__Init_cnt;
15487 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
15488 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
15489 void __cdecl ios_base_Init__Init_ctor(void *this)
15491 TRACE("(%p)\n", this);
15493 if(ios_base_Init__Init_cnt < 0)
15494 ios_base_Init__Init_cnt = 1;
15495 else
15496 ios_base_Init__Init_cnt++;
15499 /* ??0Init@ios_base@std@@QAE@XZ */
15500 /* ??0Init@ios_base@std@@QEAA@XZ */
15501 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
15502 void* __thiscall ios_base_Init_ctor(void *this)
15504 ios_base_Init__Init_ctor(this);
15505 return this;
15508 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
15509 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
15510 void __cdecl ios_base_Init__Init_dtor(void *this)
15512 TRACE("(%p)\n", this);
15514 ios_base_Init__Init_cnt--;
15515 if(!ios_base_Init__Init_cnt) {
15516 basic_ostream_char_flush(&cout.obj);
15517 basic_ostream_char_flush(&cerr.obj);
15518 basic_ostream_char_flush(&MSVCP_clog.obj);
15522 /* ??1Init@ios_base@std@@QAE@XZ */
15523 /* ??1Init@ios_base@std@@QEAA@XZ */
15524 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
15525 void __thiscall ios_base_Init_dtor(void *this)
15527 ios_base_Init__Init_dtor(this);
15530 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
15531 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
15532 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
15533 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
15535 TRACE("(%p %p)\n", this, rhs);
15536 return this;
15539 /* ?_Init_cnt@_Winit@std@@0HA */
15540 int _Winit__Init_cnt = -1;
15542 /* ??0_Winit@std@@QAE@XZ */
15543 /* ??0_Winit@std@@QEAA@XZ */
15544 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
15545 void* __thiscall _Winit_ctor(void *this)
15547 TRACE("(%p)\n", this);
15549 if(_Winit__Init_cnt < 0)
15550 _Winit__Init_cnt = 1;
15551 else
15552 _Winit__Init_cnt++;
15554 return this;
15557 /* ?_File_size@sys@tr2@std@@YA_KPB_W@Z */
15558 /* ?_File_size@sys@tr2@std@@YA_KPEB_W@Z */
15559 ULONGLONG __cdecl tr2_sys__File_size_wchar(WCHAR const* path)
15561 WIN32_FILE_ATTRIBUTE_DATA fad;
15563 TRACE("(%s)\n", debugstr_w(path));
15564 if(!GetFileAttributesExW(path, GetFileExInfoStandard, &fad))
15565 return 0;
15567 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
15570 /* _File_size, msvcp140 version. Different error handling. */
15571 ULONGLONG __cdecl _File_size(WCHAR const* path)
15573 WIN32_FILE_ATTRIBUTE_DATA fad;
15575 TRACE("(%s)\n", debugstr_w(path));
15576 if(!GetFileAttributesExW(path, GetFileExInfoStandard, &fad))
15577 return ~(ULONGLONG)0;
15579 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
15582 int __cdecl _Resize(const WCHAR *path, UINT64 size)
15584 LARGE_INTEGER offset;
15585 HANDLE file;
15586 BOOL ret;
15588 TRACE("(%s %s)\n", debugstr_w(path), wine_dbgstr_longlong(size));
15590 file = CreateFileW(path, FILE_GENERIC_WRITE, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15591 NULL, OPEN_EXISTING, 0, 0);
15592 if(file == INVALID_HANDLE_VALUE)
15593 return GetLastError();
15595 offset.QuadPart = size;
15596 if((ret = SetFilePointerEx(file, offset, NULL, FILE_BEGIN)))
15597 ret = SetEndOfFile(file);
15598 CloseHandle(file);
15599 return ret ? 0 : GetLastError();
15602 /* ?_Equivalent@sys@tr2@std@@YAHPB_W0@Z */
15603 /* ?_Equivalent@sys@tr2@std@@YAHPEB_W0@Z */
15604 int __cdecl tr2_sys__Equivalent_wchar(WCHAR const* path1, WCHAR const* path2)
15606 HANDLE h1, h2;
15607 int ret;
15609 TRACE("(%s %s)\n", debugstr_w(path1), debugstr_w(path2));
15611 h1 = CreateFileW(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15612 NULL, OPEN_EXISTING, 0, 0);
15613 h2 = CreateFileW(path2, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15614 NULL, OPEN_EXISTING, 0, 0);
15615 ret = equivalent_handles(h1, h2);
15616 CloseHandle(h1);
15617 CloseHandle(h2);
15618 return ret;
15621 /* _Equivalent, msvcp140 version */
15622 int __cdecl _Equivalent(WCHAR const* path1, WCHAR const* path2)
15624 HANDLE h1, h2;
15625 int ret;
15627 TRACE("(%s %s)\n", debugstr_w(path1), debugstr_w(path2));
15629 h1 = CreateFileW(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15630 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
15631 h2 = CreateFileW(path2, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15632 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
15633 ret = equivalent_handles(h1, h2);
15634 CloseHandle(h1);
15635 CloseHandle(h2);
15636 return ret;
15639 /* ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z */
15640 /* ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z */
15641 WCHAR* __cdecl tr2_sys__Current_get_wchar(WCHAR *current_path)
15643 TRACE("(%s)\n", debugstr_w(current_path));
15645 if(!GetCurrentDirectoryW(MAX_PATH, current_path))
15646 return NULL;
15647 return current_path;
15650 /* _Current_get, msvcp140 version */
15651 BOOL __cdecl _Current_get(WCHAR *current_path)
15653 TRACE("(%s)\n", debugstr_w(current_path));
15655 if(!GetCurrentDirectoryW(MAX_PATH, current_path))
15656 return FALSE;
15657 return TRUE;
15660 /* ?_Current_set@sys@tr2@std@@YA_NPB_W@Z */
15661 /* ?_Current_set@sys@tr2@std@@YA_NPEB_W@Z */
15662 MSVCP_bool __cdecl tr2_sys__Current_set_wchar(WCHAR const* path)
15664 TRACE("(%s)\n", debugstr_w(path));
15665 return SetCurrentDirectoryW(path) != 0;
15668 /* ?_Make_dir@sys@tr2@std@@YAHPB_W@Z */
15669 /* ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z */
15670 int __cdecl tr2_sys__Make_dir_wchar(WCHAR const* path)
15672 TRACE("(%s)\n", debugstr_w(path));
15674 if(!CreateDirectoryW(path, NULL)) {
15675 if(GetLastError() == ERROR_ALREADY_EXISTS)
15676 return 0;
15677 else
15678 return -1;
15681 return 1;
15684 /* ?_Remove_dir@sys@tr2@std@@YA_NPB_W@Z */
15685 /* ?_Remove_dir@sys@tr2@std@@YA_NPEB_W@Z */
15686 MSVCP_bool __cdecl tr2_sys__Remove_dir_wchar(WCHAR const* path)
15688 TRACE("(%s)\n", debugstr_w(path));
15689 return RemoveDirectoryW(path) != 0;
15692 /* ?_Copy_file@sys@tr2@std@@YAHPB_W0_N@Z */
15693 /* ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z */
15694 int __cdecl tr2_sys__Copy_file_wchar(WCHAR const* source, WCHAR const* dest, MSVCP_bool fail_if_exists)
15696 TRACE("(%s %s %x)\n", debugstr_w(source), debugstr_w(dest), fail_if_exists);
15698 if(CopyFileW(source, dest, fail_if_exists))
15699 return ERROR_SUCCESS;
15700 return GetLastError();
15703 /* ?_Rename@sys@tr2@std@@YAHPB_W0@Z */
15704 /* ?_Rename@sys@tr2@std@@YAHPEB_W0@Z */
15705 int __cdecl tr2_sys__Rename_wchar(WCHAR const* old_path, WCHAR const* new_path)
15707 TRACE("(%s %s)\n", debugstr_w(old_path), debugstr_w(new_path));
15709 if(MoveFileExW(old_path, new_path, MOVEFILE_COPY_ALLOWED))
15710 return ERROR_SUCCESS;
15711 return GetLastError();
15714 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z */
15715 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z */
15716 struct space_info* __cdecl tr2_sys__Statvfs_wchar(struct space_info *ret, const WCHAR* path)
15718 ULARGE_INTEGER available, total, free;
15720 TRACE("(%s)\n", debugstr_w(path));
15722 if(!path || !GetDiskFreeSpaceExW(path, &available, &total, &free)) {
15723 ret->capacity = ret->free = ret->available = 0;
15724 }else {
15725 ret->capacity = total.QuadPart;
15726 ret->free = free.QuadPart;
15727 ret->available = available.QuadPart;
15729 return ret;
15732 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z */
15733 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z */
15734 enum file_type __cdecl tr2_sys__Stat_wchar(WCHAR const* path, int* err_code)
15736 DWORD attr;
15737 TRACE("(%s %p)\n", debugstr_w(path), err_code);
15738 if(!path) {
15739 *err_code = ERROR_INVALID_PARAMETER;
15740 return status_unknown;
15743 attr=GetFileAttributesW(path);
15744 if(attr == INVALID_FILE_ATTRIBUTES) {
15745 enum file_type ret;
15746 switch(GetLastError()) {
15747 case ERROR_FILE_NOT_FOUND:
15748 case ERROR_BAD_NETPATH:
15749 case ERROR_INVALID_NAME:
15750 case ERROR_BAD_PATHNAME:
15751 case ERROR_PATH_NOT_FOUND:
15752 ret = file_not_found;
15753 *err_code = ERROR_SUCCESS;
15754 break;
15755 default:
15756 ret = status_unknown;
15757 *err_code = GetLastError();
15759 return ret;
15762 *err_code = ERROR_SUCCESS;
15763 return (attr & FILE_ATTRIBUTE_DIRECTORY)?directory_file:regular_file;
15766 /* _Stat, msvcp140 version */
15767 enum file_type __cdecl _Stat(WCHAR const* path, int* permissions)
15769 DWORD attr;
15770 TRACE("(%s %p)\n", debugstr_w(path), permissions);
15771 if(!path) {
15772 return file_not_found;
15775 attr=GetFileAttributesW(path);
15776 if(attr == INVALID_FILE_ATTRIBUTES) {
15777 enum file_type ret;
15778 switch(GetLastError()) {
15779 case ERROR_FILE_NOT_FOUND:
15780 case ERROR_BAD_NETPATH:
15781 case ERROR_INVALID_NAME:
15782 case ERROR_BAD_PATHNAME:
15783 case ERROR_PATH_NOT_FOUND:
15784 ret = file_not_found;
15785 break;
15786 default:
15787 ret = status_unknown;
15789 return ret;
15792 if (permissions)
15793 *permissions = (attr & FILE_ATTRIBUTE_READONLY) ? 0555 : 0777;
15794 return (attr & FILE_ATTRIBUTE_DIRECTORY) ? directory_file : regular_file;
15797 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z */
15798 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z */
15799 enum file_type __cdecl tr2_sys__Lstat_wchar(WCHAR const* path, int* err_code)
15801 return tr2_sys__Stat_wchar(path, err_code);
15804 /* _Lstat, msvcp140 version */
15805 enum file_type __cdecl _Lstat(WCHAR const* path, int* permissions)
15807 return _Stat(path, permissions);
15810 WCHAR * __cdecl _Temp_get(WCHAR *dst)
15812 GetTempPathW(MAX_PATH, dst);
15813 return dst;
15816 /* ??1_Winit@std@@QAE@XZ */
15817 /* ??1_Winit@std@@QAE@XZ */
15818 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
15819 void __thiscall _Winit_dtor(void *this)
15821 TRACE("(%p)\n", this);
15823 _Winit__Init_cnt--;
15824 if(!_Winit__Init_cnt) {
15825 basic_ostream_wchar_flush(&wcout.obj);
15826 basic_ostream_wchar_flush(&wcerr.obj);
15827 basic_ostream_wchar_flush(&wclog.obj);
15831 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
15832 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
15833 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
15834 void* __thiscall _Winit_op_assign(void *this, void *rhs)
15836 TRACE("(%p %p)\n", this, rhs);
15837 return this;
15840 void init_io(void *base)
15842 #ifdef __x86_64__
15843 init_iosb_rtti(base);
15844 init_ios_base_rtti(base);
15845 init_basic_ios_char_rtti(base);
15846 init_basic_ios_wchar_rtti(base);
15847 init_basic_ios_short_rtti(base);
15848 init_basic_streambuf_char_rtti(base);
15849 init_basic_streambuf_wchar_rtti(base);
15850 init_basic_streambuf_short_rtti(base);
15851 init_basic_filebuf_char_rtti(base);
15852 init_basic_filebuf_wchar_rtti(base);
15853 init_basic_filebuf_short_rtti(base);
15854 init_basic_stringbuf_char_rtti(base);
15855 init_basic_stringbuf_wchar_rtti(base);
15856 init_basic_stringbuf_short_rtti(base);
15857 init_basic_ostream_char_rtti(base);
15858 init_basic_ostream_wchar_rtti(base);
15859 init_basic_ostream_short_rtti(base);
15860 init_basic_istream_char_rtti(base);
15861 init_basic_istream_wchar_rtti(base);
15862 init_basic_istream_short_rtti(base);
15863 init_basic_iostream_char_rtti(base);
15864 init_basic_iostream_wchar_rtti(base);
15865 init_basic_iostream_short_rtti(base);
15866 init_basic_ofstream_char_rtti(base);
15867 init_basic_ofstream_wchar_rtti(base);
15868 init_basic_ofstream_short_rtti(base);
15869 init_basic_ifstream_char_rtti(base);
15870 init_basic_ifstream_wchar_rtti(base);
15871 init_basic_ifstream_short_rtti(base);
15872 init_basic_fstream_char_rtti(base);
15873 init_basic_fstream_wchar_rtti(base);
15874 init_basic_fstream_short_rtti(base);
15875 init_basic_ostringstream_char_rtti(base);
15876 init_basic_ostringstream_wchar_rtti(base);
15877 init_basic_ostringstream_short_rtti(base);
15878 init_basic_istringstream_char_rtti(base);
15879 init_basic_istringstream_wchar_rtti(base);
15880 init_basic_istringstream_short_rtti(base);
15881 init_basic_stringstream_char_rtti(base);
15882 init_basic_stringstream_wchar_rtti(base);
15883 init_basic_stringstream_short_rtti(base);
15884 init_strstreambuf_rtti(base);
15885 init_strstream_rtti(base);
15886 init_ostrstream_rtti(base);
15887 #endif
15889 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
15890 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
15892 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
15893 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
15895 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
15896 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
15898 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
15899 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE);
15901 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
15902 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE);
15904 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
15905 basic_ostream_wchar_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE);
15907 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
15908 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE);
15910 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
15911 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE);
15913 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
15914 basic_ostream_wchar_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE);
15916 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
15917 basic_ostream_char_ctor(&MSVCP_clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE);
15919 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
15920 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE);
15922 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
15923 basic_ostream_wchar_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE);
15926 void free_io(void)
15928 basic_istream_char_vbase_dtor(&cin.obj);
15929 basic_filebuf_char_dtor(&filebuf_char_stdin);
15931 basic_istream_wchar_vbase_dtor(&ucin.obj);
15932 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
15934 basic_istream_wchar_vbase_dtor(&wcin.obj);
15935 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
15937 basic_ostream_char_vbase_dtor(&cout.obj);
15938 basic_filebuf_char_dtor(&filebuf_char_stdout);
15940 basic_ostream_wchar_vbase_dtor(&ucout.obj);
15941 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
15943 basic_ostream_wchar_vbase_dtor(&wcout.obj);
15944 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
15946 basic_ostream_char_vbase_dtor(&cerr.obj);
15947 basic_filebuf_char_dtor(&filebuf_char_stderr);
15949 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
15950 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
15952 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
15953 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
15955 basic_ostream_char_vbase_dtor(&MSVCP_clog.obj);
15956 basic_filebuf_char_dtor(&filebuf_char_log);
15958 basic_ostream_wchar_vbase_dtor(&uclog.obj);
15959 basic_filebuf_wchar_dtor(&filebuf_short_log);
15961 basic_ostream_wchar_vbase_dtor(&wclog.obj);
15962 basic_filebuf_wchar_dtor(&filebuf_wchar_log);