libwine: Generate the composition tables access code along with the tables.
[wine.git] / dlls / msvcp90 / ios.c
blobd9ff6101f76e8848d96827d2f79778ab532bc1a9
1 /*
2 * Copyright 2011 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include <limits.h>
24 #include <share.h>
26 #include "msvcp90.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
32 #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 int state;
47 } fpos_int;
49 static inline const char* debugstr_fpos_int(fpos_int *fpos)
51 return wine_dbg_sprintf("fpos(%s %s %d)", wine_dbgstr_longlong(fpos->off), wine_dbgstr_longlong(fpos->pos), fpos->state);
54 typedef struct {
55 void (__cdecl *pfunc)(ios_base*, streamsize);
56 streamsize arg;
57 } manip_streamsize;
59 typedef struct {
60 void (__cdecl *pfunc)(ios_base*, int);
61 int arg;
62 } manip_int;
64 typedef enum {
65 INITFL_new = 0,
66 INITFL_open = 1,
67 INITFL_close = 2
68 } basic_filebuf__Initfl;
70 typedef struct {
71 basic_streambuf_char base;
72 codecvt_char *cvt;
73 #if _MSVCP_VER < 80
74 int state0;
75 char putback;
76 basic_string_char *conv;
77 #else
78 char putback;
79 #endif
80 MSVCP_bool wrotesome;
81 int state;
82 MSVCP_bool close;
83 #if _MSVCP_VER == 70
84 locale loc;
85 #endif
86 FILE *file;
87 } basic_filebuf_char;
89 typedef struct {
90 basic_streambuf_wchar base;
91 codecvt_wchar *cvt;
92 #if _MSVCP_VER < 80
93 int state0;
94 wchar_t putback;
95 basic_string_char *conv;
96 #else
97 wchar_t putback;
98 #endif
99 MSVCP_bool wrotesome;
100 int state;
101 MSVCP_bool close;
102 #if _MSVCP_VER == 70
103 locale loc;
104 #endif
105 FILE *file;
106 } basic_filebuf_wchar;
108 typedef enum {
109 STRINGBUF_allocated = 1,
110 STRINGBUF_no_write = 2,
111 STRINGBUF_no_read = 4,
112 STRINGBUF_append = 8,
113 STRINGBUF_at_end = 16
114 } basic_stringbuf_state;
116 typedef struct {
117 basic_streambuf_char base;
118 char *seekhigh;
119 int state;
120 char allocator; /* empty struct */
121 } basic_stringbuf_char;
123 typedef struct {
124 basic_streambuf_wchar base;
125 wchar_t *seekhigh;
126 int state;
127 char allocator; /* empty struct */
128 } basic_stringbuf_wchar;
130 typedef struct {
131 ios_base base;
132 basic_streambuf_char *strbuf;
133 struct _basic_ostream_char *stream;
134 char fillch;
135 } basic_ios_char;
137 typedef struct {
138 ios_base base;
139 basic_streambuf_wchar *strbuf;
140 struct _basic_ostream_wchar *stream;
141 wchar_t fillch;
142 } basic_ios_wchar;
144 typedef struct _basic_ostream_char {
145 const int *vbtable;
146 /* virtual inheritance
147 * basic_ios_char basic_ios;
149 } basic_ostream_char;
151 typedef struct _basic_ostream_wchar {
152 const int *vbtable;
153 /* virtual inheritance
154 * basic_ios_wchar basic_ios;
156 } basic_ostream_wchar;
158 typedef struct {
159 const int *vbtable;
160 streamsize count;
161 /* virtual inheritance
162 * basic_ios_char basic_ios;
164 } basic_istream_char;
166 typedef struct {
167 const int *vbtable;
168 streamsize count;
169 /* virtual inheritance
170 * basic_ios_wchar basic_ios;
172 } basic_istream_wchar;
174 typedef struct {
175 basic_istream_char base1;
176 basic_ostream_char base2;
177 /* virtual inheritance
178 * basic_ios_char basic_ios;
180 } basic_iostream_char;
182 typedef struct {
183 basic_istream_wchar base1;
184 basic_ostream_wchar base2;
185 /* virtual inheritance
186 * basic_ios_wchar basic_ios;
188 } basic_iostream_wchar;
190 typedef struct {
191 basic_ostream_char base;
192 basic_filebuf_char filebuf;
193 /* virtual inheritance
194 * basic_ios_char basic_ios;
196 } basic_ofstream_char;
198 typedef struct {
199 basic_ostream_wchar base;
200 basic_filebuf_wchar filebuf;
201 /* virtual inheritance
202 * basic_ios_wchar basic_ios;
204 } basic_ofstream_wchar;
206 typedef struct {
207 basic_istream_char base;
208 basic_filebuf_char filebuf;
209 /* virtual inheritance
210 * basic_ios_char basic_ios;
212 } basic_ifstream_char;
214 typedef struct {
215 basic_istream_wchar base;
216 basic_filebuf_wchar filebuf;
217 /* virtual inheritance
218 * basic_ios_wchar basic_ios;
220 } basic_ifstream_wchar;
222 typedef struct {
223 basic_iostream_char base;
224 basic_filebuf_char filebuf;
225 /* virtual inheritance
226 * basic_ios_char basic_ios;
228 } basic_fstream_char;
230 typedef struct {
231 basic_iostream_wchar base;
232 basic_filebuf_wchar filebuf;
233 /* virtual inheritance
234 * basic_ios_char basic_ios;
236 } basic_fstream_wchar;
238 typedef struct {
239 basic_ostream_char base;
240 basic_stringbuf_char strbuf;
241 /* virtual inheritance
242 * basic_ios_char basic_ios;
244 } basic_ostringstream_char;
246 typedef struct {
247 basic_ostream_wchar base;
248 basic_stringbuf_wchar strbuf;
249 /* virtual inheritance
250 * basic_ios_wchar basic_ios;
252 } basic_ostringstream_wchar;
254 typedef struct {
255 basic_istream_char base;
256 basic_stringbuf_char strbuf;
257 /* virtual inheritance
258 * basic_ios_char basic_ios;
260 } basic_istringstream_char;
262 typedef struct {
263 basic_istream_wchar base;
264 basic_stringbuf_wchar strbuf;
265 /* virtual inheritance
266 * basic_ios_wchar basic_ios;
268 } basic_istringstream_wchar;
270 typedef struct {
271 basic_iostream_char base;
272 basic_stringbuf_char strbuf;
273 /* virtual inheritance
274 * basic_ios_char basic_ios;
276 } basic_stringstream_char;
278 typedef struct {
279 basic_iostream_wchar base;
280 basic_stringbuf_wchar strbuf;
281 /* virtual inheritance
282 * basic_ios_wchar basic_ios;
284 } basic_stringstream_wchar;
286 typedef enum {
287 STRSTATE_Allocated = 1,
288 STRSTATE_Constant = 2,
289 STRSTATE_Dynamic = 4,
290 STRSTATE_Frozen = 8
291 } strstreambuf__Strstate;
293 typedef struct {
294 basic_streambuf_char base;
295 streamsize minsize;
296 char *endsave;
297 char *seekhigh;
298 int strmode;
299 void* (__cdecl *palloc)(MSVCP_size_t);
300 void (__cdecl *pfree)(void*);
301 } strstreambuf;
303 typedef struct {
304 basic_ostream_char base;
305 strstreambuf buf;
306 /* virtual inheritance
307 * basic_ios_char basic_ios;
309 } ostrstream;
311 typedef struct {
312 basic_istream_char base;
313 strstreambuf buf;
314 /* virtual inheritance
315 * basic_ios_char basic_ios;
317 } istrstream;
319 typedef struct {
320 basic_iostream_char base;
321 strstreambuf buf;
322 /* virtual inheritance
323 * basic_ios_char basic_ios;
325 } strstream;
327 struct space_info {
328 ULONGLONG capacity;
329 ULONGLONG free;
330 ULONGLONG available;
333 enum file_type {
334 status_unknown, file_not_found, regular_file, directory_file,
335 symlink_file, block_file, character_file, fifo_file, socket_file,
336 type_unknown
339 #if _MSVCP_VER >= 110
340 #define BASIC_IOS_VTORDISP 1
341 #define INIT_BASIC_IOS_VTORDISP(basic_ios) ((int*)basic_ios)[-1] = 0
342 #else
343 #define BASIC_IOS_VTORDISP 0
344 #define INIT_BASIC_IOS_VTORDISP(basic_ios)
345 #endif
347 #define VBTABLE_ENTRY(class, offset, vbase, vtordisp) ALIGNED_SIZE(sizeof(class)+vtordisp*sizeof(int), TYPE_ALIGNMENT(vbase))-offset
348 #define VBTABLE_BASIC_IOS_ENTRY(class, offset) VBTABLE_ENTRY(class, offset, basic_ios_char, BASIC_IOS_VTORDISP)
350 extern const vtable_ptr MSVCP_iosb_vtable;
352 /* ??_7ios_base@std@@6B@ */
353 extern const vtable_ptr MSVCP_ios_base_vtable;
355 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
356 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
358 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
359 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
361 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
362 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
364 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
365 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
367 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
368 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
370 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
371 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
373 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
374 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
376 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
377 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
379 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
380 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
382 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
383 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
385 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
386 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
388 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
389 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
391 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
392 const int basic_ostream_char_vbtable[] = {0,
393 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_char, 0)};
394 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
395 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
397 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
398 const int basic_ostream_wchar_vbtable[] = {0,
399 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)};
400 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
401 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
403 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
404 const int basic_ostream_short_vbtable[] = {0,
405 VBTABLE_BASIC_IOS_ENTRY(basic_ostream_wchar, 0)};
406 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
407 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
409 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
410 const int basic_istream_char_vbtable[] = {0,
411 VBTABLE_BASIC_IOS_ENTRY(basic_istream_char, 0)};
412 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
413 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
415 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
416 const int basic_istream_wchar_vbtable[] = {0,
417 VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)};
418 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
419 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
421 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
422 const int basic_istream_short_vbtable[] = {0,
423 VBTABLE_BASIC_IOS_ENTRY(basic_istream_wchar, 0)};
424 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
425 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
427 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
428 const int basic_iostream_char_vbtable1[] = {0,
429 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_char, 0)};
430 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
431 const int basic_iostream_char_vbtable2[] = {0,
432 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_char, FIELD_OFFSET(basic_iostream_char, base2))};
433 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
434 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
436 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
437 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
438 const int basic_iostream_wchar_vbtable1[] = {0,
439 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_wchar, 0)};
440 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
441 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
442 const int basic_iostream_wchar_vbtable2[] = {0,
443 VBTABLE_BASIC_IOS_ENTRY(basic_iostream_wchar, FIELD_OFFSET(basic_iostream_wchar, base2))};
444 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
445 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
446 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
447 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
449 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
450 const int basic_ofstream_char_vbtable[] = {0,
451 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_char, 0)};
452 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
453 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
455 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
456 const int basic_ofstream_wchar_vbtable[] = {0,
457 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_wchar, 0)};
458 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
459 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
461 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
462 const int basic_ofstream_short_vbtable[] = {0,
463 VBTABLE_BASIC_IOS_ENTRY(basic_ofstream_wchar, 0)};
464 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
465 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
467 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
468 const int basic_ifstream_char_vbtable[] = {0,
469 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_char, 0)};
470 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
471 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
473 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
474 const int basic_ifstream_wchar_vbtable[] = {0,
475 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_wchar, 0)};
476 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
477 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
479 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
480 const int basic_ifstream_short_vbtable[] = {0,
481 VBTABLE_BASIC_IOS_ENTRY(basic_ifstream_wchar, 0)};
482 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
483 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
485 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
486 const int basic_fstream_char_vbtable1[] = {0,
487 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_char, 0)};
488 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
489 const int basic_fstream_char_vbtable2[] = {0,
490 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_char, FIELD_OFFSET(basic_fstream_char, base.base2))};
491 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
492 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
494 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
495 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
496 const int basic_fstream_wchar_vbtable1[] = {0,
497 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_wchar, 0)};
498 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
499 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
500 const int basic_fstream_wchar_vbtable2[] = {0,
501 VBTABLE_BASIC_IOS_ENTRY(basic_fstream_wchar, FIELD_OFFSET(basic_fstream_wchar, base.base2))};
502 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
503 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
504 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
505 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
507 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
508 const int basic_ostringstream_char_vbtable[] = {0,
509 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_char, 0)};
510 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
511 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
513 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
514 const int basic_ostringstream_wchar_vbtable[] = {0,
515 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_wchar, 0)};
516 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
517 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
519 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
520 const int basic_ostringstream_short_vbtable[] = {0,
521 VBTABLE_BASIC_IOS_ENTRY(basic_ostringstream_wchar, 0)};
522 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
523 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
525 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
526 const int basic_istringstream_char_vbtable[] = {0,
527 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_char, 0)};
528 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
529 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
531 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
532 const int basic_istringstream_wchar_vbtable[] = {0,
533 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_wchar, 0)};
534 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
535 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
537 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
538 const int basic_istringstream_short_vbtable[] = {0,
539 VBTABLE_BASIC_IOS_ENTRY(basic_istringstream_wchar, 0)};
540 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
541 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
543 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
544 const int basic_stringstream_char_vbtable1[] = {0,
545 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_char, 0)};
546 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
547 const int basic_stringstream_char_vbtable2[] = {0,
548 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_char, FIELD_OFFSET(basic_stringstream_char, base.base2))};
549 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
550 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
552 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
553 const int basic_stringstream_wchar_vbtable1[] = {0,
554 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, 0)};
555 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
556 const int basic_stringstream_wchar_vbtable2[] = {0,
557 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, FIELD_OFFSET(basic_stringstream_wchar, base.base2))};
558 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
559 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
561 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
562 const int basic_stringstream_short_vbtable1[] = {0,
563 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, 0)};
564 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
565 const int basic_stringstream_short_vbtable2[] = {0,
566 VBTABLE_BASIC_IOS_ENTRY(basic_stringstream_wchar, FIELD_OFFSET(basic_stringstream_wchar, base.base2))};
567 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
568 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
570 /* ??_7strstreambuf@std@@6B */
571 extern const vtable_ptr MSVCP_strstreambuf_vtable;
573 static const int ostrstream_vbtable[] = {0, VBTABLE_BASIC_IOS_ENTRY(ostrstream, 0)};
574 extern const vtable_ptr MSVCP_ostrstream_vtable;
576 static const int istrstream_vbtable[] = {0, VBTABLE_BASIC_IOS_ENTRY(istrstream, 0)};
578 static const int strstream_vbtable1[] = {0, VBTABLE_BASIC_IOS_ENTRY(strstream, 0)};
579 static const int strstream_vbtable2[] = {0,
580 VBTABLE_BASIC_IOS_ENTRY(strstream, FIELD_OFFSET(strstream, base.base2))};
581 extern const vtable_ptr MSVCP_strstream_vtable;
583 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
584 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
585 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
586 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
587 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
588 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
589 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
590 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
591 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
592 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
593 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
594 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
595 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
596 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
597 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
598 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
599 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
600 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
601 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
602 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
603 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
604 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
605 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
606 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
607 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
608 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
609 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
610 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
611 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
612 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
613 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
614 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
615 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
616 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
617 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
618 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
619 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
620 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
621 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
622 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
623 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
624 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
625 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
626 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
627 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
628 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
629 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
630 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
631 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
632 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
633 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
634 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
635 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
636 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
637 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
638 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
639 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
640 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
641 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
642 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
643 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
644 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
645 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
646 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
647 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
648 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
649 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
650 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
651 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
652 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
653 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
654 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
655 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
656 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
657 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
658 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
659 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
660 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
661 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
662 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
663 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
664 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
665 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
666 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
667 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
668 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
669 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
670 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
671 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
672 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
673 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
674 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
675 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
676 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
677 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
678 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
679 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
680 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
681 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
682 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
683 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
684 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
685 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
686 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
687 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
688 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
689 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
690 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
691 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
692 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
693 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
694 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
695 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
696 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
697 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
698 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
699 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
700 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
701 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
702 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
703 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
704 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
705 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
706 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
707 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
708 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
709 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
710 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
711 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
712 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
713 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
714 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
715 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
716 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
717 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
718 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
719 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
720 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
721 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
722 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
723 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
724 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
725 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
726 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
727 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
728 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
729 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
730 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
731 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
732 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
733 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
734 "?AVostrstream@std@@")
735 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
736 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
737 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
738 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
739 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
740 "?AVstrstream@std@@")
742 #ifndef __GNUC__
743 void __asm_dummy_vtables(void) {
744 #endif
745 __ASM_VTABLE(iosb,
746 VTABLE_ADD_FUNC(iosb_vector_dtor));
747 __ASM_VTABLE(ios_base,
748 VTABLE_ADD_FUNC(ios_base_vector_dtor));
749 __ASM_VTABLE(basic_ios_char,
750 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor)
751 #if _MSVCP_VER >= 110
752 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
753 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
754 #endif
756 __ASM_VTABLE(basic_ios_wchar,
757 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor)
758 #if _MSVCP_VER >= 110
759 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
760 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
761 #endif
763 __ASM_VTABLE(basic_ios_short,
764 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor)
765 #if _MSVCP_VER >= 110
766 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
767 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
768 #endif
770 __ASM_VTABLE(basic_streambuf_char,
771 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
772 #if _MSVCP_VER >= 100
773 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
774 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
775 #endif
776 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
777 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
778 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
779 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
780 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
781 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
782 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
783 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
784 #endif
785 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
786 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
787 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
788 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
789 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
790 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
791 __ASM_VTABLE(basic_streambuf_wchar,
792 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
793 #if _MSVCP_VER >= 100
794 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
795 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
796 #endif
797 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
798 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
799 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
800 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
801 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
802 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
803 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
804 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
805 #endif
806 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
807 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
808 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
809 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
810 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
811 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
812 __ASM_VTABLE(basic_streambuf_short,
813 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
814 #if _MSVCP_VER >= 100
815 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
816 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
817 #endif
818 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
819 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
820 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
821 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
822 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
823 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
824 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
825 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
826 #endif
827 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
828 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
829 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
830 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
831 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
832 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
833 __ASM_VTABLE(basic_filebuf_char,
834 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
835 #if _MSVCP_VER >= 100
836 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
837 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
838 #endif
839 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
840 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
841 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
842 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
843 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
844 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
845 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
846 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
847 #endif
848 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
849 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
850 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
851 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
852 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
853 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
854 __ASM_VTABLE(basic_filebuf_wchar,
855 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
856 #if _MSVCP_VER >= 100
857 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
858 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
859 #endif
860 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
861 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
862 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
863 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
864 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
865 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
866 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
867 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
868 #endif
869 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
870 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
871 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
872 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
873 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
874 VTABLE_ADD_FUNC(basic_filebuf_wchar_imbue));
875 __ASM_VTABLE(basic_filebuf_short,
876 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
877 #if _MSVCP_VER >= 100
878 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
879 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
880 #endif
881 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
882 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
883 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
884 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
885 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
886 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
887 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
888 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
889 #endif
890 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
891 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
892 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
893 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
894 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
895 VTABLE_ADD_FUNC(basic_filebuf_short_imbue));
896 __ASM_VTABLE(basic_stringbuf_char,
897 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
898 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
899 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
900 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
901 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
902 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
903 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
904 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
905 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
906 #endif
907 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
908 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
909 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
910 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
911 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
912 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
913 __ASM_VTABLE(basic_stringbuf_wchar,
914 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
915 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
916 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
917 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
918 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
919 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
920 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
921 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
922 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
923 #endif
924 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
925 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
926 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
927 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
928 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
929 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
930 __ASM_VTABLE(basic_stringbuf_short,
931 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
932 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
933 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
934 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
935 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
936 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
937 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
938 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
939 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
940 #endif
941 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
942 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
943 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
944 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
945 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
946 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
947 __ASM_VTABLE(basic_ostream_char,
948 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor)
949 #if _MSVCP_VER >= 110
950 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
951 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
952 #endif
954 __ASM_VTABLE(basic_ostream_wchar,
955 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor)
956 #if _MSVCP_VER >= 110
957 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
958 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
959 #endif
961 __ASM_VTABLE(basic_ostream_short,
962 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor)
963 #if _MSVCP_VER >= 110
964 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
965 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
966 #endif
968 __ASM_VTABLE(basic_istream_char,
969 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor)
970 #if _MSVCP_VER >= 110
971 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
972 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
973 #endif
975 __ASM_VTABLE(basic_istream_wchar,
976 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor)
977 #if _MSVCP_VER >= 110
978 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
979 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
980 #endif
982 __ASM_VTABLE(basic_istream_short,
983 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor)
984 #if _MSVCP_VER >= 110
985 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
986 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
987 #endif
989 __ASM_VTABLE(basic_iostream_char,
990 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor)
991 #if _MSVCP_VER >= 110
992 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
993 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
994 #endif
996 __ASM_VTABLE(basic_iostream_wchar,
997 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor)
998 #if _MSVCP_VER >= 110
999 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1000 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1001 #endif
1003 __ASM_VTABLE(basic_iostream_short,
1004 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor)
1005 #if _MSVCP_VER >= 110
1006 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1007 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1008 #endif
1010 __ASM_VTABLE(basic_ofstream_char,
1011 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor)
1012 #if _MSVCP_VER >= 110
1013 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1014 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1015 #endif
1017 __ASM_VTABLE(basic_ofstream_wchar,
1018 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor)
1019 #if _MSVCP_VER >= 110
1020 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1021 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1022 #endif
1024 __ASM_VTABLE(basic_ofstream_short,
1025 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor)
1026 #if _MSVCP_VER >= 110
1027 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1028 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1029 #endif
1031 __ASM_VTABLE(basic_ifstream_char,
1032 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor)
1033 #if _MSVCP_VER >= 110
1034 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1035 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1036 #endif
1038 __ASM_VTABLE(basic_ifstream_wchar,
1039 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor)
1040 #if _MSVCP_VER >= 110
1041 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1042 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1043 #endif
1045 __ASM_VTABLE(basic_ifstream_short,
1046 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor)
1047 #if _MSVCP_VER >= 110
1048 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1049 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1050 #endif
1052 __ASM_VTABLE(basic_fstream_char,
1053 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor)
1054 #if _MSVCP_VER >= 110
1055 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1056 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1057 #endif
1059 __ASM_VTABLE(basic_fstream_wchar,
1060 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor)
1061 #if _MSVCP_VER >= 110
1062 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1063 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1064 #endif
1066 __ASM_VTABLE(basic_fstream_short,
1067 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor)
1068 #if _MSVCP_VER >= 110
1069 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1070 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1071 #endif
1073 __ASM_VTABLE(basic_ostringstream_char,
1074 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor)
1075 #if _MSVCP_VER >= 110
1076 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1077 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1078 #endif
1080 __ASM_VTABLE(basic_ostringstream_wchar,
1081 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor)
1082 #if _MSVCP_VER >= 110
1083 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1084 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1085 #endif
1087 __ASM_VTABLE(basic_ostringstream_short,
1088 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor)
1089 #if _MSVCP_VER >= 110
1090 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1091 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1092 #endif
1094 __ASM_VTABLE(basic_istringstream_char,
1095 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor)
1096 #if _MSVCP_VER >= 110
1097 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1098 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1099 #endif
1101 __ASM_VTABLE(basic_istringstream_wchar,
1102 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor)
1103 #if _MSVCP_VER >= 110
1104 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1105 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1106 #endif
1108 __ASM_VTABLE(basic_istringstream_short,
1109 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor)
1110 #if _MSVCP_VER >= 110
1111 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1112 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1113 #endif
1115 __ASM_VTABLE(basic_stringstream_char,
1116 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor)
1117 #if _MSVCP_VER >= 110
1118 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1119 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1120 #endif
1122 __ASM_VTABLE(basic_stringstream_wchar,
1123 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor)
1124 #if _MSVCP_VER >= 110
1125 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1126 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1127 #endif
1129 __ASM_VTABLE(basic_stringstream_short,
1130 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor)
1131 #if _MSVCP_VER >= 110
1132 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1133 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1134 #endif
1136 __ASM_VTABLE(strstreambuf,
1137 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
1138 VTABLE_ADD_FUNC(strstreambuf_overflow)
1139 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
1140 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
1141 VTABLE_ADD_FUNC(strstreambuf_underflow)
1142 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
1143 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
1144 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1145 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
1146 #endif
1147 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
1148 VTABLE_ADD_FUNC(strstreambuf_seekoff)
1149 VTABLE_ADD_FUNC(strstreambuf_seekpos)
1150 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
1151 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
1152 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
1153 __ASM_VTABLE(ostrstream,
1154 VTABLE_ADD_FUNC(ostrstream_vector_dtor)
1155 #if _MSVCP_VER >= 110
1156 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1157 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1158 #endif
1160 __ASM_VTABLE(strstream,
1161 VTABLE_ADD_FUNC(strstream_vector_dtor)
1162 #if _MSVCP_VER >= 110
1163 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp1)
1164 VTABLE_ADD_FUNC(basic_ios__Add_vtordisp2)
1165 #endif
1167 #ifndef __GNUC__
1169 #endif
1171 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1172 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1173 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
1174 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
1176 TRACE("(%p %p %p %p)\n", this, first, next, last);
1178 this->wbuf = first;
1179 this->wpos = next;
1180 this->wsize = last-next;
1183 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
1184 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
1185 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
1186 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
1188 basic_streambuf_char_setp_next(this, first, first, last);
1191 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1192 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1193 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
1194 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
1196 TRACE("(%p %p %p %p)\n", this, first, next, last);
1198 this->rbuf = first;
1199 this->rpos = next;
1200 this->rsize = last-next;
1203 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
1204 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
1205 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
1206 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
1208 TRACE("(%p)\n", this);
1210 this->prbuf = &this->rbuf;
1211 this->pwbuf = &this->wbuf;
1212 this->prpos = &this->rpos;
1213 this->pwpos = &this->wpos;
1214 this->prsize = &this->rsize;
1215 this->pwsize = &this->wsize;
1217 basic_streambuf_char_setp(this, NULL, NULL);
1218 basic_streambuf_char_setg(this, NULL, NULL, NULL);
1221 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1222 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1223 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
1224 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
1226 TRACE("(%p %d)\n", this, uninitialized);
1227 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1228 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1229 mutex_ctor(&this->lock);
1230 #endif
1231 return this;
1234 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
1235 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
1236 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
1237 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
1239 TRACE("(%p)\n", this);
1241 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1242 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1243 mutex_ctor(&this->lock);
1244 #endif
1245 #if _MSVCP_VER >= 70
1246 this->loc = MSVCRT_operator_new(sizeof(locale));
1247 #endif
1248 locale_ctor(IOS_LOCALE(this));
1249 basic_streambuf_char__Init_empty(this);
1251 return this;
1254 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
1255 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1256 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
1257 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
1259 TRACE("(%p)\n", this);
1261 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1262 mutex_dtor(&this->lock);
1263 #endif
1264 locale_dtor(IOS_LOCALE(this));
1265 #if _MSVCP_VER >= 70
1266 MSVCRT_operator_delete(this->loc);
1267 #endif
1270 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
1271 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
1273 TRACE("(%p %x)\n", this, flags);
1274 if(flags & 2) {
1275 /* we have an array, with the number of elements stored before the first object */
1276 INT_PTR i, *ptr = (INT_PTR *)this-1;
1278 for(i=*ptr-1; i>=0; i--)
1279 basic_streambuf_char_dtor(this+i);
1280 MSVCRT_operator_delete(ptr);
1281 } else {
1282 basic_streambuf_char_dtor(this);
1283 if(flags & 1)
1284 MSVCRT_operator_delete(this);
1287 return this;
1290 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1291 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1292 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
1293 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
1295 TRACE("(%p)\n", this);
1296 return *this->prpos ? *this->prsize : 0;
1299 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1300 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1301 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1302 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1304 TRACE("(%p)\n", this);
1305 (*this->prsize)++;
1306 (*this->prpos)--;
1307 return *this->prpos;
1310 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1311 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1312 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1313 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1315 TRACE("(%p)\n", this);
1316 (*this->prsize)--;
1317 return (*this->prpos)++;
1320 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1321 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1322 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1323 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1325 TRACE("(%p)\n", this);
1326 (*this->prsize)--;
1327 (*this->prpos)++;
1328 return *this->prpos;
1331 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1332 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1333 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1334 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1336 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1338 this->prbuf = gf;
1339 this->pwbuf = pf;
1340 this->prpos = gn;
1341 this->pwpos = pn;
1342 this->prsize = gc;
1343 this->pwsize = pc;
1346 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1347 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1348 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1349 #if _MSVCP_VER >= 100
1350 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1351 #else
1352 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1353 #endif
1354 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1356 TRACE("(%p)\n", this);
1357 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1358 mutex_lock(&this->lock);
1359 #endif
1362 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1363 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1364 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1365 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1367 TRACE("(%p)\n", this);
1368 return *this->pwpos ? *this->pwsize : 0;
1371 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1372 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1373 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1374 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1376 TRACE("(%p)\n", this);
1377 (*this->pwsize)--;
1378 return (*this->pwpos)++;
1381 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1382 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1383 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1384 #if _MSVCP_VER >= 100
1385 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1386 #else
1387 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1388 #endif
1389 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1391 TRACE("(%p)\n", this);
1392 return EOF;
1395 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1396 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1397 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1398 #if _MSVCP_VER >= 100
1399 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1400 #else
1401 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1402 #endif
1403 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1405 int ret;
1407 TRACE("(%p)\n", this);
1409 if(call_basic_streambuf_char_underflow(this)==EOF)
1410 return EOF;
1412 ret = (unsigned char)**this->prpos;
1413 (*this->prsize)--;
1414 (*this->prpos)++;
1415 return ret;
1418 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1419 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1420 #if STREAMSIZE_BITS == 64
1421 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1422 #else
1423 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1424 #endif
1425 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1426 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1427 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1428 #else
1429 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1430 #endif
1431 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1433 streamsize copied, chunk;
1434 int c;
1436 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1438 for(copied=0; copied<count && size;) {
1439 chunk = basic_streambuf_char__Gnavail(this);
1440 if(chunk > count-copied)
1441 chunk = count-copied;
1443 if(chunk > 0) {
1444 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1445 *this->prpos += chunk;
1446 *this->prsize -= chunk;
1447 copied += chunk;
1448 size -= chunk;
1449 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1450 ptr[copied] = c;
1451 copied++;
1452 size--;
1453 }else {
1454 break;
1458 return copied;
1461 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1462 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1463 #if STREAMSIZE_BITS == 64
1464 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1465 #else
1466 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1467 #endif
1468 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1470 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1471 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1474 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1475 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1476 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1477 #if _MSVCP_VER >= 100
1478 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1479 #else
1480 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1481 #endif
1482 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1484 TRACE("(%p)\n", this);
1485 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1486 mutex_unlock(&this->lock);
1487 #endif
1490 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1491 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1492 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1493 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1495 TRACE("(%p)\n", this);
1496 return *this->prbuf;
1499 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1500 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1501 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1502 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1504 TRACE("(%p)\n", this);
1505 return *this->prpos;
1508 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1509 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1510 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1511 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1513 TRACE("(%p)\n", this);
1514 return *this->prpos+*this->prsize;
1517 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1518 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1519 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1520 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1522 TRACE("(%p)\n", this);
1523 return *this->pwpos+*this->pwsize;
1526 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1527 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1528 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1529 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1531 TRACE("(%p %d)\n", this, off);
1532 *this->prpos += off;
1533 *this->prsize -= off;
1536 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@XZ */
1537 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1538 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@XZ */
1539 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1540 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1541 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
1543 TRACE("(%p)\n", this);
1544 return locale_copy_ctor(ret, IOS_LOCALE(this));
1547 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1548 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1549 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1550 #if _MSVCP_VER >= 100
1551 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_char*, const locale*), (this, loc))
1552 #elif _MSVCP_VER >= 80
1553 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_char*, const locale*), (this, loc))
1554 #else
1555 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_char*, const locale*), (this, loc))
1556 #endif
1557 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1559 TRACE("(%p %p)\n", this, loc);
1562 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1563 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1564 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1565 #if _MSVCP_VER >= 100
1566 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 12, int, (basic_streambuf_char*, int), (this, ch))
1567 #else
1568 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, int, (basic_streambuf_char*, int), (this, ch))
1569 #endif
1570 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1572 TRACE("(%p %d)\n", this, ch);
1573 return EOF;
1576 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1577 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1578 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1579 #if _MSVCP_VER >= 100
1580 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*, int), (this, ch))
1581 #else
1582 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, int, (basic_streambuf_char*, int), (this, ch))
1583 #endif
1584 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1586 TRACE("(%p %d)\n", this, ch);
1587 return EOF;
1590 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1591 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1592 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1593 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1595 TRACE("(%p)\n", this);
1596 return *this->pwbuf;
1599 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1600 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1601 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1602 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1604 TRACE("(%p %d)\n", this, off);
1605 *this->pwpos += off;
1606 *this->pwsize -= off;
1609 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1610 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1611 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1612 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1614 TRACE("(%p)\n", this);
1615 return *this->pwpos;
1618 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1619 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1620 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1621 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1623 TRACE("(%p %p)\n", this, loc);
1624 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
1625 call_basic_streambuf_char_imbue(this, loc);
1626 locale_copy_ctor(IOS_LOCALE(this), loc);
1627 return ret;
1630 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1631 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1632 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1633 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1634 #if STREAMOFF_BITS == 64
1635 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1636 #else
1637 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1638 #endif
1639 #if _MSVCP_VER >= 100
1640 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1641 #elif _MSVCP_VER >= 80
1642 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1643 #else
1644 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1645 #endif
1646 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1647 fpos_int *ret, streamoff off, int way, int mode)
1649 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1650 ret->off = -1;
1651 ret->pos = 0;
1652 ret->state = 0;
1653 return ret;
1656 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1657 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1658 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
1659 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
1660 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1661 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1662 #if STREAMOFF_BITS == 64
1663 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1664 #else
1665 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1666 #endif
1667 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1668 fpos_int *ret, streamoff off, int way, int mode)
1670 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1671 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1674 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1675 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1676 #if STREAMOFF_BITS == 64
1677 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 24)
1678 #else
1679 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1680 #endif
1681 fpos_int* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1682 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
1684 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1685 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1688 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1689 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1690 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1691 #if _MSVCP_VER >= 100
1692 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 44, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1693 #elif _MSVCP_VER >= 80
1694 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1695 #else
1696 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1697 #endif
1698 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1699 fpos_int *ret, fpos_int pos, int mode)
1701 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1702 ret->off = -1;
1703 ret->pos = 0;
1704 ret->state = 0;
1705 return ret;
1708 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1709 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1710 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1711 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1712 fpos_int *ret, fpos_int pos, int mode)
1714 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1715 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1718 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1719 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1720 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1721 fpos_int* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1722 fpos_int *ret, fpos_int pos, unsigned int mode)
1724 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1725 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1728 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1729 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1730 #if STREAMSIZE_BITS == 64
1731 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1732 #else
1733 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1734 #endif
1735 #if _MSVCP_VER >= 100
1736 #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))
1737 #elif _MSVCP_VER >= 80
1738 #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))
1739 #else
1740 #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))
1741 #endif
1742 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1744 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1745 return this;
1748 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1749 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1750 #if STREAMSIZE_BITS == 64
1751 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1752 #else
1753 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1754 #endif
1755 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1757 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1758 return call_basic_streambuf_char_setbuf(this, buf, count);
1761 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1762 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1763 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1764 #if _MSVCP_VER >= 100
1765 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1766 #elif _MSVCP_VER >= 80
1767 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1768 #else
1769 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1770 #endif
1771 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1773 TRACE("(%p)\n", this);
1774 return 0;
1777 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1778 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1779 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1780 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1782 TRACE("(%p)\n", this);
1783 return call_basic_streambuf_char_sync(this);
1786 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1787 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1788 #if STREAMSIZE_BITS == 64
1789 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1790 #else
1791 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1792 #endif
1793 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1795 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1796 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1799 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1800 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1801 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1802 #if _MSVCP_VER >= 100
1803 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1804 #else
1805 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1806 #endif
1807 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1809 TRACE("(%p)\n", this);
1810 return 0;
1813 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1814 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1815 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1816 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1818 streamsize ret;
1820 TRACE("(%p)\n", this);
1822 ret = basic_streambuf_char__Gnavail(this);
1823 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1826 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1827 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1828 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1829 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1831 TRACE("(%p %d)\n", this, ch);
1832 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1833 (*this->prsize)++;
1834 (*this->prpos)--;
1835 return (unsigned char)ch;
1838 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1841 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1842 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1843 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1844 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1846 TRACE("(%p %d)\n", this, ch);
1847 return basic_streambuf_char__Pnavail(this) ?
1848 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1849 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1852 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1853 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1854 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1855 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1857 TRACE("(%p)\n", this);
1858 if(*this->prpos && *this->prpos>*this->prbuf) {
1859 (*this->prsize)++;
1860 (*this->prpos)--;
1861 return (unsigned char)**this->prpos;
1864 return call_basic_streambuf_char_pbackfail(this, EOF);
1867 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1868 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1869 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1870 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1872 TRACE("(%p)\n", this);
1873 if(basic_streambuf_char__Gnavail(this))
1874 basic_streambuf_char__Gninc(this);
1875 else
1876 call_basic_streambuf_char_uflow(this);
1879 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1880 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1881 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1882 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1884 TRACE("(%p)\n", this);
1885 return basic_streambuf_char__Gnavail(this) ?
1886 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1889 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1890 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1891 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1892 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1894 TRACE("(%p)\n", this);
1895 return basic_streambuf_char__Gnavail(this) ?
1896 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1899 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1900 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1901 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1902 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1904 TRACE("(%p)\n", this);
1906 if(basic_streambuf_char__Gnavail(this) > 1)
1907 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1908 return basic_streambuf_char_sbumpc(this)==EOF ?
1909 EOF : basic_streambuf_char_sgetc(this);
1912 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1913 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1914 #if STREAMSIZE_BITS == 64
1915 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1916 #else
1917 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1918 #endif
1919 #if _MSVCP_VER >= 100
1920 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1921 #else
1922 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1923 #endif
1924 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1926 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1927 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1930 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1931 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1932 #if STREAMSIZE_BITS == 64
1933 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1934 #else
1935 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1936 #endif
1937 #if _MSVCP_VER >= 100
1938 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1939 #elif _MSVCP_VER >= 80
1940 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1941 #else
1942 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1943 #endif
1944 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1946 streamsize copied, chunk;
1948 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1950 for(copied=0; copied<count;) {
1951 chunk = basic_streambuf_char__Pnavail(this);
1952 if(chunk > count-copied)
1953 chunk = count-copied;
1955 if(chunk > 0) {
1956 memcpy(*this->pwpos, ptr+copied, chunk);
1957 *this->pwpos += chunk;
1958 *this->pwsize -= chunk;
1959 copied += chunk;
1960 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1961 copied++;
1962 }else {
1963 break;
1967 return copied;
1970 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1971 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1972 #if STREAMSIZE_BITS == 64
1973 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
1974 #else
1975 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1976 #endif
1977 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1979 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1980 return call_basic_streambuf_char_xsputn(this, ptr, count);
1983 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
1984 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
1985 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8)
1986 void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r)
1988 basic_streambuf_char tmp;
1990 TRACE("(%p %p)\n", this, r);
1992 if(this == r)
1993 return;
1995 tmp = *this;
1996 *this = *r;
1997 this->vtable = tmp.vtable;
1998 tmp.vtable = r->vtable;
1999 *r = tmp;
2002 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
2003 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
2004 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
2005 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
2006 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
2007 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
2009 TRACE("(%p %p %p %p)\n", this, first, next, last);
2011 this->wbuf = first;
2012 this->wpos = next;
2013 this->wsize = last-next;
2016 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
2017 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
2018 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
2019 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
2020 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
2021 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
2023 basic_streambuf_wchar_setp_next(this, first, first, last);
2026 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
2027 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
2028 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
2029 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
2030 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
2031 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
2033 TRACE("(%p %p %p %p)\n", this, first, next, last);
2035 this->rbuf = first;
2036 this->rpos = next;
2037 this->rsize = last-next;
2040 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
2041 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
2042 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
2043 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
2044 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
2045 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
2047 TRACE("(%p)\n", this);
2049 this->prbuf = &this->rbuf;
2050 this->pwbuf = &this->wbuf;
2051 this->prpos = &this->rpos;
2052 this->pwpos = &this->wpos;
2053 this->prsize = &this->rsize;
2054 this->pwsize = &this->wsize;
2056 basic_streambuf_wchar_setp(this, NULL, NULL);
2057 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
2060 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
2061 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
2062 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
2063 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
2065 TRACE("(%p %d)\n", this, uninitialized);
2066 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
2067 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2068 mutex_ctor(&this->lock);
2069 #endif
2070 return this;
2073 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
2074 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
2075 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
2076 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
2078 TRACE("(%p %d)\n", this, uninitialized);
2079 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
2080 this->vtable = &MSVCP_basic_streambuf_short_vtable;
2081 return this;
2084 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
2085 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
2086 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
2087 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
2089 TRACE("(%p)\n", this);
2091 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
2092 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2093 mutex_ctor(&this->lock);
2094 #endif
2095 #if _MSVCP_VER >= 70
2096 this->loc = MSVCRT_operator_new(sizeof(locale));
2097 #endif
2098 locale_ctor(IOS_LOCALE(this));
2099 basic_streambuf_wchar__Init_empty(this);
2101 return this;
2104 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
2105 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
2106 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
2107 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
2109 TRACE("(%p)\n", this);
2110 basic_streambuf_wchar_ctor(this);
2111 this->vtable = &MSVCP_basic_streambuf_short_vtable;
2112 return this;
2115 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
2116 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
2117 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
2118 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
2119 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
2120 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
2122 TRACE("(%p)\n", this);
2124 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2125 mutex_dtor(&this->lock);
2126 #endif
2127 locale_dtor(IOS_LOCALE(this));
2128 #if _MSVCP_VER >= 70
2129 MSVCRT_operator_delete(this->loc);
2130 #endif
2133 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
2134 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
2136 TRACE("(%p %x)\n", this, flags);
2137 if(flags & 2) {
2138 /* we have an array, with the number of elements stored before the first object */
2139 INT_PTR i, *ptr = (INT_PTR *)this-1;
2141 for(i=*ptr-1; i>=0; i--)
2142 basic_streambuf_wchar_dtor(this+i);
2143 MSVCRT_operator_delete(ptr);
2144 } else {
2145 basic_streambuf_wchar_dtor(this);
2146 if(flags & 1)
2147 MSVCRT_operator_delete(this);
2150 return this;
2153 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2154 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2155 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2156 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2157 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
2158 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
2160 TRACE("(%p)\n", this);
2161 return *this->prpos ? *this->prsize : 0;
2164 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2165 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2166 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2167 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2168 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
2169 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
2171 TRACE("(%p)\n", this);
2172 (*this->prsize)++;
2173 (*this->prpos)--;
2174 return *this->prpos;
2177 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2178 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2179 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2180 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2181 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
2182 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
2184 TRACE("(%p)\n", this);
2185 (*this->prsize)--;
2186 return (*this->prpos)++;
2189 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2190 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2191 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2192 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2193 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
2194 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
2196 TRACE("(%p)\n", this);
2197 (*this->prsize)--;
2198 (*this->prpos)++;
2199 return *this->prpos;
2202 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
2203 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
2204 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
2205 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
2206 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
2207 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)
2209 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
2211 this->prbuf = gf;
2212 this->pwbuf = pf;
2213 this->prpos = gn;
2214 this->pwpos = pn;
2215 this->prsize = gc;
2216 this->pwsize = pc;
2219 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2220 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2221 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2222 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2223 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
2224 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
2226 TRACE("(%p)\n", this);
2227 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2228 mutex_lock(&this->lock);
2229 #endif
2232 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2233 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2234 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2235 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2236 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
2237 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
2239 TRACE("(%p)\n", this);
2240 return *this->pwpos ? *this->pwsize : 0;
2243 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2244 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2245 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2246 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2247 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
2248 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
2250 TRACE("(%p)\n", this);
2251 (*this->pwsize)--;
2252 return (*this->pwpos)++;
2255 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2256 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2257 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2258 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2259 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
2260 #if _MSVCP_VER >= 100
2261 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
2262 #else
2263 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
2264 #endif
2265 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
2267 TRACE("(%p)\n", this);
2268 return WEOF;
2271 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2272 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2273 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2274 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2275 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
2276 #if _MSVCP_VER >= 100
2277 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
2278 #else
2279 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
2280 #endif
2281 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
2283 int ret;
2285 TRACE("(%p)\n", this);
2287 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
2288 return WEOF;
2290 ret = **this->prpos;
2291 (*this->prsize)--;
2292 (*this->prpos)++;
2293 return ret;
2296 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
2297 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
2298 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
2299 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
2300 #if STREAMSIZE_BITS == 64
2301 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
2302 #else
2303 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
2304 #endif
2305 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2306 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
2307 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
2308 #else
2309 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
2310 #endif
2311 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2313 streamsize copied, chunk;
2314 unsigned short c;
2316 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2318 for(copied=0; copied<count && size;) {
2319 chunk = basic_streambuf_wchar__Gnavail(this);
2320 if(chunk > count-copied)
2321 chunk = count-copied;
2323 if(chunk > 0) {
2324 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
2325 *this->prpos += chunk;
2326 *this->prsize -= chunk;
2327 copied += chunk;
2328 size -= chunk*sizeof(wchar_t);
2329 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
2330 ptr[copied] = c;
2331 copied++;
2332 size--;
2333 }else {
2334 break;
2338 return copied;
2341 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
2342 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
2343 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
2344 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
2345 #if STREAMSIZE_BITS == 64
2346 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
2347 #else
2348 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
2349 #endif
2350 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2352 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2353 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
2356 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2357 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2358 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2359 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2360 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
2361 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
2363 TRACE("(%p)\n", this);
2364 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2365 mutex_unlock(&this->lock);
2366 #endif
2369 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2370 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2371 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2372 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2373 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2374 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2376 TRACE("(%p)\n", this);
2377 return *this->prbuf;
2380 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2381 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2382 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2383 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2384 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2385 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2387 TRACE("(%p)\n", this);
2388 return *this->prpos;
2391 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2392 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2393 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2394 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2395 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2396 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2398 TRACE("(%p)\n", this);
2399 return *this->prpos+*this->prsize;
2402 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2403 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2404 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2405 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2406 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2407 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2409 TRACE("(%p)\n", this);
2410 return *this->pwpos+*this->pwsize;
2413 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2414 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2415 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2416 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2417 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2418 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2420 TRACE("(%p %d)\n", this, off);
2421 *this->prpos += off;
2422 *this->prsize -= off;
2425 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
2426 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
2427 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
2428 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
2429 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
2430 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
2432 TRACE("(%p)\n", this);
2433 return locale_copy_ctor(ret, IOS_LOCALE(this));
2436 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2437 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2438 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2439 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2440 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2441 #if _MSVCP_VER >= 100
2442 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2443 #elif _MSVCP_VER >= 80
2444 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2445 #else
2446 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2447 #endif
2448 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2450 TRACE("(%p %p)\n", this, loc);
2453 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2454 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2455 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2456 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2457 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2458 #if _MSVCP_VER >= 100
2459 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2460 #else
2461 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2462 #endif
2463 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2465 TRACE("(%p %d)\n", this, ch);
2466 return WEOF;
2469 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2470 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2471 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2472 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2473 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2474 #if _MSVCP_VER >= 100
2475 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2476 #else
2477 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2478 #endif
2479 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2481 TRACE("(%p %d)\n", this, ch);
2482 return WEOF;
2485 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2486 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2487 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2488 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2489 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2490 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2492 TRACE("(%p)\n", this);
2493 return *this->pwbuf;
2496 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2497 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2498 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2499 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2500 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2501 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2503 TRACE("(%p %d)\n", this, off);
2504 *this->pwpos += off;
2505 *this->pwsize -= off;
2508 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2509 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2510 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2511 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2512 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2513 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2515 TRACE("(%p)\n", this);
2516 return *this->pwpos;
2519 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2520 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2521 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2522 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2523 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2524 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2526 TRACE("(%p %p)\n", this, loc);
2527 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
2528 call_basic_streambuf_wchar_imbue(this, loc);
2529 locale_copy_ctor(IOS_LOCALE(this), loc);
2530 return ret;
2533 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2534 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
2535 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2536 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2537 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2538 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2539 #if STREAMOFF_BITS == 64
2540 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2541 #else
2542 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2543 #endif
2544 #if _MSVCP_VER >= 100
2545 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2546 #elif _MSVCP_VER >= 80
2547 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2548 #else
2549 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 32, fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2550 #endif
2551 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2552 fpos_int *ret, streamoff off, int way, int mode)
2554 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2555 ret->off = -1;
2556 ret->pos = 0;
2557 ret->state = 0;
2558 return ret;
2561 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2562 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2563 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2564 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2565 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
2566 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
2567 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2568 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ioos_base@2@H@Z */
2569 #if STREAMOFF_BITS == 64
2570 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2571 #else
2572 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2573 #endif
2574 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2575 fpos_int *ret, streamoff off, int way, int mode)
2577 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2578 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2581 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2582 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2583 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2584 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2585 #if STREAMOFF_BITS == 64
2586 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 24)
2587 #else
2588 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2589 #endif
2590 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2591 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
2593 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2594 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2597 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2598 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2599 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2600 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2601 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2602 #if _MSVCP_VER >= 100
2603 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 44, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2604 #elif _MSVCP_VER >= 80
2605 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2606 #else
2607 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 36, fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
2608 #endif
2609 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2610 fpos_int *ret, fpos_int pos, int mode)
2612 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2613 ret->off = -1;
2614 ret->pos = 0;
2615 ret->state = 0;
2616 return ret;
2619 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2620 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2621 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2622 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2623 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2624 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2625 fpos_int *ret, fpos_int pos, int mode)
2627 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2628 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2631 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2632 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2633 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2634 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2635 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2636 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2637 fpos_int *ret, fpos_int pos, unsigned int mode)
2639 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2640 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2643 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2644 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2645 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2646 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2647 #if STREAMSIZE_BITS == 64
2648 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2649 #else
2650 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2651 #endif
2652 #if _MSVCP_VER >= 100
2653 #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))
2654 #elif _MSVCP_VER >= 80
2655 #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))
2656 #else
2657 #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))
2658 #endif
2659 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2661 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2662 return this;
2665 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2666 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2667 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2668 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2669 #if STREAMSIZE_BITS == 64
2670 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2671 #else
2672 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2673 #endif
2674 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2676 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2677 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2680 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2681 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2682 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2683 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2684 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2685 #if _MSVCP_VER >= 100
2686 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2687 #elif _MSVCP_VER >= 80
2688 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2689 #else
2690 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2691 #endif
2692 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2694 TRACE("(%p)\n", this);
2695 return 0;
2698 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2699 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2700 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2701 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2702 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2703 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2705 TRACE("(%p)\n", this);
2706 return call_basic_streambuf_wchar_sync(this);
2709 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2710 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2711 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2712 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2713 #if STREAMSIZE_BITS == 64
2714 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2715 #else
2716 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2717 #endif
2718 #if _MSVCP_VER >= 100
2719 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2720 #else
2721 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2722 #endif
2723 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2725 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2726 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2729 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2730 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2731 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2732 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2733 #if STREAMSIZE_BITS == 64
2734 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2735 #else
2736 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2737 #endif
2738 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2740 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2741 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2744 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2745 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2746 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2747 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2748 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2749 #if _MSVCP_VER >= 100
2750 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2751 #else
2752 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2753 #endif
2754 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2756 TRACE("(%p)\n", this);
2757 return 0;
2760 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2761 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2762 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2763 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2764 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2765 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2767 streamsize ret;
2769 TRACE("(%p)\n", this);
2771 ret = basic_streambuf_wchar__Gnavail(this);
2772 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2775 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2776 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2777 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2778 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2779 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2780 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2782 TRACE("(%p %d)\n", this, ch);
2783 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2784 (*this->prsize)++;
2785 (*this->prpos)--;
2786 return ch;
2789 return call_basic_streambuf_wchar_pbackfail(this, ch);
2792 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2793 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2794 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2795 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2796 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2797 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2799 TRACE("(%p %d)\n", this, ch);
2800 return basic_streambuf_wchar__Pnavail(this) ?
2801 (*basic_streambuf_wchar__Pninc(this) = ch) :
2802 call_basic_streambuf_wchar_overflow(this, ch);
2805 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2806 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2807 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2808 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2809 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2810 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2812 TRACE("(%p)\n", this);
2813 if(*this->prpos && *this->prpos>*this->prbuf) {
2814 (*this->prsize)++;
2815 (*this->prpos)--;
2816 return **this->prpos;
2819 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2822 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2823 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2824 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2825 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2826 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2827 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2829 TRACE("(%p)\n", this);
2830 if(basic_streambuf_wchar__Gnavail(this))
2831 basic_streambuf_wchar__Gninc(this);
2832 else
2833 call_basic_streambuf_wchar_uflow(this);
2836 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2837 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2838 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2839 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2840 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2841 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2843 TRACE("(%p)\n", this);
2844 return basic_streambuf_wchar__Gnavail(this) ?
2845 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2848 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2849 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2850 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2851 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2852 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2853 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2855 TRACE("(%p)\n", this);
2856 return basic_streambuf_wchar__Gnavail(this) ?
2857 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2860 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2861 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2862 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2863 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2864 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2865 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2867 TRACE("(%p)\n", this);
2869 if(basic_streambuf_wchar__Gnavail(this) > 1)
2870 return *basic_streambuf_wchar__Gnpreinc(this);
2871 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2872 WEOF : basic_streambuf_wchar_sgetc(this);
2875 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2876 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2877 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2878 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2879 #if STREAMSIZE_BITS == 64
2880 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2881 #else
2882 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2883 #endif
2884 #if _MSVCP_VER >= 100
2885 #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))
2886 #elif _MSVCP_VER >= 80
2887 #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))
2888 #else
2889 #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))
2890 #endif
2891 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2893 streamsize copied, chunk;
2895 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2897 for(copied=0; copied<count;) {
2898 chunk = basic_streambuf_wchar__Pnavail(this);
2899 if(chunk > count-copied)
2900 chunk = count-copied;
2902 if(chunk > 0) {
2903 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2904 *this->pwpos += chunk;
2905 *this->pwsize -= chunk;
2906 copied += chunk;
2907 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2908 copied++;
2909 }else {
2910 break;
2914 return copied;
2917 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2918 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2919 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2920 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2921 #if STREAMSIZE_BITS == 64
2922 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2923 #else
2924 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2925 #endif
2926 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2928 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2929 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2932 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
2933 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
2934 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2935 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2936 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8)
2937 void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r)
2939 basic_streambuf_wchar tmp;
2941 TRACE("(%p %p)\n", this, r);
2943 if(this == r)
2944 return;
2946 tmp = *this;
2947 *this = *r;
2948 this->vtable = tmp.vtable;
2949 tmp.vtable = r->vtable;
2950 *r = tmp;
2953 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2954 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2955 int basic_filebuf_char__Init__Stinit = 0;
2957 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2958 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2959 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2960 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2962 TRACE("(%p %p %d)\n", this, file, which);
2964 this->cvt = NULL;
2965 this->wrotesome = FALSE;
2966 this->state = basic_filebuf_char__Init__Stinit;
2967 this->close = (which == INITFL_open);
2968 this->file = file;
2970 basic_streambuf_char__Init_empty(&this->base);
2971 if(file)
2972 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2973 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2976 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
2977 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
2978 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt_cvt, 8)
2979 void __thiscall basic_filebuf_char__Initcvt_cvt(basic_filebuf_char *this, codecvt_char *cvt)
2981 TRACE("(%p %p)\n", this, cvt);
2983 if(codecvt_base_always_noconv(&cvt->base)) {
2984 this->cvt = NULL;
2985 }else {
2986 basic_streambuf_char__Init_empty(&this->base);
2987 this->cvt = cvt;
2991 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
2992 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
2993 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 4)
2994 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this)
2996 codecvt_char *cvt = codecvt_char_use_facet(IOS_LOCALE(&this->base));
2997 basic_filebuf_char__Initcvt_cvt( this, cvt );
3000 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
3001 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
3002 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Endwrite, 4)
3003 MSVCP_bool __thiscall basic_filebuf_char__Endwrite(basic_filebuf_char *this)
3005 TRACE("(%p)\n", this);
3007 if(!this->wrotesome || !this->cvt)
3008 return TRUE;
3011 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3012 return FALSE;
3014 while(1) {
3015 /* TODO: check if we need a dynamic buffer here */
3016 char buf[128];
3017 char *next;
3018 int ret;
3020 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3021 switch(ret) {
3022 case CODECVT_ok:
3023 this->wrotesome = FALSE;
3024 /* fall through */
3025 case CODECVT_partial:
3026 if(!fwrite(buf, next-buf, 1, this->file))
3027 return FALSE;
3028 if(this->wrotesome)
3029 break;
3030 /* fall through */
3031 case CODECVT_noconv:
3032 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3033 return FALSE;
3034 return TRUE;
3035 default:
3036 return FALSE;
3041 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
3042 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
3043 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
3044 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
3046 basic_filebuf_char *ret = this;
3048 TRACE("(%p)\n", this);
3050 if(!this->file)
3051 return NULL;
3053 /* TODO: handle exceptions */
3054 if(!basic_filebuf_char__Endwrite(this))
3055 ret = NULL;
3056 if(fclose(this->file))
3057 ret = NULL;
3059 basic_filebuf_char__Init(this, NULL, INITFL_close);
3060 return ret;
3063 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
3064 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3065 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
3066 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
3068 TRACE("(%p %p)\n", this, file);
3070 basic_streambuf_char_ctor(&this->base);
3071 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
3073 basic_filebuf_char__Init(this, file, INITFL_new);
3074 return this;
3077 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
3078 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
3079 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
3080 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
3082 return basic_filebuf_char_ctor_file(this, NULL);
3085 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3086 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3087 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
3088 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
3090 TRACE("(%p %d)\n", this, uninitialized);
3092 basic_streambuf_char_ctor(&this->base);
3093 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
3094 return this;
3097 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
3098 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
3099 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
3100 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
3102 TRACE("(%p)\n", this);
3104 if(this->close)
3105 basic_filebuf_char_close(this);
3106 basic_streambuf_char_dtor(&this->base);
3109 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
3110 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
3112 TRACE("(%p %x)\n", this, flags);
3113 if(flags & 2) {
3114 /* we have an array, with the number of elements stored before the first object */
3115 INT_PTR i, *ptr = (INT_PTR *)this-1;
3117 for(i=*ptr-1; i>=0; i--)
3118 basic_filebuf_char_dtor(this+i);
3119 MSVCRT_operator_delete(ptr);
3120 } else {
3121 basic_filebuf_char_dtor(this);
3122 if(flags & 1)
3123 MSVCRT_operator_delete(this);
3126 return this;
3129 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
3130 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
3131 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
3132 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
3134 TRACE("(%p)\n", this);
3135 return this->file != NULL;
3138 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
3139 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
3140 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
3142 static const wchar_t rW[] = {'r',0};
3143 static const struct {
3144 int mode;
3145 const wchar_t str[4];
3146 const wchar_t str_bin[4];
3147 } str_mode[] = {
3148 {OPENMODE_out, {'w',0}, {'w','b',0}},
3149 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
3150 {OPENMODE_app, {'a',0}, {'a','b',0}},
3151 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
3152 {OPENMODE_in, {'r',0}, {'r','b',0}},
3153 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
3154 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
3155 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
3156 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
3159 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
3160 size_t mode_idx;
3161 FILE *f = NULL;
3163 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
3165 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
3166 if(str_mode[mode_idx].mode == real_mode)
3167 break;
3168 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
3169 return NULL;
3171 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
3172 return NULL;
3173 else if(f)
3174 fclose(f);
3176 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
3177 && (f = _wfopen(name, rW))) {
3178 fclose(f);
3179 return NULL;
3182 #if _MSVCP_VER < 80 /* msvcp60 - msvcp71 are ignoring prot argument */
3183 prot = SH_DENYNO;
3184 #endif
3186 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
3187 : str_mode[mode_idx].str, prot);
3188 if(!f)
3189 return NULL;
3191 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
3192 fclose(f);
3193 return NULL;
3196 return f;
3199 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
3200 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
3201 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
3203 wchar_t nameW[FILENAME_MAX];
3205 TRACE("(%s %d %d)\n", name, mode, prot);
3207 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3208 return NULL;
3209 return _Fiopen_wchar(nameW, mode, prot);
3212 /* ?__Fiopen@std@@YAPAU_iobuf@@PBDH@Z */
3213 /* ?__Fiopen@std@@YAPEAU_iobuf@@PEBDH@Z */
3214 FILE* __cdecl ___Fiopen(const char *name, int mode)
3216 TRACE("(%p %d)\n", name, mode);
3217 return _Fiopen(name, mode, _SH_DENYNO);
3220 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
3221 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3222 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
3223 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3224 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
3225 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
3227 FILE *f = NULL;
3229 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3231 if(basic_filebuf_char_is_open(this))
3232 return NULL;
3234 if(!(f = _Fiopen_wchar(name, mode, prot)))
3235 return NULL;
3237 basic_filebuf_char__Init(this, f, INITFL_open);
3238 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(IOS_LOCALE(&this->base)));
3239 return this;
3242 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
3243 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3244 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
3245 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
3246 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
3247 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
3249 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
3252 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
3253 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3254 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
3255 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
3257 wchar_t nameW[FILENAME_MAX];
3259 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3261 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3262 return NULL;
3263 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
3266 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDF@Z */
3267 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDF@Z */
3268 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
3269 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
3271 TRACE("(%p %p %d)\n", this, name, mode);
3272 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3275 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDH@Z */
3276 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDH@Z */
3277 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
3278 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
3279 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
3280 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
3282 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3285 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3286 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3287 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
3288 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
3290 char buf[8], *dyn_buf;
3291 char ch = c, *to_next;
3292 const char *from_next;
3293 int ret, max_size;
3296 TRACE("(%p %d)\n", this, c);
3298 if(!basic_filebuf_char_is_open(this))
3299 return EOF;
3300 if(c == EOF)
3301 return !c;
3303 if(!this->cvt)
3304 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3306 from_next = &ch;
3307 do {
3308 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3309 &from_next, buf, buf+sizeof(buf), &to_next);
3311 switch(ret) {
3312 case CODECVT_partial:
3313 if(to_next == buf)
3314 break;
3315 /* fall through */
3316 case CODECVT_ok:
3317 if(!fwrite(buf, to_next-buf, 1, this->file))
3318 return EOF;
3319 if(ret == CODECVT_partial)
3320 continue;
3321 return c;
3322 case CODECVT_noconv:
3323 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3324 default:
3325 return EOF;
3328 break;
3329 } while(1);
3331 max_size = codecvt_base_max_length(&this->cvt->base);
3332 dyn_buf = malloc(max_size);
3333 if(!dyn_buf)
3334 return EOF;
3336 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3337 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3339 switch(ret) {
3340 case CODECVT_ok:
3341 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3342 free(dyn_buf);
3343 return ret ? c : EOF;
3344 case CODECVT_partial:
3345 ERR("buffer should be big enough to store all output\n");
3346 /* fall through */
3347 default:
3348 free(dyn_buf);
3349 return EOF;
3353 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3354 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3355 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
3356 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
3358 TRACE("(%p %d)\n", this, c);
3360 if(!basic_filebuf_char_is_open(this))
3361 return EOF;
3363 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
3364 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
3365 basic_streambuf_char__Gndec(&this->base);
3366 return c==EOF ? !c : c;
3367 }else if(c!=EOF && !this->cvt) {
3368 return ungetc(c, this->file);
3371 return EOF;
3374 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3375 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3376 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
3377 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
3379 char ch, buf[128], *to_next;
3380 const char *buf_next;
3381 int c, j;
3382 size_t i;
3384 TRACE("(%p)\n", this);
3386 if(!basic_filebuf_char_is_open(this))
3387 return EOF;
3389 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3390 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
3392 c = fgetc(this->file);
3393 if(!this->cvt || c==EOF)
3394 return c;
3396 buf_next = buf;
3397 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3398 buf[i] = c;
3400 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
3401 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3402 case CODECVT_partial:
3403 case CODECVT_ok:
3404 if(to_next == &ch) {
3405 c = fgetc(this->file);
3406 if(c == EOF)
3407 return EOF;
3408 continue;
3411 for(j = --i; j >= buf_next-buf; j--)
3412 ungetc(buf[j], this->file);
3413 return ch;
3414 case CODECVT_noconv:
3415 return (unsigned char)buf[0];
3416 default:
3417 return EOF;
3421 FIXME("buffer is too small\n");
3422 return EOF;
3425 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3426 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3427 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
3428 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
3430 int ret;
3432 TRACE("(%p)\n", this);
3434 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3435 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
3437 ret = call_basic_streambuf_char_uflow(&this->base);
3438 if(ret != EOF)
3439 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
3440 return ret;
3443 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3444 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3445 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3446 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3447 #if STREAMOFF_BITS == 64
3448 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
3449 #else
3450 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
3451 #endif
3452 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
3453 fpos_int *ret, streamoff off, int way, int mode)
3455 fpos_t pos;
3457 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3459 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3460 || fseek(this->file, off, way)) {
3461 ret->off = -1;
3462 ret->pos = 0;
3463 ret->state = 0;
3464 return ret;
3467 fgetpos(this->file, &pos);
3468 ret->off = 0;
3469 ret->pos = pos;
3470 ret->state = this->state;
3471 return ret;
3474 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3475 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3476 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
3477 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
3478 fpos_int *ret, fpos_int pos, int mode)
3480 fpos_t fpos;
3482 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3484 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3485 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3486 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3487 ret->off = -1;
3488 ret->pos = 0;
3489 ret->state = 0;
3490 return ret;
3493 fgetpos(this->file, &fpos);
3494 ret->off = 0;
3495 ret->pos = fpos;
3496 ret->state = this->state;
3497 return ret;
3500 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
3501 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
3502 #if STREAMSIZE_BITS == 64
3503 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
3504 #else
3505 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
3506 #endif
3507 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
3509 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3511 if(!basic_filebuf_char_is_open(this))
3512 return NULL;
3514 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3515 return NULL;
3517 basic_filebuf_char__Init(this, this->file, INITFL_open);
3518 return &this->base;
3521 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3522 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3523 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3524 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3526 TRACE("(%p)\n", this);
3528 if(!basic_filebuf_char_is_open(this))
3529 return 0;
3531 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3532 return 0;
3533 return fflush(this->file);
3536 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
3537 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
3538 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
3539 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
3541 TRACE("(%p %p)\n", this, loc);
3542 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(loc));
3545 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3546 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3547 int basic_filebuf_wchar__Init__Stinit = 0;
3549 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3550 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3551 int basic_filebuf_short__Init__Stinit = 0;
3553 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3554 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3555 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3556 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3558 TRACE("(%p %p %d)\n", this, file, which);
3560 this->cvt = NULL;
3561 this->wrotesome = FALSE;
3562 this->state = basic_filebuf_wchar__Init__Stinit;
3563 this->close = (which == INITFL_open);
3564 this->file = file;
3566 basic_streambuf_wchar__Init_empty(&this->base);
3569 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3570 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3571 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3572 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3574 TRACE("(%p %p %d)\n", this, file, which);
3576 this->cvt = NULL;
3577 this->wrotesome = FALSE;
3578 this->state = basic_filebuf_short__Init__Stinit;
3579 this->close = (which == INITFL_open);
3580 this->file = file;
3582 basic_streambuf_wchar__Init_empty(&this->base);
3585 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
3586 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
3587 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
3588 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
3589 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt_cvt, 8)
3590 void __thiscall basic_filebuf_wchar__Initcvt_cvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
3592 TRACE("(%p %p)\n", this, cvt);
3594 if(codecvt_base_always_noconv(&cvt->base)) {
3595 this->cvt = NULL;
3596 }else {
3597 basic_streambuf_wchar__Init_empty(&this->base);
3598 this->cvt = cvt;
3602 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
3603 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
3604 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 4)
3605 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this)
3607 codecvt_wchar *cvt = codecvt_wchar_use_facet(IOS_LOCALE(&this->base));
3608 basic_filebuf_wchar__Initcvt_cvt( this, cvt );
3611 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAE_NXZ */
3612 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAA_NXZ */
3613 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAE_NXZ */
3614 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAA_NXZ */
3615 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Endwrite, 4)
3616 MSVCP_bool __thiscall basic_filebuf_wchar__Endwrite(basic_filebuf_wchar *this)
3618 TRACE("(%p)\n", this);
3620 if(!this->wrotesome || !this->cvt)
3621 return TRUE;
3623 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3624 return FALSE;
3626 while(1) {
3627 /* TODO: check if we need a dynamic buffer here */
3628 char buf[128];
3629 char *next;
3630 int ret;
3632 ret = codecvt_wchar_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3633 switch(ret) {
3634 case CODECVT_ok:
3635 this->wrotesome = FALSE;
3636 /* fall through */
3637 case CODECVT_partial:
3638 if(!fwrite(buf, next-buf, 1, this->file))
3639 return FALSE;
3640 if(this->wrotesome)
3641 break;
3642 /* fall through */
3643 case CODECVT_noconv:
3644 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3645 return FALSE;
3646 return TRUE;
3647 default:
3648 return FALSE;
3653 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3654 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3655 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3656 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3657 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3658 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3660 basic_filebuf_wchar *ret = this;
3662 TRACE("(%p)\n", this);
3664 if(!this->file)
3665 return NULL;
3667 /* TODO: handle exceptions */
3668 if(!basic_filebuf_wchar__Endwrite(this))
3669 ret = NULL;
3670 if(fclose(this->file))
3671 ret = NULL;
3673 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3674 return ret;
3677 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3678 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3679 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3680 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3682 TRACE("(%p %p)\n", this, file);
3684 basic_streambuf_wchar_ctor(&this->base);
3685 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3687 basic_filebuf_wchar__Init(this, file, INITFL_new);
3688 return this;
3691 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3692 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3693 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3694 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3696 TRACE("(%p %p)\n", this, file);
3698 basic_streambuf_short_ctor(&this->base);
3699 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3701 basic_filebuf_short__Init(this, file, INITFL_new);
3702 return this;
3705 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3706 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3707 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3708 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3710 return basic_filebuf_wchar_ctor_file(this, NULL);
3713 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3714 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3715 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3716 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3718 return basic_filebuf_short_ctor_file(this, NULL);
3721 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3722 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3723 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3724 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3726 TRACE("(%p %d)\n", this, uninitialized);
3728 basic_streambuf_wchar_ctor(&this->base);
3729 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3730 return this;
3733 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3734 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3735 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3736 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3738 TRACE("(%p %d)\n", this, uninitialized);
3740 basic_streambuf_short_ctor(&this->base);
3741 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3742 return this;
3745 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3746 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3747 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3748 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3749 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3750 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3752 TRACE("(%p)\n", this);
3754 if(this->close)
3755 basic_filebuf_wchar_close(this);
3756 basic_streambuf_wchar_dtor(&this->base);
3759 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3760 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3762 TRACE("(%p %x)\n", this, flags);
3763 if(flags & 2) {
3764 /* we have an array, with the number of elements stored before the first object */
3765 INT_PTR i, *ptr = (INT_PTR *)this-1;
3767 for(i=*ptr-1; i>=0; i--)
3768 basic_filebuf_wchar_dtor(this+i);
3769 MSVCRT_operator_delete(ptr);
3770 } else {
3771 basic_filebuf_wchar_dtor(this);
3772 if(flags & 1)
3773 MSVCRT_operator_delete(this);
3776 return this;
3779 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3780 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3781 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3782 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3783 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3784 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3786 TRACE("(%p)\n", this);
3787 return this->file != NULL;
3790 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3791 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3792 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3793 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3794 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3795 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3797 FILE *f = NULL;
3799 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3801 if(basic_filebuf_wchar_is_open(this))
3802 return NULL;
3804 if(!(f = _Fiopen_wchar(name, mode, prot)))
3805 return NULL;
3807 basic_filebuf_wchar__Init(this, f, INITFL_open);
3808 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(IOS_LOCALE(&this->base)));
3809 return this;
3812 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3813 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3814 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3815 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3816 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3817 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3819 FILE *f = NULL;
3821 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3823 if(basic_filebuf_wchar_is_open(this))
3824 return NULL;
3826 if(!(f = _Fiopen_wchar(name, mode, prot)))
3827 return NULL;
3829 basic_filebuf_short__Init(this, f, INITFL_open);
3830 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(IOS_LOCALE(&this->base)));
3831 return this;
3834 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3835 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3836 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3837 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3838 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3839 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3841 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3844 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3845 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3846 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3847 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3848 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3849 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3851 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3854 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3855 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3856 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3857 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3859 wchar_t nameW[FILENAME_MAX];
3861 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3863 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3864 return NULL;
3865 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3868 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3869 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3870 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3871 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3873 wchar_t nameW[FILENAME_MAX];
3875 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3877 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3878 return NULL;
3879 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3882 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
3883 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
3884 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
3885 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
3887 TRACE("(%p %p %d)\n", this, name, mode);
3888 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3891 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
3892 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
3893 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3894 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3895 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3896 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3898 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3901 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3902 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3903 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3904 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3906 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3909 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3910 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3911 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3912 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3913 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3914 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3916 char buf[8], *dyn_buf, *to_next;
3917 wchar_t ch = c;
3918 const wchar_t *from_next;
3919 int max_size;
3920 unsigned short ret;
3923 TRACE("(%p %d)\n", this, c);
3925 if(!basic_filebuf_wchar_is_open(this))
3926 return WEOF;
3927 if(c == WEOF)
3928 return !c;
3930 if(!this->cvt)
3931 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3933 from_next = &ch;
3934 do {
3935 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3936 &from_next, buf, buf+sizeof(buf), &to_next);
3938 switch(ret) {
3939 case CODECVT_partial:
3940 if(to_next == buf)
3941 break;
3942 /* fall through */
3943 case CODECVT_ok:
3944 if(!fwrite(buf, to_next-buf, 1, this->file))
3945 return WEOF;
3946 if(ret == CODECVT_partial)
3947 continue;
3948 return c;
3949 case CODECVT_noconv:
3950 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3951 default:
3952 return WEOF;
3955 break;
3956 } while(1);
3958 max_size = codecvt_base_max_length(&this->cvt->base);
3959 dyn_buf = malloc(max_size);
3960 if(!dyn_buf)
3961 return WEOF;
3963 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3964 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3966 switch(ret) {
3967 case CODECVT_ok:
3968 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3969 free(dyn_buf);
3970 return ret ? c : WEOF;
3971 case CODECVT_partial:
3972 ERR("buffer should be big enough to store all output\n");
3973 /* fall through */
3974 default:
3975 free(dyn_buf);
3976 return WEOF;
3980 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3981 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3982 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3983 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3984 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3985 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3987 TRACE("(%p %d)\n", this, c);
3989 if(!basic_filebuf_wchar_is_open(this))
3990 return WEOF;
3992 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3993 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3994 basic_streambuf_wchar__Gndec(&this->base);
3995 return c==WEOF ? !c : c;
3996 }else if(c!=WEOF && !this->cvt) {
3997 return ungetwc(c, this->file);
3998 }else if(c!=WEOF && basic_streambuf_wchar_gptr(&this->base)!=&this->putback) {
3999 this->putback = c;
4000 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback, &this->putback+1);
4001 return c;
4004 return WEOF;
4007 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
4008 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
4009 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
4010 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
4011 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
4012 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
4014 wchar_t ch, *to_next;
4015 char buf[128];
4016 const char *buf_next;
4017 int c, j;
4018 size_t i;
4020 TRACE("(%p)\n", this);
4022 if(!basic_filebuf_wchar_is_open(this))
4023 return WEOF;
4025 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
4026 return *basic_streambuf_wchar__Gninc(&this->base);
4028 if(!this->cvt)
4029 return fgetwc(this->file);
4031 buf_next = buf;
4032 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
4033 if((c = fgetc(this->file)) == EOF)
4034 return WEOF;
4035 buf[i] = c;
4037 switch(codecvt_wchar_in(this->cvt, &this->state, buf_next,
4038 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
4039 case CODECVT_partial:
4040 case CODECVT_ok:
4041 if(to_next == &ch)
4042 continue;
4044 for(j = --i; j >= buf_next-buf; j--)
4045 ungetc(buf[j], this->file);
4046 return ch;
4047 case CODECVT_noconv:
4048 if(i+1 < sizeof(wchar_t))
4049 continue;
4051 memcpy(&ch, buf, sizeof(wchar_t));
4052 return ch;
4053 default:
4054 return WEOF;
4058 FIXME("buffer is too small\n");
4059 return WEOF;
4062 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
4063 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
4064 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
4065 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
4066 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
4067 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
4069 unsigned short ret;
4071 TRACE("(%p)\n", this);
4073 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
4074 return *basic_streambuf_wchar_gptr(&this->base);
4076 ret = call_basic_streambuf_wchar_uflow(&this->base);
4077 if(ret != WEOF)
4078 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
4079 return ret;
4082 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4083 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4084 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4085 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4086 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4087 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4088 #if STREAMOFF_BITS == 64
4089 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
4090 #else
4091 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
4092 #endif
4093 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
4094 fpos_int *ret, streamoff off, int way, int mode)
4096 fpos_t pos;
4098 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4100 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback) {
4101 if(way == SEEKDIR_cur)
4102 off -= sizeof(wchar_t);
4104 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
4107 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
4108 || fseek(this->file, off, way)) {
4109 ret->off = -1;
4110 ret->pos = 0;
4111 ret->state = 0;
4112 return ret;
4115 fgetpos(this->file, &pos);
4116 ret->off = 0;
4117 ret->pos = pos;
4118 ret->state = this->state;
4119 return ret;
4122 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4123 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4124 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4125 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4126 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
4127 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
4128 fpos_int *ret, fpos_int pos, int mode)
4130 fpos_t fpos;
4132 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4134 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
4135 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
4136 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
4137 ret->off = -1;
4138 ret->pos = 0;
4139 ret->state = 0;
4140 return ret;
4143 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback)
4144 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
4146 fgetpos(this->file, &fpos);
4147 ret->off = 0;
4148 ret->pos = fpos;
4149 ret->state = this->state;
4150 return ret;
4153 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
4154 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
4155 #if STREAMSIZE_BITS == 64
4156 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
4157 #else
4158 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
4159 #endif
4160 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
4162 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
4164 if(!basic_filebuf_wchar_is_open(this))
4165 return NULL;
4167 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
4168 return NULL;
4170 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
4171 return &this->base;
4174 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
4175 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
4176 #if STREAMSIZE_BITS == 64
4177 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
4178 #else
4179 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
4180 #endif
4181 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
4183 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
4185 if(!basic_filebuf_wchar_is_open(this))
4186 return NULL;
4188 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
4189 return NULL;
4191 basic_filebuf_short__Init(this, this->file, INITFL_open);
4192 return &this->base;
4195 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
4196 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
4197 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
4198 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
4199 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
4200 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
4202 TRACE("(%p)\n", this);
4204 if(!basic_filebuf_wchar_is_open(this))
4205 return 0;
4207 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
4208 return 0;
4209 return fflush(this->file);
4212 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
4213 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
4214 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
4215 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
4217 TRACE("(%p %p)\n", this, loc);
4218 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(loc));
4221 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
4222 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
4223 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
4224 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
4226 TRACE("(%p %p)\n", this, loc);
4227 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(loc));
4230 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
4231 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
4232 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
4233 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
4234 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
4235 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
4237 int state = 0;
4239 if(!(mode & OPENMODE_in))
4240 state |= STRINGBUF_no_read;
4242 if(!(mode & OPENMODE_out))
4243 state |= STRINGBUF_no_write;
4245 if(mode & OPENMODE_ate)
4246 state |= STRINGBUF_at_end;
4248 if(mode & OPENMODE_app)
4249 state |= STRINGBUF_append;
4251 return state;
4254 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
4255 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
4256 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
4257 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
4259 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
4261 basic_streambuf_char__Init_empty(&this->base);
4263 this->state = state;
4264 this->seekhigh = NULL;
4266 if(count && str) {
4267 char *buf = MSVCRT_operator_new(count);
4268 if(!buf) {
4269 ERR("Out of memory\n");
4270 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4273 memcpy(buf, str, count);
4274 this->seekhigh = buf + count;
4276 this->state |= STRINGBUF_allocated;
4278 if(!(state & STRINGBUF_no_read))
4279 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
4281 if(!(state & STRINGBUF_no_write)) {
4282 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4284 if(!basic_streambuf_char_gptr(&this->base))
4285 basic_streambuf_char_setg(&this->base, buf, 0, buf);
4290 /* ??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 */
4291 /* ??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 */
4292 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
4293 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
4294 const basic_string_char *str, IOSB_openmode mode)
4296 TRACE("(%p %p %d)\n", this, str, mode);
4298 basic_streambuf_char_ctor(&this->base);
4299 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4301 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
4302 str->size, basic_stringbuf_char__Getstate(this, mode));
4303 return this;
4306 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
4307 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
4308 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
4309 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
4310 basic_stringbuf_char *this, IOSB_openmode mode)
4312 TRACE("(%p %d)\n", this, mode);
4314 basic_streambuf_char_ctor(&this->base);
4315 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
4317 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
4318 return this;
4321 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
4322 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
4323 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
4324 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
4326 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4329 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
4330 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
4331 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
4332 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
4334 TRACE("(%p)\n", this);
4336 if(this->state & STRINGBUF_allocated) {
4337 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
4338 this->seekhigh = NULL;
4339 this->state &= ~STRINGBUF_allocated;
4342 basic_streambuf_char__Init_empty(&this->base);
4345 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
4346 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
4347 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
4348 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
4350 TRACE("(%p)\n", this);
4352 basic_stringbuf_char__Tidy(this);
4353 basic_streambuf_char_dtor(&this->base);
4356 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
4357 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
4359 TRACE("(%p %x)\n", this, flags);
4361 if(flags & 2) {
4362 /* we have an array, with the number of elements stored before the first object */
4363 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4365 for (i = *ptr - 1; i >= 0; i--)
4366 basic_stringbuf_char_dtor(this+i);
4368 MSVCRT_operator_delete(ptr);
4369 }else {
4370 basic_stringbuf_char_dtor(this);
4372 if(flags & 1)
4373 MSVCRT_operator_delete(this);
4376 return this;
4379 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4380 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4381 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
4382 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
4384 MSVCP_size_t oldsize, size;
4385 char *ptr, *buf;
4387 TRACE("(%p %x)\n", this, meta);
4389 if(meta == EOF)
4390 return !EOF;
4391 if(this->state & STRINGBUF_no_write)
4392 return EOF;
4394 ptr = basic_streambuf_char_pptr(&this->base);
4395 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4396 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
4397 this->seekhigh, basic_streambuf_char_epptr(&this->base));
4399 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
4400 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4402 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
4403 size = oldsize|0xf;
4404 size += size/2;
4405 buf = MSVCRT_operator_new(size);
4406 if(!buf) {
4407 ERR("Out of memory\n");
4408 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4411 if(!oldsize) {
4412 this->seekhigh = buf;
4413 basic_streambuf_char_setp(&this->base, buf, buf+size);
4414 if(this->state & STRINGBUF_no_read)
4415 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4416 else
4417 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
4419 this->state |= STRINGBUF_allocated;
4420 }else {
4421 ptr = basic_streambuf_char_eback(&this->base);
4422 memcpy(buf, ptr, oldsize);
4424 this->seekhigh = buf+(this->seekhigh-ptr);
4425 basic_streambuf_char_setp_next(&this->base, buf,
4426 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
4427 if(this->state & STRINGBUF_no_read)
4428 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4429 else
4430 basic_streambuf_char_setg(&this->base, buf,
4431 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
4432 basic_streambuf_char_pptr(&this->base)+1);
4434 MSVCRT_operator_delete(ptr);
4437 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4440 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4441 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4442 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
4443 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
4445 char *cur;
4447 TRACE("(%p %x)\n", this, c);
4449 cur = basic_streambuf_char_gptr(&this->base);
4450 if(!cur || cur==basic_streambuf_char_eback(&this->base)
4451 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4452 return EOF;
4454 if(c != EOF)
4455 cur[-1] = c;
4456 basic_streambuf_char_gbump(&this->base, -1);
4457 return c==EOF ? !EOF : c;
4460 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
4461 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
4462 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
4463 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
4465 char *ptr, *cur;
4467 TRACE("(%p)\n", this);
4469 cur = basic_streambuf_char_gptr(&this->base);
4470 if(!cur || this->state&STRINGBUF_no_read)
4471 return EOF;
4473 ptr = basic_streambuf_char_pptr(&this->base);
4474 if(this->seekhigh < ptr)
4475 this->seekhigh = ptr;
4477 ptr = basic_streambuf_char_egptr(&this->base);
4478 if(this->seekhigh > ptr)
4479 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
4481 if(cur < this->seekhigh)
4482 return (unsigned char)*cur;
4483 return EOF;
4486 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4487 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4488 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4489 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4490 #if STREAMOFF_BITS == 64
4491 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
4492 #else
4493 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
4494 #endif
4495 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
4496 fpos_int *ret, streamoff off, int way, int mode)
4498 char *beg, *cur_r, *cur_w;
4500 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4502 cur_w = basic_streambuf_char_pptr(&this->base);
4503 if(cur_w > this->seekhigh)
4504 this->seekhigh = cur_w;
4506 ret->off = 0;
4507 ret->pos = 0;
4508 ret->state = 0;
4510 beg = basic_streambuf_char_eback(&this->base);
4511 cur_r = basic_streambuf_char_gptr(&this->base);
4512 if((mode & OPENMODE_in) && cur_r) {
4513 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4514 off += cur_r-beg;
4515 else if(way == SEEKDIR_end)
4516 off += this->seekhigh-beg;
4517 else if(way != SEEKDIR_beg)
4518 off = -1;
4520 if(off<0 || off>this->seekhigh-beg) {
4521 off = -1;
4522 }else {
4523 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
4524 if((mode & OPENMODE_out) && cur_w) {
4525 basic_streambuf_char_setp_next(&this->base, beg,
4526 basic_streambuf_char_gptr(&this->base),
4527 basic_streambuf_char_epptr(&this->base));
4530 }else if((mode & OPENMODE_out) && cur_w) {
4531 if(way == SEEKDIR_cur)
4532 off += cur_w-beg;
4533 else if(way == SEEKDIR_end)
4534 off += this->seekhigh-beg;
4535 else if(way != SEEKDIR_beg)
4536 off = -1;
4538 if(off<0 || off>this->seekhigh-beg)
4539 off = -1;
4540 else
4541 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
4542 }else {
4543 off = -1;
4546 ret->off = off;
4547 return ret;
4550 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4551 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4552 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
4553 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
4554 fpos_int *ret, fpos_int pos, int mode)
4556 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4558 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4559 *ret = pos;
4560 return ret;
4563 return basic_stringbuf_char_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4566 /* ?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 */
4567 /* ?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 */
4568 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
4569 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
4571 TRACE("(%p %p)\n", this, str);
4573 basic_stringbuf_char__Tidy(this);
4574 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
4577 /* ?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 */
4578 /* ?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 */
4579 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
4580 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
4582 char *ptr;
4584 TRACE("(%p)\n", this);
4586 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
4587 char *pptr;
4589 ptr = basic_streambuf_char_pbase(&this->base);
4590 pptr = basic_streambuf_char_pptr(&this->base);
4592 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4595 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
4596 ptr = basic_streambuf_char_eback(&this->base);
4597 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
4600 return MSVCP_basic_string_char_ctor(ret);
4603 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
4604 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
4605 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4606 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4607 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4608 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4609 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
4610 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
4612 int state = 0;
4614 if(!(mode & OPENMODE_in))
4615 state |= STRINGBUF_no_read;
4617 if(!(mode & OPENMODE_out))
4618 state |= STRINGBUF_no_write;
4620 if(mode & OPENMODE_ate)
4621 state |= STRINGBUF_at_end;
4623 if(mode & OPENMODE_app)
4624 state |= STRINGBUF_append;
4626 return state;
4629 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
4630 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
4631 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
4632 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
4633 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
4634 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
4636 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
4638 basic_streambuf_wchar__Init_empty(&this->base);
4640 this->state = state;
4641 this->seekhigh = NULL;
4643 if(count && str) {
4644 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
4645 if(!buf) {
4646 ERR("Out of memory\n");
4647 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4650 memcpy(buf, str, count*sizeof(wchar_t));
4651 this->seekhigh = buf + count;
4653 this->state |= STRINGBUF_allocated;
4655 if(!(state & STRINGBUF_no_read))
4656 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
4658 if(!(state & STRINGBUF_no_write)) {
4659 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4661 if(!basic_streambuf_wchar_gptr(&this->base))
4662 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
4667 /* ??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 */
4668 /* ??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 */
4669 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
4670 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
4671 const basic_string_wchar *str, IOSB_openmode mode)
4673 TRACE("(%p %p %d)\n", this, str, mode);
4675 basic_streambuf_wchar_ctor(&this->base);
4676 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4678 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
4679 str->size, basic_stringbuf_wchar__Getstate(this, mode));
4680 return this;
4683 /* ??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 */
4684 /* ??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 */
4685 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
4686 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
4687 const basic_string_wchar *str, IOSB_openmode mode)
4689 basic_stringbuf_wchar_ctor_str(this, str, mode);
4690 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4691 return this;
4694 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4695 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4696 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4697 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4698 basic_stringbuf_wchar *this, IOSB_openmode mode)
4700 TRACE("(%p %d)\n", this, mode);
4702 basic_streambuf_wchar_ctor(&this->base);
4703 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4705 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4706 return this;
4709 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4710 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4711 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4712 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4713 basic_stringbuf_wchar *this, IOSB_openmode mode)
4715 basic_stringbuf_wchar_ctor_mode(this, mode);
4716 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4717 return this;
4720 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4721 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4722 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4723 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4725 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4728 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4729 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4730 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4731 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4733 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4736 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4737 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4738 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4739 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4740 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4741 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4743 TRACE("(%p)\n", this);
4745 if(this->state & STRINGBUF_allocated) {
4746 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4747 this->seekhigh = NULL;
4748 this->state &= ~STRINGBUF_allocated;
4751 basic_streambuf_wchar__Init_empty(&this->base);
4754 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4755 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4756 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4757 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4758 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4759 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4761 TRACE("(%p)\n", this);
4763 basic_stringbuf_wchar__Tidy(this);
4764 basic_streambuf_wchar_dtor(&this->base);
4767 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4768 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4770 TRACE("(%p %x)\n", this, flags);
4772 if(flags & 2) {
4773 /* we have an array, with the number of elements stored before the first object */
4774 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4776 for (i = *ptr - 1; i >= 0; i--)
4777 basic_stringbuf_wchar_dtor(this+i);
4779 MSVCRT_operator_delete(ptr);
4780 }else {
4781 basic_stringbuf_wchar_dtor(this);
4783 if(flags & 1)
4784 MSVCRT_operator_delete(this);
4787 return this;
4790 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4791 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4792 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4793 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4794 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4795 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4797 MSVCP_size_t oldsize, size;
4798 wchar_t *ptr, *buf;
4800 TRACE("(%p %x)\n", this, meta);
4802 if(meta == WEOF)
4803 return !WEOF;
4804 if(this->state & STRINGBUF_no_write)
4805 return WEOF;
4807 ptr = basic_streambuf_wchar_pptr(&this->base);
4808 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4809 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4810 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4812 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4813 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4815 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4816 size = oldsize|0xf;
4817 size += size/2;
4818 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4819 if(!buf) {
4820 ERR("Out of memory\n");
4821 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4824 if(!oldsize) {
4825 this->seekhigh = buf;
4826 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4827 if(this->state & STRINGBUF_no_read)
4828 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4829 else
4830 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4832 this->state |= STRINGBUF_allocated;
4833 }else {
4834 ptr = basic_streambuf_wchar_eback(&this->base);
4835 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4837 this->seekhigh = buf+(this->seekhigh-ptr);
4838 basic_streambuf_wchar_setp_next(&this->base, buf,
4839 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4840 if(this->state & STRINGBUF_no_read)
4841 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4842 else
4843 basic_streambuf_wchar_setg(&this->base, buf,
4844 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4845 basic_streambuf_wchar_pptr(&this->base)+1);
4847 MSVCRT_operator_delete(ptr);
4850 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4853 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4854 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4855 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4856 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4857 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4858 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4860 wchar_t *cur;
4862 TRACE("(%p %x)\n", this, c);
4864 cur = basic_streambuf_wchar_gptr(&this->base);
4865 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4866 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4867 return WEOF;
4869 if(c != WEOF)
4870 cur[-1] = c;
4871 basic_streambuf_wchar_gbump(&this->base, -1);
4872 return c==WEOF ? !WEOF : c;
4875 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4876 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4877 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4878 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4879 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4880 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4882 wchar_t *ptr, *cur;
4884 TRACE("(%p)\n", this);
4886 cur = basic_streambuf_wchar_gptr(&this->base);
4887 if(!cur || this->state&STRINGBUF_no_read)
4888 return WEOF;
4890 ptr = basic_streambuf_wchar_pptr(&this->base);
4891 if(this->seekhigh < ptr)
4892 this->seekhigh = ptr;
4894 ptr = basic_streambuf_wchar_egptr(&this->base);
4895 if(this->seekhigh > ptr)
4896 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4898 if(cur < this->seekhigh)
4899 return *cur;
4900 return WEOF;
4903 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4904 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4905 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4906 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4907 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4908 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4909 #if STREAMOFF_BITS == 64
4910 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4911 #else
4912 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4913 #endif
4914 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4915 fpos_int *ret, streamoff off, int way, int mode)
4917 wchar_t *beg, *cur_r, *cur_w;
4919 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4921 cur_w = basic_streambuf_wchar_pptr(&this->base);
4922 if(cur_w > this->seekhigh)
4923 this->seekhigh = cur_w;
4925 ret->off = 0;
4926 ret->pos = 0;
4927 ret->state = 0;
4929 beg = basic_streambuf_wchar_eback(&this->base);
4930 cur_r = basic_streambuf_wchar_gptr(&this->base);
4931 if((mode & OPENMODE_in) && cur_r) {
4932 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4933 off += cur_r-beg;
4934 else if(way == SEEKDIR_end)
4935 off += this->seekhigh-beg;
4936 else if(way != SEEKDIR_beg)
4937 off = -1;
4939 if(off<0 || off>this->seekhigh-beg) {
4940 off = -1;
4941 }else {
4942 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4943 if((mode & OPENMODE_out) && cur_w) {
4944 basic_streambuf_wchar_setp_next(&this->base, beg,
4945 basic_streambuf_wchar_gptr(&this->base),
4946 basic_streambuf_wchar_epptr(&this->base));
4949 }else if((mode & OPENMODE_out) && cur_w) {
4950 if(way == SEEKDIR_cur)
4951 off += cur_w-beg;
4952 else if(way == SEEKDIR_end)
4953 off += this->seekhigh-beg;
4954 else if(way != SEEKDIR_beg)
4955 off = -1;
4957 if(off<0 || off>this->seekhigh-beg)
4958 off = -1;
4959 else
4960 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4961 }else {
4962 off = -1;
4965 ret->off = off;
4966 return ret;
4969 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4970 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4971 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4972 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4973 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4974 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4975 fpos_int *ret, fpos_int pos, int mode)
4977 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4979 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4980 *ret = pos;
4981 return ret;
4984 return basic_stringbuf_wchar_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4987 /* ?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 */
4988 /* ?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 */
4989 /* ?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 */
4990 /* ?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 */
4991 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4992 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4994 TRACE("(%p %p)\n", this, str);
4996 basic_stringbuf_wchar__Tidy(this);
4997 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
5000 /* ?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 */
5001 /* ?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 */
5002 /* ?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 */
5003 /* ?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 */
5004 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
5005 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
5007 wchar_t *ptr;
5009 TRACE("(%p)\n", this);
5011 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
5012 wchar_t *pptr;
5014 ptr = basic_streambuf_wchar_pbase(&this->base);
5015 pptr = basic_streambuf_wchar_pptr(&this->base);
5017 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
5020 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
5021 ptr = basic_streambuf_wchar_eback(&this->base);
5022 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
5025 return MSVCP_basic_string_wchar_ctor(ret);
5028 /* ??0ios_base@std@@IAE@XZ */
5029 /* ??0ios_base@std@@IEAA@XZ */
5030 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
5031 ios_base* __thiscall ios_base_ctor(ios_base *this)
5033 TRACE("(%p)\n", this);
5034 this->vtable = &MSVCP_ios_base_vtable;
5035 return this;
5038 /* ??0ios_base@std@@QAE@ABV01@@Z */
5039 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
5040 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
5041 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
5043 TRACE("(%p %p)\n", this, copy);
5044 *this = *copy;
5045 this->vtable = &MSVCP_ios_base_vtable;
5046 return this;
5049 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
5050 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
5051 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
5052 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
5054 IOS_BASE_fnarray *cur;
5056 TRACE("(%p %x)\n", this, event);
5058 for(cur=this->calls; cur; cur=cur->next)
5059 cur->event_handler(event, this, cur->index);
5062 /* ?_Tidy@ios_base@std@@AAAXXZ */
5063 /* ?_Tidy@ios_base@std@@AEAAXXZ */
5064 void __cdecl ios_base_Tidy(ios_base *this)
5066 IOS_BASE_iosarray *arr_cur, *arr_next;
5067 IOS_BASE_fnarray *event_cur, *event_next;
5069 TRACE("(%p)\n", this);
5071 ios_base_Callfns(this, EVENT_erase_event);
5073 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
5074 arr_next = arr_cur->next;
5075 MSVCRT_operator_delete(arr_cur);
5077 this->arr = NULL;
5079 for(event_cur=this->calls; event_cur; event_cur=event_next) {
5080 event_next = event_cur->next;
5081 MSVCRT_operator_delete(event_cur);
5083 this->calls = NULL;
5086 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
5087 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
5088 void __cdecl ios_base_Ios_base_dtor(ios_base *obj)
5090 TRACE("(%p)\n", obj);
5091 locale_dtor(IOS_LOCALE(obj));
5092 #if _MSVCP_VER >= 70
5093 MSVCRT_operator_delete(obj->loc);
5094 #endif
5095 ios_base_Tidy(obj);
5098 /* ??1ios_base@std@@UAE@XZ */
5099 /* ??1ios_base@std@@UEAA@XZ */
5100 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
5101 void __thiscall ios_base_dtor(ios_base *this)
5103 ios_base_Ios_base_dtor(this);
5106 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
5107 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
5109 TRACE("(%p %x)\n", this, flags);
5110 if(flags & 2) {
5111 /* we have an array, with the number of elements stored before the first object */
5112 INT_PTR i, *ptr = (INT_PTR *)this-1;
5114 for(i=*ptr-1; i>=0; i--)
5115 ios_base_dtor(this+i);
5116 MSVCRT_operator_delete(ptr);
5117 } else {
5118 ios_base_dtor(this);
5119 if(flags & 1)
5120 MSVCRT_operator_delete(this);
5123 return this;
5126 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
5127 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
5129 TRACE("(%p %x)\n", this, flags);
5130 if(flags & 2) {
5131 INT_PTR *ptr = (INT_PTR *)this-1;
5132 MSVCRT_operator_delete(ptr);
5133 } else {
5134 if(flags & 1)
5135 MSVCRT_operator_delete(this);
5138 return this;
5141 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
5142 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
5143 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
5144 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
5146 IOS_BASE_iosarray *p;
5148 TRACE("(%p %d)\n", this, index);
5150 for(p=this->arr; p; p=p->next) {
5151 if(p->index == index)
5152 return p;
5155 for(p=this->arr; p; p=p->next) {
5156 if(!p->long_val && !p->ptr_val) {
5157 p->index = index;
5158 return p;
5162 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
5163 p->next = this->arr;
5164 p->index = index;
5165 p->long_val = 0;
5166 p->ptr_val = NULL;
5167 this->arr = p;
5168 return p;
5171 /* ?iword@ios_base@std@@QAEAAJH@Z */
5172 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
5173 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
5174 LONG* __thiscall ios_base_iword(ios_base *this, int index)
5176 TRACE("(%p %d)\n", this, index);
5177 return &ios_base_Findarr(this, index)->long_val;
5180 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
5181 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
5182 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
5183 void** __thiscall ios_base_pword(ios_base *this, int index)
5185 TRACE("(%p %d)\n", this, index);
5186 return &ios_base_Findarr(this, index)->ptr_val;
5189 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
5190 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
5191 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
5192 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
5194 IOS_BASE_fnarray *event;
5196 TRACE("(%p %p %d)\n", this, callback, index);
5198 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
5199 event->next = this->calls;
5200 event->index = index;
5201 event->event_handler = callback;
5202 this->calls = event;
5205 /* ?clear@ios_base@std@@QAEXH_N@Z */
5206 /* ?clear@ios_base@std@@QEAAXH_N@Z */
5207 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
5208 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5210 TRACE("(%p %x %x)\n", this, state, reraise);
5212 this->state = state & IOSTATE_mask;
5213 if(!(this->state & this->except))
5214 return;
5216 if(reraise)
5217 throw_exception(EXCEPTION_RERAISE, NULL);
5218 else if(this->state & this->except & IOSTATE_eofbit)
5219 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
5220 else if(this->state & this->except & IOSTATE_failbit)
5221 throw_exception(EXCEPTION_FAILURE, "failbit is set");
5222 else if(this->state & this->except & IOSTATE_badbit)
5223 throw_exception(EXCEPTION_FAILURE, "badbit is set");
5224 else if(this->state & this->except & IOSTATE__Hardfail)
5225 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
5228 /* ?clear@ios_base@std@@QAEXH@Z */
5229 /* ?clear@ios_base@std@@QEAAXH@Z */
5230 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
5231 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
5233 ios_base_clear_reraise(this, state, FALSE);
5236 /* ?clear@ios_base@std@@QAEXI@Z */
5237 /* ?clear@ios_base@std@@QEAAXI@Z */
5238 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
5239 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
5241 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
5244 /* ?exceptions@ios_base@std@@QAEXH@Z */
5245 /* ?exceptions@ios_base@std@@QEAAXH@Z */
5246 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
5247 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
5249 TRACE("(%p %x)\n", this, state);
5250 this->except = state & IOSTATE_mask;
5251 ios_base_clear(this, this->state);
5254 /* ?exceptions@ios_base@std@@QAEXI@Z */
5255 /* ?exceptions@ios_base@std@@QEAAXI@Z */
5256 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
5257 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
5259 TRACE("(%p %x)\n", this, state);
5260 ios_base_exceptions_set(this, state);
5263 /* ?exceptions@ios_base@std@@QBEHXZ */
5264 /* ?exceptions@ios_base@std@@QEBAHXZ */
5265 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
5266 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
5268 TRACE("(%p)\n", this);
5269 return this->except;
5272 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
5273 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
5274 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
5275 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
5277 TRACE("(%p %p)\n", this, rhs);
5279 if(this != rhs) {
5280 IOS_BASE_iosarray *arr_cur;
5281 IOS_BASE_fnarray *event_cur;
5283 ios_base_Tidy(this);
5285 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
5286 if(arr_cur->long_val)
5287 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
5288 if(arr_cur->ptr_val)
5289 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
5291 this->stdstr = rhs->stdstr;
5292 this->fmtfl = rhs->fmtfl;
5293 this->prec = rhs->prec;
5294 this->wide = rhs->wide;
5295 locale_operator_assign(IOS_LOCALE(this), IOS_LOCALE(rhs));
5297 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
5298 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
5300 ios_base_Callfns(this, EVENT_copyfmt_event);
5301 ios_base_exceptions_set(this, rhs->except);
5304 return this;
5307 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
5308 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
5309 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
5310 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
5312 TRACE("(%p %p)\n", this, right);
5314 if(this != right) {
5315 this->state = right->state;
5316 ios_base_copyfmt(this, right);
5319 return this;
5322 /* ?fail@ios_base@std@@QBE_NXZ */
5323 /* ?fail@ios_base@std@@QEBA_NXZ */
5324 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
5325 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
5327 TRACE("(%p)\n", this);
5328 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
5331 /* ??7ios_base@std@@QBE_NXZ */
5332 /* ??7ios_base@std@@QEBA_NXZ */
5333 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
5334 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
5336 TRACE("(%p)\n", this);
5337 return ios_base_fail(this);
5340 /* ??Bios_base@std@@QBEPAXXZ */
5341 /* ??Bios_base@std@@QEBAPEAXXZ */
5342 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
5343 void* __thiscall ios_base_op_fail(const ios_base *this)
5345 TRACE("(%p)\n", this);
5346 return ios_base_fail(this) ? NULL : (void*)this;
5349 /* ??Bios_base@std@@QBA_NXZ */
5350 /* ??Bios_base@std@@QBE_NXZ */
5351 /* ??Bios_base@std@@QEBA_NXZ */
5352 DEFINE_THISCALL_WRAPPER(ios_base_operator_bool, 4)
5353 MSVCP_bool __thiscall ios_base_operator_bool(const ios_base *this)
5355 TRACE("(%p)\n", this);
5356 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) == 0;
5359 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
5360 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
5361 void __cdecl ios_base_Addstd(ios_base *add)
5363 FIXME("(%p) stub\n", add);
5366 /* ?_Index_func@ios_base@std@@CAAAHXZ */
5367 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
5368 int* __cdecl ios_base_Index_func(void)
5370 TRACE("\n");
5371 return &ios_base_Index;
5374 /* ?_Init@ios_base@std@@IAEXXZ */
5375 /* ?_Init@ios_base@std@@IEAAXXZ */
5376 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
5377 void __thiscall ios_base__Init(ios_base *this)
5379 TRACE("(%p)\n", this);
5381 this->stdstr = 0;
5382 this->state = this->except = IOSTATE_goodbit;
5383 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
5384 this->prec = 6;
5385 this->wide = 0;
5386 this->arr = NULL;
5387 this->calls = NULL;
5388 #if _MSVCP_VER >= 70
5389 this->loc = MSVCRT_operator_new(sizeof(locale));
5390 #endif
5391 locale_ctor(IOS_LOCALE(this));
5394 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
5395 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
5396 MSVCP_bool* __cdecl ios_base_Sync_func(void)
5398 TRACE("\n");
5399 return &ios_base_Sync;
5402 /* ?bad@ios_base@std@@QBE_NXZ */
5403 /* ?bad@ios_base@std@@QEBA_NXZ */
5404 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
5405 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
5407 TRACE("(%p)\n", this);
5408 return (this->state & IOSTATE_badbit) != 0;
5411 /* ?eof@ios_base@std@@QBE_NXZ */
5412 /* ?eof@ios_base@std@@QEBA_NXZ */
5413 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
5414 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
5416 TRACE("(%p)\n", this);
5417 return (this->state & IOSTATE_eofbit) != 0;
5420 /* ?flags@ios_base@std@@QAEHH@Z */
5421 /* ?flags@ios_base@std@@QEAAHH@Z */
5422 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
5423 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
5425 IOSB_fmtflags ret = this->fmtfl;
5427 TRACE("(%p %x)\n", this, flags);
5429 this->fmtfl = flags & FMTFLAG_mask;
5430 return ret;
5433 /* ?flags@ios_base@std@@QBEHXZ */
5434 /* ?flags@ios_base@std@@QEBAHXZ */
5435 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
5436 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
5438 TRACE("(%p)\n", this);
5439 return this->fmtfl;
5442 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
5443 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
5444 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
5445 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
5447 TRACE("(%p)\n", this);
5448 return locale_copy_ctor(ret, IOS_LOCALE(this));
5451 /* ?good@ios_base@std@@QBE_NXZ */
5452 /* ?good@ios_base@std@@QEBA_NXZ */
5453 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
5454 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
5456 TRACE("(%p)\n", this);
5457 return this->state == IOSTATE_goodbit;
5460 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
5461 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
5462 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
5463 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
5465 TRACE("(%p %p)\n", this, loc);
5466 *ret = *IOS_LOCALE(this);
5467 locale_copy_ctor(IOS_LOCALE(this), loc);
5468 return ret;
5471 /* ?precision@ios_base@std@@QAEHH@Z */
5472 /* ?precision@ios_base@std@@QEAA_J_J@Z */
5473 #if STREAMSIZE_BITS == 64
5474 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
5475 #else
5476 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
5477 #endif
5478 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
5480 streamsize ret = this->prec;
5482 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
5484 this->prec = precision;
5485 return ret;
5488 /* ?precision@ios_base@std@@QBEHXZ */
5489 /* ?precision@ios_base@std@@QEBA_JXZ */
5490 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
5491 streamsize __thiscall ios_base_precision_get(const ios_base *this)
5493 TRACE("(%p)\n", this);
5494 return this->prec;
5497 /* ?rdstate@ios_base@std@@QBEHXZ */
5498 /* ?rdstate@ios_base@std@@QEBAHXZ */
5499 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
5500 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
5502 TRACE("(%p)\n", this);
5503 return this->state;
5506 /* ?setf@ios_base@std@@QAEHHH@Z */
5507 /* ?setf@ios_base@std@@QEAAHHH@Z */
5508 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
5509 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
5511 IOSB_fmtflags ret = this->fmtfl;
5513 TRACE("(%p %x %x)\n", this, flags, mask);
5515 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
5516 return ret;
5519 /* ?setf@ios_base@std@@QAEHH@Z */
5520 /* ?setf@ios_base@std@@QEAAHH@Z */
5521 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
5522 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
5524 IOSB_fmtflags ret = this->fmtfl;
5526 TRACE("(%p %x)\n", this, flags);
5528 this->fmtfl |= flags & FMTFLAG_mask;
5529 return ret;
5532 /* ?setstate@ios_base@std@@QAEXH_N@Z */
5533 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
5534 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
5535 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5537 TRACE("(%p %x %x)\n", this, state, reraise);
5539 if(state != IOSTATE_goodbit)
5540 ios_base_clear_reraise(this, this->state | state, reraise);
5543 /* ?setstate@ios_base@std@@QAEXH@Z */
5544 /* ?setstate@ios_base@std@@QEAAXH@Z */
5545 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
5546 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
5548 ios_base_setstate_reraise(this, state, FALSE);
5551 /* ?setstate@ios_base@std@@QAEXI@Z */
5552 /* ?setstate@ios_base@std@@QEAAXI@Z */
5553 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
5554 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
5556 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5559 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
5560 MSVCP_bool __cdecl ios_base_sync_with_stdio(MSVCP_bool sync)
5562 _Lockit lock;
5563 MSVCP_bool ret;
5565 TRACE("(%x)\n", sync);
5567 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5568 ret = ios_base_Sync;
5569 ios_base_Sync = sync;
5570 _Lockit_dtor(&lock);
5571 return ret;
5574 /* ?unsetf@ios_base@std@@QAEXH@Z */
5575 /* ?unsetf@ios_base@std@@QEAAXH@Z */
5576 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
5577 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
5579 TRACE("(%p %x)\n", this, flags);
5580 this->fmtfl &= ~flags;
5583 /* ?width@ios_base@std@@QAEHH@Z */
5584 /* ?width@ios_base@std@@QEAA_J_J@Z */
5585 #if STREAMSIZE_BITS == 64
5586 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
5587 #else
5588 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
5589 #endif
5590 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
5592 streamsize ret = this->wide;
5594 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
5596 this->wide = width;
5597 return ret;
5600 /* ?width@ios_base@std@@QBEHXZ */
5601 /* ?width@ios_base@std@@QEBA_JXZ */
5602 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
5603 streamsize __thiscall ios_base_width_get(ios_base *this)
5605 TRACE("(%p)\n", this);
5606 return this->wide;
5609 /* ?xalloc@ios_base@std@@SAHXZ */
5610 int __cdecl ios_base_xalloc(void)
5612 _Lockit lock;
5613 int ret;
5615 TRACE("\n");
5617 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5618 ret = ios_base_Index++;
5619 _Lockit_dtor(&lock);
5620 return ret;
5623 /* ?swap@ios_base@std@@QAEXAAV12@@Z */
5624 /* ?swap@ios_base@std@@QEAAXAEAV12@@Z */
5625 DEFINE_THISCALL_WRAPPER(ios_base_swap, 8)
5626 void __thiscall ios_base_swap(ios_base *this, ios_base *r)
5628 ios_base tmp;
5630 TRACE("(%p %p)\n", this, r);
5632 if(this == r)
5633 return;
5635 tmp = *this;
5636 *this = *r;
5637 this->vtable = tmp.vtable;
5638 tmp.vtable = r->vtable;
5639 *r = tmp;
5642 DEFINE_THISCALL_WRAPPER(basic_ios__Add_vtordisp1, 4)
5643 void __thiscall basic_ios__Add_vtordisp1(void *this)
5645 WARN("should not be called (%p)\n", this);
5648 DEFINE_THISCALL_WRAPPER(basic_ios__Add_vtordisp2, 4)
5649 void __thiscall basic_ios__Add_vtordisp2(void *this)
5651 WARN("should not be called (%p)\n", this);
5654 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
5655 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
5656 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
5657 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
5659 TRACE("(%p)\n", this);
5661 ios_base_ctor(&this->base);
5662 this->base.vtable = &MSVCP_basic_ios_char_vtable;
5663 return this;
5666 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5667 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5668 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
5669 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
5671 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5672 ios_base__Init(&this->base);
5673 this->strbuf = streambuf;
5674 this->stream = NULL;
5675 this->fillch = ' ';
5677 if(!streambuf)
5678 ios_base_setstate(&this->base, IOSTATE_badbit);
5680 if(isstd)
5681 FIXME("standard streams not handled yet\n");
5684 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5685 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5686 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
5687 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
5689 TRACE("(%p %p)\n", this, strbuf);
5691 basic_ios_char_ctor(this);
5692 basic_ios_char_init(this, strbuf, FALSE);
5693 return this;
5696 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
5697 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5698 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
5699 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
5701 TRACE("(%p)\n", this);
5702 ios_base_dtor(&this->base);
5705 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
5706 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
5708 TRACE("(%p %x)\n", this, flags);
5709 if(flags & 2) {
5710 /* we have an array, with the number of elements stored before the first object */
5711 INT_PTR i, *ptr = (INT_PTR *)this-1;
5713 for(i=*ptr-1; i>=0; i--)
5714 basic_ios_char_dtor(this+i);
5715 MSVCRT_operator_delete(ptr);
5716 } else {
5717 basic_ios_char_dtor(this);
5718 if(flags & 1)
5719 MSVCRT_operator_delete(this);
5722 return this;
5725 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5726 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5727 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5728 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5730 TRACE("(%p %x %x)\n", this, state, reraise);
5731 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5734 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5735 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5736 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5737 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5739 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5742 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5743 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5744 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5745 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5747 TRACE("(%p %p)\n", this, copy);
5748 if(this == copy)
5749 return this;
5751 this->stream = copy->stream;
5752 this->fillch = copy->fillch;
5753 ios_base_copyfmt(&this->base, &copy->base);
5754 return this;
5757 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5758 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5759 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5760 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5762 char ret = this->fillch;
5764 TRACE("(%p %c)\n", this, fill);
5766 this->fillch = fill;
5767 return ret;
5770 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5771 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5772 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5773 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5775 TRACE("(%p)\n", this);
5776 return this->fillch;
5779 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5780 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5781 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5782 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5784 TRACE("(%p %p %p)\n", this, ret, loc);
5786 if(this->strbuf) {
5787 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5788 locale_dtor(ret);
5791 return ios_base_imbue(&this->base, ret, loc);
5794 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5795 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5796 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5797 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5799 TRACE("(%p %c %c)\n", this, ch, def);
5800 return ctype_char_narrow_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5803 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5804 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5805 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5806 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5808 basic_streambuf_char *ret = this->strbuf;
5810 TRACE("(%p %p)\n", this, streambuf);
5812 this->strbuf = streambuf;
5813 basic_ios_char_clear(this, IOSTATE_goodbit);
5814 return ret;
5817 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5818 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5819 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5820 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5822 TRACE("(%p)\n", this);
5823 return this->strbuf;
5826 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5827 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5828 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5829 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5831 TRACE("(%p %x %x)\n", this, state, reraise);
5833 if(state != IOSTATE_goodbit)
5834 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5837 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5838 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5839 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5840 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5842 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5845 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5846 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5847 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5848 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5850 basic_ostream_char *ret = this->stream;
5852 TRACE("(%p %p)\n", this, ostream);
5854 this->stream = ostream;
5855 return ret;
5858 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5859 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5860 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5861 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5863 TRACE("(%p)\n", this);
5864 return this->stream;
5867 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5868 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5869 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5870 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5872 TRACE("(%p %c)\n", this, ch);
5873 return ctype_char_widen_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch);
5876 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
5877 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
5878 DEFINE_THISCALL_WRAPPER(basic_ios_char_swap, 8)
5879 void __thiscall basic_ios_char_swap(basic_ios_char *this, basic_ios_char *r)
5881 void *swap_ptr;
5883 TRACE("(%p %p)\n", this, r);
5885 if(this == r)
5886 return;
5888 ios_base_swap(&this->base, &r->base);
5889 swap_ptr = this->stream;
5890 this->stream = r->stream;
5891 r->stream = swap_ptr;
5892 this->fillch ^= r->fillch;
5893 r->fillch ^= this->fillch;
5894 this->fillch ^= r->fillch;
5897 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5898 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5899 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5900 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5902 TRACE("(%p)\n", this);
5904 ios_base_ctor(&this->base);
5905 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5906 return this;
5909 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5910 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5911 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5912 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5914 basic_ios_wchar_ctor(this);
5915 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5916 return this;
5919 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5920 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5921 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5922 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5923 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5924 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
5926 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5927 ios_base__Init(&this->base);
5928 this->strbuf = streambuf;
5929 this->stream = NULL;
5930 this->fillch = ' ';
5932 if(!streambuf)
5933 ios_base_setstate(&this->base, IOSTATE_badbit);
5935 if(isstd)
5936 FIXME("standard streams not handled yet\n");
5939 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5940 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5941 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
5942 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5944 TRACE("(%p %p)\n", this, strbuf);
5946 basic_ios_wchar_ctor(this);
5947 basic_ios_wchar_init(this, strbuf, FALSE);
5948 return this;
5951 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5952 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5953 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
5954 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5956 basic_ios_wchar_ctor_streambuf(this, strbuf);
5957 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5958 return this;
5961 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
5962 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
5963 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
5964 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
5965 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
5966 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
5968 TRACE("(%p)\n", this);
5969 ios_base_dtor(&this->base);
5972 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5973 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5975 TRACE("(%p %x)\n", this, flags);
5976 if(flags & 2) {
5977 /* we have an array, with the number of elements stored before the first object */
5978 INT_PTR i, *ptr = (INT_PTR *)this-1;
5980 for(i=*ptr-1; i>=0; i--)
5981 basic_ios_wchar_dtor(this+i);
5982 MSVCRT_operator_delete(ptr);
5983 } else {
5984 basic_ios_wchar_dtor(this);
5985 if(flags & 1)
5986 MSVCRT_operator_delete(this);
5989 return this;
5992 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5993 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5994 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5995 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5996 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5997 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5999 TRACE("(%p %x %x)\n", this, state, reraise);
6000 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
6003 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
6004 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
6005 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
6006 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
6007 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
6008 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
6010 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
6013 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
6014 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
6015 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
6016 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
6017 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
6018 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
6020 TRACE("(%p %p)\n", this, copy);
6021 if(this == copy)
6022 return this;
6024 this->stream = copy->stream;
6025 this->fillch = copy->fillch;
6026 ios_base_copyfmt(&this->base, &copy->base);
6027 return this;
6030 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
6031 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
6032 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
6033 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
6034 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
6035 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
6037 wchar_t ret = this->fillch;
6039 TRACE("(%p %c)\n", this, fill);
6041 this->fillch = fill;
6042 return ret;
6045 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
6046 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
6047 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
6048 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
6049 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
6050 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
6052 TRACE("(%p)\n", this);
6053 return this->fillch;
6056 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
6057 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
6058 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
6059 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
6060 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
6061 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
6063 TRACE("(%p %p %p)\n", this, ret, loc);
6065 if(this->strbuf) {
6066 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
6067 locale_dtor(ret);
6070 return ios_base_imbue(&this->base, ret, loc);
6073 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
6074 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
6075 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
6076 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
6077 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
6078 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
6080 TRACE("(%p %c %c)\n", this, ch, def);
6081 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
6084 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
6085 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
6086 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
6087 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
6088 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
6089 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
6091 basic_streambuf_wchar *ret = this->strbuf;
6093 TRACE("(%p %p)\n", this, streambuf);
6095 this->strbuf = streambuf;
6096 basic_ios_wchar_clear(this, IOSTATE_goodbit);
6097 return ret;
6100 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
6101 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
6102 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
6103 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
6104 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
6105 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
6107 TRACE("(%p)\n", this);
6108 return this->strbuf;
6111 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
6112 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
6113 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
6114 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
6115 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
6116 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
6118 TRACE("(%p %x %x)\n", this, state, reraise);
6120 if(state != IOSTATE_goodbit)
6121 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
6124 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
6125 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
6126 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
6127 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
6128 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
6129 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
6131 basic_ios_wchar_setstate_reraise(this, state, FALSE);
6134 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
6135 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
6136 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
6137 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
6138 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
6139 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
6141 basic_ostream_wchar *ret = this->stream;
6143 TRACE("(%p %p)\n", this, ostream);
6145 this->stream = ostream;
6146 return ret;
6149 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
6150 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
6151 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
6152 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
6153 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
6154 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
6156 TRACE("(%p)\n", this);
6157 return this->stream;
6160 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
6161 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
6162 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
6163 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
6164 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
6165 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
6167 TRACE("(%p %c)\n", this, ch);
6168 return ctype_wchar_widen_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch);
6171 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
6172 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
6173 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
6174 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
6175 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_swap, 8)
6176 void __thiscall basic_ios_wchar_swap(basic_ios_wchar *this, basic_ios_wchar *r)
6178 void *swap_ptr;
6180 TRACE("(%p %p)\n", this, r);
6182 if(this == r)
6183 return;
6185 ios_base_swap(&this->base, &r->base);
6186 swap_ptr = this->stream;
6187 this->stream = r->stream;
6188 r->stream = swap_ptr;
6189 this->fillch ^= r->fillch;
6190 r->fillch ^= this->fillch;
6191 this->fillch ^= r->fillch;
6194 /* Caution: basic_ostream uses virtual inheritance.
6195 * All constructors have additional parameter that says if base class should be initialized.
6196 * Base class needs to be accessed using vbtable.
6198 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
6200 return (basic_ios_char*)((char*)this+this->vbtable[1]);
6203 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
6205 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
6208 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
6210 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
6213 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6214 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
6215 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 16)
6216 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
6217 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6219 basic_ios_char *base;
6221 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6223 if(virt_init) {
6224 this->vbtable = basic_ostream_char_vbtable;
6225 base = basic_ostream_char_get_basic_ios(this);
6226 INIT_BASIC_IOS_VTORDISP(base);
6227 basic_ios_char_ctor(base);
6228 }else {
6229 base = basic_ostream_char_get_basic_ios(this);
6232 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
6233 basic_ios_char_init(base, strbuf, isstd);
6234 return this;
6237 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6238 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6239 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 16)
6240 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
6241 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6243 basic_ios_char *base;
6245 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
6247 if(virt_init) {
6248 this->vbtable = basic_ostream_char_vbtable;
6249 base = basic_ostream_char_get_basic_ios(this);
6250 INIT_BASIC_IOS_VTORDISP(base);
6251 basic_ios_char_ctor(base);
6252 }else {
6253 base = basic_ostream_char_get_basic_ios(this);
6256 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
6257 if(addstd)
6258 ios_base_Addstd(&base->base);
6259 return this;
6262 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
6263 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
6264 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
6265 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
6267 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
6269 /* don't destroy virtual base here */
6270 TRACE("(%p)\n", this);
6273 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6274 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6275 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
6276 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
6278 TRACE("(%p)\n", this);
6279 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
6280 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
6283 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
6284 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
6286 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
6288 TRACE("(%p %x)\n", this, flags);
6290 if(flags & 2) {
6291 /* we have an array, with the number of elements stored before the first object */
6292 INT_PTR i, *ptr = (INT_PTR *)this-1;
6294 for(i=*ptr-1; i>=0; i--)
6295 basic_ostream_char_vbase_dtor(this+i);
6296 MSVCRT_operator_delete(ptr);
6297 } else {
6298 basic_ostream_char_vbase_dtor(this);
6299 if(flags & 1)
6300 MSVCRT_operator_delete(this);
6303 return this;
6306 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
6307 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
6308 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
6309 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
6311 /* this function is not matching C++ specification */
6312 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6314 TRACE("(%p)\n", this);
6316 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
6317 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
6318 basic_ios_char_setstate(base, IOSTATE_badbit);
6319 return this;
6322 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6323 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6324 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
6326 return basic_ostream_char_flush(ostream);
6329 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6330 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6331 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
6332 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
6334 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6336 TRACE("(%p)\n", this);
6338 if(base->base.fmtfl & FMTFLAG_unitbuf)
6339 basic_ostream_char_flush(this);
6342 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
6343 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
6344 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
6345 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
6347 TRACE("(%p)\n", this);
6348 basic_ostream_char__Osfx(this);
6351 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
6353 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6355 if(basic_ios_char_rdbuf_get(base))
6356 call_basic_streambuf_char__Lock(base->strbuf);
6358 if(ios_base_good(&base->base) && base->stream)
6359 basic_ostream_char_flush(base->stream);
6361 return ios_base_good(&base->base);
6364 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
6366 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6368 if(ios_base_good(&base->base) && !__uncaught_exception())
6369 basic_ostream_char_osfx(ostr);
6371 if(basic_ios_char_rdbuf_get(base))
6372 call_basic_streambuf_char__Unlock(base->strbuf);
6375 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
6376 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
6377 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
6378 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
6380 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6382 TRACE("(%p)\n", this);
6384 if(ios_base_good(&base->base) && base->stream)
6385 basic_ostream_char_flush(base->stream);
6386 return ios_base_good(&base->base);
6389 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
6390 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
6391 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
6392 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
6394 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6396 TRACE("(%p %c)\n", this, ch);
6398 if(!basic_ostream_char_sentry_create(this)
6399 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
6400 basic_ostream_char_sentry_destroy(this);
6401 basic_ios_char_setstate(base, IOSTATE_badbit);
6402 return this;
6405 basic_ostream_char_sentry_destroy(this);
6406 return this;
6409 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
6410 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
6411 #if STREAMOFF_BITS == 64
6412 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 16)
6413 #else
6414 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
6415 #endif
6416 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
6418 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6420 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6422 if(!ios_base_fail(&base->base)) {
6423 fpos_int seek;
6425 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6426 &seek, off, way, OPENMODE_out);
6427 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6428 basic_ios_char_setstate(base, IOSTATE_failbit);
6430 return this;
6433 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6434 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6435 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
6436 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
6438 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6440 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6442 if(!ios_base_fail(&base->base)) {
6443 fpos_int seek;
6445 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
6446 &seek, pos, OPENMODE_out);
6447 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6448 basic_ios_char_setstate(base, IOSTATE_failbit);
6450 return this;
6453 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6454 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6455 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
6456 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
6458 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6460 TRACE("(%p)\n", this);
6462 if(!ios_base_fail(&base->base)) {
6463 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6464 ret, 0, SEEKDIR_cur, OPENMODE_out);
6465 }else {
6466 ret->off = -1;
6467 ret->pos = 0;
6468 ret->state = 0;
6470 return ret;
6473 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
6474 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
6475 #if STREAMSIZE_BITS == 64
6476 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
6477 #else
6478 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
6479 #endif
6480 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
6482 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6484 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
6486 if(!basic_ostream_char_sentry_create(this)
6487 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
6488 basic_ostream_char_sentry_destroy(this);
6489 basic_ios_char_setstate(base, IOSTATE_badbit);
6490 return this;
6493 basic_ostream_char_sentry_destroy(this);
6494 return this;
6497 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
6498 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
6499 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
6500 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
6502 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6503 int state = IOSTATE_goodbit;
6505 TRACE("(%p %d)\n", this, val);
6507 if(basic_ostream_char_sentry_create(this)) {
6508 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6509 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6510 ostreambuf_iterator_char dest;
6512 memset(&dest, 0, sizeof(dest));
6513 dest.strbuf = strbuf;
6514 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
6515 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6516 ? (LONG)((unsigned short)val) : (LONG)val);
6518 basic_ostream_char_sentry_destroy(this);
6520 basic_ios_char_setstate(base, state);
6521 return this;
6524 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
6525 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
6526 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
6527 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
6529 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6530 int state = IOSTATE_goodbit;
6532 TRACE("(%p %u)\n", this, val);
6534 if(basic_ostream_char_sentry_create(this)) {
6535 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6536 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6537 ostreambuf_iterator_char dest;
6539 memset(&dest, 0, sizeof(dest));
6540 dest.strbuf = strbuf;
6541 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6543 basic_ostream_char_sentry_destroy(this);
6545 basic_ios_char_setstate(base, state);
6546 return this;
6549 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
6550 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
6551 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
6552 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
6553 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
6554 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
6556 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6557 int state = IOSTATE_goodbit;
6559 TRACE("(%p %d)\n", this, val);
6561 if(basic_ostream_char_sentry_create(this)) {
6562 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6563 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6564 ostreambuf_iterator_char dest;
6566 memset(&dest, 0, sizeof(dest));
6567 dest.strbuf = strbuf;
6568 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6570 basic_ostream_char_sentry_destroy(this);
6572 basic_ios_char_setstate(base, state);
6573 return this;
6576 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
6577 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
6578 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
6579 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
6580 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
6581 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
6583 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6584 int state = IOSTATE_goodbit;
6586 TRACE("(%p %u)\n", this, val);
6588 if(basic_ostream_char_sentry_create(this)) {
6589 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6590 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6591 ostreambuf_iterator_char dest;
6593 memset(&dest, 0, sizeof(dest));
6594 dest.strbuf = strbuf;
6595 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6597 basic_ostream_char_sentry_destroy(this);
6599 basic_ios_char_setstate(base, state);
6600 return this;
6603 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
6604 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
6605 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
6606 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
6608 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6609 int state = IOSTATE_goodbit;
6611 TRACE("(%p %f)\n", this, val);
6613 if(basic_ostream_char_sentry_create(this)) {
6614 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6615 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6616 ostreambuf_iterator_char dest;
6618 memset(&dest, 0, sizeof(dest));
6619 dest.strbuf = strbuf;
6620 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6622 basic_ostream_char_sentry_destroy(this);
6624 basic_ios_char_setstate(base, state);
6625 return this;
6628 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
6629 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
6630 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
6631 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
6633 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6634 int state = IOSTATE_goodbit;
6636 TRACE("(%p %lf)\n", this, val);
6638 if(basic_ostream_char_sentry_create(this)) {
6639 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6640 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6641 ostreambuf_iterator_char dest;
6643 memset(&dest, 0, sizeof(dest));
6644 dest.strbuf = strbuf;
6645 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6647 basic_ostream_char_sentry_destroy(this);
6649 basic_ios_char_setstate(base, state);
6650 return this;
6653 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
6654 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
6655 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
6656 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
6658 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6659 int state = IOSTATE_goodbit;
6661 TRACE("(%p %lf)\n", this, val);
6663 if(basic_ostream_char_sentry_create(this)) {
6664 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6665 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6666 ostreambuf_iterator_char dest;
6668 memset(&dest, 0, sizeof(dest));
6669 dest.strbuf = strbuf;
6670 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6672 basic_ostream_char_sentry_destroy(this);
6674 basic_ios_char_setstate(base, state);
6675 return this;
6678 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6679 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6680 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
6681 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
6683 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6684 IOSB_iostate state = IOSTATE_badbit;
6685 int c = '\n';
6687 TRACE("(%p %p)\n", this, val);
6689 if(basic_ostream_char_sentry_create(this)) {
6690 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
6691 c = basic_streambuf_char_snextc(val)) {
6692 state = IOSTATE_goodbit;
6694 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
6695 state = IOSTATE_badbit;
6696 break;
6699 }else {
6700 state = IOSTATE_badbit;
6702 basic_ostream_char_sentry_destroy(this);
6704 ios_base_width_set(&base->base, 0);
6705 basic_ios_char_setstate(base, state);
6706 return this;
6709 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
6710 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
6711 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
6712 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
6714 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6715 int state = IOSTATE_goodbit;
6717 TRACE("(%p %p)\n", this, val);
6719 if(basic_ostream_char_sentry_create(this)) {
6720 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6721 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6722 ostreambuf_iterator_char dest;
6724 memset(&dest, 0, sizeof(dest));
6725 dest.strbuf = strbuf;
6726 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6728 basic_ostream_char_sentry_destroy(this);
6730 basic_ios_char_setstate(base, state);
6731 return this;
6734 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
6735 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
6736 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
6737 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
6739 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6740 int state = IOSTATE_goodbit;
6742 TRACE("(%p)\n", this);
6744 if(basic_ostream_char_sentry_create(this)) {
6745 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6746 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6747 ostreambuf_iterator_char dest;
6749 memset(&dest, 0, sizeof(dest));
6750 dest.strbuf = strbuf;
6751 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6753 basic_ostream_char_sentry_destroy(this);
6755 basic_ios_char_setstate(base, state);
6756 return this;
6759 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
6760 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
6761 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
6762 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
6764 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6765 int state = IOSTATE_goodbit;
6767 TRACE("(%p)\n", this);
6769 if(basic_ostream_char_sentry_create(this)) {
6770 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6771 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6772 ostreambuf_iterator_char dest;
6774 memset(&dest, 0, sizeof(dest));
6775 dest.strbuf = strbuf;
6776 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6778 basic_ostream_char_sentry_destroy(this);
6780 basic_ios_char_setstate(base, state);
6781 return this;
6784 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
6785 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
6786 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
6787 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
6789 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6790 int state = IOSTATE_goodbit;
6792 TRACE("(%p %x)\n", this, val);
6794 if(basic_ostream_char_sentry_create(this)) {
6795 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6796 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6797 ostreambuf_iterator_char dest;
6799 memset(&dest, 0, sizeof(dest));
6800 dest.strbuf = strbuf;
6801 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6803 basic_ostream_char_sentry_destroy(this);
6805 basic_ios_char_setstate(base, state);
6806 return this;
6809 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6810 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6811 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6813 TRACE("(%p)\n", ostr);
6815 basic_ostream_char_put(ostr, 0);
6816 return ostr;
6819 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6820 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6821 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6823 TRACE("(%p)\n", ostr);
6825 basic_ostream_char_put(ostr, '\n');
6826 basic_ostream_char_flush(ostr);
6827 return ostr;
6830 /* ??$?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 */
6831 /* ??$?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 */
6832 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6834 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6835 IOSB_iostate state = IOSTATE_goodbit;
6837 TRACE("(%p %p)\n", ostr, str);
6839 if(basic_ostream_char_sentry_create(ostr)) {
6840 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6841 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6843 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6844 for(; pad!=0; pad--) {
6845 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6846 state = IOSTATE_badbit;
6847 break;
6852 if(state == IOSTATE_goodbit) {
6853 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6854 state = IOSTATE_badbit;
6857 if(state == IOSTATE_goodbit) {
6858 for(; pad!=0; pad--) {
6859 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6860 state = IOSTATE_badbit;
6861 break;
6866 base->base.wide = 0;
6867 }else {
6868 state = IOSTATE_badbit;
6870 basic_ostream_char_sentry_destroy(ostr);
6872 basic_ios_char_setstate(base, state);
6873 return ostr;
6876 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6877 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6878 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6879 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6880 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6881 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6882 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6884 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6885 IOSB_iostate state = IOSTATE_goodbit;
6887 TRACE("(%p %d)\n", ostr, ch);
6889 if(basic_ostream_char_sentry_create(ostr)) {
6890 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6892 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6893 for(; pad!=0; pad--) {
6894 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6895 state = IOSTATE_badbit;
6896 break;
6901 if(state == IOSTATE_goodbit) {
6902 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6903 state = IOSTATE_badbit;
6906 if(state == IOSTATE_goodbit) {
6907 for(; pad!=0; pad--) {
6908 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6909 state = IOSTATE_badbit;
6910 break;
6915 base->base.wide = 0;
6916 }else {
6917 state = IOSTATE_badbit;
6919 basic_ostream_char_sentry_destroy(ostr);
6921 basic_ios_char_setstate(base, state);
6922 return ostr;
6925 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6926 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6927 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6928 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6929 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
6930 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
6931 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
6933 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6934 IOSB_iostate state = IOSTATE_goodbit;
6936 TRACE("(%p %s)\n", ostr, str);
6938 if(basic_ostream_char_sentry_create(ostr)) {
6939 MSVCP_size_t len = strlen(str);
6940 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6942 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6943 for(; pad!=0; pad--) {
6944 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6945 state = IOSTATE_badbit;
6946 break;
6951 if(state == IOSTATE_goodbit) {
6952 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
6953 state = IOSTATE_badbit;
6956 if(state == IOSTATE_goodbit) {
6957 for(; pad!=0; pad--) {
6958 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6959 state = IOSTATE_badbit;
6960 break;
6965 base->base.wide = 0;
6966 }else {
6967 state = IOSTATE_badbit;
6969 basic_ostream_char_sentry_destroy(ostr);
6971 basic_ios_char_setstate(base, state);
6972 return ostr;
6975 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6976 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6977 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
6978 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
6979 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
6981 TRACE("(%p %p)\n", this, pfunc);
6982 pfunc(this);
6983 return this;
6986 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
6987 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
6988 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
6989 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
6990 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
6992 TRACE("(%p %p)\n", this, pfunc);
6993 pfunc(basic_ostream_char_get_basic_ios(this));
6994 return this;
6997 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6998 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6999 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
7000 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
7001 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
7003 TRACE("(%p %p)\n", this, pfunc);
7004 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
7005 return this;
7008 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
7009 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
7010 DEFINE_THISCALL_WRAPPER(basic_ostream_char_swap, 8)
7011 void __thiscall basic_ostream_char_swap(basic_ostream_char *this, basic_ostream_char *r)
7013 TRACE("(%p %p)\n", this, r);
7015 if(this == r)
7016 return;
7018 basic_ios_char_swap(basic_ostream_char_get_basic_ios(this),
7019 basic_ostream_char_get_basic_ios(r));
7022 /* Caution: basic_ostream uses virtual inheritance. */
7023 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
7025 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
7028 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
7030 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
7033 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
7035 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
7038 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
7039 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
7040 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor, 16)
7041 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor(basic_ostream_wchar *this,
7042 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7044 basic_ios_wchar *base;
7046 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
7048 if(virt_init) {
7049 this->vbtable = basic_ostream_wchar_vbtable;
7050 base = basic_ostream_wchar_get_basic_ios(this);
7051 INIT_BASIC_IOS_VTORDISP(base);
7052 basic_ios_wchar_ctor(base);
7053 }else {
7054 base = basic_ostream_wchar_get_basic_ios(this);
7057 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
7058 basic_ios_wchar_init(base, strbuf, isstd);
7059 return this;
7062 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
7063 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
7064 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 16)
7065 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
7066 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7068 basic_ostream_wchar_ctor(this, strbuf, isstd, virt_init);
7069 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
7070 return this;
7073 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
7074 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
7075 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor_uninitialized, 16)
7076 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor_uninitialized(basic_ostream_wchar *this,
7077 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
7079 basic_ios_wchar *base;
7081 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
7083 if(virt_init) {
7084 this->vbtable = basic_ostream_wchar_vbtable;
7085 base = basic_ostream_wchar_get_basic_ios(this);
7086 INIT_BASIC_IOS_VTORDISP(base);
7087 basic_ios_wchar_ctor(base);
7088 }else {
7089 base = basic_ostream_wchar_get_basic_ios(this);
7092 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
7093 if(addstd)
7094 ios_base_Addstd(&base->base);
7095 return this;
7098 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
7099 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
7100 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 16)
7101 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
7102 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
7104 basic_ostream_wchar_ctor_uninitialized(this, uninitialized, addstd, virt_init);
7105 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
7106 return this;
7109 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
7110 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
7111 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
7112 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
7113 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
7114 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
7116 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
7118 /* don't destroy virtual base here */
7119 TRACE("(%p)\n", this);
7122 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7123 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7124 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7125 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7126 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
7127 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
7129 TRACE("(%p)\n", this);
7130 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
7131 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
7134 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
7135 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
7137 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
7139 TRACE("(%p %x)\n", this, flags);
7141 if(flags & 2) {
7142 /* we have an array, with the number of elements stored before the first object */
7143 INT_PTR i, *ptr = (INT_PTR *)this-1;
7145 for(i=*ptr-1; i>=0; i--)
7146 basic_ostream_wchar_vbase_dtor(this+i);
7147 MSVCRT_operator_delete(ptr);
7148 } else {
7149 basic_ostream_wchar_vbase_dtor(this);
7150 if(flags & 1)
7151 MSVCRT_operator_delete(this);
7154 return this;
7157 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
7158 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
7159 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
7160 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
7161 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
7162 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
7164 /* this function is not matching C++ specification */
7165 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7167 TRACE("(%p)\n", this);
7169 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
7170 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
7171 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7172 return this;
7175 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7176 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7177 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7178 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7179 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
7181 return basic_ostream_wchar_flush(ostream);
7184 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7185 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7186 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7187 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7188 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
7189 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
7191 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7193 TRACE("(%p)\n", this);
7195 if(base->base.fmtfl & FMTFLAG_unitbuf)
7196 basic_ostream_wchar_flush(this);
7199 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
7200 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
7201 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
7202 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
7203 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
7204 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
7206 TRACE("(%p)\n", this);
7207 basic_ostream_wchar__Osfx(this);
7210 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
7212 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7214 if(basic_ios_wchar_rdbuf_get(base))
7215 basic_streambuf_wchar__Lock(base->strbuf);
7217 if(ios_base_good(&base->base) && base->stream)
7218 basic_ostream_wchar_flush(base->stream);
7220 return ios_base_good(&base->base);
7223 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
7225 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7227 if(ios_base_good(&base->base) && !__uncaught_exception())
7228 basic_ostream_wchar_osfx(ostr);
7230 if(basic_ios_wchar_rdbuf_get(base))
7231 basic_streambuf_wchar__Unlock(base->strbuf);
7234 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
7235 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
7236 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
7237 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
7238 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
7239 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
7241 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7243 TRACE("(%p)\n", this);
7245 if(ios_base_good(&base->base) && base->stream)
7246 basic_ostream_wchar_flush(base->stream);
7247 return ios_base_good(&base->base);
7250 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
7251 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
7252 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
7253 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
7254 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
7255 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
7257 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7259 TRACE("(%p %c)\n", this, ch);
7261 if(!basic_ostream_wchar_sentry_create(this)
7262 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
7263 basic_ostream_wchar_sentry_destroy(this);
7264 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7265 return this;
7268 basic_ostream_wchar_sentry_destroy(this);
7269 return this;
7272 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
7273 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
7274 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
7275 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
7276 #if STREAMOFF_BITS == 64
7277 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 16)
7278 #else
7279 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
7280 #endif
7281 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
7283 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7285 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
7287 if(!ios_base_fail(&base->base)) {
7288 fpos_int seek;
7290 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
7291 &seek, off, way, OPENMODE_out);
7292 if(seek.off==-1 && seek.pos==0 && seek.state==0)
7293 basic_ios_wchar_setstate(base, IOSTATE_failbit);
7295 return this;
7298 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7299 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7300 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
7301 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
7302 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
7303 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_int pos)
7305 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7307 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
7309 if(!ios_base_fail(&base->base)) {
7310 fpos_int seek;
7312 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
7313 &seek, pos, OPENMODE_out);
7314 if(seek.off==-1 && seek.pos==0 && seek.state==0)
7315 basic_ios_wchar_setstate(base, IOSTATE_failbit);
7317 return this;
7320 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7321 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7322 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
7323 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
7324 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
7325 fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_int *ret)
7327 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7329 TRACE("(%p)\n", this);
7331 if(!ios_base_fail(&base->base)) {
7332 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
7333 ret, 0, SEEKDIR_cur, OPENMODE_out);
7334 }else {
7335 ret->off = -1;
7336 ret->pos = 0;
7337 ret->state = 0;
7339 return ret;
7342 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
7343 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
7344 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
7345 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
7346 #if STREAMSIZE_BITS == 64
7347 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
7348 #else
7349 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
7350 #endif
7351 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
7353 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7355 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
7357 if(!basic_ostream_wchar_sentry_create(this)
7358 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
7359 basic_ostream_wchar_sentry_destroy(this);
7360 basic_ios_wchar_setstate(base, IOSTATE_badbit);
7361 return this;
7364 basic_ostream_wchar_sentry_destroy(this);
7365 return this;
7368 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
7370 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7371 int state = IOSTATE_goodbit;
7373 TRACE("(%p %d)\n", this, val);
7375 if(basic_ostream_wchar_sentry_create(this)) {
7376 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7377 ostreambuf_iterator_wchar dest;
7379 memset(&dest, 0, sizeof(dest));
7380 dest.strbuf = strbuf;
7381 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
7382 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
7383 ? (LONG)((unsigned short)val) : (LONG)val);
7385 basic_ostream_wchar_sentry_destroy(this);
7387 basic_ios_wchar_setstate(base, state);
7388 return this;
7391 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
7392 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
7393 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
7394 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
7396 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
7397 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7400 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
7401 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
7402 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
7403 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
7405 return basic_ostream_print_short(this, val, num_put_short_use_facet(
7406 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7409 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
7411 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7412 int state = IOSTATE_goodbit;
7414 TRACE("(%p %d)\n", this, val);
7416 if(basic_ostream_wchar_sentry_create(this)) {
7417 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7418 ostreambuf_iterator_wchar dest;
7420 memset(&dest, 0, sizeof(dest));
7421 dest.strbuf = strbuf;
7422 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7424 basic_ostream_wchar_sentry_destroy(this);
7426 basic_ios_wchar_setstate(base, state);
7427 return this;
7430 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
7431 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
7432 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
7433 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
7435 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
7436 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7439 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
7440 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
7441 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
7442 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
7444 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
7445 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7448 /* ??6std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7449 /* ??6std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7450 basic_ostream_wchar* __cdecl basic_ostream_short_print_ushort_global(basic_ostream_wchar *ostr, unsigned short val)
7452 return basic_ostream_print_ushort(ostr, val, num_put_short_use_facet(
7453 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(ostr)))));
7456 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
7458 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7459 int state = IOSTATE_goodbit;
7461 TRACE("(%p %d)\n", this, val);
7463 if(basic_ostream_wchar_sentry_create(this)) {
7464 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7465 ostreambuf_iterator_wchar dest;
7467 memset(&dest, 0, sizeof(dest));
7468 dest.strbuf = strbuf;
7469 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7471 basic_ostream_wchar_sentry_destroy(this);
7473 basic_ios_wchar_setstate(base, state);
7474 return this;
7477 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
7478 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
7479 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
7480 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
7481 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
7482 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
7484 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
7485 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7488 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
7489 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
7490 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
7491 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
7492 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
7493 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
7495 return basic_ostream_print_int(this, val, num_put_short_use_facet(
7496 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7499 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
7501 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7502 int state = IOSTATE_goodbit;
7504 TRACE("(%p %u)\n", this, val);
7506 if(basic_ostream_wchar_sentry_create(this)) {
7507 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7508 ostreambuf_iterator_wchar dest;
7510 memset(&dest, 0, sizeof(dest));
7511 dest.strbuf = strbuf;
7512 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7514 basic_ostream_wchar_sentry_destroy(this);
7516 basic_ios_wchar_setstate(base, state);
7517 return this;
7520 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
7521 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
7522 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
7523 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
7524 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
7525 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
7527 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
7528 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7531 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
7532 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
7533 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
7534 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
7535 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
7536 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
7538 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
7539 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7542 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
7544 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7545 int state = IOSTATE_goodbit;
7547 TRACE("(%p %f)\n", this, val);
7549 if(basic_ostream_wchar_sentry_create(this)) {
7550 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7551 ostreambuf_iterator_wchar dest;
7553 memset(&dest, 0, sizeof(dest));
7554 dest.strbuf = strbuf;
7555 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7557 basic_ostream_wchar_sentry_destroy(this);
7559 basic_ios_wchar_setstate(base, state);
7560 return this;
7563 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
7564 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
7565 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
7566 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
7568 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
7569 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7572 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
7573 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
7574 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
7575 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
7577 return basic_ostream_print_float(this, val, num_put_short_use_facet(
7578 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7581 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
7583 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7584 int state = IOSTATE_goodbit;
7586 TRACE("(%p %lf)\n", this, val);
7588 if(basic_ostream_wchar_sentry_create(this)) {
7589 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7590 ostreambuf_iterator_wchar dest;
7592 memset(&dest, 0, sizeof(dest));
7593 dest.strbuf = strbuf;
7594 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7596 basic_ostream_wchar_sentry_destroy(this);
7598 basic_ios_wchar_setstate(base, state);
7599 return this;
7602 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
7603 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
7604 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
7605 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
7607 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
7608 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7611 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
7612 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
7613 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
7614 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
7616 return basic_ostream_print_double(this, val, num_put_short_use_facet(
7617 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7620 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
7622 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7623 int state = IOSTATE_goodbit;
7625 TRACE("(%p %lf)\n", this, val);
7627 if(basic_ostream_wchar_sentry_create(this)) {
7628 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7629 ostreambuf_iterator_wchar dest;
7631 memset(&dest, 0, sizeof(dest));
7632 dest.strbuf = strbuf;
7633 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7635 basic_ostream_wchar_sentry_destroy(this);
7637 basic_ios_wchar_setstate(base, state);
7638 return this;
7641 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
7642 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
7643 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
7644 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
7646 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
7647 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7650 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
7651 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
7652 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
7653 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
7655 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
7656 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7659 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7660 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7661 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7662 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7663 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
7664 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
7666 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7667 IOSB_iostate state = IOSTATE_badbit;
7668 unsigned short c = '\n';
7670 TRACE("(%p %p)\n", this, val);
7672 if(basic_ostream_wchar_sentry_create(this)) {
7673 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
7674 c = basic_streambuf_wchar_snextc(val)) {
7675 state = IOSTATE_goodbit;
7677 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
7678 state = IOSTATE_badbit;
7679 break;
7682 }else {
7683 state = IOSTATE_badbit;
7685 basic_ostream_wchar_sentry_destroy(this);
7687 ios_base_width_set(&base->base, 0);
7688 basic_ios_wchar_setstate(base, state);
7689 return this;
7692 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
7694 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7695 int state = IOSTATE_goodbit;
7697 TRACE("(%p %p)\n", this, val);
7699 if(basic_ostream_wchar_sentry_create(this)) {
7700 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7701 ostreambuf_iterator_wchar dest;
7703 memset(&dest, 0, sizeof(dest));
7704 dest.strbuf = strbuf;
7705 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7707 basic_ostream_wchar_sentry_destroy(this);
7709 basic_ios_wchar_setstate(base, state);
7710 return this;
7713 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
7714 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
7715 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
7716 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
7718 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
7719 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7722 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
7723 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
7724 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
7725 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
7727 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
7728 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7731 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
7733 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7734 int state = IOSTATE_goodbit;
7736 TRACE("(%p)\n", this);
7738 if(basic_ostream_wchar_sentry_create(this)) {
7739 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7740 ostreambuf_iterator_wchar dest;
7742 memset(&dest, 0, sizeof(dest));
7743 dest.strbuf = strbuf;
7744 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7746 basic_ostream_wchar_sentry_destroy(this);
7748 basic_ios_wchar_setstate(base, state);
7749 return this;
7752 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
7753 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
7754 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
7755 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
7757 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
7758 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7761 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
7762 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
7763 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
7764 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
7766 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
7767 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7770 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
7772 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7773 int state = IOSTATE_goodbit;
7775 TRACE("(%p)\n", this);
7777 if(basic_ostream_wchar_sentry_create(this)) {
7778 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7779 ostreambuf_iterator_wchar dest;
7781 memset(&dest, 0, sizeof(dest));
7782 dest.strbuf = strbuf;
7783 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7785 basic_ostream_wchar_sentry_destroy(this);
7787 basic_ios_wchar_setstate(base, state);
7788 return this;
7791 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
7792 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
7793 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
7794 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7796 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
7797 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7800 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
7801 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
7802 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
7803 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7805 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
7806 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7809 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
7811 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7812 int state = IOSTATE_goodbit;
7814 TRACE("(%p %x)\n", this, val);
7816 if(basic_ostream_wchar_sentry_create(this)) {
7817 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7818 ostreambuf_iterator_wchar dest;
7820 memset(&dest, 0, sizeof(dest));
7821 dest.strbuf = strbuf;
7822 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7824 basic_ostream_wchar_sentry_destroy(this);
7826 basic_ios_wchar_setstate(base, state);
7827 return this;
7830 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
7831 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
7832 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
7833 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7835 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
7836 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7839 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
7840 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
7841 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
7842 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7844 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
7845 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7848 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7849 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7850 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7851 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7852 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
7854 TRACE("(%p)\n", ostr);
7856 basic_ostream_wchar_put(ostr, 0);
7857 return ostr;
7860 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7861 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7862 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7863 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7864 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
7866 TRACE("(%p)\n", ostr);
7868 basic_ostream_wchar_put(ostr, '\n');
7869 basic_ostream_wchar_flush(ostr);
7870 return ostr;
7873 /* ??$?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 */
7874 /* ??$?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 */
7875 /* ??$?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 */
7876 /* ??$?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 */
7877 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
7879 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7880 IOSB_iostate state = IOSTATE_goodbit;
7882 TRACE("(%p %p)\n", ostr, str);
7884 if(basic_ostream_wchar_sentry_create(ostr)) {
7885 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
7886 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7888 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7889 for(; pad!=0; pad--) {
7890 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7891 state = IOSTATE_badbit;
7892 break;
7897 if(state == IOSTATE_goodbit) {
7898 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7899 state = IOSTATE_badbit;
7902 if(state == IOSTATE_goodbit) {
7903 for(; pad!=0; pad--) {
7904 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7905 state = IOSTATE_badbit;
7906 break;
7911 base->base.wide = 0;
7912 }else {
7913 state = IOSTATE_badbit;
7915 basic_ostream_wchar_sentry_destroy(ostr);
7917 basic_ios_wchar_setstate(base, state);
7918 return ostr;
7921 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
7922 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
7923 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7924 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7925 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
7927 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7928 IOSB_iostate state = IOSTATE_goodbit;
7930 TRACE("(%p %d)\n", ostr, ch);
7932 if(basic_ostream_wchar_sentry_create(ostr)) {
7933 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
7935 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7936 for(; pad!=0; pad--) {
7937 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7938 state = IOSTATE_badbit;
7939 break;
7944 if(state == IOSTATE_goodbit) {
7945 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
7946 state = IOSTATE_badbit;
7949 if(state == IOSTATE_goodbit) {
7950 for(; pad!=0; pad--) {
7951 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7952 state = IOSTATE_badbit;
7953 break;
7958 base->base.wide = 0;
7959 }else {
7960 state = IOSTATE_badbit;
7962 basic_ostream_wchar_sentry_destroy(ostr);
7964 basic_ios_wchar_setstate(base, state);
7965 return ostr;
7968 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
7969 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
7970 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
7971 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
7972 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
7974 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7975 IOSB_iostate state = IOSTATE_goodbit;
7977 TRACE("(%p %s)\n", ostr, debugstr_w(str));
7979 if(basic_ostream_wchar_sentry_create(ostr)) {
7980 MSVCP_size_t len = wcslen(str);
7981 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7983 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7984 for(; pad!=0; pad--) {
7985 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7986 state = IOSTATE_badbit;
7987 break;
7992 if(state == IOSTATE_goodbit) {
7993 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
7994 state = IOSTATE_badbit;
7997 if(state == IOSTATE_goodbit) {
7998 for(; pad!=0; pad--) {
7999 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
8000 state = IOSTATE_badbit;
8001 break;
8006 base->base.wide = 0;
8007 }else {
8008 state = IOSTATE_badbit;
8010 basic_ostream_wchar_sentry_destroy(ostr);
8012 basic_ios_wchar_setstate(base, state);
8013 return ostr;
8016 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8017 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8018 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8019 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8020 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
8021 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
8022 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
8024 TRACE("(%p %p)\n", this, pfunc);
8025 pfunc(this);
8026 return this;
8029 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
8030 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
8031 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
8032 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
8033 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
8034 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
8035 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
8037 TRACE("(%p %p)\n", this, pfunc);
8038 pfunc(basic_ostream_wchar_get_basic_ios(this));
8039 return this;
8042 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8043 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8044 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8045 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8046 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
8047 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
8048 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
8050 TRACE("(%p %p)\n", this, pfunc);
8051 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
8052 return this;
8055 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
8056 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
8057 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
8058 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IEAAXAEAV12@@Z */
8059 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_swap, 8)
8060 void __thiscall basic_ostream_wchar_swap(basic_ostream_wchar *this, basic_ostream_wchar *r)
8062 TRACE("(%p %p)\n", this, r);
8064 if(this == r)
8065 return;
8067 basic_ios_wchar_swap(basic_ostream_wchar_get_basic_ios(this),
8068 basic_ostream_wchar_get_basic_ios(r));
8071 /* Caution: basic_istream uses virtual inheritance. */
8072 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
8074 return (basic_ios_char*)((char*)this+this->vbtable[1]);
8077 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
8079 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
8082 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
8084 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
8087 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
8088 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
8089 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
8090 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)
8092 basic_ios_char *base;
8094 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
8096 if(virt_init) {
8097 this->vbtable = basic_istream_char_vbtable;
8098 base = basic_istream_char_get_basic_ios(this);
8099 INIT_BASIC_IOS_VTORDISP(base);
8100 basic_ios_char_ctor(base);
8101 }else {
8102 base = basic_istream_char_get_basic_ios(this);
8105 base->base.vtable = &MSVCP_basic_istream_char_vtable;
8106 this->count = 0;
8107 if(!noinit)
8108 basic_ios_char_init(base, strbuf, isstd);
8109 return this;
8112 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
8113 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
8114 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
8115 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8117 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8120 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8121 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8122 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
8123 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
8125 basic_ios_char *base;
8127 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
8129 if(virt_init) {
8130 this->vbtable = basic_istream_char_vbtable;
8131 base = basic_istream_char_get_basic_ios(this);
8132 INIT_BASIC_IOS_VTORDISP(base);
8133 basic_ios_char_ctor(base);
8134 }else {
8135 base = basic_istream_char_get_basic_ios(this);
8138 base->base.vtable = &MSVCP_basic_istream_char_vtable;
8139 ios_base_Addstd(&base->base);
8140 return this;
8143 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
8144 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
8145 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
8146 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
8148 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
8150 /* don't destroy virtual base here */
8151 TRACE("(%p)\n", this);
8154 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
8155 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
8156 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
8157 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
8159 TRACE("(%p)\n", this);
8160 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
8161 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
8164 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
8165 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
8167 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
8169 TRACE("(%p %x)\n", this, flags);
8171 if(flags & 2) {
8172 /* we have an array, with the number of elements stored before the first object */
8173 INT_PTR i, *ptr = (INT_PTR *)this-1;
8175 for(i=*ptr-1; i>=0; i--)
8176 basic_istream_char_vbase_dtor(this+i);
8177 MSVCRT_operator_delete(ptr);
8178 } else {
8179 basic_istream_char_vbase_dtor(this);
8180 if(flags & 1)
8181 MSVCRT_operator_delete(this);
8184 return this;
8187 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
8188 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
8189 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
8190 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
8192 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8194 TRACE("(%p %d)\n", this, noskip);
8196 if(ios_base_good(&base->base)) {
8197 if(basic_ios_char_tie_get(base))
8198 basic_ostream_char_flush(basic_ios_char_tie_get(base));
8200 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
8201 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8202 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8203 int ch;
8205 for(ch = basic_streambuf_char_sgetc(strbuf); ;
8206 ch = basic_streambuf_char_snextc(strbuf)) {
8207 if(ch == EOF) {
8208 basic_ios_char_setstate(base, IOSTATE_eofbit);
8209 break;
8212 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
8213 break;
8218 if(!ios_base_good(&base->base)) {
8219 basic_ios_char_setstate(base, IOSTATE_failbit);
8220 return FALSE;
8223 return TRUE;
8226 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
8227 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
8228 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
8229 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
8231 return basic_istream_char__Ipfx(this, noskip);
8234 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
8235 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
8236 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
8237 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
8239 TRACE("(%p)\n", this);
8242 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
8244 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
8246 if(basic_ios_char_rdbuf_get(base))
8247 call_basic_streambuf_char__Lock(base->strbuf);
8249 return basic_istream_char_ipfx(istr, noskip);
8252 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
8254 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
8256 if(basic_ios_char_rdbuf_get(base))
8257 call_basic_streambuf_char__Unlock(base->strbuf);
8260 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
8261 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
8262 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
8263 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
8264 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
8265 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
8267 TRACE("(%p)\n", this);
8268 return this->count;
8271 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8272 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8273 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
8274 int __thiscall basic_istream_char_get(basic_istream_char *this)
8276 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8277 int ret;
8279 TRACE("(%p)\n", this);
8281 this->count = 0;
8283 if(!basic_istream_char_sentry_create(this, TRUE)) {
8284 basic_istream_char_sentry_destroy(this);
8285 return EOF;
8288 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
8289 basic_istream_char_sentry_destroy(this);
8290 if(ret == EOF)
8291 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
8292 else
8293 this->count++;
8295 return ret;
8298 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
8299 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
8300 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
8301 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
8303 int ret;
8305 TRACE("(%p %p)\n", this, ch);
8307 ret = basic_istream_char_get(this);
8308 if(ret != EOF)
8309 *ch = (char)ret;
8310 return this;
8313 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8314 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8315 #if STREAMSIZE_BITS == 64
8316 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
8317 #else
8318 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
8319 #endif
8320 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8322 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8323 int ch = delim;
8325 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
8327 this->count = 0;
8329 if(basic_istream_char_sentry_create(this, TRUE)) {
8330 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8332 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
8333 ch = basic_streambuf_char_snextc(strbuf)) {
8334 if(ch==EOF || ch==delim)
8335 break;
8337 *str++ = ch;
8338 this->count++;
8339 count--;
8342 basic_istream_char_sentry_destroy(this);
8344 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8345 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8346 if(count > 0)
8347 *str = 0;
8348 return this;
8351 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8352 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8353 #if STREAMSIZE_BITS == 64
8354 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
8355 #else
8356 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
8357 #endif
8358 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
8360 return basic_istream_char_get_str_delim(this, str, count, '\n');
8363 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8364 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
8365 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
8366 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
8368 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8369 int ch = delim;
8371 TRACE("(%p %p %c)\n", this, strbuf, delim);
8373 this->count = 0;
8375 if(basic_istream_char_sentry_create(this, TRUE)) {
8376 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
8378 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
8379 ch = basic_streambuf_char_snextc(strbuf_read)) {
8380 if(ch==EOF || ch==delim)
8381 break;
8383 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
8384 break;
8385 this->count++;
8388 basic_istream_char_sentry_destroy(this);
8390 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8391 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8392 return this;
8395 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8396 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8397 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
8398 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
8400 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
8403 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8404 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8405 #if STREAMSIZE_BITS == 64
8406 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
8407 #else
8408 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
8409 #endif
8410 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8412 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8413 int ch = (unsigned char)delim;
8415 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
8417 this->count = 0;
8419 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
8420 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8422 while(count > 1) {
8423 ch = basic_streambuf_char_sbumpc(strbuf);
8425 if(ch==EOF || ch==(unsigned char)delim)
8426 break;
8428 *str++ = ch;
8429 this->count++;
8430 count--;
8433 if(ch == (unsigned char)delim)
8434 this->count++;
8435 else if(ch != EOF) {
8436 ch = basic_streambuf_char_sgetc(strbuf);
8438 if(ch == (unsigned char)delim) {
8439 basic_streambuf_char__Gninc(strbuf);
8440 this->count++;
8444 basic_istream_char_sentry_destroy(this);
8446 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8447 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8448 if(count > 0)
8449 *str = 0;
8450 return this;
8453 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8454 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8455 #if STREAMSIZE_BITS == 64
8456 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
8457 #else
8458 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
8459 #endif
8460 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
8462 return basic_istream_char_getline_delim(this, str, count, '\n');
8465 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
8466 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8467 #if STREAMSIZE_BITS == 64
8468 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
8469 #else
8470 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
8471 #endif
8472 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
8474 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8475 int ch = (unsigned char)delim;
8476 unsigned int state;
8478 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8480 this->count = 0;
8482 if(basic_istream_char_sentry_create(this, TRUE)) {
8483 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8484 state = IOSTATE_goodbit;
8486 while(count > 0) {
8487 ch = basic_streambuf_char_sbumpc(strbuf);
8489 if(ch==EOF) {
8490 state = IOSTATE_eofbit;
8491 break;
8494 if(ch==(unsigned char)delim)
8495 break;
8497 this->count++;
8498 if(count != INT_MAX)
8499 count--;
8501 }else
8502 state = IOSTATE_failbit;
8503 basic_istream_char_sentry_destroy(this);
8505 basic_ios_char_setstate(base, state);
8506 return this;
8509 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
8510 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
8511 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
8513 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8514 int ch = '\n';
8516 TRACE("(%p)\n", istream);
8518 if(basic_istream_char_sentry_create(istream, TRUE)) {
8519 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8520 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(strbuf));
8522 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
8523 ch = basic_streambuf_char_snextc(strbuf)) {
8524 if(ch == EOF)
8525 break;
8528 basic_istream_char_sentry_destroy(istream);
8530 if(ch == EOF)
8531 basic_ios_char_setstate(base, IOSTATE_eofbit);
8532 return istream;
8535 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8536 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8537 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
8538 int __thiscall basic_istream_char_peek(basic_istream_char *this)
8540 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8541 int ret = EOF;
8543 TRACE("(%p)\n", this);
8545 this->count = 0;
8547 if(basic_istream_char_sentry_create(this, TRUE))
8548 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8549 basic_istream_char_sentry_destroy(this);
8551 if (ret == EOF)
8552 basic_ios_char_setstate(base, IOSTATE_eofbit);
8554 return ret;
8557 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
8558 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
8559 #if STREAMSIZE_BITS == 64
8560 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
8561 #else
8562 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
8563 #endif
8564 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8566 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8567 IOSB_iostate state = IOSTATE_goodbit;
8569 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8571 if(basic_istream_char_sentry_create(this, TRUE)) {
8572 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8574 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
8575 if(this->count != count)
8576 state |= IOSTATE_failbit | IOSTATE_eofbit;
8577 }else {
8578 this->count = 0;
8580 basic_istream_char_sentry_destroy(this);
8582 basic_ios_char_setstate(base, state);
8583 return this;
8586 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8587 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8588 #if STREAMSIZE_BITS == 64
8589 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
8590 #else
8591 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
8592 #endif
8593 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
8595 return basic_istream_char__Read_s(this, str, -1, count);
8598 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
8599 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
8600 #if STREAMSIZE_BITS == 64
8601 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
8602 #else
8603 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
8604 #endif
8605 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8607 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8608 IOSB_iostate state = IOSTATE_goodbit;
8610 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8612 this->count = 0;
8614 if(basic_istream_char_sentry_create(this, TRUE)) {
8615 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
8616 if(avail > count)
8617 avail = count;
8619 if(avail == -1)
8620 state |= IOSTATE_eofbit;
8621 else if(avail > 0)
8622 basic_istream_char__Read_s(this, str, size, avail);
8623 }else {
8624 state |= IOSTATE_failbit;
8626 basic_istream_char_sentry_destroy(this);
8628 basic_ios_char_setstate(base, state);
8629 return this->count;
8632 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
8633 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
8634 #if STREAMSIZE_BITS == 64
8635 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
8636 #else
8637 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
8638 #endif
8639 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
8641 return basic_istream_char__Readsome_s(this, str, count, count);
8644 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
8645 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
8646 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
8647 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
8649 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8650 IOSB_iostate state = IOSTATE_goodbit;
8652 TRACE("(%p %c)\n", this, ch);
8654 this->count = 0;
8656 if(basic_istream_char_sentry_create(this, TRUE)) {
8657 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8659 if(!ios_base_good(&base->base))
8660 state |= IOSTATE_failbit;
8661 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
8662 state |= IOSTATE_badbit;
8664 basic_istream_char_sentry_destroy(this);
8666 basic_ios_char_setstate(base, state);
8667 return this;
8670 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
8671 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
8672 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
8673 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
8675 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8676 IOSB_iostate state = IOSTATE_goodbit;
8678 TRACE("(%p)\n", this);
8680 this->count = 0;
8682 if(basic_istream_char_sentry_create(this, TRUE)) {
8683 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8685 if(!ios_base_good(&base->base))
8686 state |= IOSTATE_failbit;
8687 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
8688 state |= IOSTATE_badbit;
8690 basic_istream_char_sentry_destroy(this);
8692 basic_ios_char_setstate(base, state);
8693 return this;
8696 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8697 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8698 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
8699 int __thiscall basic_istream_char_sync(basic_istream_char *this)
8701 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8702 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8704 TRACE("(%p)\n", this);
8706 if(!strbuf)
8707 return -1;
8709 if(basic_istream_char_sentry_create(this, TRUE)) {
8710 if(basic_streambuf_char_pubsync(strbuf) != -1) {
8711 basic_istream_char_sentry_destroy(this);
8712 return 0;
8715 basic_istream_char_sentry_destroy(this);
8717 basic_ios_char_setstate(base, IOSTATE_badbit);
8718 return -1;
8721 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8722 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8723 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
8724 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
8726 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8728 TRACE("(%p %p)\n", this, ret);
8730 if(ios_base_fail(&base->base)) {
8731 ret->off = -1;
8732 ret->pos = 0;
8733 ret->state = 0;
8734 return ret;
8737 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8738 ret, 0, SEEKDIR_cur, OPENMODE_in);
8740 if(ret->off==-1 && ret->pos==0 && ret->state==0)
8741 basic_ios_char_setstate(base, IOSTATE_failbit);
8743 return ret;
8746 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
8747 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
8748 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
8749 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8750 #if STREAMOFF_BITS == 64
8751 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
8752 #else
8753 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
8754 #endif
8755 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
8757 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8759 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8761 if(!ios_base_fail(&base->base)) {
8762 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8763 fpos_int ret;
8765 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8767 if(ret.off==-1 && ret.pos==0 && ret.state==0)
8768 basic_ios_char_setstate(base, IOSTATE_failbit);
8769 else
8770 basic_ios_char_clear(base, IOSTATE_goodbit);
8771 return this;
8772 }else
8773 basic_ios_char_clear(base, IOSTATE_goodbit);
8775 return this;
8778 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8779 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8780 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
8781 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
8783 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8785 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
8787 if(!ios_base_fail(&base->base)) {
8788 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8789 fpos_int ret;
8791 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8793 if(ret.off==-1 && ret.pos==0 && ret.state==0)
8794 basic_ios_char_setstate(base, IOSTATE_failbit);
8795 else
8796 basic_ios_char_clear(base, IOSTATE_goodbit);
8797 return this;
8798 }else
8799 basic_ios_char_clear(base, IOSTATE_goodbit);
8801 return this;
8804 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
8805 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
8806 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
8807 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
8809 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8810 int state = IOSTATE_goodbit;
8812 TRACE("(%p %p)\n", this, v);
8814 if(basic_istream_char_sentry_create(this, FALSE)) {
8815 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8816 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8817 istreambuf_iterator_char first={0}, last={0};
8818 LONG tmp;
8820 first.strbuf = strbuf;
8821 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8823 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8824 *v = tmp;
8825 else
8826 state |= IOSTATE_failbit;
8828 basic_istream_char_sentry_destroy(this);
8830 basic_ios_char_setstate(base, state);
8831 return this;
8834 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
8835 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
8836 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
8837 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
8839 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8840 int state = IOSTATE_goodbit;
8842 TRACE("(%p %p)\n", this, v);
8844 if(basic_istream_char_sentry_create(this, FALSE)) {
8845 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8846 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8847 istreambuf_iterator_char first={0}, last={0};
8849 first.strbuf = strbuf;
8850 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
8852 basic_istream_char_sentry_destroy(this);
8854 basic_ios_char_setstate(base, state);
8855 return this;
8858 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
8859 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
8860 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
8861 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
8863 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8864 int state = IOSTATE_goodbit;
8866 TRACE("(%p %p)\n", this, v);
8868 if(basic_istream_char_sentry_create(this, FALSE)) {
8869 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8870 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8871 istreambuf_iterator_char first={0}, last={0};
8873 first.strbuf = strbuf;
8874 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8876 basic_istream_char_sentry_destroy(this);
8878 basic_ios_char_setstate(base, state);
8879 return this;
8882 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
8883 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
8884 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
8885 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
8887 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8888 int state = IOSTATE_goodbit;
8890 TRACE("(%p %p)\n", this, v);
8892 if(basic_istream_char_sentry_create(this, FALSE)) {
8893 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8894 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8895 istreambuf_iterator_char first={0}, last={0};
8897 first.strbuf = strbuf;
8898 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
8900 basic_istream_char_sentry_destroy(this);
8902 basic_ios_char_setstate(base, state);
8903 return this;
8906 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
8907 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
8908 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
8909 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
8911 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8912 int state = IOSTATE_goodbit;
8914 TRACE("(%p %p)\n", this, v);
8916 if(basic_istream_char_sentry_create(this, FALSE)) {
8917 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8918 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8919 istreambuf_iterator_char first={0}, last={0};
8921 first.strbuf = strbuf;
8922 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8924 basic_istream_char_sentry_destroy(this);
8926 basic_ios_char_setstate(base, state);
8927 return this;
8930 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
8931 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
8932 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
8933 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
8935 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8936 int state = IOSTATE_goodbit;
8938 TRACE("(%p %p)\n", this, v);
8940 if(basic_istream_char_sentry_create(this, FALSE)) {
8941 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8942 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8943 istreambuf_iterator_char first={0}, last={0};
8945 first.strbuf = strbuf;
8946 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
8948 basic_istream_char_sentry_destroy(this);
8950 basic_ios_char_setstate(base, state);
8951 return this;
8954 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
8955 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
8956 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
8957 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
8959 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8960 int state = IOSTATE_goodbit;
8962 TRACE("(%p %p)\n", this, v);
8964 if(basic_istream_char_sentry_create(this, FALSE)) {
8965 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8966 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8967 istreambuf_iterator_char first={0}, last={0};
8969 first.strbuf = strbuf;
8970 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
8972 basic_istream_char_sentry_destroy(this);
8974 basic_ios_char_setstate(base, state);
8975 return this;
8978 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
8979 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
8980 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
8981 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
8983 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8984 int state = IOSTATE_goodbit;
8986 TRACE("(%p %p)\n", this, v);
8988 if(basic_istream_char_sentry_create(this, FALSE)) {
8989 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8990 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8991 istreambuf_iterator_char first={0}, last={0};
8993 first.strbuf = strbuf;
8994 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
8996 basic_istream_char_sentry_destroy(this);
8998 basic_ios_char_setstate(base, state);
8999 return this;
9002 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
9003 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
9004 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
9005 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
9007 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9008 int state = IOSTATE_goodbit;
9010 TRACE("(%p %p)\n", this, v);
9012 if(basic_istream_char_sentry_create(this, FALSE)) {
9013 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9014 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9015 istreambuf_iterator_char first={0}, last={0};
9017 first.strbuf = strbuf;
9018 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
9020 basic_istream_char_sentry_destroy(this);
9022 basic_ios_char_setstate(base, state);
9023 return this;
9026 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
9027 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
9028 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
9029 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
9031 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9032 int state = IOSTATE_goodbit;
9034 TRACE("(%p %p)\n", this, v);
9036 if(basic_istream_char_sentry_create(this, FALSE)) {
9037 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9038 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9039 istreambuf_iterator_char first={0}, last={0};
9041 first.strbuf = strbuf;
9042 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
9044 basic_istream_char_sentry_destroy(this);
9046 basic_ios_char_setstate(base, state);
9047 return this;
9050 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
9051 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
9052 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
9053 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
9055 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9056 int state = IOSTATE_goodbit;
9058 TRACE("(%p %p)\n", this, v);
9060 if(basic_istream_char_sentry_create(this, FALSE)) {
9061 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9062 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9063 istreambuf_iterator_char first={0}, last={0};
9065 first.strbuf = strbuf;
9066 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
9068 basic_istream_char_sentry_destroy(this);
9070 basic_ios_char_setstate(base, state);
9071 return this;
9074 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
9075 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
9076 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
9077 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
9079 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9080 int state = IOSTATE_goodbit;
9082 TRACE("(%p %p)\n", this, v);
9084 if(basic_istream_char_sentry_create(this, FALSE)) {
9085 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9086 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9087 istreambuf_iterator_char first={0}, last={0};
9089 first.strbuf = strbuf;
9090 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
9092 basic_istream_char_sentry_destroy(this);
9094 basic_ios_char_setstate(base, state);
9095 return this;
9098 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
9099 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
9100 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
9101 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
9103 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9104 int state = IOSTATE_goodbit;
9106 TRACE("(%p %p)\n", this, v);
9108 if(basic_istream_char_sentry_create(this, FALSE)) {
9109 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9110 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
9111 istreambuf_iterator_char first={0}, last={0};
9113 first.strbuf = strbuf;
9114 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
9116 basic_istream_char_sentry_destroy(this);
9118 basic_ios_char_setstate(base, state);
9119 return this;
9122 /* ??$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 */
9123 /* ??$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 */
9124 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
9125 basic_istream_char *istream, basic_string_char *str, char delim)
9127 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9128 IOSB_iostate state = IOSTATE_goodbit;
9129 int c = (unsigned char)delim;
9131 TRACE("(%p %p %c)\n", istream, str, delim);
9133 if(basic_istream_char_sentry_create(istream, TRUE)) {
9134 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
9135 MSVCP_basic_string_char_clear(str);
9137 c = basic_streambuf_char_sgetc(strbuf);
9138 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
9139 MSVCP_basic_string_char_append_ch(str, c);
9140 if(c==EOF) state |= IOSTATE_eofbit;
9141 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
9143 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
9145 basic_istream_char_sentry_destroy(istream);
9147 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
9148 return istream;
9151 /* ??$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 */
9152 /* ??$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 */
9153 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
9154 basic_istream_char *istream, basic_string_char *str)
9156 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
9159 /* ??$?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 */
9160 /* ??$?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 */
9161 basic_istream_char* __cdecl basic_istream_char_read_bstr(
9162 basic_istream_char *istream, basic_string_char *str)
9164 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9165 IOSB_iostate state = IOSTATE_failbit;
9166 int c = '\n';
9168 TRACE("(%p %p)\n", istream, str);
9170 if(basic_istream_char_sentry_create(istream, FALSE)) {
9171 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
9172 MSVCP_size_t count = ios_base_width_get(&base->base);
9174 if(!count)
9175 count = -1;
9177 MSVCP_basic_string_char_clear(str);
9179 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
9180 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9181 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
9182 state = IOSTATE_goodbit;
9183 MSVCP_basic_string_char_append_ch(str, c);
9186 basic_istream_char_sentry_destroy(istream);
9188 ios_base_width_set(&base->base, 0);
9189 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9190 return istream;
9193 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
9194 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
9195 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
9196 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
9197 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
9198 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
9199 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
9201 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
9202 IOSB_iostate state = IOSTATE_failbit;
9203 int c = '\n';
9205 TRACE("(%p %p)\n", istream, str);
9207 if(basic_istream_char_sentry_create(istream, FALSE)) {
9208 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
9209 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
9211 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
9212 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
9213 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
9214 state = IOSTATE_goodbit;
9215 *str++ = c;
9218 basic_istream_char_sentry_destroy(istream);
9220 *str = 0;
9221 ios_base_width_set(&base->base, 0);
9222 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9223 return istream;
9226 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
9227 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
9228 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
9229 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
9230 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
9231 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
9232 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
9234 IOSB_iostate state = IOSTATE_failbit;
9235 int c = 0;
9237 TRACE("(%p %p)\n", istream, ch);
9239 if(basic_istream_char_sentry_create(istream, FALSE)) {
9240 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
9241 basic_istream_char_get_basic_ios(istream)));
9242 if(c != EOF) {
9243 state = IOSTATE_goodbit;
9244 *ch = c;
9247 basic_istream_char_sentry_destroy(istream);
9249 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
9250 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9251 return istream;
9254 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9255 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
9256 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
9257 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
9258 basic_istream_char *this, basic_streambuf_char *streambuf)
9260 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9261 IOSB_iostate state = IOSTATE_failbit;
9262 int c = '\n';
9264 TRACE("(%p %p)\n", this, streambuf);
9266 if(basic_istream_char_sentry_create(this, FALSE)) {
9267 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
9268 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
9269 state = IOSTATE_goodbit;
9270 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
9271 break;
9274 basic_istream_char_sentry_destroy(this);
9276 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9277 return this;
9280 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
9281 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
9282 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
9283 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
9284 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
9286 TRACE("(%p %p)\n", this, pfunc);
9287 pfunc(this);
9288 return this;
9291 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
9292 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
9293 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
9294 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
9295 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
9297 TRACE("(%p %p)\n", this, pfunc);
9298 pfunc(basic_istream_char_get_basic_ios(this));
9299 return this;
9302 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
9303 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
9304 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
9305 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
9306 ios_base* (__cdecl *pfunc)(ios_base*))
9308 TRACE("(%p %p)\n", this, pfunc);
9309 pfunc(&basic_istream_char_get_basic_ios(this)->base);
9310 return this;
9313 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@M@0@@Z */
9314 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@M@0@@Z */
9315 basic_istream_char* __cdecl basic_istream_char_read_complex_float(basic_istream_char *this, complex_float *v)
9317 float r;
9318 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9320 TRACE("(%p %p)\n", this, v);
9322 ws_basic_istream_char(this);
9323 if(basic_istream_char_peek(this) == '(') {
9324 char c;
9325 basic_istream_char_get(this);
9326 basic_istream_char_read_float(this, &r);
9328 if(ios_base_fail(&base->base))
9329 return this;
9331 ws_basic_istream_char(this);
9332 c = basic_istream_char_peek(this);
9333 if(c == ',') {
9334 float i;
9335 basic_istream_char_get(this);
9336 basic_istream_char_read_float(this, &i);
9338 if(ios_base_fail(&base->base))
9339 return this;
9341 ws_basic_istream_char(this);
9342 c = basic_istream_char_peek(this);
9343 if(c == ')') { /* supported format: (real, imag) */
9344 basic_istream_char_get(this);
9345 v->real = r;
9346 v->imag = i;
9347 }else {
9348 basic_ios_char_setstate(base, IOSTATE_failbit);
9349 return this;
9351 }else if(c == ')') { /* supported format: (real) */
9352 basic_istream_char_get(this);
9353 v->real = r;
9354 v->imag = 0;
9355 }else {
9356 basic_ios_char_setstate(base, IOSTATE_failbit);
9357 return this;
9359 }else { /* supported format: real */
9360 basic_istream_char_read_float(this, &r);
9362 if(ios_base_fail(&base->base))
9363 return this;
9365 v->real = r;
9366 v->imag = 0;
9369 return this;
9372 /* ??$?5NDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@N@0@@Z */
9373 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@N@0@@Z */
9374 basic_istream_char* __cdecl basic_istream_char_read_complex_double(basic_istream_char *this, complex_double *v)
9376 double r;
9377 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9379 TRACE("(%p %p)\n", this, v);
9381 ws_basic_istream_char(this);
9382 if(basic_istream_char_peek(this) == '(') {
9383 char c;
9384 basic_istream_char_get(this);
9385 basic_istream_char_read_double(this, &r);
9387 if(ios_base_fail(&base->base))
9388 return this;
9390 ws_basic_istream_char(this);
9391 c = basic_istream_char_peek(this);
9392 if(c == ',') {
9393 double i;
9394 basic_istream_char_get(this);
9395 basic_istream_char_read_double(this, &i);
9397 if(ios_base_fail(&base->base))
9398 return this;
9400 ws_basic_istream_char(this);
9401 c = basic_istream_char_peek(this);
9402 if(c == ')') { /* supported format: (real, imag) */
9403 basic_istream_char_get(this);
9404 v->real = r;
9405 v->imag = i;
9406 }else {
9407 basic_ios_char_setstate(base, IOSTATE_failbit);
9408 return this;
9410 }else if(c == ')') { /* supported format: (real) */
9411 basic_istream_char_get(this);
9412 v->real = r;
9413 v->imag = 0;
9414 }else {
9415 basic_ios_char_setstate(base, IOSTATE_failbit);
9416 return this;
9418 }else { /* supported format: real */
9419 basic_istream_char_read_double(this, &r);
9421 if(ios_base_fail(&base->base))
9422 return this;
9424 v->real = r;
9425 v->imag = 0;
9428 return this;
9431 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@O@0@@Z */
9432 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@O@0@@Z */
9433 basic_istream_char* __cdecl basic_istream_char_read_complex_ldouble(basic_istream_char *this, complex_double *v)
9435 double r;
9436 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9438 TRACE("(%p %p)\n", this, v);
9440 ws_basic_istream_char(this);
9441 if(basic_istream_char_peek(this) == '(') {
9442 char c;
9443 basic_istream_char_get(this);
9444 basic_istream_char_read_ldouble(this, &r);
9446 if(ios_base_fail(&base->base))
9447 return this;
9449 ws_basic_istream_char(this);
9450 c = basic_istream_char_peek(this);
9451 if(c == ',') {
9452 double i;
9453 basic_istream_char_get(this);
9454 basic_istream_char_read_ldouble(this, &i);
9456 if(ios_base_fail(&base->base))
9457 return this;
9459 ws_basic_istream_char(this);
9460 c = basic_istream_char_peek(this);
9461 if(c == ')') { /* supported format: (real, imag) */
9462 basic_istream_char_get(this);
9463 v->real = r;
9464 v->imag = i;
9465 }else {
9466 basic_ios_char_setstate(base, IOSTATE_failbit);
9467 return this;
9469 }else if(c == ')') { /* supported format: (real) */
9470 basic_istream_char_get(this);
9471 v->real = r;
9472 v->imag = 0;
9473 }else {
9474 basic_ios_char_setstate(base, IOSTATE_failbit);
9475 return this;
9477 }else { /* supported format: real */
9478 basic_istream_char_read_ldouble(this, &r);
9480 if(ios_base_fail(&base->base))
9481 return this;
9483 v->real = r;
9484 v->imag = 0;
9487 return this;
9490 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
9491 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
9492 DEFINE_THISCALL_WRAPPER(basic_istream_char_swap, 8)
9493 void __thiscall basic_istream_char_swap(basic_istream_char *this, basic_istream_char *r)
9495 TRACE("(%p %p)\n", this, r);
9497 if(this == r)
9498 return;
9500 basic_ios_char_swap(basic_istream_char_get_basic_ios(this),
9501 basic_istream_char_get_basic_ios(r));
9502 this->count ^= r->count;
9503 r->count ^= this->count;
9504 this->count ^= r->count;
9507 /* Caution: basic_istream uses virtual inheritance. */
9508 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
9510 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
9513 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
9515 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
9518 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9520 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
9523 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9524 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9525 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
9526 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
9527 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9529 basic_ios_wchar *base;
9531 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
9533 if(virt_init) {
9534 this->vbtable = basic_istream_wchar_vbtable;
9535 base = basic_istream_wchar_get_basic_ios(this);
9536 INIT_BASIC_IOS_VTORDISP(base);
9537 basic_ios_wchar_ctor(base);
9538 }else {
9539 base = basic_istream_wchar_get_basic_ios(this);
9542 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9543 this->count = 0;
9544 if(!noinit)
9545 basic_ios_wchar_init(base, strbuf, isstd);
9546 return this;
9549 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9550 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9551 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
9552 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
9553 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9555 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
9556 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9557 return this;
9560 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9561 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9562 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
9563 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
9564 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9566 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9569 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9570 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9571 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
9572 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
9573 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9575 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9578 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9579 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9580 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
9581 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
9582 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9584 basic_ios_wchar *base;
9586 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
9588 if(virt_init) {
9589 this->vbtable = basic_istream_wchar_vbtable;
9590 base = basic_istream_wchar_get_basic_ios(this);
9591 INIT_BASIC_IOS_VTORDISP(base);
9592 basic_ios_wchar_ctor(base);
9593 }else {
9594 base = basic_istream_wchar_get_basic_ios(this);
9597 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9598 ios_base_Addstd(&base->base);
9599 return this;
9602 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9603 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9604 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
9605 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
9606 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9608 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
9609 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9610 return this;
9613 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9614 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9615 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9616 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9617 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
9618 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
9620 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9622 /* don't destroy virtual base here */
9623 TRACE("(%p)\n", this);
9626 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9627 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9628 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9629 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9630 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
9631 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
9633 TRACE("(%p)\n", this);
9634 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
9635 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
9638 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
9639 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9641 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9643 TRACE("(%p %x)\n", this, flags);
9645 if(flags & 2) {
9646 /* we have an array, with the number of elements stored before the first object */
9647 INT_PTR i, *ptr = (INT_PTR *)this-1;
9649 for(i=*ptr-1; i>=0; i--)
9650 basic_istream_wchar_vbase_dtor(this+i);
9651 MSVCRT_operator_delete(ptr);
9652 } else {
9653 basic_istream_wchar_vbase_dtor(this);
9654 if(flags & 1)
9655 MSVCRT_operator_delete(this);
9658 return this;
9661 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9662 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9663 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9664 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9665 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
9666 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9668 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9670 TRACE("(%p %d)\n", this, noskip);
9672 if(ios_base_good(&base->base)) {
9673 if(basic_ios_wchar_tie_get(base))
9674 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
9676 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
9677 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9678 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(base->strbuf));
9679 int ch;
9681 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
9682 ch = basic_streambuf_wchar_snextc(strbuf)) {
9683 if(ch == WEOF) {
9684 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9685 break;
9688 if(!ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
9689 break;
9694 if(!ios_base_good(&base->base)) {
9695 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9696 return FALSE;
9698 return TRUE;
9701 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9702 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9703 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9704 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9705 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
9706 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9708 return basic_istream_wchar__Ipfx(this, noskip);
9711 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9712 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9713 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9714 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9715 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
9716 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
9718 TRACE("(%p)\n", this);
9721 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
9723 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9725 if(basic_ios_wchar_rdbuf_get(base))
9726 basic_streambuf_wchar__Lock(base->strbuf);
9728 return basic_istream_wchar_ipfx(istr, noskip);
9731 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
9733 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9735 if(basic_ios_wchar_rdbuf_get(base))
9736 basic_streambuf_wchar__Unlock(base->strbuf);
9739 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
9740 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
9741 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
9742 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
9743 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
9744 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
9745 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
9746 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
9747 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
9748 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
9750 TRACE("(%p)\n", this);
9751 return this->count;
9754 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9755 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9756 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9757 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9758 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
9759 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
9761 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9762 int ret;
9764 TRACE("(%p)\n", this);
9766 this->count = 0;
9768 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
9769 basic_istream_wchar_sentry_destroy(this);
9770 return WEOF;
9773 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
9774 basic_istream_wchar_sentry_destroy(this);
9775 if(ret == WEOF)
9776 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
9777 else
9778 this->count++;
9780 return ret;
9783 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
9784 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
9785 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
9786 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
9787 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
9788 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
9790 unsigned short ret;
9792 TRACE("(%p %p)\n", this, ch);
9794 ret = basic_istream_wchar_get(this);
9795 if(ret != WEOF)
9796 *ch = (wchar_t)ret;
9797 return this;
9800 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9801 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9802 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9803 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9804 #if STREAMSIZE_BITS == 64
9805 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
9806 #else
9807 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
9808 #endif
9809 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9811 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9812 unsigned short ch = delim;
9814 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
9816 this->count = 0;
9818 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9819 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9821 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
9822 ch = basic_streambuf_wchar_snextc(strbuf)) {
9823 if(ch==WEOF || ch==delim)
9824 break;
9826 *str++ = ch;
9827 this->count++;
9828 count--;
9831 basic_istream_wchar_sentry_destroy(this);
9833 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9834 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9835 if(count > 0)
9836 *str = 0;
9837 return this;
9840 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9841 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9842 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9843 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9844 #if STREAMSIZE_BITS == 64
9845 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
9846 #else
9847 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
9848 #endif
9849 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
9851 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
9854 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9855 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9856 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9857 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9858 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
9859 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
9861 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9862 unsigned short ch = delim;
9864 TRACE("(%p %p %c)\n", this, strbuf, delim);
9866 this->count = 0;
9868 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9869 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
9871 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
9872 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
9873 if(ch==WEOF || ch==delim)
9874 break;
9876 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
9877 break;
9878 this->count++;
9881 basic_istream_wchar_sentry_destroy(this);
9883 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9884 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9885 return this;
9888 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9889 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9890 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9891 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9892 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
9893 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
9895 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
9898 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9899 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9900 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9901 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9902 #if STREAMSIZE_BITS == 64
9903 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
9904 #else
9905 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
9906 #endif
9907 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9909 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9910 unsigned short ch = delim;
9912 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
9914 this->count = 0;
9916 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
9917 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9919 while(count > 1) {
9920 ch = basic_streambuf_wchar_sbumpc(strbuf);
9922 if(ch==WEOF || ch==delim)
9923 break;
9925 *str++ = ch;
9926 this->count++;
9927 count--;
9930 if(ch == delim)
9931 this->count++;
9932 else if(ch != WEOF) {
9933 ch = basic_streambuf_wchar_sgetc(strbuf);
9935 if(ch == delim) {
9936 basic_streambuf_wchar__Gninc(strbuf);
9937 this->count++;
9941 basic_istream_wchar_sentry_destroy(this);
9943 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
9944 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
9945 if(count > 0)
9946 *str = 0;
9947 return this;
9950 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9951 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9952 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9953 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9954 #if STREAMSIZE_BITS == 64
9955 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
9956 #else
9957 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
9958 #endif
9959 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
9961 return basic_istream_wchar_getline_delim(this, str, count, '\n');
9964 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
9965 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
9966 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
9967 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
9968 #if STREAMSIZE_BITS == 64
9969 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
9970 #else
9971 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
9972 #endif
9973 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
9975 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9976 unsigned short ch = delim;
9977 unsigned int state;
9979 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
9981 this->count = 0;
9983 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9984 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9985 state = IOSTATE_goodbit;
9987 while(count > 0) {
9988 ch = basic_streambuf_wchar_sbumpc(strbuf);
9990 if(ch==WEOF) {
9991 state = IOSTATE_eofbit;
9992 break;
9995 if(ch==delim)
9996 break;
9998 this->count++;
9999 if(count != INT_MAX)
10000 count--;
10002 }else
10003 state = IOSTATE_failbit;
10004 basic_istream_wchar_sentry_destroy(this);
10006 basic_ios_wchar_setstate(base, state);
10007 return this;
10010 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
10011 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
10012 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
10013 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
10014 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
10016 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10017 unsigned short ch = '\n';
10019 TRACE("(%p)\n", istream);
10021 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10022 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10023 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(strbuf));
10025 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
10026 ch = basic_streambuf_wchar_snextc(strbuf)) {
10027 if(ch == WEOF)
10028 break;
10031 basic_istream_wchar_sentry_destroy(istream);
10033 if(ch == WEOF)
10034 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
10035 return istream;
10038 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
10039 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
10040 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
10041 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
10042 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
10043 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
10045 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10046 unsigned short ret = WEOF;
10048 TRACE("(%p)\n", this);
10050 this->count = 0;
10052 if(basic_istream_wchar_sentry_create(this, TRUE))
10053 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10054 basic_istream_wchar_sentry_destroy(this);
10056 if (ret == WEOF)
10057 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
10059 return ret;
10062 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
10063 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
10064 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
10065 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
10066 #if STREAMSIZE_BITS == 64
10067 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
10068 #else
10069 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
10070 #endif
10071 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
10073 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10074 IOSB_iostate state = IOSTATE_goodbit;
10076 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
10078 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10079 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10081 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
10082 if(this->count != count)
10083 state |= IOSTATE_failbit | IOSTATE_eofbit;
10084 }else {
10085 this->count = 0;
10087 basic_istream_wchar_sentry_destroy(this);
10089 basic_ios_wchar_setstate(base, state);
10090 return this;
10093 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
10094 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
10095 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
10096 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
10097 #if STREAMSIZE_BITS == 64
10098 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
10099 #else
10100 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
10101 #endif
10102 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
10104 return basic_istream_wchar__Read_s(this, str, -1, count);
10107 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
10108 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
10109 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
10110 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
10111 #if STREAMSIZE_BITS == 64
10112 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
10113 #else
10114 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
10115 #endif
10116 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
10118 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10119 IOSB_iostate state = IOSTATE_goodbit;
10121 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
10123 this->count = 0;
10125 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10126 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
10127 if(avail > count)
10128 avail = count;
10130 if(avail == -1)
10131 state |= IOSTATE_eofbit;
10132 else if(avail > 0)
10133 basic_istream_wchar__Read_s(this, str, size, avail);
10134 }else {
10135 state |= IOSTATE_failbit;
10137 basic_istream_wchar_sentry_destroy(this);
10139 basic_ios_wchar_setstate(base, state);
10140 return this->count;
10143 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
10144 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
10145 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
10146 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
10147 #if STREAMSIZE_BITS == 64
10148 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
10149 #else
10150 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
10151 #endif
10152 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
10154 return basic_istream_wchar__Readsome_s(this, str, count, count);
10157 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
10158 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
10159 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
10160 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
10161 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
10162 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
10164 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10165 IOSB_iostate state = IOSTATE_goodbit;
10167 TRACE("(%p %c)\n", this, ch);
10169 this->count = 0;
10171 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10172 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10174 if(!ios_base_good(&base->base))
10175 state |= IOSTATE_failbit;
10176 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
10177 state |= IOSTATE_badbit;
10179 basic_istream_wchar_sentry_destroy(this);
10181 basic_ios_wchar_setstate(base, state);
10182 return this;
10185 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
10186 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
10187 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
10188 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
10189 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
10190 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
10192 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10193 IOSB_iostate state = IOSTATE_goodbit;
10195 TRACE("(%p)\n", this);
10197 this->count = 0;
10199 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10200 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10202 if(!ios_base_good(&base->base))
10203 state |= IOSTATE_failbit;
10204 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
10205 state |= IOSTATE_badbit;
10207 basic_istream_wchar_sentry_destroy(this);
10209 basic_ios_wchar_setstate(base, state);
10210 return this;
10213 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
10214 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
10215 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
10216 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
10217 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
10218 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
10220 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10221 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10223 TRACE("(%p)\n", this);
10225 if(!strbuf)
10226 return -1;
10228 if(basic_istream_wchar_sentry_create(this, TRUE)) {
10229 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
10230 basic_istream_wchar_sentry_destroy(this);
10231 return 0;
10234 basic_istream_wchar_sentry_destroy(this);
10236 basic_ios_wchar_setstate(base, IOSTATE_badbit);
10237 return -1;
10240 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
10241 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
10242 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
10243 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
10244 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
10245 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
10247 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10249 TRACE("(%p %p)\n", this, ret);
10251 if(ios_base_fail(&base->base)) {
10252 ret->off = -1;
10253 ret->pos = 0;
10254 ret->state = 0;
10255 return ret;
10258 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
10259 ret, 0, SEEKDIR_cur, OPENMODE_in);
10260 if(ret->off==-1 && ret->pos==0 && ret->state==0)
10261 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10263 return ret;
10266 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
10267 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
10268 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
10269 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
10270 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
10271 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
10272 #if STREAMOFF_BITS == 64
10273 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
10274 #else
10275 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
10276 #endif
10277 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
10279 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10281 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
10283 if(!ios_base_fail(&base->base)) {
10284 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10285 fpos_int ret;
10287 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
10289 if(ret.off==-1 && ret.pos==0 && ret.state==0)
10290 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10291 else
10292 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10293 return this;
10294 }else
10295 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10297 return this;
10300 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
10301 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
10302 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
10303 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
10304 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
10305 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
10307 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10309 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
10311 if(!ios_base_fail(&base->base)) {
10312 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10313 fpos_int ret;
10315 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
10317 if(ret.off==-1 && ret.pos==0 && ret.state==0)
10318 basic_ios_wchar_setstate(base, IOSTATE_failbit);
10319 else
10320 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10321 return this;
10322 }else
10323 basic_ios_wchar_clear(base, IOSTATE_goodbit);
10325 return this;
10328 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
10330 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10331 int state = IOSTATE_goodbit;
10333 TRACE("(%p %p)\n", this, v);
10335 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10336 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10337 istreambuf_iterator_wchar first={0}, last={0};
10338 LONG tmp;
10340 first.strbuf = strbuf;
10341 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
10343 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
10344 *v = tmp;
10345 else
10346 state |= IOSTATE_failbit;
10348 basic_istream_wchar_sentry_destroy(this);
10350 basic_ios_wchar_setstate(base, state);
10351 return this;
10354 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
10355 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
10356 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
10357 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
10359 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
10360 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10363 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
10364 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
10365 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
10366 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
10368 return basic_istream_read_short(this, v, num_get_short_use_facet(
10369 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10372 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
10373 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
10374 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
10375 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
10377 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10378 int state = IOSTATE_goodbit;
10380 TRACE("(%p %p)\n", this, v);
10382 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10383 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10384 const num_get *numget = num_get_wchar_use_facet(IOS_LOCALE(strbuf));
10385 istreambuf_iterator_wchar first={0}, last={0};
10387 first.strbuf = strbuf;
10388 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
10390 basic_istream_wchar_sentry_destroy(this);
10392 basic_ios_wchar_setstate(base, state);
10393 return this;
10396 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
10398 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10399 int state = IOSTATE_goodbit;
10401 TRACE("(%p %p)\n", this, v);
10403 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10404 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10405 istreambuf_iterator_wchar first={0}, last={0};
10407 first.strbuf = strbuf;
10408 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10410 basic_istream_wchar_sentry_destroy(this);
10412 basic_ios_wchar_setstate(base, state);
10413 return this;
10416 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAH@Z */
10417 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
10418 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
10419 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
10421 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
10422 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10425 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
10426 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
10427 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
10428 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
10430 return basic_istream_read_int(this, v, num_get_short_use_facet(
10431 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10434 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
10436 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10437 int state = IOSTATE_goodbit;
10439 TRACE("(%p %p)\n", this, v);
10441 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10442 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10443 istreambuf_iterator_wchar first={0}, last={0};
10445 first.strbuf = strbuf;
10446 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
10448 basic_istream_wchar_sentry_destroy(this);
10450 basic_ios_wchar_setstate(base, state);
10451 return this;
10454 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
10455 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
10456 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
10457 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
10459 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
10460 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10463 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
10464 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
10465 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
10466 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
10468 return basic_istream_read_uint(this, v, num_get_short_use_facet(
10469 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10472 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
10474 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10475 int state = IOSTATE_goodbit;
10477 TRACE("(%p %p)\n", this, v);
10479 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10480 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10481 istreambuf_iterator_wchar first={0}, last={0};
10483 first.strbuf = strbuf;
10484 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10486 basic_istream_wchar_sentry_destroy(this);
10488 basic_ios_wchar_setstate(base, state);
10489 return this;
10492 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10493 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10494 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
10495 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
10497 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
10498 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10501 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10502 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10503 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
10504 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
10506 return basic_istream_read_long(this, v, num_get_short_use_facet(
10507 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10510 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
10512 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10513 int state = IOSTATE_goodbit;
10515 TRACE("(%p %p)\n", this, v);
10517 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10518 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10519 istreambuf_iterator_wchar first={0}, last={0};
10521 first.strbuf = strbuf;
10522 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
10524 basic_istream_wchar_sentry_destroy(this);
10526 basic_ios_wchar_setstate(base, state);
10527 return this;
10530 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
10531 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
10532 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
10533 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
10535 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
10536 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10539 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
10540 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
10541 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
10542 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
10544 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
10545 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10548 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
10550 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10551 int state = IOSTATE_goodbit;
10553 TRACE("(%p %p)\n", this, v);
10555 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10556 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10557 istreambuf_iterator_wchar first={0}, last={0};
10559 first.strbuf = strbuf;
10560 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
10562 basic_istream_wchar_sentry_destroy(this);
10564 basic_ios_wchar_setstate(base, state);
10565 return this;
10568 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
10569 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
10570 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
10571 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
10573 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
10574 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10577 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
10578 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
10579 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
10580 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
10582 return basic_istream_read_float(this, v, num_get_short_use_facet(
10583 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10586 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
10588 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10589 int state = IOSTATE_goodbit;
10591 TRACE("(%p %p)\n", this, v);
10593 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10594 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10595 istreambuf_iterator_wchar first={0}, last={0};
10597 first.strbuf = strbuf;
10598 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
10600 basic_istream_wchar_sentry_destroy(this);
10602 basic_ios_wchar_setstate(base, state);
10603 return this;
10606 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
10607 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
10608 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
10609 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
10611 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
10612 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10615 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
10616 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
10617 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
10618 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
10620 return basic_istream_read_double(this, v, num_get_short_use_facet(
10621 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10624 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
10626 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10627 int state = IOSTATE_goodbit;
10629 TRACE("(%p %p)\n", this, v);
10631 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10632 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10633 istreambuf_iterator_wchar first={0}, last={0};
10635 first.strbuf = strbuf;
10636 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
10638 basic_istream_wchar_sentry_destroy(this);
10640 basic_ios_wchar_setstate(base, state);
10641 return this;
10644 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
10645 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
10646 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
10647 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
10649 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
10650 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10653 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
10654 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
10655 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
10656 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
10658 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
10659 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10662 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
10664 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10665 int state = IOSTATE_goodbit;
10667 TRACE("(%p %p)\n", this, v);
10669 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10670 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10671 istreambuf_iterator_wchar first={0}, last={0};
10673 first.strbuf = strbuf;
10674 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
10676 basic_istream_wchar_sentry_destroy(this);
10678 basic_ios_wchar_setstate(base, state);
10679 return this;
10682 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
10683 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10684 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
10685 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
10687 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
10688 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10691 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
10692 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10693 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
10694 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
10696 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
10697 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10700 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
10702 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10703 int state = IOSTATE_goodbit;
10705 TRACE("(%p %p)\n", this, v);
10707 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10708 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10709 istreambuf_iterator_wchar first={0}, last={0};
10711 first.strbuf = strbuf;
10712 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
10714 basic_istream_wchar_sentry_destroy(this);
10716 basic_ios_wchar_setstate(base, state);
10717 return this;
10720 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
10721 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
10722 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
10723 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
10725 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
10726 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10729 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
10730 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
10731 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
10732 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
10734 return basic_istream_read_int64(this, v, num_get_short_use_facet(
10735 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10738 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
10740 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10741 int state = IOSTATE_goodbit;
10743 TRACE("(%p %p)\n", this, v);
10745 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10746 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10747 istreambuf_iterator_wchar first={0}, last={0};
10749 first.strbuf = strbuf;
10750 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
10752 basic_istream_wchar_sentry_destroy(this);
10754 basic_ios_wchar_setstate(base, state);
10755 return this;
10758 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
10759 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
10760 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
10761 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10763 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
10764 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10767 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
10768 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
10769 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
10770 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10772 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
10773 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10776 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
10778 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10779 int state = IOSTATE_goodbit;
10781 TRACE("(%p %p)\n", this, v);
10783 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10784 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10785 istreambuf_iterator_wchar first={0}, last={0};
10787 first.strbuf = strbuf;
10788 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
10790 basic_istream_wchar_sentry_destroy(this);
10792 basic_ios_wchar_setstate(base, state);
10793 return this;
10796 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
10797 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
10798 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
10799 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10801 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
10802 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10805 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
10806 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
10807 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
10808 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10810 return basic_istream_read_bool(this, v, num_get_short_use_facet(
10811 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10814 /* ??$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 */
10815 /* ??$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 */
10816 /* ??$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 */
10817 /* ??$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 */
10818 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
10819 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
10821 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10822 IOSB_iostate state = IOSTATE_goodbit;
10823 int c = delim;
10825 TRACE("(%p %p %c)\n", istream, str, delim);
10827 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10828 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10829 MSVCP_basic_string_wchar_clear(str);
10831 c = basic_streambuf_wchar_sgetc(strbuf);
10832 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
10833 MSVCP_basic_string_wchar_append_ch(str, c);
10834 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
10835 else if(c==WEOF) state |= IOSTATE_eofbit;
10837 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
10839 basic_istream_wchar_sentry_destroy(istream);
10841 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
10842 return istream;
10845 /* ??$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 */
10846 /* ??$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 */
10847 /* ??$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 */
10848 /* ??$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 */
10849 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
10850 basic_istream_wchar *istream, basic_string_wchar *str)
10852 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
10855 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
10856 basic_string_wchar *str, const ctype_wchar *ctype)
10858 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10859 IOSB_iostate state = IOSTATE_failbit;
10860 int c = '\n';
10862 TRACE("(%p %p)\n", istream, str);
10864 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10865 MSVCP_size_t count = ios_base_width_get(&base->base);
10867 if(!count)
10868 count = -1;
10870 MSVCP_basic_string_wchar_clear(str);
10872 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10873 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10874 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10875 state = IOSTATE_goodbit;
10876 MSVCP_basic_string_wchar_append_ch(str, c);
10879 basic_istream_wchar_sentry_destroy(istream);
10881 ios_base_width_set(&base->base, 0);
10882 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10883 return istream;
10886 /* ??$?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 */
10887 /* ??$?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 */
10888 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
10889 basic_istream_wchar *istream, basic_string_wchar *str)
10891 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
10892 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10895 /* ??$?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 */
10896 /* ??$?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 */
10897 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
10898 basic_istream_wchar *istream, basic_string_wchar *str)
10900 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
10901 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10904 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
10906 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10907 IOSB_iostate state = IOSTATE_failbit;
10908 unsigned short c = '\n';
10910 TRACE("(%p %p)\n", istream, str);
10912 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10913 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
10915 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10916 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10917 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10918 state = IOSTATE_goodbit;
10919 *str++ = c;
10922 basic_istream_wchar_sentry_destroy(istream);
10924 *str = 0;
10925 ios_base_width_set(&base->base, 0);
10926 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10927 return istream;
10930 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
10931 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
10932 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
10934 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
10935 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10938 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
10939 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
10940 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
10942 return basic_istream_read_str(istream, str, ctype_short_use_facet(
10943 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10946 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
10947 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
10948 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
10949 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
10950 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
10952 IOSB_iostate state = IOSTATE_failbit;
10953 unsigned short c = 0;
10955 TRACE("(%p %p)\n", istream, ch);
10957 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10958 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
10959 basic_istream_wchar_get_basic_ios(istream)));
10960 if(c != WEOF) {
10961 state = IOSTATE_goodbit;
10962 *ch = c;
10965 basic_istream_wchar_sentry_destroy(istream);
10967 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
10968 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10969 return istream;
10972 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10973 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10974 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10975 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10976 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
10977 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
10978 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
10980 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10981 IOSB_iostate state = IOSTATE_failbit;
10982 unsigned short c = '\n';
10984 TRACE("(%p %p)\n", this, streambuf);
10986 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10987 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
10988 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
10989 state = IOSTATE_goodbit;
10990 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
10991 break;
10994 basic_istream_wchar_sentry_destroy(this);
10996 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10997 return this;
11000 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
11001 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
11002 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
11003 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
11004 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
11005 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
11006 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
11008 TRACE("(%p %p)\n", this, pfunc);
11009 pfunc(this);
11010 return this;
11013 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
11014 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
11015 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
11016 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
11017 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
11018 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
11019 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
11021 TRACE("(%p %p)\n", this, pfunc);
11022 pfunc(basic_istream_wchar_get_basic_ios(this));
11023 return this;
11026 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
11027 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
11028 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
11029 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
11030 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
11031 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
11032 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
11034 TRACE("(%p %p)\n", this, pfunc);
11035 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
11036 return this;
11039 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
11040 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
11041 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
11042 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
11043 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_swap, 8)
11044 void __thiscall basic_istream_wchar_swap(basic_istream_wchar *this, basic_istream_wchar *r)
11046 TRACE("(%p %p)\n", this, r);
11048 if(this == r)
11049 return;
11051 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(this),
11052 basic_istream_wchar_get_basic_ios(r));
11053 this->count ^= r->count;
11054 r->count ^= this->count;
11055 this->count ^= r->count;
11058 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
11060 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
11063 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
11065 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
11068 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
11069 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
11070 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
11071 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
11073 basic_ios_char *basic_ios;
11075 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
11077 if(virt_init) {
11078 this->base1.vbtable = basic_iostream_char_vbtable1;
11079 this->base2.vbtable = basic_iostream_char_vbtable2;
11080 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
11081 INIT_BASIC_IOS_VTORDISP(basic_ios);
11082 basic_ios_char_ctor(basic_ios);
11083 }else {
11084 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
11087 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
11089 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
11090 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
11091 return this;
11094 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11095 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11096 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
11097 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
11099 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
11101 TRACE("(%p)\n", this);
11102 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
11103 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
11106 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11107 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11108 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
11109 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
11111 TRACE("(%p)\n", this);
11112 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
11113 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
11116 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
11117 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11119 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
11121 TRACE("(%p %x)\n", this, flags);
11123 if(flags & 2) {
11124 /* we have an array, with the number of elements stored before the first object */
11125 INT_PTR i, *ptr = (INT_PTR *)this-1;
11127 for(i=*ptr-1; i>=0; i--)
11128 basic_iostream_char_vbase_dtor(this+i);
11129 MSVCRT_operator_delete(ptr);
11130 } else {
11131 basic_iostream_char_vbase_dtor(this);
11132 if(flags & 1)
11133 MSVCRT_operator_delete(this);
11136 return this;
11139 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
11140 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
11141 DEFINE_THISCALL_WRAPPER(basic_iostream_char_swap, 8)
11142 void __thiscall basic_iostream_char_swap(basic_iostream_char *this, basic_iostream_char *r)
11144 TRACE("(%p %p)\n", this, r);
11146 if(this == r)
11147 return;
11149 basic_ios_char_swap(basic_istream_char_get_basic_ios(&this->base1),
11150 basic_istream_char_get_basic_ios(&r->base1));
11153 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
11155 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
11158 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11160 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
11163 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11164 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
11165 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
11166 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
11167 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
11169 basic_ios_wchar *basic_ios;
11171 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
11173 if(virt_init) {
11174 this->base1.vbtable = basic_iostream_wchar_vbtable1;
11175 this->base2.vbtable = basic_iostream_wchar_vbtable2;
11176 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
11177 INIT_BASIC_IOS_VTORDISP(basic_ios);
11178 basic_ios_wchar_ctor(basic_ios);
11179 }else {
11180 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
11183 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
11184 basic_ostream_wchar_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
11186 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
11187 return this;
11190 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11191 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
11192 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
11193 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
11194 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
11196 basic_iostream_wchar_ctor(this, strbuf, virt_init);
11197 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
11198 return this;
11201 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11202 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11203 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11204 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11205 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
11206 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
11208 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
11210 TRACE("(%p)\n", this);
11211 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
11212 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
11215 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11216 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11217 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11218 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11219 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
11220 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
11222 TRACE("(%p)\n", this);
11223 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
11224 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
11227 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
11228 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11230 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
11232 TRACE("(%p %x)\n", this, flags);
11234 if(flags & 2) {
11235 /* we have an array, with the number of elements stored before the first object */
11236 INT_PTR i, *ptr = (INT_PTR *)this-1;
11238 for(i=*ptr-1; i>=0; i--)
11239 basic_iostream_wchar_vbase_dtor(this+i);
11240 MSVCRT_operator_delete(ptr);
11241 } else {
11242 basic_iostream_wchar_vbase_dtor(this);
11243 if(flags & 1)
11244 MSVCRT_operator_delete(this);
11247 return this;
11250 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
11251 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
11252 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
11253 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
11254 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_swap, 8)
11255 void __thiscall basic_iostream_wchar_swap(basic_iostream_wchar *this, basic_iostream_wchar *r)
11257 TRACE("(%p %p)\n", this, r);
11259 if(this == r)
11260 return;
11262 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(&this->base1),
11263 basic_istream_wchar_get_basic_ios(&r->base1));
11266 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
11268 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
11271 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
11273 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
11276 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11277 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11278 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
11279 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
11281 basic_ios_char *basic_ios;
11283 TRACE("(%p %d)\n", this, virt_init);
11285 if(virt_init) {
11286 this->base.vbtable = basic_ofstream_char_vbtable;
11287 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11288 INIT_BASIC_IOS_VTORDISP(basic_ios);
11289 basic_ios_char_ctor(basic_ios);
11290 }else {
11291 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11294 basic_filebuf_char_ctor(&this->filebuf);
11295 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11296 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
11297 return this;
11300 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11301 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11302 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
11303 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
11304 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
11306 basic_ios_char *basic_ios;
11308 TRACE("(%p %p %d)\n", this, file, virt_init);
11310 if(virt_init) {
11311 this->base.vbtable = basic_ofstream_char_vbtable;
11312 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11313 INIT_BASIC_IOS_VTORDISP(basic_ios);
11314 basic_ios_char_ctor(basic_ios);
11315 }else {
11316 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11319 basic_filebuf_char_ctor_file(&this->filebuf, file);
11320 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11321 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
11322 return this;
11325 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11326 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11327 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 20)
11328 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
11329 const char *name, int mode, int prot, MSVCP_bool virt_init)
11331 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11333 basic_ofstream_char_ctor(this, virt_init);
11335 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11336 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11337 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11339 return this;
11342 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11343 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11344 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11345 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11346 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name_wchar, 20)
11347 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name_wchar(basic_ofstream_char *this,
11348 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11350 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11352 basic_ofstream_char_ctor(this, virt_init);
11354 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11355 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11356 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11358 return this;
11361 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11362 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11363 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
11364 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
11366 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
11368 TRACE("(%p)\n", this);
11370 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
11371 basic_filebuf_char_dtor(&this->filebuf);
11374 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11375 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11376 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
11377 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
11379 TRACE("(%p)\n", this);
11381 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
11382 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
11385 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
11386 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11388 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
11390 TRACE("(%p %x)\n", this, flags);
11392 if(flags & 2) {
11393 /* we have an array, with the number of elements stored before the first object */
11394 INT_PTR i, *ptr = (INT_PTR *)this-1;
11396 for(i=*ptr-1; i>=0; i--)
11397 basic_ofstream_char_vbase_dtor(this+i);
11398 MSVCRT_operator_delete(ptr);
11399 } else {
11400 basic_ofstream_char_vbase_dtor(this);
11401 if(flags & 1)
11402 MSVCRT_operator_delete(this);
11405 return this;
11408 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11409 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11410 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
11411 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
11413 TRACE("(%p)\n", this);
11415 if(!basic_filebuf_char_close(&this->filebuf)) {
11416 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11417 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11421 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11422 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11423 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
11424 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
11426 TRACE("(%p)\n", this);
11427 return basic_filebuf_char_is_open(&this->filebuf);
11430 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11431 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11432 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 16)
11433 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
11434 const char *name, int mode, int prot)
11436 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11438 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11439 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11440 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11444 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11445 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11446 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
11447 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
11448 const char *name, unsigned int mode)
11450 basic_ofstream_char_open(this, name, mode, _SH_DENYNO);
11453 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11454 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11455 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11456 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11457 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar, 16)
11458 void __thiscall basic_ofstream_char_open_wchar(basic_ofstream_char *this,
11459 const wchar_t *name, int mode, int prot)
11461 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11463 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11464 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11465 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11469 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11470 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11471 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11472 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11473 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar_old, 12)
11474 void __thiscall basic_ofstream_char_open_wchar_old(basic_ofstream_char *this,
11475 const wchar_t *name, unsigned int mode)
11477 basic_ofstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11480 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11481 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11482 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
11483 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
11485 TRACE("(%p)\n", this);
11486 return (basic_filebuf_char*)&this->filebuf;
11489 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
11491 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
11494 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11496 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
11499 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11500 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11501 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
11502 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11504 basic_ios_wchar *basic_ios;
11506 TRACE("(%p %d)\n", this, virt_init);
11508 if(virt_init) {
11509 this->base.vbtable = basic_ofstream_wchar_vbtable;
11510 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11511 INIT_BASIC_IOS_VTORDISP(basic_ios);
11512 basic_ios_wchar_ctor(basic_ios);
11513 }else {
11514 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11517 basic_filebuf_wchar_ctor(&this->filebuf);
11518 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11519 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11520 return this;
11523 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11524 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11525 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
11526 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11528 basic_ofstream_wchar_ctor(this, virt_init);
11529 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11530 return this;
11533 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11534 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11535 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
11536 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
11537 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11539 basic_ios_wchar *basic_ios;
11541 TRACE("(%p %p %d)\n", this, file, virt_init);
11543 if(virt_init) {
11544 this->base.vbtable = basic_ofstream_wchar_vbtable;
11545 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11546 INIT_BASIC_IOS_VTORDISP(basic_ios);
11547 basic_ios_wchar_ctor(basic_ios);
11548 }else {
11549 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11552 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11553 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11554 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11555 return this;
11558 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11559 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11560 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
11561 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
11562 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11564 basic_ofstream_wchar_ctor_file(this, file, virt_init);
11565 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11566 return this;
11569 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
11570 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
11571 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name, 20)
11572 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name(basic_ofstream_wchar *this,
11573 const char *name, int mode, int prot, MSVCP_bool virt_init)
11575 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11577 basic_ofstream_wchar_ctor(this, virt_init);
11579 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11580 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11581 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11583 return this;
11586 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
11587 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
11588 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 20)
11589 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
11590 const char *name, int mode, int prot, MSVCP_bool virt_init)
11592 basic_ofstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11593 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11594 return this;
11597 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11598 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11599 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11600 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11601 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name_wchar, 20)
11602 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name_wchar(basic_ofstream_wchar *this,
11603 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11605 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11607 basic_ofstream_wchar_ctor(this, virt_init);
11609 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11610 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11611 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11613 return this;
11616 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11617 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11618 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11619 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11620 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name_wchar, 20)
11621 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name_wchar(basic_ofstream_wchar *this,
11622 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11624 basic_ofstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11625 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11626 return this;
11629 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11630 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11631 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11632 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11633 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
11634 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
11636 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11638 TRACE("(%p)\n", this);
11640 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11641 basic_filebuf_wchar_dtor(&this->filebuf);
11644 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11645 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11646 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11647 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11648 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
11649 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
11651 TRACE("(%p)\n", this);
11653 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
11654 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
11657 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
11658 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11660 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11662 TRACE("(%p %x)\n", this, flags);
11664 if(flags & 2) {
11665 /* we have an array, with the number of elements stored before the first object */
11666 INT_PTR i, *ptr = (INT_PTR *)this-1;
11668 for(i=*ptr-1; i>=0; i--)
11669 basic_ofstream_wchar_vbase_dtor(this+i);
11670 MSVCRT_operator_delete(ptr);
11671 } else {
11672 basic_ofstream_wchar_vbase_dtor(this);
11673 if(flags & 1)
11674 MSVCRT_operator_delete(this);
11677 return this;
11680 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11681 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11682 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11683 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11684 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
11685 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
11687 TRACE("(%p)\n", this);
11689 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11690 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11691 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11695 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11696 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11697 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11698 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11699 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
11700 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
11702 TRACE("(%p)\n", this);
11703 return basic_filebuf_wchar_is_open(&this->filebuf);
11706 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
11707 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
11708 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
11709 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
11710 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 16)
11711 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
11712 const char *name, int mode, int prot)
11714 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11716 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11717 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11718 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11722 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
11723 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
11724 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
11725 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
11726 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
11727 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
11728 const char *name, unsigned int mode)
11730 basic_ofstream_wchar_open(this, name, mode, _SH_DENYNO);
11733 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11734 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11735 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11736 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11737 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11738 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11739 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11740 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11741 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar, 16)
11742 void __thiscall basic_ofstream_wchar_open_wchar(basic_ofstream_wchar *this,
11743 const wchar_t *name, int mode, int prot)
11745 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11747 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11748 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11749 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11753 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11754 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11755 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11756 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11757 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11758 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11759 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11760 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11761 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar_old, 12)
11762 void __thiscall basic_ofstream_wchar_open_wchar_old(basic_ofstream_wchar *this,
11763 const wchar_t *name, unsigned int mode)
11765 basic_ofstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11768 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11769 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11770 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11771 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11772 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
11773 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
11775 TRACE("(%p)\n", this);
11776 return (basic_filebuf_wchar*)&this->filebuf;
11779 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
11781 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
11784 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
11786 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
11789 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11790 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11791 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
11792 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
11794 basic_ios_char *basic_ios;
11796 TRACE("(%p %d)\n", this, virt_init);
11798 if(virt_init) {
11799 this->base.vbtable = basic_ifstream_char_vbtable;
11800 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11801 INIT_BASIC_IOS_VTORDISP(basic_ios);
11802 basic_ios_char_ctor(basic_ios);
11803 }else {
11804 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11807 basic_filebuf_char_ctor(&this->filebuf);
11808 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11809 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11810 return this;
11813 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11814 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11815 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
11816 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
11817 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
11819 basic_ios_char *basic_ios;
11821 TRACE("(%p %p %d)\n", this, file, virt_init);
11823 if(virt_init) {
11824 this->base.vbtable = basic_ifstream_char_vbtable;
11825 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11826 INIT_BASIC_IOS_VTORDISP(basic_ios);
11827 basic_ios_char_ctor(basic_ios);
11828 }else {
11829 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11832 basic_filebuf_char_ctor_file(&this->filebuf, file);
11833 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11834 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11835 return this;
11838 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11839 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11840 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 20)
11841 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
11842 const char *name, int mode, int prot, MSVCP_bool virt_init)
11844 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11846 basic_ifstream_char_ctor(this, virt_init);
11848 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11849 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11850 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11852 return this;
11855 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
11856 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
11857 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_old, 16)
11858 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_old(basic_ifstream_char *this,
11859 const char *name, int mode, MSVCP_bool virt_init)
11861 return basic_ifstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
11864 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11865 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11866 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11867 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11868 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_wchar, 20)
11869 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_wchar(basic_ifstream_char *this,
11870 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11872 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11874 basic_ifstream_char_ctor(this, virt_init);
11876 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11877 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11878 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11880 return this;
11883 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11884 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11885 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
11886 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
11888 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11890 TRACE("(%p)\n", this);
11892 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11893 basic_filebuf_char_dtor(&this->filebuf);
11896 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11897 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11898 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
11899 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
11901 TRACE("(%p)\n", this);
11903 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
11904 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11907 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
11908 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11910 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11912 TRACE("(%p %x)\n", this, flags);
11914 if(flags & 2) {
11915 /* we have an array, with the number of elements stored before the first object */
11916 INT_PTR i, *ptr = (INT_PTR *)this-1;
11918 for(i=*ptr-1; i>=0; i--)
11919 basic_ifstream_char_vbase_dtor(this+i);
11920 MSVCRT_operator_delete(ptr);
11921 } else {
11922 basic_ifstream_char_vbase_dtor(this);
11923 if(flags & 1)
11924 MSVCRT_operator_delete(this);
11927 return this;
11930 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11931 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11932 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
11933 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
11935 TRACE("(%p)\n", this);
11937 if(!basic_filebuf_char_close(&this->filebuf)) {
11938 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11939 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11943 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11944 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11945 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
11946 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
11948 TRACE("(%p)\n", this);
11949 return basic_filebuf_char_is_open(&this->filebuf);
11952 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11953 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11954 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 16)
11955 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
11956 const char *name, int mode, int prot)
11958 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11960 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11961 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11962 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11966 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11967 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11968 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
11969 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
11970 const char *name, unsigned int mode)
11972 basic_ifstream_char_open(this, name, mode, _SH_DENYNO);
11975 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11976 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11977 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11978 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11979 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar, 16)
11980 void __thiscall basic_ifstream_char_open_wchar(basic_ifstream_char *this,
11981 const wchar_t *name, int mode, int prot)
11983 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11985 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11986 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11987 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11991 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11992 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11993 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11994 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11995 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar_old, 12)
11996 void __thiscall basic_ifstream_char_open_wchar_old(basic_ifstream_char *this,
11997 const wchar_t *name, unsigned int mode)
11999 basic_ifstream_char_open_wchar(this, name, mode, _SH_DENYNO);
12002 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12003 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12004 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
12005 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
12007 TRACE("(%p)\n", this);
12008 return (basic_filebuf_char*)&this->filebuf;
12011 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
12013 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
12016 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12018 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
12021 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
12022 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
12023 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
12024 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
12026 basic_ios_wchar *basic_ios;
12028 TRACE("(%p %d)\n", this, virt_init);
12030 if(virt_init) {
12031 this->base.vbtable = basic_ifstream_wchar_vbtable;
12032 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12033 INIT_BASIC_IOS_VTORDISP(basic_ios);
12034 basic_ios_wchar_ctor(basic_ios);
12035 }else {
12036 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12039 basic_filebuf_wchar_ctor(&this->filebuf);
12040 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12041 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
12042 return this;
12045 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
12046 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
12047 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
12048 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
12050 basic_ifstream_wchar_ctor(this, virt_init);
12051 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12052 return this;
12055 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
12056 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12057 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
12058 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
12059 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
12061 basic_ios_wchar *basic_ios;
12063 TRACE("(%p %p %d)\n", this, file, virt_init);
12065 if(virt_init) {
12066 this->base.vbtable = basic_ifstream_wchar_vbtable;
12067 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12068 INIT_BASIC_IOS_VTORDISP(basic_ios);
12069 basic_ios_wchar_ctor(basic_ios);
12070 }else {
12071 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12074 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
12075 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
12076 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
12077 return this;
12080 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
12081 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12082 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
12083 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
12084 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
12086 basic_ifstream_wchar_ctor_file(this, file, virt_init);
12087 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12088 return this;
12091 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
12092 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
12093 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name, 20)
12094 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name(basic_ifstream_wchar *this,
12095 const char *name, int mode, int prot, MSVCP_bool virt_init)
12097 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12099 basic_ifstream_wchar_ctor(this, virt_init);
12101 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12102 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12103 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12105 return this;
12108 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
12109 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
12110 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 20)
12111 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
12112 const char *name, int mode, int prot, MSVCP_bool virt_init)
12114 basic_ifstream_wchar_ctor_name(this, name, mode, prot, virt_init);
12115 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12116 return this;
12119 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
12120 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDH@Z */
12121 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_old, 16)
12122 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_old(basic_ifstream_wchar *this,
12123 const char *name, int mode, MSVCP_bool virt_init)
12125 return basic_ifstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12128 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
12129 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
12130 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_old, 16)
12131 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_old(basic_ifstream_wchar *this,
12132 const char *name, int mode, MSVCP_bool virt_init)
12134 return basic_ifstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12137 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
12138 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
12139 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12140 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12141 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_wchar, 20)
12142 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_wchar(basic_ifstream_wchar *this,
12143 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12145 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12147 basic_ifstream_wchar_ctor(this, virt_init);
12149 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12150 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12151 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12153 return this;
12156 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12157 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12158 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
12159 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
12160 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_wchar, 20)
12161 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_wchar(basic_ifstream_wchar *this,
12162 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12164 basic_ifstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
12165 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
12166 return this;
12169 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
12170 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
12171 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
12172 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
12173 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
12174 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
12176 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
12178 TRACE("(%p)\n", this);
12180 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12181 basic_filebuf_wchar_dtor(&this->filebuf);
12184 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12185 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12186 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12187 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12188 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
12189 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
12191 TRACE("(%p)\n", this);
12193 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
12194 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
12197 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
12198 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12200 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
12202 TRACE("(%p %x)\n", this, flags);
12204 if(flags & 2) {
12205 /* we have an array, with the number of elements stored before the first object */
12206 INT_PTR i, *ptr = (INT_PTR *)this-1;
12208 for(i=*ptr-1; i>=0; i--)
12209 basic_ifstream_wchar_vbase_dtor(this+i);
12210 MSVCRT_operator_delete(ptr);
12211 } else {
12212 basic_ifstream_wchar_vbase_dtor(this);
12213 if(flags & 1)
12214 MSVCRT_operator_delete(this);
12217 return this;
12220 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12221 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12222 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12223 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12224 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
12225 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
12227 TRACE("(%p)\n", this);
12229 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12230 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12231 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12235 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12236 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12237 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12238 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12239 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
12240 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
12242 TRACE("(%p)\n", this);
12243 return basic_filebuf_wchar_is_open(&this->filebuf);
12246 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
12247 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
12248 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
12249 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
12250 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 16)
12251 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
12252 const char *name, int mode, int prot)
12254 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12256 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12257 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12258 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12262 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
12263 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
12264 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
12265 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
12266 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
12267 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
12268 const char *name, unsigned int mode)
12270 basic_ifstream_wchar_open(this, name, mode, _SH_DENYNO);
12273 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
12274 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
12275 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
12276 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
12277 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
12278 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
12279 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
12280 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
12281 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar, 16)
12282 void __thiscall basic_ifstream_wchar_open_wchar(basic_ifstream_wchar *this,
12283 const wchar_t *name, int mode, int prot)
12285 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12287 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
12288 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12289 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12293 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
12294 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
12295 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
12296 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
12297 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
12298 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
12299 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
12300 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
12301 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar_old, 12)
12302 void __thiscall basic_ifstream_wchar_open_wchar_old(basic_ifstream_wchar *this,
12303 const wchar_t *name, unsigned int mode)
12305 basic_ifstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
12308 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12309 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12310 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12311 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12312 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
12313 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
12315 TRACE("(%p)\n", this);
12316 return (basic_filebuf_wchar*)&this->filebuf;
12319 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
12321 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
12324 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
12326 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
12329 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
12330 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
12331 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
12332 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
12334 basic_ios_char *basic_ios;
12336 TRACE("(%p %d)\n", this, virt_init);
12338 if(virt_init) {
12339 this->base.base1.vbtable = basic_fstream_char_vbtable1;
12340 this->base.base2.vbtable = basic_fstream_char_vbtable2;
12341 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12342 INIT_BASIC_IOS_VTORDISP(basic_ios);
12343 basic_ios_char_ctor(basic_ios);
12344 }else {
12345 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12348 basic_filebuf_char_ctor(&this->filebuf);
12349 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
12350 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
12351 return this;
12354 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
12355 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12356 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
12357 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
12358 FILE *file, MSVCP_bool virt_init)
12360 basic_ios_char *basic_ios;
12362 TRACE("(%p %p %d)\n", this, file, virt_init);
12364 if(virt_init) {
12365 this->base.base1.vbtable = basic_fstream_char_vbtable1;
12366 this->base.base2.vbtable = basic_fstream_char_vbtable2;
12367 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12368 INIT_BASIC_IOS_VTORDISP(basic_ios);
12369 basic_ios_char_ctor(basic_ios);
12370 }else {
12371 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12374 basic_filebuf_char_ctor_file(&this->filebuf, file);
12375 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
12376 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
12377 return this;
12380 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
12381 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
12382 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 20)
12383 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
12384 const char *name, int mode, int prot, MSVCP_bool virt_init)
12386 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12388 basic_fstream_char_ctor(this, virt_init);
12390 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
12391 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12392 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12394 return this;
12397 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
12398 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
12399 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_noprot, 16)
12400 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_noprot(basic_fstream_char *this,
12401 const char *name, int mode, MSVCP_bool virt_init)
12403 return basic_fstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12406 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
12407 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
12408 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
12409 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
12410 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_wchar, 20)
12411 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_wchar(basic_fstream_char *this,
12412 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12414 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12416 basic_fstream_char_ctor(this, virt_init);
12418 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
12419 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12420 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12422 return this;
12425 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
12426 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
12427 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
12428 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
12430 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
12432 TRACE("(%p)\n", this);
12434 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12435 basic_filebuf_char_dtor(&this->filebuf);
12438 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12439 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12440 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
12441 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
12443 TRACE("(%p)\n", this);
12445 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
12446 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
12449 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
12450 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12452 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
12454 TRACE("(%p %x)\n", this, flags);
12456 if(flags & 2) {
12457 /* we have an array, with the number of elements stored before the first object */
12458 INT_PTR i, *ptr = (INT_PTR *)this-1;
12460 for(i=*ptr-1; i>=0; i--)
12461 basic_fstream_char_vbase_dtor(this+i);
12462 MSVCRT_operator_delete(ptr);
12463 } else {
12464 basic_fstream_char_vbase_dtor(this);
12465 if(flags & 1)
12466 MSVCRT_operator_delete(this);
12469 return this;
12472 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
12473 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
12474 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
12475 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
12477 TRACE("(%p)\n", this);
12479 if(!basic_filebuf_char_close(&this->filebuf)) {
12480 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12481 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12485 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
12486 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
12487 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
12488 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
12490 TRACE("(%p)\n", this);
12491 return basic_filebuf_char_is_open(&this->filebuf);
12494 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
12495 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
12496 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 16)
12497 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
12498 const char *name, int mode, int prot)
12500 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12502 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
12503 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12504 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12508 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
12509 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
12510 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
12511 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
12512 const char *name, unsigned int mode)
12514 basic_fstream_char_open(this, name, mode, _SH_DENYNO);
12517 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
12518 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
12519 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
12520 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
12521 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar, 16)
12522 void __thiscall basic_fstream_char_open_wchar(basic_fstream_char *this,
12523 const wchar_t *name, int mode, int prot)
12525 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12527 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
12528 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12529 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
12533 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
12534 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
12535 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
12536 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
12537 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar_old, 12)
12538 void __thiscall basic_fstream_char_open_wchar_old(basic_fstream_char *this,
12539 const wchar_t *name, unsigned int mode)
12541 basic_fstream_char_open_wchar(this, name, mode, _SH_DENYNO);
12544 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12545 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
12546 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
12547 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
12549 TRACE("(%p)\n", this);
12550 return (basic_filebuf_char*)&this->filebuf;
12553 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
12555 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
12558 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12560 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
12563 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
12564 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
12565 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
12566 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12568 basic_ios_wchar *basic_ios;
12570 TRACE("(%p %d)\n", this, virt_init);
12572 if(virt_init) {
12573 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12574 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12575 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12576 INIT_BASIC_IOS_VTORDISP(basic_ios);
12577 basic_ios_wchar_ctor(basic_ios);
12578 }else {
12579 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12582 basic_filebuf_wchar_ctor(&this->filebuf);
12583 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12584 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12585 return this;
12588 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
12589 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
12590 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
12591 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
12593 basic_fstream_wchar_ctor(this, virt_init);
12594 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12595 return this;
12598 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
12599 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12600 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
12601 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
12602 FILE *file, MSVCP_bool virt_init)
12604 basic_ios_wchar *basic_ios;
12606 TRACE("(%p %p %d)\n", this, file, virt_init);
12608 if(virt_init) {
12609 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
12610 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
12611 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12612 INIT_BASIC_IOS_VTORDISP(basic_ios);
12613 basic_ios_wchar_ctor(basic_ios);
12614 }else {
12615 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12618 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
12619 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
12620 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
12621 return this;
12624 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
12625 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
12626 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
12627 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
12628 FILE *file, MSVCP_bool virt_init)
12630 basic_fstream_wchar_ctor_file(this, file, virt_init);
12631 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12632 return this;
12635 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12636 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12637 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name, 20)
12638 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name(basic_fstream_wchar *this,
12639 const char *name, int mode, int prot, MSVCP_bool virt_init)
12641 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
12643 basic_fstream_wchar_ctor(this, virt_init);
12645 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
12646 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12647 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12649 return this;
12652 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12653 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12654 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 20)
12655 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
12656 const char *name, int mode, int prot, MSVCP_bool virt_init)
12658 basic_fstream_wchar_ctor_name(this, name, mode, prot, virt_init);
12659 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12660 return this;
12663 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
12664 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_noprot, 16)
12665 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_noprot(basic_fstream_wchar *this,
12666 const char *name, int mode, MSVCP_bool virt_init)
12668 return basic_fstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12671 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
12672 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
12673 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_noprot, 16)
12674 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_noprot(basic_fstream_wchar *this,
12675 const char *name, int mode, MSVCP_bool virt_init)
12677 return basic_fstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
12680 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
12681 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
12682 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
12683 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
12684 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_wchar, 20)
12685 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_wchar(basic_fstream_wchar *this,
12686 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12688 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
12690 basic_fstream_wchar_ctor(this, virt_init);
12692 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
12693 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12694 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12696 return this;
12699 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
12700 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
12701 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
12702 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
12703 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_wchar, 20)
12704 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_wchar(basic_fstream_wchar *this,
12705 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
12707 basic_fstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
12708 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
12709 return this;
12712 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
12713 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
12714 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
12715 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
12716 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
12717 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
12719 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12721 TRACE("(%p)\n", this);
12723 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
12724 basic_filebuf_wchar_dtor(&this->filebuf);
12727 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12728 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12729 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12730 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12731 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
12732 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
12734 TRACE("(%p)\n", this);
12736 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
12737 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
12740 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
12741 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12743 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
12745 TRACE("(%p %x)\n", this, flags);
12747 if(flags & 2) {
12748 /* we have an array, with the number of elements stored before the first object */
12749 INT_PTR i, *ptr = (INT_PTR *)this-1;
12751 for(i=*ptr-1; i>=0; i--)
12752 basic_fstream_wchar_vbase_dtor(this+i);
12753 MSVCRT_operator_delete(ptr);
12754 } else {
12755 basic_fstream_wchar_vbase_dtor(this);
12756 if(flags & 1)
12757 MSVCRT_operator_delete(this);
12760 return this;
12763 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12764 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12765 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12766 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12767 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
12768 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
12770 TRACE("(%p)\n", this);
12772 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12773 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12774 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12778 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12779 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12780 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12781 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12782 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
12783 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
12785 TRACE("(%p)\n", this);
12786 return basic_filebuf_wchar_is_open(&this->filebuf);
12789 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
12790 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
12791 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
12792 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
12793 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 16)
12794 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
12795 const char *name, int mode, int prot)
12797 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12799 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
12800 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12801 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12805 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
12806 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
12807 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
12808 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
12809 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
12810 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
12811 const char *name, unsigned int mode)
12813 basic_fstream_wchar_open(this, name, mode, _SH_DENYNO);
12816 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
12817 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
12818 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
12819 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
12820 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
12821 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
12822 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
12823 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
12824 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar, 16)
12825 void __thiscall basic_fstream_wchar_open_wchar(basic_fstream_wchar *this,
12826 const wchar_t *name, int mode, int prot)
12828 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12830 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
12831 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12832 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12836 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
12837 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
12838 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
12839 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
12840 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
12841 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
12842 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
12843 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
12844 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar_old, 12)
12845 void __thiscall basic_fstream_wchar_open_wchar_old(basic_fstream_wchar *this,
12846 const wchar_t *name, unsigned int mode)
12848 basic_fstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
12851 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12852 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12853 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12854 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12855 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
12856 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
12858 TRACE("(%p)\n", this);
12859 return (basic_filebuf_wchar*)&this->filebuf;
12862 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
12864 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
12867 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
12869 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
12872 /* ??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 */
12873 /* ??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 */
12874 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
12875 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
12876 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12878 basic_ios_char *basic_ios;
12880 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12882 if(virt_init) {
12883 this->base.vbtable = basic_ostringstream_char_vbtable;
12884 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12885 INIT_BASIC_IOS_VTORDISP(basic_ios);
12886 basic_ios_char_ctor(basic_ios);
12887 }else {
12888 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12891 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12892 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12893 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12894 return this;
12897 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12898 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12899 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
12900 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
12901 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
12903 basic_ios_char *basic_ios;
12905 TRACE("(%p %d %d)\n", this, mode, virt_init);
12907 if(virt_init) {
12908 this->base.vbtable = basic_ostringstream_char_vbtable;
12909 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12910 INIT_BASIC_IOS_VTORDISP(basic_ios);
12911 basic_ios_char_ctor(basic_ios);
12912 }else {
12913 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12916 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12917 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12918 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12919 return this;
12922 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12923 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12924 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
12925 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
12926 basic_ostringstream_char *this)
12928 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
12931 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12932 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12933 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
12934 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
12936 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12938 TRACE("(%p)\n", this);
12940 basic_stringbuf_char_dtor(&this->strbuf);
12941 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
12944 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12945 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12946 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
12947 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
12949 TRACE("(%p)\n", this);
12951 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
12952 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
12955 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
12956 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12958 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12960 TRACE("(%p %x)\n", this, flags);
12962 if(flags & 2) {
12963 /* we have an array, with the number of elements stored before the first object */
12964 INT_PTR i, *ptr = (INT_PTR *)this-1;
12966 for(i=*ptr-1; i>=0; i--)
12967 basic_ostringstream_char_vbase_dtor(this+i);
12968 MSVCRT_operator_delete(ptr);
12969 } else {
12970 basic_ostringstream_char_vbase_dtor(this);
12971 if(flags & 1)
12972 MSVCRT_operator_delete(this);
12975 return this;
12978 /* ?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 */
12979 /* ?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 */
12980 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
12981 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
12983 TRACE("(%p)\n", this);
12984 return (basic_stringbuf_char*)&this->strbuf;
12987 /* ?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 */
12988 /* ?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 */
12989 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
12990 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
12992 TRACE("(%p %p)\n", this, str);
12993 basic_stringbuf_char_str_set(&this->strbuf, str);
12996 /* ?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 */
12997 /* ?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 */
12998 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
12999 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
13001 TRACE("(%p %p)\n", this, ret);
13002 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13005 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
13007 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
13010 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13012 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
13015 /* ??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 */
13016 /* ??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 */
13017 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
13018 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
13019 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13021 basic_ios_wchar *basic_ios;
13023 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13025 if(virt_init) {
13026 this->base.vbtable = basic_ostringstream_wchar_vbtable;
13027 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13028 INIT_BASIC_IOS_VTORDISP(basic_ios);
13029 basic_ios_wchar_ctor(basic_ios);
13030 }else {
13031 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13034 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
13035 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13036 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
13037 return this;
13040 /* ??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 */
13041 /* ??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 */
13042 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
13043 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
13044 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13046 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
13047 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
13048 return this;
13051 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13052 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13053 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
13054 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
13055 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
13057 basic_ios_wchar *basic_ios;
13059 TRACE("(%p %d %d)\n", this, mode, virt_init);
13061 if(virt_init) {
13062 this->base.vbtable = basic_ostringstream_wchar_vbtable;
13063 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13064 INIT_BASIC_IOS_VTORDISP(basic_ios);
13065 basic_ios_wchar_ctor(basic_ios);
13066 }else {
13067 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
13070 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
13071 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13072 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
13073 return this;
13076 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13077 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13078 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
13079 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
13080 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
13082 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
13083 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
13084 return this;
13087 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13088 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13089 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
13090 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
13091 basic_ostringstream_wchar *this)
13093 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
13096 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13097 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13098 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
13099 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
13100 basic_ostringstream_wchar *this)
13102 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
13105 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13106 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13107 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13108 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13109 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
13110 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
13112 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
13114 TRACE("(%p)\n", this);
13116 basic_stringbuf_wchar_dtor(&this->strbuf);
13117 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
13120 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13121 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13122 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13123 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13124 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
13125 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
13127 TRACE("(%p)\n", this);
13129 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
13130 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
13133 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
13134 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13136 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
13138 TRACE("(%p %x)\n", this, flags);
13140 if(flags & 2) {
13141 /* we have an array, with the number of elements stored before the first object */
13142 INT_PTR i, *ptr = (INT_PTR *)this-1;
13144 for(i=*ptr-1; i>=0; i--)
13145 basic_ostringstream_wchar_vbase_dtor(this+i);
13146 MSVCRT_operator_delete(ptr);
13147 } else {
13148 basic_ostringstream_wchar_vbase_dtor(this);
13149 if(flags & 1)
13150 MSVCRT_operator_delete(this);
13153 return this;
13156 /* ?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 */
13157 /* ?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 */
13158 /* ?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 */
13159 /* ?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 */
13160 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
13161 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
13163 TRACE("(%p)\n", this);
13164 return (basic_stringbuf_wchar*)&this->strbuf;
13167 /* ?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 */
13168 /* ?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 */
13169 /* ?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 */
13170 /* ?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 */
13171 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
13172 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
13174 TRACE("(%p %p)\n", this, str);
13175 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13178 /* ?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 */
13179 /* ?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 */
13180 /* ?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 */
13181 /* ?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 */
13182 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
13183 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
13185 TRACE("(%p %p)\n", this, ret);
13186 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13189 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
13191 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
13194 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
13196 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
13199 /* ??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 */
13200 /* ??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 */
13201 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
13202 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
13203 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13205 basic_ios_char *basic_ios;
13207 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13209 if(virt_init) {
13210 this->base.vbtable = basic_istringstream_char_vbtable;
13211 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13212 INIT_BASIC_IOS_VTORDISP(basic_ios);
13213 basic_ios_char_ctor(basic_ios);
13214 }else {
13215 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13218 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
13219 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13220 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
13221 return this;
13224 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13225 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13226 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
13227 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
13228 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
13230 basic_ios_char *basic_ios;
13232 TRACE("(%p %d %d)\n", this, mode, virt_init);
13234 if(virt_init) {
13235 this->base.vbtable = basic_istringstream_char_vbtable;
13236 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13237 INIT_BASIC_IOS_VTORDISP(basic_ios);
13238 basic_ios_char_ctor(basic_ios);
13239 }else {
13240 basic_ios = basic_istream_char_get_basic_ios(&this->base);
13243 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
13244 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13245 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
13246 return this;
13249 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13250 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13251 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
13252 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
13253 basic_istringstream_char *this)
13255 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
13258 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13259 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13260 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
13261 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
13263 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
13265 TRACE("(%p)\n", this);
13267 basic_stringbuf_char_dtor(&this->strbuf);
13268 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
13271 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13272 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13273 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
13274 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
13276 TRACE("(%p)\n", this);
13278 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
13279 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
13282 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
13283 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13285 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
13287 TRACE("(%p %x)\n", this, flags);
13289 if(flags & 2) {
13290 /* we have an array, with the number of elements stored before the first object */
13291 INT_PTR i, *ptr = (INT_PTR *)this-1;
13293 for(i=*ptr-1; i>=0; i--)
13294 basic_istringstream_char_vbase_dtor(this+i);
13295 MSVCRT_operator_delete(ptr);
13296 } else {
13297 basic_istringstream_char_vbase_dtor(this);
13298 if(flags & 1)
13299 MSVCRT_operator_delete(this);
13302 return this;
13305 /* ?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 */
13306 /* ?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 */
13307 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
13308 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
13310 TRACE("(%p)\n", this);
13311 return (basic_stringbuf_char*)&this->strbuf;
13314 /* ?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 */
13315 /* ?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 */
13316 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
13317 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
13319 TRACE("(%p %p)\n", this, str);
13320 basic_stringbuf_char_str_set(&this->strbuf, str);
13323 /* ?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 */
13324 /* ?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 */
13325 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
13326 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
13328 TRACE("(%p %p)\n", this, ret);
13329 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13332 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
13334 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
13337 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13339 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
13342 /* ??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 */
13343 /* ??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 */
13344 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
13345 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
13346 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13348 basic_ios_wchar *basic_ios;
13350 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13352 if(virt_init) {
13353 this->base.vbtable = basic_istringstream_wchar_vbtable;
13354 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13355 INIT_BASIC_IOS_VTORDISP(basic_ios);
13356 basic_ios_wchar_ctor(basic_ios);
13357 }else {
13358 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13361 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
13362 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13363 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
13364 return this;
13367 /* ??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 */
13368 /* ??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 */
13369 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
13370 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
13371 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13373 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
13374 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
13375 return this;
13378 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13379 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13380 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
13381 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
13382 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
13384 basic_ios_wchar *basic_ios;
13386 TRACE("(%p %d %d)\n", this, mode, virt_init);
13388 if(virt_init) {
13389 this->base.vbtable = basic_istringstream_wchar_vbtable;
13390 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13391 INIT_BASIC_IOS_VTORDISP(basic_ios);
13392 basic_ios_wchar_ctor(basic_ios);
13393 }else {
13394 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
13397 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
13398 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
13399 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
13400 return this;
13403 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13404 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13405 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
13406 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
13407 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
13409 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
13410 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
13411 return this;
13414 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13415 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13416 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
13417 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
13418 basic_istringstream_wchar *this)
13420 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
13423 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13424 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13425 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
13426 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
13427 basic_istringstream_wchar *this)
13429 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
13432 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13433 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13434 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13435 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13436 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
13437 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
13439 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
13441 TRACE("(%p)\n", this);
13443 basic_stringbuf_wchar_dtor(&this->strbuf);
13444 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
13447 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13448 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13449 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13450 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13451 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
13452 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
13454 TRACE("(%p)\n", this);
13456 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
13457 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
13460 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
13461 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13463 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
13465 TRACE("(%p %x)\n", this, flags);
13467 if(flags & 2) {
13468 /* we have an array, with the number of elements stored before the first object */
13469 INT_PTR i, *ptr = (INT_PTR *)this-1;
13471 for(i=*ptr-1; i>=0; i--)
13472 basic_istringstream_wchar_vbase_dtor(this+i);
13473 MSVCRT_operator_delete(ptr);
13474 } else {
13475 basic_istringstream_wchar_vbase_dtor(this);
13476 if(flags & 1)
13477 MSVCRT_operator_delete(this);
13480 return this;
13483 /* ?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 */
13484 /* ?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 */
13485 /* ?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 */
13486 /* ?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 */
13487 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
13488 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
13490 TRACE("(%p)\n", this);
13491 return (basic_stringbuf_wchar*)&this->strbuf;
13494 /* ?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 */
13495 /* ?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 */
13496 /* ?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 */
13497 /* ?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 */
13498 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
13499 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
13501 TRACE("(%p %p)\n", this, str);
13502 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13505 /* ?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 */
13506 /* ?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 */
13507 /* ?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 */
13508 /* ?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 */
13509 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
13510 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
13512 TRACE("(%p %p)\n", this, ret);
13513 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13516 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
13518 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
13521 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
13523 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
13526 /* ??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 */
13527 /* ??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 */
13528 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
13529 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
13530 const basic_string_char *str, int mode, MSVCP_bool virt_init)
13532 basic_ios_char *basic_ios;
13534 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13536 if(virt_init) {
13537 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
13538 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
13539 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13540 INIT_BASIC_IOS_VTORDISP(basic_ios);
13541 basic_ios_char_ctor(basic_ios);
13542 }else {
13543 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13546 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
13547 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
13548 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
13549 return this;
13552 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
13553 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
13554 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
13555 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
13556 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
13558 basic_ios_char *basic_ios;
13560 TRACE("(%p %d %d)\n", this, mode, virt_init);
13562 if(virt_init) {
13563 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
13564 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
13565 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13566 INIT_BASIC_IOS_VTORDISP(basic_ios);
13567 basic_ios_char_ctor(basic_ios);
13568 }else {
13569 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13572 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
13573 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
13574 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
13575 return this;
13578 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13579 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13580 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
13581 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
13582 basic_stringstream_char *this)
13584 return basic_stringstream_char_ctor_mode(
13585 this, OPENMODE_out|OPENMODE_in, TRUE);
13588 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
13589 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
13590 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
13591 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
13593 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13595 TRACE("(%p)\n", this);
13597 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13598 basic_stringbuf_char_dtor(&this->strbuf);
13601 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
13602 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
13603 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
13604 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
13606 TRACE("(%p)\n", this);
13608 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
13609 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
13612 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
13613 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
13615 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
13617 TRACE("(%p %x)\n", this, flags);
13619 if(flags & 2) {
13620 /* we have an array, with the number of elements stored before the first object */
13621 INT_PTR i, *ptr = (INT_PTR *)this-1;
13623 for(i=*ptr-1; i>=0; i--)
13624 basic_stringstream_char_vbase_dtor(this+i);
13625 MSVCRT_operator_delete(ptr);
13626 } else {
13627 basic_stringstream_char_vbase_dtor(this);
13628 if(flags & 1)
13629 MSVCRT_operator_delete(this);
13632 return this;
13635 /* ?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 */
13636 /* ?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 */
13637 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
13638 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
13640 TRACE("(%p)\n", this);
13641 return (basic_stringbuf_char*)&this->strbuf;
13644 /* ?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 */
13645 /* ?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 */
13646 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
13647 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
13649 TRACE("(%p %p)\n", this, str);
13650 basic_stringbuf_char_str_set(&this->strbuf, str);
13653 /* ?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 */
13654 /* ?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 */
13655 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
13656 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
13658 TRACE("(%p %p)\n", this, ret);
13659 return basic_stringbuf_char_str_get(&this->strbuf, ret);
13662 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
13664 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
13667 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
13669 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
13672 /* ??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 */
13673 /* ??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 */
13674 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
13675 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
13676 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13678 basic_ios_wchar *basic_ios;
13680 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
13682 if(virt_init) {
13683 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13684 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13685 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13686 INIT_BASIC_IOS_VTORDISP(basic_ios);
13687 basic_ios_wchar_ctor(basic_ios);
13688 }else {
13689 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13692 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
13693 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13694 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13695 return this;
13698 /* ??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 */
13699 /* ??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 */
13700 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
13701 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
13702 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
13704 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
13705 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13706 return this;
13709 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
13710 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
13711 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
13712 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
13713 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13715 basic_ios_wchar *basic_ios;
13717 TRACE("(%p %d %d)\n", this, mode, virt_init);
13719 if(virt_init) {
13720 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
13721 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
13722 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13723 INIT_BASIC_IOS_VTORDISP(basic_ios);
13724 basic_ios_wchar_ctor(basic_ios);
13725 }else {
13726 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
13729 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
13730 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
13731 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
13732 return this;
13735 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
13736 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
13737 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
13738 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
13739 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
13741 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
13742 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
13743 return this;
13746 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13747 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13748 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
13749 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
13750 basic_stringstream_wchar *this)
13752 return basic_stringstream_wchar_ctor_mode(
13753 this, OPENMODE_out|OPENMODE_in, TRUE);
13756 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13757 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13758 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
13759 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
13760 basic_stringstream_wchar *this)
13762 return basic_stringstream_short_ctor_mode(
13763 this, OPENMODE_out|OPENMODE_in, TRUE);
13766 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
13767 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
13768 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
13769 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
13770 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
13771 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
13773 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13775 TRACE("(%p)\n", this);
13777 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
13778 basic_stringbuf_wchar_dtor(&this->strbuf);
13781 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13782 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13783 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13784 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13785 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
13786 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
13788 TRACE("(%p)\n", this);
13790 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
13791 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
13794 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
13795 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13797 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13799 TRACE("(%p %x)\n", this, flags);
13801 if(flags & 2) {
13802 /* we have an array, with the number of elements stored before the first object */
13803 INT_PTR i, *ptr = (INT_PTR *)this-1;
13805 for(i=*ptr-1; i>=0; i--)
13806 basic_stringstream_wchar_vbase_dtor(this+i);
13807 MSVCRT_operator_delete(ptr);
13808 } else {
13809 basic_stringstream_wchar_vbase_dtor(this);
13810 if(flags & 1)
13811 MSVCRT_operator_delete(this);
13814 return this;
13817 /* ?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 */
13818 /* ?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 */
13819 /* ?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 */
13820 /* ?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 */
13821 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
13822 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
13824 TRACE("(%p)\n", this);
13825 return (basic_stringbuf_wchar*)&this->strbuf;
13828 /* ?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 */
13829 /* ?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 */
13830 /* ?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 */
13831 /* ?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 */
13832 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
13833 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
13835 TRACE("(%p %p)\n", this, str);
13836 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13839 /* ?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 */
13840 /* ?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 */
13841 /* ?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 */
13842 /* ?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 */
13843 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
13844 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
13846 TRACE("(%p %p)\n", this, ret);
13847 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13850 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
13851 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
13852 #if STREAMSIZE_BITS == 64
13853 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
13854 #else
13855 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
13856 #endif
13857 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
13859 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
13861 this->minsize = 32;
13862 this->endsave = NULL;
13863 this->strmode = mode;
13864 this->palloc = NULL;
13865 this->pfree = NULL;
13867 if(!g) {
13868 this->strmode |= STRSTATE_Dynamic;
13869 if(len > this->minsize)
13870 this->minsize = len;
13871 this->seekhigh = NULL;
13872 return;
13875 if(len < 0)
13876 len = INT_MAX;
13877 else if(!len)
13878 len = strlen(g);
13880 this->seekhigh = g+len;
13881 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
13882 if(p)
13883 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
13886 /* ??0strstreambuf@std@@QAE@PACH0@Z */
13887 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
13888 /* ??0strstreambuf@std@@QAE@PADH0@Z */
13889 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
13890 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
13891 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
13892 #if STREAMSIZE_BITS == 64
13893 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
13894 #else
13895 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
13896 #endif
13897 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
13899 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
13901 basic_streambuf_char_ctor(&this->base);
13902 this->base.vtable = &MSVCP_strstreambuf_vtable;
13904 strstreambuf__Init(this, len, g, p, 0);
13905 return this;
13908 /* ??0strstreambuf@std@@QAE@H@Z */
13909 /* ??0strstreambuf@std@@QEAA@_J@Z */
13910 #if STREAMSIZE_BITS == 64
13911 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 12)
13912 #else
13913 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
13914 #endif
13915 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
13917 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
13920 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
13921 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
13922 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
13923 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(MSVCP_size_t), void (__cdecl *pfree)(void*))
13925 TRACE("(%p %p %p)\n", this, palloc, pfree);
13927 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13928 this->palloc = palloc;
13929 this->pfree = pfree;
13930 return this;
13933 /* ??0strstreambuf@std@@QAE@PBCH@Z */
13934 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
13935 /* ??0strstreambuf@std@@QAE@PBDH@Z */
13936 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
13937 /* ??0strstreambuf@std@@QAE@PBEH@Z */
13938 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
13939 #if STREAMSIZE_BITS == 64
13940 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 16)
13941 #else
13942 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
13943 #endif
13944 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
13946 TRACE("(%p %p %s)\n", this, g, wine_dbgstr_longlong(len));
13948 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
13949 this->strmode |= STRSTATE_Constant;
13950 return this;
13953 /* ??_Fstrstreambuf@std@@QAEXXZ */
13954 /* ??_Fstrstreambuf@std@@QEAAXXZ */
13955 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
13956 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
13958 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13961 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
13962 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
13963 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
13964 void __thiscall strstreambuf__Tidy(strstreambuf *this)
13966 TRACE("(%p)\n", this);
13968 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
13969 if(this->pfree)
13970 this->pfree(basic_streambuf_char_eback(&this->base));
13971 else
13972 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
13975 this->endsave = NULL;
13976 this->seekhigh = NULL;
13977 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
13978 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
13979 basic_streambuf_char_setp(&this->base, NULL, NULL);
13982 /* ??1strstreambuf@std@@UAE@XZ */
13983 /* ??1strstreambuf@std@@UEAA@XZ */
13984 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
13985 void __thiscall strstreambuf_dtor(strstreambuf *this)
13987 TRACE("(%p)\n", this);
13989 strstreambuf__Tidy(this);
13990 basic_streambuf_char_dtor(&this->base);
13993 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
13994 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
13996 TRACE("(%p %x)\n", this, flags);
13997 if(flags & 2) {
13998 /* we have an array, with the number of elements stored before the first object */
13999 INT_PTR i, *ptr = (INT_PTR *)this-1;
14001 for(i=*ptr-1; i>=0; i--)
14002 strstreambuf_dtor(this+i);
14003 MSVCRT_operator_delete(ptr);
14004 } else {
14005 strstreambuf_dtor(this);
14006 if(flags & 1)
14007 MSVCRT_operator_delete(this);
14010 return this;
14013 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
14014 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
14015 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
14016 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
14018 TRACE("(%p %d)\n", this, freeze);
14020 if(!freeze == !(this->strmode & STRSTATE_Frozen))
14021 return;
14023 if(freeze) {
14024 this->strmode |= STRSTATE_Frozen;
14025 this->endsave = basic_streambuf_char_epptr(&this->base);
14026 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
14027 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
14028 }else {
14029 this->strmode &= ~STRSTATE_Frozen;
14030 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
14031 basic_streambuf_char_pptr(&this->base), this->endsave);
14035 /* ?str@strstreambuf@std@@QAEPADXZ */
14036 /* ?str@strstreambuf@std@@QEAAPEADXZ */
14037 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
14038 char* __thiscall strstreambuf_str(strstreambuf *this)
14040 TRACE("(%p)\n", this);
14042 strstreambuf_freeze(this, TRUE);
14043 return basic_streambuf_char_gptr(&this->base);
14046 /* ?pcount@strstreambuf@std@@QBEHXZ */
14047 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
14048 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
14049 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
14051 char *ppos = basic_streambuf_char_pptr(&this->base);
14053 TRACE("(%p)\n", this);
14055 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
14058 /* ?overflow@strstreambuf@std@@MAEHH@Z */
14059 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
14060 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
14061 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
14063 MSVCP_size_t old_size, size;
14064 char *ptr, *buf;
14066 TRACE("(%p %d)\n", this, c);
14068 if(c == EOF)
14069 return !EOF;
14071 if(this->strmode & STRSTATE_Frozen)
14072 return EOF;
14074 ptr = basic_streambuf_char_pptr(&this->base);
14075 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
14076 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
14078 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
14079 return EOF;
14081 ptr = basic_streambuf_char_eback(&this->base);
14082 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
14084 size = old_size + old_size/2;
14085 if(size < this->minsize)
14086 size = this->minsize;
14088 if(this->palloc)
14089 buf = this->palloc(size);
14090 else
14091 buf = MSVCRT_operator_new(size);
14092 if(!buf)
14093 return EOF;
14095 memcpy(buf, ptr, old_size);
14096 if(this->strmode & STRSTATE_Allocated) {
14097 if(this->pfree)
14098 this->pfree(ptr);
14099 else
14100 MSVCRT_operator_delete(ptr);
14103 this->strmode |= STRSTATE_Allocated;
14104 if(!old_size) {
14105 this->seekhigh = buf;
14106 basic_streambuf_char_setp(&this->base, buf, buf+size);
14107 basic_streambuf_char_setg(&this->base, buf, buf, buf);
14108 }else {
14109 this->seekhigh = this->seekhigh-ptr+buf;
14110 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
14111 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
14112 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
14113 basic_streambuf_char_pptr(&this->base));
14116 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
14119 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
14120 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
14121 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
14122 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
14124 char *ptr = basic_streambuf_char_gptr(&this->base);
14126 TRACE("(%p %d)\n", this, c);
14128 if(ptr<=basic_streambuf_char_eback(&this->base)
14129 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
14130 return EOF;
14132 basic_streambuf_char_gbump(&this->base, -1);
14133 if(c == EOF)
14134 return !EOF;
14135 if(this->strmode & STRSTATE_Constant)
14136 return (unsigned char)c;
14138 return (unsigned char)(ptr[0] = c);
14141 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
14142 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
14143 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
14144 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
14145 #if STREAMOFF_BITS == 64
14146 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
14147 #else
14148 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
14149 #endif
14150 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
14152 char *eback = basic_streambuf_char_eback(&this->base);
14153 char *pptr = basic_streambuf_char_pptr(&this->base);
14154 char *gptr = basic_streambuf_char_gptr(&this->base);
14156 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
14158 ret->off = 0;
14159 ret->state = 0;
14161 if(pptr > this->seekhigh)
14162 this->seekhigh = pptr;
14164 if((mode & OPENMODE_in) && gptr) {
14165 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
14166 off += gptr-eback;
14167 else if(way == SEEKDIR_end)
14168 off += this->seekhigh-eback;
14169 else if(way != SEEKDIR_beg)
14170 off = -1;
14172 if(off<0 || off>this->seekhigh-eback) {
14173 off = -1;
14174 }else {
14175 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
14176 if((mode & OPENMODE_out) && pptr) {
14177 basic_streambuf_char_setp_next(&this->base, eback,
14178 gptr, basic_streambuf_char_epptr(&this->base));
14181 }else if((mode & OPENMODE_out) && pptr) {
14182 if(way == SEEKDIR_cur)
14183 off += pptr-eback;
14184 else if(way == SEEKDIR_end)
14185 off += this->seekhigh-eback;
14186 else if(way != SEEKDIR_beg)
14187 off = -1;
14189 if(off<0 || off>this->seekhigh-eback)
14190 off = -1;
14191 else
14192 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
14193 }else {
14194 off = -1;
14197 ret->pos = off;
14198 return ret;
14201 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
14202 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
14203 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
14204 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
14206 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
14208 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
14209 *ret = pos;
14210 return ret;
14213 return strstreambuf_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
14216 /* ?underflow@strstreambuf@std@@MAEHXZ */
14217 /* ?underflow@strstreambuf@std@@MEAAHXZ */
14218 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
14219 int __thiscall strstreambuf_underflow(strstreambuf *this)
14221 char *gptr = basic_streambuf_char_gptr(&this->base);
14222 char *pptr;
14224 TRACE("(%p)\n", this);
14226 if(!gptr)
14227 return EOF;
14229 if(gptr < basic_streambuf_char_egptr(&this->base))
14230 return (unsigned char)(*gptr);
14232 pptr = basic_streambuf_char_gptr(&this->base);
14233 if(pptr > this->seekhigh)
14234 this->seekhigh = pptr;
14236 if(this->seekhigh <= gptr)
14237 return EOF;
14239 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
14240 gptr, this->seekhigh);
14241 return (unsigned char)(*gptr);
14244 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
14246 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
14249 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
14251 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
14254 /* ??0ostrstream@std@@QAE@PADHH@Z */
14255 #if STREAMSIZE_BITS == 64
14256 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
14257 #else
14258 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
14259 #endif
14260 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
14262 basic_ios_char *basic_ios;
14264 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
14266 if(virt_init) {
14267 this->base.vbtable = ostrstream_vbtable;
14268 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
14269 INIT_BASIC_IOS_VTORDISP(basic_ios);
14270 basic_ios_char_ctor(basic_ios);
14271 }else {
14272 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
14275 strstreambuf_ctor_get_put(&this->buf, buf, size,
14276 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
14277 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, FALSE);
14278 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
14279 return this;
14282 /* ??1ostrstream@std@@UAE@XZ */
14283 /* ??1ostrstream@std@@UEAA@XZ */
14284 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
14285 void __thiscall ostrstream_dtor(basic_ios_char *base)
14287 ostrstream *this = ostrstream_from_basic_ios(base);
14289 TRACE("(%p)\n", this);
14291 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
14292 strstreambuf_dtor(&this->buf);
14295 static void ostrstream_vbase_dtor(ostrstream *this)
14297 TRACE("(%p)\n", this);
14299 ostrstream_dtor(ostrstream_to_basic_ios(this));
14300 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
14303 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
14304 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
14306 ostrstream *this = ostrstream_from_basic_ios(base);
14308 TRACE("(%p %x)\n", this, flags);
14310 if(flags & 2) {
14311 /* we have an array, with the number of elements stored before the first object */
14312 INT_PTR i, *ptr = (INT_PTR *)this-1;
14314 for(i=*ptr-1; i>=0; i--)
14315 ostrstream_vbase_dtor(this+i);
14316 MSVCRT_operator_delete(ptr);
14317 } else {
14318 ostrstream_vbase_dtor(this);
14319 if(flags & 1)
14320 MSVCRT_operator_delete(this);
14323 return this;
14326 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
14328 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
14331 /* ??1istrstream@std@@UAE@XZ */
14332 /* ??1istrstream@std@@UEAA@XZ */
14333 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
14334 void __thiscall istrstream_dtor(basic_ios_char *base)
14336 istrstream *this = istrstream_from_basic_ios(base);
14338 TRACE("(%p)\n", this);
14340 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
14341 strstreambuf_dtor(&this->buf);
14344 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
14346 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
14349 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
14351 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
14354 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@M@0@@Z */
14355 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@M@0@@Z */
14356 basic_ostream_char* __cdecl basic_ostream_char_print_complex_float(basic_ostream_char *ostr, const complex_float *val)
14358 struct {
14359 basic_ostringstream_char obj;
14360 basic_ios_char vbase;
14361 } oss;
14362 ios_base *ostringstream_ios_base, *ostream_ios_base;
14363 locale loc;
14364 basic_string_char str;
14365 basic_ostringstream_char_ctor(&oss.obj);
14366 ostringstream_ios_base = &oss.vbase.base;
14367 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14368 TRACE("(%p %p)\n", ostr, val);
14370 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14371 locale_dtor(&loc);
14372 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14373 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14375 basic_ostream_char_print_ch(&oss.obj.base, '(');
14376 basic_ostream_char_print_float(&oss.obj.base, val->real);
14377 basic_ostream_char_print_ch(&oss.obj.base, ',');
14378 basic_ostream_char_print_float(&oss.obj.base, val->imag);
14379 basic_ostream_char_print_ch(&oss.obj.base, ')');
14381 basic_ostringstream_char_str_get(&oss.obj, &str);
14382 basic_ostringstream_char_dtor(&oss.vbase);
14383 basic_ostream_char_print_bstr(ostr, &str);
14384 MSVCP_basic_string_char_dtor(&str);
14385 return ostr;
14388 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@N@0@@Z */
14389 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@N@0@@Z */
14390 basic_ostream_char* __cdecl basic_ostream_char_print_complex_double(basic_ostream_char *ostr, const complex_double *val)
14392 struct {
14393 basic_ostringstream_char obj;
14394 basic_ios_char vbase;
14395 } oss;
14396 ios_base *ostringstream_ios_base, *ostream_ios_base;
14397 locale loc;
14398 basic_string_char str;
14399 basic_ostringstream_char_ctor(&oss.obj);
14400 ostringstream_ios_base = &oss.vbase.base;
14401 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14402 TRACE("(%p %p)\n", ostr, val);
14404 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14405 locale_dtor(&loc);
14406 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14407 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14409 basic_ostream_char_print_ch(&oss.obj.base, '(');
14410 basic_ostream_char_print_double(&oss.obj.base, val->real);
14411 basic_ostream_char_print_ch(&oss.obj.base, ',');
14412 basic_ostream_char_print_double(&oss.obj.base, val->imag);
14413 basic_ostream_char_print_ch(&oss.obj.base, ')');
14415 basic_ostringstream_char_str_get(&oss.obj, &str);
14416 basic_ostringstream_char_dtor(&oss.vbase);
14417 basic_ostream_char_print_bstr(ostr, &str);
14418 MSVCP_basic_string_char_dtor(&str);
14419 return ostr;
14422 /* ??$?6odu?$char_traits@d@std@@@std@@yaaav?$basic_ostream@du?$char_traits@d@std@@@0@aav10@abv?$complex@o@0@@Z */
14423 /* ??$?6ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@O@0@@Z */
14424 basic_ostream_char* __cdecl basic_ostream_char_print_complex_ldouble(basic_ostream_char *ostr, const complex_double *val)
14426 struct {
14427 basic_ostringstream_char obj;
14428 basic_ios_char vbase;
14429 } oss;
14430 ios_base *ostringstream_ios_base, *ostream_ios_base;
14431 locale loc;
14432 basic_string_char str;
14433 basic_ostringstream_char_ctor(&oss.obj);
14434 ostringstream_ios_base = &oss.vbase.base;
14435 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
14436 TRACE("(%p %p)\n", ostr, val);
14438 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
14439 locale_dtor(&loc);
14440 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
14441 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
14443 basic_ostream_char_print_ch(&oss.obj.base, '(');
14444 basic_ostream_char_print_ldouble(&oss.obj.base, val->real);
14445 basic_ostream_char_print_ch(&oss.obj.base, ',');
14446 basic_ostream_char_print_ldouble(&oss.obj.base, val->imag);
14447 basic_ostream_char_print_ch(&oss.obj.base, ')');
14449 basic_ostringstream_char_str_get(&oss.obj, &str);
14450 basic_ostringstream_char_dtor(&oss.vbase);
14451 basic_ostream_char_print_bstr(ostr, &str);
14452 MSVCP_basic_string_char_dtor(&str);
14453 return ostr;
14456 /* ?_File_size@sys@tr2@std@@YA_KPBD@Z */
14457 /* ?_File_size@sys@tr2@std@@YA_KPEBD@Z */
14458 ULONGLONG __cdecl tr2_sys__File_size(char const* path)
14460 WIN32_FILE_ATTRIBUTE_DATA fad;
14462 TRACE("(%s)\n", debugstr_a(path));
14463 if(!GetFileAttributesExA(path, GetFileExInfoStandard, &fad))
14464 return 0;
14465 if(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
14466 return 0;
14468 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
14471 /* ?_Equivalent@sys@tr2@std@@YAHPBD0@Z */
14472 /* ?_Equivalent@sys@tr2@std@@YAHPEBD0@Z */
14473 int __cdecl tr2_sys__Equivalent(char const* path1, char const* path2)
14475 HANDLE h1, h2;
14476 int ret;
14477 BY_HANDLE_FILE_INFORMATION info1, info2;
14478 TRACE("(%s %s)\n", debugstr_a(path1), debugstr_a(path2));
14480 h1 = CreateFileA(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14481 NULL, OPEN_EXISTING, 0, 0);
14482 h2 = CreateFileA(path2, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14483 NULL, OPEN_EXISTING, 0, 0);
14484 if(h1 == INVALID_HANDLE_VALUE) {
14485 if(h2 == INVALID_HANDLE_VALUE) {
14486 return -1;
14487 }else {
14488 CloseHandle(h2);
14489 return 0;
14491 }else if(h2 == INVALID_HANDLE_VALUE) {
14492 CloseHandle(h1);
14493 return 0;
14496 ret = GetFileInformationByHandle(h1, &info1) && GetFileInformationByHandle(h2, &info2);
14497 CloseHandle(h1);
14498 CloseHandle(h2);
14499 if(!ret)
14500 return -1;
14501 return (info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber
14502 && info1.nFileIndexHigh == info2.nFileIndexHigh
14503 && info1.nFileIndexLow == info2.nFileIndexLow
14507 /* ?_Current_get@sys@tr2@std@@YAPADAAY0BAE@D@Z */
14508 /* ?_Current_get@sys@tr2@std@@YAPEADAEAY0BAE@D@Z */
14509 char* __cdecl tr2_sys__Current_get(char *current_path)
14511 TRACE("(%s)\n", debugstr_a(current_path));
14513 if(!GetCurrentDirectoryA(MAX_PATH, current_path))
14514 return NULL;
14515 return current_path;
14518 /* ?_Current_set@sys@tr2@std@@YA_NPBD@Z */
14519 /* ?_Current_set@sys@tr2@std@@YA_NPEBD@Z */
14520 MSVCP_bool __cdecl tr2_sys__Current_set(char const* path)
14522 TRACE("(%s)\n", debugstr_a(path));
14523 return SetCurrentDirectoryA(path) != 0;
14526 /* ?_Make_dir@sys@tr2@std@@YAHPBD@Z */
14527 /* ?_Make_dir@sys@tr2@std@@YAHPEBD@Z */
14528 int __cdecl tr2_sys__Make_dir(char const* path)
14530 TRACE("(%s)\n", debugstr_a(path));
14532 if(!CreateDirectoryA(path, NULL)) {
14533 if(GetLastError() == ERROR_ALREADY_EXISTS)
14534 return 0;
14535 else
14536 return -1;
14539 return 1;
14542 /* ?_Remove_dir@sys@tr2@std@@YA_NPBD@Z */
14543 /* ?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z */
14544 MSVCP_bool __cdecl tr2_sys__Remove_dir(char const* path)
14546 TRACE("(%s)\n", debugstr_a(path));
14547 return RemoveDirectoryA(path) != 0;
14550 /* ?_Copy_file@sys@tr2@std@@YAHPBD0_N@Z */
14551 /* ?_Copy_file@sys@tr2@std@@YAHPEBD0_N@Z */
14552 int __cdecl tr2_sys__Copy_file(char const* source, char const* dest, MSVCP_bool fail_if_exists)
14554 TRACE("(%s %s %x)\n", debugstr_a(source), debugstr_a(dest), fail_if_exists);
14556 if(CopyFileA(source, dest, fail_if_exists))
14557 return ERROR_SUCCESS;
14558 return GetLastError();
14561 /* ?_Rename@sys@tr2@std@@YAHPBD0@Z */
14562 /* ?_Rename@sys@tr2@std@@YAHPEBD0@Z */
14563 int __cdecl tr2_sys__Rename(char const* old_path, char const* new_path)
14565 TRACE("(%s %s)\n", debugstr_a(old_path), debugstr_a(new_path));
14567 if(!old_path || !new_path)
14568 return ERROR_INVALID_PARAMETER;
14570 if(MoveFileExA(old_path, new_path, MOVEFILE_COPY_ALLOWED))
14571 return ERROR_SUCCESS;
14572 return GetLastError();
14575 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z */
14576 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z */
14577 struct space_info* __cdecl tr2_sys__Statvfs(struct space_info *ret, const char* path)
14579 ULARGE_INTEGER available, total, free;
14581 TRACE("(%s)\n", debugstr_a(path));
14583 if(!path || !GetDiskFreeSpaceExA(path, &available, &total, &free)) {
14584 ret->capacity = ret->free = ret->available = 0;
14585 }else {
14586 ret->capacity = total.QuadPart;
14587 ret->free = free.QuadPart;
14588 ret->available = available.QuadPart;
14590 return ret;
14593 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */
14594 /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z */
14595 enum file_type __cdecl tr2_sys__Stat(char const* path, int* err_code)
14597 DWORD attr;
14598 TRACE("(%s %p)\n", debugstr_a(path), err_code);
14599 if(!path) {
14600 *err_code = ERROR_INVALID_PARAMETER;
14601 return status_unknown;
14604 attr=GetFileAttributesA(path);
14605 if(attr == INVALID_FILE_ATTRIBUTES) {
14606 enum file_type ret;
14607 switch(GetLastError()) {
14608 case ERROR_FILE_NOT_FOUND:
14609 case ERROR_BAD_NETPATH:
14610 case ERROR_INVALID_NAME:
14611 case ERROR_BAD_PATHNAME:
14612 case ERROR_PATH_NOT_FOUND:
14613 ret = file_not_found;
14614 *err_code = ERROR_SUCCESS;
14615 break;
14616 default:
14617 ret = status_unknown;
14618 *err_code = GetLastError();
14620 return ret;
14623 *err_code = ERROR_SUCCESS;
14624 return (attr & FILE_ATTRIBUTE_DIRECTORY)?directory_file:regular_file;
14627 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */
14628 /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z */
14629 enum file_type __cdecl tr2_sys__Lstat(char const* path, int* err_code)
14631 return tr2_sys__Stat(path, err_code);
14634 /* ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z */
14635 /* ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z */
14636 __int64 __cdecl tr2_sys__Last_write_time(char const* path)
14638 HANDLE handle;
14639 FILETIME lwt;
14640 int ret;
14641 __int64 last_write_time;
14642 TRACE("(%s)\n", debugstr_a(path));
14644 handle = CreateFileA(path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14645 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14646 if(handle == INVALID_HANDLE_VALUE)
14647 return 0;
14649 ret = GetFileTime(handle, 0, 0, &lwt);
14650 CloseHandle(handle);
14651 if(!ret)
14652 return 0;
14654 last_write_time = (((__int64)lwt.dwHighDateTime)<< 32) + lwt.dwLowDateTime;
14655 last_write_time -= TICKS_1601_TO_1970;
14656 last_write_time /= TICKSPERSEC;
14657 return last_write_time;
14660 /* ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z */
14661 /* ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z */
14662 void __cdecl tr2_sys__Last_write_time_set(char const* path, __int64 newtime)
14664 HANDLE handle;
14665 FILETIME lwt;
14666 TRACE("(%s)\n", debugstr_a(path));
14668 handle = CreateFileA(path, FILE_WRITE_ATTRIBUTES,
14669 FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
14670 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
14671 if(handle == INVALID_HANDLE_VALUE)
14672 return;
14674 /* This is the implementation based on the test of msvcp110.
14675 * According to the test of msvcp120,
14676 * msvcp120's implementation does nothing. Obviously, this is a bug of windows.
14679 newtime *= TICKSPERSEC;
14680 newtime += TICKS_1601_TO_1970;
14681 lwt.dwLowDateTime = (DWORD)(newtime);
14682 lwt.dwHighDateTime = (DWORD)(newtime >> 32);
14683 SetFileTime(handle, 0, 0, &lwt);
14684 CloseHandle(handle);
14687 /* ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z */
14688 /* ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z */
14689 void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, enum file_type* type)
14691 HANDLE handle;
14692 WIN32_FIND_DATAA data;
14693 char temppath[MAX_PATH];
14695 TRACE("(%p %s %p %p)\n", target, debugstr_a(dest), err_code, type);
14696 if(strlen(dest) > MAX_PATH - 3) {
14697 *err_code = ERROR_BAD_PATHNAME;
14698 return NULL;
14700 strcpy(temppath, dest);
14701 strcat(temppath, "\\*");
14703 handle = FindFirstFileA(temppath, &data);
14704 if(handle == INVALID_HANDLE_VALUE) {
14705 *err_code = GetLastError();
14706 return NULL;
14708 while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, "..")) {
14709 if(!FindNextFileA(handle, &data)) {
14710 *err_code = ERROR_SUCCESS;
14711 *type = status_unknown;
14712 FindClose(handle);
14713 return NULL;
14717 strcpy(target, data.cFileName);
14718 *err_code = ERROR_SUCCESS;
14719 if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
14720 *type = directory_file;
14721 else
14722 *type = regular_file;
14723 return handle;
14726 /* ?_Read_dir@sys@tr2@std@@YAPADAAY0BAE@DPAXAAW4file_type@123@@Z */
14727 /* ?_Read_dir@sys@tr2@std@@YAPEADAEAY0BAE@DPEAXAEAW4file_type@123@@Z */
14728 char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type)
14730 WIN32_FIND_DATAA data;
14732 TRACE("(%p %p %p)\n", target, handle, type);
14734 do {
14735 if(!FindNextFileA(handle, &data)) {
14736 *type = status_unknown;
14737 *target = '\0';
14738 return target;
14740 } while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, ".."));
14742 strcpy(target, data.cFileName);
14743 if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
14744 *type = directory_file;
14745 else
14746 *type = regular_file;
14747 return target;
14750 /* ?_Close_dir@sys@tr2@std@@YAXPAX@Z */
14751 /* ?_Close_dir@sys@tr2@std@@YAXPEAX@Z */
14752 void __cdecl tr2_sys__Close_dir(void* handle)
14754 TRACE("(%p)\n", handle);
14756 FindClose(handle);
14759 /* ?_Link@sys@tr2@std@@YAHPBD0@Z */
14760 /* ?_Link@sys@tr2@std@@YAHPEBD0@Z */
14761 int __cdecl tr2_sys__Link(char const* existing_path, char const* new_path)
14763 TRACE("(%s %s)\n", debugstr_a(existing_path), debugstr_a(new_path));
14764 if(!existing_path || !new_path)
14765 return ERROR_INVALID_PARAMETER;
14767 if(CreateHardLinkA(new_path, existing_path, NULL))
14768 return ERROR_SUCCESS;
14769 return GetLastError();
14772 /* ?_Symlink@sys@tr2@std@@YAHPBD0@Z */
14773 /* ?_Symlink@sys@tr2@std@@YAHPEBD0@Z */
14774 int __cdecl tr2_sys__Symlink(char const* existing_file_name, char const* file_name)
14776 TRACE("(%s %s)\n", debugstr_a(existing_file_name), debugstr_a(file_name));
14777 if(!existing_file_name || !file_name)
14778 return ERROR_INVALID_PARAMETER;
14780 if(CreateSymbolicLinkA(file_name, existing_file_name, 0))
14781 return ERROR_SUCCESS;
14782 return GetLastError();
14785 /* ??0strstream@std@@QAE@PADHH@Z */
14786 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
14787 #if STREAMSIZE_BITS == 64
14788 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
14789 #else
14790 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
14791 #endif
14792 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
14794 basic_ios_char *basic_ios;
14796 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
14798 if(virt_init) {
14799 this->base.base1.vbtable = strstream_vbtable1;
14800 this->base.base2.vbtable = strstream_vbtable2;
14801 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
14802 INIT_BASIC_IOS_VTORDISP(basic_ios);
14803 basic_ios_char_ctor(basic_ios);
14804 }else {
14805 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
14808 strstreambuf_ctor_get_put(&this->buf, buf, size,
14809 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
14810 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
14811 basic_ios->base.vtable = &MSVCP_strstream_vtable;
14812 return this;
14815 /* ??1strstream@std@@UAE@XZ */
14816 /* ??1strstream@std@@UEAA@XZ */
14817 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
14818 void __thiscall strstream_dtor(basic_ios_char *base)
14820 strstream *this = strstream_from_basic_ios(base);
14822 TRACE("(%p)\n", this);
14824 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
14825 strstreambuf_dtor(&this->buf);
14828 static void strstream_vbase_dtor(strstream *this)
14830 TRACE("(%p)\n", this);
14832 strstream_dtor(strstream_to_basic_ios(this));
14833 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
14836 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
14837 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
14839 strstream *this = strstream_from_basic_ios(base);
14841 TRACE("(%p %x)\n", this, flags);
14843 if(flags & 2) {
14844 /* we have an array, with the number of elements stored before the first object */
14845 INT_PTR i, *ptr = (INT_PTR *)this-1;
14847 for(i=*ptr-1; i>=0; i--)
14848 strstream_vbase_dtor(this+i);
14849 MSVCRT_operator_delete(ptr);
14850 } else {
14851 strstream_vbase_dtor(this);
14852 if(flags & 1)
14853 MSVCRT_operator_delete(this);
14856 return this;
14859 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
14861 ios_base_precision_set(base, prec);
14864 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
14865 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
14866 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
14868 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
14870 ret->pfunc = setprecision_func;
14871 ret->arg = prec;
14872 return ret;
14875 static void __cdecl setw_func(ios_base *base, streamsize width)
14877 ios_base_width_set(base, width);
14880 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
14881 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
14882 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
14884 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
14886 ret->pfunc = setw_func;
14887 ret->arg = width;
14888 return ret;
14891 static void __cdecl resetioflags_func(ios_base *base, int mask)
14893 ios_base_setf_mask(base, 0, mask);
14896 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
14897 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
14899 TRACE("(%p %d)\n", ret, mask);
14901 ret->pfunc = resetioflags_func;
14902 ret->arg = mask;
14903 return ret;
14906 static void __cdecl setiosflags_func(ios_base *base, int mask)
14908 ios_base_setf_mask(base, FMTFLAG_mask, mask);
14911 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
14912 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
14914 TRACE("(%p %d)\n", ret, mask);
14916 ret->pfunc = setiosflags_func;
14917 ret->arg = mask;
14918 return ret;
14921 static void __cdecl setbase_func(ios_base *base, int set_base)
14923 if(set_base == 10)
14924 set_base = FMTFLAG_dec;
14925 else if(set_base == 8)
14926 set_base = FMTFLAG_oct;
14927 else if(set_base == 16)
14928 set_base = FMTFLAG_hex;
14929 else
14930 set_base = 0;
14932 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
14935 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
14936 manip_int* __cdecl setbase(manip_int *ret, int base)
14938 TRACE("(%p %d)\n", ret, base);
14940 ret->pfunc = setbase_func;
14941 ret->arg = base;
14942 return ret;
14945 static basic_filebuf_char filebuf_char_stdin;
14946 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
14947 struct {
14948 basic_istream_char obj;
14949 basic_ios_char vbase;
14950 } cin = { { 0 } };
14951 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
14952 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
14953 basic_istream_char *_Ptr_cin = &cin.obj;
14955 static basic_filebuf_wchar filebuf_short_stdin;
14956 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
14957 struct {
14958 basic_istream_wchar obj;
14959 basic_ios_wchar vbase;
14960 } ucin = { { 0 } };
14961 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
14962 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
14963 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
14965 static basic_filebuf_wchar filebuf_wchar_stdin;
14966 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
14967 struct {
14968 basic_istream_wchar obj;
14969 basic_ios_wchar vbase;
14970 } wcin = { { 0 } };
14971 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
14972 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
14973 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
14975 static basic_filebuf_char filebuf_char_stdout;
14976 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14977 struct {
14978 basic_ostream_char obj;
14979 basic_ios_char vbase;
14980 } cout = { { 0 } };
14981 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
14982 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
14983 basic_ostream_char *_Ptr_cout = &cout.obj;
14985 static basic_filebuf_wchar filebuf_short_stdout;
14986 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14987 struct {
14988 basic_ostream_wchar obj;
14989 basic_ios_wchar vbase;
14990 } ucout = { { 0 } };
14991 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
14992 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
14993 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
14995 static basic_filebuf_wchar filebuf_wchar_stdout;
14996 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
14997 struct {
14998 basic_ostream_wchar obj;
14999 basic_ios_wchar vbase;
15000 } wcout = { { 0 } };
15001 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15002 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15003 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
15005 static basic_filebuf_char filebuf_char_stderr;
15006 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15007 struct {
15008 basic_ostream_char obj;
15009 basic_ios_char vbase;
15010 } cerr = { { 0 } };
15011 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15012 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15013 basic_ostream_char *_Ptr_cerr = &cerr.obj;
15015 static basic_filebuf_wchar filebuf_short_stderr;
15016 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15017 struct {
15018 basic_ostream_wchar obj;
15019 basic_ios_wchar vbase;
15020 } ucerr = { { 0 } };
15021 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15022 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15023 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
15025 static basic_filebuf_wchar filebuf_wchar_stderr;
15026 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15027 struct {
15028 basic_ostream_wchar obj;
15029 basic_ios_wchar vbase;
15030 } wcerr = { { 0 } };
15031 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15032 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15033 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
15035 static basic_filebuf_char filebuf_char_log;
15036 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15037 struct {
15038 basic_ostream_char obj;
15039 basic_ios_char vbase;
15040 } clog = { { 0 } };
15041 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
15042 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
15043 basic_ostream_char *_Ptr_clog = &clog.obj;
15045 static basic_filebuf_wchar filebuf_short_log;
15046 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15047 struct {
15048 basic_ostream_wchar obj;
15049 basic_ios_wchar vbase;
15050 } uclog = { { 0 } };
15051 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
15052 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
15053 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
15055 static basic_filebuf_wchar filebuf_wchar_log;
15056 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15057 struct {
15058 basic_ostream_wchar obj;
15059 basic_ios_wchar vbase;
15060 } wclog = { { 0 } };
15061 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
15062 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
15063 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
15065 /* ?_Init_cnt@Init@ios_base@std@@0HA */
15066 int ios_base_Init__Init_cnt = -1;
15068 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
15069 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
15070 int* __cdecl ios_base_Init__Init_cnt_func(void)
15072 return &ios_base_Init__Init_cnt;
15075 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
15076 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
15077 void __cdecl ios_base_Init__Init_ctor(void *this)
15079 TRACE("(%p)\n", this);
15081 if(ios_base_Init__Init_cnt < 0)
15082 ios_base_Init__Init_cnt = 1;
15083 else
15084 ios_base_Init__Init_cnt++;
15087 /* ??0Init@ios_base@std@@QAE@XZ */
15088 /* ??0Init@ios_base@std@@QEAA@XZ */
15089 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
15090 void* __thiscall ios_base_Init_ctor(void *this)
15092 ios_base_Init__Init_ctor(this);
15093 return this;
15096 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
15097 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
15098 void __cdecl ios_base_Init__Init_dtor(void *this)
15100 TRACE("(%p)\n", this);
15102 ios_base_Init__Init_cnt--;
15103 if(!ios_base_Init__Init_cnt) {
15104 basic_ostream_char_flush(&cout.obj);
15105 basic_ostream_char_flush(&cerr.obj);
15106 basic_ostream_char_flush(&clog.obj);
15110 /* ??1Init@ios_base@std@@QAE@XZ */
15111 /* ??1Init@ios_base@std@@QEAA@XZ */
15112 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
15113 void __thiscall ios_base_Init_dtor(void *this)
15115 ios_base_Init__Init_dtor(this);
15118 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
15119 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
15120 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
15121 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
15123 TRACE("(%p %p)\n", this, rhs);
15124 return this;
15127 /* ?_Init_cnt@_Winit@std@@0HA */
15128 int _Winit__Init_cnt = -1;
15130 /* ??0_Winit@std@@QAE@XZ */
15131 /* ??0_Winit@std@@QEAA@XZ */
15132 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
15133 void* __thiscall _Winit_ctor(void *this)
15135 TRACE("(%p)\n", this);
15137 if(_Winit__Init_cnt < 0)
15138 _Winit__Init_cnt = 1;
15139 else
15140 _Winit__Init_cnt++;
15142 return this;
15145 /* ?_File_size@sys@tr2@std@@YA_KPB_W@Z */
15146 /* ?_File_size@sys@tr2@std@@YA_KPEB_W@Z */
15147 ULONGLONG __cdecl tr2_sys__File_size_wchar(WCHAR const* path)
15149 WIN32_FILE_ATTRIBUTE_DATA fad;
15151 TRACE("(%s)\n", debugstr_w(path));
15152 if(!GetFileAttributesExW(path, GetFileExInfoStandard, &fad))
15153 return 0;
15154 if(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
15155 return 0;
15157 return ((ULONGLONG)(fad.nFileSizeHigh) << 32) + fad.nFileSizeLow;
15160 /* ?_Equivalent@sys@tr2@std@@YAHPB_W0@Z */
15161 /* ?_Equivalent@sys@tr2@std@@YAHPEB_W0@Z */
15162 int __cdecl tr2_sys__Equivalent_wchar(WCHAR const* path1, WCHAR const* path2)
15164 HANDLE h1, h2;
15165 int ret;
15166 BY_HANDLE_FILE_INFORMATION info1, info2;
15167 TRACE("(%s %s)\n", debugstr_w(path1), debugstr_w(path2));
15169 h1 = CreateFileW(path1, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15170 NULL, OPEN_EXISTING, 0, 0);
15171 h2 = CreateFileW(path2, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
15172 NULL, OPEN_EXISTING, 0, 0);
15173 if(h1 == INVALID_HANDLE_VALUE) {
15174 if(h2 == INVALID_HANDLE_VALUE) {
15175 return -1;
15176 }else {
15177 CloseHandle(h2);
15178 return 0;
15180 }else if(h2 == INVALID_HANDLE_VALUE) {
15181 CloseHandle(h1);
15182 return 0;
15185 ret = GetFileInformationByHandle(h1, &info1) && GetFileInformationByHandle(h2, &info2);
15186 CloseHandle(h1);
15187 CloseHandle(h2);
15188 if(!ret)
15189 return -1;
15190 return (info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber
15191 && info1.nFileIndexHigh == info2.nFileIndexHigh
15192 && info1.nFileIndexLow == info2.nFileIndexLow
15196 /* ?_Current_get@sys@tr2@std@@YAPA_WAAY0BAE@_W@Z */
15197 /* ?_Current_get@sys@tr2@std@@YAPEA_WAEAY0BAE@_W@Z */
15198 WCHAR* __cdecl tr2_sys__Current_get_wchar(WCHAR *current_path)
15200 TRACE("(%s)\n", debugstr_w(current_path));
15202 if(!GetCurrentDirectoryW(MAX_PATH, current_path))
15203 return NULL;
15204 return current_path;
15207 /* ?_Current_set@sys@tr2@std@@YA_NPB_W@Z */
15208 /* ?_Current_set@sys@tr2@std@@YA_NPEB_W@Z */
15209 MSVCP_bool __cdecl tr2_sys__Current_set_wchar(WCHAR const* path)
15211 TRACE("(%s)\n", debugstr_w(path));
15212 return SetCurrentDirectoryW(path) != 0;
15215 /* ?_Make_dir@sys@tr2@std@@YAHPB_W@Z */
15216 /* ?_Make_dir@sys@tr2@std@@YAHPEB_W@Z */
15217 int __cdecl tr2_sys__Make_dir_wchar(WCHAR const* path)
15219 TRACE("(%s)\n", debugstr_w(path));
15221 if(!CreateDirectoryW(path, NULL)) {
15222 if(GetLastError() == ERROR_ALREADY_EXISTS)
15223 return 0;
15224 else
15225 return -1;
15228 return 1;
15231 /* ?_Remove_dir@sys@tr2@std@@YA_NPB_W@Z */
15232 /* ?_Remove_dir@sys@tr2@std@@YA_NPEB_W@Z */
15233 MSVCP_bool __cdecl tr2_sys__Remove_dir_wchar(WCHAR const* path)
15235 TRACE("(%s)\n", debugstr_w(path));
15236 return RemoveDirectoryW(path) != 0;
15239 /* ?_Copy_file@sys@tr2@std@@YAHPB_W0_N@Z */
15240 /* ?_Copy_file@sys@tr2@std@@YAHPEB_W0_N@Z */
15241 int __cdecl tr2_sys__Copy_file_wchar(WCHAR const* source, WCHAR const* dest, MSVCP_bool fail_if_exists)
15243 TRACE("(%s %s %x)\n", debugstr_w(source), debugstr_w(dest), fail_if_exists);
15245 if(CopyFileW(source, dest, fail_if_exists))
15246 return ERROR_SUCCESS;
15247 return GetLastError();
15250 /* ?_Rename@sys@tr2@std@@YAHPB_W0@Z */
15251 /* ?_Rename@sys@tr2@std@@YAHPEB_W0@Z */
15252 int __cdecl tr2_sys__Rename_wchar(WCHAR const* old_path, WCHAR const* new_path)
15254 TRACE("(%s %s)\n", debugstr_w(old_path), debugstr_w(new_path));
15256 if(!old_path || !new_path)
15257 return ERROR_INVALID_PARAMETER;
15259 if(MoveFileExW(old_path, new_path, MOVEFILE_COPY_ALLOWED))
15260 return ERROR_SUCCESS;
15261 return GetLastError();
15264 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z */
15265 /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z */
15266 struct space_info* __cdecl tr2_sys__Statvfs_wchar(struct space_info *ret, const WCHAR* path)
15268 ULARGE_INTEGER available, total, free;
15270 TRACE("(%s)\n", debugstr_w(path));
15272 if(!path || !GetDiskFreeSpaceExW(path, &available, &total, &free)) {
15273 ret->capacity = ret->free = ret->available = 0;
15274 }else {
15275 ret->capacity = total.QuadPart;
15276 ret->free = free.QuadPart;
15277 ret->available = available.QuadPart;
15279 return ret;
15282 /* ??1_Winit@std@@QAE@XZ */
15283 /* ??1_Winit@std@@QAE@XZ */
15284 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
15285 void __thiscall _Winit_dtor(void *this)
15287 TRACE("(%p)\n", this);
15289 _Winit__Init_cnt--;
15290 if(!_Winit__Init_cnt) {
15291 basic_ostream_wchar_flush(&wcout.obj);
15292 basic_ostream_wchar_flush(&wcerr.obj);
15293 basic_ostream_wchar_flush(&wclog.obj);
15297 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
15298 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
15299 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
15300 void* __thiscall _Winit_op_assign(void *this, void *rhs)
15302 TRACE("(%p %p)\n", this, rhs);
15303 return this;
15306 void init_io(void *base)
15308 #ifdef __x86_64__
15309 init_iosb_rtti(base);
15310 init_ios_base_rtti(base);
15311 init_basic_ios_char_rtti(base);
15312 init_basic_ios_wchar_rtti(base);
15313 init_basic_ios_short_rtti(base);
15314 init_basic_streambuf_char_rtti(base);
15315 init_basic_streambuf_wchar_rtti(base);
15316 init_basic_streambuf_short_rtti(base);
15317 init_basic_filebuf_char_rtti(base);
15318 init_basic_filebuf_wchar_rtti(base);
15319 init_basic_filebuf_short_rtti(base);
15320 init_basic_stringbuf_char_rtti(base);
15321 init_basic_stringbuf_wchar_rtti(base);
15322 init_basic_stringbuf_short_rtti(base);
15323 init_basic_ostream_char_rtti(base);
15324 init_basic_ostream_wchar_rtti(base);
15325 init_basic_ostream_short_rtti(base);
15326 init_basic_istream_char_rtti(base);
15327 init_basic_istream_wchar_rtti(base);
15328 init_basic_istream_short_rtti(base);
15329 init_basic_iostream_char_rtti(base);
15330 init_basic_iostream_wchar_rtti(base);
15331 init_basic_iostream_short_rtti(base);
15332 init_basic_ofstream_char_rtti(base);
15333 init_basic_ofstream_wchar_rtti(base);
15334 init_basic_ofstream_short_rtti(base);
15335 init_basic_ifstream_char_rtti(base);
15336 init_basic_ifstream_wchar_rtti(base);
15337 init_basic_ifstream_short_rtti(base);
15338 init_basic_fstream_char_rtti(base);
15339 init_basic_fstream_wchar_rtti(base);
15340 init_basic_fstream_short_rtti(base);
15341 init_basic_ostringstream_char_rtti(base);
15342 init_basic_ostringstream_wchar_rtti(base);
15343 init_basic_ostringstream_short_rtti(base);
15344 init_basic_istringstream_char_rtti(base);
15345 init_basic_istringstream_wchar_rtti(base);
15346 init_basic_istringstream_short_rtti(base);
15347 init_basic_stringstream_char_rtti(base);
15348 init_basic_stringstream_wchar_rtti(base);
15349 init_basic_stringstream_short_rtti(base);
15350 init_strstreambuf_rtti(base);
15351 init_strstream_rtti(base);
15352 init_ostrstream_rtti(base);
15353 #endif
15355 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
15356 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
15358 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
15359 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
15361 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
15362 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
15364 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
15365 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE);
15367 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
15368 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE);
15370 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
15371 basic_ostream_wchar_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE);
15373 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
15374 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE);
15376 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
15377 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE);
15379 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
15380 basic_ostream_wchar_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE);
15382 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
15383 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE);
15385 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
15386 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE);
15388 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
15389 basic_ostream_wchar_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE);
15392 void free_io(void)
15394 basic_istream_char_vbase_dtor(&cin.obj);
15395 basic_filebuf_char_dtor(&filebuf_char_stdin);
15397 basic_istream_wchar_vbase_dtor(&ucin.obj);
15398 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
15400 basic_istream_wchar_vbase_dtor(&wcin.obj);
15401 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
15403 basic_ostream_char_vbase_dtor(&cout.obj);
15404 basic_filebuf_char_dtor(&filebuf_char_stdout);
15406 basic_ostream_wchar_vbase_dtor(&ucout.obj);
15407 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
15409 basic_ostream_wchar_vbase_dtor(&wcout.obj);
15410 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
15412 basic_ostream_char_vbase_dtor(&cerr.obj);
15413 basic_filebuf_char_dtor(&filebuf_char_stderr);
15415 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
15416 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
15418 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
15419 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
15421 basic_ostream_char_vbase_dtor(&clog.obj);
15422 basic_filebuf_char_dtor(&filebuf_char_log);
15424 basic_ostream_wchar_vbase_dtor(&uclog.obj);
15425 basic_filebuf_wchar_dtor(&filebuf_short_log);
15427 basic_ostream_wchar_vbase_dtor(&wclog.obj);
15428 basic_filebuf_wchar_dtor(&filebuf_wchar_log);