winmm: Fix a memory leak in mciSendStringW (valgrind).
[wine.git] / dlls / msvcp90 / ios.c
blobd8f1e1c07380e290453d1195e596dd0271b5ed23
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 /* ?_Index@ios_base@std@@0HA */
33 int ios_base_Index = 0;
34 /* ?_Sync@ios_base@std@@0_NA */
35 MSVCP_bool ios_base_Sync = FALSE;
37 typedef struct {
38 streamoff off;
39 __int64 DECLSPEC_ALIGN(8) pos;
40 int state;
41 } fpos_int;
43 static inline const char* debugstr_fpos_int(fpos_int *fpos)
45 return wine_dbg_sprintf("fpos(%s %s %d)", wine_dbgstr_longlong(fpos->off), wine_dbgstr_longlong(fpos->pos), fpos->state);
48 typedef struct {
49 void (__cdecl *pfunc)(ios_base*, streamsize);
50 streamsize arg;
51 } manip_streamsize;
53 typedef struct {
54 void (__cdecl *pfunc)(ios_base*, int);
55 int arg;
56 } manip_int;
58 typedef enum {
59 INITFL_new = 0,
60 INITFL_open = 1,
61 INITFL_close = 2
62 } basic_filebuf__Initfl;
64 typedef struct {
65 basic_streambuf_char base;
66 codecvt_char *cvt;
67 #if _MSVCP_VER < 80
68 int state0;
69 char putback;
70 basic_string_char *conv;
71 #else
72 char putback;
73 #endif
74 MSVCP_bool wrotesome;
75 int state;
76 MSVCP_bool close;
77 FILE *file;
78 } basic_filebuf_char;
80 typedef struct {
81 basic_streambuf_wchar base;
82 codecvt_wchar *cvt;
83 #if _MSVCP_VER < 80
84 int state0;
85 wchar_t putback;
86 basic_string_char *conv;
87 #else
88 wchar_t putback;
89 #endif
90 MSVCP_bool wrotesome;
91 int state;
92 MSVCP_bool close;
93 FILE *file;
94 } basic_filebuf_wchar;
96 typedef enum {
97 STRINGBUF_allocated = 1,
98 STRINGBUF_no_write = 2,
99 STRINGBUF_no_read = 4,
100 STRINGBUF_append = 8,
101 STRINGBUF_at_end = 16
102 } basic_stringbuf_state;
104 typedef struct {
105 basic_streambuf_char base;
106 char *seekhigh;
107 int state;
108 char allocator; /* empty struct */
109 } basic_stringbuf_char;
111 typedef struct {
112 basic_streambuf_wchar base;
113 wchar_t *seekhigh;
114 int state;
115 char allocator; /* empty struct */
116 } basic_stringbuf_wchar;
118 typedef struct {
119 ios_base base;
120 basic_streambuf_char *strbuf;
121 struct _basic_ostream_char *stream;
122 char fillch;
123 } basic_ios_char;
125 typedef struct {
126 ios_base base;
127 basic_streambuf_wchar *strbuf;
128 struct _basic_ostream_wchar *stream;
129 wchar_t fillch;
130 } basic_ios_wchar;
132 typedef struct _basic_ostream_char {
133 const int *vbtable;
134 /* virtual inheritance
135 * basic_ios_char basic_ios;
137 } basic_ostream_char;
139 typedef struct _basic_ostream_wchar {
140 const int *vbtable;
141 /* virtual inheritance
142 * basic_ios_wchar basic_ios;
144 } basic_ostream_wchar;
146 typedef struct {
147 const int *vbtable;
148 streamsize count;
149 /* virtual inheritance
150 * basic_ios_char basic_ios;
152 } basic_istream_char;
154 typedef struct {
155 const int *vbtable;
156 streamsize count;
157 /* virtual inheritance
158 * basic_ios_wchar basic_ios;
160 } basic_istream_wchar;
162 typedef struct {
163 basic_istream_char base1;
164 basic_ostream_char base2;
165 /* virtual inheritance
166 * basic_ios_char basic_ios;
168 } basic_iostream_char;
170 typedef struct {
171 basic_istream_wchar base1;
172 basic_ostream_wchar base2;
173 /* virtual inheritance
174 * basic_ios_wchar basic_ios;
176 } basic_iostream_wchar;
178 typedef struct {
179 basic_ostream_char base;
180 basic_filebuf_char filebuf;
181 /* virtual inheritance
182 * basic_ios_char basic_ios;
184 } basic_ofstream_char;
186 typedef struct {
187 basic_ostream_wchar base;
188 basic_filebuf_wchar filebuf;
189 /* virtual inheritance
190 * basic_ios_wchar basic_ios;
192 } basic_ofstream_wchar;
194 typedef struct {
195 basic_istream_char base;
196 basic_filebuf_char filebuf;
197 /* virtual inheritance
198 * basic_ios_char basic_ios;
200 } basic_ifstream_char;
202 typedef struct {
203 basic_istream_wchar base;
204 basic_filebuf_wchar filebuf;
205 /* virtual inheritance
206 * basic_ios_wchar basic_ios;
208 } basic_ifstream_wchar;
210 typedef struct {
211 basic_iostream_char base;
212 basic_filebuf_char filebuf;
213 /* virtual inheritance
214 * basic_ios_char basic_ios;
216 } basic_fstream_char;
218 typedef struct {
219 basic_iostream_wchar base;
220 basic_filebuf_wchar filebuf;
221 /* virtual inheritance
222 * basic_ios_char basic_ios;
224 } basic_fstream_wchar;
226 typedef struct {
227 basic_ostream_char base;
228 basic_stringbuf_char strbuf;
229 /* virtual inheritance
230 * basic_ios_char basic_ios;
232 } basic_ostringstream_char;
234 typedef struct {
235 basic_ostream_wchar base;
236 basic_stringbuf_wchar strbuf;
237 /* virtual inheritance
238 * basic_ios_wchar basic_ios;
240 } basic_ostringstream_wchar;
242 typedef struct {
243 basic_istream_char base;
244 basic_stringbuf_char strbuf;
245 /* virtual inheritance
246 * basic_ios_char basic_ios;
248 } basic_istringstream_char;
250 typedef struct {
251 basic_istream_wchar base;
252 basic_stringbuf_wchar strbuf;
253 /* virtual inheritance
254 * basic_ios_wchar basic_ios;
256 } basic_istringstream_wchar;
258 typedef struct {
259 basic_iostream_char base;
260 basic_stringbuf_char strbuf;
261 /* virtual inheritance
262 * basic_ios_char basic_ios;
264 } basic_stringstream_char;
266 typedef struct {
267 basic_iostream_wchar base;
268 basic_stringbuf_wchar strbuf;
269 /* virtual inheritance
270 * basic_ios_wchar basic_ios;
272 } basic_stringstream_wchar;
274 typedef enum {
275 STRSTATE_Allocated = 1,
276 STRSTATE_Constant = 2,
277 STRSTATE_Dynamic = 4,
278 STRSTATE_Frozen = 8
279 } strstreambuf__Strstate;
281 typedef struct {
282 basic_streambuf_char base;
283 streamsize minsize;
284 char *endsave;
285 char *seekhigh;
286 int strmode;
287 void* (__cdecl *palloc)(MSVCP_size_t);
288 void (__cdecl *pfree)(void*);
289 } strstreambuf;
291 typedef struct {
292 basic_ostream_char base;
293 strstreambuf buf;
294 /* virtual inheritance
295 * basic_ios_char basic_ios;
297 } ostrstream;
299 typedef struct {
300 basic_istream_char base;
301 strstreambuf buf;
302 /* virtual inheritance
303 * basic_ios_char basic_ios;
305 } istrstream;
307 typedef struct {
308 basic_iostream_char base;
309 strstreambuf buf;
310 /* virtual inheritance
311 * basic_ios_char basic_ios;
313 } strstream;
315 #if _MSVCP_VER >= 100
316 #define VBTABLE_ALIGN 8
317 #else
318 #define VBTABLE_ALIGN 4
319 #endif
321 extern const vtable_ptr MSVCP_iosb_vtable;
323 /* ??_7ios_base@std@@6B@ */
324 extern const vtable_ptr MSVCP_ios_base_vtable;
326 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
327 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
329 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
330 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
332 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
333 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
335 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
336 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
338 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
339 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
341 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
342 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
344 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
345 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
347 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
348 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
350 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
351 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
353 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
354 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
356 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
357 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
359 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
360 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
362 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
363 const int basic_ostream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_char), VBTABLE_ALIGN)};
364 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
365 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
367 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
368 const int basic_ostream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
369 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
370 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
372 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
373 const int basic_ostream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
374 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
375 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
377 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
378 const int basic_istream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_char), VBTABLE_ALIGN)};
379 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
380 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
382 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
383 const int basic_istream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
384 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
385 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
387 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
388 const int basic_istream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
389 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
390 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
392 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
393 const int basic_iostream_char_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)};
394 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
395 const int basic_iostream_char_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_char, base2)};
396 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
397 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
399 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
400 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
401 const int basic_iostream_wchar_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)};
402 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
403 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
404 const int basic_iostream_wchar_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_wchar, base2)};
405 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
406 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
407 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
408 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
410 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
411 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
412 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
413 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
415 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
416 const int basic_ofstream_wchar_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
417 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
418 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
420 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
421 const int basic_ofstream_short_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
422 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
423 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
425 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
426 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
427 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
428 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
430 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
431 const int basic_ifstream_wchar_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
432 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
433 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
435 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
436 const int basic_ifstream_short_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
437 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
438 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
440 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
441 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
442 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
443 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
444 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
445 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
447 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
448 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
449 const int basic_fstream_wchar_vbtable1[] = {0, sizeof(basic_fstream_wchar)};
450 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
451 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
452 const int basic_fstream_wchar_vbtable2[] = {0, sizeof(basic_fstream_wchar)-FIELD_OFFSET(basic_fstream_wchar, base.base2)};
453 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
454 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
455 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
456 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
458 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
459 const int basic_ostringstream_char_vbtable[] = {0, sizeof(basic_ostringstream_char)};
460 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
461 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
463 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
464 const int basic_ostringstream_wchar_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
465 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
466 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
468 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
469 const int basic_ostringstream_short_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
470 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
471 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
473 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
474 const int basic_istringstream_char_vbtable[] = {0, sizeof(basic_istringstream_char)};
475 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
476 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
478 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
479 const int basic_istringstream_wchar_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
480 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
481 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
483 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
484 const int basic_istringstream_short_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
485 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
486 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
488 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
489 const int basic_stringstream_char_vbtable1[] = {0, sizeof(basic_stringstream_char)};
490 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
491 const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_char)-FIELD_OFFSET(basic_stringstream_char, base.base2)};
492 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
493 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
495 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
496 const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
497 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
498 const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
499 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
500 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
502 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
503 const int basic_stringstream_short_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
504 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
505 const int basic_stringstream_short_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
506 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
507 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
509 /* ??_7strstreambuf@std@@6B */
510 extern const vtable_ptr MSVCP_strstreambuf_vtable;
512 static const int ostrstream_vbtable[] = {0, sizeof(ostrstream)};
513 extern const vtable_ptr MSVCP_ostrstream_vtable;
515 static const int istrstream_vbtable[] = {0, sizeof(istrstream)};
517 static const int strstream_vbtable1[] = {0, sizeof(strstream)};
518 static const int strstream_vbtable2[] = {0, sizeof(strstream)-FIELD_OFFSET(strstream, base.base2)};
519 extern const vtable_ptr MSVCP_strstream_vtable;
521 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
522 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
523 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
524 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
525 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
526 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
527 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
528 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
529 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
530 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
531 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
532 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
533 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
534 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
535 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
536 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
537 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
538 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
539 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
540 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
541 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
542 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
543 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
544 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
545 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
546 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
547 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
548 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
549 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
550 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
551 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
552 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
553 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
554 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
555 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
556 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
557 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
558 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
559 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
560 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
561 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
562 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
563 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
564 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
565 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
566 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
567 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
568 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
569 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
570 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
571 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
572 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
573 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
574 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
575 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
576 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
577 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
578 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
579 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
580 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
581 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
582 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
583 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
584 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
585 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
586 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
587 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
588 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
589 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
590 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
591 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
592 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
593 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
594 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
595 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
596 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
597 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
598 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
599 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
600 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
601 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
602 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
603 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
604 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
605 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
606 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
607 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
608 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
609 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
610 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
611 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
612 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
613 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
614 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
615 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
616 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
617 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
618 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
619 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
620 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
621 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
622 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
623 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
624 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
625 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
626 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
627 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
628 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
629 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
630 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
631 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
632 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
633 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
634 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
635 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
636 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
637 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
638 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
639 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
640 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
641 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
642 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
643 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
644 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
645 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
646 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
647 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
648 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
649 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
650 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
651 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
652 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
653 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
654 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
655 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
656 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
657 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
658 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
659 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
660 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
661 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
662 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
663 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
664 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
665 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
666 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
667 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
668 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
669 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
670 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
671 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
672 "?AVostrstream@std@@")
673 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
674 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
675 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
676 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
677 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
678 "?AVstrstream@std@@")
680 #ifndef __GNUC__
681 void __asm_dummy_vtables(void) {
682 #endif
683 __ASM_VTABLE(iosb,
684 VTABLE_ADD_FUNC(iosb_vector_dtor));
685 __ASM_VTABLE(ios_base,
686 VTABLE_ADD_FUNC(ios_base_vector_dtor));
687 __ASM_VTABLE(basic_ios_char,
688 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor));
689 __ASM_VTABLE(basic_ios_wchar,
690 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
691 __ASM_VTABLE(basic_ios_short,
692 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
693 __ASM_VTABLE(basic_streambuf_char,
694 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
695 #if _MSVCP_VER >= 100
696 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
697 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
698 #endif
699 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
700 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
701 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
702 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
703 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
704 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
705 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
706 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
707 #endif
708 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
709 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
710 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
711 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
712 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
713 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
714 __ASM_VTABLE(basic_streambuf_wchar,
715 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
716 #if _MSVCP_VER >= 100
717 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
718 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
719 #endif
720 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
721 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
722 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
723 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
724 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
725 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
726 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
727 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
728 #endif
729 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
730 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
731 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
732 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
733 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
734 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
735 __ASM_VTABLE(basic_streambuf_short,
736 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
737 #if _MSVCP_VER >= 100
738 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
739 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
740 #endif
741 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
742 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
743 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
744 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
745 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
746 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
747 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
748 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
749 #endif
750 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
751 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
752 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
753 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
754 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
755 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
756 __ASM_VTABLE(basic_filebuf_char,
757 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
758 #if _MSVCP_VER >= 100
759 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
760 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
761 #endif
762 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
763 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
764 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
765 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
766 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
767 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
768 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
769 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
770 #endif
771 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
772 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
773 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
774 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
775 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
776 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
777 __ASM_VTABLE(basic_filebuf_wchar,
778 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
779 #if _MSVCP_VER >= 100
780 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
781 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
782 #endif
783 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
784 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
785 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
786 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
787 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
788 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
789 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
790 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
791 #endif
792 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
793 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
794 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
795 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
796 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
797 VTABLE_ADD_FUNC(basic_filebuf_wchar_imbue));
798 __ASM_VTABLE(basic_filebuf_short,
799 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
800 #if _MSVCP_VER >= 100
801 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
802 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
803 #endif
804 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
805 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
806 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
807 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
808 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
809 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
810 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
811 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
812 #endif
813 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
814 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
815 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
816 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
817 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
818 VTABLE_ADD_FUNC(basic_filebuf_short_imbue));
819 __ASM_VTABLE(basic_stringbuf_char,
820 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
821 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
822 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
823 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
824 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
825 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
826 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
827 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
828 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
829 #endif
830 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
831 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
832 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
833 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
834 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
835 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
836 __ASM_VTABLE(basic_stringbuf_wchar,
837 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
838 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
839 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
840 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
841 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
842 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
843 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
844 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
845 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
846 #endif
847 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
848 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
849 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
850 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
851 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
852 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
853 __ASM_VTABLE(basic_stringbuf_short,
854 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
855 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
856 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
857 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
858 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
859 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
860 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
861 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
862 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
863 #endif
864 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
865 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
866 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
867 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
868 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
869 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
870 __ASM_VTABLE(basic_ostream_char,
871 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor));
872 __ASM_VTABLE(basic_ostream_wchar,
873 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
874 __ASM_VTABLE(basic_ostream_short,
875 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
876 __ASM_VTABLE(basic_istream_char,
877 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor));
878 __ASM_VTABLE(basic_istream_wchar,
879 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
880 __ASM_VTABLE(basic_istream_short,
881 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
882 __ASM_VTABLE(basic_iostream_char,
883 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor));
884 __ASM_VTABLE(basic_iostream_wchar,
885 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
886 __ASM_VTABLE(basic_iostream_short,
887 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
888 __ASM_VTABLE(basic_ofstream_char,
889 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor));
890 __ASM_VTABLE(basic_ofstream_wchar,
891 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
892 __ASM_VTABLE(basic_ofstream_short,
893 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
894 __ASM_VTABLE(basic_ifstream_char,
895 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor));
896 __ASM_VTABLE(basic_ifstream_wchar,
897 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
898 __ASM_VTABLE(basic_ifstream_short,
899 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
900 __ASM_VTABLE(basic_fstream_char,
901 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor));
902 __ASM_VTABLE(basic_fstream_wchar,
903 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
904 __ASM_VTABLE(basic_fstream_short,
905 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
906 __ASM_VTABLE(basic_ostringstream_char,
907 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor));
908 __ASM_VTABLE(basic_ostringstream_wchar,
909 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
910 __ASM_VTABLE(basic_ostringstream_short,
911 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
912 __ASM_VTABLE(basic_istringstream_char,
913 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor));
914 __ASM_VTABLE(basic_istringstream_wchar,
915 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
916 __ASM_VTABLE(basic_istringstream_short,
917 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
918 __ASM_VTABLE(basic_stringstream_char,
919 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor));
920 __ASM_VTABLE(basic_stringstream_wchar,
921 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
922 __ASM_VTABLE(basic_stringstream_short,
923 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
924 __ASM_VTABLE(strstreambuf,
925 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
926 VTABLE_ADD_FUNC(strstreambuf_overflow)
927 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
928 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
929 VTABLE_ADD_FUNC(strstreambuf_underflow)
930 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
931 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
932 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
933 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
934 #endif
935 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
936 VTABLE_ADD_FUNC(strstreambuf_seekoff)
937 VTABLE_ADD_FUNC(strstreambuf_seekpos)
938 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
939 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
940 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
941 __ASM_VTABLE(ostrstream,
942 VTABLE_ADD_FUNC(ostrstream_vector_dtor));
943 __ASM_VTABLE(strstream,
944 VTABLE_ADD_FUNC(strstream_vector_dtor));
945 #ifndef __GNUC__
947 #endif
949 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
950 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
951 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
952 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
954 TRACE("(%p %p %p %p)\n", this, first, next, last);
956 this->wbuf = first;
957 this->wpos = next;
958 this->wsize = last-next;
961 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
962 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
963 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
964 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
966 basic_streambuf_char_setp_next(this, first, first, last);
969 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
970 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
971 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
972 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
974 TRACE("(%p %p %p %p)\n", this, first, next, last);
976 this->rbuf = first;
977 this->rpos = next;
978 this->rsize = last-next;
981 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
982 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
983 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
984 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
986 TRACE("(%p)\n", this);
988 this->prbuf = &this->rbuf;
989 this->pwbuf = &this->wbuf;
990 this->prpos = &this->rpos;
991 this->pwpos = &this->wpos;
992 this->prsize = &this->rsize;
993 this->pwsize = &this->wsize;
995 basic_streambuf_char_setp(this, NULL, NULL);
996 basic_streambuf_char_setg(this, NULL, NULL, NULL);
999 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1000 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1001 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
1002 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
1004 TRACE("(%p %d)\n", this, uninitialized);
1005 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1006 #if _MSVCP_VER <= 100
1007 mutex_ctor(&this->lock);
1008 #endif
1009 return this;
1012 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
1013 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
1014 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
1015 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
1017 TRACE("(%p)\n", this);
1019 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1020 #if _MSVCP_VER <= 100
1021 mutex_ctor(&this->lock);
1022 #endif
1023 this->loc = MSVCRT_operator_new(sizeof(locale));
1024 locale_ctor(this->loc);
1025 basic_streambuf_char__Init_empty(this);
1027 return this;
1030 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
1031 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1032 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
1033 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
1035 TRACE("(%p)\n", this);
1037 #if _MSVCP_VER <= 100
1038 mutex_dtor(&this->lock);
1039 #endif
1040 locale_dtor(this->loc);
1041 MSVCRT_operator_delete(this->loc);
1044 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
1045 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
1047 TRACE("(%p %x)\n", this, flags);
1048 if(flags & 2) {
1049 /* we have an array, with the number of elements stored before the first object */
1050 INT_PTR i, *ptr = (INT_PTR *)this-1;
1052 for(i=*ptr-1; i>=0; i--)
1053 basic_streambuf_char_dtor(this+i);
1054 MSVCRT_operator_delete(ptr);
1055 } else {
1056 basic_streambuf_char_dtor(this);
1057 if(flags & 1)
1058 MSVCRT_operator_delete(this);
1061 return this;
1064 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1065 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1066 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
1067 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
1069 TRACE("(%p)\n", this);
1070 return *this->prpos ? *this->prsize : 0;
1073 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1074 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1075 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1076 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1078 TRACE("(%p)\n", this);
1079 (*this->prsize)++;
1080 (*this->prpos)--;
1081 return *this->prpos;
1084 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1085 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1086 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1087 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1089 TRACE("(%p)\n", this);
1090 (*this->prsize)--;
1091 return (*this->prpos)++;
1094 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1095 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1096 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1097 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1099 TRACE("(%p)\n", this);
1100 (*this->prsize)--;
1101 (*this->prpos)++;
1102 return *this->prpos;
1105 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1106 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1107 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1108 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1110 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1112 this->prbuf = gf;
1113 this->pwbuf = pf;
1114 this->prpos = gn;
1115 this->pwpos = pn;
1116 this->prsize = gc;
1117 this->pwsize = pc;
1120 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1121 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1122 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1123 #if _MSVCP_VER >= 100
1124 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1125 #else
1126 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1127 #endif
1128 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1130 TRACE("(%p)\n", this);
1131 #if _MSVCP_VER <= 100
1132 mutex_lock(&this->lock);
1133 #endif
1136 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1137 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1138 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1139 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1141 TRACE("(%p)\n", this);
1142 return *this->pwpos ? *this->pwsize : 0;
1145 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1146 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1147 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1148 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1150 TRACE("(%p)\n", this);
1151 (*this->pwsize)--;
1152 return (*this->pwpos)++;
1155 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1156 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1157 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1158 #if _MSVCP_VER >= 100
1159 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1160 #else
1161 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1162 #endif
1163 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1165 TRACE("(%p)\n", this);
1166 return EOF;
1169 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1170 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1171 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1172 #if _MSVCP_VER >= 100
1173 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1174 #else
1175 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1176 #endif
1177 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1179 int ret;
1181 TRACE("(%p)\n", this);
1183 if(call_basic_streambuf_char_underflow(this)==EOF)
1184 return EOF;
1186 ret = (unsigned char)**this->prpos;
1187 (*this->prsize)--;
1188 (*this->prpos)++;
1189 return ret;
1192 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1193 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1194 #if STREAMSIZE_BITS == 64
1195 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1196 #else
1197 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1198 #endif
1199 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1200 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1201 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1202 #else
1203 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1204 #endif
1205 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1207 streamsize copied, chunk;
1208 int c;
1210 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1212 for(copied=0; copied<count && size;) {
1213 chunk = basic_streambuf_char__Gnavail(this);
1214 if(chunk > count-copied)
1215 chunk = count-copied;
1217 if(chunk > 0) {
1218 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1219 *this->prpos += chunk;
1220 *this->prsize -= chunk;
1221 copied += chunk;
1222 size -= chunk;
1223 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1224 ptr[copied] = c;
1225 copied++;
1226 size--;
1227 }else {
1228 break;
1232 return copied;
1235 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1236 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1237 #if STREAMSIZE_BITS == 64
1238 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1239 #else
1240 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1241 #endif
1242 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1244 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1245 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1248 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1249 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1250 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1251 #if _MSVCP_VER >= 100
1252 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1253 #else
1254 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1255 #endif
1256 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1258 TRACE("(%p)\n", this);
1259 #if _MSVCP_VER <= 100
1260 mutex_unlock(&this->lock);
1261 #endif
1264 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1265 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1266 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1267 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1269 TRACE("(%p)\n", this);
1270 return *this->prbuf;
1273 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1274 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1275 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1276 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1278 TRACE("(%p)\n", this);
1279 return *this->prpos;
1282 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1283 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1284 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1285 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1287 TRACE("(%p)\n", this);
1288 return *this->prpos+*this->prsize;
1291 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1292 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1293 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1294 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1296 TRACE("(%p)\n", this);
1297 return *this->pwpos+*this->pwsize;
1300 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1301 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1302 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1303 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1305 TRACE("(%p %d)\n", this, off);
1306 *this->prpos += off;
1307 *this->prsize -= off;
1310 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1311 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1312 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1313 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
1315 TRACE("(%p)\n", this);
1316 return locale_copy_ctor(ret, this->loc);
1319 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1320 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1321 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1322 #if _MSVCP_VER >= 100
1323 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_char*, const locale*), (this, loc))
1324 #elif _MSVCP_VER >= 80
1325 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_char*, const locale*), (this, loc))
1326 #else
1327 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_char*, const locale*), (this, loc))
1328 #endif
1329 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1331 TRACE("(%p %p)\n", this, loc);
1334 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1335 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1336 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1337 #if _MSVCP_VER >= 100
1338 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 12, int, (basic_streambuf_char*, int), (this, ch))
1339 #else
1340 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, int, (basic_streambuf_char*, int), (this, ch))
1341 #endif
1342 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1344 TRACE("(%p %d)\n", this, ch);
1345 return EOF;
1348 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1349 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1350 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1351 #if _MSVCP_VER >= 100
1352 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*, int), (this, ch))
1353 #else
1354 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, int, (basic_streambuf_char*, int), (this, ch))
1355 #endif
1356 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1358 TRACE("(%p %d)\n", this, ch);
1359 return EOF;
1362 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1363 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1364 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1365 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1367 TRACE("(%p)\n", this);
1368 return *this->pwbuf;
1371 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1372 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1373 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1374 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1376 TRACE("(%p %d)\n", this, off);
1377 *this->pwpos += off;
1378 *this->pwsize -= off;
1381 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1382 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1383 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1384 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1386 TRACE("(%p)\n", this);
1387 return *this->pwpos;
1390 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1391 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1392 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1393 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1395 TRACE("(%p %p)\n", this, loc);
1396 memcpy(ret, this->loc, sizeof(locale));
1397 call_basic_streambuf_char_imbue(this, loc);
1398 locale_copy_ctor(this->loc, loc);
1399 return ret;
1402 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1403 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1404 #if STREAMOFF_BITS == 64
1405 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1406 #else
1407 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1408 #endif
1409 #if _MSVCP_VER >= 100
1410 #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))
1411 #elif _MSVCP_VER >= 80
1412 #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))
1413 #else
1414 #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))
1415 #endif
1416 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1417 fpos_int *ret, streamoff off, int way, int mode)
1419 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1420 ret->off = -1;
1421 ret->pos = 0;
1422 ret->state = 0;
1423 return ret;
1426 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1427 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1428 #if STREAMOFF_BITS == 64
1429 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1430 #else
1431 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1432 #endif
1433 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1434 fpos_int *ret, streamoff off, int way, int mode)
1436 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1437 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1440 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1441 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1442 #if STREAMOFF_BITS == 64
1443 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 24)
1444 #else
1445 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1446 #endif
1447 fpos_int* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1448 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
1450 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1451 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1454 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1455 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1456 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1457 #if _MSVCP_VER >= 100
1458 #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))
1459 #elif _MSVCP_VER >= 80
1460 #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))
1461 #else
1462 #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))
1463 #endif
1464 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1465 fpos_int *ret, fpos_int pos, int mode)
1467 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1468 ret->off = -1;
1469 ret->pos = 0;
1470 ret->state = 0;
1471 return ret;
1474 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1475 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1476 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1477 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1478 fpos_int *ret, fpos_int pos, int mode)
1480 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1481 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1484 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1485 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1486 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1487 fpos_int* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1488 fpos_int *ret, fpos_int pos, unsigned int mode)
1490 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1491 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1494 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1495 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1496 #if STREAMSIZE_BITS == 64
1497 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1498 #else
1499 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1500 #endif
1501 #if _MSVCP_VER >= 100
1502 #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))
1503 #elif _MSVCP_VER >= 80
1504 #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))
1505 #else
1506 #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))
1507 #endif
1508 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1510 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1511 return this;
1514 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1515 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1516 #if STREAMSIZE_BITS == 64
1517 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1518 #else
1519 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1520 #endif
1521 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1523 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1524 return call_basic_streambuf_char_setbuf(this, buf, count);
1527 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1528 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1529 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1530 #if _MSVCP_VER >= 100
1531 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1532 #elif _MSVCP_VER >= 80
1533 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1534 #else
1535 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1536 #endif
1537 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1539 TRACE("(%p)\n", this);
1540 return 0;
1543 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1544 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1545 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1546 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1548 TRACE("(%p)\n", this);
1549 return call_basic_streambuf_char_sync(this);
1552 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1553 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1554 #if STREAMSIZE_BITS == 64
1555 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1556 #else
1557 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1558 #endif
1559 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1561 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1562 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1565 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1566 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1567 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1568 #if _MSVCP_VER >= 100
1569 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1570 #else
1571 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1572 #endif
1573 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1575 TRACE("(%p)\n", this);
1576 return 0;
1579 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1580 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1581 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1582 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1584 streamsize ret;
1586 TRACE("(%p)\n", this);
1588 ret = basic_streambuf_char__Gnavail(this);
1589 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1592 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1593 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1594 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1595 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1597 TRACE("(%p %d)\n", this, ch);
1598 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1599 (*this->prsize)++;
1600 (*this->prpos)--;
1601 return (unsigned char)ch;
1604 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1607 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1608 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1609 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1610 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1612 TRACE("(%p %d)\n", this, ch);
1613 return basic_streambuf_char__Pnavail(this) ?
1614 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1615 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1618 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1619 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1620 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1621 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1623 TRACE("(%p)\n", this);
1624 if(*this->prpos && *this->prpos>*this->prbuf) {
1625 (*this->prsize)++;
1626 (*this->prpos)--;
1627 return (unsigned char)**this->prpos;
1630 return call_basic_streambuf_char_pbackfail(this, EOF);
1633 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1634 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1635 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1636 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1638 TRACE("(%p)\n", this);
1639 if(basic_streambuf_char__Gnavail(this))
1640 basic_streambuf_char__Gninc(this);
1641 else
1642 call_basic_streambuf_char_uflow(this);
1645 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1646 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1647 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1648 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1650 TRACE("(%p)\n", this);
1651 return basic_streambuf_char__Gnavail(this) ?
1652 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1655 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1656 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1657 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1658 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1660 TRACE("(%p)\n", this);
1661 return basic_streambuf_char__Gnavail(this) ?
1662 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1665 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1666 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1667 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1668 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1670 TRACE("(%p)\n", this);
1672 if(basic_streambuf_char__Gnavail(this) > 1)
1673 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1674 return basic_streambuf_char_sbumpc(this)==EOF ?
1675 EOF : basic_streambuf_char_sgetc(this);
1678 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1679 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1680 #if STREAMSIZE_BITS == 64
1681 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1682 #else
1683 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1684 #endif
1685 #if _MSVCP_VER >= 100
1686 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1687 #else
1688 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1689 #endif
1690 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1692 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1693 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1696 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1697 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1698 #if STREAMSIZE_BITS == 64
1699 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1700 #else
1701 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1702 #endif
1703 #if _MSVCP_VER >= 100
1704 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1705 #elif _MSVCP_VER >= 80
1706 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1707 #else
1708 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1709 #endif
1710 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1712 streamsize copied, chunk;
1714 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1716 for(copied=0; copied<count;) {
1717 chunk = basic_streambuf_char__Pnavail(this);
1718 if(chunk > count-copied)
1719 chunk = count-copied;
1721 if(chunk > 0) {
1722 memcpy(*this->pwpos, ptr+copied, chunk);
1723 *this->pwpos += chunk;
1724 *this->pwsize -= chunk;
1725 copied += chunk;
1726 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1727 copied++;
1728 }else {
1729 break;
1733 return copied;
1736 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1737 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1738 #if STREAMSIZE_BITS == 64
1739 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
1740 #else
1741 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1742 #endif
1743 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1745 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1746 return call_basic_streambuf_char_xsputn(this, ptr, count);
1749 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1750 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1751 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1752 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1753 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1754 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1756 TRACE("(%p %p %p %p)\n", this, first, next, last);
1758 this->wbuf = first;
1759 this->wpos = next;
1760 this->wsize = last-next;
1763 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1764 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1765 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1766 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1767 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1768 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1770 basic_streambuf_wchar_setp_next(this, first, first, last);
1773 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1774 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1775 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1776 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1777 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1778 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1780 TRACE("(%p %p %p %p)\n", this, first, next, last);
1782 this->rbuf = first;
1783 this->rpos = next;
1784 this->rsize = last-next;
1787 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1788 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1789 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1790 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1791 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1792 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1794 TRACE("(%p)\n", this);
1796 this->prbuf = &this->rbuf;
1797 this->pwbuf = &this->wbuf;
1798 this->prpos = &this->rpos;
1799 this->pwpos = &this->wpos;
1800 this->prsize = &this->rsize;
1801 this->pwsize = &this->wsize;
1803 basic_streambuf_wchar_setp(this, NULL, NULL);
1804 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1807 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1808 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1809 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
1810 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1812 TRACE("(%p %d)\n", this, uninitialized);
1813 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1814 #if _MSVCP_VER <= 100
1815 mutex_ctor(&this->lock);
1816 #endif
1817 return this;
1820 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1821 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1822 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1823 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1825 TRACE("(%p %d)\n", this, uninitialized);
1826 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1827 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1828 return this;
1831 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1832 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1833 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
1834 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1836 TRACE("(%p)\n", this);
1838 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1839 #if _MSVCP_VER <= 100
1840 mutex_ctor(&this->lock);
1841 #endif
1842 this->loc = MSVCRT_operator_new(sizeof(locale));
1843 locale_ctor(this->loc);
1844 basic_streambuf_wchar__Init_empty(this);
1846 return this;
1849 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1850 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1851 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1852 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1854 TRACE("(%p)\n", this);
1855 basic_streambuf_wchar_ctor(this);
1856 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1857 return this;
1860 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1861 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1862 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1863 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1864 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1865 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1867 TRACE("(%p)\n", this);
1869 #if _MSVCP_VER <= 100
1870 mutex_dtor(&this->lock);
1871 #endif
1872 locale_dtor(this->loc);
1873 MSVCRT_operator_delete(this->loc);
1876 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
1877 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1879 TRACE("(%p %x)\n", this, flags);
1880 if(flags & 2) {
1881 /* we have an array, with the number of elements stored before the first object */
1882 INT_PTR i, *ptr = (INT_PTR *)this-1;
1884 for(i=*ptr-1; i>=0; i--)
1885 basic_streambuf_wchar_dtor(this+i);
1886 MSVCRT_operator_delete(ptr);
1887 } else {
1888 basic_streambuf_wchar_dtor(this);
1889 if(flags & 1)
1890 MSVCRT_operator_delete(this);
1893 return this;
1896 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1897 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1898 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1899 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1900 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
1901 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1903 TRACE("(%p)\n", this);
1904 return *this->prpos ? *this->prsize : 0;
1907 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1908 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1909 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1910 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1911 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1912 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1914 TRACE("(%p)\n", this);
1915 (*this->prsize)++;
1916 (*this->prpos)--;
1917 return *this->prpos;
1920 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1921 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1922 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1923 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1924 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1925 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1927 TRACE("(%p)\n", this);
1928 (*this->prsize)--;
1929 return (*this->prpos)++;
1932 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1933 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1934 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1935 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1936 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
1937 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1939 TRACE("(%p)\n", this);
1940 (*this->prsize)--;
1941 (*this->prpos)++;
1942 return *this->prpos;
1945 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1946 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1947 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1948 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1949 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1950 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)
1952 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1954 this->prbuf = gf;
1955 this->pwbuf = pf;
1956 this->prpos = gn;
1957 this->pwpos = pn;
1958 this->prsize = gc;
1959 this->pwsize = pc;
1962 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1963 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1964 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1965 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1966 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
1967 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
1969 TRACE("(%p)\n", this);
1970 #if _MSVCP_VER <= 100
1971 mutex_lock(&this->lock);
1972 #endif
1975 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1976 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1977 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1978 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1979 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
1980 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
1982 TRACE("(%p)\n", this);
1983 return *this->pwpos ? *this->pwsize : 0;
1986 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1987 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1988 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1989 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1990 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
1991 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
1993 TRACE("(%p)\n", this);
1994 (*this->pwsize)--;
1995 return (*this->pwpos)++;
1998 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1999 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2000 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2001 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2002 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
2003 #if _MSVCP_VER >= 100
2004 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
2005 #else
2006 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
2007 #endif
2008 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
2010 TRACE("(%p)\n", this);
2011 return WEOF;
2014 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2015 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2016 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2017 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2018 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
2019 #if _MSVCP_VER >= 100
2020 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
2021 #else
2022 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
2023 #endif
2024 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
2026 int ret;
2028 TRACE("(%p)\n", this);
2030 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
2031 return WEOF;
2033 ret = **this->prpos;
2034 (*this->prsize)--;
2035 (*this->prpos)++;
2036 return ret;
2039 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
2040 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
2041 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
2042 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
2043 #if STREAMSIZE_BITS == 64
2044 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
2045 #else
2046 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
2047 #endif
2048 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2049 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
2050 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
2051 #else
2052 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
2053 #endif
2054 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2056 streamsize copied, chunk;
2057 unsigned short c;
2059 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2061 for(copied=0; copied<count && size;) {
2062 chunk = basic_streambuf_wchar__Gnavail(this);
2063 if(chunk > count-copied)
2064 chunk = count-copied;
2066 if(chunk > 0) {
2067 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
2068 *this->prpos += chunk;
2069 *this->prsize -= chunk;
2070 copied += chunk;
2071 size -= chunk*sizeof(wchar_t);
2072 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
2073 ptr[copied] = c;
2074 copied++;
2075 size--;
2076 }else {
2077 break;
2081 return copied;
2084 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
2085 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
2086 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
2087 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
2088 #if STREAMSIZE_BITS == 64
2089 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
2090 #else
2091 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
2092 #endif
2093 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2095 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2096 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
2099 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2100 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2101 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2102 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2103 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
2104 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
2106 TRACE("(%p)\n", this);
2107 #if _MSVCP_VER <= 100
2108 mutex_unlock(&this->lock);
2109 #endif
2112 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2113 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2114 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2115 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2116 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2117 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2119 TRACE("(%p)\n", this);
2120 return *this->prbuf;
2123 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2124 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2125 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2126 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2127 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2128 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2130 TRACE("(%p)\n", this);
2131 return *this->prpos;
2134 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2135 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2136 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2137 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2138 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2139 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2141 TRACE("(%p)\n", this);
2142 return *this->prpos+*this->prsize;
2145 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2146 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2147 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2148 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2149 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2150 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2152 TRACE("(%p)\n", this);
2153 return *this->pwpos+*this->pwsize;
2156 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2157 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2158 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2159 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2160 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2161 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2163 TRACE("(%p %d)\n", this, off);
2164 *this->prpos += off;
2165 *this->prsize -= off;
2168 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
2169 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
2170 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
2171 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
2172 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
2173 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
2175 TRACE("(%p)\n", this);
2176 return locale_copy_ctor(ret, this->loc);
2179 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2180 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2181 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2182 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2183 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2184 #if _MSVCP_VER >= 100
2185 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2186 #elif _MSVCP_VER >= 80
2187 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2188 #else
2189 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2190 #endif
2191 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2193 TRACE("(%p %p)\n", this, loc);
2196 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2197 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2198 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2199 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2200 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2201 #if _MSVCP_VER >= 100
2202 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2203 #else
2204 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2205 #endif
2206 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2208 TRACE("(%p %d)\n", this, ch);
2209 return WEOF;
2212 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2213 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2214 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2215 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2216 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2217 #if _MSVCP_VER >= 100
2218 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2219 #else
2220 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2221 #endif
2222 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2224 TRACE("(%p %d)\n", this, ch);
2225 return WEOF;
2228 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2229 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2230 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2231 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2232 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2233 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2235 TRACE("(%p)\n", this);
2236 return *this->pwbuf;
2239 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2240 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2241 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2242 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2243 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2244 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2246 TRACE("(%p %d)\n", this, off);
2247 *this->pwpos += off;
2248 *this->pwsize -= off;
2251 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2252 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2253 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2254 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2255 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2256 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2258 TRACE("(%p)\n", this);
2259 return *this->pwpos;
2262 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2263 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2264 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2265 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2266 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2267 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2269 TRACE("(%p %p)\n", this, loc);
2270 memcpy(ret, this->loc, sizeof(locale));
2271 call_basic_streambuf_wchar_imbue(this, loc);
2272 locale_copy_ctor(this->loc, loc);
2273 return ret;
2276 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2277 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2278 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2279 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2280 #if STREAMOFF_BITS == 64
2281 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2282 #else
2283 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2284 #endif
2285 #if _MSVCP_VER >= 100
2286 #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))
2287 #elif _MSVCP_VER >= 80
2288 #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))
2289 #else
2290 #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))
2291 #endif
2292 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2293 fpos_int *ret, streamoff off, int way, int mode)
2295 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2296 ret->off = -1;
2297 ret->pos = 0;
2298 ret->state = 0;
2299 return ret;
2302 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2303 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2304 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2305 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2306 #if STREAMOFF_BITS == 64
2307 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2308 #else
2309 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2310 #endif
2311 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2312 fpos_int *ret, streamoff off, int way, int mode)
2314 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2315 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2318 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2319 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2320 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2321 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2322 #if STREAMOFF_BITS == 64
2323 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 24)
2324 #else
2325 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2326 #endif
2327 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2328 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
2330 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2331 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2334 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2335 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2336 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2337 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2338 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2339 #if _MSVCP_VER >= 100
2340 #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))
2341 #elif _MSVCP_VER >= 80
2342 #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))
2343 #else
2344 #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))
2345 #endif
2346 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2347 fpos_int *ret, fpos_int pos, int mode)
2349 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2350 ret->off = -1;
2351 ret->pos = 0;
2352 ret->state = 0;
2353 return ret;
2356 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2357 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2358 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2359 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2360 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2361 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2362 fpos_int *ret, fpos_int pos, int mode)
2364 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2365 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2368 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2369 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2370 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2371 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2372 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2373 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2374 fpos_int *ret, fpos_int pos, unsigned int mode)
2376 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2377 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2380 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2381 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2382 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2383 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2384 #if STREAMSIZE_BITS == 64
2385 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2386 #else
2387 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2388 #endif
2389 #if _MSVCP_VER >= 100
2390 #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))
2391 #elif _MSVCP_VER >= 80
2392 #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))
2393 #else
2394 #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))
2395 #endif
2396 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2398 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2399 return this;
2402 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2403 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2404 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2405 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2406 #if STREAMSIZE_BITS == 64
2407 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2408 #else
2409 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2410 #endif
2411 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2413 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2414 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2417 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2418 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2419 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2420 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2421 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2422 #if _MSVCP_VER >= 100
2423 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2424 #elif _MSVCP_VER >= 80
2425 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2426 #else
2427 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2428 #endif
2429 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2431 TRACE("(%p)\n", this);
2432 return 0;
2435 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2436 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2437 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2438 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2439 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2440 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2442 TRACE("(%p)\n", this);
2443 return call_basic_streambuf_wchar_sync(this);
2446 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2447 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2448 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2449 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2450 #if STREAMSIZE_BITS == 64
2451 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2452 #else
2453 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2454 #endif
2455 #if _MSVCP_VER >= 100
2456 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2457 #else
2458 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2459 #endif
2460 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2462 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2463 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2466 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2467 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2468 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2469 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2470 #if STREAMSIZE_BITS == 64
2471 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2472 #else
2473 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2474 #endif
2475 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2477 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2478 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2481 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2482 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2483 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2484 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2485 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2486 #if _MSVCP_VER >= 100
2487 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2488 #else
2489 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2490 #endif
2491 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2493 TRACE("(%p)\n", this);
2494 return 0;
2497 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2498 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2499 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2500 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2501 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2502 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2504 streamsize ret;
2506 TRACE("(%p)\n", this);
2508 ret = basic_streambuf_wchar__Gnavail(this);
2509 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2512 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2513 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2514 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2515 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2516 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2517 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2519 TRACE("(%p %d)\n", this, ch);
2520 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2521 (*this->prsize)++;
2522 (*this->prpos)--;
2523 return ch;
2526 return call_basic_streambuf_wchar_pbackfail(this, ch);
2529 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2530 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2531 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2532 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2533 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2534 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2536 TRACE("(%p %d)\n", this, ch);
2537 return basic_streambuf_wchar__Pnavail(this) ?
2538 (*basic_streambuf_wchar__Pninc(this) = ch) :
2539 call_basic_streambuf_wchar_overflow(this, ch);
2542 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2543 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2544 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2545 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2546 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2547 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2549 TRACE("(%p)\n", this);
2550 if(*this->prpos && *this->prpos>*this->prbuf) {
2551 (*this->prsize)++;
2552 (*this->prpos)--;
2553 return **this->prpos;
2556 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2559 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2560 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2561 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2562 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2563 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2564 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2566 TRACE("(%p)\n", this);
2567 if(basic_streambuf_wchar__Gnavail(this))
2568 basic_streambuf_wchar__Gninc(this);
2569 else
2570 call_basic_streambuf_wchar_uflow(this);
2573 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2574 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2575 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2576 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2577 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2578 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2580 TRACE("(%p)\n", this);
2581 return basic_streambuf_wchar__Gnavail(this) ?
2582 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2585 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2586 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2587 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2588 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2589 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2590 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2592 TRACE("(%p)\n", this);
2593 return basic_streambuf_wchar__Gnavail(this) ?
2594 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2597 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2598 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2599 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2600 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2601 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2602 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2604 TRACE("(%p)\n", this);
2606 if(basic_streambuf_wchar__Gnavail(this) > 1)
2607 return *basic_streambuf_wchar__Gnpreinc(this);
2608 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2609 WEOF : basic_streambuf_wchar_sgetc(this);
2612 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2613 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2614 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2615 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2616 #if STREAMSIZE_BITS == 64
2617 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2618 #else
2619 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2620 #endif
2621 #if _MSVCP_VER >= 100
2622 #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))
2623 #elif _MSVCP_VER >= 80
2624 #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))
2625 #else
2626 #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))
2627 #endif
2628 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2630 streamsize copied, chunk;
2632 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2634 for(copied=0; copied<count;) {
2635 chunk = basic_streambuf_wchar__Pnavail(this);
2636 if(chunk > count-copied)
2637 chunk = count-copied;
2639 if(chunk > 0) {
2640 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2641 *this->pwpos += chunk;
2642 *this->pwsize -= chunk;
2643 copied += chunk;
2644 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2645 copied++;
2646 }else {
2647 break;
2651 return copied;
2654 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2655 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2656 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2657 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2658 #if STREAMSIZE_BITS == 64
2659 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2660 #else
2661 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2662 #endif
2663 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2665 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2666 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2669 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2670 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2671 int basic_filebuf_char__Init__Stinit = 0;
2673 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2674 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2675 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2676 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2678 TRACE("(%p %p %d)\n", this, file, which);
2680 this->cvt = NULL;
2681 this->wrotesome = FALSE;
2682 this->state = basic_filebuf_char__Init__Stinit;
2683 this->close = (which == INITFL_open);
2684 this->file = file;
2686 basic_streambuf_char__Init_empty(&this->base);
2687 if(file)
2688 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2689 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2692 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
2693 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
2694 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 8)
2695 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this, codecvt_char *cvt)
2697 TRACE("(%p %p)\n", this, cvt);
2699 if(codecvt_base_always_noconv(&cvt->base)) {
2700 this->cvt = NULL;
2701 }else {
2702 basic_streambuf_char__Init_empty(&this->base);
2703 this->cvt = cvt;
2707 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
2708 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
2709 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Endwrite, 4)
2710 MSVCP_bool __thiscall basic_filebuf_char__Endwrite(basic_filebuf_char *this)
2712 TRACE("(%p)\n", this);
2714 if(!this->wrotesome || !this->cvt)
2715 return TRUE;
2718 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2719 return FALSE;
2721 while(1) {
2722 /* TODO: check if we need a dynamic buffer here */
2723 char buf[128];
2724 char *next;
2725 int ret;
2727 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
2728 switch(ret) {
2729 case CODECVT_ok:
2730 this->wrotesome = FALSE;
2731 /* fall through */
2732 case CODECVT_partial:
2733 if(!fwrite(buf, next-buf, 1, this->file))
2734 return FALSE;
2735 if(this->wrotesome)
2736 break;
2737 /* fall through */
2738 case CODECVT_noconv:
2739 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2740 return FALSE;
2741 return TRUE;
2742 default:
2743 return FALSE;
2748 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2749 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2750 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2751 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2753 basic_filebuf_char *ret = this;
2755 TRACE("(%p)\n", this);
2757 if(!this->file)
2758 return NULL;
2760 /* TODO: handle exceptions */
2761 if(!basic_filebuf_char__Endwrite(this))
2762 ret = NULL;
2763 if(fclose(this->file))
2764 ret = NULL;
2766 basic_filebuf_char__Init(this, NULL, INITFL_close);
2767 return ret;
2770 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2771 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2772 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2773 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2775 TRACE("(%p %p)\n", this, file);
2777 basic_streambuf_char_ctor(&this->base);
2778 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2780 basic_filebuf_char__Init(this, file, INITFL_new);
2781 return this;
2784 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2785 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2786 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2787 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2789 return basic_filebuf_char_ctor_file(this, NULL);
2792 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2793 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2794 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2795 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2797 TRACE("(%p %d)\n", this, uninitialized);
2799 basic_streambuf_char_ctor(&this->base);
2800 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2801 return this;
2804 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2805 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2806 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2807 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2809 TRACE("(%p)\n", this);
2811 if(this->close)
2812 basic_filebuf_char_close(this);
2813 basic_streambuf_char_dtor(&this->base);
2816 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
2817 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2819 TRACE("(%p %x)\n", this, flags);
2820 if(flags & 2) {
2821 /* we have an array, with the number of elements stored before the first object */
2822 INT_PTR i, *ptr = (INT_PTR *)this-1;
2824 for(i=*ptr-1; i>=0; i--)
2825 basic_filebuf_char_dtor(this+i);
2826 MSVCRT_operator_delete(ptr);
2827 } else {
2828 basic_filebuf_char_dtor(this);
2829 if(flags & 1)
2830 MSVCRT_operator_delete(this);
2833 return this;
2836 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2837 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2838 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2839 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2841 TRACE("(%p)\n", this);
2842 return this->file != NULL;
2845 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
2846 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
2847 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
2849 static const wchar_t rW[] = {'r',0};
2850 static const struct {
2851 int mode;
2852 const wchar_t str[4];
2853 const wchar_t str_bin[4];
2854 } str_mode[] = {
2855 {OPENMODE_out, {'w',0}, {'w','b',0}},
2856 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
2857 {OPENMODE_app, {'a',0}, {'a','b',0}},
2858 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
2859 {OPENMODE_in, {'r',0}, {'r','b',0}},
2860 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
2861 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
2862 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
2863 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
2866 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2867 size_t mode_idx;
2868 FILE *f = NULL;
2870 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
2872 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
2873 if(str_mode[mode_idx].mode == real_mode)
2874 break;
2875 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
2876 return NULL;
2878 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
2879 return NULL;
2880 else if(f)
2881 fclose(f);
2883 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2884 && (f = _wfopen(name, rW))) {
2885 fclose(f);
2886 return NULL;
2889 #if _MSVCP_VER < 80 /* msvcp60 - msvcp71 are ignoring prot argument */
2890 prot = SH_DENYNO;
2891 #endif
2893 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2894 : str_mode[mode_idx].str, prot);
2895 if(!f)
2896 return NULL;
2898 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2899 fclose(f);
2900 return NULL;
2903 return f;
2906 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
2907 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
2908 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
2910 wchar_t nameW[FILENAME_MAX];
2912 TRACE("(%s %d %d)\n", name, mode, prot);
2914 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2915 return NULL;
2916 return _Fiopen_wchar(nameW, mode, prot);
2919 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2920 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2921 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2922 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2923 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
2924 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2926 FILE *f = NULL;
2928 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2930 if(basic_filebuf_char_is_open(this))
2931 return NULL;
2933 if(!(f = _Fiopen_wchar(name, mode, prot)))
2934 return NULL;
2936 basic_filebuf_char__Init(this, f, INITFL_open);
2937 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(this->base.loc));
2938 return this;
2941 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
2942 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
2943 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
2944 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
2945 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
2946 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
2948 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
2951 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2952 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2953 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
2954 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2956 wchar_t nameW[FILENAME_MAX];
2958 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
2960 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2961 return NULL;
2962 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
2965 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
2966 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
2967 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
2968 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
2970 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
2973 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2974 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2975 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
2976 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
2978 char buf[8], *dyn_buf;
2979 char ch = c, *to_next;
2980 const char *from_next;
2981 int ret, max_size;
2984 TRACE("(%p %d)\n", this, c);
2986 if(!basic_filebuf_char_is_open(this))
2987 return EOF;
2988 if(c == EOF)
2989 return !c;
2991 if(!this->cvt)
2992 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2994 from_next = &ch;
2995 do {
2996 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
2997 &from_next, buf, buf+sizeof(buf), &to_next);
2999 switch(ret) {
3000 case CODECVT_partial:
3001 if(to_next == buf)
3002 break;
3003 /* fall through */
3004 case CODECVT_ok:
3005 if(!fwrite(buf, to_next-buf, 1, this->file))
3006 return EOF;
3007 if(ret == CODECVT_partial)
3008 continue;
3009 return c;
3010 case CODECVT_noconv:
3011 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3012 default:
3013 return EOF;
3016 break;
3017 } while(1);
3019 max_size = codecvt_base_max_length(&this->cvt->base);
3020 dyn_buf = malloc(max_size);
3021 if(!dyn_buf)
3022 return EOF;
3024 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
3025 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3027 switch(ret) {
3028 case CODECVT_ok:
3029 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3030 free(dyn_buf);
3031 return ret ? c : EOF;
3032 case CODECVT_partial:
3033 ERR("buffer should be big enough to store all output\n");
3034 /* fall through */
3035 default:
3036 free(dyn_buf);
3037 return EOF;
3041 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3042 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3043 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
3044 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
3046 TRACE("(%p %d)\n", this, c);
3048 if(!basic_filebuf_char_is_open(this))
3049 return EOF;
3051 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
3052 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
3053 basic_streambuf_char__Gndec(&this->base);
3054 return c==EOF ? !c : c;
3055 }else if(c!=EOF && !this->cvt) {
3056 return ungetc(c, this->file);
3059 return EOF;
3062 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3063 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3064 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
3065 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
3067 char ch, buf[128], *to_next;
3068 const char *buf_next;
3069 int c, j;
3070 size_t i;
3072 TRACE("(%p)\n", this);
3074 if(!basic_filebuf_char_is_open(this))
3075 return EOF;
3077 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3078 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
3080 c = fgetc(this->file);
3081 if(!this->cvt || c==EOF)
3082 return c;
3084 buf_next = buf;
3085 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3086 buf[i] = c;
3088 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
3089 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3090 case CODECVT_partial:
3091 case CODECVT_ok:
3092 if(to_next == &ch) {
3093 c = fgetc(this->file);
3094 if(c == EOF)
3095 return EOF;
3096 continue;
3099 for(j = --i; j >= buf_next-buf; j--)
3100 ungetc(buf[j], this->file);
3101 return ch;
3102 case CODECVT_noconv:
3103 return (unsigned char)buf[0];
3104 default:
3105 return EOF;
3109 FIXME("buffer is too small\n");
3110 return EOF;
3113 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3114 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3115 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
3116 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
3118 int ret;
3120 TRACE("(%p)\n", this);
3122 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3123 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
3125 ret = call_basic_streambuf_char_uflow(&this->base);
3126 if(ret != EOF)
3127 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
3128 return ret;
3131 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3132 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3133 #if STREAMOFF_BITS == 64
3134 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
3135 #else
3136 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
3137 #endif
3138 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
3139 fpos_int *ret, streamoff off, int way, int mode)
3141 fpos_t pos;
3143 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3145 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3146 || fseek(this->file, off, way)) {
3147 ret->off = -1;
3148 ret->pos = 0;
3149 ret->state = 0;
3150 return ret;
3153 fgetpos(this->file, &pos);
3154 ret->off = 0;
3155 ret->pos = pos;
3156 ret->state = this->state;
3157 return ret;
3160 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3161 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3162 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
3163 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
3164 fpos_int *ret, fpos_int pos, int mode)
3166 fpos_t fpos;
3168 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3170 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
3171 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3172 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3173 ret->off = -1;
3174 ret->pos = 0;
3175 ret->state = 0;
3176 return ret;
3179 fgetpos(this->file, &fpos);
3180 ret->off = 0;
3181 ret->pos = fpos;
3182 ret->state = this->state;
3183 return ret;
3186 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
3187 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
3188 #if STREAMSIZE_BITS == 64
3189 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
3190 #else
3191 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
3192 #endif
3193 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
3195 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3197 if(!basic_filebuf_char_is_open(this))
3198 return NULL;
3200 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3201 return NULL;
3203 basic_filebuf_char__Init(this, this->file, INITFL_open);
3204 return &this->base;
3207 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3208 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3209 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3210 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3212 TRACE("(%p)\n", this);
3214 if(!basic_filebuf_char_is_open(this))
3215 return 0;
3217 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3218 return 0;
3219 return fflush(this->file);
3222 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
3223 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
3224 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
3225 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
3227 TRACE("(%p %p)\n", this, loc);
3228 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(loc));
3231 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3232 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3233 int basic_filebuf_wchar__Init__Stinit = 0;
3235 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3236 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3237 int basic_filebuf_short__Init__Stinit = 0;
3239 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3240 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3241 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3242 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3244 TRACE("(%p %p %d)\n", this, file, which);
3246 this->cvt = NULL;
3247 this->wrotesome = FALSE;
3248 this->state = basic_filebuf_wchar__Init__Stinit;
3249 this->close = (which == INITFL_open);
3250 this->file = file;
3252 basic_streambuf_wchar__Init_empty(&this->base);
3255 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3256 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3257 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3258 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3260 TRACE("(%p %p %d)\n", this, file, which);
3262 this->cvt = NULL;
3263 this->wrotesome = FALSE;
3264 this->state = basic_filebuf_short__Init__Stinit;
3265 this->close = (which == INITFL_open);
3266 this->file = file;
3268 basic_streambuf_wchar__Init_empty(&this->base);
3271 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
3272 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
3273 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
3274 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
3275 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 8)
3276 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
3278 TRACE("(%p %p)\n", this, cvt);
3280 if(codecvt_base_always_noconv(&cvt->base)) {
3281 this->cvt = NULL;
3282 }else {
3283 basic_streambuf_wchar__Init_empty(&this->base);
3284 this->cvt = cvt;
3288 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAE_NXZ */
3289 /* ?_Endwrite@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAA_NXZ */
3290 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAE_NXZ */
3291 /* ?_Endwrite@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAA_NXZ */
3292 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Endwrite, 4)
3293 MSVCP_bool __thiscall basic_filebuf_wchar__Endwrite(basic_filebuf_wchar *this)
3295 TRACE("(%p)\n", this);
3297 if(!this->wrotesome || !this->cvt)
3298 return TRUE;
3300 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3301 return FALSE;
3303 while(1) {
3304 /* TODO: check if we need a dynamic buffer here */
3305 char buf[128];
3306 char *next;
3307 int ret;
3309 ret = codecvt_wchar_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
3310 switch(ret) {
3311 case CODECVT_ok:
3312 this->wrotesome = FALSE;
3313 /* fall through */
3314 case CODECVT_partial:
3315 if(!fwrite(buf, next-buf, 1, this->file))
3316 return FALSE;
3317 if(this->wrotesome)
3318 break;
3319 /* fall through */
3320 case CODECVT_noconv:
3321 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3322 return FALSE;
3323 return TRUE;
3324 default:
3325 return FALSE;
3330 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3331 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3332 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3333 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3334 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3335 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3337 basic_filebuf_wchar *ret = this;
3339 TRACE("(%p)\n", this);
3341 if(!this->file)
3342 return NULL;
3344 /* TODO: handle exceptions */
3345 if(!basic_filebuf_wchar__Endwrite(this))
3346 ret = NULL;
3347 if(fclose(this->file))
3348 ret = NULL;
3350 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3351 return ret;
3354 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3355 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3356 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3357 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3359 TRACE("(%p %p)\n", this, file);
3361 basic_streambuf_wchar_ctor(&this->base);
3362 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3364 basic_filebuf_wchar__Init(this, file, INITFL_new);
3365 return this;
3368 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3369 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3370 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3371 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3373 TRACE("(%p %p)\n", this, file);
3375 basic_streambuf_short_ctor(&this->base);
3376 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3378 basic_filebuf_short__Init(this, file, INITFL_new);
3379 return this;
3382 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3383 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3384 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3385 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3387 return basic_filebuf_wchar_ctor_file(this, NULL);
3390 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3391 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3392 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3393 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3395 return basic_filebuf_short_ctor_file(this, NULL);
3398 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3399 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3400 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3401 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3403 TRACE("(%p %d)\n", this, uninitialized);
3405 basic_streambuf_wchar_ctor(&this->base);
3406 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3407 return this;
3410 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3411 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3412 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3413 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3415 TRACE("(%p %d)\n", this, uninitialized);
3417 basic_streambuf_short_ctor(&this->base);
3418 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3419 return this;
3422 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3423 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3424 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3425 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3426 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3427 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3429 TRACE("(%p)\n", this);
3431 if(this->close)
3432 basic_filebuf_wchar_close(this);
3433 basic_streambuf_wchar_dtor(&this->base);
3436 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3437 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3439 TRACE("(%p %x)\n", this, flags);
3440 if(flags & 2) {
3441 /* we have an array, with the number of elements stored before the first object */
3442 INT_PTR i, *ptr = (INT_PTR *)this-1;
3444 for(i=*ptr-1; i>=0; i--)
3445 basic_filebuf_wchar_dtor(this+i);
3446 MSVCRT_operator_delete(ptr);
3447 } else {
3448 basic_filebuf_wchar_dtor(this);
3449 if(flags & 1)
3450 MSVCRT_operator_delete(this);
3453 return this;
3456 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3457 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3458 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3459 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3460 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3461 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3463 TRACE("(%p)\n", this);
3464 return this->file != NULL;
3467 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3468 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3469 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3470 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3471 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3472 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3474 FILE *f = NULL;
3476 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3478 if(basic_filebuf_wchar_is_open(this))
3479 return NULL;
3481 if(!(f = _Fiopen_wchar(name, mode, prot)))
3482 return NULL;
3484 basic_filebuf_wchar__Init(this, f, INITFL_open);
3485 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(this->base.loc));
3486 return this;
3489 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3490 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3491 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3492 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3493 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3494 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3496 FILE *f = NULL;
3498 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3500 if(basic_filebuf_wchar_is_open(this))
3501 return NULL;
3503 if(!(f = _Fiopen_wchar(name, mode, prot)))
3504 return NULL;
3506 basic_filebuf_short__Init(this, f, INITFL_open);
3507 basic_filebuf_wchar__Initcvt(this, codecvt_short_use_facet(this->base.loc));
3508 return this;
3511 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3512 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3513 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3514 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3515 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3516 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3518 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3521 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3522 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3523 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3524 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3525 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3526 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3528 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3531 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3532 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3533 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3534 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3536 wchar_t nameW[FILENAME_MAX];
3538 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3540 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3541 return NULL;
3542 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3545 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3546 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3547 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3548 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3550 wchar_t nameW[FILENAME_MAX];
3552 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3554 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3555 return NULL;
3556 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3559 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3560 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3561 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3562 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3564 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3567 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3568 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3569 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3570 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3572 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3575 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3576 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3577 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3578 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3579 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3580 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3582 char buf[8], *dyn_buf, *to_next;
3583 wchar_t ch = c;
3584 const wchar_t *from_next;
3585 int max_size;
3586 unsigned short ret;
3589 TRACE("(%p %d)\n", this, c);
3591 if(!basic_filebuf_wchar_is_open(this))
3592 return WEOF;
3593 if(c == WEOF)
3594 return !c;
3596 if(!this->cvt)
3597 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3599 from_next = &ch;
3600 do {
3601 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3602 &from_next, buf, buf+sizeof(buf), &to_next);
3604 switch(ret) {
3605 case CODECVT_partial:
3606 if(to_next == buf)
3607 break;
3608 /* fall through */
3609 case CODECVT_ok:
3610 if(!fwrite(buf, to_next-buf, 1, this->file))
3611 return WEOF;
3612 if(ret == CODECVT_partial)
3613 continue;
3614 return c;
3615 case CODECVT_noconv:
3616 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3617 default:
3618 return WEOF;
3621 break;
3622 } while(1);
3624 max_size = codecvt_base_max_length(&this->cvt->base);
3625 dyn_buf = malloc(max_size);
3626 if(!dyn_buf)
3627 return WEOF;
3629 ret = codecvt_wchar_out(this->cvt, &this->state, from_next, &ch+1,
3630 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
3632 switch(ret) {
3633 case CODECVT_ok:
3634 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
3635 free(dyn_buf);
3636 return ret ? c : WEOF;
3637 case CODECVT_partial:
3638 ERR("buffer should be big enough to store all output\n");
3639 /* fall through */
3640 default:
3641 free(dyn_buf);
3642 return WEOF;
3646 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3647 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3648 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3649 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3650 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3651 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3653 TRACE("(%p %d)\n", this, c);
3655 if(!basic_filebuf_wchar_is_open(this))
3656 return WEOF;
3658 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3659 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3660 basic_streambuf_wchar__Gndec(&this->base);
3661 return c==WEOF ? !c : c;
3662 }else if(c!=WEOF && !this->cvt) {
3663 return ungetwc(c, this->file);
3664 }else if(c!=WEOF && basic_streambuf_wchar_gptr(&this->base)!=&this->putback) {
3665 this->putback = c;
3666 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback, &this->putback+1);
3667 return c;
3670 return WEOF;
3673 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3674 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3675 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3676 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3677 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
3678 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
3680 wchar_t ch, *to_next;
3681 char buf[128];
3682 const char *buf_next;
3683 int c, j;
3684 size_t i;
3686 TRACE("(%p)\n", this);
3688 if(!basic_filebuf_wchar_is_open(this))
3689 return WEOF;
3691 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3692 return *basic_streambuf_wchar__Gninc(&this->base);
3694 if(!this->cvt)
3695 return fgetwc(this->file);
3697 buf_next = buf;
3698 for(i=0; i < sizeof(buf)/sizeof(buf[0]); i++) {
3699 if((c = fgetc(this->file)) == EOF)
3700 return WEOF;
3701 buf[i] = c;
3703 switch(codecvt_wchar_in(this->cvt, &this->state, buf_next,
3704 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
3705 case CODECVT_partial:
3706 case CODECVT_ok:
3707 if(to_next == &ch)
3708 continue;
3710 for(j = --i; j >= buf_next-buf; j--)
3711 ungetc(buf[j], this->file);
3712 return ch;
3713 case CODECVT_noconv:
3714 if(i+1 < sizeof(wchar_t))
3715 continue;
3717 memcpy(&ch, buf, sizeof(wchar_t));
3718 return ch;
3719 default:
3720 return WEOF;
3724 FIXME("buffer is too small\n");
3725 return WEOF;
3728 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3729 /* ?underflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3730 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3731 /* ?underflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3732 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_underflow, 4)
3733 unsigned short __thiscall basic_filebuf_wchar_underflow(basic_filebuf_wchar *this)
3735 unsigned short ret;
3737 TRACE("(%p)\n", this);
3739 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3740 return *basic_streambuf_wchar_gptr(&this->base);
3742 ret = call_basic_streambuf_wchar_uflow(&this->base);
3743 if(ret != WEOF)
3744 ret = call_basic_streambuf_wchar_pbackfail(&this->base, ret);
3745 return ret;
3748 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3749 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3750 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3751 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3752 #if STREAMOFF_BITS == 64
3753 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
3754 #else
3755 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
3756 #endif
3757 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
3758 fpos_int *ret, streamoff off, int way, int mode)
3760 fpos_t pos;
3762 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3764 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback) {
3765 if(way == SEEKDIR_cur)
3766 off -= sizeof(wchar_t);
3768 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3771 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3772 || fseek(this->file, off, way)) {
3773 ret->off = -1;
3774 ret->pos = 0;
3775 ret->state = 0;
3776 return ret;
3779 fgetpos(this->file, &pos);
3780 ret->off = 0;
3781 ret->pos = pos;
3782 ret->state = this->state;
3783 return ret;
3786 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3787 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3788 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3789 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3790 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
3791 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
3792 fpos_int *ret, fpos_int pos, int mode)
3794 fpos_t fpos;
3796 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3798 if(!basic_filebuf_wchar_is_open(this) || !basic_filebuf_wchar__Endwrite(this)
3799 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3800 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3801 ret->off = -1;
3802 ret->pos = 0;
3803 ret->state = 0;
3804 return ret;
3807 if(basic_streambuf_wchar_gptr(&this->base) == &this->putback)
3808 basic_streambuf_wchar_setg(&this->base, &this->putback, &this->putback+1, &this->putback+1);
3810 fgetpos(this->file, &fpos);
3811 ret->off = 0;
3812 ret->pos = fpos;
3813 ret->state = this->state;
3814 return ret;
3817 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
3818 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
3819 #if STREAMSIZE_BITS == 64
3820 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
3821 #else
3822 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
3823 #endif
3824 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3826 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3828 if(!basic_filebuf_wchar_is_open(this))
3829 return NULL;
3831 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3832 return NULL;
3834 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
3835 return &this->base;
3838 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
3839 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
3840 #if STREAMSIZE_BITS == 64
3841 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
3842 #else
3843 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
3844 #endif
3845 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3847 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3849 if(!basic_filebuf_wchar_is_open(this))
3850 return NULL;
3852 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3853 return NULL;
3855 basic_filebuf_short__Init(this, this->file, INITFL_open);
3856 return &this->base;
3859 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
3860 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
3861 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
3862 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
3863 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
3864 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
3866 TRACE("(%p)\n", this);
3868 if(!basic_filebuf_wchar_is_open(this))
3869 return 0;
3871 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3872 return 0;
3873 return fflush(this->file);
3876 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
3877 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
3878 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
3879 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
3881 TRACE("(%p %p)\n", this, loc);
3882 basic_filebuf_wchar__Initcvt(this, codecvt_wchar_use_facet(loc));
3885 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
3886 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
3887 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
3888 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
3890 TRACE("(%p %p)\n", this, loc);
3891 basic_filebuf_wchar__Initcvt(this, codecvt_short_use_facet(loc));
3894 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3895 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3896 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
3897 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
3899 int state = 0;
3901 if(!(mode & OPENMODE_in))
3902 state |= STRINGBUF_no_read;
3904 if(!(mode & OPENMODE_out))
3905 state |= STRINGBUF_no_write;
3907 if(mode & OPENMODE_ate)
3908 state |= STRINGBUF_at_end;
3910 if(mode & OPENMODE_app)
3911 state |= STRINGBUF_append;
3913 return state;
3916 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
3917 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
3918 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
3919 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
3921 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
3923 basic_streambuf_char__Init_empty(&this->base);
3925 this->state = state;
3926 this->seekhigh = NULL;
3928 if(count && str) {
3929 char *buf = MSVCRT_operator_new(count);
3930 if(!buf) {
3931 ERR("Out of memory\n");
3932 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3935 memcpy(buf, str, count);
3936 this->seekhigh = buf + count;
3938 this->state |= STRINGBUF_allocated;
3940 if(!(state & STRINGBUF_no_read))
3941 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
3943 if(!(state & STRINGBUF_no_write)) {
3944 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3946 if(!basic_streambuf_char_gptr(&this->base))
3947 basic_streambuf_char_setg(&this->base, buf, 0, buf);
3952 /* ??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 */
3953 /* ??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 */
3954 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
3955 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
3956 const basic_string_char *str, IOSB_openmode mode)
3958 TRACE("(%p %p %d)\n", this, str, mode);
3960 basic_streambuf_char_ctor(&this->base);
3961 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3963 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
3964 str->size, basic_stringbuf_char__Getstate(this, mode));
3965 return this;
3968 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
3969 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
3970 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
3971 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
3972 basic_stringbuf_char *this, IOSB_openmode mode)
3974 TRACE("(%p %d)\n", this, mode);
3976 basic_streambuf_char_ctor(&this->base);
3977 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3979 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
3980 return this;
3983 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
3984 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
3985 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
3986 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
3988 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
3991 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
3992 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
3993 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
3994 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
3996 TRACE("(%p)\n", this);
3998 if(this->state & STRINGBUF_allocated) {
3999 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
4000 this->seekhigh = NULL;
4001 this->state &= ~STRINGBUF_allocated;
4004 basic_streambuf_char__Init_empty(&this->base);
4007 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
4008 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
4009 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
4010 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
4012 TRACE("(%p)\n", this);
4014 basic_stringbuf_char__Tidy(this);
4015 basic_streambuf_char_dtor(&this->base);
4018 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
4019 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
4021 TRACE("(%p %x)\n", this, flags);
4023 if(flags & 2) {
4024 /* we have an array, with the number of elements stored before the first object */
4025 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4027 for (i = *ptr - 1; i >= 0; i--)
4028 basic_stringbuf_char_dtor(this+i);
4030 MSVCRT_operator_delete(ptr);
4031 }else {
4032 basic_stringbuf_char_dtor(this);
4034 if(flags & 1)
4035 MSVCRT_operator_delete(this);
4038 return this;
4041 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4042 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4043 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
4044 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
4046 MSVCP_size_t oldsize, size;
4047 char *ptr, *buf;
4049 TRACE("(%p %x)\n", this, meta);
4051 if(meta == EOF)
4052 return !EOF;
4053 if(this->state & STRINGBUF_no_write)
4054 return EOF;
4056 ptr = basic_streambuf_char_pptr(&this->base);
4057 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4058 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
4059 this->seekhigh, basic_streambuf_char_epptr(&this->base));
4061 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
4062 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4064 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
4065 size = oldsize|0xf;
4066 size += size/2;
4067 buf = MSVCRT_operator_new(size);
4068 if(!buf) {
4069 ERR("Out of memory\n");
4070 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4073 if(!oldsize) {
4074 this->seekhigh = buf;
4075 basic_streambuf_char_setp(&this->base, buf, buf+size);
4076 if(this->state & STRINGBUF_no_read)
4077 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4078 else
4079 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
4081 this->state |= STRINGBUF_allocated;
4082 }else {
4083 ptr = basic_streambuf_char_eback(&this->base);
4084 memcpy(buf, ptr, oldsize);
4086 this->seekhigh = buf+(this->seekhigh-ptr);
4087 basic_streambuf_char_setp_next(&this->base, buf,
4088 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
4089 if(this->state & STRINGBUF_no_read)
4090 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4091 else
4092 basic_streambuf_char_setg(&this->base, buf,
4093 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
4094 basic_streambuf_char_pptr(&this->base)+1);
4096 MSVCRT_operator_delete(ptr);
4099 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4102 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4103 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4104 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
4105 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
4107 char *cur;
4109 TRACE("(%p %x)\n", this, c);
4111 cur = basic_streambuf_char_gptr(&this->base);
4112 if(!cur || cur==basic_streambuf_char_eback(&this->base)
4113 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4114 return EOF;
4116 if(c != EOF)
4117 cur[-1] = c;
4118 basic_streambuf_char_gbump(&this->base, -1);
4119 return c==EOF ? !EOF : c;
4122 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
4123 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
4124 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
4125 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
4127 char *ptr, *cur;
4129 TRACE("(%p)\n", this);
4131 cur = basic_streambuf_char_gptr(&this->base);
4132 if(!cur || this->state&STRINGBUF_no_read)
4133 return EOF;
4135 ptr = basic_streambuf_char_pptr(&this->base);
4136 if(this->seekhigh < ptr)
4137 this->seekhigh = ptr;
4139 ptr = basic_streambuf_char_egptr(&this->base);
4140 if(this->seekhigh > ptr)
4141 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
4143 if(cur < this->seekhigh)
4144 return (unsigned char)*cur;
4145 return EOF;
4148 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4149 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4150 #if STREAMOFF_BITS == 64
4151 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
4152 #else
4153 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
4154 #endif
4155 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
4156 fpos_int *ret, streamoff off, int way, int mode)
4158 char *beg, *cur_r, *cur_w;
4160 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4162 cur_w = basic_streambuf_char_pptr(&this->base);
4163 if(cur_w > this->seekhigh)
4164 this->seekhigh = cur_w;
4166 ret->off = 0;
4167 ret->pos = 0;
4168 ret->state = 0;
4170 beg = basic_streambuf_char_eback(&this->base);
4171 cur_r = basic_streambuf_char_gptr(&this->base);
4172 if((mode & OPENMODE_in) && cur_r) {
4173 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4174 off += cur_r-beg;
4175 else if(way == SEEKDIR_end)
4176 off += this->seekhigh-beg;
4177 else if(way != SEEKDIR_beg)
4178 off = -1;
4180 if(off<0 || off>this->seekhigh-beg) {
4181 off = -1;
4182 }else {
4183 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
4184 if((mode & OPENMODE_out) && cur_w) {
4185 basic_streambuf_char_setp_next(&this->base, beg,
4186 basic_streambuf_char_gptr(&this->base),
4187 basic_streambuf_char_epptr(&this->base));
4190 }else if((mode & OPENMODE_out) && cur_w) {
4191 if(way == SEEKDIR_cur)
4192 off += cur_w-beg;
4193 else if(way == SEEKDIR_end)
4194 off += this->seekhigh-beg;
4195 else if(way != SEEKDIR_beg)
4196 off = -1;
4198 if(off<0 || off>this->seekhigh-beg)
4199 off = -1;
4200 else
4201 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
4202 }else {
4203 off = -1;
4206 ret->off = off;
4207 return ret;
4210 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4211 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4212 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
4213 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
4214 fpos_int *ret, fpos_int pos, int mode)
4216 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4218 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4219 *ret = pos;
4220 return ret;
4223 return basic_stringbuf_char_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
4226 /* ?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 */
4227 /* ?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 */
4228 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
4229 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
4231 TRACE("(%p %p)\n", this, str);
4233 basic_stringbuf_char__Tidy(this);
4234 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
4237 /* ?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 */
4238 /* ?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 */
4239 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
4240 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
4242 char *ptr;
4244 TRACE("(%p)\n", this);
4246 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
4247 char *pptr;
4249 ptr = basic_streambuf_char_pbase(&this->base);
4250 pptr = basic_streambuf_char_pptr(&this->base);
4252 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4255 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
4256 ptr = basic_streambuf_char_eback(&this->base);
4257 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
4260 return MSVCP_basic_string_char_ctor(ret);
4263 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
4264 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
4265 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4266 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4267 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
4268 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
4270 int state = 0;
4272 if(!(mode & OPENMODE_in))
4273 state |= STRINGBUF_no_read;
4275 if(!(mode & OPENMODE_out))
4276 state |= STRINGBUF_no_write;
4278 if(mode & OPENMODE_ate)
4279 state |= STRINGBUF_at_end;
4281 if(mode & OPENMODE_app)
4282 state |= STRINGBUF_append;
4284 return state;
4287 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
4288 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
4289 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
4290 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
4291 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
4292 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
4294 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
4296 basic_streambuf_wchar__Init_empty(&this->base);
4298 this->state = state;
4299 this->seekhigh = NULL;
4301 if(count && str) {
4302 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
4303 if(!buf) {
4304 ERR("Out of memory\n");
4305 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4308 memcpy(buf, str, count*sizeof(wchar_t));
4309 this->seekhigh = buf + count;
4311 this->state |= STRINGBUF_allocated;
4313 if(!(state & STRINGBUF_no_read))
4314 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
4316 if(!(state & STRINGBUF_no_write)) {
4317 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4319 if(!basic_streambuf_wchar_gptr(&this->base))
4320 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
4325 /* ??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 */
4326 /* ??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 */
4327 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
4328 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
4329 const basic_string_wchar *str, IOSB_openmode mode)
4331 TRACE("(%p %p %d)\n", this, str, mode);
4333 basic_streambuf_wchar_ctor(&this->base);
4334 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4336 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
4337 str->size, basic_stringbuf_wchar__Getstate(this, mode));
4338 return this;
4341 /* ??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 */
4342 /* ??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 */
4343 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
4344 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
4345 const basic_string_wchar *str, IOSB_openmode mode)
4347 basic_stringbuf_wchar_ctor_str(this, str, mode);
4348 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4349 return this;
4352 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4353 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4354 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4355 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4356 basic_stringbuf_wchar *this, IOSB_openmode mode)
4358 TRACE("(%p %d)\n", this, mode);
4360 basic_streambuf_wchar_ctor(&this->base);
4361 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4363 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4364 return this;
4367 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4368 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4369 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4370 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4371 basic_stringbuf_wchar *this, IOSB_openmode mode)
4373 basic_stringbuf_wchar_ctor_mode(this, mode);
4374 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4375 return this;
4378 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4379 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4380 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4381 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4383 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4386 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4387 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4388 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4389 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4391 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4394 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4395 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4396 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4397 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4398 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4399 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4401 TRACE("(%p)\n", this);
4403 if(this->state & STRINGBUF_allocated) {
4404 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4405 this->seekhigh = NULL;
4406 this->state &= ~STRINGBUF_allocated;
4409 basic_streambuf_wchar__Init_empty(&this->base);
4412 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4413 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4414 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4415 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4416 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4417 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4419 TRACE("(%p)\n", this);
4421 basic_stringbuf_wchar__Tidy(this);
4422 basic_streambuf_wchar_dtor(&this->base);
4425 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4426 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4428 TRACE("(%p %x)\n", this, flags);
4430 if(flags & 2) {
4431 /* we have an array, with the number of elements stored before the first object */
4432 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4434 for (i = *ptr - 1; i >= 0; i--)
4435 basic_stringbuf_wchar_dtor(this+i);
4437 MSVCRT_operator_delete(ptr);
4438 }else {
4439 basic_stringbuf_wchar_dtor(this);
4441 if(flags & 1)
4442 MSVCRT_operator_delete(this);
4445 return this;
4448 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4449 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4450 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4451 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4452 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4453 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4455 MSVCP_size_t oldsize, size;
4456 wchar_t *ptr, *buf;
4458 TRACE("(%p %x)\n", this, meta);
4460 if(meta == WEOF)
4461 return !WEOF;
4462 if(this->state & STRINGBUF_no_write)
4463 return WEOF;
4465 ptr = basic_streambuf_wchar_pptr(&this->base);
4466 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4467 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4468 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4470 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4471 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4473 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4474 size = oldsize|0xf;
4475 size += size/2;
4476 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4477 if(!buf) {
4478 ERR("Out of memory\n");
4479 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4482 if(!oldsize) {
4483 this->seekhigh = buf;
4484 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4485 if(this->state & STRINGBUF_no_read)
4486 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4487 else
4488 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4490 this->state |= STRINGBUF_allocated;
4491 }else {
4492 ptr = basic_streambuf_wchar_eback(&this->base);
4493 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4495 this->seekhigh = buf+(this->seekhigh-ptr);
4496 basic_streambuf_wchar_setp_next(&this->base, buf,
4497 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4498 if(this->state & STRINGBUF_no_read)
4499 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4500 else
4501 basic_streambuf_wchar_setg(&this->base, buf,
4502 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4503 basic_streambuf_wchar_pptr(&this->base)+1);
4505 MSVCRT_operator_delete(ptr);
4508 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4511 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4512 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4513 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4514 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4515 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4516 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4518 wchar_t *cur;
4520 TRACE("(%p %x)\n", this, c);
4522 cur = basic_streambuf_wchar_gptr(&this->base);
4523 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4524 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4525 return WEOF;
4527 if(c != WEOF)
4528 cur[-1] = c;
4529 basic_streambuf_wchar_gbump(&this->base, -1);
4530 return c==WEOF ? !WEOF : c;
4533 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4534 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4535 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4536 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4537 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4538 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4540 wchar_t *ptr, *cur;
4542 TRACE("(%p)\n", this);
4544 cur = basic_streambuf_wchar_gptr(&this->base);
4545 if(!cur || this->state&STRINGBUF_no_read)
4546 return WEOF;
4548 ptr = basic_streambuf_wchar_pptr(&this->base);
4549 if(this->seekhigh < ptr)
4550 this->seekhigh = ptr;
4552 ptr = basic_streambuf_wchar_egptr(&this->base);
4553 if(this->seekhigh > ptr)
4554 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4556 if(cur < this->seekhigh)
4557 return *cur;
4558 return WEOF;
4561 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4562 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4563 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4564 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4565 #if STREAMOFF_BITS == 64
4566 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4567 #else
4568 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4569 #endif
4570 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4571 fpos_int *ret, streamoff off, int way, int mode)
4573 wchar_t *beg, *cur_r, *cur_w;
4575 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4577 cur_w = basic_streambuf_wchar_pptr(&this->base);
4578 if(cur_w > this->seekhigh)
4579 this->seekhigh = cur_w;
4581 ret->off = 0;
4582 ret->pos = 0;
4583 ret->state = 0;
4585 beg = basic_streambuf_wchar_eback(&this->base);
4586 cur_r = basic_streambuf_wchar_gptr(&this->base);
4587 if((mode & OPENMODE_in) && cur_r) {
4588 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4589 off += cur_r-beg;
4590 else if(way == SEEKDIR_end)
4591 off += this->seekhigh-beg;
4592 else if(way != SEEKDIR_beg)
4593 off = -1;
4595 if(off<0 || off>this->seekhigh-beg) {
4596 off = -1;
4597 }else {
4598 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4599 if((mode & OPENMODE_out) && cur_w) {
4600 basic_streambuf_wchar_setp_next(&this->base, beg,
4601 basic_streambuf_wchar_gptr(&this->base),
4602 basic_streambuf_wchar_epptr(&this->base));
4605 }else if((mode & OPENMODE_out) && cur_w) {
4606 if(way == SEEKDIR_cur)
4607 off += cur_w-beg;
4608 else if(way == SEEKDIR_end)
4609 off += this->seekhigh-beg;
4610 else if(way != SEEKDIR_beg)
4611 off = -1;
4613 if(off<0 || off>this->seekhigh-beg)
4614 off = -1;
4615 else
4616 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4617 }else {
4618 off = -1;
4621 ret->off = off;
4622 return ret;
4625 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4626 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4627 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4628 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4629 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4630 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4631 fpos_int *ret, fpos_int pos, int mode)
4633 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4635 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4636 *ret = pos;
4637 return ret;
4640 return basic_stringbuf_wchar_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
4643 /* ?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 */
4644 /* ?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 */
4645 /* ?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 */
4646 /* ?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 */
4647 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4648 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4650 TRACE("(%p %p)\n", this, str);
4652 basic_stringbuf_wchar__Tidy(this);
4653 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
4656 /* ?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 */
4657 /* ?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 */
4658 /* ?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 */
4659 /* ?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 */
4660 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
4661 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
4663 wchar_t *ptr;
4665 TRACE("(%p)\n", this);
4667 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
4668 wchar_t *pptr;
4670 ptr = basic_streambuf_wchar_pbase(&this->base);
4671 pptr = basic_streambuf_wchar_pptr(&this->base);
4673 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4676 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
4677 ptr = basic_streambuf_wchar_eback(&this->base);
4678 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
4681 return MSVCP_basic_string_wchar_ctor(ret);
4684 /* ??0ios_base@std@@IAE@XZ */
4685 /* ??0ios_base@std@@IEAA@XZ */
4686 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
4687 ios_base* __thiscall ios_base_ctor(ios_base *this)
4689 TRACE("(%p)\n", this);
4690 this->vtable = &MSVCP_ios_base_vtable;
4691 return this;
4694 /* ??0ios_base@std@@QAE@ABV01@@Z */
4695 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
4696 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
4697 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
4699 TRACE("(%p %p)\n", this, copy);
4700 *this = *copy;
4701 this->vtable = &MSVCP_ios_base_vtable;
4702 return this;
4705 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
4706 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
4707 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
4708 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
4710 IOS_BASE_fnarray *cur;
4712 TRACE("(%p %x)\n", this, event);
4714 for(cur=this->calls; cur; cur=cur->next)
4715 cur->event_handler(event, this, cur->index);
4718 /* ?_Tidy@ios_base@std@@AAAXXZ */
4719 /* ?_Tidy@ios_base@std@@AEAAXXZ */
4720 void CDECL ios_base_Tidy(ios_base *this)
4722 IOS_BASE_iosarray *arr_cur, *arr_next;
4723 IOS_BASE_fnarray *event_cur, *event_next;
4725 TRACE("(%p)\n", this);
4727 ios_base_Callfns(this, EVENT_erase_event);
4729 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
4730 arr_next = arr_cur->next;
4731 MSVCRT_operator_delete(arr_cur);
4733 this->arr = NULL;
4735 for(event_cur=this->calls; event_cur; event_cur=event_next) {
4736 event_next = event_cur->next;
4737 MSVCRT_operator_delete(event_cur);
4739 this->calls = NULL;
4742 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
4743 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
4744 void CDECL ios_base_Ios_base_dtor(ios_base *obj)
4746 TRACE("(%p)\n", obj);
4747 if(obj->loc) {
4748 locale_dtor(obj->loc);
4749 MSVCRT_operator_delete(obj->loc);
4751 ios_base_Tidy(obj);
4754 /* ??1ios_base@std@@UAE@XZ */
4755 /* ??1ios_base@std@@UEAA@XZ */
4756 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
4757 void __thiscall ios_base_dtor(ios_base *this)
4759 ios_base_Ios_base_dtor(this);
4762 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
4763 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
4765 TRACE("(%p %x)\n", this, flags);
4766 if(flags & 2) {
4767 /* we have an array, with the number of elements stored before the first object */
4768 INT_PTR i, *ptr = (INT_PTR *)this-1;
4770 for(i=*ptr-1; i>=0; i--)
4771 ios_base_dtor(this+i);
4772 MSVCRT_operator_delete(ptr);
4773 } else {
4774 ios_base_dtor(this);
4775 if(flags & 1)
4776 MSVCRT_operator_delete(this);
4779 return this;
4782 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
4783 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
4785 TRACE("(%p %x)\n", this, flags);
4786 if(flags & 2) {
4787 INT_PTR *ptr = (INT_PTR *)this-1;
4788 MSVCRT_operator_delete(ptr);
4789 } else {
4790 if(flags & 1)
4791 MSVCRT_operator_delete(this);
4794 return this;
4797 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
4798 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
4799 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
4800 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
4802 IOS_BASE_iosarray *p;
4804 TRACE("(%p %d)\n", this, index);
4806 for(p=this->arr; p; p=p->next) {
4807 if(p->index == index)
4808 return p;
4811 for(p=this->arr; p; p=p->next) {
4812 if(!p->long_val && !p->ptr_val) {
4813 p->index = index;
4814 return p;
4818 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
4819 p->next = this->arr;
4820 p->index = index;
4821 p->long_val = 0;
4822 p->ptr_val = NULL;
4823 this->arr = p;
4824 return p;
4827 /* ?iword@ios_base@std@@QAEAAJH@Z */
4828 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
4829 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
4830 LONG* __thiscall ios_base_iword(ios_base *this, int index)
4832 TRACE("(%p %d)\n", this, index);
4833 return &ios_base_Findarr(this, index)->long_val;
4836 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
4837 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
4838 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
4839 void** __thiscall ios_base_pword(ios_base *this, int index)
4841 TRACE("(%p %d)\n", this, index);
4842 return &ios_base_Findarr(this, index)->ptr_val;
4845 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
4846 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
4847 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
4848 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
4850 IOS_BASE_fnarray *event;
4852 TRACE("(%p %p %d)\n", this, callback, index);
4854 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
4855 event->next = this->calls;
4856 event->index = index;
4857 event->event_handler = callback;
4858 this->calls = event;
4861 /* ?clear@ios_base@std@@QAEXH_N@Z */
4862 /* ?clear@ios_base@std@@QEAAXH_N@Z */
4863 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
4864 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4866 TRACE("(%p %x %x)\n", this, state, reraise);
4868 this->state = state & IOSTATE_mask;
4869 if(!(this->state & this->except))
4870 return;
4872 if(reraise)
4873 throw_exception(EXCEPTION_RERAISE, NULL);
4874 else if(this->state & this->except & IOSTATE_eofbit)
4875 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
4876 else if(this->state & this->except & IOSTATE_failbit)
4877 throw_exception(EXCEPTION_FAILURE, "failbit is set");
4878 else if(this->state & this->except & IOSTATE_badbit)
4879 throw_exception(EXCEPTION_FAILURE, "badbit is set");
4880 else if(this->state & this->except & IOSTATE__Hardfail)
4881 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
4884 /* ?clear@ios_base@std@@QAEXH@Z */
4885 /* ?clear@ios_base@std@@QEAAXH@Z */
4886 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
4887 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
4889 ios_base_clear_reraise(this, state, FALSE);
4892 /* ?clear@ios_base@std@@QAEXI@Z */
4893 /* ?clear@ios_base@std@@QEAAXI@Z */
4894 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
4895 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
4897 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
4900 /* ?exceptions@ios_base@std@@QAEXH@Z */
4901 /* ?exceptions@ios_base@std@@QEAAXH@Z */
4902 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
4903 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
4905 TRACE("(%p %x)\n", this, state);
4906 this->except = state & IOSTATE_mask;
4907 ios_base_clear(this, this->state);
4910 /* ?exceptions@ios_base@std@@QAEXI@Z */
4911 /* ?exceptions@ios_base@std@@QEAAXI@Z */
4912 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
4913 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
4915 TRACE("(%p %x)\n", this, state);
4916 ios_base_exceptions_set(this, state);
4919 /* ?exceptions@ios_base@std@@QBEHXZ */
4920 /* ?exceptions@ios_base@std@@QEBAHXZ */
4921 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
4922 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
4924 TRACE("(%p)\n", this);
4925 return this->except;
4928 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
4929 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
4930 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
4931 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
4933 TRACE("(%p %p)\n", this, rhs);
4935 if(this != rhs) {
4936 IOS_BASE_iosarray *arr_cur;
4937 IOS_BASE_fnarray *event_cur;
4939 ios_base_Tidy(this);
4941 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
4942 if(arr_cur->long_val)
4943 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
4944 if(arr_cur->ptr_val)
4945 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
4947 this->stdstr = rhs->stdstr;
4948 this->fmtfl = rhs->fmtfl;
4949 this->prec = rhs->prec;
4950 this->wide = rhs->wide;
4951 locale_operator_assign(this->loc, rhs->loc);
4953 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
4954 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
4956 ios_base_Callfns(this, EVENT_copyfmt_event);
4957 ios_base_exceptions_set(this, rhs->except);
4960 return this;
4963 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
4964 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
4965 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
4966 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
4968 TRACE("(%p %p)\n", this, right);
4970 if(this != right) {
4971 this->state = right->state;
4972 ios_base_copyfmt(this, right);
4975 return this;
4978 /* ?fail@ios_base@std@@QBE_NXZ */
4979 /* ?fail@ios_base@std@@QEBA_NXZ */
4980 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
4981 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
4983 TRACE("(%p)\n", this);
4984 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
4987 /* ??7ios_base@std@@QBE_NXZ */
4988 /* ??7ios_base@std@@QEBA_NXZ */
4989 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
4990 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
4992 TRACE("(%p)\n", this);
4993 return ios_base_fail(this);
4996 /* ??Bios_base@std@@QBEPAXXZ */
4997 /* ??Bios_base@std@@QEBAPEAXXZ */
4998 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
4999 void* __thiscall ios_base_op_fail(const ios_base *this)
5001 TRACE("(%p)\n", this);
5002 return ios_base_fail(this) ? NULL : (void*)this;
5005 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
5006 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
5007 void CDECL ios_base_Addstd(ios_base *add)
5009 FIXME("(%p) stub\n", add);
5012 /* ?_Index_func@ios_base@std@@CAAAHXZ */
5013 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
5014 int* CDECL ios_base_Index_func(void)
5016 TRACE("\n");
5017 return &ios_base_Index;
5020 /* ?_Init@ios_base@std@@IAEXXZ */
5021 /* ?_Init@ios_base@std@@IEAAXXZ */
5022 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
5023 void __thiscall ios_base__Init(ios_base *this)
5025 TRACE("(%p)\n", this);
5027 this->stdstr = 0;
5028 this->state = this->except = IOSTATE_goodbit;
5029 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
5030 this->prec = 6;
5031 this->wide = 0;
5032 this->arr = NULL;
5033 this->calls = NULL;
5034 this->loc = MSVCRT_operator_new(sizeof(locale));
5035 locale_ctor(this->loc);
5038 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
5039 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
5040 MSVCP_bool* CDECL ios_base_Sync_func(void)
5042 TRACE("\n");
5043 return &ios_base_Sync;
5046 /* ?bad@ios_base@std@@QBE_NXZ */
5047 /* ?bad@ios_base@std@@QEBA_NXZ */
5048 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
5049 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
5051 TRACE("(%p)\n", this);
5052 return (this->state & IOSTATE_badbit) != 0;
5055 /* ?eof@ios_base@std@@QBE_NXZ */
5056 /* ?eof@ios_base@std@@QEBA_NXZ */
5057 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
5058 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
5060 TRACE("(%p)\n", this);
5061 return (this->state & IOSTATE_eofbit) != 0;
5064 /* ?flags@ios_base@std@@QAEHH@Z */
5065 /* ?flags@ios_base@std@@QEAAHH@Z */
5066 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
5067 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
5069 IOSB_fmtflags ret = this->fmtfl;
5071 TRACE("(%p %x)\n", this, flags);
5073 this->fmtfl = flags & FMTFLAG_mask;
5074 return ret;
5077 /* ?flags@ios_base@std@@QBEHXZ */
5078 /* ?flags@ios_base@std@@QEBAHXZ */
5079 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
5080 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
5082 TRACE("(%p)\n", this);
5083 return this->fmtfl;
5086 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
5087 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
5088 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
5089 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
5091 TRACE("(%p)\n", this);
5092 return locale_copy_ctor(ret, this->loc);
5095 /* ?good@ios_base@std@@QBE_NXZ */
5096 /* ?good@ios_base@std@@QEBA_NXZ */
5097 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
5098 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
5100 TRACE("(%p)\n", this);
5101 return this->state == IOSTATE_goodbit;
5104 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
5105 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
5106 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
5107 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
5109 TRACE("(%p %p)\n", this, loc);
5110 *ret = *this->loc;
5111 locale_copy_ctor(this->loc, loc);
5112 return ret;
5115 /* ?precision@ios_base@std@@QAEHH@Z */
5116 /* ?precision@ios_base@std@@QEAA_J_J@Z */
5117 #if STREAMSIZE_BITS == 64
5118 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
5119 #else
5120 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
5121 #endif
5122 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
5124 streamsize ret = this->prec;
5126 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
5128 this->prec = precision;
5129 return ret;
5132 /* ?precision@ios_base@std@@QBEHXZ */
5133 /* ?precision@ios_base@std@@QEBA_JXZ */
5134 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
5135 streamsize __thiscall ios_base_precision_get(const ios_base *this)
5137 TRACE("(%p)\n", this);
5138 return this->prec;
5141 /* ?rdstate@ios_base@std@@QBEHXZ */
5142 /* ?rdstate@ios_base@std@@QEBAHXZ */
5143 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
5144 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
5146 TRACE("(%p)\n", this);
5147 return this->state;
5150 /* ?setf@ios_base@std@@QAEHHH@Z */
5151 /* ?setf@ios_base@std@@QEAAHHH@Z */
5152 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
5153 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
5155 IOSB_fmtflags ret = this->fmtfl;
5157 TRACE("(%p %x %x)\n", this, flags, mask);
5159 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
5160 return ret;
5163 /* ?setf@ios_base@std@@QAEHH@Z */
5164 /* ?setf@ios_base@std@@QEAAHH@Z */
5165 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
5166 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
5168 IOSB_fmtflags ret = this->fmtfl;
5170 TRACE("(%p %x)\n", this, flags);
5172 this->fmtfl |= flags & FMTFLAG_mask;
5173 return ret;
5176 /* ?setstate@ios_base@std@@QAEXH_N@Z */
5177 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
5178 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
5179 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5181 TRACE("(%p %x %x)\n", this, state, reraise);
5183 if(state != IOSTATE_goodbit)
5184 ios_base_clear_reraise(this, this->state | state, reraise);
5187 /* ?setstate@ios_base@std@@QAEXH@Z */
5188 /* ?setstate@ios_base@std@@QEAAXH@Z */
5189 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
5190 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
5192 ios_base_setstate_reraise(this, state, FALSE);
5195 /* ?setstate@ios_base@std@@QAEXI@Z */
5196 /* ?setstate@ios_base@std@@QEAAXI@Z */
5197 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
5198 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
5200 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5203 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
5204 MSVCP_bool CDECL ios_base_sync_with_stdio(MSVCP_bool sync)
5206 _Lockit lock;
5207 MSVCP_bool ret;
5209 TRACE("(%x)\n", sync);
5211 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5212 ret = ios_base_Sync;
5213 ios_base_Sync = sync;
5214 _Lockit_dtor(&lock);
5215 return ret;
5218 /* ?unsetf@ios_base@std@@QAEXH@Z */
5219 /* ?unsetf@ios_base@std@@QEAAXH@Z */
5220 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
5221 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
5223 TRACE("(%p %x)\n", this, flags);
5224 this->fmtfl &= ~flags;
5227 /* ?width@ios_base@std@@QAEHH@Z */
5228 /* ?width@ios_base@std@@QEAA_J_J@Z */
5229 #if STREAMSIZE_BITS == 64
5230 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
5231 #else
5232 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
5233 #endif
5234 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
5236 streamsize ret = this->wide;
5238 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
5240 this->wide = width;
5241 return ret;
5244 /* ?width@ios_base@std@@QBEHXZ */
5245 /* ?width@ios_base@std@@QEBA_JXZ */
5246 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
5247 streamsize __thiscall ios_base_width_get(ios_base *this)
5249 TRACE("(%p)\n", this);
5250 return this->wide;
5253 /* ?xalloc@ios_base@std@@SAHXZ */
5254 int CDECL ios_base_xalloc(void)
5256 _Lockit lock;
5257 int ret;
5259 TRACE("\n");
5261 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5262 ret = ios_base_Index++;
5263 _Lockit_dtor(&lock);
5264 return ret;
5267 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
5268 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
5269 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
5270 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
5272 TRACE("(%p)\n", this);
5274 ios_base_ctor(&this->base);
5275 this->base.vtable = &MSVCP_basic_ios_char_vtable;
5276 return this;
5279 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5280 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5281 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
5282 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
5284 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5285 ios_base__Init(&this->base);
5286 this->strbuf = streambuf;
5287 this->stream = NULL;
5288 this->fillch = ' ';
5290 if(!streambuf)
5291 ios_base_setstate(&this->base, IOSTATE_badbit);
5293 if(isstd)
5294 FIXME("standard streams not handled yet\n");
5297 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5298 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5299 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
5300 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
5302 TRACE("(%p %p)\n", this, strbuf);
5304 basic_ios_char_ctor(this);
5305 basic_ios_char_init(this, strbuf, FALSE);
5306 return this;
5309 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
5310 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5311 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
5312 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
5314 TRACE("(%p)\n", this);
5315 ios_base_dtor(&this->base);
5318 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
5319 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
5321 TRACE("(%p %x)\n", this, flags);
5322 if(flags & 2) {
5323 /* we have an array, with the number of elements stored before the first object */
5324 INT_PTR i, *ptr = (INT_PTR *)this-1;
5326 for(i=*ptr-1; i>=0; i--)
5327 basic_ios_char_dtor(this+i);
5328 MSVCRT_operator_delete(ptr);
5329 } else {
5330 basic_ios_char_dtor(this);
5331 if(flags & 1)
5332 MSVCRT_operator_delete(this);
5335 return this;
5338 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5339 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5340 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5341 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5343 TRACE("(%p %x %x)\n", this, state, reraise);
5344 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5347 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5348 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5349 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5350 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5352 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5355 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5356 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5357 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5358 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5360 TRACE("(%p %p)\n", this, copy);
5361 if(this == copy)
5362 return this;
5364 this->stream = copy->stream;
5365 this->fillch = copy->fillch;
5366 ios_base_copyfmt(&this->base, &copy->base);
5367 return this;
5370 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5371 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5372 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5373 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5375 char ret = this->fillch;
5377 TRACE("(%p %c)\n", this, fill);
5379 this->fillch = fill;
5380 return ret;
5383 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5384 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5385 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5386 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5388 TRACE("(%p)\n", this);
5389 return this->fillch;
5392 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5393 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5394 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5395 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5397 TRACE("(%p %p %p)\n", this, ret, loc);
5399 if(this->strbuf) {
5400 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5401 locale_dtor(ret);
5404 return ios_base_imbue(&this->base, ret, loc);
5407 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5408 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5409 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5410 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5412 TRACE("(%p %c %c)\n", this, ch, def);
5413 return ctype_char_narrow_ch(ctype_char_use_facet(this->strbuf->loc), ch, def);
5416 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5417 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5418 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5419 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5421 basic_streambuf_char *ret = this->strbuf;
5423 TRACE("(%p %p)\n", this, streambuf);
5425 this->strbuf = streambuf;
5426 basic_ios_char_clear(this, IOSTATE_goodbit);
5427 return ret;
5430 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5431 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5432 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5433 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5435 TRACE("(%p)\n", this);
5436 return this->strbuf;
5439 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5440 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5441 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5442 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5444 TRACE("(%p %x %x)\n", this, state, reraise);
5446 if(state != IOSTATE_goodbit)
5447 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5450 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5451 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5452 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5453 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5455 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5458 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5459 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5460 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5461 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5463 basic_ostream_char *ret = this->stream;
5465 TRACE("(%p %p)\n", this, ostream);
5467 this->stream = ostream;
5468 return ret;
5471 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5472 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5473 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5474 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5476 TRACE("(%p)\n", this);
5477 return this->stream;
5480 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5481 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5482 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5483 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5485 TRACE("(%p %c)\n", this, ch);
5486 return ctype_char_widen_ch(ctype_char_use_facet(this->strbuf->loc), ch);
5490 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5491 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5492 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5493 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5495 TRACE("(%p)\n", this);
5497 ios_base_ctor(&this->base);
5498 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5499 return this;
5502 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5503 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5504 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5505 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5507 basic_ios_wchar_ctor(this);
5508 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5509 return this;
5512 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5513 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5514 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5515 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5516 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5517 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
5519 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5520 ios_base__Init(&this->base);
5521 this->strbuf = streambuf;
5522 this->stream = NULL;
5523 this->fillch = ' ';
5525 if(!streambuf)
5526 ios_base_setstate(&this->base, IOSTATE_badbit);
5528 if(isstd)
5529 FIXME("standard streams not handled yet\n");
5532 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5533 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5534 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
5535 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5537 TRACE("(%p %p)\n", this, strbuf);
5539 basic_ios_wchar_ctor(this);
5540 basic_ios_wchar_init(this, strbuf, FALSE);
5541 return this;
5544 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5545 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5546 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
5547 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5549 basic_ios_wchar_ctor_streambuf(this, strbuf);
5550 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5551 return this;
5554 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
5555 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
5556 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
5557 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
5558 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
5559 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
5561 TRACE("(%p)\n", this);
5562 ios_base_dtor(&this->base);
5565 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5566 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5568 TRACE("(%p %x)\n", this, flags);
5569 if(flags & 2) {
5570 /* we have an array, with the number of elements stored before the first object */
5571 INT_PTR i, *ptr = (INT_PTR *)this-1;
5573 for(i=*ptr-1; i>=0; i--)
5574 basic_ios_wchar_dtor(this+i);
5575 MSVCRT_operator_delete(ptr);
5576 } else {
5577 basic_ios_wchar_dtor(this);
5578 if(flags & 1)
5579 MSVCRT_operator_delete(this);
5582 return this;
5585 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5586 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5587 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5588 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5589 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5590 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5592 TRACE("(%p %x %x)\n", this, state, reraise);
5593 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5596 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5597 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5598 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5599 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5600 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
5601 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
5603 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
5606 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
5607 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5608 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
5609 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5610 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
5611 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
5613 TRACE("(%p %p)\n", this, copy);
5614 if(this == copy)
5615 return this;
5617 this->stream = copy->stream;
5618 this->fillch = copy->fillch;
5619 ios_base_copyfmt(&this->base, &copy->base);
5620 return this;
5623 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
5624 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
5625 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
5626 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
5627 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
5628 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
5630 wchar_t ret = this->fillch;
5632 TRACE("(%p %c)\n", this, fill);
5634 this->fillch = fill;
5635 return ret;
5638 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
5639 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
5640 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
5641 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
5642 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
5643 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
5645 TRACE("(%p)\n", this);
5646 return this->fillch;
5649 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5650 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5651 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5652 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5653 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
5654 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
5656 TRACE("(%p %p %p)\n", this, ret, loc);
5658 if(this->strbuf) {
5659 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
5660 locale_dtor(ret);
5663 return ios_base_imbue(&this->base, ret, loc);
5666 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
5667 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
5668 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
5669 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
5670 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
5671 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
5673 TRACE("(%p %c %c)\n", this, ch, def);
5674 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(this->strbuf->loc), ch, def);
5677 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5678 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5679 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
5680 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5681 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
5682 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
5684 basic_streambuf_wchar *ret = this->strbuf;
5686 TRACE("(%p %p)\n", this, streambuf);
5688 this->strbuf = streambuf;
5689 basic_ios_wchar_clear(this, IOSTATE_goodbit);
5690 return ret;
5693 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5694 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5695 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5696 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5697 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
5698 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
5700 TRACE("(%p)\n", this);
5701 return this->strbuf;
5704 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5705 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5706 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5707 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5708 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
5709 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5711 TRACE("(%p %x %x)\n", this, state, reraise);
5713 if(state != IOSTATE_goodbit)
5714 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
5717 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5718 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5719 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5720 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5721 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
5722 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
5724 basic_ios_wchar_setstate_reraise(this, state, FALSE);
5727 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5728 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5729 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
5730 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5731 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
5732 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
5734 basic_ostream_wchar *ret = this->stream;
5736 TRACE("(%p %p)\n", this, ostream);
5738 this->stream = ostream;
5739 return ret;
5742 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5743 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5744 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5745 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5746 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
5747 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
5749 TRACE("(%p)\n", this);
5750 return this->stream;
5753 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
5754 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
5755 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
5756 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
5757 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
5758 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
5760 TRACE("(%p %c)\n", this, ch);
5761 return ctype_wchar_widen_ch(ctype_wchar_use_facet(this->strbuf->loc), ch);
5764 /* Caution: basic_ostream uses virtual inheritance.
5765 * All constructors have additional parameter that says if base class should be initialized.
5766 * Base class needs to be accessed using vbtable.
5768 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
5770 return (basic_ios_char*)((char*)this+this->vbtable[1]);
5773 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
5775 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
5778 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
5780 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
5783 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5784 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
5785 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 16)
5786 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
5787 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
5789 basic_ios_char *base;
5791 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
5793 if(virt_init) {
5794 this->vbtable = basic_ostream_char_vbtable;
5795 base = basic_ostream_char_get_basic_ios(this);
5796 basic_ios_char_ctor(base);
5797 }else {
5798 base = basic_ostream_char_get_basic_ios(this);
5801 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5802 basic_ios_char_init(base, strbuf, isstd);
5803 return this;
5806 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
5807 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
5808 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 16)
5809 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
5810 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
5812 basic_ios_char *base;
5814 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
5816 if(virt_init) {
5817 this->vbtable = basic_ostream_char_vbtable;
5818 base = basic_ostream_char_get_basic_ios(this);
5819 basic_ios_char_ctor(base);
5820 }else {
5821 base = basic_ostream_char_get_basic_ios(this);
5824 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5825 if(addstd)
5826 ios_base_Addstd(&base->base);
5827 return this;
5830 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5831 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5832 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
5833 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
5835 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5837 /* don't destroy virtual base here */
5838 TRACE("(%p)\n", this);
5841 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5842 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5843 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
5844 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
5846 TRACE("(%p)\n", this);
5847 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
5848 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
5851 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
5852 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5854 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5856 TRACE("(%p %x)\n", this, flags);
5858 if(flags & 2) {
5859 /* we have an array, with the number of elements stored before the first object */
5860 INT_PTR i, *ptr = (INT_PTR *)this-1;
5862 for(i=*ptr-1; i>=0; i--)
5863 basic_ostream_char_vbase_dtor(this+i);
5864 MSVCRT_operator_delete(ptr);
5865 } else {
5866 basic_ostream_char_vbase_dtor(this);
5867 if(flags & 1)
5868 MSVCRT_operator_delete(this);
5871 return this;
5874 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
5875 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
5876 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
5877 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
5879 /* this function is not matching C++ specification */
5880 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5882 TRACE("(%p)\n", this);
5884 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
5885 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
5886 basic_ios_char_setstate(base, IOSTATE_badbit);
5887 return this;
5890 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5891 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5892 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
5894 return basic_ostream_char_flush(ostream);
5897 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5898 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5899 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
5900 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
5902 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5904 TRACE("(%p)\n", this);
5906 if(base->base.fmtfl & FMTFLAG_unitbuf)
5907 basic_ostream_char_flush(this);
5910 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5911 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5912 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
5913 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
5915 TRACE("(%p)\n", this);
5916 basic_ostream_char__Osfx(this);
5919 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
5921 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5923 if(basic_ios_char_rdbuf_get(base))
5924 call_basic_streambuf_char__Lock(base->strbuf);
5926 if(ios_base_good(&base->base) && base->stream)
5927 basic_ostream_char_flush(base->stream);
5929 return ios_base_good(&base->base);
5932 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
5934 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5936 if(ios_base_good(&base->base) && !__uncaught_exception())
5937 basic_ostream_char_osfx(ostr);
5939 if(basic_ios_char_rdbuf_get(base))
5940 call_basic_streambuf_char__Unlock(base->strbuf);
5943 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
5944 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
5945 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
5946 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
5948 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5950 TRACE("(%p)\n", this);
5952 if(ios_base_good(&base->base) && base->stream)
5953 basic_ostream_char_flush(base->stream);
5954 return ios_base_good(&base->base);
5957 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
5958 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
5959 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
5960 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
5962 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5964 TRACE("(%p %c)\n", this, ch);
5966 if(!basic_ostream_char_sentry_create(this)
5967 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
5968 basic_ostream_char_sentry_destroy(this);
5969 basic_ios_char_setstate(base, IOSTATE_badbit);
5970 return this;
5973 basic_ostream_char_sentry_destroy(this);
5974 return this;
5977 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
5978 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
5979 #if STREAMOFF_BITS == 64
5980 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 16)
5981 #else
5982 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
5983 #endif
5984 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
5986 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5988 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
5990 if(!ios_base_fail(&base->base)) {
5991 fpos_int seek;
5993 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
5994 &seek, off, way, OPENMODE_out);
5995 if(seek.off==-1 && seek.pos==0 && seek.state==0)
5996 basic_ios_char_setstate(base, IOSTATE_failbit);
5998 return this;
6001 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6002 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6003 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
6004 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
6006 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6008 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6010 if(!ios_base_fail(&base->base)) {
6011 fpos_int seek;
6013 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
6014 &seek, pos, OPENMODE_out);
6015 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6016 basic_ios_char_setstate(base, IOSTATE_failbit);
6018 return this;
6021 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6022 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6023 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
6024 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
6026 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6028 TRACE("(%p)\n", this);
6030 if(!ios_base_fail(&base->base)) {
6031 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6032 ret, 0, SEEKDIR_cur, OPENMODE_out);
6033 }else {
6034 ret->off = -1;
6035 ret->pos = 0;
6036 ret->state = 0;
6038 return ret;
6041 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
6042 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
6043 #if STREAMSIZE_BITS == 64
6044 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
6045 #else
6046 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
6047 #endif
6048 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
6050 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6052 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
6054 if(!basic_ostream_char_sentry_create(this)
6055 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
6056 basic_ostream_char_sentry_destroy(this);
6057 basic_ios_char_setstate(base, IOSTATE_badbit);
6058 return this;
6061 basic_ostream_char_sentry_destroy(this);
6062 return this;
6065 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
6066 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
6067 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
6068 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
6070 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6071 int state = IOSTATE_goodbit;
6073 TRACE("(%p %d)\n", this, val);
6075 if(basic_ostream_char_sentry_create(this)) {
6076 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6077 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6078 ostreambuf_iterator_char dest;
6080 memset(&dest, 0, sizeof(dest));
6081 dest.strbuf = strbuf;
6082 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
6083 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6084 ? (LONG)((unsigned short)val) : (LONG)val);
6086 basic_ostream_char_sentry_destroy(this);
6088 basic_ios_char_setstate(base, state);
6089 return this;
6092 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
6093 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
6094 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
6095 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
6097 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6098 int state = IOSTATE_goodbit;
6100 TRACE("(%p %u)\n", this, val);
6102 if(basic_ostream_char_sentry_create(this)) {
6103 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6104 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6105 ostreambuf_iterator_char dest;
6107 memset(&dest, 0, sizeof(dest));
6108 dest.strbuf = strbuf;
6109 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6111 basic_ostream_char_sentry_destroy(this);
6113 basic_ios_char_setstate(base, state);
6114 return this;
6117 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
6118 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
6119 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
6120 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
6121 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
6122 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
6124 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6125 int state = IOSTATE_goodbit;
6127 TRACE("(%p %d)\n", this, val);
6129 if(basic_ostream_char_sentry_create(this)) {
6130 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6131 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6132 ostreambuf_iterator_char dest;
6134 memset(&dest, 0, sizeof(dest));
6135 dest.strbuf = strbuf;
6136 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6138 basic_ostream_char_sentry_destroy(this);
6140 basic_ios_char_setstate(base, state);
6141 return this;
6144 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
6145 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
6146 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
6147 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
6148 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
6149 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
6151 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6152 int state = IOSTATE_goodbit;
6154 TRACE("(%p %u)\n", this, val);
6156 if(basic_ostream_char_sentry_create(this)) {
6157 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6158 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6159 ostreambuf_iterator_char dest;
6161 memset(&dest, 0, sizeof(dest));
6162 dest.strbuf = strbuf;
6163 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6165 basic_ostream_char_sentry_destroy(this);
6167 basic_ios_char_setstate(base, state);
6168 return this;
6171 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
6172 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
6173 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
6174 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
6176 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6177 int state = IOSTATE_goodbit;
6179 TRACE("(%p %f)\n", this, val);
6181 if(basic_ostream_char_sentry_create(this)) {
6182 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6183 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6184 ostreambuf_iterator_char dest;
6186 memset(&dest, 0, sizeof(dest));
6187 dest.strbuf = strbuf;
6188 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6190 basic_ostream_char_sentry_destroy(this);
6192 basic_ios_char_setstate(base, state);
6193 return this;
6196 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
6197 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
6198 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
6199 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
6201 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6202 int state = IOSTATE_goodbit;
6204 TRACE("(%p %lf)\n", this, val);
6206 if(basic_ostream_char_sentry_create(this)) {
6207 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6208 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6209 ostreambuf_iterator_char dest;
6211 memset(&dest, 0, sizeof(dest));
6212 dest.strbuf = strbuf;
6213 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6215 basic_ostream_char_sentry_destroy(this);
6217 basic_ios_char_setstate(base, state);
6218 return this;
6221 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
6222 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
6223 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
6224 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
6226 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6227 int state = IOSTATE_goodbit;
6229 TRACE("(%p %lf)\n", this, val);
6231 if(basic_ostream_char_sentry_create(this)) {
6232 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6233 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6234 ostreambuf_iterator_char dest;
6236 memset(&dest, 0, sizeof(dest));
6237 dest.strbuf = strbuf;
6238 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6240 basic_ostream_char_sentry_destroy(this);
6242 basic_ios_char_setstate(base, state);
6243 return this;
6246 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6247 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6248 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
6249 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
6251 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6252 IOSB_iostate state = IOSTATE_badbit;
6253 int c = '\n';
6255 TRACE("(%p %p)\n", this, val);
6257 if(basic_ostream_char_sentry_create(this)) {
6258 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
6259 c = basic_streambuf_char_snextc(val)) {
6260 state = IOSTATE_goodbit;
6262 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
6263 state = IOSTATE_badbit;
6264 break;
6267 }else {
6268 state = IOSTATE_badbit;
6270 basic_ostream_char_sentry_destroy(this);
6272 ios_base_width_set(&base->base, 0);
6273 basic_ios_char_setstate(base, state);
6274 return this;
6277 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
6278 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
6279 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
6280 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
6282 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6283 int state = IOSTATE_goodbit;
6285 TRACE("(%p %p)\n", this, val);
6287 if(basic_ostream_char_sentry_create(this)) {
6288 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6289 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6290 ostreambuf_iterator_char dest;
6292 memset(&dest, 0, sizeof(dest));
6293 dest.strbuf = strbuf;
6294 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6296 basic_ostream_char_sentry_destroy(this);
6298 basic_ios_char_setstate(base, state);
6299 return this;
6302 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
6303 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
6304 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
6305 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
6307 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6308 int state = IOSTATE_goodbit;
6310 TRACE("(%p)\n", this);
6312 if(basic_ostream_char_sentry_create(this)) {
6313 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6314 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6315 ostreambuf_iterator_char dest;
6317 memset(&dest, 0, sizeof(dest));
6318 dest.strbuf = strbuf;
6319 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6321 basic_ostream_char_sentry_destroy(this);
6323 basic_ios_char_setstate(base, state);
6324 return this;
6327 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
6328 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
6329 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
6330 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
6332 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6333 int state = IOSTATE_goodbit;
6335 TRACE("(%p)\n", this);
6337 if(basic_ostream_char_sentry_create(this)) {
6338 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6339 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6340 ostreambuf_iterator_char dest;
6342 memset(&dest, 0, sizeof(dest));
6343 dest.strbuf = strbuf;
6344 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6346 basic_ostream_char_sentry_destroy(this);
6348 basic_ios_char_setstate(base, state);
6349 return this;
6352 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
6353 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
6354 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
6355 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
6357 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6358 int state = IOSTATE_goodbit;
6360 TRACE("(%p %x)\n", this, val);
6362 if(basic_ostream_char_sentry_create(this)) {
6363 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6364 const num_put *numput = num_put_char_use_facet(strbuf->loc);
6365 ostreambuf_iterator_char dest;
6367 memset(&dest, 0, sizeof(dest));
6368 dest.strbuf = strbuf;
6369 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6371 basic_ostream_char_sentry_destroy(this);
6373 basic_ios_char_setstate(base, state);
6374 return this;
6377 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6378 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6379 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6381 TRACE("(%p)\n", ostr);
6383 basic_ostream_char_put(ostr, 0);
6384 return ostr;
6387 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6388 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6389 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6391 TRACE("(%p)\n", ostr);
6393 basic_ostream_char_put(ostr, '\n');
6394 basic_ostream_char_flush(ostr);
6395 return ostr;
6398 /* $?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 */
6399 /* ??$?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 */
6400 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6402 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6403 IOSB_iostate state = IOSTATE_goodbit;
6405 TRACE("(%p %p)\n", ostr, str);
6407 if(basic_ostream_char_sentry_create(ostr)) {
6408 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6409 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6411 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6412 for(; pad!=0; pad--) {
6413 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6414 state = IOSTATE_badbit;
6415 break;
6420 if(state == IOSTATE_goodbit) {
6421 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6422 state = IOSTATE_badbit;
6425 if(state == IOSTATE_goodbit) {
6426 for(; pad!=0; pad--) {
6427 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6428 state = IOSTATE_badbit;
6429 break;
6434 base->base.wide = 0;
6435 }else {
6436 state = IOSTATE_badbit;
6438 basic_ostream_char_sentry_destroy(ostr);
6440 basic_ios_char_setstate(base, state);
6441 return ostr;
6444 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6445 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6446 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6447 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6448 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6449 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6450 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6452 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6453 IOSB_iostate state = IOSTATE_goodbit;
6455 TRACE("(%p %d)\n", ostr, ch);
6457 if(basic_ostream_char_sentry_create(ostr)) {
6458 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6460 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6461 for(; pad!=0; pad--) {
6462 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6463 state = IOSTATE_badbit;
6464 break;
6469 if(state == IOSTATE_goodbit) {
6470 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6471 state = IOSTATE_badbit;
6474 if(state == IOSTATE_goodbit) {
6475 for(; pad!=0; pad--) {
6476 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6477 state = IOSTATE_badbit;
6478 break;
6483 base->base.wide = 0;
6484 }else {
6485 state = IOSTATE_badbit;
6487 basic_ostream_char_sentry_destroy(ostr);
6489 basic_ios_char_setstate(base, state);
6490 return ostr;
6493 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6494 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6495 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6496 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6497 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
6498 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
6499 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
6501 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6502 IOSB_iostate state = IOSTATE_goodbit;
6504 TRACE("(%p %s)\n", ostr, str);
6506 if(basic_ostream_char_sentry_create(ostr)) {
6507 MSVCP_size_t len = strlen(str);
6508 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6510 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6511 for(; pad!=0; pad--) {
6512 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6513 state = IOSTATE_badbit;
6514 break;
6519 if(state == IOSTATE_goodbit) {
6520 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
6521 state = IOSTATE_badbit;
6524 if(state == IOSTATE_goodbit) {
6525 for(; pad!=0; pad--) {
6526 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6527 state = IOSTATE_badbit;
6528 break;
6533 base->base.wide = 0;
6534 }else {
6535 state = IOSTATE_badbit;
6537 basic_ostream_char_sentry_destroy(ostr);
6539 basic_ios_char_setstate(base, state);
6540 return ostr;
6543 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6544 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6545 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
6546 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
6547 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
6549 TRACE("(%p %p)\n", this, pfunc);
6550 pfunc(this);
6551 return this;
6554 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
6555 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
6556 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
6557 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
6558 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
6560 TRACE("(%p %p)\n", this, pfunc);
6561 pfunc(basic_ostream_char_get_basic_ios(this));
6562 return this;
6565 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6566 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6567 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
6568 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
6569 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
6571 TRACE("(%p %p)\n", this, pfunc);
6572 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
6573 return this;
6576 /* Caution: basic_ostream uses virtual inheritance. */
6577 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
6579 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
6582 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
6584 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
6587 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
6589 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
6592 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
6593 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
6594 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor, 16)
6595 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor(basic_ostream_wchar *this,
6596 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6598 basic_ios_wchar *base;
6600 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6602 if(virt_init) {
6603 this->vbtable = basic_ostream_wchar_vbtable;
6604 base = basic_ostream_wchar_get_basic_ios(this);
6605 basic_ios_wchar_ctor(base);
6606 }else {
6607 base = basic_ostream_wchar_get_basic_ios(this);
6610 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
6611 basic_ios_wchar_init(base, strbuf, isstd);
6612 return this;
6615 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
6616 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
6617 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 16)
6618 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
6619 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
6621 basic_ostream_wchar_ctor(this, strbuf, isstd, virt_init);
6622 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
6623 return this;
6626 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6627 /* ??0?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6628 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_ctor_uninitialized, 16)
6629 basic_ostream_wchar* __thiscall basic_ostream_wchar_ctor_uninitialized(basic_ostream_wchar *this,
6630 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6632 basic_ios_wchar *base;
6634 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
6636 if(virt_init) {
6637 this->vbtable = basic_ostream_wchar_vbtable;
6638 base = basic_ostream_wchar_get_basic_ios(this);
6639 basic_ios_wchar_ctor(base);
6640 }else {
6641 base = basic_ostream_wchar_get_basic_ios(this);
6644 base->base.vtable = &MSVCP_basic_ostream_wchar_vtable;
6645 if(addstd)
6646 ios_base_Addstd(&base->base);
6647 return this;
6650 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
6651 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
6652 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 16)
6653 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
6654 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
6656 basic_ostream_wchar_ctor_uninitialized(this, uninitialized, addstd, virt_init);
6657 basic_ostream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_ostream_short_vtable;
6658 return this;
6661 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6662 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6663 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
6664 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6665 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
6666 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
6668 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6670 /* don't destroy virtual base here */
6671 TRACE("(%p)\n", this);
6674 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6675 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6676 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6677 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6678 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
6679 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
6681 TRACE("(%p)\n", this);
6682 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
6683 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
6686 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
6687 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
6689 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6691 TRACE("(%p %x)\n", this, flags);
6693 if(flags & 2) {
6694 /* we have an array, with the number of elements stored before the first object */
6695 INT_PTR i, *ptr = (INT_PTR *)this-1;
6697 for(i=*ptr-1; i>=0; i--)
6698 basic_ostream_wchar_vbase_dtor(this+i);
6699 MSVCRT_operator_delete(ptr);
6700 } else {
6701 basic_ostream_wchar_vbase_dtor(this);
6702 if(flags & 1)
6703 MSVCRT_operator_delete(this);
6706 return this;
6709 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
6710 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
6711 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
6712 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
6713 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
6714 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
6716 /* this function is not matching C++ specification */
6717 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6719 TRACE("(%p)\n", this);
6721 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
6722 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
6723 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6724 return this;
6727 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6728 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6729 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6730 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6731 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
6733 return basic_ostream_wchar_flush(ostream);
6736 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6737 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6738 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6739 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6740 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
6741 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
6743 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6745 TRACE("(%p)\n", this);
6747 if(base->base.fmtfl & FMTFLAG_unitbuf)
6748 basic_ostream_wchar_flush(this);
6751 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6752 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6753 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6754 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6755 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
6756 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
6758 TRACE("(%p)\n", this);
6759 basic_ostream_wchar__Osfx(this);
6762 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
6764 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6766 if(basic_ios_wchar_rdbuf_get(base))
6767 basic_streambuf_wchar__Lock(base->strbuf);
6769 if(ios_base_good(&base->base) && base->stream)
6770 basic_ostream_wchar_flush(base->stream);
6772 return ios_base_good(&base->base);
6775 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
6777 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6779 if(ios_base_good(&base->base) && !__uncaught_exception())
6780 basic_ostream_wchar_osfx(ostr);
6782 if(basic_ios_wchar_rdbuf_get(base))
6783 basic_streambuf_wchar__Unlock(base->strbuf);
6786 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
6787 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
6788 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
6789 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
6790 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
6791 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
6793 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6795 TRACE("(%p)\n", this);
6797 if(ios_base_good(&base->base) && base->stream)
6798 basic_ostream_wchar_flush(base->stream);
6799 return ios_base_good(&base->base);
6802 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
6803 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
6804 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
6805 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
6806 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
6807 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
6809 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6811 TRACE("(%p %c)\n", this, ch);
6813 if(!basic_ostream_wchar_sentry_create(this)
6814 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
6815 basic_ostream_wchar_sentry_destroy(this);
6816 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6817 return this;
6820 basic_ostream_wchar_sentry_destroy(this);
6821 return this;
6824 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
6825 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
6826 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
6827 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
6828 #if STREAMOFF_BITS == 64
6829 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 16)
6830 #else
6831 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
6832 #endif
6833 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
6835 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6837 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6839 if(!ios_base_fail(&base->base)) {
6840 fpos_int seek;
6842 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6843 &seek, off, way, OPENMODE_out);
6844 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6845 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6847 return this;
6850 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6851 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6852 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6853 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6854 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
6855 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_int pos)
6857 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6859 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6861 if(!ios_base_fail(&base->base)) {
6862 fpos_int seek;
6864 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
6865 &seek, pos, OPENMODE_out);
6866 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6867 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6869 return this;
6872 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6873 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6874 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6875 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6876 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
6877 fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_int *ret)
6879 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6881 TRACE("(%p)\n", this);
6883 if(!ios_base_fail(&base->base)) {
6884 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6885 ret, 0, SEEKDIR_cur, OPENMODE_out);
6886 }else {
6887 ret->off = -1;
6888 ret->pos = 0;
6889 ret->state = 0;
6891 return ret;
6894 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
6895 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
6896 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
6897 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
6898 #if STREAMSIZE_BITS == 64
6899 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
6900 #else
6901 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
6902 #endif
6903 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
6905 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6907 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
6909 if(!basic_ostream_wchar_sentry_create(this)
6910 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
6911 basic_ostream_wchar_sentry_destroy(this);
6912 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6913 return this;
6916 basic_ostream_wchar_sentry_destroy(this);
6917 return this;
6920 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
6922 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6923 int state = IOSTATE_goodbit;
6925 TRACE("(%p %d)\n", this, val);
6927 if(basic_ostream_wchar_sentry_create(this)) {
6928 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6929 ostreambuf_iterator_wchar dest;
6931 memset(&dest, 0, sizeof(dest));
6932 dest.strbuf = strbuf;
6933 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
6934 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6935 ? (LONG)((unsigned short)val) : (LONG)val);
6937 basic_ostream_wchar_sentry_destroy(this);
6939 basic_ios_wchar_setstate(base, state);
6940 return this;
6943 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
6944 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
6945 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
6946 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
6948 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
6949 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6952 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
6953 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
6954 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
6955 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
6957 return basic_ostream_print_short(this, val, num_put_short_use_facet(
6958 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6961 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
6963 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6964 int state = IOSTATE_goodbit;
6966 TRACE("(%p %d)\n", this, val);
6968 if(basic_ostream_wchar_sentry_create(this)) {
6969 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6970 ostreambuf_iterator_wchar dest;
6972 memset(&dest, 0, sizeof(dest));
6973 dest.strbuf = strbuf;
6974 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
6976 basic_ostream_wchar_sentry_destroy(this);
6978 basic_ios_wchar_setstate(base, state);
6979 return this;
6982 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
6983 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
6984 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
6985 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
6987 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
6988 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
6991 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
6992 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
6993 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
6994 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
6996 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
6997 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7000 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
7002 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7003 int state = IOSTATE_goodbit;
7005 TRACE("(%p %d)\n", this, val);
7007 if(basic_ostream_wchar_sentry_create(this)) {
7008 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7009 ostreambuf_iterator_wchar dest;
7011 memset(&dest, 0, sizeof(dest));
7012 dest.strbuf = strbuf;
7013 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7015 basic_ostream_wchar_sentry_destroy(this);
7017 basic_ios_wchar_setstate(base, state);
7018 return this;
7021 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
7022 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
7023 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
7024 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
7025 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
7026 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
7028 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
7029 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7032 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
7033 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
7034 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
7035 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
7036 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
7037 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
7039 return basic_ostream_print_int(this, val, num_put_short_use_facet(
7040 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7043 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
7045 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7046 int state = IOSTATE_goodbit;
7048 TRACE("(%p %u)\n", this, val);
7050 if(basic_ostream_wchar_sentry_create(this)) {
7051 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7052 ostreambuf_iterator_wchar dest;
7054 memset(&dest, 0, sizeof(dest));
7055 dest.strbuf = strbuf;
7056 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7058 basic_ostream_wchar_sentry_destroy(this);
7060 basic_ios_wchar_setstate(base, state);
7061 return this;
7064 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
7065 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
7066 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
7067 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
7068 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
7069 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
7071 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
7072 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7075 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
7076 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
7077 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
7078 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
7079 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
7080 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
7082 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
7083 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7086 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
7088 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7089 int state = IOSTATE_goodbit;
7091 TRACE("(%p %f)\n", this, val);
7093 if(basic_ostream_wchar_sentry_create(this)) {
7094 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7095 ostreambuf_iterator_wchar dest;
7097 memset(&dest, 0, sizeof(dest));
7098 dest.strbuf = strbuf;
7099 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7101 basic_ostream_wchar_sentry_destroy(this);
7103 basic_ios_wchar_setstate(base, state);
7104 return this;
7107 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
7108 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
7109 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
7110 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
7112 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
7113 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7116 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
7117 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
7118 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
7119 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
7121 return basic_ostream_print_float(this, val, num_put_short_use_facet(
7122 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7125 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
7127 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7128 int state = IOSTATE_goodbit;
7130 TRACE("(%p %lf)\n", this, val);
7132 if(basic_ostream_wchar_sentry_create(this)) {
7133 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7134 ostreambuf_iterator_wchar dest;
7136 memset(&dest, 0, sizeof(dest));
7137 dest.strbuf = strbuf;
7138 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7140 basic_ostream_wchar_sentry_destroy(this);
7142 basic_ios_wchar_setstate(base, state);
7143 return this;
7146 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
7147 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
7148 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
7149 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
7151 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
7152 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7155 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
7156 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
7157 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
7158 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
7160 return basic_ostream_print_double(this, val, num_put_short_use_facet(
7161 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7164 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
7166 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7167 int state = IOSTATE_goodbit;
7169 TRACE("(%p %lf)\n", this, val);
7171 if(basic_ostream_wchar_sentry_create(this)) {
7172 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7173 ostreambuf_iterator_wchar dest;
7175 memset(&dest, 0, sizeof(dest));
7176 dest.strbuf = strbuf;
7177 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7179 basic_ostream_wchar_sentry_destroy(this);
7181 basic_ios_wchar_setstate(base, state);
7182 return this;
7185 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
7186 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
7187 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
7188 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
7190 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
7191 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7194 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
7195 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
7196 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
7197 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
7199 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
7200 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7203 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7204 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7205 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7206 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7207 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
7208 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
7210 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7211 IOSB_iostate state = IOSTATE_badbit;
7212 unsigned short c = '\n';
7214 TRACE("(%p %p)\n", this, val);
7216 if(basic_ostream_wchar_sentry_create(this)) {
7217 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
7218 c = basic_streambuf_wchar_snextc(val)) {
7219 state = IOSTATE_goodbit;
7221 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
7222 state = IOSTATE_badbit;
7223 break;
7226 }else {
7227 state = IOSTATE_badbit;
7229 basic_ostream_wchar_sentry_destroy(this);
7231 ios_base_width_set(&base->base, 0);
7232 basic_ios_wchar_setstate(base, state);
7233 return this;
7236 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
7238 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7239 int state = IOSTATE_goodbit;
7241 TRACE("(%p %p)\n", this, val);
7243 if(basic_ostream_wchar_sentry_create(this)) {
7244 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7245 ostreambuf_iterator_wchar dest;
7247 memset(&dest, 0, sizeof(dest));
7248 dest.strbuf = strbuf;
7249 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7251 basic_ostream_wchar_sentry_destroy(this);
7253 basic_ios_wchar_setstate(base, state);
7254 return this;
7257 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
7258 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
7259 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
7260 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
7262 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
7263 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7266 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
7267 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
7268 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
7269 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
7271 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
7272 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7275 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
7277 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7278 int state = IOSTATE_goodbit;
7280 TRACE("(%p)\n", this);
7282 if(basic_ostream_wchar_sentry_create(this)) {
7283 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7284 ostreambuf_iterator_wchar dest;
7286 memset(&dest, 0, sizeof(dest));
7287 dest.strbuf = strbuf;
7288 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7290 basic_ostream_wchar_sentry_destroy(this);
7292 basic_ios_wchar_setstate(base, state);
7293 return this;
7296 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
7297 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
7298 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
7299 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
7301 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
7302 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7305 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
7306 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
7307 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
7308 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
7310 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
7311 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7314 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
7316 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7317 int state = IOSTATE_goodbit;
7319 TRACE("(%p)\n", this);
7321 if(basic_ostream_wchar_sentry_create(this)) {
7322 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7323 ostreambuf_iterator_wchar dest;
7325 memset(&dest, 0, sizeof(dest));
7326 dest.strbuf = strbuf;
7327 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7329 basic_ostream_wchar_sentry_destroy(this);
7331 basic_ios_wchar_setstate(base, state);
7332 return this;
7335 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
7336 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
7337 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
7338 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7340 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
7341 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7344 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
7345 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
7346 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
7347 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7349 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
7350 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7353 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
7355 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7356 int state = IOSTATE_goodbit;
7358 TRACE("(%p %x)\n", this, val);
7360 if(basic_ostream_wchar_sentry_create(this)) {
7361 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7362 ostreambuf_iterator_wchar dest;
7364 memset(&dest, 0, sizeof(dest));
7365 dest.strbuf = strbuf;
7366 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7368 basic_ostream_wchar_sentry_destroy(this);
7370 basic_ios_wchar_setstate(base, state);
7371 return this;
7374 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
7375 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
7376 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
7377 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7379 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
7380 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7383 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
7384 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
7385 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
7386 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7388 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
7389 basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this))->loc));
7392 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7393 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7394 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7395 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7396 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
7398 TRACE("(%p)\n", ostr);
7400 basic_ostream_wchar_put(ostr, 0);
7401 return ostr;
7404 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7405 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7406 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7407 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7408 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
7410 TRACE("(%p)\n", ostr);
7412 basic_ostream_wchar_put(ostr, '\n');
7413 basic_ostream_wchar_flush(ostr);
7414 return ostr;
7417 /* ??$?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 */
7418 /* ??$?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 */
7419 /* ??$?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 */
7420 /* ??$?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 */
7421 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
7423 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7424 IOSB_iostate state = IOSTATE_goodbit;
7426 TRACE("(%p %p)\n", ostr, str);
7428 if(basic_ostream_wchar_sentry_create(ostr)) {
7429 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
7430 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7432 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7433 for(; pad!=0; pad--) {
7434 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7435 state = IOSTATE_badbit;
7436 break;
7441 if(state == IOSTATE_goodbit) {
7442 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7443 state = IOSTATE_badbit;
7446 if(state == IOSTATE_goodbit) {
7447 for(; pad!=0; pad--) {
7448 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7449 state = IOSTATE_badbit;
7450 break;
7455 base->base.wide = 0;
7456 }else {
7457 state = IOSTATE_badbit;
7459 basic_ostream_wchar_sentry_destroy(ostr);
7461 basic_ios_wchar_setstate(base, state);
7462 return ostr;
7465 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
7466 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
7467 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7468 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7469 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
7471 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7472 IOSB_iostate state = IOSTATE_goodbit;
7474 TRACE("(%p %d)\n", ostr, ch);
7476 if(basic_ostream_wchar_sentry_create(ostr)) {
7477 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
7479 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7480 for(; pad!=0; pad--) {
7481 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7482 state = IOSTATE_badbit;
7483 break;
7488 if(state == IOSTATE_goodbit) {
7489 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
7490 state = IOSTATE_badbit;
7493 if(state == IOSTATE_goodbit) {
7494 for(; pad!=0; pad--) {
7495 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7496 state = IOSTATE_badbit;
7497 break;
7502 base->base.wide = 0;
7503 }else {
7504 state = IOSTATE_badbit;
7506 basic_ostream_wchar_sentry_destroy(ostr);
7508 basic_ios_wchar_setstate(base, state);
7509 return ostr;
7512 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
7513 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
7514 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
7515 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
7516 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
7518 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7519 IOSB_iostate state = IOSTATE_goodbit;
7521 TRACE("(%p %s)\n", ostr, debugstr_w(str));
7523 if(basic_ostream_wchar_sentry_create(ostr)) {
7524 MSVCP_size_t len = wcslen(str);
7525 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7527 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7528 for(; pad!=0; pad--) {
7529 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7530 state = IOSTATE_badbit;
7531 break;
7536 if(state == IOSTATE_goodbit) {
7537 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
7538 state = IOSTATE_badbit;
7541 if(state == IOSTATE_goodbit) {
7542 for(; pad!=0; pad--) {
7543 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7544 state = IOSTATE_badbit;
7545 break;
7550 base->base.wide = 0;
7551 }else {
7552 state = IOSTATE_badbit;
7554 basic_ostream_wchar_sentry_destroy(ostr);
7556 basic_ios_wchar_setstate(base, state);
7557 return ostr;
7560 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7561 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7562 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7563 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7564 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
7565 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
7566 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
7568 TRACE("(%p %p)\n", this, pfunc);
7569 pfunc(this);
7570 return this;
7573 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
7574 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
7575 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
7576 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
7577 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
7578 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
7579 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
7581 TRACE("(%p %p)\n", this, pfunc);
7582 pfunc(basic_ostream_wchar_get_basic_ios(this));
7583 return this;
7586 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7587 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7588 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7589 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7590 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
7591 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
7592 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
7594 TRACE("(%p %p)\n", this, pfunc);
7595 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
7596 return this;
7599 /* Caution: basic_istream uses virtual inheritance. */
7600 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
7602 return (basic_ios_char*)((char*)this+this->vbtable[1]);
7605 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
7607 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
7610 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
7612 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
7615 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7616 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7617 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
7618 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)
7620 basic_ios_char *base;
7622 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
7624 if(virt_init) {
7625 this->vbtable = basic_istream_char_vbtable;
7626 base = basic_istream_char_get_basic_ios(this);
7627 basic_ios_char_ctor(base);
7628 }else {
7629 base = basic_istream_char_get_basic_ios(this);
7632 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7633 this->count = 0;
7634 if(!noinit)
7635 basic_ios_char_init(base, strbuf, isstd);
7636 return this;
7639 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7640 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7641 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
7642 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7644 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
7647 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
7648 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
7649 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
7650 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
7652 basic_ios_char *base;
7654 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
7656 if(virt_init) {
7657 this->vbtable = basic_istream_char_vbtable;
7658 base = basic_istream_char_get_basic_ios(this);
7659 basic_ios_char_ctor(base);
7660 }else {
7661 base = basic_istream_char_get_basic_ios(this);
7664 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7665 ios_base_Addstd(&base->base);
7666 return this;
7669 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
7670 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
7671 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
7672 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
7674 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7676 /* don't destroy virtual base here */
7677 TRACE("(%p)\n", this);
7680 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7681 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7682 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
7683 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
7685 TRACE("(%p)\n", this);
7686 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
7687 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
7690 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
7691 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
7693 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7695 TRACE("(%p %x)\n", this, flags);
7697 if(flags & 2) {
7698 /* we have an array, with the number of elements stored before the first object */
7699 INT_PTR i, *ptr = (INT_PTR *)this-1;
7701 for(i=*ptr-1; i>=0; i--)
7702 basic_istream_char_vbase_dtor(this+i);
7703 MSVCRT_operator_delete(ptr);
7704 } else {
7705 basic_istream_char_vbase_dtor(this);
7706 if(flags & 1)
7707 MSVCRT_operator_delete(this);
7710 return this;
7713 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7714 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7715 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
7716 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
7718 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7720 TRACE("(%p %d)\n", this, noskip);
7722 if(ios_base_good(&base->base)) {
7723 if(basic_ios_char_tie_get(base))
7724 basic_ostream_char_flush(basic_ios_char_tie_get(base));
7726 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
7727 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7728 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
7729 int ch;
7731 for(ch = basic_streambuf_char_sgetc(strbuf); ;
7732 ch = basic_streambuf_char_snextc(strbuf)) {
7733 if(ch == EOF) {
7734 basic_ios_char_setstate(base, IOSTATE_eofbit);
7735 break;
7738 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
7739 break;
7744 if(!ios_base_good(&base->base)) {
7745 basic_ios_char_setstate(base, IOSTATE_failbit);
7746 return FALSE;
7749 return TRUE;
7752 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7753 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7754 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
7755 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
7757 return basic_istream_char__Ipfx(this, noskip);
7760 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7761 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7762 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
7763 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
7765 TRACE("(%p)\n", this);
7768 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
7770 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7772 if(basic_ios_char_rdbuf_get(base))
7773 call_basic_streambuf_char__Lock(base->strbuf);
7775 return basic_istream_char_ipfx(istr, noskip);
7778 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
7780 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7782 if(basic_ios_char_rdbuf_get(base))
7783 call_basic_streambuf_char__Unlock(base->strbuf);
7786 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
7787 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
7788 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
7789 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
7790 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
7791 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
7793 TRACE("(%p)\n", this);
7794 return this->count;
7797 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7798 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7799 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
7800 int __thiscall basic_istream_char_get(basic_istream_char *this)
7802 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7803 int ret;
7805 TRACE("(%p)\n", this);
7807 this->count = 0;
7809 if(!basic_istream_char_sentry_create(this, TRUE)) {
7810 basic_istream_char_sentry_destroy(this);
7811 return EOF;
7814 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
7815 basic_istream_char_sentry_destroy(this);
7816 if(ret == EOF)
7817 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
7818 else
7819 this->count++;
7821 return ret;
7824 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
7825 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
7826 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
7827 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
7829 int ret;
7831 TRACE("(%p %p)\n", this, ch);
7833 ret = basic_istream_char_get(this);
7834 if(ret != EOF)
7835 *ch = (char)ret;
7836 return this;
7839 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7840 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7841 #if STREAMSIZE_BITS == 64
7842 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
7843 #else
7844 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
7845 #endif
7846 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7848 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7849 int ch = delim;
7851 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
7853 this->count = 0;
7855 if(basic_istream_char_sentry_create(this, TRUE)) {
7856 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7858 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
7859 ch = basic_streambuf_char_snextc(strbuf)) {
7860 if(ch==EOF || ch==delim)
7861 break;
7863 *str++ = ch;
7864 this->count++;
7865 count--;
7868 basic_istream_char_sentry_destroy(this);
7870 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7871 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7872 if(count > 0)
7873 *str = 0;
7874 return this;
7877 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7878 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7879 #if STREAMSIZE_BITS == 64
7880 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
7881 #else
7882 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
7883 #endif
7884 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
7886 return basic_istream_char_get_str_delim(this, str, count, '\n');
7889 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7890 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7891 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
7892 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
7894 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7895 int ch = delim;
7897 TRACE("(%p %p %c)\n", this, strbuf, delim);
7899 this->count = 0;
7901 if(basic_istream_char_sentry_create(this, TRUE)) {
7902 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
7904 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
7905 ch = basic_streambuf_char_snextc(strbuf_read)) {
7906 if(ch==EOF || ch==delim)
7907 break;
7909 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
7910 break;
7911 this->count++;
7914 basic_istream_char_sentry_destroy(this);
7916 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7917 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7918 return this;
7921 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7922 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
7923 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
7924 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
7926 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
7929 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7930 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7931 #if STREAMSIZE_BITS == 64
7932 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
7933 #else
7934 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
7935 #endif
7936 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7938 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7939 int ch = (unsigned char)delim;
7941 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
7943 this->count = 0;
7945 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
7946 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7948 while(count > 1) {
7949 ch = basic_streambuf_char_sbumpc(strbuf);
7951 if(ch==EOF || ch==(unsigned char)delim)
7952 break;
7954 *str++ = ch;
7955 this->count++;
7956 count--;
7959 if(ch == (unsigned char)delim)
7960 this->count++;
7961 else if(ch != EOF) {
7962 ch = basic_streambuf_char_sgetc(strbuf);
7964 if(ch == (unsigned char)delim) {
7965 basic_streambuf_char__Gninc(strbuf);
7966 this->count++;
7970 basic_istream_char_sentry_destroy(this);
7972 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
7973 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
7974 if(count > 0)
7975 *str = 0;
7976 return this;
7979 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7980 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7981 #if STREAMSIZE_BITS == 64
7982 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
7983 #else
7984 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
7985 #endif
7986 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
7988 return basic_istream_char_getline_delim(this, str, count, '\n');
7991 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
7992 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
7993 #if STREAMSIZE_BITS == 64
7994 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
7995 #else
7996 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
7997 #endif
7998 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
8000 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8001 int ch = (unsigned char)delim;
8002 unsigned int state;
8004 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8006 this->count = 0;
8008 if(basic_istream_char_sentry_create(this, TRUE)) {
8009 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8010 state = IOSTATE_goodbit;
8012 while(count > 0) {
8013 ch = basic_streambuf_char_sbumpc(strbuf);
8015 if(ch==EOF) {
8016 state = IOSTATE_eofbit;
8017 break;
8020 if(ch==(unsigned char)delim)
8021 break;
8023 this->count++;
8024 if(count != INT_MAX)
8025 count--;
8027 }else
8028 state = IOSTATE_failbit;
8029 basic_istream_char_sentry_destroy(this);
8031 basic_ios_char_setstate(base, state);
8032 return this;
8035 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
8036 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
8037 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
8039 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8040 int ch = '\n';
8042 TRACE("(%p)\n", istream);
8044 if(basic_istream_char_sentry_create(istream, TRUE)) {
8045 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8046 const ctype_char *ctype = ctype_char_use_facet(strbuf->loc);
8048 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
8049 ch = basic_streambuf_char_snextc(strbuf)) {
8050 if(ch == EOF)
8051 break;
8054 basic_istream_char_sentry_destroy(istream);
8056 if(ch == EOF)
8057 basic_ios_char_setstate(base, IOSTATE_eofbit);
8058 return istream;
8061 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8062 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8063 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
8064 int __thiscall basic_istream_char_peek(basic_istream_char *this)
8066 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8067 int ret = EOF;
8069 TRACE("(%p)\n", this);
8071 this->count = 0;
8073 if(basic_istream_char_sentry_create(this, TRUE))
8074 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8075 basic_istream_char_sentry_destroy(this);
8077 if (ret == EOF)
8078 basic_ios_char_setstate(base, IOSTATE_eofbit);
8080 return ret;
8083 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
8084 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
8085 #if STREAMSIZE_BITS == 64
8086 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
8087 #else
8088 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
8089 #endif
8090 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8092 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8093 IOSB_iostate state = IOSTATE_goodbit;
8095 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8097 if(basic_istream_char_sentry_create(this, TRUE)) {
8098 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8100 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
8101 if(this->count != count)
8102 state |= IOSTATE_failbit | IOSTATE_eofbit;
8103 }else {
8104 this->count = 0;
8106 basic_istream_char_sentry_destroy(this);
8108 basic_ios_char_setstate(base, state);
8109 return this;
8112 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8113 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8114 #if STREAMSIZE_BITS == 64
8115 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
8116 #else
8117 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
8118 #endif
8119 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
8121 return basic_istream_char__Read_s(this, str, -1, count);
8124 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
8125 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
8126 #if STREAMSIZE_BITS == 64
8127 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
8128 #else
8129 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
8130 #endif
8131 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8133 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8134 IOSB_iostate state = IOSTATE_goodbit;
8136 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8138 this->count = 0;
8140 if(basic_istream_char_sentry_create(this, TRUE)) {
8141 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
8142 if(avail > count)
8143 avail = count;
8145 if(avail == -1)
8146 state |= IOSTATE_eofbit;
8147 else if(avail > 0)
8148 basic_istream_char__Read_s(this, str, size, avail);
8149 }else {
8150 state |= IOSTATE_failbit;
8152 basic_istream_char_sentry_destroy(this);
8154 basic_ios_char_setstate(base, state);
8155 return this->count;
8158 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
8159 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
8160 #if STREAMSIZE_BITS == 64
8161 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
8162 #else
8163 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
8164 #endif
8165 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
8167 return basic_istream_char__Readsome_s(this, str, count, count);
8170 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
8171 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
8172 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
8173 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
8175 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8176 IOSB_iostate state = IOSTATE_goodbit;
8178 TRACE("(%p %c)\n", this, ch);
8180 this->count = 0;
8182 if(basic_istream_char_sentry_create(this, TRUE)) {
8183 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8185 if(!ios_base_good(&base->base))
8186 state |= IOSTATE_failbit;
8187 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
8188 state |= IOSTATE_badbit;
8190 basic_istream_char_sentry_destroy(this);
8192 basic_ios_char_setstate(base, state);
8193 return this;
8196 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
8197 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
8198 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
8199 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
8201 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8202 IOSB_iostate state = IOSTATE_goodbit;
8204 TRACE("(%p)\n", this);
8206 this->count = 0;
8208 if(basic_istream_char_sentry_create(this, TRUE)) {
8209 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8211 if(!ios_base_good(&base->base))
8212 state |= IOSTATE_failbit;
8213 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
8214 state |= IOSTATE_badbit;
8216 basic_istream_char_sentry_destroy(this);
8218 basic_ios_char_setstate(base, state);
8219 return this;
8222 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8223 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8224 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
8225 int __thiscall basic_istream_char_sync(basic_istream_char *this)
8227 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8228 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8230 TRACE("(%p)\n", this);
8232 if(!strbuf)
8233 return -1;
8235 if(basic_istream_char_sentry_create(this, TRUE)) {
8236 if(basic_streambuf_char_pubsync(strbuf) != -1) {
8237 basic_istream_char_sentry_destroy(this);
8238 return 0;
8241 basic_istream_char_sentry_destroy(this);
8243 basic_ios_char_setstate(base, IOSTATE_badbit);
8244 return -1;
8247 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8248 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8249 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
8250 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
8252 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8254 TRACE("(%p %p)\n", this, ret);
8256 if(ios_base_fail(&base->base)) {
8257 ret->off = -1;
8258 ret->pos = 0;
8259 ret->state = 0;
8260 return ret;
8263 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8264 ret, 0, SEEKDIR_cur, OPENMODE_in);
8266 if(ret->off==-1 && ret->pos==0 && ret->state==0)
8267 basic_ios_char_setstate(base, IOSTATE_failbit);
8269 return ret;
8272 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
8273 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8274 #if STREAMOFF_BITS == 64
8275 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
8276 #else
8277 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
8278 #endif
8279 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
8281 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8283 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8285 if(!ios_base_fail(&base->base)) {
8286 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8287 fpos_int ret;
8289 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8291 if(ret.off==-1 && ret.pos==0 && ret.state==0)
8292 basic_ios_char_setstate(base, IOSTATE_failbit);
8293 else
8294 basic_ios_char_clear(base, IOSTATE_goodbit);
8295 return this;
8296 }else
8297 basic_ios_char_clear(base, IOSTATE_goodbit);
8299 return this;
8302 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8303 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8304 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
8305 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
8307 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8309 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
8311 if(!ios_base_fail(&base->base)) {
8312 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8313 fpos_int ret;
8315 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8317 if(ret.off==-1 && ret.pos==0 && ret.state==0)
8318 basic_ios_char_setstate(base, IOSTATE_failbit);
8319 else
8320 basic_ios_char_clear(base, IOSTATE_goodbit);
8321 return this;
8322 }else
8323 basic_ios_char_clear(base, IOSTATE_goodbit);
8325 return this;
8328 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
8329 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
8330 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
8331 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
8333 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8334 int state = IOSTATE_goodbit;
8336 TRACE("(%p %p)\n", this, v);
8338 if(basic_istream_char_sentry_create(this, FALSE)) {
8339 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8340 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8341 istreambuf_iterator_char first={0}, last={0};
8342 LONG tmp;
8344 first.strbuf = strbuf;
8345 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8347 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8348 *v = tmp;
8349 else
8350 state |= IOSTATE_failbit;
8352 basic_istream_char_sentry_destroy(this);
8354 basic_ios_char_setstate(base, state);
8355 return this;
8358 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
8359 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
8360 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
8361 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *v)
8363 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8364 int state = IOSTATE_goodbit;
8366 TRACE("(%p %p)\n", this, v);
8368 if(basic_istream_char_sentry_create(this, FALSE)) {
8369 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8370 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8371 istreambuf_iterator_char first={0}, last={0};
8373 first.strbuf = strbuf;
8374 num_get_char_get_ushort(numget, &last, first, last, &base->base, &state, v);
8376 basic_istream_char_sentry_destroy(this);
8378 basic_ios_char_setstate(base, state);
8379 return this;
8382 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
8383 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
8384 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
8385 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *v)
8387 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8388 int state = IOSTATE_goodbit;
8390 TRACE("(%p %p)\n", this, v);
8392 if(basic_istream_char_sentry_create(this, FALSE)) {
8393 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8394 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8395 istreambuf_iterator_char first={0}, last={0};
8397 first.strbuf = strbuf;
8398 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8400 basic_istream_char_sentry_destroy(this);
8402 basic_ios_char_setstate(base, state);
8403 return this;
8406 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
8407 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
8408 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
8409 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *v)
8411 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8412 int state = IOSTATE_goodbit;
8414 TRACE("(%p %p)\n", this, v);
8416 if(basic_istream_char_sentry_create(this, FALSE)) {
8417 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8418 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8419 istreambuf_iterator_char first={0}, last={0};
8421 first.strbuf = strbuf;
8422 num_get_char_get_uint(numget, &last, first, last, &base->base, &state, v);
8424 basic_istream_char_sentry_destroy(this);
8426 basic_ios_char_setstate(base, state);
8427 return this;
8430 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
8431 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
8432 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
8433 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *v)
8435 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8436 int state = IOSTATE_goodbit;
8438 TRACE("(%p %p)\n", this, v);
8440 if(basic_istream_char_sentry_create(this, FALSE)) {
8441 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8442 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8443 istreambuf_iterator_char first={0}, last={0};
8445 first.strbuf = strbuf;
8446 num_get_char_get_long(numget, &last, first, last, &base->base, &state, v);
8448 basic_istream_char_sentry_destroy(this);
8450 basic_ios_char_setstate(base, state);
8451 return this;
8454 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
8455 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
8456 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
8457 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *v)
8459 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8460 int state = IOSTATE_goodbit;
8462 TRACE("(%p %p)\n", this, v);
8464 if(basic_istream_char_sentry_create(this, FALSE)) {
8465 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8466 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8467 istreambuf_iterator_char first={0}, last={0};
8469 first.strbuf = strbuf;
8470 num_get_char_get_ulong(numget, &last, first, last, &base->base, &state, v);
8472 basic_istream_char_sentry_destroy(this);
8474 basic_ios_char_setstate(base, state);
8475 return this;
8478 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
8479 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
8480 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
8481 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *v)
8483 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8484 int state = IOSTATE_goodbit;
8486 TRACE("(%p %p)\n", this, v);
8488 if(basic_istream_char_sentry_create(this, FALSE)) {
8489 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8490 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8491 istreambuf_iterator_char first={0}, last={0};
8493 first.strbuf = strbuf;
8494 num_get_char_get_float(numget, &last, first, last, &base->base, &state, v);
8496 basic_istream_char_sentry_destroy(this);
8498 basic_ios_char_setstate(base, state);
8499 return this;
8502 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
8503 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
8504 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
8505 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *v)
8507 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8508 int state = IOSTATE_goodbit;
8510 TRACE("(%p %p)\n", this, v);
8512 if(basic_istream_char_sentry_create(this, FALSE)) {
8513 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8514 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8515 istreambuf_iterator_char first={0}, last={0};
8517 first.strbuf = strbuf;
8518 num_get_char_get_double(numget, &last, first, last, &base->base, &state, v);
8520 basic_istream_char_sentry_destroy(this);
8522 basic_ios_char_setstate(base, state);
8523 return this;
8526 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
8527 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
8528 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
8529 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *v)
8531 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8532 int state = IOSTATE_goodbit;
8534 TRACE("(%p %p)\n", this, v);
8536 if(basic_istream_char_sentry_create(this, FALSE)) {
8537 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8538 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8539 istreambuf_iterator_char first={0}, last={0};
8541 first.strbuf = strbuf;
8542 num_get_char_get_ldouble(numget, &last, first, last, &base->base, &state, v);
8544 basic_istream_char_sentry_destroy(this);
8546 basic_ios_char_setstate(base, state);
8547 return this;
8550 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
8551 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
8552 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
8553 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **v)
8555 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8556 int state = IOSTATE_goodbit;
8558 TRACE("(%p %p)\n", this, v);
8560 if(basic_istream_char_sentry_create(this, FALSE)) {
8561 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8562 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8563 istreambuf_iterator_char first={0}, last={0};
8565 first.strbuf = strbuf;
8566 num_get_char_get_void(numget, &last, first, last, &base->base, &state, v);
8568 basic_istream_char_sentry_destroy(this);
8570 basic_ios_char_setstate(base, state);
8571 return this;
8574 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
8575 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
8576 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
8577 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
8579 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8580 int state = IOSTATE_goodbit;
8582 TRACE("(%p %p)\n", this, v);
8584 if(basic_istream_char_sentry_create(this, FALSE)) {
8585 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8586 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8587 istreambuf_iterator_char first={0}, last={0};
8589 first.strbuf = strbuf;
8590 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
8592 basic_istream_char_sentry_destroy(this);
8594 basic_ios_char_setstate(base, state);
8595 return this;
8598 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
8599 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
8600 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
8601 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
8603 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8604 int state = IOSTATE_goodbit;
8606 TRACE("(%p %p)\n", this, v);
8608 if(basic_istream_char_sentry_create(this, FALSE)) {
8609 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8610 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8611 istreambuf_iterator_char first={0}, last={0};
8613 first.strbuf = strbuf;
8614 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
8616 basic_istream_char_sentry_destroy(this);
8618 basic_ios_char_setstate(base, state);
8619 return this;
8622 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
8623 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
8624 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
8625 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
8627 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8628 int state = IOSTATE_goodbit;
8630 TRACE("(%p %p)\n", this, v);
8632 if(basic_istream_char_sentry_create(this, FALSE)) {
8633 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8634 const num_get *numget = num_get_char_use_facet(strbuf->loc);
8635 istreambuf_iterator_char first={0}, last={0};
8637 first.strbuf = strbuf;
8638 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
8640 basic_istream_char_sentry_destroy(this);
8642 basic_ios_char_setstate(base, state);
8643 return this;
8646 /* ??$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 */
8647 /* ??$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 */
8648 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
8649 basic_istream_char *istream, basic_string_char *str, char delim)
8651 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8652 IOSB_iostate state = IOSTATE_goodbit;
8653 int c = (unsigned char)delim;
8655 TRACE("(%p %p %c)\n", istream, str, delim);
8657 if(basic_istream_char_sentry_create(istream, TRUE)) {
8658 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8659 MSVCP_basic_string_char_clear(str);
8661 c = basic_streambuf_char_sgetc(strbuf);
8662 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
8663 MSVCP_basic_string_char_append_ch(str, c);
8664 if(c==EOF) state |= IOSTATE_eofbit;
8665 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
8667 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
8669 basic_istream_char_sentry_destroy(istream);
8671 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
8672 return istream;
8675 /* ??$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 */
8676 /* ??$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 */
8677 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
8678 basic_istream_char *istream, basic_string_char *str)
8680 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
8683 /* ??$?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 */
8684 /* ??$?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 */
8685 basic_istream_char* __cdecl basic_istream_char_read_bstr(
8686 basic_istream_char *istream, basic_string_char *str)
8688 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8689 IOSB_iostate state = IOSTATE_failbit;
8690 int c = '\n';
8692 TRACE("(%p %p)\n", istream, str);
8694 if(basic_istream_char_sentry_create(istream, FALSE)) {
8695 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
8696 MSVCP_size_t count = ios_base_width_get(&base->base);
8698 if(!count)
8699 count = -1;
8701 MSVCP_basic_string_char_clear(str);
8703 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8704 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8705 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8706 state = IOSTATE_goodbit;
8707 MSVCP_basic_string_char_append_ch(str, c);
8710 basic_istream_char_sentry_destroy(istream);
8712 ios_base_width_set(&base->base, 0);
8713 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8714 return istream;
8717 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
8718 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
8719 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
8720 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
8721 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
8722 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
8723 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
8725 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8726 IOSB_iostate state = IOSTATE_failbit;
8727 int c = '\n';
8729 TRACE("(%p %p)\n", istream, str);
8731 if(basic_istream_char_sentry_create(istream, FALSE)) {
8732 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
8733 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
8735 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8736 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8737 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8738 state = IOSTATE_goodbit;
8739 *str++ = c;
8742 basic_istream_char_sentry_destroy(istream);
8744 *str = 0;
8745 ios_base_width_set(&base->base, 0);
8746 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8747 return istream;
8750 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
8751 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
8752 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
8753 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
8754 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
8755 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
8756 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
8758 IOSB_iostate state = IOSTATE_failbit;
8759 int c = 0;
8761 TRACE("(%p %p)\n", istream, ch);
8763 if(basic_istream_char_sentry_create(istream, FALSE)) {
8764 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
8765 basic_istream_char_get_basic_ios(istream)));
8766 if(c != EOF) {
8767 state = IOSTATE_goodbit;
8768 *ch = c;
8771 basic_istream_char_sentry_destroy(istream);
8773 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
8774 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8775 return istream;
8778 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8779 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8780 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
8781 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
8782 basic_istream_char *this, basic_streambuf_char *streambuf)
8784 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8785 IOSB_iostate state = IOSTATE_failbit;
8786 int c = '\n';
8788 TRACE("(%p %p)\n", this, streambuf);
8790 if(basic_istream_char_sentry_create(this, FALSE)) {
8791 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
8792 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
8793 state = IOSTATE_goodbit;
8794 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
8795 break;
8798 basic_istream_char_sentry_destroy(this);
8800 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8801 return this;
8804 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8805 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8806 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
8807 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
8808 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
8810 TRACE("(%p %p)\n", this, pfunc);
8811 pfunc(this);
8812 return this;
8815 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
8816 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
8817 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
8818 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
8819 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
8821 TRACE("(%p %p)\n", this, pfunc);
8822 pfunc(basic_istream_char_get_basic_ios(this));
8823 return this;
8826 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8827 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8828 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
8829 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
8830 ios_base* (__cdecl *pfunc)(ios_base*))
8832 TRACE("(%p %p)\n", this, pfunc);
8833 pfunc(&basic_istream_char_get_basic_ios(this)->base);
8834 return this;
8837 /* Caution: basic_istream uses virtual inheritance. */
8838 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
8840 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
8843 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
8845 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
8848 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
8850 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
8853 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
8854 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
8855 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
8856 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
8857 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
8859 basic_ios_wchar *base;
8861 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
8863 if(virt_init) {
8864 this->vbtable = basic_istream_wchar_vbtable;
8865 base = basic_istream_wchar_get_basic_ios(this);
8866 basic_ios_wchar_ctor(base);
8867 }else {
8868 base = basic_istream_wchar_get_basic_ios(this);
8871 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
8872 this->count = 0;
8873 if(!noinit)
8874 basic_ios_wchar_init(base, strbuf, isstd);
8875 return this;
8878 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
8879 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
8880 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
8881 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
8882 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
8884 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
8885 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8886 return this;
8889 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8890 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
8891 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
8892 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
8893 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8895 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8898 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8899 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
8900 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
8901 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
8902 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
8904 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
8907 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8908 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8909 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
8910 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
8911 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8913 basic_ios_wchar *base;
8915 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
8917 if(virt_init) {
8918 this->vbtable = basic_istream_wchar_vbtable;
8919 base = basic_istream_wchar_get_basic_ios(this);
8920 basic_ios_wchar_ctor(base);
8921 }else {
8922 base = basic_istream_wchar_get_basic_ios(this);
8925 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
8926 ios_base_Addstd(&base->base);
8927 return this;
8930 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
8931 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
8932 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
8933 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
8934 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
8936 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
8937 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
8938 return this;
8941 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
8942 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
8943 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
8944 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
8945 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
8946 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
8948 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8950 /* don't destroy virtual base here */
8951 TRACE("(%p)\n", this);
8954 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
8955 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
8956 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
8957 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
8958 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
8959 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
8961 TRACE("(%p)\n", this);
8962 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
8963 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
8966 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
8967 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
8969 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
8971 TRACE("(%p %x)\n", this, flags);
8973 if(flags & 2) {
8974 /* we have an array, with the number of elements stored before the first object */
8975 INT_PTR i, *ptr = (INT_PTR *)this-1;
8977 for(i=*ptr-1; i>=0; i--)
8978 basic_istream_wchar_vbase_dtor(this+i);
8979 MSVCRT_operator_delete(ptr);
8980 } else {
8981 basic_istream_wchar_vbase_dtor(this);
8982 if(flags & 1)
8983 MSVCRT_operator_delete(this);
8986 return this;
8989 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
8990 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
8991 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
8992 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
8993 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
8994 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
8996 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
8998 TRACE("(%p %d)\n", this, noskip);
9000 if(ios_base_good(&base->base)) {
9001 if(basic_ios_wchar_tie_get(base))
9002 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
9004 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
9005 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9006 const ctype_wchar *ctype = ctype_wchar_use_facet(base->strbuf->loc);
9007 int ch;
9009 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
9010 ch = basic_streambuf_wchar_snextc(strbuf)) {
9011 if(ch == WEOF) {
9012 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9013 break;
9016 if(!ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
9017 break;
9022 if(!ios_base_good(&base->base)) {
9023 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9024 return FALSE;
9026 return TRUE;
9029 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9030 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9031 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9032 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9033 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
9034 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9036 return basic_istream_wchar__Ipfx(this, noskip);
9039 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9040 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9041 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9042 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9043 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
9044 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
9046 TRACE("(%p)\n", this);
9049 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
9051 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9053 if(basic_ios_wchar_rdbuf_get(base))
9054 basic_streambuf_wchar__Lock(base->strbuf);
9056 return basic_istream_wchar_ipfx(istr, noskip);
9059 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
9061 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9063 if(basic_ios_wchar_rdbuf_get(base))
9064 basic_streambuf_wchar__Unlock(base->strbuf);
9067 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
9068 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
9069 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
9070 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
9071 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
9072 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
9073 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
9074 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
9075 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
9076 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
9078 TRACE("(%p)\n", this);
9079 return this->count;
9082 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9083 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9084 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9085 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9086 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
9087 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
9089 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9090 int ret;
9092 TRACE("(%p)\n", this);
9094 this->count = 0;
9096 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
9097 basic_istream_wchar_sentry_destroy(this);
9098 return WEOF;
9101 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
9102 basic_istream_wchar_sentry_destroy(this);
9103 if(ret == WEOF)
9104 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
9105 else
9106 this->count++;
9108 return ret;
9111 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
9112 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
9113 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
9114 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
9115 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
9116 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
9118 unsigned short ret;
9120 TRACE("(%p %p)\n", this, ch);
9122 ret = basic_istream_wchar_get(this);
9123 if(ret != WEOF)
9124 *ch = (wchar_t)ret;
9125 return this;
9128 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9129 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9130 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9131 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9132 #if STREAMSIZE_BITS == 64
9133 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
9134 #else
9135 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
9136 #endif
9137 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9139 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9140 unsigned short ch = delim;
9142 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
9144 this->count = 0;
9146 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9147 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9149 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
9150 ch = basic_streambuf_wchar_snextc(strbuf)) {
9151 if(ch==WEOF || ch==delim)
9152 break;
9154 *str++ = ch;
9155 this->count++;
9156 count--;
9159 basic_istream_wchar_sentry_destroy(this);
9161 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9162 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9163 if(count > 0)
9164 *str = 0;
9165 return this;
9168 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9169 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9170 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9171 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9172 #if STREAMSIZE_BITS == 64
9173 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
9174 #else
9175 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
9176 #endif
9177 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
9179 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
9182 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9183 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9184 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9185 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9186 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
9187 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
9189 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9190 unsigned short ch = delim;
9192 TRACE("(%p %p %c)\n", this, strbuf, delim);
9194 this->count = 0;
9196 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9197 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
9199 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
9200 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
9201 if(ch==WEOF || ch==delim)
9202 break;
9204 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
9205 break;
9206 this->count++;
9209 basic_istream_wchar_sentry_destroy(this);
9211 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9212 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9213 return this;
9216 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9217 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9218 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9219 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9220 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
9221 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
9223 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
9226 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9227 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9228 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9229 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9230 #if STREAMSIZE_BITS == 64
9231 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
9232 #else
9233 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
9234 #endif
9235 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9237 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9238 unsigned short ch = delim;
9240 TRACE("(%p %p %s %c)\n", this, str, wine_dbgstr_longlong(count), delim);
9242 this->count = 0;
9244 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
9245 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9247 while(count > 1) {
9248 ch = basic_streambuf_wchar_sbumpc(strbuf);
9250 if(ch==WEOF || ch==delim)
9251 break;
9253 *str++ = ch;
9254 this->count++;
9255 count--;
9258 if(ch == delim)
9259 this->count++;
9260 else if(ch != WEOF) {
9261 ch = basic_streambuf_wchar_sgetc(strbuf);
9263 if(ch == delim) {
9264 basic_streambuf_wchar__Gninc(strbuf);
9265 this->count++;
9269 basic_istream_wchar_sentry_destroy(this);
9271 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
9272 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
9273 if(count > 0)
9274 *str = 0;
9275 return this;
9278 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9279 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9280 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9281 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9282 #if STREAMSIZE_BITS == 64
9283 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
9284 #else
9285 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
9286 #endif
9287 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
9289 return basic_istream_wchar_getline_delim(this, str, count, '\n');
9292 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
9293 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
9294 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
9295 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
9296 #if STREAMSIZE_BITS == 64
9297 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
9298 #else
9299 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
9300 #endif
9301 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
9303 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9304 unsigned short ch = delim;
9305 unsigned int state;
9307 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
9309 this->count = 0;
9311 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9312 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9313 state = IOSTATE_goodbit;
9315 while(count > 0) {
9316 ch = basic_streambuf_wchar_sbumpc(strbuf);
9318 if(ch==WEOF) {
9319 state = IOSTATE_eofbit;
9320 break;
9323 if(ch==delim)
9324 break;
9326 this->count++;
9327 if(count != INT_MAX)
9328 count--;
9330 }else
9331 state = IOSTATE_failbit;
9332 basic_istream_wchar_sentry_destroy(this);
9334 basic_ios_wchar_setstate(base, state);
9335 return this;
9338 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
9339 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
9340 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
9341 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
9342 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
9344 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9345 unsigned short ch = '\n';
9347 TRACE("(%p)\n", istream);
9349 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
9350 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9351 const ctype_wchar *ctype = ctype_wchar_use_facet(strbuf->loc);
9353 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
9354 ch = basic_streambuf_wchar_snextc(strbuf)) {
9355 if(ch == WEOF)
9356 break;
9359 basic_istream_wchar_sentry_destroy(istream);
9361 if(ch == WEOF)
9362 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9363 return istream;
9366 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9367 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9368 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9369 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9370 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
9371 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
9373 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9374 unsigned short ret = WEOF;
9376 TRACE("(%p)\n", this);
9378 this->count = 0;
9380 if(basic_istream_wchar_sentry_create(this, TRUE))
9381 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9382 basic_istream_wchar_sentry_destroy(this);
9384 if (ret == WEOF)
9385 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9387 return ret;
9390 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
9391 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
9392 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
9393 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
9394 #if STREAMSIZE_BITS == 64
9395 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
9396 #else
9397 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
9398 #endif
9399 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
9401 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9402 IOSB_iostate state = IOSTATE_goodbit;
9404 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9406 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9407 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9409 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
9410 if(this->count != count)
9411 state |= IOSTATE_failbit | IOSTATE_eofbit;
9412 }else {
9413 this->count = 0;
9415 basic_istream_wchar_sentry_destroy(this);
9417 basic_ios_wchar_setstate(base, state);
9418 return this;
9421 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9422 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9423 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9424 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9425 #if STREAMSIZE_BITS == 64
9426 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
9427 #else
9428 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
9429 #endif
9430 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
9432 return basic_istream_wchar__Read_s(this, str, -1, count);
9435 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
9436 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
9437 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
9438 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
9439 #if STREAMSIZE_BITS == 64
9440 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
9441 #else
9442 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
9443 #endif
9444 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
9446 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9447 IOSB_iostate state = IOSTATE_goodbit;
9449 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9451 this->count = 0;
9453 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9454 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
9455 if(avail > count)
9456 avail = count;
9458 if(avail == -1)
9459 state |= IOSTATE_eofbit;
9460 else if(avail > 0)
9461 basic_istream_wchar__Read_s(this, str, size, avail);
9462 }else {
9463 state |= IOSTATE_failbit;
9465 basic_istream_wchar_sentry_destroy(this);
9467 basic_ios_wchar_setstate(base, state);
9468 return this->count;
9471 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
9472 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
9473 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
9474 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
9475 #if STREAMSIZE_BITS == 64
9476 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
9477 #else
9478 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
9479 #endif
9480 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
9482 return basic_istream_wchar__Readsome_s(this, str, count, count);
9485 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
9486 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
9487 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
9488 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
9489 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
9490 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
9492 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9493 IOSB_iostate state = IOSTATE_goodbit;
9495 TRACE("(%p %c)\n", this, ch);
9497 this->count = 0;
9499 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9500 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9502 if(!ios_base_good(&base->base))
9503 state |= IOSTATE_failbit;
9504 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
9505 state |= IOSTATE_badbit;
9507 basic_istream_wchar_sentry_destroy(this);
9509 basic_ios_wchar_setstate(base, state);
9510 return this;
9513 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
9514 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
9515 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
9516 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
9517 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
9518 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
9520 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9521 IOSB_iostate state = IOSTATE_goodbit;
9523 TRACE("(%p)\n", this);
9525 this->count = 0;
9527 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9528 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9530 if(!ios_base_good(&base->base))
9531 state |= IOSTATE_failbit;
9532 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
9533 state |= IOSTATE_badbit;
9535 basic_istream_wchar_sentry_destroy(this);
9537 basic_ios_wchar_setstate(base, state);
9538 return this;
9541 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
9542 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
9543 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
9544 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
9545 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
9546 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
9548 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9549 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9551 TRACE("(%p)\n", this);
9553 if(!strbuf)
9554 return -1;
9556 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9557 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
9558 basic_istream_wchar_sentry_destroy(this);
9559 return 0;
9562 basic_istream_wchar_sentry_destroy(this);
9564 basic_ios_wchar_setstate(base, IOSTATE_badbit);
9565 return -1;
9568 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9569 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9570 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9571 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9572 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
9573 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
9575 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9577 TRACE("(%p %p)\n", this, ret);
9579 if(ios_base_fail(&base->base)) {
9580 ret->off = -1;
9581 ret->pos = 0;
9582 ret->state = 0;
9583 return ret;
9586 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
9587 ret, 0, SEEKDIR_cur, OPENMODE_in);
9588 if(ret->off==-1 && ret->pos==0 && ret->state==0)
9589 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9591 return ret;
9594 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
9595 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
9596 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
9597 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
9598 #if STREAMOFF_BITS == 64
9599 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
9600 #else
9601 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
9602 #endif
9603 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
9605 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9607 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
9609 if(!ios_base_fail(&base->base)) {
9610 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9611 fpos_int ret;
9613 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
9615 if(ret.off==-1 && ret.pos==0 && ret.state==0)
9616 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9617 else
9618 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9619 return this;
9620 }else
9621 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9623 return this;
9626 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9627 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9628 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9629 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9630 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
9631 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
9633 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9635 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
9637 if(!ios_base_fail(&base->base)) {
9638 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9639 fpos_int ret;
9641 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
9643 if(ret.off==-1 && ret.pos==0 && ret.state==0)
9644 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9645 else
9646 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9647 return this;
9648 }else
9649 basic_ios_wchar_clear(base, IOSTATE_goodbit);
9651 return this;
9654 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
9656 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9657 int state = IOSTATE_goodbit;
9659 TRACE("(%p %p)\n", this, v);
9661 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9662 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9663 istreambuf_iterator_wchar first={0}, last={0};
9664 LONG tmp;
9666 first.strbuf = strbuf;
9667 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
9669 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
9670 *v = tmp;
9671 else
9672 state |= IOSTATE_failbit;
9674 basic_istream_wchar_sentry_destroy(this);
9676 basic_ios_wchar_setstate(base, state);
9677 return this;
9680 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
9681 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
9682 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
9683 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
9685 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
9686 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9689 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
9690 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
9691 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
9692 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
9694 return basic_istream_read_short(this, v, num_get_short_use_facet(
9695 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9698 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
9699 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
9700 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
9701 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
9703 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9704 int state = IOSTATE_goodbit;
9706 TRACE("(%p %p)\n", this, v);
9708 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9709 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9710 const num_get *numget = num_get_wchar_use_facet(strbuf->loc);
9711 istreambuf_iterator_wchar first={0}, last={0};
9713 first.strbuf = strbuf;
9714 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
9716 basic_istream_wchar_sentry_destroy(this);
9718 basic_ios_wchar_setstate(base, state);
9719 return this;
9722 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
9724 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9725 int state = IOSTATE_goodbit;
9727 TRACE("(%p %p)\n", this, v);
9729 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9730 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9731 istreambuf_iterator_wchar first={0}, last={0};
9733 first.strbuf = strbuf;
9734 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9736 basic_istream_wchar_sentry_destroy(this);
9738 basic_ios_wchar_setstate(base, state);
9739 return this;
9742 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAH@Z */
9743 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
9744 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
9745 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
9747 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
9748 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9751 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
9752 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
9753 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
9754 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
9756 return basic_istream_read_int(this, v, num_get_short_use_facet(
9757 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9760 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
9762 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9763 int state = IOSTATE_goodbit;
9765 TRACE("(%p %p)\n", this, v);
9767 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9768 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9769 istreambuf_iterator_wchar first={0}, last={0};
9771 first.strbuf = strbuf;
9772 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
9774 basic_istream_wchar_sentry_destroy(this);
9776 basic_ios_wchar_setstate(base, state);
9777 return this;
9780 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
9781 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
9782 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
9783 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
9785 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
9786 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9789 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
9790 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
9791 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
9792 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
9794 return basic_istream_read_uint(this, v, num_get_short_use_facet(
9795 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9798 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
9800 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9801 int state = IOSTATE_goodbit;
9803 TRACE("(%p %p)\n", this, v);
9805 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9806 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9807 istreambuf_iterator_wchar first={0}, last={0};
9809 first.strbuf = strbuf;
9810 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9812 basic_istream_wchar_sentry_destroy(this);
9814 basic_ios_wchar_setstate(base, state);
9815 return this;
9818 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
9819 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
9820 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
9821 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
9823 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
9824 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9827 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
9828 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
9829 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
9830 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
9832 return basic_istream_read_long(this, v, num_get_short_use_facet(
9833 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9836 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
9838 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9839 int state = IOSTATE_goodbit;
9841 TRACE("(%p %p)\n", this, v);
9843 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9844 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9845 istreambuf_iterator_wchar first={0}, last={0};
9847 first.strbuf = strbuf;
9848 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
9850 basic_istream_wchar_sentry_destroy(this);
9852 basic_ios_wchar_setstate(base, state);
9853 return this;
9856 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
9857 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
9858 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
9859 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
9861 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
9862 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9865 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
9866 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
9867 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
9868 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
9870 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
9871 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9874 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
9876 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9877 int state = IOSTATE_goodbit;
9879 TRACE("(%p %p)\n", this, v);
9881 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9882 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9883 istreambuf_iterator_wchar first={0}, last={0};
9885 first.strbuf = strbuf;
9886 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
9888 basic_istream_wchar_sentry_destroy(this);
9890 basic_ios_wchar_setstate(base, state);
9891 return this;
9894 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
9895 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
9896 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
9897 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
9899 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
9900 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9903 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
9904 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
9905 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
9906 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
9908 return basic_istream_read_float(this, v, num_get_short_use_facet(
9909 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9912 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
9914 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9915 int state = IOSTATE_goodbit;
9917 TRACE("(%p %p)\n", this, v);
9919 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9920 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9921 istreambuf_iterator_wchar first={0}, last={0};
9923 first.strbuf = strbuf;
9924 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
9926 basic_istream_wchar_sentry_destroy(this);
9928 basic_ios_wchar_setstate(base, state);
9929 return this;
9932 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
9933 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
9934 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
9935 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
9937 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
9938 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9941 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
9942 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
9943 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
9944 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
9946 return basic_istream_read_double(this, v, num_get_short_use_facet(
9947 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9950 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
9952 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9953 int state = IOSTATE_goodbit;
9955 TRACE("(%p %p)\n", this, v);
9957 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9958 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9959 istreambuf_iterator_wchar first={0}, last={0};
9961 first.strbuf = strbuf;
9962 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
9964 basic_istream_wchar_sentry_destroy(this);
9966 basic_ios_wchar_setstate(base, state);
9967 return this;
9970 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
9971 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
9972 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
9973 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
9975 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
9976 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9979 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
9980 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
9981 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
9982 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
9984 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
9985 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
9988 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
9990 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9991 int state = IOSTATE_goodbit;
9993 TRACE("(%p %p)\n", this, v);
9995 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9996 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9997 istreambuf_iterator_wchar first={0}, last={0};
9999 first.strbuf = strbuf;
10000 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
10002 basic_istream_wchar_sentry_destroy(this);
10004 basic_ios_wchar_setstate(base, state);
10005 return this;
10008 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
10009 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10010 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
10011 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
10013 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
10014 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10017 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
10018 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10019 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
10020 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
10022 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
10023 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10026 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
10028 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10029 int state = IOSTATE_goodbit;
10031 TRACE("(%p %p)\n", this, v);
10033 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10034 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10035 istreambuf_iterator_wchar first={0}, last={0};
10037 first.strbuf = strbuf;
10038 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
10040 basic_istream_wchar_sentry_destroy(this);
10042 basic_ios_wchar_setstate(base, state);
10043 return this;
10046 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
10047 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
10048 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
10049 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
10051 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
10052 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10055 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
10056 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
10057 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
10058 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
10060 return basic_istream_read_int64(this, v, num_get_short_use_facet(
10061 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10064 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
10066 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10067 int state = IOSTATE_goodbit;
10069 TRACE("(%p %p)\n", this, v);
10071 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10072 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10073 istreambuf_iterator_wchar first={0}, last={0};
10075 first.strbuf = strbuf;
10076 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
10078 basic_istream_wchar_sentry_destroy(this);
10080 basic_ios_wchar_setstate(base, state);
10081 return this;
10084 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
10085 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
10086 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
10087 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10089 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
10090 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10093 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
10094 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
10095 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
10096 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10098 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
10099 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10102 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
10104 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10105 int state = IOSTATE_goodbit;
10107 TRACE("(%p %p)\n", this, v);
10109 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10110 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10111 istreambuf_iterator_wchar first={0}, last={0};
10113 first.strbuf = strbuf;
10114 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
10116 basic_istream_wchar_sentry_destroy(this);
10118 basic_ios_wchar_setstate(base, state);
10119 return this;
10122 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
10123 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
10124 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
10125 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10127 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
10128 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10131 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
10132 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
10133 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
10134 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10136 return basic_istream_read_bool(this, v, num_get_short_use_facet(
10137 basic_istream_wchar_get_basic_ios(this)->strbuf->loc));
10140 /* ??$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 */
10141 /* ??$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 */
10142 /* ??$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 */
10143 /* ??$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 */
10144 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
10145 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
10147 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10148 IOSB_iostate state = IOSTATE_goodbit;
10149 int c = delim;
10151 TRACE("(%p %p %c)\n", istream, str, delim);
10153 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10154 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10155 MSVCP_basic_string_wchar_clear(str);
10157 c = basic_streambuf_wchar_sgetc(strbuf);
10158 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
10159 MSVCP_basic_string_wchar_append_ch(str, c);
10160 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
10161 else if(c==WEOF) state |= IOSTATE_eofbit;
10163 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
10165 basic_istream_wchar_sentry_destroy(istream);
10167 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
10168 return istream;
10171 /* ??$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 */
10172 /* ??$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 */
10173 /* ??$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 */
10174 /* ??$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 */
10175 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
10176 basic_istream_wchar *istream, basic_string_wchar *str)
10178 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
10181 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
10182 basic_string_wchar *str, const ctype_wchar *ctype)
10184 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10185 IOSB_iostate state = IOSTATE_failbit;
10186 int c = '\n';
10188 TRACE("(%p %p)\n", istream, str);
10190 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10191 MSVCP_size_t count = ios_base_width_get(&base->base);
10193 if(!count)
10194 count = -1;
10196 MSVCP_basic_string_wchar_clear(str);
10198 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10199 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10200 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10201 state = IOSTATE_goodbit;
10202 MSVCP_basic_string_wchar_append_ch(str, c);
10205 basic_istream_wchar_sentry_destroy(istream);
10207 ios_base_width_set(&base->base, 0);
10208 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10209 return istream;
10212 /* ??$?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 */
10213 /* ??$?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 */
10214 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
10215 basic_istream_wchar *istream, basic_string_wchar *str)
10217 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
10218 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10221 /* ??$?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 */
10222 /* ??$?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 */
10223 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
10224 basic_istream_wchar *istream, basic_string_wchar *str)
10226 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
10227 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10230 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
10232 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10233 IOSB_iostate state = IOSTATE_failbit;
10234 unsigned short c = '\n';
10236 TRACE("(%p %p)\n", istream, str);
10238 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10239 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
10241 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10242 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10243 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10244 state = IOSTATE_goodbit;
10245 *str++ = c;
10248 basic_istream_wchar_sentry_destroy(istream);
10250 *str = 0;
10251 ios_base_width_set(&base->base, 0);
10252 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10253 return istream;
10256 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
10257 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
10258 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
10260 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
10261 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10264 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
10265 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
10266 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
10268 return basic_istream_read_str(istream, str, ctype_short_use_facet(
10269 basic_istream_wchar_get_basic_ios(istream)->strbuf->loc));
10272 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
10273 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
10274 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
10275 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
10276 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
10278 IOSB_iostate state = IOSTATE_failbit;
10279 unsigned short c = 0;
10281 TRACE("(%p %p)\n", istream, ch);
10283 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10284 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
10285 basic_istream_wchar_get_basic_ios(istream)));
10286 if(c != WEOF) {
10287 state = IOSTATE_goodbit;
10288 *ch = c;
10291 basic_istream_wchar_sentry_destroy(istream);
10293 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
10294 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10295 return istream;
10298 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10299 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10300 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10301 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10302 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
10303 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
10304 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
10306 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10307 IOSB_iostate state = IOSTATE_failbit;
10308 unsigned short c = '\n';
10310 TRACE("(%p %p)\n", this, streambuf);
10312 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10313 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
10314 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
10315 state = IOSTATE_goodbit;
10316 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
10317 break;
10320 basic_istream_wchar_sentry_destroy(this);
10322 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10323 return this;
10326 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10327 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10328 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10329 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10330 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
10331 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
10332 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
10334 TRACE("(%p %p)\n", this, pfunc);
10335 pfunc(this);
10336 return this;
10339 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
10340 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
10341 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
10342 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
10343 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
10344 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
10345 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
10347 TRACE("(%p %p)\n", this, pfunc);
10348 pfunc(basic_istream_wchar_get_basic_ios(this));
10349 return this;
10352 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10353 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10354 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10355 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10356 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
10357 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
10358 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
10360 TRACE("(%p %p)\n", this, pfunc);
10361 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
10362 return this;
10365 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
10367 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
10370 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
10372 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
10375 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10376 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10377 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
10378 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
10380 basic_ios_char *basic_ios;
10382 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10384 if(virt_init) {
10385 this->base1.vbtable = basic_iostream_char_vbtable1;
10386 this->base2.vbtable = basic_iostream_char_vbtable2;
10387 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10388 basic_ios_char_ctor(basic_ios);
10389 }else {
10390 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10393 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
10395 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
10396 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
10397 return this;
10400 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10401 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10402 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
10403 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
10405 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10407 TRACE("(%p)\n", this);
10408 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
10409 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
10412 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10413 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10414 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
10415 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
10417 TRACE("(%p)\n", this);
10418 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
10419 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
10422 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
10423 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10425 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10427 TRACE("(%p %x)\n", this, flags);
10429 if(flags & 2) {
10430 /* we have an array, with the number of elements stored before the first object */
10431 INT_PTR i, *ptr = (INT_PTR *)this-1;
10433 for(i=*ptr-1; i>=0; i--)
10434 basic_iostream_char_vbase_dtor(this+i);
10435 MSVCRT_operator_delete(ptr);
10436 } else {
10437 basic_iostream_char_vbase_dtor(this);
10438 if(flags & 1)
10439 MSVCRT_operator_delete(this);
10442 return this;
10445 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
10447 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
10450 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10452 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
10455 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10456 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10457 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
10458 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
10459 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
10461 basic_ios_wchar *basic_ios;
10463 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10465 if(virt_init) {
10466 this->base1.vbtable = basic_iostream_wchar_vbtable1;
10467 this->base2.vbtable = basic_iostream_wchar_vbtable2;
10468 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10469 basic_ios_wchar_ctor(basic_ios);
10470 }else {
10471 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10474 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
10475 basic_ostream_wchar_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
10477 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
10478 return this;
10481 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10482 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10483 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
10484 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
10485 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
10487 basic_iostream_wchar_ctor(this, strbuf, virt_init);
10488 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
10489 return this;
10492 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10493 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10494 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10495 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10496 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
10497 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
10499 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10501 TRACE("(%p)\n", this);
10502 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
10503 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
10506 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10507 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10508 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10509 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10510 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
10511 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
10513 TRACE("(%p)\n", this);
10514 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
10515 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
10518 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
10519 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10521 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10523 TRACE("(%p %x)\n", this, flags);
10525 if(flags & 2) {
10526 /* we have an array, with the number of elements stored before the first object */
10527 INT_PTR i, *ptr = (INT_PTR *)this-1;
10529 for(i=*ptr-1; i>=0; i--)
10530 basic_iostream_wchar_vbase_dtor(this+i);
10531 MSVCRT_operator_delete(ptr);
10532 } else {
10533 basic_iostream_wchar_vbase_dtor(this);
10534 if(flags & 1)
10535 MSVCRT_operator_delete(this);
10538 return this;
10541 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
10543 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
10546 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
10548 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
10551 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10552 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10553 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
10554 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
10556 basic_ios_char *basic_ios;
10558 TRACE("(%p %d)\n", this, virt_init);
10560 if(virt_init) {
10561 this->base.vbtable = basic_ofstream_char_vbtable;
10562 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10563 basic_ios_char_ctor(basic_ios);
10564 }else {
10565 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10568 basic_filebuf_char_ctor(&this->filebuf);
10569 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10570 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10571 return this;
10574 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10575 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10576 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
10577 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
10578 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
10580 basic_ios_char *basic_ios;
10582 TRACE("(%p %p %d)\n", this, file, virt_init);
10584 if(virt_init) {
10585 this->base.vbtable = basic_ofstream_char_vbtable;
10586 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10587 basic_ios_char_ctor(basic_ios);
10588 }else {
10589 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10592 basic_filebuf_char_ctor_file(&this->filebuf, file);
10593 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10594 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10595 return this;
10598 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
10599 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
10600 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 20)
10601 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
10602 const char *name, int mode, int prot, MSVCP_bool virt_init)
10604 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
10606 basic_ofstream_char_ctor(this, virt_init);
10608 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10609 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10610 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10612 return this;
10615 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
10616 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
10617 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
10618 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
10619 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name_wchar, 20)
10620 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name_wchar(basic_ofstream_char *this,
10621 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10623 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
10625 basic_ofstream_char_ctor(this, virt_init);
10627 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10628 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10629 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10631 return this;
10634 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10635 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10636 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
10637 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
10639 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10641 TRACE("(%p)\n", this);
10643 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
10644 basic_filebuf_char_dtor(&this->filebuf);
10647 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10648 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10649 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
10650 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
10652 TRACE("(%p)\n", this);
10654 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
10655 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
10658 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
10659 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10661 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10663 TRACE("(%p %x)\n", this, flags);
10665 if(flags & 2) {
10666 /* we have an array, with the number of elements stored before the first object */
10667 INT_PTR i, *ptr = (INT_PTR *)this-1;
10669 for(i=*ptr-1; i>=0; i--)
10670 basic_ofstream_char_vbase_dtor(this+i);
10671 MSVCRT_operator_delete(ptr);
10672 } else {
10673 basic_ofstream_char_vbase_dtor(this);
10674 if(flags & 1)
10675 MSVCRT_operator_delete(this);
10678 return this;
10681 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10682 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10683 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
10684 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
10686 TRACE("(%p)\n", this);
10688 if(!basic_filebuf_char_close(&this->filebuf)) {
10689 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10690 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10694 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10695 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10696 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
10697 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
10699 TRACE("(%p)\n", this);
10700 return basic_filebuf_char_is_open(&this->filebuf);
10703 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
10704 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
10705 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 16)
10706 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
10707 const char *name, int mode, int prot)
10709 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
10711 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10712 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10713 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10717 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
10718 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
10719 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
10720 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
10721 const char *name, unsigned int mode)
10723 basic_ofstream_char_open(this, name, mode, _SH_DENYNO);
10726 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
10727 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
10728 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
10729 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
10730 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar, 16)
10731 void __thiscall basic_ofstream_char_open_wchar(basic_ofstream_char *this,
10732 const wchar_t *name, int mode, int prot)
10734 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
10736 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10737 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10738 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10742 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
10743 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
10744 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
10745 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
10746 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar_old, 12)
10747 void __thiscall basic_ofstream_char_open_wchar_old(basic_ofstream_char *this,
10748 const wchar_t *name, unsigned int mode)
10750 basic_ofstream_char_open_wchar(this, name, mode, _SH_DENYNO);
10753 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10754 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
10755 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
10756 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
10758 TRACE("(%p)\n", this);
10759 return (basic_filebuf_char*)&this->filebuf;
10762 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
10764 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
10767 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10769 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
10772 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
10773 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
10774 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
10775 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10777 basic_ios_wchar *basic_ios;
10779 TRACE("(%p %d)\n", this, virt_init);
10781 if(virt_init) {
10782 this->base.vbtable = basic_ofstream_wchar_vbtable;
10783 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10784 basic_ios_wchar_ctor(basic_ios);
10785 }else {
10786 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10789 basic_filebuf_wchar_ctor(&this->filebuf);
10790 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10791 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
10792 return this;
10795 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
10796 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
10797 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
10798 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
10800 basic_ofstream_wchar_ctor(this, virt_init);
10801 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10802 return this;
10805 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
10806 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10807 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
10808 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
10809 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10811 basic_ios_wchar *basic_ios;
10813 TRACE("(%p %p %d)\n", this, file, virt_init);
10815 if(virt_init) {
10816 this->base.vbtable = basic_ofstream_wchar_vbtable;
10817 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10818 basic_ios_wchar_ctor(basic_ios);
10819 }else {
10820 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10823 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
10824 basic_ostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
10825 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
10826 return this;
10829 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
10830 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10831 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
10832 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
10833 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
10835 basic_ofstream_wchar_ctor_file(this, file, virt_init);
10836 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10837 return this;
10840 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
10841 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
10842 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name, 20)
10843 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name(basic_ofstream_wchar *this,
10844 const char *name, int mode, int prot, MSVCP_bool virt_init)
10846 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
10848 basic_ofstream_wchar_ctor(this, virt_init);
10850 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10851 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10852 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10854 return this;
10857 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
10858 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
10859 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 20)
10860 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
10861 const char *name, int mode, int prot, MSVCP_bool virt_init)
10863 basic_ofstream_wchar_ctor_name(this, name, mode, prot, virt_init);
10864 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10865 return this;
10868 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
10869 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
10870 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
10871 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
10872 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_name_wchar, 20)
10873 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_name_wchar(basic_ofstream_wchar *this,
10874 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10876 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
10878 basic_ofstream_wchar_ctor(this, virt_init);
10880 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10881 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10882 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10884 return this;
10887 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
10888 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
10889 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
10890 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
10891 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name_wchar, 20)
10892 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name_wchar(basic_ofstream_wchar *this,
10893 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
10895 basic_ofstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
10896 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
10897 return this;
10900 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10901 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10902 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10903 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10904 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
10905 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
10907 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
10909 TRACE("(%p)\n", this);
10911 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
10912 basic_filebuf_wchar_dtor(&this->filebuf);
10915 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10916 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10917 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10918 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10919 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
10920 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
10922 TRACE("(%p)\n", this);
10924 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
10925 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
10928 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
10929 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10931 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
10933 TRACE("(%p %x)\n", this, flags);
10935 if(flags & 2) {
10936 /* we have an array, with the number of elements stored before the first object */
10937 INT_PTR i, *ptr = (INT_PTR *)this-1;
10939 for(i=*ptr-1; i>=0; i--)
10940 basic_ofstream_wchar_vbase_dtor(this+i);
10941 MSVCRT_operator_delete(ptr);
10942 } else {
10943 basic_ofstream_wchar_vbase_dtor(this);
10944 if(flags & 1)
10945 MSVCRT_operator_delete(this);
10948 return this;
10951 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10952 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10953 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10954 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10955 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
10956 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
10958 TRACE("(%p)\n", this);
10960 if(!basic_filebuf_wchar_close(&this->filebuf)) {
10961 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10962 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10966 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
10967 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
10968 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
10969 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
10970 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
10971 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
10973 TRACE("(%p)\n", this);
10974 return basic_filebuf_wchar_is_open(&this->filebuf);
10977 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
10978 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
10979 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
10980 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
10981 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 16)
10982 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
10983 const char *name, int mode, int prot)
10985 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
10987 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
10988 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
10989 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
10993 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
10994 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
10995 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
10996 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
10997 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
10998 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
10999 const char *name, unsigned int mode)
11001 basic_ofstream_wchar_open(this, name, mode, _SH_DENYNO);
11004 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11005 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11006 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11007 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11008 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11009 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11010 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11011 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11012 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar, 16)
11013 void __thiscall basic_ofstream_wchar_open_wchar(basic_ofstream_wchar *this,
11014 const wchar_t *name, int mode, int prot)
11016 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11018 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
11019 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11020 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11024 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11025 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11026 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11027 /* ?open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11028 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11029 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11030 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11031 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11032 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_wchar_old, 12)
11033 void __thiscall basic_ofstream_wchar_open_wchar_old(basic_ofstream_wchar *this,
11034 const wchar_t *name, unsigned int mode)
11036 basic_ofstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11039 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11040 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11041 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11042 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11043 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
11044 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
11046 TRACE("(%p)\n", this);
11047 return (basic_filebuf_wchar*)&this->filebuf;
11050 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
11052 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
11055 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
11057 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
11060 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11061 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11062 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
11063 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
11065 basic_ios_char *basic_ios;
11067 TRACE("(%p %d)\n", this, virt_init);
11069 if(virt_init) {
11070 this->base.vbtable = basic_ifstream_char_vbtable;
11071 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11072 basic_ios_char_ctor(basic_ios);
11073 }else {
11074 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11077 basic_filebuf_char_ctor(&this->filebuf);
11078 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11079 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11080 return this;
11083 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11084 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11085 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
11086 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
11087 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
11089 basic_ios_char *basic_ios;
11091 TRACE("(%p %p %d)\n", this, file, virt_init);
11093 if(virt_init) {
11094 this->base.vbtable = basic_ifstream_char_vbtable;
11095 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11096 basic_ios_char_ctor(basic_ios);
11097 }else {
11098 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11101 basic_filebuf_char_ctor_file(&this->filebuf, file);
11102 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11103 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11104 return this;
11107 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11108 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11109 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 20)
11110 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
11111 const char *name, int mode, int prot, MSVCP_bool virt_init)
11113 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11115 basic_ifstream_char_ctor(this, virt_init);
11117 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11118 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11119 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11121 return this;
11124 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11125 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11126 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11127 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11128 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_wchar, 20)
11129 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_wchar(basic_ifstream_char *this,
11130 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11132 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11134 basic_ifstream_char_ctor(this, virt_init);
11136 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11137 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11138 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11140 return this;
11143 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11144 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11145 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
11146 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
11148 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11150 TRACE("(%p)\n", this);
11152 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11153 basic_filebuf_char_dtor(&this->filebuf);
11156 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11157 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11158 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
11159 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
11161 TRACE("(%p)\n", this);
11163 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
11164 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11167 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
11168 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11170 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11172 TRACE("(%p %x)\n", this, flags);
11174 if(flags & 2) {
11175 /* we have an array, with the number of elements stored before the first object */
11176 INT_PTR i, *ptr = (INT_PTR *)this-1;
11178 for(i=*ptr-1; i>=0; i--)
11179 basic_ifstream_char_vbase_dtor(this+i);
11180 MSVCRT_operator_delete(ptr);
11181 } else {
11182 basic_ifstream_char_vbase_dtor(this);
11183 if(flags & 1)
11184 MSVCRT_operator_delete(this);
11187 return this;
11190 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11191 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11192 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
11193 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
11195 TRACE("(%p)\n", this);
11197 if(!basic_filebuf_char_close(&this->filebuf)) {
11198 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11199 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11203 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11204 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11205 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
11206 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
11208 TRACE("(%p)\n", this);
11209 return basic_filebuf_char_is_open(&this->filebuf);
11212 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11213 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11214 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 16)
11215 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
11216 const char *name, int mode, int prot)
11218 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11220 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11221 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11222 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11226 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11227 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11228 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
11229 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
11230 const char *name, unsigned int mode)
11232 basic_ifstream_char_open(this, name, mode, _SH_DENYNO);
11235 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11236 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11237 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11238 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11239 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar, 16)
11240 void __thiscall basic_ifstream_char_open_wchar(basic_ifstream_char *this,
11241 const wchar_t *name, int mode, int prot)
11243 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11245 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11246 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11247 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11251 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11252 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11253 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11254 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11255 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar_old, 12)
11256 void __thiscall basic_ifstream_char_open_wchar_old(basic_ifstream_char *this,
11257 const wchar_t *name, unsigned int mode)
11259 basic_ifstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11262 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11263 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11264 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
11265 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
11267 TRACE("(%p)\n", this);
11268 return (basic_filebuf_char*)&this->filebuf;
11271 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
11273 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
11276 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11278 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
11281 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11282 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11283 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
11284 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
11286 basic_ios_wchar *basic_ios;
11288 TRACE("(%p %d)\n", this, virt_init);
11290 if(virt_init) {
11291 this->base.vbtable = basic_ifstream_wchar_vbtable;
11292 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11293 basic_ios_wchar_ctor(basic_ios);
11294 }else {
11295 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11298 basic_filebuf_wchar_ctor(&this->filebuf);
11299 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11300 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11301 return this;
11304 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11305 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11306 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
11307 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
11309 basic_ifstream_wchar_ctor(this, virt_init);
11310 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11311 return this;
11314 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11315 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11316 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
11317 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
11318 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11320 basic_ios_wchar *basic_ios;
11322 TRACE("(%p %p %d)\n", this, file, virt_init);
11324 if(virt_init) {
11325 this->base.vbtable = basic_ifstream_wchar_vbtable;
11326 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11327 basic_ios_wchar_ctor(basic_ios);
11328 }else {
11329 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11332 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11333 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11334 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11335 return this;
11338 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11339 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11340 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
11341 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
11342 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11344 basic_ifstream_wchar_ctor_file(this, file, virt_init);
11345 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11346 return this;
11349 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z */
11350 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z */
11351 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name, 20)
11352 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name(basic_ifstream_wchar *this,
11353 const char *name, int mode, int prot, MSVCP_bool virt_init)
11355 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11357 basic_ifstream_wchar_ctor(this, virt_init);
11359 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11360 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11361 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11363 return this;
11366 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z */
11367 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z */
11368 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 20)
11369 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
11370 const char *name, int mode, int prot, MSVCP_bool virt_init)
11372 basic_ifstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11373 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11374 return this;
11377 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11378 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11379 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11380 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11381 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_name_wchar, 20)
11382 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_name_wchar(basic_ifstream_wchar *this,
11383 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11385 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11387 basic_ifstream_wchar_ctor(this, virt_init);
11389 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11390 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11391 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11393 return this;
11396 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11397 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11398 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11399 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11400 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name_wchar, 20)
11401 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name_wchar(basic_ifstream_wchar *this,
11402 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11404 basic_ifstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11405 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11406 return this;
11409 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11410 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11411 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11412 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11413 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
11414 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
11416 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11418 TRACE("(%p)\n", this);
11420 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
11421 basic_filebuf_wchar_dtor(&this->filebuf);
11424 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11425 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11426 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11427 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11428 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
11429 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
11431 TRACE("(%p)\n", this);
11433 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
11434 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
11437 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
11438 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11440 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11442 TRACE("(%p %x)\n", this, flags);
11444 if(flags & 2) {
11445 /* we have an array, with the number of elements stored before the first object */
11446 INT_PTR i, *ptr = (INT_PTR *)this-1;
11448 for(i=*ptr-1; i>=0; i--)
11449 basic_ifstream_wchar_vbase_dtor(this+i);
11450 MSVCRT_operator_delete(ptr);
11451 } else {
11452 basic_ifstream_wchar_vbase_dtor(this);
11453 if(flags & 1)
11454 MSVCRT_operator_delete(this);
11457 return this;
11460 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11461 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11462 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11463 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11464 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
11465 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
11467 TRACE("(%p)\n", this);
11469 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11470 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11471 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11475 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11476 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11477 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11478 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11479 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
11480 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
11482 TRACE("(%p)\n", this);
11483 return basic_filebuf_wchar_is_open(&this->filebuf);
11486 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
11487 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
11488 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
11489 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
11490 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 16)
11491 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
11492 const char *name, int mode, int prot)
11494 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11496 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11497 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11498 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11502 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
11503 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
11504 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
11505 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
11506 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
11507 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
11508 const char *name, unsigned int mode)
11510 basic_ifstream_wchar_open(this, name, mode, _SH_DENYNO);
11513 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
11514 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
11515 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
11516 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
11517 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
11518 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
11519 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
11520 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
11521 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar, 16)
11522 void __thiscall basic_ifstream_wchar_open_wchar(basic_ifstream_wchar *this,
11523 const wchar_t *name, int mode, int prot)
11525 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11527 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
11528 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11529 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11533 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
11534 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
11535 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
11536 /* ?open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
11537 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
11538 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
11539 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
11540 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
11541 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_wchar_old, 12)
11542 void __thiscall basic_ifstream_wchar_open_wchar_old(basic_ifstream_wchar *this,
11543 const wchar_t *name, unsigned int mode)
11545 basic_ifstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
11548 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11549 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11550 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11551 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11552 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
11553 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
11555 TRACE("(%p)\n", this);
11556 return (basic_filebuf_wchar*)&this->filebuf;
11559 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
11561 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
11564 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
11566 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
11569 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11570 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11571 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
11572 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
11574 basic_ios_char *basic_ios;
11576 TRACE("(%p %d)\n", this, virt_init);
11578 if(virt_init) {
11579 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11580 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11581 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11582 basic_ios_char_ctor(basic_ios);
11583 }else {
11584 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11587 basic_filebuf_char_ctor(&this->filebuf);
11588 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11589 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11590 return this;
11593 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11594 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11595 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
11596 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
11597 FILE *file, MSVCP_bool virt_init)
11599 basic_ios_char *basic_ios;
11601 TRACE("(%p %p %d)\n", this, file, virt_init);
11603 if(virt_init) {
11604 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11605 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11606 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11607 basic_ios_char_ctor(basic_ios);
11608 }else {
11609 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11612 basic_filebuf_char_ctor_file(&this->filebuf, file);
11613 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11614 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11615 return this;
11618 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
11619 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
11620 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 20)
11621 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
11622 const char *name, int mode, int prot, MSVCP_bool virt_init)
11624 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11626 basic_fstream_char_ctor(this, virt_init);
11628 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
11629 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11630 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11632 return this;
11635 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
11636 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
11637 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_noprot, 16)
11638 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_noprot(basic_fstream_char *this,
11639 const char *name, int mode, MSVCP_bool virt_init)
11641 return basic_fstream_char_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
11644 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
11645 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
11646 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
11647 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
11648 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_wchar, 20)
11649 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_wchar(basic_fstream_char *this,
11650 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11652 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11654 basic_fstream_char_ctor(this, virt_init);
11656 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
11657 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11658 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11660 return this;
11663 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11664 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11665 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
11666 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
11668 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11670 TRACE("(%p)\n", this);
11672 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
11673 basic_filebuf_char_dtor(&this->filebuf);
11676 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11677 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11678 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
11679 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
11681 TRACE("(%p)\n", this);
11683 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
11684 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
11687 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
11688 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11690 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11692 TRACE("(%p %x)\n", this, flags);
11694 if(flags & 2) {
11695 /* we have an array, with the number of elements stored before the first object */
11696 INT_PTR i, *ptr = (INT_PTR *)this-1;
11698 for(i=*ptr-1; i>=0; i--)
11699 basic_fstream_char_vbase_dtor(this+i);
11700 MSVCRT_operator_delete(ptr);
11701 } else {
11702 basic_fstream_char_vbase_dtor(this);
11703 if(flags & 1)
11704 MSVCRT_operator_delete(this);
11707 return this;
11710 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11711 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11712 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
11713 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
11715 TRACE("(%p)\n", this);
11717 if(!basic_filebuf_char_close(&this->filebuf)) {
11718 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11719 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11723 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11724 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11725 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
11726 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
11728 TRACE("(%p)\n", this);
11729 return basic_filebuf_char_is_open(&this->filebuf);
11732 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
11733 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
11734 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 16)
11735 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
11736 const char *name, int mode, int prot)
11738 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
11740 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
11741 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11742 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11746 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
11747 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
11748 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
11749 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
11750 const char *name, unsigned int mode)
11752 basic_fstream_char_open(this, name, mode, _SH_DENYNO);
11755 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
11756 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
11757 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
11758 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
11759 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar, 16)
11760 void __thiscall basic_fstream_char_open_wchar(basic_fstream_char *this,
11761 const wchar_t *name, int mode, int prot)
11763 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
11765 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
11766 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11767 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11771 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
11772 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
11773 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
11774 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
11775 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar_old, 12)
11776 void __thiscall basic_fstream_char_open_wchar_old(basic_fstream_char *this,
11777 const wchar_t *name, unsigned int mode)
11779 basic_fstream_char_open_wchar(this, name, mode, _SH_DENYNO);
11782 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11783 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11784 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
11785 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
11787 TRACE("(%p)\n", this);
11788 return (basic_filebuf_char*)&this->filebuf;
11791 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
11793 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
11796 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11798 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
11801 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11802 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11803 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
11804 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
11806 basic_ios_wchar *basic_ios;
11808 TRACE("(%p %d)\n", this, virt_init);
11810 if(virt_init) {
11811 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11812 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11813 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11814 basic_ios_wchar_ctor(basic_ios);
11815 }else {
11816 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11819 basic_filebuf_wchar_ctor(&this->filebuf);
11820 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11821 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11822 return this;
11825 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11826 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11827 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
11828 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
11830 basic_fstream_wchar_ctor(this, virt_init);
11831 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11832 return this;
11835 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11836 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11837 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
11838 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
11839 FILE *file, MSVCP_bool virt_init)
11841 basic_ios_wchar *basic_ios;
11843 TRACE("(%p %p %d)\n", this, file, virt_init);
11845 if(virt_init) {
11846 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11847 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11848 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11849 basic_ios_wchar_ctor(basic_ios);
11850 }else {
11851 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11854 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11855 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11856 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11857 return this;
11860 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11861 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11862 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
11863 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
11864 FILE *file, MSVCP_bool virt_init)
11866 basic_fstream_wchar_ctor_file(this, file, virt_init);
11867 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11868 return this;
11871 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11872 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11873 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name, 20)
11874 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name(basic_fstream_wchar *this,
11875 const char *name, int mode, int prot, MSVCP_bool virt_init)
11877 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
11879 basic_fstream_wchar_ctor(this, virt_init);
11881 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
11882 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11883 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11885 return this;
11888 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11889 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11890 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 20)
11891 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
11892 const char *name, int mode, int prot, MSVCP_bool virt_init)
11894 basic_fstream_wchar_ctor_name(this, name, mode, prot, virt_init);
11895 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11896 return this;
11899 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDH@Z */
11900 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_noprot, 16)
11901 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_noprot(basic_fstream_wchar *this,
11902 const char *name, int mode, MSVCP_bool virt_init)
11904 return basic_fstream_wchar_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
11907 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
11908 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
11909 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_noprot, 16)
11910 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_noprot(basic_fstream_wchar *this,
11911 const char *name, int mode, MSVCP_bool virt_init)
11913 return basic_fstream_short_ctor_name(this, name, mode, _SH_DENYNO, virt_init);
11916 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
11917 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
11918 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
11919 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
11920 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_wchar, 20)
11921 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_wchar(basic_fstream_wchar *this,
11922 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11924 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
11926 basic_fstream_wchar_ctor(this, virt_init);
11928 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
11929 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11930 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11932 return this;
11935 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
11936 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
11937 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
11938 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
11939 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_wchar, 20)
11940 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_wchar(basic_fstream_wchar *this,
11941 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
11943 basic_fstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
11944 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11945 return this;
11948 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11949 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11950 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11951 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11952 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
11953 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
11955 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11957 TRACE("(%p)\n", this);
11959 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
11960 basic_filebuf_wchar_dtor(&this->filebuf);
11963 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11964 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11965 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11966 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11967 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
11968 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
11970 TRACE("(%p)\n", this);
11972 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
11973 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
11976 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
11977 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11979 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11981 TRACE("(%p %x)\n", this, flags);
11983 if(flags & 2) {
11984 /* we have an array, with the number of elements stored before the first object */
11985 INT_PTR i, *ptr = (INT_PTR *)this-1;
11987 for(i=*ptr-1; i>=0; i--)
11988 basic_fstream_wchar_vbase_dtor(this+i);
11989 MSVCRT_operator_delete(ptr);
11990 } else {
11991 basic_fstream_wchar_vbase_dtor(this);
11992 if(flags & 1)
11993 MSVCRT_operator_delete(this);
11996 return this;
11999 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
12000 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
12001 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
12002 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
12003 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
12004 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
12006 TRACE("(%p)\n", this);
12008 if(!basic_filebuf_wchar_close(&this->filebuf)) {
12009 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12010 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12014 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12015 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12016 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12017 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12018 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
12019 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
12021 TRACE("(%p)\n", this);
12022 return basic_filebuf_wchar_is_open(&this->filebuf);
12025 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDHH@Z */
12026 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDHH@Z */
12027 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDHH@Z */
12028 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDHH@Z */
12029 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 16)
12030 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
12031 const char *name, int mode, int prot)
12033 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
12035 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
12036 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12037 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12041 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBDI@Z */
12042 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBDI@Z */
12043 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBDI@Z */
12044 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDI@Z */
12045 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
12046 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
12047 const char *name, unsigned int mode)
12049 basic_fstream_wchar_open(this, name, mode, _SH_DENYNO);
12052 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGHH@Z */
12053 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGHH@Z */
12054 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WHH@Z */
12055 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WHH@Z */
12056 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGHH@Z */
12057 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGHH@Z */
12058 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WHH@Z */
12059 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WHH@Z */
12060 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar, 16)
12061 void __thiscall basic_fstream_wchar_open_wchar(basic_fstream_wchar *this,
12062 const wchar_t *name, int mode, int prot)
12064 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
12066 if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
12067 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12068 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12072 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPBGI@Z */
12073 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEBGI@Z */
12074 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXPB_WI@Z */
12075 /* ?open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXPEB_WI@Z */
12076 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPBGI@Z */
12077 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEBGI@Z */
12078 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXPB_WI@Z */
12079 /* ?open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXPEB_WI@Z */
12080 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_wchar_old, 12)
12081 void __thiscall basic_fstream_wchar_open_wchar_old(basic_fstream_wchar *this,
12082 const wchar_t *name, unsigned int mode)
12084 basic_fstream_wchar_open_wchar(this, name, mode, _SH_DENYNO);
12087 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12088 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12089 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12090 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12091 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
12092 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
12094 TRACE("(%p)\n", this);
12095 return (basic_filebuf_wchar*)&this->filebuf;
12098 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
12100 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
12103 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
12105 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
12108 /* ??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 */
12109 /* ??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 */
12110 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
12111 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
12112 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12114 basic_ios_char *basic_ios;
12116 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12118 if(virt_init) {
12119 this->base.vbtable = basic_ostringstream_char_vbtable;
12120 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12121 basic_ios_char_ctor(basic_ios);
12122 }else {
12123 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12126 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12127 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12128 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12129 return this;
12132 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12133 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12134 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
12135 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
12136 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
12138 basic_ios_char *basic_ios;
12140 TRACE("(%p %d %d)\n", this, mode, virt_init);
12142 if(virt_init) {
12143 this->base.vbtable = basic_ostringstream_char_vbtable;
12144 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12145 basic_ios_char_ctor(basic_ios);
12146 }else {
12147 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12150 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12151 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12152 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12153 return this;
12156 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12157 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12158 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
12159 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
12160 basic_ostringstream_char *this)
12162 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
12165 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12166 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12167 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
12168 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
12170 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12172 TRACE("(%p)\n", this);
12174 basic_stringbuf_char_dtor(&this->strbuf);
12175 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
12178 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12179 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12180 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
12181 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
12183 TRACE("(%p)\n", this);
12185 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
12186 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
12189 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
12190 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12192 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12194 TRACE("(%p %x)\n", this, flags);
12196 if(flags & 2) {
12197 /* we have an array, with the number of elements stored before the first object */
12198 INT_PTR i, *ptr = (INT_PTR *)this-1;
12200 for(i=*ptr-1; i>=0; i--)
12201 basic_ostringstream_char_vbase_dtor(this+i);
12202 MSVCRT_operator_delete(ptr);
12203 } else {
12204 basic_ostringstream_char_vbase_dtor(this);
12205 if(flags & 1)
12206 MSVCRT_operator_delete(this);
12209 return this;
12212 /* ?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 */
12213 /* ?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 */
12214 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
12215 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
12217 TRACE("(%p)\n", this);
12218 return (basic_stringbuf_char*)&this->strbuf;
12221 /* ?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 */
12222 /* ?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 */
12223 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
12224 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
12226 TRACE("(%p %p)\n", this, str);
12227 basic_stringbuf_char_str_set(&this->strbuf, str);
12230 /* ?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 */
12231 /* ?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 */
12232 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
12233 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
12235 TRACE("(%p %p)\n", this, ret);
12236 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12239 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
12241 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
12244 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12246 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
12249 /* ??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 */
12250 /* ??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 */
12251 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
12252 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
12253 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12255 basic_ios_wchar *basic_ios;
12257 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12259 if(virt_init) {
12260 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12261 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12262 basic_ios_wchar_ctor(basic_ios);
12263 }else {
12264 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12267 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12268 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12269 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12270 return this;
12273 /* ??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 */
12274 /* ??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 */
12275 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
12276 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
12277 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12279 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
12280 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12281 return this;
12284 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12285 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12286 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
12287 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
12288 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
12290 basic_ios_wchar *basic_ios;
12292 TRACE("(%p %d %d)\n", this, mode, virt_init);
12294 if(virt_init) {
12295 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12296 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12297 basic_ios_wchar_ctor(basic_ios);
12298 }else {
12299 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12302 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12303 basic_ostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12304 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12305 return this;
12308 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12309 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12310 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
12311 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
12312 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
12314 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
12315 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12316 return this;
12319 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12320 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12321 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
12322 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
12323 basic_ostringstream_wchar *this)
12325 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
12328 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12329 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12330 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
12331 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
12332 basic_ostringstream_wchar *this)
12334 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
12337 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12338 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12339 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12340 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12341 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
12342 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
12344 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12346 TRACE("(%p)\n", this);
12348 basic_stringbuf_wchar_dtor(&this->strbuf);
12349 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
12352 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12353 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12354 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12355 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12356 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
12357 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
12359 TRACE("(%p)\n", this);
12361 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
12362 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
12365 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
12366 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12368 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12370 TRACE("(%p %x)\n", this, flags);
12372 if(flags & 2) {
12373 /* we have an array, with the number of elements stored before the first object */
12374 INT_PTR i, *ptr = (INT_PTR *)this-1;
12376 for(i=*ptr-1; i>=0; i--)
12377 basic_ostringstream_wchar_vbase_dtor(this+i);
12378 MSVCRT_operator_delete(ptr);
12379 } else {
12380 basic_ostringstream_wchar_vbase_dtor(this);
12381 if(flags & 1)
12382 MSVCRT_operator_delete(this);
12385 return this;
12388 /* ?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 */
12389 /* ?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 */
12390 /* ?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 */
12391 /* ?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 */
12392 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
12393 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
12395 TRACE("(%p)\n", this);
12396 return (basic_stringbuf_wchar*)&this->strbuf;
12399 /* ?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 */
12400 /* ?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 */
12401 /* ?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 */
12402 /* ?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 */
12403 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
12404 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
12406 TRACE("(%p %p)\n", this, str);
12407 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12410 /* ?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 */
12411 /* ?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 */
12412 /* ?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 */
12413 /* ?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 */
12414 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
12415 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
12417 TRACE("(%p %p)\n", this, ret);
12418 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12421 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
12423 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
12426 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
12428 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
12431 /* ??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 */
12432 /* ??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 */
12433 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
12434 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
12435 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12437 basic_ios_char *basic_ios;
12439 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12441 if(virt_init) {
12442 this->base.vbtable = basic_istringstream_char_vbtable;
12443 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12444 basic_ios_char_ctor(basic_ios);
12445 }else {
12446 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12449 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12450 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12451 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12452 return this;
12455 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12456 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12457 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
12458 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
12459 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
12461 basic_ios_char *basic_ios;
12463 TRACE("(%p %d %d)\n", this, mode, virt_init);
12465 if(virt_init) {
12466 this->base.vbtable = basic_istringstream_char_vbtable;
12467 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12468 basic_ios_char_ctor(basic_ios);
12469 }else {
12470 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12473 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12474 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12475 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12476 return this;
12479 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12480 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12481 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
12482 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
12483 basic_istringstream_char *this)
12485 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
12488 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12489 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12490 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
12491 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
12493 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12495 TRACE("(%p)\n", this);
12497 basic_stringbuf_char_dtor(&this->strbuf);
12498 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
12501 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12502 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12503 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
12504 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
12506 TRACE("(%p)\n", this);
12508 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
12509 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
12512 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
12513 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12515 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12517 TRACE("(%p %x)\n", this, flags);
12519 if(flags & 2) {
12520 /* we have an array, with the number of elements stored before the first object */
12521 INT_PTR i, *ptr = (INT_PTR *)this-1;
12523 for(i=*ptr-1; i>=0; i--)
12524 basic_istringstream_char_vbase_dtor(this+i);
12525 MSVCRT_operator_delete(ptr);
12526 } else {
12527 basic_istringstream_char_vbase_dtor(this);
12528 if(flags & 1)
12529 MSVCRT_operator_delete(this);
12532 return this;
12535 /* ?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 */
12536 /* ?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 */
12537 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
12538 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
12540 TRACE("(%p)\n", this);
12541 return (basic_stringbuf_char*)&this->strbuf;
12544 /* ?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 */
12545 /* ?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 */
12546 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
12547 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
12549 TRACE("(%p %p)\n", this, str);
12550 basic_stringbuf_char_str_set(&this->strbuf, str);
12553 /* ?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 */
12554 /* ?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 */
12555 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
12556 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
12558 TRACE("(%p %p)\n", this, ret);
12559 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12562 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
12564 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
12567 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12569 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
12572 /* ??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 */
12573 /* ??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 */
12574 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
12575 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
12576 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12578 basic_ios_wchar *basic_ios;
12580 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12582 if(virt_init) {
12583 this->base.vbtable = basic_istringstream_wchar_vbtable;
12584 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12585 basic_ios_wchar_ctor(basic_ios);
12586 }else {
12587 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12590 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12591 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12592 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12593 return this;
12596 /* ??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 */
12597 /* ??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 */
12598 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
12599 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
12600 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12602 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
12603 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12604 return this;
12607 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12608 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12609 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
12610 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
12611 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12613 basic_ios_wchar *basic_ios;
12615 TRACE("(%p %d %d)\n", this, mode, virt_init);
12617 if(virt_init) {
12618 this->base.vbtable = basic_istringstream_wchar_vbtable;
12619 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12620 basic_ios_wchar_ctor(basic_ios);
12621 }else {
12622 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12625 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12626 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12627 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12628 return this;
12631 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12632 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12633 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
12634 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
12635 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12637 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
12638 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12639 return this;
12642 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12643 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12644 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
12645 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
12646 basic_istringstream_wchar *this)
12648 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
12651 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12652 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12653 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
12654 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
12655 basic_istringstream_wchar *this)
12657 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
12660 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12661 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12662 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12663 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12664 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
12665 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
12667 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12669 TRACE("(%p)\n", this);
12671 basic_stringbuf_wchar_dtor(&this->strbuf);
12672 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12675 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12676 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12677 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12678 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12679 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
12680 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
12682 TRACE("(%p)\n", this);
12684 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
12685 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
12688 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
12689 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12691 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12693 TRACE("(%p %x)\n", this, flags);
12695 if(flags & 2) {
12696 /* we have an array, with the number of elements stored before the first object */
12697 INT_PTR i, *ptr = (INT_PTR *)this-1;
12699 for(i=*ptr-1; i>=0; i--)
12700 basic_istringstream_wchar_vbase_dtor(this+i);
12701 MSVCRT_operator_delete(ptr);
12702 } else {
12703 basic_istringstream_wchar_vbase_dtor(this);
12704 if(flags & 1)
12705 MSVCRT_operator_delete(this);
12708 return this;
12711 /* ?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 */
12712 /* ?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 */
12713 /* ?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 */
12714 /* ?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 */
12715 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
12716 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
12718 TRACE("(%p)\n", this);
12719 return (basic_stringbuf_wchar*)&this->strbuf;
12722 /* ?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 */
12723 /* ?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 */
12724 /* ?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 */
12725 /* ?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 */
12726 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
12727 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
12729 TRACE("(%p %p)\n", this, str);
12730 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12733 /* ?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 */
12734 /* ?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 */
12735 /* ?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 */
12736 /* ?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 */
12737 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
12738 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
12740 TRACE("(%p %p)\n", this, ret);
12741 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12744 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
12746 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
12749 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
12751 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
12754 /* ??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 */
12755 /* ??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 */
12756 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
12757 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
12758 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12760 basic_ios_char *basic_ios;
12762 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12764 if(virt_init) {
12765 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12766 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12767 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12768 basic_ios_char_ctor(basic_ios);
12769 }else {
12770 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12773 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
12774 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12775 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12776 return this;
12779 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12780 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12781 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
12782 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
12783 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
12785 basic_ios_char *basic_ios;
12787 TRACE("(%p %d %d)\n", this, mode, virt_init);
12789 if(virt_init) {
12790 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12791 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12792 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12793 basic_ios_char_ctor(basic_ios);
12794 }else {
12795 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12798 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
12799 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12800 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12801 return this;
12804 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12805 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12806 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
12807 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
12808 basic_stringstream_char *this)
12810 return basic_stringstream_char_ctor_mode(
12811 this, OPENMODE_out|OPENMODE_in, TRUE);
12814 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12815 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12816 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
12817 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
12819 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12821 TRACE("(%p)\n", this);
12823 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12824 basic_stringbuf_char_dtor(&this->strbuf);
12827 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12828 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12829 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
12830 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
12832 TRACE("(%p)\n", this);
12834 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
12835 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
12838 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
12839 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12841 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12843 TRACE("(%p %x)\n", this, flags);
12845 if(flags & 2) {
12846 /* we have an array, with the number of elements stored before the first object */
12847 INT_PTR i, *ptr = (INT_PTR *)this-1;
12849 for(i=*ptr-1; i>=0; i--)
12850 basic_stringstream_char_vbase_dtor(this+i);
12851 MSVCRT_operator_delete(ptr);
12852 } else {
12853 basic_stringstream_char_vbase_dtor(this);
12854 if(flags & 1)
12855 MSVCRT_operator_delete(this);
12858 return this;
12861 /* ?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 */
12862 /* ?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 */
12863 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
12864 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
12866 TRACE("(%p)\n", this);
12867 return (basic_stringbuf_char*)&this->strbuf;
12870 /* ?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 */
12871 /* ?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 */
12872 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
12873 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
12875 TRACE("(%p %p)\n", this, str);
12876 basic_stringbuf_char_str_set(&this->strbuf, str);
12879 /* ?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 */
12880 /* ?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 */
12881 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
12882 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
12884 TRACE("(%p %p)\n", this, ret);
12885 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12888 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
12890 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
12893 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12895 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
12898 /* ??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 */
12899 /* ??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 */
12900 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
12901 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
12902 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12904 basic_ios_wchar *basic_ios;
12906 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12908 if(virt_init) {
12909 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12910 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12911 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12912 basic_ios_wchar_ctor(basic_ios);
12913 }else {
12914 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12917 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
12918 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12919 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12920 return this;
12923 /* ??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 */
12924 /* ??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 */
12925 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
12926 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
12927 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12929 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
12930 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12931 return this;
12934 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12935 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12936 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
12937 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
12938 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
12940 basic_ios_wchar *basic_ios;
12942 TRACE("(%p %d %d)\n", this, mode, virt_init);
12944 if(virt_init) {
12945 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12946 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12947 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12948 basic_ios_wchar_ctor(basic_ios);
12949 }else {
12950 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12953 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
12954 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12955 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12956 return this;
12959 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12960 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12961 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
12962 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
12963 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
12965 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
12966 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12967 return this;
12970 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12971 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12972 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
12973 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
12974 basic_stringstream_wchar *this)
12976 return basic_stringstream_wchar_ctor_mode(
12977 this, OPENMODE_out|OPENMODE_in, TRUE);
12980 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12981 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12982 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
12983 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
12984 basic_stringstream_wchar *this)
12986 return basic_stringstream_short_ctor_mode(
12987 this, OPENMODE_out|OPENMODE_in, TRUE);
12990 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12991 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12992 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12993 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12994 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
12995 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
12997 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
12999 TRACE("(%p)\n", this);
13001 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
13002 basic_stringbuf_wchar_dtor(&this->strbuf);
13005 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
13006 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
13007 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
13008 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
13009 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
13010 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
13012 TRACE("(%p)\n", this);
13014 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
13015 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
13018 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
13019 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
13021 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
13023 TRACE("(%p %x)\n", this, flags);
13025 if(flags & 2) {
13026 /* we have an array, with the number of elements stored before the first object */
13027 INT_PTR i, *ptr = (INT_PTR *)this-1;
13029 for(i=*ptr-1; i>=0; i--)
13030 basic_stringstream_wchar_vbase_dtor(this+i);
13031 MSVCRT_operator_delete(ptr);
13032 } else {
13033 basic_stringstream_wchar_vbase_dtor(this);
13034 if(flags & 1)
13035 MSVCRT_operator_delete(this);
13038 return this;
13041 /* ?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 */
13042 /* ?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 */
13043 /* ?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 */
13044 /* ?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 */
13045 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
13046 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
13048 TRACE("(%p)\n", this);
13049 return (basic_stringbuf_wchar*)&this->strbuf;
13052 /* ?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 */
13053 /* ?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 */
13054 /* ?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 */
13055 /* ?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 */
13056 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
13057 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
13059 TRACE("(%p %p)\n", this, str);
13060 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13063 /* ?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 */
13064 /* ?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 */
13065 /* ?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 */
13066 /* ?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 */
13067 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
13068 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
13070 TRACE("(%p %p)\n", this, ret);
13071 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13074 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
13075 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
13076 #if STREAMSIZE_BITS == 64
13077 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
13078 #else
13079 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
13080 #endif
13081 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
13083 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
13085 this->minsize = 32;
13086 this->endsave = NULL;
13087 this->strmode = mode;
13088 this->palloc = NULL;
13089 this->pfree = NULL;
13091 if(!g) {
13092 this->strmode |= STRSTATE_Dynamic;
13093 if(len > this->minsize)
13094 this->minsize = len;
13095 this->seekhigh = NULL;
13096 return;
13099 if(len < 0)
13100 len = INT_MAX;
13101 else if(!len)
13102 len = strlen(g);
13104 this->seekhigh = g+len;
13105 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
13106 if(p)
13107 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
13110 /* ??0strstreambuf@std@@QAE@PACH0@Z */
13111 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
13112 /* ??0strstreambuf@std@@QAE@PADH0@Z */
13113 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
13114 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
13115 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
13116 #if STREAMSIZE_BITS == 64
13117 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
13118 #else
13119 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
13120 #endif
13121 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
13123 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
13125 basic_streambuf_char_ctor(&this->base);
13126 this->base.vtable = &MSVCP_strstreambuf_vtable;
13128 strstreambuf__Init(this, len, g, p, 0);
13129 return this;
13132 /* ??0strstreambuf@std@@QAE@H@Z */
13133 /* ??0strstreambuf@std@@QEAA@_J@Z */
13134 #if STREAMSIZE_BITS == 64
13135 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 12)
13136 #else
13137 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
13138 #endif
13139 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
13141 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
13144 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
13145 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
13146 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
13147 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(MSVCP_size_t), void (__cdecl *pfree)(void*))
13149 TRACE("(%p %p %p)\n", this, palloc, pfree);
13151 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13152 this->palloc = palloc;
13153 this->pfree = pfree;
13154 return this;
13157 /* ??0strstreambuf@std@@QAE@PBCH@Z */
13158 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
13159 /* ??0strstreambuf@std@@QAE@PBDH@Z */
13160 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
13161 /* ??0strstreambuf@std@@QAE@PBEH@Z */
13162 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
13163 #if STREAMSIZE_BITS == 64
13164 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 16)
13165 #else
13166 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
13167 #endif
13168 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
13170 TRACE("(%p %p %s)\n", this, g, wine_dbgstr_longlong(len));
13172 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
13173 this->strmode |= STRSTATE_Constant;
13174 return this;
13177 /* ??_Fstrstreambuf@std@@QAEXXZ */
13178 /* ??_Fstrstreambuf@std@@QEAAXXZ */
13179 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
13180 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
13182 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13185 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
13186 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
13187 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
13188 void __thiscall strstreambuf__Tidy(strstreambuf *this)
13190 TRACE("(%p)\n", this);
13192 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
13193 if(this->pfree)
13194 this->pfree(basic_streambuf_char_eback(&this->base));
13195 else
13196 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
13199 this->endsave = NULL;
13200 this->seekhigh = NULL;
13201 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
13202 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
13203 basic_streambuf_char_setp(&this->base, NULL, NULL);
13206 /* ??1strstreambuf@std@@UAE@XZ */
13207 /* ??1strstreambuf@std@@UEAA@XZ */
13208 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
13209 void __thiscall strstreambuf_dtor(strstreambuf *this)
13211 TRACE("(%p)\n", this);
13213 strstreambuf__Tidy(this);
13214 basic_streambuf_char_dtor(&this->base);
13217 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
13218 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
13220 TRACE("(%p %x)\n", this, flags);
13221 if(flags & 2) {
13222 /* we have an array, with the number of elements stored before the first object */
13223 INT_PTR i, *ptr = (INT_PTR *)this-1;
13225 for(i=*ptr-1; i>=0; i--)
13226 strstreambuf_dtor(this+i);
13227 MSVCRT_operator_delete(ptr);
13228 } else {
13229 strstreambuf_dtor(this);
13230 if(flags & 1)
13231 MSVCRT_operator_delete(this);
13234 return this;
13237 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
13238 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
13239 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
13240 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
13242 TRACE("(%p %d)\n", this, freeze);
13244 if(!freeze == !(this->strmode *STRSTATE_Frozen))
13245 return;
13247 if(freeze) {
13248 this->strmode |= STRSTATE_Frozen;
13249 this->endsave = basic_streambuf_char_epptr(&this->base);
13250 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13251 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
13252 }else {
13253 this->strmode &= ~STRSTATE_Frozen;
13254 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13255 basic_streambuf_char_pptr(&this->base), this->endsave);
13259 /* ?str@strstreambuf@std@@QAEPADXZ */
13260 /* ?str@strstreambuf@std@@QEAAPEADXZ */
13261 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
13262 char* __thiscall strstreambuf_str(strstreambuf *this)
13264 TRACE("(%p)\n", this);
13266 strstreambuf_freeze(this, TRUE);
13267 return basic_streambuf_char_gptr(&this->base);
13270 /* ?pcount@strstreambuf@std@@QBEHXZ */
13271 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
13272 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
13273 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
13275 char *ppos = basic_streambuf_char_pptr(&this->base);
13277 TRACE("(%p)\n", this);
13279 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
13282 /* ?overflow@strstreambuf@std@@MAEHH@Z */
13283 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
13284 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
13285 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
13287 MSVCP_size_t old_size, size;
13288 char *ptr, *buf;
13290 TRACE("(%p %d)\n", this, c);
13292 if(c == EOF)
13293 return !EOF;
13295 if(this->strmode & STRSTATE_Frozen)
13296 return EOF;
13298 ptr = basic_streambuf_char_pptr(&this->base);
13299 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
13300 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13302 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
13303 return EOF;
13305 ptr = basic_streambuf_char_eback(&this->base);
13306 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
13308 size = old_size + old_size/2;
13309 if(size < this->minsize)
13310 size = this->minsize;
13312 if(this->palloc)
13313 buf = this->palloc(size);
13314 else
13315 buf = MSVCRT_operator_new(size);
13316 if(!buf)
13317 return EOF;
13319 memcpy(buf, ptr, old_size);
13320 if(this->strmode & STRSTATE_Allocated) {
13321 if(this->pfree)
13322 this->pfree(ptr);
13323 else
13324 MSVCRT_operator_delete(ptr);
13327 this->strmode |= STRSTATE_Allocated;
13328 if(!old_size) {
13329 this->seekhigh = buf;
13330 basic_streambuf_char_setp(&this->base, buf, buf+size);
13331 basic_streambuf_char_setg(&this->base, buf, buf, buf);
13332 }else {
13333 this->seekhigh = this->seekhigh-ptr+buf;
13334 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
13335 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
13336 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
13337 basic_streambuf_char_pptr(&this->base));
13340 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13343 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
13344 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
13345 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
13346 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
13348 char *ptr = basic_streambuf_char_gptr(&this->base);
13350 TRACE("(%p %d)\n", this, c);
13352 if(ptr<=basic_streambuf_char_eback(&this->base)
13353 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
13354 return EOF;
13356 basic_streambuf_char_gbump(&this->base, -1);
13357 if(c == EOF)
13358 return !EOF;
13359 if(this->strmode & STRSTATE_Constant)
13360 return (unsigned char)c;
13362 return (unsigned char)(ptr[0] = c);
13365 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
13366 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
13367 #if STREAMOFF_BITS == 64
13368 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
13369 #else
13370 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
13371 #endif
13372 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
13374 char *eback = basic_streambuf_char_eback(&this->base);
13375 char *pptr = basic_streambuf_char_pptr(&this->base);
13376 char *gptr = basic_streambuf_char_gptr(&this->base);
13378 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
13380 ret->off = 0;
13381 ret->state = 0;
13383 if(pptr > this->seekhigh)
13384 this->seekhigh = pptr;
13386 if((mode & OPENMODE_in) && gptr) {
13387 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
13388 off += gptr-eback;
13389 else if(way == SEEKDIR_end)
13390 off += this->seekhigh-eback;
13391 else if(way != SEEKDIR_beg)
13392 off = -1;
13394 if(off<0 || off>this->seekhigh-eback) {
13395 off = -1;
13396 }else {
13397 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
13398 if((mode & OPENMODE_out) && pptr) {
13399 basic_streambuf_char_setp_next(&this->base, eback,
13400 gptr, basic_streambuf_char_epptr(&this->base));
13403 }else if((mode & OPENMODE_out) && pptr) {
13404 if(way == SEEKDIR_cur)
13405 off += pptr-eback;
13406 else if(way == SEEKDIR_end)
13407 off += this->seekhigh-eback;
13408 else if(way != SEEKDIR_beg)
13409 off = -1;
13411 if(off<0 || off>this->seekhigh-eback)
13412 off = -1;
13413 else
13414 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
13415 }else {
13416 off = -1;
13419 ret->pos = off;
13420 return ret;
13423 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
13424 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
13425 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
13426 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
13428 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
13430 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
13431 *ret = pos;
13432 return ret;
13435 return strstreambuf_seekoff(this, ret, pos.off, SEEKDIR_beg, mode);
13438 /* ?underflow@strstreambuf@std@@MAEHXZ */
13439 /* ?underflow@strstreambuf@std@@MEAAHXZ */
13440 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
13441 int __thiscall strstreambuf_underflow(strstreambuf *this)
13443 char *gptr = basic_streambuf_char_gptr(&this->base);
13444 char *pptr;
13446 TRACE("(%p)\n", this);
13448 if(!gptr)
13449 return EOF;
13451 if(gptr < basic_streambuf_char_egptr(&this->base))
13452 return (unsigned char)(*gptr);
13454 pptr = basic_streambuf_char_gptr(&this->base);
13455 if(pptr > this->seekhigh)
13456 this->seekhigh = pptr;
13458 if(this->seekhigh <= gptr)
13459 return EOF;
13461 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
13462 gptr, this->seekhigh);
13463 return (unsigned char)(*gptr);
13466 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
13468 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
13471 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
13473 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
13476 /* ??0ostrstream@std@@QAE@PADHH@Z */
13477 #if STREAMSIZE_BITS == 64
13478 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
13479 #else
13480 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
13481 #endif
13482 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
13484 basic_ios_char *basic_ios;
13486 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13488 if(virt_init) {
13489 this->base.vbtable = ostrstream_vbtable;
13490 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13491 basic_ios_char_ctor(basic_ios);
13492 }else {
13493 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13496 strstreambuf_ctor_get_put(&this->buf, buf, size,
13497 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13498 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, FALSE);
13499 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
13500 return this;
13503 /* ??1ostrstream@std@@UAE@XZ */
13504 /* ??1ostrstream@std@@UEAA@XZ */
13505 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
13506 void __thiscall ostrstream_dtor(basic_ios_char *base)
13508 ostrstream *this = ostrstream_from_basic_ios(base);
13510 TRACE("(%p)\n", this);
13512 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
13513 strstreambuf_dtor(&this->buf);
13516 static void ostrstream_vbase_dtor(ostrstream *this)
13518 TRACE("(%p)\n", this);
13520 ostrstream_dtor(ostrstream_to_basic_ios(this));
13521 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
13524 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
13525 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13527 ostrstream *this = ostrstream_from_basic_ios(base);
13529 TRACE("(%p %x)\n", this, flags);
13531 if(flags & 2) {
13532 /* we have an array, with the number of elements stored before the first object */
13533 INT_PTR i, *ptr = (INT_PTR *)this-1;
13535 for(i=*ptr-1; i>=0; i--)
13536 ostrstream_vbase_dtor(this+i);
13537 MSVCRT_operator_delete(ptr);
13538 } else {
13539 ostrstream_vbase_dtor(this);
13540 if(flags & 1)
13541 MSVCRT_operator_delete(this);
13544 return this;
13547 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
13549 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
13552 /* ??1istrstream@std@@UAE@XZ */
13553 /* ??1istrstream@std@@UEAA@XZ */
13554 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
13555 void __thiscall istrstream_dtor(basic_ios_char *base)
13557 istrstream *this = istrstream_from_basic_ios(base);
13559 TRACE("(%p)\n", this);
13561 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
13562 strstreambuf_dtor(&this->buf);
13565 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
13567 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
13570 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
13572 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
13575 /* ??0strstream@std@@QAE@PADHH@Z */
13576 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
13577 #if STREAMSIZE_BITS == 64
13578 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
13579 #else
13580 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
13581 #endif
13582 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
13584 basic_ios_char *basic_ios;
13586 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13588 if(virt_init) {
13589 this->base.base1.vbtable = strstream_vbtable1;
13590 this->base.base2.vbtable = strstream_vbtable2;
13591 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13592 basic_ios_char_ctor(basic_ios);
13593 }else {
13594 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13597 strstreambuf_ctor_get_put(&this->buf, buf, size,
13598 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13599 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
13600 basic_ios->base.vtable = &MSVCP_strstream_vtable;
13601 return this;
13604 /* ??1strstream@std@@UAE@XZ */
13605 /* ??1strstream@std@@UEAA@XZ */
13606 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
13607 void __thiscall strstream_dtor(basic_ios_char *base)
13609 strstream *this = strstream_from_basic_ios(base);
13611 TRACE("(%p)\n", this);
13613 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13614 strstreambuf_dtor(&this->buf);
13617 static void strstream_vbase_dtor(strstream *this)
13619 TRACE("(%p)\n", this);
13621 strstream_dtor(strstream_to_basic_ios(this));
13622 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
13625 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
13626 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13628 strstream *this = strstream_from_basic_ios(base);
13630 TRACE("(%p %x)\n", this, flags);
13632 if(flags & 2) {
13633 /* we have an array, with the number of elements stored before the first object */
13634 INT_PTR i, *ptr = (INT_PTR *)this-1;
13636 for(i=*ptr-1; i>=0; i--)
13637 strstream_vbase_dtor(this+i);
13638 MSVCRT_operator_delete(ptr);
13639 } else {
13640 strstream_vbase_dtor(this);
13641 if(flags & 1)
13642 MSVCRT_operator_delete(this);
13645 return this;
13648 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
13650 ios_base_precision_set(base, prec);
13653 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
13654 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13655 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
13657 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
13659 ret->pfunc = setprecision_func;
13660 ret->arg = prec;
13661 return ret;
13664 static void __cdecl setw_func(ios_base *base, streamsize width)
13666 ios_base_width_set(base, width);
13669 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
13670 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13671 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
13673 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
13675 ret->pfunc = setw_func;
13676 ret->arg = width;
13677 return ret;
13680 static void __cdecl resetioflags_func(ios_base *base, int mask)
13682 ios_base_setf_mask(base, 0, mask);
13685 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
13686 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
13688 TRACE("(%p %d)\n", ret, mask);
13690 ret->pfunc = resetioflags_func;
13691 ret->arg = mask;
13692 return ret;
13695 static void __cdecl setiosflags_func(ios_base *base, int mask)
13697 ios_base_setf_mask(base, FMTFLAG_mask, mask);
13700 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
13701 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
13703 TRACE("(%p %d)\n", ret, mask);
13705 ret->pfunc = setiosflags_func;
13706 ret->arg = mask;
13707 return ret;
13710 static void __cdecl setbase_func(ios_base *base, int set_base)
13712 if(set_base == 10)
13713 set_base = FMTFLAG_dec;
13714 else if(set_base == 8)
13715 set_base = FMTFLAG_oct;
13716 else if(set_base == 16)
13717 set_base = FMTFLAG_hex;
13718 else
13719 set_base = 0;
13721 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
13724 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
13725 manip_int* __cdecl setbase(manip_int *ret, int base)
13727 TRACE("(%p %d)\n", ret, base);
13729 ret->pfunc = setbase_func;
13730 ret->arg = base;
13731 return ret;
13734 static basic_filebuf_char filebuf_char_stdin;
13735 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
13736 struct {
13737 basic_istream_char obj;
13738 basic_ios_char vbase;
13739 } cin = { { 0 } };
13740 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
13741 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
13742 basic_istream_char *_Ptr_cin = &cin.obj;
13744 static basic_filebuf_wchar filebuf_short_stdin;
13745 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
13746 struct {
13747 basic_istream_wchar obj;
13748 basic_ios_wchar vbase;
13749 } ucin = { { 0 } };
13750 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
13751 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
13752 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
13754 static basic_filebuf_wchar filebuf_wchar_stdin;
13755 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13756 struct {
13757 basic_istream_wchar obj;
13758 basic_ios_wchar vbase;
13759 } wcin = { { 0 } };
13760 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13761 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
13762 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
13764 static basic_filebuf_char filebuf_char_stdout;
13765 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13766 struct {
13767 basic_ostream_char obj;
13768 basic_ios_char vbase;
13769 } cout = { { 0 } };
13770 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13771 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13772 basic_ostream_char *_Ptr_cout = &cout.obj;
13774 static basic_filebuf_wchar filebuf_short_stdout;
13775 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13776 struct {
13777 basic_ostream_wchar obj;
13778 basic_ios_wchar vbase;
13779 } ucout = { { 0 } };
13780 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13781 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13782 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
13784 static basic_filebuf_wchar filebuf_wchar_stdout;
13785 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13786 struct {
13787 basic_ostream_wchar obj;
13788 basic_ios_wchar vbase;
13789 } wcout = { { 0 } };
13790 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13791 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13792 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
13794 static basic_filebuf_char filebuf_char_stderr;
13795 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13796 struct {
13797 basic_ostream_char obj;
13798 basic_ios_char vbase;
13799 } cerr = { { 0 } };
13800 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13801 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13802 basic_ostream_char *_Ptr_cerr = &cerr.obj;
13804 static basic_filebuf_wchar filebuf_short_stderr;
13805 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13806 struct {
13807 basic_ostream_wchar obj;
13808 basic_ios_wchar vbase;
13809 } ucerr = { { 0 } };
13810 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13811 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13812 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
13814 static basic_filebuf_wchar filebuf_wchar_stderr;
13815 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13816 struct {
13817 basic_ostream_wchar obj;
13818 basic_ios_wchar vbase;
13819 } wcerr = { { 0 } };
13820 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13821 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13822 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
13824 static basic_filebuf_char filebuf_char_log;
13825 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13826 struct {
13827 basic_ostream_char obj;
13828 basic_ios_char vbase;
13829 } clog = { { 0 } };
13830 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13831 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13832 basic_ostream_char *_Ptr_clog = &clog.obj;
13834 static basic_filebuf_wchar filebuf_short_log;
13835 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13836 struct {
13837 basic_ostream_wchar obj;
13838 basic_ios_wchar vbase;
13839 } uclog = { { 0 } };
13840 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13841 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13842 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
13844 static basic_filebuf_wchar filebuf_wchar_log;
13845 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13846 struct {
13847 basic_ostream_wchar obj;
13848 basic_ios_wchar vbase;
13849 } wclog = { { 0 } };
13850 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13851 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13852 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
13854 /* ?_Init_cnt@Init@ios_base@std@@0HA */
13855 int ios_base_Init__Init_cnt = -1;
13857 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
13858 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
13859 int* __cdecl ios_base_Init__Init_cnt_func(void)
13861 return &ios_base_Init__Init_cnt;
13864 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
13865 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
13866 void __cdecl ios_base_Init__Init_ctor(void *this)
13868 TRACE("(%p)\n", this);
13870 if(ios_base_Init__Init_cnt < 0)
13871 ios_base_Init__Init_cnt = 1;
13872 else
13873 ios_base_Init__Init_cnt++;
13876 /* ??0Init@ios_base@std@@QAE@XZ */
13877 /* ??0Init@ios_base@std@@QEAA@XZ */
13878 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
13879 void* __thiscall ios_base_Init_ctor(void *this)
13881 ios_base_Init__Init_ctor(this);
13882 return this;
13885 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
13886 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
13887 void __cdecl ios_base_Init__Init_dtor(void *this)
13889 TRACE("(%p)\n", this);
13891 ios_base_Init__Init_cnt--;
13892 if(!ios_base_Init__Init_cnt) {
13893 basic_ostream_char_flush(&cout.obj);
13894 basic_ostream_char_flush(&cerr.obj);
13895 basic_ostream_char_flush(&clog.obj);
13899 /* ??1Init@ios_base@std@@QAE@XZ */
13900 /* ??1Init@ios_base@std@@QEAA@XZ */
13901 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
13902 void __thiscall ios_base_Init_dtor(void *this)
13904 ios_base_Init__Init_dtor(this);
13907 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
13908 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
13909 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
13910 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
13912 TRACE("(%p %p)\n", this, rhs);
13913 return this;
13916 /* ?_Init_cnt@_Winit@std@@0HA */
13917 int _Winit__Init_cnt = -1;
13919 /* ??0_Winit@std@@QAE@XZ */
13920 /* ??0_Winit@std@@QEAA@XZ */
13921 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
13922 void* __thiscall _Winit_ctor(void *this)
13924 TRACE("(%p)\n", this);
13926 if(_Winit__Init_cnt < 0)
13927 _Winit__Init_cnt = 1;
13928 else
13929 _Winit__Init_cnt++;
13931 return this;
13934 /* ??1_Winit@std@@QAE@XZ */
13935 /* ??1_Winit@std@@QAE@XZ */
13936 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
13937 void __thiscall _Winit_dtor(void *this)
13939 TRACE("(%p)\n", this);
13941 _Winit__Init_cnt--;
13942 if(!_Winit__Init_cnt) {
13943 basic_ostream_wchar_flush(&wcout.obj);
13944 basic_ostream_wchar_flush(&wcerr.obj);
13945 basic_ostream_wchar_flush(&wclog.obj);
13949 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
13950 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
13951 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
13952 void* __thiscall _Winit_op_assign(void *this, void *rhs)
13954 TRACE("(%p %p)\n", this, rhs);
13955 return this;
13958 void init_io(void *base)
13960 #ifdef __x86_64__
13961 init_iosb_rtti(base);
13962 init_ios_base_rtti(base);
13963 init_basic_ios_char_rtti(base);
13964 init_basic_ios_wchar_rtti(base);
13965 init_basic_ios_short_rtti(base);
13966 init_basic_streambuf_char_rtti(base);
13967 init_basic_streambuf_wchar_rtti(base);
13968 init_basic_streambuf_short_rtti(base);
13969 init_basic_filebuf_char_rtti(base);
13970 init_basic_filebuf_wchar_rtti(base);
13971 init_basic_filebuf_short_rtti(base);
13972 init_basic_stringbuf_char_rtti(base);
13973 init_basic_stringbuf_wchar_rtti(base);
13974 init_basic_stringbuf_short_rtti(base);
13975 init_basic_ostream_char_rtti(base);
13976 init_basic_ostream_wchar_rtti(base);
13977 init_basic_ostream_short_rtti(base);
13978 init_basic_istream_char_rtti(base);
13979 init_basic_istream_wchar_rtti(base);
13980 init_basic_istream_short_rtti(base);
13981 init_basic_iostream_char_rtti(base);
13982 init_basic_iostream_wchar_rtti(base);
13983 init_basic_iostream_short_rtti(base);
13984 init_basic_ofstream_char_rtti(base);
13985 init_basic_ofstream_wchar_rtti(base);
13986 init_basic_ofstream_short_rtti(base);
13987 init_basic_ifstream_char_rtti(base);
13988 init_basic_ifstream_wchar_rtti(base);
13989 init_basic_ifstream_short_rtti(base);
13990 init_basic_fstream_char_rtti(base);
13991 init_basic_fstream_wchar_rtti(base);
13992 init_basic_fstream_short_rtti(base);
13993 init_basic_ostringstream_char_rtti(base);
13994 init_basic_ostringstream_wchar_rtti(base);
13995 init_basic_ostringstream_short_rtti(base);
13996 init_basic_istringstream_char_rtti(base);
13997 init_basic_istringstream_wchar_rtti(base);
13998 init_basic_istringstream_short_rtti(base);
13999 init_basic_stringstream_char_rtti(base);
14000 init_basic_stringstream_wchar_rtti(base);
14001 init_basic_stringstream_short_rtti(base);
14002 init_strstreambuf_rtti(base);
14003 init_strstream_rtti(base);
14004 init_ostrstream_rtti(base);
14005 #endif
14007 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
14008 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
14010 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
14011 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
14013 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
14014 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
14016 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
14017 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE);
14019 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
14020 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE);
14022 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
14023 basic_ostream_wchar_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE);
14025 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
14026 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE);
14028 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
14029 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE);
14031 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
14032 basic_ostream_wchar_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE);
14034 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
14035 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE);
14037 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
14038 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE);
14040 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
14041 basic_ostream_wchar_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE);
14044 void free_io(void)
14046 basic_istream_char_vbase_dtor(&cin.obj);
14047 basic_filebuf_char_dtor(&filebuf_char_stdin);
14049 basic_istream_wchar_vbase_dtor(&ucin.obj);
14050 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
14052 basic_istream_wchar_vbase_dtor(&wcin.obj);
14053 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
14055 basic_ostream_char_vbase_dtor(&cout.obj);
14056 basic_filebuf_char_dtor(&filebuf_char_stdout);
14058 basic_ostream_wchar_vbase_dtor(&ucout.obj);
14059 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
14061 basic_ostream_wchar_vbase_dtor(&wcout.obj);
14062 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
14064 basic_ostream_char_vbase_dtor(&cerr.obj);
14065 basic_filebuf_char_dtor(&filebuf_char_stderr);
14067 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
14068 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
14070 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
14071 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
14073 basic_ostream_char_vbase_dtor(&clog.obj);
14074 basic_filebuf_char_dtor(&filebuf_char_log);
14076 basic_ostream_wchar_vbase_dtor(&uclog.obj);
14077 basic_filebuf_wchar_dtor(&filebuf_short_log);
14079 basic_ostream_wchar_vbase_dtor(&wclog.obj);
14080 basic_filebuf_wchar_dtor(&filebuf_wchar_log);