msvcrt/tests: Add _strupr tests.
[wine.git] / dlls / msvcp60 / ios.c
blobfea2adee1648ef5dc05edbfdf2150d6880ed54ca
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>
25 #include <locale.h>
27 #include "msvcp.h"
28 #include "windef.h"
29 #include "winbase.h"
30 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
33 /* ?_Index@ios_base@std@@0HA */
34 int ios_base_Index = 0;
35 /* ?_Sync@ios_base@std@@0_NA */
36 MSVCP_bool ios_base_Sync = FALSE;
38 typedef struct {
39 streamoff off;
40 __int64 DECLSPEC_ALIGN(8) pos;
41 int state;
42 } fpos_int;
44 static inline const char* debugstr_fpos_int(fpos_int *fpos)
46 return wine_dbg_sprintf("fpos(%s %s %d)", wine_dbgstr_longlong(fpos->off), wine_dbgstr_longlong(fpos->pos), fpos->state);
49 typedef struct {
50 void (__cdecl *pfunc)(ios_base*, streamsize);
51 streamsize arg;
52 } manip_streamsize;
54 typedef struct {
55 void (__cdecl *pfunc)(ios_base*, int);
56 int arg;
57 } manip_int;
59 typedef enum {
60 INITFL_new = 0,
61 INITFL_open = 1,
62 INITFL_close = 2
63 } basic_filebuf__Initfl;
65 typedef struct {
66 basic_streambuf_char base;
67 codecvt_char *cvt;
68 int state0;
69 int state;
70 basic_string_char *str;
71 MSVCP_bool close;
72 #if _MSVCP_VER <= 70
73 locale loc;
74 #endif
75 FILE *file;
76 } basic_filebuf_char;
78 typedef struct {
79 basic_streambuf_wchar base;
80 codecvt_wchar *cvt;
81 int state0;
82 int state;
83 basic_string_char *str;
84 MSVCP_bool close;
85 #if _MSVCP_VER <= 70
86 locale loc;
87 #endif
88 FILE *file;
89 } basic_filebuf_wchar;
91 typedef enum {
92 STRINGBUF_allocated = 1,
93 STRINGBUF_no_write = 2,
94 STRINGBUF_no_read = 4,
95 STRINGBUF_append = 8,
96 STRINGBUF_at_end = 16
97 } basic_stringbuf_state;
99 typedef struct {
100 basic_streambuf_char base;
101 char *pendsave;
102 char *seekhigh;
103 int alsize;
104 int state;
105 char allocator; /* empty struct */
106 } basic_stringbuf_char;
108 typedef struct {
109 basic_streambuf_wchar base;
110 wchar_t *pendsave;
111 wchar_t *seekhigh;
112 int alsize;
113 int state;
114 char allocator; /* empty struct */
115 } basic_stringbuf_wchar;
117 typedef struct {
118 ios_base base;
119 basic_streambuf_char *strbuf;
120 struct _basic_ostream_char *stream;
121 char fillch;
122 } basic_ios_char;
124 typedef struct {
125 ios_base base;
126 basic_streambuf_wchar *strbuf;
127 struct _basic_ostream_wchar *stream;
128 wchar_t fillch;
129 } basic_ios_wchar;
131 typedef struct _basic_ostream_char {
132 const int *vbtable;
133 /* virtual inheritance
134 * basic_ios_char basic_ios;
136 } basic_ostream_char;
138 typedef struct _basic_ostream_wchar {
139 const int *vbtable;
140 /* virtual inheritance
141 * basic_ios_wchar basic_ios;
143 } basic_ostream_wchar;
145 typedef struct {
146 const int *vbtable;
147 streamsize count;
148 /* virtual inheritance
149 * basic_ios_char basic_ios;
151 } basic_istream_char;
153 typedef struct {
154 const int *vbtable;
155 streamsize count;
156 /* virtual inheritance
157 * basic_ios_wchar basic_ios;
159 } basic_istream_wchar;
161 typedef struct {
162 basic_istream_char base1;
163 basic_ostream_char base2;
164 /* virtual inheritance
165 * basic_ios_char basic_ios;
167 } basic_iostream_char;
169 typedef struct {
170 basic_istream_wchar base1;
171 basic_ostream_wchar base2;
172 /* virtual inheritance
173 * basic_ios_wchar basic_ios;
175 } basic_iostream_wchar;
177 typedef struct {
178 basic_ostream_char base;
179 basic_filebuf_char filebuf;
180 /* virtual inheritance
181 * basic_ios_char basic_ios;
183 } basic_ofstream_char;
185 typedef struct {
186 basic_ostream_wchar base;
187 basic_filebuf_wchar filebuf;
188 /* virtual inheritance
189 * basic_ios_wchar basic_ios;
191 } basic_ofstream_wchar;
193 typedef struct {
194 basic_istream_char base;
195 basic_filebuf_char filebuf;
196 /* virtual inheritance
197 * basic_ios_char basic_ios;
199 } basic_ifstream_char;
201 typedef struct {
202 basic_istream_wchar base;
203 basic_filebuf_wchar filebuf;
204 /* virtual inheritance
205 * basic_ios_wchar basic_ios;
207 } basic_ifstream_wchar;
209 typedef struct {
210 basic_iostream_char base;
211 basic_filebuf_char filebuf;
212 /* virtual inheritance
213 * basic_ios_char basic_ios;
215 } basic_fstream_char;
217 typedef struct {
218 basic_iostream_wchar base;
219 basic_filebuf_wchar filebuf;
220 /* virtual inheritance
221 * basic_ios_char basic_ios;
223 } basic_fstream_wchar;
225 typedef struct {
226 basic_ostream_char base;
227 basic_stringbuf_char strbuf;
228 /* virtual inheritance
229 * basic_ios_char basic_ios;
231 } basic_ostringstream_char;
233 typedef struct {
234 basic_ostream_wchar base;
235 basic_stringbuf_wchar strbuf;
236 /* virtual inheritance
237 * basic_ios_wchar basic_ios;
239 } basic_ostringstream_wchar;
241 typedef struct {
242 basic_istream_char base;
243 basic_stringbuf_char strbuf;
244 /* virtual inheritance
245 * basic_ios_char basic_ios;
247 } basic_istringstream_char;
249 typedef struct {
250 basic_istream_wchar base;
251 basic_stringbuf_wchar strbuf;
252 /* virtual inheritance
253 * basic_ios_wchar basic_ios;
255 } basic_istringstream_wchar;
257 typedef struct {
258 basic_iostream_char base;
259 basic_stringbuf_char strbuf;
260 /* virtual inheritance
261 * basic_ios_char basic_ios;
263 } basic_stringstream_char;
265 typedef struct {
266 basic_iostream_wchar base;
267 basic_stringbuf_wchar strbuf;
268 /* virtual inheritance
269 * basic_ios_wchar basic_ios;
271 } basic_stringstream_wchar;
273 typedef enum {
274 STRSTATE_Allocated = 1,
275 STRSTATE_Constant = 2,
276 STRSTATE_Dynamic = 4,
277 STRSTATE_Frozen = 8
278 } strstreambuf__Strstate;
280 typedef struct {
281 basic_streambuf_char base;
282 char *endsave;
283 char *seekhigh;
284 streamsize minsize;
285 int strmode;
286 void* (__cdecl *palloc)(MSVCP_size_t);
287 void (__cdecl *pfree)(void*);
288 } strstreambuf;
290 typedef struct {
291 basic_ostream_char base;
292 strstreambuf buf;
293 /* virtual inheritance
294 * basic_ios_char basic_ios;
296 } ostrstream;
298 typedef struct {
299 basic_istream_char base;
300 strstreambuf buf;
301 /* virtual inheritance
302 * basic_ios_char basic_ios;
304 } istrstream;
306 typedef struct {
307 basic_iostream_char base;
308 strstreambuf buf;
309 /* virtual inheritance
310 * basic_ios_char basic_ios;
312 } strstream;
314 #if _MSVCP_VER >= 100
315 #define VBTABLE_ALIGN 8
316 #else
317 #define VBTABLE_ALIGN 4
318 #endif
320 extern const vtable_ptr MSVCP_iosb_vtable;
322 /* ??_7ios_base@std@@6B@ */
323 extern const vtable_ptr MSVCP_ios_base_vtable;
325 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
326 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
328 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
329 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
331 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
332 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
334 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
335 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
337 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
338 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
340 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
341 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
343 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
344 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
346 /* ??_7?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@6B@ */
347 extern const vtable_ptr MSVCP_basic_filebuf_wchar_vtable;
349 /* ??_7?$basic_filebuf@GU?$char_traits@G@std@@@std@@6B@ */
350 extern const vtable_ptr MSVCP_basic_filebuf_short_vtable;
352 /* ??_7?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
353 extern const vtable_ptr MSVCP_basic_stringbuf_char_vtable;
355 /* ??_7?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
356 extern const vtable_ptr MSVCP_basic_stringbuf_wchar_vtable;
358 /* ??_7?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
359 extern const vtable_ptr MSVCP_basic_stringbuf_short_vtable;
361 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
362 const int basic_ostream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_char), VBTABLE_ALIGN)};
363 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
364 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
366 /* ??_8?$basic_ostream@_WU?$char_traits@_W@std@@@std@@7B@ */
367 const int basic_ostream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
368 /* ??_7?$basic_ostream@_WU?$char_traits@_W@std@@@std@@6B@ */
369 extern const vtable_ptr MSVCP_basic_ostream_wchar_vtable;
371 /* ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@ */
372 const int basic_ostream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_ostream_wchar), VBTABLE_ALIGN)};
373 /* ??_7?$basic_ostream@GU?$char_traits@G@std@@@std@@6B@ */
374 extern const vtable_ptr MSVCP_basic_ostream_short_vtable;
376 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
377 const int basic_istream_char_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_char), VBTABLE_ALIGN)};
378 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
379 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
381 /* ??_8?$basic_istream@_WU?$char_traits@_W@std@@@std@@7B@ */
382 const int basic_istream_wchar_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
383 /* ??_7?$basic_istream@_WU?$char_traits@_W@std@@@std@@6B@ */
384 extern const vtable_ptr MSVCP_basic_istream_wchar_vtable;
386 /* ??_8?$basic_istream@GU?$char_traits@G@std@@@std@@7B@ */
387 const int basic_istream_short_vbtable[] = {0, ALIGNED_SIZE(sizeof(basic_istream_wchar), VBTABLE_ALIGN)};
388 /* ??_7?$basic_istream@GU?$char_traits@G@std@@@std@@6B@ */
389 extern const vtable_ptr MSVCP_basic_istream_short_vtable;
391 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
392 const int basic_iostream_char_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)};
393 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
394 const int basic_iostream_char_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_char), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_char, base2)};
395 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
396 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
398 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
399 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
400 const int basic_iostream_wchar_vbtable1[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)};
401 /* ??_8?$basic_iostream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
402 /* ??_8?$basic_iostream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
403 const int basic_iostream_wchar_vbtable2[] = {0, ALIGNED_SIZE(sizeof(basic_iostream_wchar), VBTABLE_ALIGN)-FIELD_OFFSET(basic_iostream_wchar, base2)};
404 /* ??_7?$basic_iostream@_WU?$char_traits@_W@std@@@std@@6B@ */
405 extern const vtable_ptr MSVCP_basic_iostream_wchar_vtable;
406 /* ??_7?$basic_iostream@GU?$char_traits@G@std@@@std@@6B@ */
407 extern const vtable_ptr MSVCP_basic_iostream_short_vtable;
409 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
410 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
411 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
412 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
414 /* ??_8?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@7B@ */
415 const int basic_ofstream_wchar_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
416 /* ??_7?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@6B@ */
417 extern const vtable_ptr MSVCP_basic_ofstream_wchar_vtable;
419 /* ??_8?$basic_ofstream@GU?$char_traits@G@std@@@std@@7B@ */
420 const int basic_ofstream_short_vbtable[] = {0, sizeof(basic_ofstream_wchar)};
421 /* ??_7?$basic_ofstream@GU?$char_traits@G@std@@@std@@6B@ */
422 extern const vtable_ptr MSVCP_basic_ofstream_short_vtable;
424 /* ??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
425 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
426 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
427 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
429 /* ??_8?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@7B@ */
430 const int basic_ifstream_wchar_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
431 /* ??_7?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@6B@ */
432 extern const vtable_ptr MSVCP_basic_ifstream_wchar_vtable;
434 /* ??_8?$basic_ifstream@GU?$char_traits@G@std@@@std@@7B@ */
435 const int basic_ifstream_short_vbtable[] = {0, sizeof(basic_ifstream_wchar)};
436 /* ??_7?$basic_ifstream@GU?$char_traits@G@std@@@std@@6B@ */
437 extern const vtable_ptr MSVCP_basic_ifstream_short_vtable;
439 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
440 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
441 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
442 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
443 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
444 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
446 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
447 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
448 const int basic_fstream_wchar_vbtable1[] = {0, sizeof(basic_fstream_wchar)};
449 /* ??_8?$basic_fstream@_WU?$char_traits@_W@std@@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
450 /* ??_8?$basic_fstream@GU?$char_traits@G@std@@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
451 const int basic_fstream_wchar_vbtable2[] = {0, sizeof(basic_fstream_wchar)-FIELD_OFFSET(basic_fstream_wchar, base.base2)};
452 /* ??_7?$basic_fstream@_WU?$char_traits@_W@std@@@std@@6B@ */
453 extern const vtable_ptr MSVCP_basic_fstream_wchar_vtable;
454 /* ??_7?$basic_fstream@GU?$char_traits@G@std@@@std@@6B@ */
455 extern const vtable_ptr MSVCP_basic_fstream_short_vtable;
457 /* ??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
458 const int basic_ostringstream_char_vbtable[] = {0, sizeof(basic_ostringstream_char)};
459 /* ??_7?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
460 extern const vtable_ptr MSVCP_basic_ostringstream_char_vtable;
462 /* ??_8?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
463 const int basic_ostringstream_wchar_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
464 /* ??_7?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
465 extern const vtable_ptr MSVCP_basic_ostringstream_wchar_vtable;
467 /* ??_8?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
468 const int basic_ostringstream_short_vbtable[] = {0, sizeof(basic_ostringstream_wchar)};
469 /* ??_7?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
470 extern const vtable_ptr MSVCP_basic_ostringstream_short_vtable;
472 /* ??_8?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@ */
473 const int basic_istringstream_char_vbtable[] = {0, sizeof(basic_istringstream_char)};
474 /* ??_7?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
475 extern const vtable_ptr MSVCP_basic_istringstream_char_vtable;
477 /* ??_8?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B@ */
478 const int basic_istringstream_wchar_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
479 /* ??_7?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
480 extern const vtable_ptr MSVCP_basic_istringstream_wchar_vtable;
482 /* ??_8?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B@ */
483 const int basic_istringstream_short_vbtable[] = {0, sizeof(basic_istringstream_wchar)};
484 /* ??_7?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
485 extern const vtable_ptr MSVCP_basic_istringstream_short_vtable;
487 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
488 const int basic_stringstream_char_vbtable1[] = {0, sizeof(basic_stringstream_char)};
489 /* ??_8?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
490 const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_char)-FIELD_OFFSET(basic_stringstream_char, base.base2)};
491 /* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
492 extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
494 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
495 const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
496 /* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
497 const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
498 /* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
499 extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
501 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_istream@GU?$char_traits@G@std@@@1@@ */
502 const int basic_stringstream_short_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
503 /* ??_8?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@7B?$basic_ostream@GU?$char_traits@G@std@@@1@@ */
504 const int basic_stringstream_short_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
505 /* ??_7?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@6B@ */
506 extern const vtable_ptr MSVCP_basic_stringstream_short_vtable;
508 /* ??_7strstreambuf@std@@6B */
509 extern const vtable_ptr MSVCP_strstreambuf_vtable;
511 static const int ostrstream_vbtable[] = {0, sizeof(ostrstream)};
512 extern const vtable_ptr MSVCP_ostrstream_vtable;
514 static const int istrstream_vbtable[] = {0, sizeof(istrstream)};
516 static const int strstream_vbtable1[] = {0, sizeof(strstream)};
517 static const int strstream_vbtable2[] = {0, sizeof(strstream)-FIELD_OFFSET(strstream, base.base2)};
518 extern const vtable_ptr MSVCP_strstream_vtable;
520 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@")
521 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@")
522 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
523 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@")
524 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
525 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@")
526 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
527 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@")
528 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
529 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@")
530 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
531 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@")
532 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
533 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@")
534 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
535 ".?AV?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@")
536 DEFINE_RTTI_DATA1(basic_filebuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
537 ".?AV?$basic_filebuf@GU?$char_traits@G@std@@@std@@")
538 DEFINE_RTTI_DATA1(basic_filebuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
539 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@")
540 DEFINE_RTTI_DATA1(basic_stringbuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
541 ".?AV?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
542 DEFINE_RTTI_DATA1(basic_stringbuf_wchar, 0, &basic_streambuf_wchar_rtti_base_descriptor,
543 ".?AV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
544 DEFINE_RTTI_DATA1(basic_stringbuf_short, 0, &basic_streambuf_short_rtti_base_descriptor,
545 ".?AV?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
546 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
547 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
548 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@")
549 DEFINE_RTTI_DATA3(basic_ostream_wchar, sizeof(basic_ostream_wchar), &basic_ios_wchar_rtti_base_descriptor,
550 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
551 ".?AV?$basic_ostream@_WU?$char_traits@_W@std@@@std@@")
552 DEFINE_RTTI_DATA3(basic_ostream_short, sizeof(basic_ostream_wchar), &basic_ios_short_rtti_base_descriptor,
553 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
554 ".?AV?$basic_ostream@GU?$char_traits@G@std@@@std@@")
555 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
556 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
557 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@")
558 DEFINE_RTTI_DATA3(basic_istream_wchar, sizeof(basic_istream_wchar), &basic_ios_wchar_rtti_base_descriptor,
559 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
560 ".?AV?$basic_istream@_WU?$char_traits@_W@std@@@std@@")
561 DEFINE_RTTI_DATA3(basic_istream_short, sizeof(basic_istream_wchar), &basic_ios_short_rtti_base_descriptor,
562 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
563 ".?AV?$basic_istream@GU?$char_traits@G@std@@@std@@")
564 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
565 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
566 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
567 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
568 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
569 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@")
570 DEFINE_RTTI_DATA8(basic_iostream_wchar, sizeof(basic_iostream_wchar),
571 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
572 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
573 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
574 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
575 ".?AV?$basic_iostream@_WU?$char_traits@_W@std@@@std@@")
576 DEFINE_RTTI_DATA8(basic_iostream_short, sizeof(basic_iostream_wchar),
577 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
578 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
579 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
580 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
581 ".?AV?$basic_iostream@GU?$char_traits@G@std@@@std@@")
582 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
583 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
584 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
585 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@")
586 DEFINE_RTTI_DATA4(basic_ofstream_wchar, sizeof(basic_ofstream_wchar),
587 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
588 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
589 ".?AV?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@")
590 DEFINE_RTTI_DATA4(basic_ofstream_short, sizeof(basic_ofstream_wchar),
591 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
592 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
593 ".?AV?$basic_ofstream@GU?$char_traits@G@std@@@std@@")
594 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
595 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
596 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
597 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@")
598 DEFINE_RTTI_DATA4(basic_ifstream_wchar, sizeof(basic_ifstream_wchar),
599 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
600 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
601 ".?AV?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@")
602 DEFINE_RTTI_DATA4(basic_ifstream_short, sizeof(basic_ifstream_wchar),
603 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
604 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
605 ".?AV?$basic_ifstream@GU?$char_traits@G@std@@@std@@")
606 DEFINE_RTTI_DATA8(basic_fstream_char, sizeof(basic_fstream_char),
607 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
608 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
609 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
610 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
611 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@")
612 DEFINE_RTTI_DATA8(basic_fstream_wchar, sizeof(basic_fstream_wchar),
613 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
614 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
615 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
616 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
617 ".?AV?$basic_fstream@_WU?$char_traits@_W@std@@@std@@")
618 DEFINE_RTTI_DATA8(basic_fstream_short, sizeof(basic_fstream_wchar),
619 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
620 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
621 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
622 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
623 ".?AV?$basic_fstream@GU?$char_traits@G@std@@@std@@")
624 DEFINE_RTTI_DATA4(basic_ostringstream_char, sizeof(basic_ostringstream_char),
625 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
626 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
627 ".?AV?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
628 DEFINE_RTTI_DATA4(basic_ostringstream_wchar, sizeof(basic_ostringstream_wchar),
629 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
630 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
631 ".?AV?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
632 DEFINE_RTTI_DATA4(basic_ostringstream_short, sizeof(basic_ostringstream_wchar),
633 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
634 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
635 ".?AV?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
636 DEFINE_RTTI_DATA4(basic_istringstream_char, sizeof(basic_istringstream_char),
637 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
638 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
639 ".?AV?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
640 DEFINE_RTTI_DATA4(basic_istringstream_wchar, sizeof(basic_istringstream_wchar),
641 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
642 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
643 ".?AV?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
644 DEFINE_RTTI_DATA4(basic_istringstream_short, sizeof(basic_istringstream_wchar),
645 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
646 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
647 ".?AV?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
648 DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
649 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
650 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
651 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
652 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
653 ".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@")
654 DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
655 &basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
656 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
657 &basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
658 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
659 ".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@")
660 DEFINE_RTTI_DATA8(basic_stringstream_short, sizeof(basic_stringstream_wchar),
661 &basic_istream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
662 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
663 &basic_ostream_short_rtti_base_descriptor, &basic_ios_short_rtti_base_descriptor,
664 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
665 ".?AV?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@")
666 DEFINE_RTTI_DATA1(strstreambuf, sizeof(strstreambuf),
667 &basic_streambuf_char_rtti_base_descriptor, ".?AVstrstreambuf@std@@")
668 DEFINE_RTTI_DATA4(ostrstream, sizeof(ostrstream),
669 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
670 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
671 "?AVostrstream@std@@")
672 DEFINE_RTTI_DATA8(strstream, sizeof(strstream),
673 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
674 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
675 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
676 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
677 "?AVstrstream@std@@")
679 #ifndef __GNUC__
680 void __asm_dummy_vtables(void) {
681 #endif
682 __ASM_VTABLE(iosb,
683 VTABLE_ADD_FUNC(iosb_vector_dtor));
684 __ASM_VTABLE(ios_base,
685 VTABLE_ADD_FUNC(ios_base_vector_dtor));
686 __ASM_VTABLE(basic_ios_char,
687 VTABLE_ADD_FUNC(basic_ios_char_vector_dtor));
688 __ASM_VTABLE(basic_ios_wchar,
689 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
690 __ASM_VTABLE(basic_ios_short,
691 VTABLE_ADD_FUNC(basic_ios_wchar_vector_dtor));
692 __ASM_VTABLE(basic_streambuf_char,
693 VTABLE_ADD_FUNC(basic_streambuf_char_vector_dtor)
694 #if _MSVCP_VER >= 100
695 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
696 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
697 #endif
698 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
699 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
700 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
701 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
702 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
703 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
704 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
705 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
706 #endif
707 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
708 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
709 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
710 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
711 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
712 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
713 __ASM_VTABLE(basic_streambuf_wchar,
714 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
715 #if _MSVCP_VER >= 100
716 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
717 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
718 #endif
719 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
720 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
721 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
722 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
723 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
724 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
725 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
726 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
727 #endif
728 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
729 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
730 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
731 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
732 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
733 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
734 __ASM_VTABLE(basic_streambuf_short,
735 VTABLE_ADD_FUNC(basic_streambuf_wchar_vector_dtor)
736 #if _MSVCP_VER >= 100
737 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
738 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
739 #endif
740 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
741 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
742 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
743 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
744 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
745 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
746 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
747 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
748 #endif
749 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
750 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
751 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
752 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
753 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
754 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
755 __ASM_VTABLE(basic_filebuf_char,
756 VTABLE_ADD_FUNC(basic_filebuf_char_vector_dtor)
757 #if _MSVCP_VER >= 100
758 VTABLE_ADD_FUNC(basic_streambuf_char__Lock)
759 VTABLE_ADD_FUNC(basic_streambuf_char__Unlock)
760 #endif
761 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
762 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
763 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
764 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
765 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
766 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
767 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
768 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
769 #endif
770 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
771 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
772 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
773 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
774 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
775 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
776 __ASM_VTABLE(basic_filebuf_wchar,
777 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
778 #if _MSVCP_VER >= 100
779 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
780 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
781 #endif
782 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
783 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
784 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
785 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
786 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
787 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
788 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
789 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
790 #endif
791 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
792 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
793 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
794 VTABLE_ADD_FUNC(basic_filebuf_wchar_setbuf)
795 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
796 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
797 __ASM_VTABLE(basic_filebuf_short,
798 VTABLE_ADD_FUNC(basic_filebuf_wchar_vector_dtor)
799 #if _MSVCP_VER >= 100
800 VTABLE_ADD_FUNC(basic_streambuf_wchar__Lock)
801 VTABLE_ADD_FUNC(basic_streambuf_wchar__Unlock)
802 #endif
803 VTABLE_ADD_FUNC(basic_filebuf_wchar_overflow)
804 VTABLE_ADD_FUNC(basic_filebuf_wchar_pbackfail)
805 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
806 VTABLE_ADD_FUNC(basic_filebuf_wchar_underflow)
807 VTABLE_ADD_FUNC(basic_filebuf_wchar_uflow)
808 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
809 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
810 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
811 #endif
812 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
813 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekoff)
814 VTABLE_ADD_FUNC(basic_filebuf_wchar_seekpos)
815 VTABLE_ADD_FUNC(basic_filebuf_short_setbuf)
816 VTABLE_ADD_FUNC(basic_filebuf_wchar_sync)
817 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
818 __ASM_VTABLE(basic_stringbuf_char,
819 VTABLE_ADD_FUNC(basic_stringbuf_char_vector_dtor)
820 VTABLE_ADD_FUNC(basic_stringbuf_char_overflow)
821 VTABLE_ADD_FUNC(basic_stringbuf_char_pbackfail)
822 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
823 VTABLE_ADD_FUNC(basic_stringbuf_char_underflow)
824 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
825 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
826 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
827 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
828 #endif
829 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
830 VTABLE_ADD_FUNC(basic_stringbuf_char_seekoff)
831 VTABLE_ADD_FUNC(basic_stringbuf_char_seekpos)
832 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
833 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
834 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
835 __ASM_VTABLE(basic_stringbuf_wchar,
836 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
837 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
838 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
839 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
840 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
841 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
842 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
843 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
844 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
845 #endif
846 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
847 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
848 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
849 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
850 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
851 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
852 __ASM_VTABLE(basic_stringbuf_short,
853 VTABLE_ADD_FUNC(basic_stringbuf_wchar_vector_dtor)
854 VTABLE_ADD_FUNC(basic_stringbuf_wchar_overflow)
855 VTABLE_ADD_FUNC(basic_stringbuf_wchar_pbackfail)
856 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
857 VTABLE_ADD_FUNC(basic_stringbuf_wchar_underflow)
858 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
859 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
860 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
861 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
862 #endif
863 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
864 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekoff)
865 VTABLE_ADD_FUNC(basic_stringbuf_wchar_seekpos)
866 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
867 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
868 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
869 __ASM_VTABLE(basic_ostream_char,
870 VTABLE_ADD_FUNC(basic_ostream_char_vector_dtor));
871 __ASM_VTABLE(basic_ostream_wchar,
872 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
873 __ASM_VTABLE(basic_ostream_short,
874 VTABLE_ADD_FUNC(basic_ostream_wchar_vector_dtor));
875 __ASM_VTABLE(basic_istream_char,
876 VTABLE_ADD_FUNC(basic_istream_char_vector_dtor));
877 __ASM_VTABLE(basic_istream_wchar,
878 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
879 __ASM_VTABLE(basic_istream_short,
880 VTABLE_ADD_FUNC(basic_istream_wchar_vector_dtor));
881 __ASM_VTABLE(basic_iostream_char,
882 VTABLE_ADD_FUNC(basic_iostream_char_vector_dtor));
883 __ASM_VTABLE(basic_iostream_wchar,
884 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
885 __ASM_VTABLE(basic_iostream_short,
886 VTABLE_ADD_FUNC(basic_iostream_wchar_vector_dtor));
887 __ASM_VTABLE(basic_ofstream_char,
888 VTABLE_ADD_FUNC(basic_ofstream_char_vector_dtor));
889 __ASM_VTABLE(basic_ofstream_wchar,
890 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
891 __ASM_VTABLE(basic_ofstream_short,
892 VTABLE_ADD_FUNC(basic_ofstream_wchar_vector_dtor));
893 __ASM_VTABLE(basic_ifstream_char,
894 VTABLE_ADD_FUNC(basic_ifstream_char_vector_dtor));
895 __ASM_VTABLE(basic_ifstream_wchar,
896 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
897 __ASM_VTABLE(basic_ifstream_short,
898 VTABLE_ADD_FUNC(basic_ifstream_wchar_vector_dtor));
899 __ASM_VTABLE(basic_fstream_char,
900 VTABLE_ADD_FUNC(basic_fstream_char_vector_dtor));
901 __ASM_VTABLE(basic_fstream_wchar,
902 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
903 __ASM_VTABLE(basic_fstream_short,
904 VTABLE_ADD_FUNC(basic_fstream_wchar_vector_dtor));
905 __ASM_VTABLE(basic_ostringstream_char,
906 VTABLE_ADD_FUNC(basic_ostringstream_char_vector_dtor));
907 __ASM_VTABLE(basic_ostringstream_wchar,
908 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
909 __ASM_VTABLE(basic_ostringstream_short,
910 VTABLE_ADD_FUNC(basic_ostringstream_wchar_vector_dtor));
911 __ASM_VTABLE(basic_istringstream_char,
912 VTABLE_ADD_FUNC(basic_istringstream_char_vector_dtor));
913 __ASM_VTABLE(basic_istringstream_wchar,
914 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
915 __ASM_VTABLE(basic_istringstream_short,
916 VTABLE_ADD_FUNC(basic_istringstream_wchar_vector_dtor));
917 __ASM_VTABLE(basic_stringstream_char,
918 VTABLE_ADD_FUNC(basic_stringstream_char_vector_dtor));
919 __ASM_VTABLE(basic_stringstream_wchar,
920 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
921 __ASM_VTABLE(basic_stringstream_short,
922 VTABLE_ADD_FUNC(basic_stringstream_wchar_vector_dtor));
923 __ASM_VTABLE(strstreambuf,
924 VTABLE_ADD_FUNC(strstreambuf_vector_dtor)
925 VTABLE_ADD_FUNC(strstreambuf_overflow)
926 VTABLE_ADD_FUNC(strstreambuf_pbackfail)
927 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
928 VTABLE_ADD_FUNC(strstreambuf_underflow)
929 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
930 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
931 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
932 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
933 #endif
934 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
935 VTABLE_ADD_FUNC(strstreambuf_seekoff)
936 VTABLE_ADD_FUNC(strstreambuf_seekpos)
937 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
938 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
939 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
940 __ASM_VTABLE(ostrstream,
941 VTABLE_ADD_FUNC(ostrstream_vector_dtor));
942 __ASM_VTABLE(strstream,
943 VTABLE_ADD_FUNC(strstream_vector_dtor));
944 #ifndef __GNUC__
946 #endif
948 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
949 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
950 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
951 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
953 TRACE("(%p %p %p %p)\n", this, first, next, last);
955 this->wbuf = first;
956 this->wpos = next;
957 this->wsize = last-next;
960 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
961 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
962 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
963 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
965 basic_streambuf_char_setp_next(this, first, first, last);
968 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
969 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
970 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
971 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
973 TRACE("(%p %p %p %p)\n", this, first, next, last);
975 this->rbuf = first;
976 this->rpos = next;
977 this->rsize = last-next;
980 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
981 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
982 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
983 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
985 TRACE("(%p)\n", this);
987 this->prbuf = &this->rbuf;
988 this->pwbuf = &this->wbuf;
989 this->prpos = &this->rpos;
990 this->pwpos = &this->wpos;
991 this->prsize = &this->rsize;
992 this->pwsize = &this->wsize;
994 basic_streambuf_char_setp(this, NULL, NULL);
995 basic_streambuf_char_setg(this, NULL, NULL, NULL);
998 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
999 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1000 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
1001 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
1003 TRACE("(%p %d)\n", this, uninitialized);
1004 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1005 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1006 mutex_ctor(&this->lock);
1007 #endif
1008 return this;
1011 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
1012 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
1013 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
1014 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
1016 TRACE("(%p)\n", this);
1018 this->vtable = &MSVCP_basic_streambuf_char_vtable;
1019 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1020 mutex_ctor(&this->lock);
1021 #endif
1022 #if _MSVCP_VER >= 70
1023 this->loc = MSVCRT_operator_new(sizeof(locale));
1024 #endif
1025 locale_ctor(IOS_LOCALE(this));
1026 basic_streambuf_char__Init_empty(this);
1028 return this;
1031 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
1032 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1033 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
1034 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
1036 TRACE("(%p)\n", this);
1038 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1039 mutex_dtor(&this->lock);
1040 #endif
1041 locale_dtor(IOS_LOCALE(this));
1042 #if _MSVCP_VER >= 70
1043 MSVCRT_operator_delete(this->loc);
1044 #endif
1047 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_vector_dtor, 8)
1048 basic_streambuf_char* __thiscall basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
1050 TRACE("(%p %x)\n", this, flags);
1051 if(flags & 2) {
1052 /* we have an array, with the number of elements stored before the first object */
1053 INT_PTR i, *ptr = (INT_PTR *)this-1;
1055 for(i=*ptr-1; i>=0; i--)
1056 basic_streambuf_char_dtor(this+i);
1057 MSVCRT_operator_delete(ptr);
1058 } else {
1059 basic_streambuf_char_dtor(this);
1060 if(flags & 1)
1061 MSVCRT_operator_delete(this);
1064 return this;
1067 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1068 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1069 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
1070 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
1072 TRACE("(%p)\n", this);
1073 return *this->prpos ? *this->prsize : 0;
1076 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1077 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1078 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
1079 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
1081 TRACE("(%p)\n", this);
1082 (*this->prsize)++;
1083 (*this->prpos)--;
1084 return *this->prpos;
1087 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1088 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1089 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1090 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1092 TRACE("(%p)\n", this);
1093 (*this->prsize)--;
1094 return (*this->prpos)++;
1097 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1098 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1099 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1100 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1102 TRACE("(%p)\n", this);
1103 (*this->prsize)--;
1104 (*this->prpos)++;
1105 return *this->prpos;
1108 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1109 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1110 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1111 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1113 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1115 this->prbuf = gf;
1116 this->pwbuf = pf;
1117 this->prpos = gn;
1118 this->pwpos = pn;
1119 this->prsize = gc;
1120 this->pwsize = pc;
1123 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1124 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1125 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1126 #if _MSVCP_VER >= 100
1127 #define call_basic_streambuf_char__Lock(this) CALL_VTBL_FUNC(this, 4, void, (basic_streambuf_char*), (this))
1128 #else
1129 #define call_basic_streambuf_char__Lock(this) basic_streambuf_char__Lock(this)
1130 #endif
1131 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1133 TRACE("(%p)\n", this);
1134 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1135 mutex_lock(&this->lock);
1136 #endif
1139 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1140 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1141 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1142 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1144 TRACE("(%p)\n", this);
1145 return *this->pwpos ? *this->pwsize : 0;
1148 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1149 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1150 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1151 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1153 TRACE("(%p)\n", this);
1154 (*this->pwsize)--;
1155 return (*this->pwpos)++;
1158 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1159 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1160 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1161 #if _MSVCP_VER >= 100
1162 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 24, int, (basic_streambuf_char*), (this))
1163 #else
1164 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*), (this))
1165 #endif
1166 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1168 TRACE("(%p)\n", this);
1169 return EOF;
1172 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1173 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1174 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1175 #if _MSVCP_VER >= 100
1176 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 28, int, (basic_streambuf_char*), (this))
1177 #else
1178 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, int, (basic_streambuf_char*), (this))
1179 #endif
1180 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1182 int ret;
1184 TRACE("(%p)\n", this);
1186 if(call_basic_streambuf_char_underflow(this)==EOF)
1187 return EOF;
1189 ret = (unsigned char)**this->prpos;
1190 (*this->prsize)--;
1191 (*this->prpos)++;
1192 return ret;
1195 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1196 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1197 #if STREAMSIZE_BITS == 64
1198 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 20)
1199 #else
1200 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1201 #endif
1202 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1203 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1204 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1205 #else
1206 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) basic_streambuf_char__Xsgetn_s(this, ptr, size, count)
1207 #endif
1208 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1210 streamsize copied, chunk;
1211 int c;
1213 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1215 for(copied=0; copied<count && size;) {
1216 chunk = basic_streambuf_char__Gnavail(this);
1217 if(chunk > count-copied)
1218 chunk = count-copied;
1220 if(chunk > 0) {
1221 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1222 *this->prpos += chunk;
1223 *this->prsize -= chunk;
1224 copied += chunk;
1225 size -= chunk;
1226 }else if((c = call_basic_streambuf_char_uflow(this)) != EOF) {
1227 ptr[copied] = c;
1228 copied++;
1229 size--;
1230 }else {
1231 break;
1235 return copied;
1238 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1239 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1240 #if STREAMSIZE_BITS == 64
1241 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 20)
1242 #else
1243 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1244 #endif
1245 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1247 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
1248 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
1251 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1252 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1253 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1254 #if _MSVCP_VER >= 100
1255 #define call_basic_streambuf_char__Unlock(this) CALL_VTBL_FUNC(this, 8, void, (basic_streambuf_char*), (this))
1256 #else
1257 #define call_basic_streambuf_char__Unlock(this) basic_streambuf_char__Unlock(this)
1258 #endif
1259 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1261 TRACE("(%p)\n", this);
1262 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1263 mutex_unlock(&this->lock);
1264 #endif
1267 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1268 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1269 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1270 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1272 TRACE("(%p)\n", this);
1273 return *this->prbuf;
1276 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1277 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1278 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1279 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1281 TRACE("(%p)\n", this);
1282 return *this->prpos;
1285 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1286 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1287 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1288 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1290 TRACE("(%p)\n", this);
1291 return *this->prpos+*this->prsize;
1294 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1295 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1296 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1297 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1299 TRACE("(%p)\n", this);
1300 return *this->pwpos+*this->pwsize;
1303 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1304 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1305 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1306 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1308 TRACE("(%p %d)\n", this, off);
1309 *this->prpos += off;
1310 *this->prsize -= off;
1313 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@XZ */
1314 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1315 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@XZ */
1316 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1317 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
1318 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
1320 TRACE("(%p)\n", this);
1321 return locale_copy_ctor(ret, IOS_LOCALE(this));
1324 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1325 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1326 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1327 #if _MSVCP_VER >= 100
1328 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_char*, const locale*), (this, loc))
1329 #elif _MSVCP_VER >= 80
1330 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_char*, const locale*), (this, loc))
1331 #else
1332 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_char*, const locale*), (this, loc))
1333 #endif
1334 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1336 TRACE("(%p %p)\n", this, loc);
1339 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1340 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1341 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1342 #if _MSVCP_VER >= 100
1343 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 12, int, (basic_streambuf_char*, int), (this, ch))
1344 #else
1345 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, int, (basic_streambuf_char*, int), (this, ch))
1346 #endif
1347 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1349 TRACE("(%p %d)\n", this, ch);
1350 return EOF;
1353 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1354 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1355 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1356 #if _MSVCP_VER >= 100
1357 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, int, (basic_streambuf_char*, int), (this, ch))
1358 #else
1359 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, int, (basic_streambuf_char*, int), (this, ch))
1360 #endif
1361 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1363 TRACE("(%p %d)\n", this, ch);
1364 return EOF;
1367 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1368 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1369 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1370 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1372 TRACE("(%p)\n", this);
1373 return *this->pwbuf;
1376 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1377 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1378 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1379 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1381 TRACE("(%p %d)\n", this, off);
1382 *this->pwpos += off;
1383 *this->pwsize -= off;
1386 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1387 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1388 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1389 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1391 TRACE("(%p)\n", this);
1392 return *this->pwpos;
1395 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1396 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1397 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
1398 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
1400 TRACE("(%p %p)\n", this, loc);
1401 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
1402 call_basic_streambuf_char_imbue(this, loc);
1403 locale_copy_ctor(IOS_LOCALE(this), loc);
1404 return ret;
1407 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1408 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1409 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1410 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1411 #if STREAMOFF_BITS == 64
1412 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 24)
1413 #else
1414 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
1415 #endif
1416 #if _MSVCP_VER >= 100
1417 #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))
1418 #elif _MSVCP_VER >= 80
1419 #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))
1420 #else
1421 #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))
1422 #endif
1423 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
1424 fpos_int *ret, streamoff off, int way, int mode)
1426 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1427 ret->off = -1;
1428 ret->pos = 0;
1429 ret->state = 0;
1430 return ret;
1433 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1434 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1435 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
1436 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
1437 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
1438 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
1439 #if STREAMOFF_BITS == 64
1440 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 24)
1441 #else
1442 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
1443 #endif
1444 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
1445 fpos_int *ret, streamoff off, int way, int mode)
1447 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1448 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
1451 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1452 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1453 #if STREAMOFF_BITS == 64
1454 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 24)
1455 #else
1456 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
1457 #endif
1458 fpos_int* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
1459 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
1461 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
1462 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
1465 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1466 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1467 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
1468 #if _MSVCP_VER >= 100
1469 #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))
1470 #elif _MSVCP_VER >= 80
1471 #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))
1472 #else
1473 #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))
1474 #endif
1475 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
1476 fpos_int *ret, fpos_int pos, int mode)
1478 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1479 ret->off = -1;
1480 ret->pos = 0;
1481 ret->state = 0;
1482 return ret;
1485 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1486 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1487 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
1488 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
1489 fpos_int *ret, fpos_int pos, int mode)
1491 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1492 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
1495 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1496 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1497 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
1498 fpos_int* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
1499 fpos_int *ret, fpos_int pos, unsigned int mode)
1501 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1502 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
1505 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1506 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1507 #if STREAMSIZE_BITS == 64
1508 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 16)
1509 #else
1510 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1511 #endif
1512 #if _MSVCP_VER >= 100
1513 #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))
1514 #elif _MSVCP_VER >= 80
1515 #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))
1516 #else
1517 #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))
1518 #endif
1519 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1521 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1522 return this;
1525 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1526 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1527 #if STREAMSIZE_BITS == 64
1528 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 16)
1529 #else
1530 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1531 #endif
1532 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1534 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
1535 return call_basic_streambuf_char_setbuf(this, buf, count);
1538 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1539 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1540 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1541 #if _MSVCP_VER >= 100
1542 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_char*), (this))
1543 #elif _MSVCP_VER >= 80
1544 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_char*), (this))
1545 #else
1546 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_char*), (this))
1547 #endif
1548 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1550 TRACE("(%p)\n", this);
1551 return 0;
1554 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1555 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1556 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1557 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1559 TRACE("(%p)\n", this);
1560 return call_basic_streambuf_char_sync(this);
1563 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1564 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1565 #if STREAMSIZE_BITS == 64
1566 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 16)
1567 #else
1568 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1569 #endif
1570 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1572 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1573 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1576 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1577 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1578 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1579 #if _MSVCP_VER >= 100
1580 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_char*), (this))
1581 #else
1582 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_char*), (this))
1583 #endif
1584 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1586 TRACE("(%p)\n", this);
1587 return 0;
1590 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1591 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1592 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1593 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1595 streamsize ret;
1597 TRACE("(%p)\n", this);
1599 ret = basic_streambuf_char__Gnavail(this);
1600 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
1603 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1604 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1605 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1606 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1608 TRACE("(%p %d)\n", this, ch);
1609 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1610 (*this->prsize)++;
1611 (*this->prpos)--;
1612 return (unsigned char)ch;
1615 return call_basic_streambuf_char_pbackfail(this, (unsigned char)ch);
1618 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1619 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1620 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1621 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1623 TRACE("(%p %d)\n", this, ch);
1624 return basic_streambuf_char__Pnavail(this) ?
1625 (unsigned char)(*basic_streambuf_char__Pninc(this) = ch) :
1626 call_basic_streambuf_char_overflow(this, (unsigned char)ch);
1629 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1630 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1631 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1632 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1634 TRACE("(%p)\n", this);
1635 if(*this->prpos && *this->prpos>*this->prbuf) {
1636 (*this->prsize)++;
1637 (*this->prpos)--;
1638 return (unsigned char)**this->prpos;
1641 return call_basic_streambuf_char_pbackfail(this, EOF);
1644 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1645 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1646 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1647 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1649 TRACE("(%p)\n", this);
1650 if(basic_streambuf_char__Gnavail(this))
1651 basic_streambuf_char__Gninc(this);
1652 else
1653 call_basic_streambuf_char_uflow(this);
1656 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1657 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1658 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1659 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1661 TRACE("(%p)\n", this);
1662 return basic_streambuf_char__Gnavail(this) ?
1663 (int)(unsigned char)*basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1666 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1667 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1668 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1669 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1671 TRACE("(%p)\n", this);
1672 return basic_streambuf_char__Gnavail(this) ?
1673 (int)(unsigned char)*basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1676 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1677 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1678 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1679 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1681 TRACE("(%p)\n", this);
1683 if(basic_streambuf_char__Gnavail(this) > 1)
1684 return (unsigned char)*basic_streambuf_char__Gnpreinc(this);
1685 return basic_streambuf_char_sbumpc(this)==EOF ?
1686 EOF : basic_streambuf_char_sgetc(this);
1689 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1690 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1691 #if STREAMSIZE_BITS == 64
1692 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 16)
1693 #else
1694 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1695 #endif
1696 #if _MSVCP_VER >= 100
1697 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1698 #else
1699 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1700 #endif
1701 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1703 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1704 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1707 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1708 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1709 #if STREAMSIZE_BITS == 64
1710 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 16)
1711 #else
1712 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1713 #endif
1714 #if _MSVCP_VER >= 100
1715 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 36, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1716 #elif _MSVCP_VER >= 80
1717 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1718 #else
1719 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 28, streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1720 #endif
1721 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1723 streamsize copied, chunk;
1725 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1727 for(copied=0; copied<count;) {
1728 chunk = basic_streambuf_char__Pnavail(this);
1729 if(chunk > count-copied)
1730 chunk = count-copied;
1732 if(chunk > 0) {
1733 memcpy(*this->pwpos, ptr+copied, chunk);
1734 *this->pwpos += chunk;
1735 *this->pwsize -= chunk;
1736 copied += chunk;
1737 }else if(call_basic_streambuf_char_overflow(this, (unsigned char)ptr[copied]) != EOF) {
1738 copied++;
1739 }else {
1740 break;
1744 return copied;
1747 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1748 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1749 #if STREAMSIZE_BITS == 64
1750 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 16)
1751 #else
1752 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1753 #endif
1754 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1756 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
1757 return call_basic_streambuf_char_xsputn(this, ptr, count);
1760 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
1761 /* ?swap@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
1762 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8)
1763 void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r)
1765 basic_streambuf_char tmp;
1767 TRACE("(%p %p)\n", this, r);
1769 if(this == r)
1770 return;
1772 tmp = *this;
1773 *this = *r;
1774 this->vtable = tmp.vtable;
1775 tmp.vtable = r->vtable;
1776 *r = tmp;
1779 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1780 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1781 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1782 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1783 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1784 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1786 TRACE("(%p %p %p %p)\n", this, first, next, last);
1788 this->wbuf = first;
1789 this->wpos = next;
1790 this->wsize = last-next;
1793 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1794 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1795 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1796 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1797 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1798 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1800 basic_streambuf_wchar_setp_next(this, first, first, last);
1803 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1804 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1805 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1806 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1807 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1808 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1810 TRACE("(%p %p %p %p)\n", this, first, next, last);
1812 this->rbuf = first;
1813 this->rpos = next;
1814 this->rsize = last-next;
1817 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1818 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1819 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1820 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1821 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1822 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1824 TRACE("(%p)\n", this);
1826 this->prbuf = &this->rbuf;
1827 this->pwbuf = &this->wbuf;
1828 this->prpos = &this->rpos;
1829 this->pwpos = &this->wpos;
1830 this->prsize = &this->rsize;
1831 this->pwsize = &this->wsize;
1833 basic_streambuf_wchar_setp(this, NULL, NULL);
1834 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1837 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1838 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1839 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
1840 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1842 TRACE("(%p %d)\n", this, uninitialized);
1843 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1844 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1845 mutex_ctor(&this->lock);
1846 #endif
1847 return this;
1850 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1851 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1852 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1853 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1855 TRACE("(%p %d)\n", this, uninitialized);
1856 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1857 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1858 return this;
1861 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1862 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1863 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
1864 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1866 TRACE("(%p)\n", this);
1868 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1869 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1870 mutex_ctor(&this->lock);
1871 #endif
1872 #if _MSVCP_VER >= 70
1873 this->loc = MSVCRT_operator_new(sizeof(locale));
1874 #endif
1875 locale_ctor(IOS_LOCALE(this));
1876 basic_streambuf_wchar__Init_empty(this);
1878 return this;
1881 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1882 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1883 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1884 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1886 TRACE("(%p)\n", this);
1887 basic_streambuf_wchar_ctor(this);
1888 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1889 return this;
1892 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1893 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1894 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1895 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1896 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1897 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1899 TRACE("(%p)\n", this);
1901 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
1902 mutex_dtor(&this->lock);
1903 #endif
1904 locale_dtor(IOS_LOCALE(this));
1905 #if _MSVCP_VER >= 70
1906 MSVCRT_operator_delete(this->loc);
1907 #endif
1910 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_vector_dtor, 8)
1911 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1913 TRACE("(%p %x)\n", this, flags);
1914 if(flags & 2) {
1915 /* we have an array, with the number of elements stored before the first object */
1916 INT_PTR i, *ptr = (INT_PTR *)this-1;
1918 for(i=*ptr-1; i>=0; i--)
1919 basic_streambuf_wchar_dtor(this+i);
1920 MSVCRT_operator_delete(ptr);
1921 } else {
1922 basic_streambuf_wchar_dtor(this);
1923 if(flags & 1)
1924 MSVCRT_operator_delete(this);
1927 return this;
1930 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1931 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1932 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1933 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1934 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
1935 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1937 TRACE("(%p)\n", this);
1938 return *this->prpos ? *this->prsize : 0;
1941 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1942 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1943 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1944 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1945 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1946 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1948 TRACE("(%p)\n", this);
1949 (*this->prsize)++;
1950 (*this->prpos)--;
1951 return *this->prpos;
1954 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1955 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1956 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1957 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1958 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1959 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1961 TRACE("(%p)\n", this);
1962 (*this->prsize)--;
1963 return (*this->prpos)++;
1966 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1967 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1968 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1969 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1970 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
1971 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1973 TRACE("(%p)\n", this);
1974 (*this->prsize)--;
1975 (*this->prpos)++;
1976 return *this->prpos;
1979 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1980 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1981 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1982 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1983 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1984 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)
1986 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1988 this->prbuf = gf;
1989 this->pwbuf = pf;
1990 this->prpos = gn;
1991 this->pwpos = pn;
1992 this->prsize = gc;
1993 this->pwsize = pc;
1996 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1997 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1998 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1999 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2000 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
2001 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
2003 TRACE("(%p)\n", this);
2004 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2005 mutex_lock(&this->lock);
2006 #endif
2009 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
2010 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
2011 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
2012 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
2013 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
2014 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
2016 TRACE("(%p)\n", this);
2017 return *this->pwpos ? *this->pwsize : 0;
2020 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
2021 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
2022 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
2023 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
2024 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
2025 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
2027 TRACE("(%p)\n", this);
2028 (*this->pwsize)--;
2029 return (*this->pwpos)++;
2032 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2033 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2034 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2035 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2036 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
2037 #if _MSVCP_VER >= 100
2038 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 24, unsigned short, (basic_streambuf_wchar*), (this))
2039 #else
2040 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*), (this))
2041 #endif
2042 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
2044 TRACE("(%p)\n", this);
2045 return WEOF;
2048 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
2049 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
2050 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
2051 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
2052 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
2053 #if _MSVCP_VER >= 100
2054 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 28, unsigned short, (basic_streambuf_wchar*), (this))
2055 #else
2056 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, unsigned short, (basic_streambuf_wchar*), (this))
2057 #endif
2058 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
2060 int ret;
2062 TRACE("(%p)\n", this);
2064 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
2065 return WEOF;
2067 ret = **this->prpos;
2068 (*this->prsize)--;
2069 (*this->prpos)++;
2070 return ret;
2073 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
2074 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
2075 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
2076 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
2077 #if STREAMSIZE_BITS == 64
2078 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 20)
2079 #else
2080 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
2081 #endif
2082 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2083 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
2084 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
2085 #else
2086 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count)
2087 #endif
2088 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2090 streamsize copied, chunk;
2091 unsigned short c;
2093 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2095 for(copied=0; copied<count && size;) {
2096 chunk = basic_streambuf_wchar__Gnavail(this);
2097 if(chunk > count-copied)
2098 chunk = count-copied;
2100 if(chunk > 0) {
2101 memcpy_s(ptr+copied, size, *this->prpos, chunk*sizeof(wchar_t));
2102 *this->prpos += chunk;
2103 *this->prsize -= chunk;
2104 copied += chunk;
2105 size -= chunk*sizeof(wchar_t);
2106 }else if((c = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
2107 ptr[copied] = c;
2108 copied++;
2109 size--;
2110 }else {
2111 break;
2115 return copied;
2118 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
2119 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
2120 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
2121 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
2122 #if STREAMSIZE_BITS == 64
2123 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 20)
2124 #else
2125 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
2126 #endif
2127 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
2129 TRACE("(%p %p %lu %s)\n", this, ptr, size, wine_dbgstr_longlong(count));
2130 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
2133 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2134 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2135 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2136 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2137 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
2138 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
2140 TRACE("(%p)\n", this);
2141 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
2142 mutex_unlock(&this->lock);
2143 #endif
2146 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2147 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2148 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2149 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2150 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
2151 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
2153 TRACE("(%p)\n", this);
2154 return *this->prbuf;
2157 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2158 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2159 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2160 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2161 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
2162 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
2164 TRACE("(%p)\n", this);
2165 return *this->prpos;
2168 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2169 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2170 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2171 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2172 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
2173 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
2175 TRACE("(%p)\n", this);
2176 return *this->prpos+*this->prsize;
2179 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2180 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2181 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2182 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2183 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
2184 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
2186 TRACE("(%p)\n", this);
2187 return *this->pwpos+*this->pwsize;
2190 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2191 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2192 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2193 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2194 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
2195 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
2197 TRACE("(%p %d)\n", this, off);
2198 *this->prpos += off;
2199 *this->prsize -= off;
2202 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
2203 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
2204 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
2205 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
2206 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
2207 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
2209 TRACE("(%p)\n", this);
2210 return locale_copy_ctor(ret, IOS_LOCALE(this));
2213 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
2214 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
2215 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
2216 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
2217 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
2218 #if _MSVCP_VER >= 100
2219 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 56, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2220 #elif _MSVCP_VER >= 80
2221 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2222 #else
2223 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 48, void, (basic_streambuf_wchar*, const locale*), (this, loc))
2224 #endif
2225 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
2227 TRACE("(%p %p)\n", this, loc);
2230 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2231 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2232 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2233 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2234 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
2235 #if _MSVCP_VER >= 100
2236 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 12, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2237 #else
2238 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2239 #endif
2240 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
2242 TRACE("(%p %d)\n", this, ch);
2243 return WEOF;
2246 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
2247 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
2248 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
2249 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
2250 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
2251 #if _MSVCP_VER >= 100
2252 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 16, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2253 #else
2254 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
2255 #endif
2256 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
2258 TRACE("(%p %d)\n", this, ch);
2259 return WEOF;
2262 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2263 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2264 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2265 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2266 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
2267 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
2269 TRACE("(%p)\n", this);
2270 return *this->pwbuf;
2273 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
2274 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
2275 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
2276 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
2277 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
2278 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
2280 TRACE("(%p %d)\n", this, off);
2281 *this->pwpos += off;
2282 *this->pwsize -= off;
2285 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
2286 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
2287 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
2288 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
2289 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
2290 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
2292 TRACE("(%p)\n", this);
2293 return *this->pwpos;
2296 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2297 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2298 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
2299 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
2300 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
2301 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
2303 TRACE("(%p %p)\n", this, loc);
2304 memcpy(ret, IOS_LOCALE(this), sizeof(locale));
2305 call_basic_streambuf_wchar_imbue(this, loc);
2306 locale_copy_ctor(IOS_LOCALE(this), loc);
2307 return ret;
2310 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2311 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
2312 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2313 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2314 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2315 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2316 #if STREAMOFF_BITS == 64
2317 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 24)
2318 #else
2319 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
2320 #endif
2321 #if _MSVCP_VER >= 100
2322 #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))
2323 #elif _MSVCP_VER >= 80
2324 #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))
2325 #else
2326 #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))
2327 #endif
2328 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
2329 fpos_int *ret, streamoff off, int way, int mode)
2331 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2332 ret->off = -1;
2333 ret->pos = 0;
2334 ret->state = 0;
2335 return ret;
2338 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2339 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2340 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
2341 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
2342 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JFF@Z */
2343 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JFF@Z */
2344 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
2345 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JW4seekdir@ioos_base@2@H@Z */
2346 #if STREAMOFF_BITS == 64
2347 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 24)
2348 #else
2349 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
2350 #endif
2351 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
2352 fpos_int *ret, streamoff off, int way, int mode)
2354 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2355 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
2358 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2359 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2360 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
2361 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
2362 #if STREAMOFF_BITS == 64
2363 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 24)
2364 #else
2365 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
2366 #endif
2367 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
2368 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
2370 TRACE("(%p %s %d %d)\n", this, wine_dbgstr_longlong(off), way, mode);
2371 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
2374 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2375 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2376 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2377 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2378 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
2379 #if _MSVCP_VER >= 100
2380 #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))
2381 #elif _MSVCP_VER >= 80
2382 #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))
2383 #else
2384 #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))
2385 #endif
2386 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
2387 fpos_int *ret, fpos_int pos, int mode)
2389 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2390 ret->off = -1;
2391 ret->pos = 0;
2392 ret->state = 0;
2393 return ret;
2396 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2397 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2398 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
2399 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
2400 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
2401 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
2402 fpos_int *ret, fpos_int pos, int mode)
2404 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2405 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
2408 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2409 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2410 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
2411 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
2412 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
2413 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
2414 fpos_int *ret, fpos_int pos, unsigned int mode)
2416 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
2417 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
2420 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
2421 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
2422 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
2423 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
2424 #if STREAMSIZE_BITS == 64
2425 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 16)
2426 #else
2427 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
2428 #endif
2429 #if _MSVCP_VER >= 100
2430 #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))
2431 #elif _MSVCP_VER >= 80
2432 #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))
2433 #else
2434 #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))
2435 #endif
2436 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2438 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2439 return this;
2442 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
2443 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
2444 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
2445 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
2446 #if STREAMSIZE_BITS == 64
2447 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 16)
2448 #else
2449 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
2450 #endif
2451 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
2453 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
2454 return call_basic_streambuf_wchar_setbuf(this, buf, count);
2457 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2458 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
2459 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2460 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
2461 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
2462 #if _MSVCP_VER >= 100
2463 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 52, int, (basic_streambuf_wchar*), (this))
2464 #elif _MSVCP_VER >= 80
2465 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, int, (basic_streambuf_wchar*), (this))
2466 #else
2467 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 44, int, (basic_streambuf_wchar*), (this))
2468 #endif
2469 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
2471 TRACE("(%p)\n", this);
2472 return 0;
2475 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2476 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
2477 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2478 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
2479 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
2480 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
2482 TRACE("(%p)\n", this);
2483 return call_basic_streambuf_wchar_sync(this);
2486 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
2487 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
2488 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
2489 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
2490 #if STREAMSIZE_BITS == 64
2491 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 16)
2492 #else
2493 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
2494 #endif
2495 #if _MSVCP_VER >= 100
2496 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 32, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2497 #else
2498 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
2499 #endif
2500 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2502 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2503 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
2506 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
2507 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
2508 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
2509 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
2510 #if STREAMSIZE_BITS == 64
2511 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 16)
2512 #else
2513 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
2514 #endif
2515 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
2517 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2518 return call_basic_streambuf_wchar_xsgetn(this, ptr, count);
2521 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
2522 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
2523 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
2524 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
2525 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
2526 #if _MSVCP_VER >= 100
2527 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 20, streamsize, (basic_streambuf_wchar*), (this))
2528 #else
2529 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, streamsize, (basic_streambuf_wchar*), (this))
2530 #endif
2531 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
2533 TRACE("(%p)\n", this);
2534 return 0;
2537 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
2538 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
2539 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
2540 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
2541 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
2542 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
2544 streamsize ret;
2546 TRACE("(%p)\n", this);
2548 ret = basic_streambuf_wchar__Gnavail(this);
2549 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
2552 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2553 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2554 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2555 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
2556 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
2557 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
2559 TRACE("(%p %d)\n", this, ch);
2560 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
2561 (*this->prsize)++;
2562 (*this->prpos)--;
2563 return ch;
2566 return call_basic_streambuf_wchar_pbackfail(this, ch);
2569 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
2570 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
2571 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
2572 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
2573 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
2574 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
2576 TRACE("(%p %d)\n", this, ch);
2577 return basic_streambuf_wchar__Pnavail(this) ?
2578 (*basic_streambuf_wchar__Pninc(this) = ch) :
2579 call_basic_streambuf_wchar_overflow(this, ch);
2582 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2583 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2584 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2585 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2586 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
2587 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
2589 TRACE("(%p)\n", this);
2590 if(*this->prpos && *this->prpos>*this->prbuf) {
2591 (*this->prsize)++;
2592 (*this->prpos)--;
2593 return **this->prpos;
2596 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
2599 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
2600 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
2601 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
2602 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
2603 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
2604 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
2606 TRACE("(%p)\n", this);
2607 if(basic_streambuf_wchar__Gnavail(this))
2608 basic_streambuf_wchar__Gninc(this);
2609 else
2610 call_basic_streambuf_wchar_uflow(this);
2613 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2614 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2615 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2616 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2617 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
2618 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
2620 TRACE("(%p)\n", this);
2621 return basic_streambuf_wchar__Gnavail(this) ?
2622 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
2625 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2626 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2627 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2628 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2629 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
2630 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
2632 TRACE("(%p)\n", this);
2633 return basic_streambuf_wchar__Gnavail(this) ?
2634 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
2637 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
2638 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
2639 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
2640 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
2641 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
2642 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
2644 TRACE("(%p)\n", this);
2646 if(basic_streambuf_wchar__Gnavail(this) > 1)
2647 return *basic_streambuf_wchar__Gnpreinc(this);
2648 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
2649 WEOF : basic_streambuf_wchar_sgetc(this);
2652 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
2653 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
2654 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
2655 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
2656 #if STREAMSIZE_BITS == 64
2657 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 16)
2658 #else
2659 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
2660 #endif
2661 #if _MSVCP_VER >= 100
2662 #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))
2663 #elif _MSVCP_VER >= 80
2664 #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))
2665 #else
2666 #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))
2667 #endif
2668 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2670 streamsize copied, chunk;
2672 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2674 for(copied=0; copied<count;) {
2675 chunk = basic_streambuf_wchar__Pnavail(this);
2676 if(chunk > count-copied)
2677 chunk = count-copied;
2679 if(chunk > 0) {
2680 memcpy(*this->pwpos, ptr+copied, chunk*sizeof(wchar_t));
2681 *this->pwpos += chunk;
2682 *this->pwsize -= chunk;
2683 copied += chunk;
2684 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
2685 copied++;
2686 }else {
2687 break;
2691 return copied;
2694 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
2695 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
2696 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
2697 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
2698 #if STREAMSIZE_BITS == 64
2699 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 16)
2700 #else
2701 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
2702 #endif
2703 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
2705 TRACE("(%p %p %s)\n", this, ptr, wine_dbgstr_longlong(count));
2706 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
2709 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
2710 /* ?swap@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
2711 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2712 /* ?swap@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
2713 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8)
2714 void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r)
2716 basic_streambuf_wchar tmp;
2718 TRACE("(%p %p)\n", this, r);
2720 if(this == r)
2721 return;
2723 tmp = *this;
2724 *this = *r;
2725 this->vtable = tmp.vtable;
2726 tmp.vtable = r->vtable;
2727 *r = tmp;
2730 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
2731 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
2732 int basic_filebuf_char__Init__Stinit = 0;
2734 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
2735 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
2736 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
2737 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
2739 TRACE("(%p %p %d)\n", this, file, which);
2741 this->cvt = NULL;
2742 this->state0 = basic_filebuf_char__Init__Stinit;
2743 this->state = basic_filebuf_char__Init__Stinit;
2744 if(which == INITFL_new)
2745 this->str = NULL;
2746 this->close = (which == INITFL_open);
2747 this->file = file;
2749 basic_streambuf_char__Init_empty(&this->base);
2750 if(file)
2751 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
2752 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
2755 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
2756 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
2757 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt_cvt, 8)
2758 void __thiscall basic_filebuf_char__Initcvt_cvt(basic_filebuf_char *this, codecvt_char *cvt)
2760 TRACE("(%p %p)\n", this, cvt);
2762 if(codecvt_base_always_noconv(&cvt->base)) {
2763 this->cvt = NULL;
2764 }else {
2765 this->str = MSVCRT_operator_new(sizeof(basic_string_char));
2766 MSVCP_basic_string_char_ctor(this->str);
2767 this->cvt = cvt;
2771 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
2772 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
2773 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 4)
2774 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this)
2776 codecvt_char *cvt = codecvt_char_use_facet(IOS_LOCALE(&this->base));
2778 TRACE("(%p)\n", this);
2780 locale__Addfac(&this->loc, &cvt->base.facet, codecvt_char_id.id, LC_CTYPE);
2781 basic_filebuf_char__Initcvt_cvt( this, cvt );
2784 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2785 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2786 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2787 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2789 basic_filebuf_char *ret = this;
2791 TRACE("(%p)\n", this);
2793 if(!this->file || fclose(this->file))
2794 return NULL;
2796 basic_filebuf_char__Init(this, NULL, INITFL_close);
2797 return ret;
2800 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2801 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2802 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2803 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2805 TRACE("(%p %p)\n", this, file);
2807 basic_streambuf_char_ctor(&this->base);
2808 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2810 locale_ctor(&this->loc);
2811 basic_filebuf_char__Init(this, file, INITFL_new);
2812 return this;
2815 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2816 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2817 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2818 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2820 return basic_filebuf_char_ctor_file(this, NULL);
2823 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2824 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2825 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2826 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2828 TRACE("(%p %d)\n", this, uninitialized);
2830 basic_streambuf_char_ctor_uninitialized(&this->base, 0);
2831 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2832 locale_ctor(&this->loc);
2833 return this;
2836 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2837 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2838 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2839 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2841 TRACE("(%p)\n", this);
2843 if(this->close)
2844 basic_filebuf_char_close(this);
2845 if(this->str) {
2846 MSVCP_basic_string_char_dtor(this->str);
2847 MSVCRT_operator_delete(this->str);
2849 locale_dtor(&this->loc);
2850 basic_streambuf_char_dtor(&this->base);
2853 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_vector_dtor, 8)
2854 basic_filebuf_char* __thiscall basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2856 TRACE("(%p %x)\n", this, flags);
2857 if(flags & 2) {
2858 /* we have an array, with the number of elements stored before the first object */
2859 INT_PTR i, *ptr = (INT_PTR *)this-1;
2861 for(i=*ptr-1; i>=0; i--)
2862 basic_filebuf_char_dtor(this+i);
2863 MSVCRT_operator_delete(ptr);
2864 } else {
2865 basic_filebuf_char_dtor(this);
2866 if(flags & 1)
2867 MSVCRT_operator_delete(this);
2870 return this;
2873 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2874 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2875 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2876 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2878 TRACE("(%p)\n", this);
2879 return this->file != NULL;
2882 /* ?_Fiopen@std@@YAPAU_iobuf@@PB_WHH@Z */
2883 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEB_WHH@Z */
2884 FILE* __cdecl _Fiopen_wchar(const wchar_t *name, int mode, int prot)
2886 static const wchar_t rW[] = {'r',0};
2887 static const struct {
2888 int mode;
2889 const wchar_t str[4];
2890 const wchar_t str_bin[4];
2891 } str_mode[] = {
2892 {OPENMODE_out, {'w',0}, {'w','b',0}},
2893 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
2894 {OPENMODE_app, {'a',0}, {'a','b',0}},
2895 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
2896 {OPENMODE_in, {'r',0}, {'r','b',0}},
2897 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
2898 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
2899 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
2900 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
2903 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2904 size_t mode_idx;
2905 FILE *f = NULL;
2907 TRACE("(%s %d %d)\n", debugstr_w(name), mode, prot);
2909 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
2910 if(str_mode[mode_idx].mode == real_mode)
2911 break;
2912 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
2913 return NULL;
2915 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
2916 return NULL;
2917 else if(f)
2918 fclose(f);
2920 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2921 && (f = _wfopen(name, rW))) {
2922 fclose(f);
2923 return NULL;
2926 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2927 : str_mode[mode_idx].str, prot);
2928 if(!f)
2929 return NULL;
2931 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2932 fclose(f);
2933 return NULL;
2936 return f;
2939 /* ?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z */
2940 /* ?_Fiopen@std@@YAPEAU_iobuf@@PEBDHH@Z */
2941 FILE* __cdecl _Fiopen(const char *name, int mode, int prot)
2943 wchar_t nameW[FILENAME_MAX];
2945 TRACE("(%s %d %d)\n", name, mode, prot);
2947 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2948 return NULL;
2949 return _Fiopen_wchar(nameW, mode, prot);
2952 /* ?__Fiopen@std@@YAPAU_iobuf@@PBDH@Z */
2953 /* ?__Fiopen@std@@YAPEAU_iobuf@@PEBDH@Z */
2954 FILE* __cdecl ___Fiopen(const char *name, int mode)
2956 TRACE("(%p %d)\n", name, mode);
2957 return _Fiopen(name, mode, _SH_DENYNO);
2960 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2961 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2962 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2963 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2964 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
2965 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2967 FILE *f = NULL;
2969 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2971 if(basic_filebuf_char_is_open(this))
2972 return NULL;
2974 if(!(f = _Fiopen_wchar(name, mode, prot)))
2975 return NULL;
2977 basic_filebuf_char__Init(this, f, INITFL_open);
2978 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(IOS_LOCALE(&this->base)));
2979 return this;
2982 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
2983 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
2984 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
2985 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
2986 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
2987 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
2989 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
2992 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2993 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2994 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
2995 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2997 wchar_t nameW[FILENAME_MAX];
2999 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3001 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3002 return NULL;
3003 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
3006 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDF@Z */
3007 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDF@Z */
3008 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode_old, 12)
3009 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode_old(basic_filebuf_char *this, const char *name, short mode)
3011 TRACE("(%p %p %d)\n", this, name, mode);
3012 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3015 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDH@Z */
3016 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDH@Z */
3017 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
3018 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
3019 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
3020 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
3022 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
3025 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3026 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3027 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
3028 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
3030 char *ptr, ch = c, *to_next;
3031 const char *from_next;
3032 int ret;
3035 TRACE("(%p %d)\n", this, c);
3037 if(!basic_filebuf_char_is_open(this))
3038 return EOF;
3039 if(c == EOF)
3040 return !c;
3042 if(!this->cvt)
3043 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3045 from_next = &ch;
3046 MSVCP_basic_string_char_clear(this->str);
3047 MSVCP_basic_string_char_append_len_ch(this->str, 8, '\0');
3048 ptr = this->str->ptr;
3049 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1, &from_next,
3050 ptr, ptr+MSVCP_basic_string_char_length(this->str), &to_next);
3052 switch(ret) {
3053 case CODECVT_partial:
3054 if(from_next == &ch)
3055 return EOF;
3056 case CODECVT_ok:
3057 if(!fwrite(ptr, to_next-ptr, 1, this->file))
3058 return EOF;
3059 return c;
3060 case CODECVT_noconv:
3061 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
3062 default:
3063 return EOF;
3067 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
3068 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
3069 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
3070 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
3072 TRACE("(%p %d)\n", this, c);
3074 if(!basic_filebuf_char_is_open(this))
3075 return EOF;
3077 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
3078 && (c==EOF || (int)(unsigned char)basic_streambuf_char_gptr(&this->base)[-1]==c)) {
3079 basic_streambuf_char__Gndec(&this->base);
3080 return c==EOF ? !c : c;
3081 }else if(c == EOF) {
3082 return EOF;
3083 }else if(!this->cvt) {
3084 return ungetc(c, this->file);
3085 }else if(MSVCP_basic_string_char_length(this->str)) {
3086 char *b, *e, *cur;
3088 e = this->str->ptr;
3089 b = e+this->str->size-1;
3090 for(cur = b; cur>=e; cur--) {
3091 if(ungetc(*cur, this->file) == EOF) {
3092 for(; cur<=b; cur++)
3093 fgetc(this->file);
3094 return EOF;
3097 MSVCP_basic_string_char_clear(this->str);
3098 this->state = this->state0;
3099 return c;
3102 return EOF;
3105 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3106 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3107 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
3108 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
3110 char ch, *to_next;
3111 const char *buf_next;
3112 int c;
3114 TRACE("(%p)\n", this);
3116 if(!basic_filebuf_char_is_open(this))
3117 return EOF;
3119 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3120 return (unsigned char)*basic_streambuf_char__Gninc(&this->base);
3122 c = fgetc(this->file);
3123 if(!this->cvt || c==EOF)
3124 return c;
3126 MSVCP_basic_string_char_clear(this->str);
3127 this->state0 = this->state;
3128 while(1) {
3129 MSVCP_basic_string_char_append_ch(this->str, c);
3130 this->state = this->state0;
3132 switch(codecvt_char_in(this->cvt, &this->state, this->str->ptr,
3133 this->str->ptr+this->str->size, &buf_next, &ch, &ch+1, &to_next)) {
3134 case CODECVT_partial:
3135 break;
3136 case CODECVT_noconv:
3137 return (unsigned char)this->str->ptr[0];
3138 case CODECVT_ok:
3139 return (unsigned char)ch;
3140 default:
3141 return EOF;
3144 c = fgetc(this->file);
3145 if(c == EOF)
3146 return EOF;
3150 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3151 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3152 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
3153 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
3155 int ret;
3157 TRACE("(%p)\n", this);
3159 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
3160 return (unsigned char)*basic_streambuf_char_gptr(&this->base);
3162 ret = call_basic_streambuf_char_uflow(&this->base);
3163 if(ret != EOF)
3164 ret = call_basic_streambuf_char_pbackfail(&this->base, ret);
3165 return ret;
3168 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3169 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3170 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3171 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3172 #if STREAMOFF_BITS == 64
3173 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 24)
3174 #else
3175 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
3176 #endif
3177 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
3178 fpos_int *ret, streamoff off, int way, int mode)
3180 fpos_t pos;
3182 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3184 if(!basic_filebuf_char_is_open(this) || fseek(this->file, off, way)) {
3185 ret->off = -1;
3186 ret->pos = 0;
3187 ret->state = 0;
3188 return ret;
3191 fgetpos(this->file, &pos);
3192 ret->off = 0;
3193 ret->pos = pos;
3194 ret->state = this->state;
3195 return ret;
3198 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3199 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3200 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
3201 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
3202 fpos_int *ret, fpos_int pos, int mode)
3204 fpos_t fpos;
3206 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3208 if(!basic_filebuf_char_is_open(this) || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3209 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3210 ret->off = -1;
3211 ret->pos = 0;
3212 ret->state = 0;
3213 return ret;
3216 fgetpos(this->file, &fpos);
3217 ret->off = 0;
3218 ret->pos = fpos;
3219 ret->state = this->state;
3220 return ret;
3223 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
3224 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
3225 #if STREAMSIZE_BITS == 64
3226 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 16)
3227 #else
3228 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
3229 #endif
3230 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
3232 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3234 if(!basic_filebuf_char_is_open(this))
3235 return NULL;
3237 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
3238 return NULL;
3240 basic_filebuf_char__Init(this, this->file, INITFL_open);
3241 return &this->base;
3244 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
3245 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
3246 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
3247 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
3249 TRACE("(%p)\n", this);
3251 if(!basic_filebuf_char_is_open(this))
3252 return 0;
3254 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
3255 return 0;
3256 return fflush(this->file);
3259 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
3260 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
3261 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
3262 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
3264 TRACE("(%p %p)\n", this, loc);
3265 basic_filebuf_char__Initcvt_cvt(this, codecvt_char_use_facet(loc));
3268 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3269 /* ?_Stinit@?1??_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3270 int basic_filebuf_wchar__Init__Stinit = 0;
3272 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
3273 /* ?_Stinit@?1??_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
3274 int basic_filebuf_short__Init__Stinit = 0;
3276 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3277 /* ?_Init@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3278 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Init, 12)
3279 void __thiscall basic_filebuf_wchar__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3281 TRACE("(%p %p %d)\n", this, file, which);
3283 this->cvt = NULL;
3284 this->state0 = basic_filebuf_short__Init__Stinit;
3285 this->state = basic_filebuf_short__Init__Stinit;
3286 if(which == INITFL_new)
3287 this->str = NULL;
3288 this->close = (which == INITFL_open);
3289 this->file = file;
3291 basic_streambuf_wchar__Init_empty(&this->base);
3294 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
3295 /* ?_Init@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
3296 DEFINE_THISCALL_WRAPPER(basic_filebuf_short__Init, 12)
3297 void __thiscall basic_filebuf_short__Init(basic_filebuf_wchar *this, FILE *file, basic_filebuf__Initfl which)
3299 TRACE("(%p %p %d)\n", this, file, which);
3301 this->cvt = NULL;
3302 this->state0 = basic_filebuf_short__Init__Stinit;
3303 this->state = basic_filebuf_short__Init__Stinit;
3304 if(which == INITFL_new)
3305 this->str = NULL;
3306 this->close = (which == INITFL_open);
3307 this->file = file;
3309 basic_streambuf_wchar__Init_empty(&this->base);
3312 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$codecvt@_WDH@2@@Z */
3313 /* ?_Initcvt@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$codecvt@_WDH@2@@Z */
3314 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXPAV?$codecvt@GDH@2@@Z */
3315 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$codecvt@GDH@2@@Z */
3316 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt_cvt, 8)
3317 void __thiscall basic_filebuf_wchar__Initcvt_cvt(basic_filebuf_wchar *this, codecvt_wchar *cvt)
3319 TRACE("(%p %p)\n", this, cvt);
3321 if(codecvt_base_always_noconv(&cvt->base)) {
3322 this->cvt = NULL;
3323 }else {
3324 basic_streambuf_wchar__Init_empty(&this->base);
3325 this->cvt = cvt;
3329 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
3330 /* ?_Initcvt@?$basic_filebuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
3331 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar__Initcvt, 4)
3332 void __thiscall basic_filebuf_wchar__Initcvt(basic_filebuf_wchar *this)
3334 codecvt_wchar *cvt = codecvt_wchar_use_facet(IOS_LOCALE(&this->base));
3335 basic_filebuf_wchar__Initcvt_cvt( this, cvt );
3338 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@XZ */
3339 /* ?close@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@XZ */
3340 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@XZ */
3341 /* ?close@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@XZ */
3342 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_close, 4)
3343 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_close(basic_filebuf_wchar *this)
3345 basic_filebuf_wchar *ret = this;
3347 TRACE("(%p)\n", this);
3349 if(!this->file || fclose(this->file))
3350 return NULL;
3352 basic_filebuf_wchar__Init(this, NULL, INITFL_close);
3353 return ret;
3356 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
3357 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3358 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_file, 8)
3359 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_file(basic_filebuf_wchar *this, FILE *file)
3361 TRACE("(%p %p)\n", this, file);
3363 basic_streambuf_wchar_ctor(&this->base);
3364 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3366 locale_ctor(&this->loc);
3367 basic_filebuf_wchar__Init(this, file, INITFL_new);
3368 return this;
3371 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
3372 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
3373 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_file, 8)
3374 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_file(basic_filebuf_wchar *this, FILE *file)
3376 TRACE("(%p %p)\n", this, file);
3378 basic_streambuf_short_ctor(&this->base);
3379 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3381 locale_ctor(&this->loc);
3382 basic_filebuf_short__Init(this, file, INITFL_new);
3383 return this;
3386 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
3387 /* ??_F?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
3388 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor, 4)
3389 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor(basic_filebuf_wchar *this)
3391 return basic_filebuf_wchar_ctor_file(this, NULL);
3394 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
3395 /* ??_F?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
3396 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor, 4)
3397 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor(basic_filebuf_wchar *this)
3399 return basic_filebuf_short_ctor_file(this, NULL);
3402 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3403 /* ??0?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3404 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_ctor_uninitialized, 8)
3405 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3407 TRACE("(%p %d)\n", this, uninitialized);
3409 basic_streambuf_wchar_ctor(&this->base);
3410 this->base.vtable = &MSVCP_basic_filebuf_wchar_vtable;
3411 return this;
3414 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
3415 /* ??0?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
3416 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_ctor_uninitialized, 8)
3417 basic_filebuf_wchar* __thiscall basic_filebuf_short_ctor_uninitialized(basic_filebuf_wchar *this, int uninitialized)
3419 TRACE("(%p %d)\n", this, uninitialized);
3421 basic_streambuf_short_ctor_uninitialized(&this->base, 0);
3422 this->base.vtable = &MSVCP_basic_filebuf_short_vtable;
3423 locale_ctor(&this->loc);
3424 return this;
3427 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3428 /* ??1?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3429 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
3430 /* ??1?$basic_filebuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3431 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_dtor, 4)
3432 void __thiscall basic_filebuf_wchar_dtor(basic_filebuf_wchar *this)
3434 TRACE("(%p)\n", this);
3436 if(this->close)
3437 basic_filebuf_wchar_close(this);
3438 if(this->str) {
3439 MSVCP_basic_string_char_dtor(this->str);
3440 MSVCRT_operator_delete(this->str);
3442 locale_dtor(&this->loc);
3443 basic_streambuf_wchar_dtor(&this->base);
3446 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_vector_dtor, 8)
3447 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_vector_dtor(basic_filebuf_wchar *this, unsigned int flags)
3449 TRACE("(%p %x)\n", this, flags);
3450 if(flags & 2) {
3451 /* we have an array, with the number of elements stored before the first object */
3452 INT_PTR i, *ptr = (INT_PTR *)this-1;
3454 for(i=*ptr-1; i>=0; i--)
3455 basic_filebuf_wchar_dtor(this+i);
3456 MSVCRT_operator_delete(ptr);
3457 } else {
3458 basic_filebuf_wchar_dtor(this);
3459 if(flags & 1)
3460 MSVCRT_operator_delete(this);
3463 return this;
3466 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
3467 /* ?is_open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
3468 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QBE_NXZ */
3469 /* ?is_open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
3470 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_is_open, 4)
3471 MSVCP_bool __thiscall basic_filebuf_wchar_is_open(const basic_filebuf_wchar *this)
3473 TRACE("(%p)\n", this);
3474 return this->file != NULL;
3477 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WHH@Z */
3478 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3479 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGHH@Z */
3480 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3481 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar, 16)
3482 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3484 FILE *f = NULL;
3486 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3488 if(basic_filebuf_wchar_is_open(this))
3489 return NULL;
3491 if(!(f = _Fiopen_wchar(name, mode, prot)))
3492 return NULL;
3494 basic_filebuf_wchar__Init(this, f, INITFL_open);
3495 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(IOS_LOCALE(&this->base)));
3496 return this;
3499 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WHH@Z */
3500 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
3501 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGHH@Z */
3502 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGHH@Z */
3503 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar, 16)
3504 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar(basic_filebuf_wchar *this, const wchar_t *name, int mode, int prot)
3506 FILE *f = NULL;
3508 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
3510 if(basic_filebuf_wchar_is_open(this))
3511 return NULL;
3513 if(!(f = _Fiopen_wchar(name, mode, prot)))
3514 return NULL;
3516 basic_filebuf_short__Init(this, f, INITFL_open);
3517 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(IOS_LOCALE(&this->base)));
3518 return this;
3521 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PB_WI@Z */
3522 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3523 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBGI@Z */
3524 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBGI@Z */
3525 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_wchar_mode, 12)
3526 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3528 return basic_filebuf_wchar_open_wchar(this, name, mode, SH_DENYNO);
3531 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PB_WI@Z */
3532 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEB_WI@Z */
3533 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBGI@Z */
3534 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBGI@Z */
3535 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_wchar_mode, 12)
3536 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_wchar_mode(basic_filebuf_wchar *this, const wchar_t *name, unsigned int mode)
3538 return basic_filebuf_short_open_wchar(this, name, mode, SH_DENYNO);
3541 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDHH@Z */
3542 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3543 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open, 16)
3544 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3546 wchar_t nameW[FILENAME_MAX];
3548 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3550 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3551 return NULL;
3552 return basic_filebuf_wchar_open_wchar(this, nameW, mode, prot);
3555 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDHH@Z */
3556 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDHH@Z */
3557 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open, 16)
3558 basic_filebuf_wchar* __thiscall basic_filebuf_short_open(basic_filebuf_wchar *this, const char *name, int mode, int prot)
3560 wchar_t nameW[FILENAME_MAX];
3562 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
3564 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
3565 return NULL;
3566 return basic_filebuf_short_open_wchar(this, nameW, mode, prot);
3569 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
3570 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
3571 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode_old, 12)
3572 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode_old(basic_filebuf_wchar *this, const char *name, short mode)
3574 TRACE("(%p %p %d)\n", this, name, mode);
3575 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3578 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
3579 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
3580 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PBDI@Z */
3581 /* ?open@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEBDI@Z */
3582 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_open_mode, 12)
3583 basic_filebuf_wchar* __thiscall basic_filebuf_wchar_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3585 return basic_filebuf_wchar_open(this, name, mode, SH_DENYNO);
3588 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDI@Z */
3589 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDI@Z */
3590 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_open_mode, 12)
3591 basic_filebuf_wchar* __thiscall basic_filebuf_short_open_mode(basic_filebuf_wchar *this, const char *name, unsigned int mode)
3593 return basic_filebuf_short_open(this, name, mode, SH_DENYNO);
3596 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3597 /* ?overflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3598 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3599 /* ?overflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3600 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_overflow, 8)
3601 unsigned short __thiscall basic_filebuf_wchar_overflow(basic_filebuf_wchar *this, unsigned short c)
3603 char *ptr, *to_next;
3604 wchar_t ch = c;
3605 const wchar_t *from_next;
3606 unsigned short ret;
3609 TRACE("(%p %d)\n", this, c);
3611 if(!basic_filebuf_wchar_is_open(this))
3612 return WEOF;
3613 if(c == WEOF)
3614 return !c;
3616 if(!this->cvt)
3617 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3619 from_next = &ch;
3620 MSVCP_basic_string_char_clear(this->str);
3621 MSVCP_basic_string_char_append_len_ch(this->str, 8, '\0');
3622 ptr = this->str->ptr;
3623 ret = codecvt_wchar_out(this->cvt, &this->state, &ch, &ch+1, &from_next,
3624 ptr, ptr+MSVCP_basic_string_char_length(this->str), &to_next);
3626 switch(ret) {
3627 case CODECVT_partial:
3628 if(from_next == &ch)
3629 return WEOF;
3630 /* fall through */
3631 case CODECVT_ok:
3632 if(!fwrite(ptr, to_next-ptr, 1, this->file))
3633 return WEOF;
3634 return c;
3635 case CODECVT_noconv:
3636 return fwrite(&ch, sizeof(wchar_t), 1, this->file) ? c : WEOF;
3637 default:
3638 return WEOF;
3642 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
3643 /* ?pbackfail@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
3644 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
3645 /* ?pbackfail@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
3646 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_pbackfail, 8)
3647 unsigned short __thiscall basic_filebuf_wchar_pbackfail(basic_filebuf_wchar *this, unsigned short c)
3649 TRACE("(%p %d)\n", this, c);
3651 if(!basic_filebuf_wchar_is_open(this))
3652 return WEOF;
3654 if(basic_streambuf_wchar_gptr(&this->base)>basic_streambuf_wchar_eback(&this->base)
3655 && (c==WEOF || basic_streambuf_wchar_gptr(&this->base)[-1]==c)) {
3656 basic_streambuf_wchar__Gndec(&this->base);
3657 return c==WEOF ? !c : c;
3658 }else if(c == WEOF) {
3659 return WEOF;
3660 }else if(!this->cvt) {
3661 return ungetwc(c, this->file);
3662 }else if(MSVCP_basic_string_char_length(this->str)) {
3663 char *b, *e, *cur;
3665 e = this->str->ptr;
3666 b = e+this->str->size-1;
3667 for(cur = b; cur>=e; cur--) {
3668 if(ungetc(*cur, this->file) == EOF) {
3669 for(; cur<=b; cur++)
3670 fgetc(this->file);
3671 return WEOF;
3674 MSVCP_basic_string_char_clear(this->str);
3675 this->state = this->state0;
3676 return c;
3679 return WEOF;
3682 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
3683 /* ?uflow@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
3684 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
3685 /* ?uflow@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
3686 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_uflow, 4)
3687 unsigned short __thiscall basic_filebuf_wchar_uflow(basic_filebuf_wchar *this)
3689 wchar_t ch, *to_next;
3690 const char *buf_next;
3691 int c;
3693 TRACE("(%p)\n", this);
3695 if(!basic_filebuf_wchar_is_open(this))
3696 return WEOF;
3698 if(basic_streambuf_wchar_gptr(&this->base) < basic_streambuf_wchar_egptr(&this->base))
3699 return *basic_streambuf_wchar__Gninc(&this->base);
3701 if(!this->cvt)
3702 return fgetwc(this->file);
3704 MSVCP_basic_string_char_clear(this->str);
3705 this->state0 = this->state;
3706 while(1) {
3707 if((c = fgetc(this->file)) == EOF)
3708 return WEOF;
3709 MSVCP_basic_string_char_append_ch(this->str, c);
3710 this->state = this->state0;
3712 switch(codecvt_wchar_in(this->cvt, &this->state, this->str->ptr,
3713 this->str->ptr+this->str->size, &buf_next, &ch, &ch+1, &to_next)) {
3714 case CODECVT_partial:
3715 break;
3716 case CODECVT_noconv:
3717 if(this->str->size < sizeof(unsigned short)/sizeof(char))
3718 break;
3719 return *(unsigned short*)this->str->ptr;
3720 case CODECVT_ok:
3721 return (unsigned short)ch;
3722 default:
3723 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@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
3749 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
3750 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3751 /* ?seekoff@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3752 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
3753 /* ?seekoff@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
3754 #if STREAMOFF_BITS == 64
3755 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 24)
3756 #else
3757 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekoff, 20)
3758 #endif
3759 fpos_int* __thiscall basic_filebuf_wchar_seekoff(basic_filebuf_wchar *this,
3760 fpos_int *ret, streamoff off, int way, int mode)
3762 fpos_t pos;
3764 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
3766 if(!basic_filebuf_wchar_is_open(this) || fseek(this->file, off, way)) {
3767 ret->off = -1;
3768 ret->pos = 0;
3769 ret->state = 0;
3770 return ret;
3773 fgetpos(this->file, &pos);
3774 ret->off = 0;
3775 ret->pos = pos;
3776 ret->state = this->state;
3777 return ret;
3780 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3781 /* ?seekpos@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3782 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
3783 /* ?seekpos@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
3784 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_seekpos, 36)
3785 fpos_int* __thiscall basic_filebuf_wchar_seekpos(basic_filebuf_wchar *this,
3786 fpos_int *ret, fpos_int pos, int mode)
3788 fpos_t fpos;
3790 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
3792 if(!basic_filebuf_wchar_is_open(this) || fseek(this->file, (LONG)pos.pos, SEEK_SET)
3793 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
3794 ret->off = -1;
3795 ret->pos = 0;
3796 ret->state = 0;
3797 return ret;
3800 fgetpos(this->file, &fpos);
3801 ret->off = 0;
3802 ret->pos = fpos;
3803 ret->state = this->state;
3804 return ret;
3807 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PA_WH@Z */
3808 /* ?setbuf@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEA_W_J@Z */
3809 #if STREAMSIZE_BITS == 64
3810 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 16)
3811 #else
3812 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_setbuf, 12)
3813 #endif
3814 basic_streambuf_wchar* __thiscall basic_filebuf_wchar_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3816 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3818 if(!basic_filebuf_wchar_is_open(this))
3819 return NULL;
3821 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3822 return NULL;
3824 basic_filebuf_wchar__Init(this, this->file, INITFL_open);
3825 return &this->base;
3828 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAGH@Z */
3829 /* ?setbuf@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAG_J@Z */
3830 #if STREAMSIZE_BITS == 64
3831 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 16)
3832 #else
3833 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_setbuf, 12)
3834 #endif
3835 basic_streambuf_wchar* __thiscall basic_filebuf_short_setbuf(basic_filebuf_wchar *this, wchar_t *buf, streamsize count)
3837 TRACE("(%p %p %s)\n", this, buf, wine_dbgstr_longlong(count));
3839 if(!basic_filebuf_wchar_is_open(this))
3840 return NULL;
3842 if(setvbuf(this->file, (char*)buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count*sizeof(wchar_t)))
3843 return NULL;
3845 basic_filebuf_short__Init(this, this->file, INITFL_open);
3846 return &this->base;
3849 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
3850 /* ?sync@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
3851 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
3852 /* ?sync@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
3853 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_sync, 4)
3854 int __thiscall basic_filebuf_wchar_sync(basic_filebuf_wchar *this)
3856 TRACE("(%p)\n", this);
3858 if(!basic_filebuf_wchar_is_open(this))
3859 return 0;
3861 if(call_basic_streambuf_wchar_overflow(&this->base, WEOF) == WEOF)
3862 return 0;
3863 return fflush(this->file);
3866 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
3867 /* ?imbue@?$basic_filebuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
3868 DEFINE_THISCALL_WRAPPER(basic_filebuf_wchar_imbue, 8)
3869 void __thiscall basic_filebuf_wchar_imbue(basic_filebuf_wchar *this, const locale *loc)
3871 TRACE("(%p %p)\n", this, loc);
3872 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_wchar_use_facet(loc));
3875 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
3876 /* ?imbue@?$basic_filebuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
3877 DEFINE_THISCALL_WRAPPER(basic_filebuf_short_imbue, 8)
3878 void __thiscall basic_filebuf_short_imbue(basic_filebuf_wchar *this, const locale *loc)
3880 TRACE("(%p %p)\n", this, loc);
3881 basic_filebuf_wchar__Initcvt_cvt(this, codecvt_short_use_facet(loc));
3884 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3885 /* ?_Getstate@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3886 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEHH@Z */
3887 /* ?_Mode@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAHH@Z */
3888 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Getstate, 8)
3889 int __thiscall basic_stringbuf_char__Getstate(basic_stringbuf_char *this, IOSB_openmode mode)
3891 int state = 0;
3893 if(!(mode & OPENMODE_in))
3894 state |= STRINGBUF_no_read;
3896 if(!(mode & OPENMODE_out))
3897 state |= STRINGBUF_no_write;
3899 if(mode & OPENMODE_ate)
3900 state |= STRINGBUF_at_end;
3902 if(mode & OPENMODE_app)
3903 state |= STRINGBUF_append;
3905 return state;
3908 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXPBDIH@Z */
3909 /* ?_Init@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXPEBD_KH@Z */
3910 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Init, 16)
3911 void __thiscall basic_stringbuf_char__Init(basic_stringbuf_char *this, const char *str, MSVCP_size_t count, int state)
3913 TRACE("(%p, %p, %ld, %d)\n", this, str, count, state);
3915 basic_streambuf_char__Init_empty(&this->base);
3917 this->state = state;
3918 this->seekhigh = NULL;
3920 if(count && str) {
3921 char *buf = MSVCRT_operator_new(count);
3922 if(!buf) {
3923 ERR("Out of memory\n");
3924 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3927 memcpy(buf, str, count);
3928 this->seekhigh = buf + count;
3930 this->state |= STRINGBUF_allocated;
3932 if(!(state & STRINGBUF_no_read))
3933 basic_streambuf_char_setg(&this->base, buf, buf, buf + count);
3935 if(!(state & STRINGBUF_no_write)) {
3936 basic_streambuf_char_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
3938 if(!basic_streambuf_char_gptr(&this->base))
3939 basic_streambuf_char_setg(&this->base, buf, 0, buf);
3944 /* ??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 */
3945 /* ??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 */
3946 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_str, 12)
3947 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_str(basic_stringbuf_char *this,
3948 const basic_string_char *str, IOSB_openmode mode)
3950 TRACE("(%p %p %d)\n", this, str, mode);
3952 basic_streambuf_char_ctor(&this->base);
3953 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3955 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str),
3956 str->size, basic_stringbuf_char__Getstate(this, mode));
3957 return this;
3960 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
3961 /* ??0?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
3962 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor_mode, 8)
3963 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor_mode(
3964 basic_stringbuf_char *this, IOSB_openmode mode)
3966 TRACE("(%p %d)\n", this, mode);
3968 basic_streambuf_char_ctor(&this->base);
3969 this->base.vtable = &MSVCP_basic_stringbuf_char_vtable;
3971 basic_stringbuf_char__Init(this, NULL, 0, basic_stringbuf_char__Getstate(this, mode));
3972 return this;
3975 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
3976 /* ??_F?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
3977 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_ctor, 4)
3978 basic_stringbuf_char* __thiscall basic_stringbuf_char_ctor(basic_stringbuf_char *this)
3980 return basic_stringbuf_char_ctor_mode(this, OPENMODE_in|OPENMODE_out);
3983 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXXZ */
3984 /* ?_Tidy@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAXXZ */
3985 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char__Tidy, 4)
3986 void __thiscall basic_stringbuf_char__Tidy(basic_stringbuf_char *this)
3988 TRACE("(%p)\n", this);
3990 if(this->state & STRINGBUF_allocated) {
3991 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
3992 this->seekhigh = NULL;
3993 this->state &= ~STRINGBUF_allocated;
3996 basic_streambuf_char__Init_empty(&this->base);
3999 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
4000 /* ??1?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
4001 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_dtor, 4)
4002 void __thiscall basic_stringbuf_char_dtor(basic_stringbuf_char *this)
4004 TRACE("(%p)\n", this);
4006 basic_stringbuf_char__Tidy(this);
4007 basic_streambuf_char_dtor(&this->base);
4010 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_vector_dtor, 8)
4011 basic_stringbuf_char* __thiscall basic_stringbuf_char_vector_dtor(basic_stringbuf_char *this, unsigned int flags)
4013 TRACE("(%p %x)\n", this, flags);
4015 if(flags & 2) {
4016 /* we have an array, with the number of elements stored before the first object */
4017 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4019 for (i = *ptr - 1; i >= 0; i--)
4020 basic_stringbuf_char_dtor(this+i);
4022 MSVCRT_operator_delete(ptr);
4023 }else {
4024 basic_stringbuf_char_dtor(this);
4026 if(flags & 1)
4027 MSVCRT_operator_delete(this);
4030 return this;
4033 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4034 /* ?overflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4035 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_overflow, 8)
4036 int __thiscall basic_stringbuf_char_overflow(basic_stringbuf_char *this, int meta)
4038 MSVCP_size_t oldsize, size;
4039 char *ptr, *buf;
4041 TRACE("(%p %x)\n", this, meta);
4043 if(meta == EOF)
4044 return !EOF;
4045 if(this->state & STRINGBUF_no_write)
4046 return EOF;
4048 ptr = basic_streambuf_char_pptr(&this->base);
4049 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4050 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
4051 this->seekhigh, basic_streambuf_char_epptr(&this->base));
4053 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
4054 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4056 oldsize = (ptr ? basic_streambuf_char_epptr(&this->base)-basic_streambuf_char_eback(&this->base): 0);
4057 size = oldsize|0xf;
4058 size += size/2;
4059 buf = MSVCRT_operator_new(size);
4060 if(!buf) {
4061 ERR("Out of memory\n");
4062 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4065 if(!oldsize) {
4066 this->seekhigh = buf;
4067 basic_streambuf_char_setp(&this->base, buf, buf+size);
4068 if(this->state & STRINGBUF_no_read)
4069 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4070 else
4071 basic_streambuf_char_setg(&this->base, buf, buf, buf+1);
4073 this->state |= STRINGBUF_allocated;
4074 }else {
4075 ptr = basic_streambuf_char_eback(&this->base);
4076 memcpy(buf, ptr, oldsize);
4078 this->seekhigh = buf+(this->seekhigh-ptr);
4079 basic_streambuf_char_setp_next(&this->base, buf,
4080 buf+(basic_streambuf_char_pptr(&this->base)-ptr), buf+size);
4081 if(this->state & STRINGBUF_no_read)
4082 basic_streambuf_char_setg(&this->base, buf, NULL, buf);
4083 else
4084 basic_streambuf_char_setg(&this->base, buf,
4085 buf+(basic_streambuf_char_gptr(&this->base)-ptr),
4086 basic_streambuf_char_pptr(&this->base)+1);
4088 MSVCRT_operator_delete(ptr);
4091 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = meta);
4094 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHH@Z */
4095 /* ?pbackfail@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHH@Z */
4096 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_pbackfail, 8)
4097 int __thiscall basic_stringbuf_char_pbackfail(basic_stringbuf_char *this, int c)
4099 char *cur;
4101 TRACE("(%p %x)\n", this, c);
4103 cur = basic_streambuf_char_gptr(&this->base);
4104 if(!cur || cur==basic_streambuf_char_eback(&this->base)
4105 || (c!=EOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4106 return EOF;
4108 if(c != EOF)
4109 cur[-1] = c;
4110 basic_streambuf_char_gbump(&this->base, -1);
4111 return c==EOF ? !EOF : c;
4114 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAEHXZ */
4115 /* ?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ */
4116 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_underflow, 4)
4117 int __thiscall basic_stringbuf_char_underflow(basic_stringbuf_char *this)
4119 char *ptr, *cur;
4121 TRACE("(%p)\n", this);
4123 cur = basic_streambuf_char_gptr(&this->base);
4124 if(!cur || this->state&STRINGBUF_no_read)
4125 return EOF;
4127 ptr = basic_streambuf_char_pptr(&this->base);
4128 if(this->seekhigh < ptr)
4129 this->seekhigh = ptr;
4131 ptr = basic_streambuf_char_egptr(&this->base);
4132 if(this->seekhigh > ptr)
4133 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base), cur, this->seekhigh);
4135 if(cur < this->seekhigh)
4136 return (unsigned char)*cur;
4137 return EOF;
4140 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4141 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4142 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4143 /* ?seekoff@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4144 #if STREAMOFF_BITS == 64
4145 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 24)
4146 #else
4147 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekoff, 20)
4148 #endif
4149 fpos_int* __thiscall basic_stringbuf_char_seekoff(basic_stringbuf_char *this,
4150 fpos_int *ret, streamoff off, int way, int mode)
4152 char *beg, *cur_r, *cur_w;
4154 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4156 cur_w = basic_streambuf_char_pptr(&this->base);
4157 if(cur_w > this->seekhigh)
4158 this->seekhigh = cur_w;
4160 ret->off = 0;
4161 ret->pos = 0;
4162 ret->state = 0;
4164 beg = basic_streambuf_char_eback(&this->base);
4165 cur_r = basic_streambuf_char_gptr(&this->base);
4166 if((mode & OPENMODE_in) && cur_r) {
4167 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4168 off += cur_r-beg;
4169 else if(way == SEEKDIR_end)
4170 off += this->seekhigh-beg;
4171 else if(way != SEEKDIR_beg)
4172 off = -1;
4174 if(off<0 || off>this->seekhigh-beg) {
4175 off = -1;
4176 }else {
4177 basic_streambuf_char_gbump(&this->base, beg-cur_r+off);
4178 if((mode & OPENMODE_out) && cur_w) {
4179 basic_streambuf_char_setp_next(&this->base, beg,
4180 basic_streambuf_char_gptr(&this->base),
4181 basic_streambuf_char_epptr(&this->base));
4184 }else if((mode & OPENMODE_out) && cur_w) {
4185 if(way == SEEKDIR_cur)
4186 off += cur_w-beg;
4187 else if(way == SEEKDIR_end)
4188 off += this->seekhigh-beg;
4189 else if(way != SEEKDIR_beg)
4190 off = -1;
4192 if(off<0 || off>this->seekhigh-beg)
4193 off = -1;
4194 else
4195 basic_streambuf_char_pbump(&this->base, beg-cur_w+off);
4196 }else {
4197 off = -1;
4200 ret->off = off;
4201 return ret;
4204 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4205 /* ?seekpos@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4206 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_seekpos, 36)
4207 fpos_int* __thiscall basic_stringbuf_char_seekpos(basic_stringbuf_char *this,
4208 fpos_int *ret, fpos_int pos, int mode)
4210 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4212 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4213 *ret = pos;
4214 return ret;
4217 return basic_stringbuf_char_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4220 /* ?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 */
4221 /* ?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 */
4222 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_set, 8)
4223 void __thiscall basic_stringbuf_char_str_set(basic_stringbuf_char *this, const basic_string_char *str)
4225 TRACE("(%p %p)\n", this, str);
4227 basic_stringbuf_char__Tidy(this);
4228 basic_stringbuf_char__Init(this, MSVCP_basic_string_char_c_str(str), str->size, this->state);
4231 /* ?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 */
4232 /* ?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 */
4233 DEFINE_THISCALL_WRAPPER(basic_stringbuf_char_str_get, 8)
4234 basic_string_char* __thiscall basic_stringbuf_char_str_get(const basic_stringbuf_char *this, basic_string_char *ret)
4236 char *ptr;
4238 TRACE("(%p)\n", this);
4240 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_char_pptr(&this->base)) {
4241 char *pptr;
4243 ptr = basic_streambuf_char_pbase(&this->base);
4244 pptr = basic_streambuf_char_pptr(&this->base);
4246 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4249 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_char_gptr(&this->base)) {
4250 ptr = basic_streambuf_char_eback(&this->base);
4251 return MSVCP_basic_string_char_ctor_cstr_len(ret, ptr, basic_streambuf_char_egptr(&this->base) - ptr);
4254 return MSVCP_basic_string_char_ctor(ret);
4257 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AAEHH@Z */
4258 /* ?_Getstate@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAHH@Z */
4259 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4260 /* ?_Getstate@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4261 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEHH@Z */
4262 /* ?_Mode@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAHH@Z */
4263 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Getstate, 8)
4264 int __thiscall basic_stringbuf_wchar__Getstate(basic_stringbuf_wchar *this, IOSB_openmode mode)
4266 int state = 0;
4268 if(!(mode & OPENMODE_in))
4269 state |= STRINGBUF_no_read;
4271 if(!(mode & OPENMODE_out))
4272 state |= STRINGBUF_no_write;
4274 if(mode & OPENMODE_ate)
4275 state |= STRINGBUF_at_end;
4277 if(mode & OPENMODE_app)
4278 state |= STRINGBUF_append;
4280 return state;
4283 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXPB_WIH@Z */
4284 /* ?_Init@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXPEB_W_KH@Z */
4285 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXPBGIH@Z */
4286 /* ?_Init@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXPEBG_KH@Z */
4287 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Init, 16)
4288 void __thiscall basic_stringbuf_wchar__Init(basic_stringbuf_wchar *this, const wchar_t *str, MSVCP_size_t count, int state)
4290 TRACE("(%p, %p, %lu, %d)\n", this, str, count, state);
4292 basic_streambuf_wchar__Init_empty(&this->base);
4294 this->state = state;
4295 this->seekhigh = NULL;
4297 if(count && str) {
4298 wchar_t *buf = MSVCRT_operator_new(count*sizeof(wchar_t));
4299 if(!buf) {
4300 ERR("Out of memory\n");
4301 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4304 memcpy(buf, str, count*sizeof(wchar_t));
4305 this->seekhigh = buf + count;
4307 this->state |= STRINGBUF_allocated;
4309 if(!(state & STRINGBUF_no_read))
4310 basic_streambuf_wchar_setg(&this->base, buf, buf, buf + count);
4312 if(!(state & STRINGBUF_no_write)) {
4313 basic_streambuf_wchar_setp_next(&this->base, buf, (state & STRINGBUF_at_end) ? buf + count : buf, buf + count);
4315 if(!basic_streambuf_wchar_gptr(&this->base))
4316 basic_streambuf_wchar_setg(&this->base, buf, 0, buf);
4321 /* ??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 */
4322 /* ??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 */
4323 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_str, 12)
4324 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_str(basic_stringbuf_wchar *this,
4325 const basic_string_wchar *str, IOSB_openmode mode)
4327 TRACE("(%p %p %d)\n", this, str, mode);
4329 basic_streambuf_wchar_ctor(&this->base);
4330 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4332 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str),
4333 str->size, basic_stringbuf_wchar__Getstate(this, mode));
4334 return this;
4337 /* ??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 */
4338 /* ??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 */
4339 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_str, 12)
4340 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_str(basic_stringbuf_wchar *this,
4341 const basic_string_wchar *str, IOSB_openmode mode)
4343 basic_stringbuf_wchar_ctor_str(this, str, mode);
4344 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4345 return this;
4348 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
4349 /* ??0?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
4350 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor_mode, 8)
4351 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor_mode(
4352 basic_stringbuf_wchar *this, IOSB_openmode mode)
4354 TRACE("(%p %d)\n", this, mode);
4356 basic_streambuf_wchar_ctor(&this->base);
4357 this->base.vtable = &MSVCP_basic_stringbuf_wchar_vtable;
4359 basic_stringbuf_wchar__Init(this, NULL, 0, basic_stringbuf_wchar__Getstate(this, mode));
4360 return this;
4363 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
4364 /* ??0?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
4365 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor_mode, 8)
4366 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor_mode(
4367 basic_stringbuf_wchar *this, IOSB_openmode mode)
4369 basic_stringbuf_wchar_ctor_mode(this, mode);
4370 this->base.vtable = &MSVCP_basic_stringbuf_short_vtable;
4371 return this;
4374 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
4375 /* ??_F?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
4376 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_ctor, 4)
4377 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_ctor(basic_stringbuf_wchar *this)
4379 return basic_stringbuf_wchar_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4382 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
4383 /* ??_F?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
4384 DEFINE_THISCALL_WRAPPER(basic_stringbuf_short_ctor, 4)
4385 basic_stringbuf_wchar* __thiscall basic_stringbuf_short_ctor(basic_stringbuf_wchar *this)
4387 return basic_stringbuf_short_ctor_mode(this, OPENMODE_in|OPENMODE_out);
4390 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXXZ */
4391 /* ?_Tidy@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAXXZ */
4392 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXXZ */
4393 /* ?_Tidy@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAXXZ */
4394 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar__Tidy, 4)
4395 void __thiscall basic_stringbuf_wchar__Tidy(basic_stringbuf_wchar *this)
4397 TRACE("(%p)\n", this);
4399 if(this->state & STRINGBUF_allocated) {
4400 MSVCRT_operator_delete(basic_streambuf_wchar_eback(&this->base));
4401 this->seekhigh = NULL;
4402 this->state &= ~STRINGBUF_allocated;
4405 basic_streambuf_wchar__Init_empty(&this->base);
4408 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
4409 /* ??1?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
4410 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
4411 /* ??1?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
4412 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_dtor, 4)
4413 void __thiscall basic_stringbuf_wchar_dtor(basic_stringbuf_wchar *this)
4415 TRACE("(%p)\n", this);
4417 basic_stringbuf_wchar__Tidy(this);
4418 basic_streambuf_wchar_dtor(&this->base);
4421 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_vector_dtor, 8)
4422 basic_stringbuf_wchar* __thiscall basic_stringbuf_wchar_vector_dtor(basic_stringbuf_wchar *this, unsigned int flags)
4424 TRACE("(%p %x)\n", this, flags);
4426 if(flags & 2) {
4427 /* we have an array, with the number of elements stored before the first object */
4428 INT_PTR i, *ptr = (INT_PTR *) this - 1;
4430 for (i = *ptr - 1; i >= 0; i--)
4431 basic_stringbuf_wchar_dtor(this+i);
4433 MSVCRT_operator_delete(ptr);
4434 }else {
4435 basic_stringbuf_wchar_dtor(this);
4437 if(flags & 1)
4438 MSVCRT_operator_delete(this);
4441 return this;
4444 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4445 /* ?overflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4446 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4447 /* ?overflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4448 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_overflow, 8)
4449 unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *this, unsigned short meta)
4451 MSVCP_size_t oldsize, size;
4452 wchar_t *ptr, *buf;
4454 TRACE("(%p %x)\n", this, meta);
4456 if(meta == WEOF)
4457 return !WEOF;
4458 if(this->state & STRINGBUF_no_write)
4459 return WEOF;
4461 ptr = basic_streambuf_wchar_pptr(&this->base);
4462 if((this->state&STRINGBUF_append) && ptr<this->seekhigh)
4463 basic_streambuf_wchar_setp_next(&this->base, basic_streambuf_wchar_pbase(&this->base),
4464 this->seekhigh, basic_streambuf_wchar_epptr(&this->base));
4466 if(ptr && ptr<basic_streambuf_wchar_epptr(&this->base))
4467 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4469 oldsize = (ptr ? basic_streambuf_wchar_epptr(&this->base)-basic_streambuf_wchar_eback(&this->base): 0);
4470 size = oldsize|0xf;
4471 size += size/2;
4472 buf = MSVCRT_operator_new(size*sizeof(wchar_t));
4473 if(!buf) {
4474 ERR("Out of memory\n");
4475 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4478 if(!oldsize) {
4479 this->seekhigh = buf;
4480 basic_streambuf_wchar_setp(&this->base, buf, buf+size);
4481 if(this->state & STRINGBUF_no_read)
4482 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4483 else
4484 basic_streambuf_wchar_setg(&this->base, buf, buf, buf+1);
4486 this->state |= STRINGBUF_allocated;
4487 }else {
4488 ptr = basic_streambuf_wchar_eback(&this->base);
4489 memcpy(buf, ptr, oldsize*sizeof(wchar_t));
4491 this->seekhigh = buf+(this->seekhigh-ptr);
4492 basic_streambuf_wchar_setp_next(&this->base, buf,
4493 buf+(basic_streambuf_wchar_pptr(&this->base)-ptr), buf+size);
4494 if(this->state & STRINGBUF_no_read)
4495 basic_streambuf_wchar_setg(&this->base, buf, NULL, buf);
4496 else
4497 basic_streambuf_wchar_setg(&this->base, buf,
4498 buf+(basic_streambuf_wchar_gptr(&this->base)-ptr),
4499 basic_streambuf_wchar_pptr(&this->base)+1);
4501 MSVCRT_operator_delete(ptr);
4504 return (*basic_streambuf_wchar__Pninc(&this->base) = meta);
4507 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGG@Z */
4508 /* ?pbackfail@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGG@Z */
4509 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGG@Z */
4510 /* ?pbackfail@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGG@Z */
4511 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_pbackfail, 8)
4512 unsigned short __thiscall basic_stringbuf_wchar_pbackfail(basic_stringbuf_wchar *this, unsigned short c)
4514 wchar_t *cur;
4516 TRACE("(%p %x)\n", this, c);
4518 cur = basic_streambuf_wchar_gptr(&this->base);
4519 if(!cur || cur==basic_streambuf_wchar_eback(&this->base)
4520 || (c!=WEOF && c!=cur[-1] && this->state&STRINGBUF_no_write))
4521 return WEOF;
4523 if(c != WEOF)
4524 cur[-1] = c;
4525 basic_streambuf_wchar_gbump(&this->base, -1);
4526 return c==WEOF ? !WEOF : c;
4529 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAEGXZ */
4530 /* ?underflow@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAAGXZ */
4531 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAEGXZ */
4532 /* ?underflow@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAAGXZ */
4533 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_underflow, 4)
4534 unsigned short __thiscall basic_stringbuf_wchar_underflow(basic_stringbuf_wchar *this)
4536 wchar_t *ptr, *cur;
4538 TRACE("(%p)\n", this);
4540 cur = basic_streambuf_wchar_gptr(&this->base);
4541 if(!cur || this->state&STRINGBUF_no_read)
4542 return WEOF;
4544 ptr = basic_streambuf_wchar_pptr(&this->base);
4545 if(this->seekhigh < ptr)
4546 this->seekhigh = ptr;
4548 ptr = basic_streambuf_wchar_egptr(&this->base);
4549 if(this->seekhigh > ptr)
4550 basic_streambuf_wchar_setg(&this->base, basic_streambuf_wchar_eback(&this->base), cur, this->seekhigh);
4552 if(cur < this->seekhigh)
4553 return *cur;
4554 return WEOF;
4557 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
4558 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
4559 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4560 /* ?seekoff@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4561 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@JHH@Z */
4562 /* ?seekoff@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
4563 #if STREAMOFF_BITS == 64
4564 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 24)
4565 #else
4566 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekoff, 20)
4567 #endif
4568 fpos_int* __thiscall basic_stringbuf_wchar_seekoff(basic_stringbuf_wchar *this,
4569 fpos_int *ret, streamoff off, int way, int mode)
4571 wchar_t *beg, *cur_r, *cur_w;
4573 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
4575 cur_w = basic_streambuf_wchar_pptr(&this->base);
4576 if(cur_w > this->seekhigh)
4577 this->seekhigh = cur_w;
4579 ret->off = 0;
4580 ret->pos = 0;
4581 ret->state = 0;
4583 beg = basic_streambuf_wchar_eback(&this->base);
4584 cur_r = basic_streambuf_wchar_gptr(&this->base);
4585 if((mode & OPENMODE_in) && cur_r) {
4586 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
4587 off += cur_r-beg;
4588 else if(way == SEEKDIR_end)
4589 off += this->seekhigh-beg;
4590 else if(way != SEEKDIR_beg)
4591 off = -1;
4593 if(off<0 || off>this->seekhigh-beg) {
4594 off = -1;
4595 }else {
4596 basic_streambuf_wchar_gbump(&this->base, beg-cur_r+off);
4597 if((mode & OPENMODE_out) && cur_w) {
4598 basic_streambuf_wchar_setp_next(&this->base, beg,
4599 basic_streambuf_wchar_gptr(&this->base),
4600 basic_streambuf_wchar_epptr(&this->base));
4603 }else if((mode & OPENMODE_out) && cur_w) {
4604 if(way == SEEKDIR_cur)
4605 off += cur_w-beg;
4606 else if(way == SEEKDIR_end)
4607 off += this->seekhigh-beg;
4608 else if(way != SEEKDIR_beg)
4609 off = -1;
4611 if(off<0 || off>this->seekhigh-beg)
4612 off = -1;
4613 else
4614 basic_streambuf_wchar_pbump(&this->base, beg-cur_w+off);
4615 }else {
4616 off = -1;
4619 ret->off = off;
4620 return ret;
4623 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4624 /* ?seekpos@?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4625 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
4626 /* ?seekpos@?$basic_stringbuf@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
4627 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_seekpos, 36)
4628 fpos_int* __thiscall basic_stringbuf_wchar_seekpos(basic_stringbuf_wchar *this,
4629 fpos_int *ret, fpos_int pos, int mode)
4631 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
4633 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
4634 *ret = pos;
4635 return ret;
4638 return basic_stringbuf_wchar_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
4641 /* ?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 */
4642 /* ?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 */
4643 /* ?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 */
4644 /* ?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 */
4645 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_set, 8)
4646 void __thiscall basic_stringbuf_wchar_str_set(basic_stringbuf_wchar *this, const basic_string_wchar *str)
4648 TRACE("(%p %p)\n", this, str);
4650 basic_stringbuf_wchar__Tidy(this);
4651 basic_stringbuf_wchar__Init(this, MSVCP_basic_string_wchar_c_str(str), str->size, this->state);
4654 /* ?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 */
4655 /* ?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 */
4656 /* ?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 */
4657 /* ?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 */
4658 DEFINE_THISCALL_WRAPPER(basic_stringbuf_wchar_str_get, 8)
4659 basic_string_wchar* __thiscall basic_stringbuf_wchar_str_get(const basic_stringbuf_wchar *this, basic_string_wchar *ret)
4661 wchar_t *ptr;
4663 TRACE("(%p)\n", this);
4665 if(!(this->state & STRINGBUF_no_write) && basic_streambuf_wchar_pptr(&this->base)) {
4666 wchar_t *pptr;
4668 ptr = basic_streambuf_wchar_pbase(&this->base);
4669 pptr = basic_streambuf_wchar_pptr(&this->base);
4671 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, (this->seekhigh < pptr ? pptr : this->seekhigh) - ptr);
4674 if(!(this->state & STRINGBUF_no_read) && basic_streambuf_wchar_gptr(&this->base)) {
4675 ptr = basic_streambuf_wchar_eback(&this->base);
4676 return MSVCP_basic_string_wchar_ctor_cstr_len(ret, ptr, basic_streambuf_wchar_egptr(&this->base) - ptr);
4679 return MSVCP_basic_string_wchar_ctor(ret);
4682 /* ??0ios_base@std@@IAE@XZ */
4683 /* ??0ios_base@std@@IEAA@XZ */
4684 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
4685 ios_base* __thiscall ios_base_ctor(ios_base *this)
4687 TRACE("(%p)\n", this);
4688 this->vtable = &MSVCP_ios_base_vtable;
4689 locale_ctor_uninitialized(IOS_LOCALE(this), 0);
4690 return this;
4693 /* ??0ios_base@std@@QAE@ABV01@@Z */
4694 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
4695 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
4696 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
4698 TRACE("(%p %p)\n", this, copy);
4699 *this = *copy;
4700 this->vtable = &MSVCP_ios_base_vtable;
4701 return this;
4704 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
4705 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
4706 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
4707 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
4709 IOS_BASE_fnarray *cur;
4711 TRACE("(%p %x)\n", this, event);
4713 for(cur=this->calls; cur; cur=cur->next)
4714 cur->event_handler(event, this, cur->index);
4717 /* ?_Tidy@ios_base@std@@AAAXXZ */
4718 /* ?_Tidy@ios_base@std@@AEAAXXZ */
4719 void __cdecl ios_base_Tidy(ios_base *this)
4721 IOS_BASE_iosarray *arr_cur, *arr_next;
4722 IOS_BASE_fnarray *event_cur, *event_next;
4724 TRACE("(%p)\n", this);
4726 ios_base_Callfns(this, EVENT_erase_event);
4728 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
4729 arr_next = arr_cur->next;
4730 MSVCRT_operator_delete(arr_cur);
4732 this->arr = NULL;
4734 for(event_cur=this->calls; event_cur; event_cur=event_next) {
4735 event_next = event_cur->next;
4736 MSVCRT_operator_delete(event_cur);
4738 this->calls = NULL;
4741 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
4742 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
4743 void __cdecl ios_base_Ios_base_dtor(ios_base *obj)
4745 TRACE("(%p)\n", obj);
4746 locale_dtor(IOS_LOCALE(obj));
4747 #if _MSVCP_VER >= 70
4748 MSVCRT_operator_delete(obj->loc);
4749 #endif
4750 ios_base_Tidy(obj);
4753 /* ??1ios_base@std@@UAE@XZ */
4754 /* ??1ios_base@std@@UEAA@XZ */
4755 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
4756 void __thiscall ios_base_dtor(ios_base *this)
4758 ios_base_Ios_base_dtor(this);
4761 DEFINE_THISCALL_WRAPPER(ios_base_vector_dtor, 8)
4762 ios_base* __thiscall ios_base_vector_dtor(ios_base *this, unsigned int flags)
4764 TRACE("(%p %x)\n", this, flags);
4765 if(flags & 2) {
4766 /* we have an array, with the number of elements stored before the first object */
4767 INT_PTR i, *ptr = (INT_PTR *)this-1;
4769 for(i=*ptr-1; i>=0; i--)
4770 ios_base_dtor(this+i);
4771 MSVCRT_operator_delete(ptr);
4772 } else {
4773 ios_base_dtor(this);
4774 if(flags & 1)
4775 MSVCRT_operator_delete(this);
4778 return this;
4781 DEFINE_THISCALL_WRAPPER(iosb_vector_dtor, 8)
4782 void* __thiscall iosb_vector_dtor(void *this, unsigned int flags)
4784 TRACE("(%p %x)\n", this, flags);
4785 if(flags & 2) {
4786 INT_PTR *ptr = (INT_PTR *)this-1;
4787 MSVCRT_operator_delete(ptr);
4788 } else {
4789 if(flags & 1)
4790 MSVCRT_operator_delete(this);
4793 return this;
4796 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
4797 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
4798 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
4799 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
4801 IOS_BASE_iosarray *p;
4803 TRACE("(%p %d)\n", this, index);
4805 for(p=this->arr; p; p=p->next) {
4806 if(p->index == index)
4807 return p;
4810 for(p=this->arr; p; p=p->next) {
4811 if(!p->long_val && !p->ptr_val) {
4812 p->index = index;
4813 return p;
4817 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
4818 p->next = this->arr;
4819 p->index = index;
4820 p->long_val = 0;
4821 p->ptr_val = NULL;
4822 this->arr = p;
4823 return p;
4826 /* ?iword@ios_base@std@@QAEAAJH@Z */
4827 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
4828 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
4829 LONG* __thiscall ios_base_iword(ios_base *this, int index)
4831 TRACE("(%p %d)\n", this, index);
4832 return &ios_base_Findarr(this, index)->long_val;
4835 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
4836 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
4837 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
4838 void** __thiscall ios_base_pword(ios_base *this, int index)
4840 TRACE("(%p %d)\n", this, index);
4841 return &ios_base_Findarr(this, index)->ptr_val;
4844 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
4845 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
4846 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
4847 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
4849 IOS_BASE_fnarray *event;
4851 TRACE("(%p %p %d)\n", this, callback, index);
4853 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
4854 event->next = this->calls;
4855 event->index = index;
4856 event->event_handler = callback;
4857 this->calls = event;
4860 /* ?clear@ios_base@std@@QAEXH_N@Z */
4861 /* ?clear@ios_base@std@@QEAAXH_N@Z */
4862 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
4863 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
4865 TRACE("(%p %x %x)\n", this, state, reraise);
4867 this->state = state & IOSTATE_mask;
4868 if(!(this->state & this->except))
4869 return;
4871 if(reraise)
4872 throw_exception(EXCEPTION_RERAISE, NULL);
4873 else if(this->state & this->except & IOSTATE_eofbit)
4874 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
4875 else if(this->state & this->except & IOSTATE_failbit)
4876 throw_exception(EXCEPTION_FAILURE, "failbit is set");
4877 else if(this->state & this->except & IOSTATE_badbit)
4878 throw_exception(EXCEPTION_FAILURE, "badbit is set");
4879 else if(this->state & this->except & IOSTATE__Hardfail)
4880 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
4883 /* ?clear@ios_base@std@@QAEXH@Z */
4884 /* ?clear@ios_base@std@@QEAAXH@Z */
4885 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
4886 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
4888 ios_base_clear_reraise(this, state, FALSE);
4891 /* ?clear@ios_base@std@@QAEXI@Z */
4892 /* ?clear@ios_base@std@@QEAAXI@Z */
4893 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
4894 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
4896 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
4899 /* ?exceptions@ios_base@std@@QAEXH@Z */
4900 /* ?exceptions@ios_base@std@@QEAAXH@Z */
4901 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
4902 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
4904 TRACE("(%p %x)\n", this, state);
4905 this->except = state & IOSTATE_mask;
4906 ios_base_clear(this, this->state);
4909 /* ?exceptions@ios_base@std@@QAEXI@Z */
4910 /* ?exceptions@ios_base@std@@QEAAXI@Z */
4911 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
4912 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
4914 TRACE("(%p %x)\n", this, state);
4915 ios_base_exceptions_set(this, state);
4918 /* ?exceptions@ios_base@std@@QBEHXZ */
4919 /* ?exceptions@ios_base@std@@QEBAHXZ */
4920 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
4921 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
4923 TRACE("(%p)\n", this);
4924 return this->except;
4927 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
4928 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
4929 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
4930 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
4932 TRACE("(%p %p)\n", this, rhs);
4934 if(this != rhs) {
4935 IOS_BASE_iosarray *arr_cur;
4936 IOS_BASE_fnarray *event_cur;
4938 ios_base_Tidy(this);
4940 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
4941 if(arr_cur->long_val)
4942 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
4943 if(arr_cur->ptr_val)
4944 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
4946 this->stdstr = rhs->stdstr;
4947 this->fmtfl = rhs->fmtfl;
4948 this->prec = rhs->prec;
4949 this->wide = rhs->wide;
4950 locale_operator_assign(IOS_LOCALE(this), IOS_LOCALE(rhs));
4952 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
4953 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
4955 ios_base_Callfns(this, EVENT_copyfmt_event);
4956 ios_base_exceptions_set(this, rhs->except);
4959 return this;
4962 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
4963 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
4964 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
4965 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
4967 TRACE("(%p %p)\n", this, right);
4969 if(this != right) {
4970 this->state = right->state;
4971 ios_base_copyfmt(this, right);
4974 return this;
4977 /* ?fail@ios_base@std@@QBE_NXZ */
4978 /* ?fail@ios_base@std@@QEBA_NXZ */
4979 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
4980 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
4982 TRACE("(%p)\n", this);
4983 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
4986 /* ??7ios_base@std@@QBE_NXZ */
4987 /* ??7ios_base@std@@QEBA_NXZ */
4988 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
4989 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
4991 TRACE("(%p)\n", this);
4992 return ios_base_fail(this);
4995 /* ??Bios_base@std@@QBEPAXXZ */
4996 /* ??Bios_base@std@@QEBAPEAXXZ */
4997 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
4998 void* __thiscall ios_base_op_fail(const ios_base *this)
5000 TRACE("(%p)\n", this);
5001 return ios_base_fail(this) ? NULL : (void*)this;
5004 /* ??Bios_base@std@@QBA_NXZ */
5005 /* ??Bios_base@std@@QBE_NXZ */
5006 /* ??Bios_base@std@@QEBA_NXZ */
5007 DEFINE_THISCALL_WRAPPER(ios_base_operator_bool, 4)
5008 MSVCP_bool __thiscall ios_base_operator_bool(const ios_base *this)
5010 TRACE("(%p)\n", this);
5011 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) == 0;
5014 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
5015 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
5016 void __cdecl ios_base_Addstd(ios_base *add)
5018 FIXME("(%p) stub\n", add);
5021 /* ?_Index_func@ios_base@std@@CAAAHXZ */
5022 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
5023 int* __cdecl ios_base_Index_func(void)
5025 TRACE("\n");
5026 return &ios_base_Index;
5029 /* ?_Init@ios_base@std@@IAEXXZ */
5030 /* ?_Init@ios_base@std@@IEAAXXZ */
5031 DEFINE_THISCALL_WRAPPER(ios_base__Init, 4)
5032 void __thiscall ios_base__Init(ios_base *this)
5034 TRACE("(%p)\n", this);
5036 this->stdstr = 0;
5037 this->state = this->except = IOSTATE_goodbit;
5038 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
5039 this->prec = 6;
5040 this->wide = 0;
5041 this->arr = NULL;
5042 this->calls = NULL;
5043 #if _MSVCP_VER >= 70
5044 this->loc = MSVCRT_operator_new(sizeof(locale));
5045 #endif
5046 locale_ctor(IOS_LOCALE(this));
5049 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
5050 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
5051 MSVCP_bool* __cdecl ios_base_Sync_func(void)
5053 TRACE("\n");
5054 return &ios_base_Sync;
5057 /* ?bad@ios_base@std@@QBE_NXZ */
5058 /* ?bad@ios_base@std@@QEBA_NXZ */
5059 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
5060 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
5062 TRACE("(%p)\n", this);
5063 return (this->state & IOSTATE_badbit) != 0;
5066 /* ?eof@ios_base@std@@QBE_NXZ */
5067 /* ?eof@ios_base@std@@QEBA_NXZ */
5068 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
5069 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
5071 TRACE("(%p)\n", this);
5072 return (this->state & IOSTATE_eofbit) != 0;
5075 /* ?flags@ios_base@std@@QAEHH@Z */
5076 /* ?flags@ios_base@std@@QEAAHH@Z */
5077 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
5078 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
5080 IOSB_fmtflags ret = this->fmtfl;
5082 TRACE("(%p %x)\n", this, flags);
5084 this->fmtfl = flags & FMTFLAG_mask;
5085 return ret;
5088 /* ?flags@ios_base@std@@QBEHXZ */
5089 /* ?flags@ios_base@std@@QEBAHXZ */
5090 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
5091 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
5093 TRACE("(%p)\n", this);
5094 return this->fmtfl;
5097 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
5098 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
5099 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
5100 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
5102 TRACE("(%p)\n", this);
5103 return locale_copy_ctor(ret, IOS_LOCALE(this));
5106 /* ?good@ios_base@std@@QBE_NXZ */
5107 /* ?good@ios_base@std@@QEBA_NXZ */
5108 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
5109 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
5111 TRACE("(%p)\n", this);
5112 return this->state == IOSTATE_goodbit;
5115 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
5116 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
5117 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
5118 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
5120 TRACE("(%p %p)\n", this, loc);
5121 *ret = *IOS_LOCALE(this);
5122 locale_copy_ctor(IOS_LOCALE(this), loc);
5123 return ret;
5126 /* ?precision@ios_base@std@@QAEHH@Z */
5127 /* ?precision@ios_base@std@@QEAA_J_J@Z */
5128 #if STREAMSIZE_BITS == 64
5129 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 12)
5130 #else
5131 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
5132 #endif
5133 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
5135 streamsize ret = this->prec;
5137 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(precision));
5139 this->prec = precision;
5140 return ret;
5143 /* ?precision@ios_base@std@@QBEHXZ */
5144 /* ?precision@ios_base@std@@QEBA_JXZ */
5145 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
5146 streamsize __thiscall ios_base_precision_get(const ios_base *this)
5148 TRACE("(%p)\n", this);
5149 return this->prec;
5152 /* ?rdstate@ios_base@std@@QBEHXZ */
5153 /* ?rdstate@ios_base@std@@QEBAHXZ */
5154 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
5155 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
5157 TRACE("(%p)\n", this);
5158 return this->state;
5161 /* ?setf@ios_base@std@@QAEHHH@Z */
5162 /* ?setf@ios_base@std@@QEAAHHH@Z */
5163 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
5164 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
5166 IOSB_fmtflags ret = this->fmtfl;
5168 TRACE("(%p %x %x)\n", this, flags, mask);
5170 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
5171 return ret;
5174 /* ?setf@ios_base@std@@QAEHH@Z */
5175 /* ?setf@ios_base@std@@QEAAHH@Z */
5176 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
5177 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
5179 IOSB_fmtflags ret = this->fmtfl;
5181 TRACE("(%p %x)\n", this, flags);
5183 this->fmtfl |= flags & FMTFLAG_mask;
5184 return ret;
5187 /* ?setstate@ios_base@std@@QAEXH_N@Z */
5188 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
5189 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
5190 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
5192 TRACE("(%p %x %x)\n", this, state, reraise);
5194 if(state != IOSTATE_goodbit)
5195 ios_base_clear_reraise(this, this->state | state, reraise);
5198 /* ?setstate@ios_base@std@@QAEXH@Z */
5199 /* ?setstate@ios_base@std@@QEAAXH@Z */
5200 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
5201 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
5203 ios_base_setstate_reraise(this, state, FALSE);
5206 /* ?setstate@ios_base@std@@QAEXI@Z */
5207 /* ?setstate@ios_base@std@@QEAAXI@Z */
5208 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
5209 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
5211 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5214 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
5215 MSVCP_bool __cdecl ios_base_sync_with_stdio(MSVCP_bool sync)
5217 _Lockit lock;
5218 MSVCP_bool ret;
5220 TRACE("(%x)\n", sync);
5222 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5223 ret = ios_base_Sync;
5224 ios_base_Sync = sync;
5225 _Lockit_dtor(&lock);
5226 return ret;
5229 /* ?unsetf@ios_base@std@@QAEXH@Z */
5230 /* ?unsetf@ios_base@std@@QEAAXH@Z */
5231 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
5232 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
5234 TRACE("(%p %x)\n", this, flags);
5235 this->fmtfl &= ~flags;
5238 /* ?width@ios_base@std@@QAEHH@Z */
5239 /* ?width@ios_base@std@@QEAA_J_J@Z */
5240 #if STREAMSIZE_BITS == 64
5241 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 12)
5242 #else
5243 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
5244 #endif
5245 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
5247 streamsize ret = this->wide;
5249 TRACE("(%p %s)\n", this, wine_dbgstr_longlong(width));
5251 this->wide = width;
5252 return ret;
5255 /* ?width@ios_base@std@@QBEHXZ */
5256 /* ?width@ios_base@std@@QEBA_JXZ */
5257 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
5258 streamsize __thiscall ios_base_width_get(ios_base *this)
5260 TRACE("(%p)\n", this);
5261 return this->wide;
5264 /* ?xalloc@ios_base@std@@SAHXZ */
5265 int __cdecl ios_base_xalloc(void)
5267 _Lockit lock;
5268 int ret;
5270 TRACE("\n");
5272 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
5273 ret = ios_base_Index++;
5274 _Lockit_dtor(&lock);
5275 return ret;
5278 /* ?swap@ios_base@std@@QAEXAAV12@@Z */
5279 /* ?swap@ios_base@std@@QEAAXAEAV12@@Z */
5280 DEFINE_THISCALL_WRAPPER(ios_base_swap, 8)
5281 void __thiscall ios_base_swap(ios_base *this, ios_base *r)
5283 ios_base tmp;
5285 TRACE("(%p %p)\n", this, r);
5287 if(this == r)
5288 return;
5290 tmp = *this;
5291 *this = *r;
5292 this->vtable = tmp.vtable;
5293 tmp.vtable = r->vtable;
5294 *r = tmp;
5297 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
5298 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
5299 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
5300 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
5302 TRACE("(%p)\n", this);
5304 ios_base_ctor(&this->base);
5305 this->base.vtable = &MSVCP_basic_ios_char_vtable;
5306 return this;
5309 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5310 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
5311 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
5312 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
5314 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5315 ios_base__Init(&this->base);
5316 this->strbuf = streambuf;
5317 this->stream = NULL;
5318 this->fillch = ' ';
5320 if(!streambuf)
5321 ios_base_setstate(&this->base, IOSTATE_badbit);
5323 if(isstd)
5324 FIXME("standard streams not handled yet\n");
5327 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5328 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
5329 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
5330 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
5332 TRACE("(%p %p)\n", this, strbuf);
5334 basic_ios_char_ctor(this);
5335 basic_ios_char_init(this, strbuf, FALSE);
5336 return this;
5339 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
5340 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5341 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
5342 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
5344 TRACE("(%p)\n", this);
5345 ios_base_dtor(&this->base);
5348 DEFINE_THISCALL_WRAPPER(basic_ios_char_vector_dtor, 8)
5349 basic_ios_char* __thiscall basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
5351 TRACE("(%p %x)\n", this, flags);
5352 if(flags & 2) {
5353 /* we have an array, with the number of elements stored before the first object */
5354 INT_PTR i, *ptr = (INT_PTR *)this-1;
5356 for(i=*ptr-1; i>=0; i--)
5357 basic_ios_char_dtor(this+i);
5358 MSVCRT_operator_delete(ptr);
5359 } else {
5360 basic_ios_char_dtor(this);
5361 if(flags & 1)
5362 MSVCRT_operator_delete(this);
5365 return this;
5368 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5369 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5370 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
5371 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5373 TRACE("(%p %x %x)\n", this, state, reraise);
5374 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5377 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5378 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5379 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
5380 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
5382 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
5385 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
5386 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5387 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
5388 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
5390 TRACE("(%p %p)\n", this, copy);
5391 if(this == copy)
5392 return this;
5394 this->stream = copy->stream;
5395 this->fillch = copy->fillch;
5396 ios_base_copyfmt(&this->base, &copy->base);
5397 return this;
5400 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
5401 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
5402 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
5403 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
5405 char ret = this->fillch;
5407 TRACE("(%p %c)\n", this, fill);
5409 this->fillch = fill;
5410 return ret;
5413 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
5414 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
5415 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
5416 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
5418 TRACE("(%p)\n", this);
5419 return this->fillch;
5422 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5423 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5424 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
5425 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
5427 TRACE("(%p %p %p)\n", this, ret, loc);
5429 if(this->strbuf) {
5430 basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
5431 locale_dtor(ret);
5434 return ios_base_imbue(&this->base, ret, loc);
5437 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
5438 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
5439 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
5440 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
5442 TRACE("(%p %c %c)\n", this, ch, def);
5443 return ctype_char_narrow_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5446 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
5447 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5448 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
5449 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
5451 basic_streambuf_char *ret = this->strbuf;
5453 TRACE("(%p %p)\n", this, streambuf);
5455 this->strbuf = streambuf;
5456 basic_ios_char_clear(this, IOSTATE_goodbit);
5457 return ret;
5460 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5461 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
5462 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
5463 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
5465 TRACE("(%p)\n", this);
5466 return this->strbuf;
5469 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
5470 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
5471 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
5472 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
5474 TRACE("(%p %x %x)\n", this, state, reraise);
5476 if(state != IOSTATE_goodbit)
5477 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
5480 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
5481 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
5482 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
5483 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
5485 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
5488 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
5489 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
5490 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
5491 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
5493 basic_ostream_char *ret = this->stream;
5495 TRACE("(%p %p)\n", this, ostream);
5497 this->stream = ostream;
5498 return ret;
5501 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5502 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
5503 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
5504 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
5506 TRACE("(%p)\n", this);
5507 return this->stream;
5510 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
5511 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
5512 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
5513 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
5515 TRACE("(%p %c)\n", this, ch);
5516 return ctype_char_widen_ch(ctype_char_use_facet(IOS_LOCALE(this->strbuf)), ch);
5519 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
5520 /* ?swap@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
5521 DEFINE_THISCALL_WRAPPER(basic_ios_char_swap, 8)
5522 void __thiscall basic_ios_char_swap(basic_ios_char *this, basic_ios_char *r)
5524 void *swap_ptr;
5526 TRACE("(%p %p)\n", this, r);
5528 if(this == r)
5529 return;
5531 ios_base_swap(&this->base, &r->base);
5532 swap_ptr = this->stream;
5533 this->stream = r->stream;
5534 r->stream = swap_ptr;
5535 this->fillch ^= r->fillch;
5536 r->fillch ^= this->fillch;
5537 this->fillch ^= r->fillch;
5540 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
5541 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
5542 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
5543 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
5545 TRACE("(%p)\n", this);
5547 ios_base_ctor(&this->base);
5548 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
5549 return this;
5552 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
5553 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
5554 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
5555 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
5557 basic_ios_wchar_ctor(this);
5558 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5559 return this;
5562 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5563 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
5564 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5565 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
5566 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
5567 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
5569 TRACE("(%p %p %x)\n", this, streambuf, isstd);
5570 ios_base__Init(&this->base);
5571 this->strbuf = streambuf;
5572 this->stream = NULL;
5573 this->fillch = ' ';
5575 if(!streambuf)
5576 ios_base_setstate(&this->base, IOSTATE_badbit);
5578 if(isstd)
5579 FIXME("standard streams not handled yet\n");
5582 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5583 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
5584 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
5585 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5587 TRACE("(%p %p)\n", this, strbuf);
5589 basic_ios_wchar_ctor(this);
5590 basic_ios_wchar_init(this, strbuf, FALSE);
5591 return this;
5594 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5595 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
5596 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
5597 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
5599 basic_ios_wchar_ctor_streambuf(this, strbuf);
5600 this->base.vtable = &MSVCP_basic_ios_short_vtable;
5601 return this;
5604 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
5605 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
5606 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
5607 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
5608 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
5609 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
5611 TRACE("(%p)\n", this);
5612 ios_base_dtor(&this->base);
5615 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_vector_dtor, 8)
5616 basic_ios_wchar* __thiscall basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
5618 TRACE("(%p %x)\n", this, flags);
5619 if(flags & 2) {
5620 /* we have an array, with the number of elements stored before the first object */
5621 INT_PTR i, *ptr = (INT_PTR *)this-1;
5623 for(i=*ptr-1; i>=0; i--)
5624 basic_ios_wchar_dtor(this+i);
5625 MSVCRT_operator_delete(ptr);
5626 } else {
5627 basic_ios_wchar_dtor(this);
5628 if(flags & 1)
5629 MSVCRT_operator_delete(this);
5632 return this;
5635 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5636 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5637 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5638 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5639 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
5640 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5642 TRACE("(%p %x %x)\n", this, state, reraise);
5643 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
5646 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5647 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5648 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5649 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5650 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
5651 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
5653 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
5656 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
5657 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5658 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
5659 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
5660 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
5661 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
5663 TRACE("(%p %p)\n", this, copy);
5664 if(this == copy)
5665 return this;
5667 this->stream = copy->stream;
5668 this->fillch = copy->fillch;
5669 ios_base_copyfmt(&this->base, &copy->base);
5670 return this;
5673 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
5674 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
5675 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
5676 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
5677 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
5678 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
5680 wchar_t ret = this->fillch;
5682 TRACE("(%p %c)\n", this, fill);
5684 this->fillch = fill;
5685 return ret;
5688 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
5689 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
5690 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
5691 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
5692 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
5693 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
5695 TRACE("(%p)\n", this);
5696 return this->fillch;
5699 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5700 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5701 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
5702 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
5703 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
5704 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
5706 TRACE("(%p %p %p)\n", this, ret, loc);
5708 if(this->strbuf) {
5709 basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
5710 locale_dtor(ret);
5713 return ios_base_imbue(&this->base, ret, loc);
5716 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
5717 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
5718 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
5719 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
5720 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
5721 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
5723 TRACE("(%p %c %c)\n", this, ch, def);
5724 return ctype_wchar_narrow_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch, def);
5727 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5728 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5729 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
5730 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5731 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
5732 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
5734 basic_streambuf_wchar *ret = this->strbuf;
5736 TRACE("(%p %p)\n", this, streambuf);
5738 this->strbuf = streambuf;
5739 basic_ios_wchar_clear(this, IOSTATE_goodbit);
5740 return ret;
5743 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5744 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
5745 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5746 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
5747 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
5748 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
5750 TRACE("(%p)\n", this);
5751 return this->strbuf;
5754 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
5755 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
5756 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
5757 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
5758 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
5759 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
5761 TRACE("(%p %x %x)\n", this, state, reraise);
5763 if(state != IOSTATE_goodbit)
5764 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
5767 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
5768 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
5769 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
5770 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
5771 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
5772 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
5774 basic_ios_wchar_setstate_reraise(this, state, FALSE);
5777 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
5778 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
5779 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
5780 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
5781 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
5782 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
5784 basic_ostream_wchar *ret = this->stream;
5786 TRACE("(%p %p)\n", this, ostream);
5788 this->stream = ostream;
5789 return ret;
5792 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5793 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
5794 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5795 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
5796 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
5797 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
5799 TRACE("(%p)\n", this);
5800 return this->stream;
5803 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
5804 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
5805 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
5806 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
5807 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
5808 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
5810 TRACE("(%p %c)\n", this, ch);
5811 return ctype_wchar_widen_ch(ctype_wchar_use_facet(IOS_LOCALE(this->strbuf)), ch);
5814 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
5815 /* ?swap@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
5816 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
5817 /* ?swap@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
5818 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_swap, 8)
5819 void __thiscall basic_ios_wchar_swap(basic_ios_wchar *this, basic_ios_wchar *r)
5821 void *swap_ptr;
5823 TRACE("(%p %p)\n", this, r);
5825 if(this == r)
5826 return;
5828 ios_base_swap(&this->base, &r->base);
5829 swap_ptr = this->stream;
5830 this->stream = r->stream;
5831 r->stream = swap_ptr;
5832 this->fillch ^= r->fillch;
5833 r->fillch ^= this->fillch;
5834 this->fillch ^= r->fillch;
5837 /* Caution: basic_ostream uses virtual inheritance.
5838 * All constructors have additional parameter that says if base class should be initialized.
5839 * Base class needs to be accessed using vbtable.
5841 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
5843 return (basic_ios_char*)((char*)this+this->vbtable[1]);
5846 static inline basic_ios_char* basic_ostream_char_to_basic_ios(basic_ostream_char *ptr)
5848 return (basic_ios_char*)((char*)ptr+basic_ostream_char_vbtable[1]);
5851 static inline basic_ostream_char* basic_ostream_char_from_basic_ios(basic_ios_char *ptr)
5853 return (basic_ostream_char*)((char*)ptr-basic_ostream_char_vbtable[1]);
5856 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
5857 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
5858 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 20)
5859 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
5860 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool init, MSVCP_bool virt_init)
5862 basic_ios_char *base;
5864 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, init, virt_init);
5866 if(virt_init) {
5867 this->vbtable = basic_ostream_char_vbtable;
5868 base = basic_ostream_char_get_basic_ios(this);
5869 basic_ios_char_ctor(base);
5870 }else {
5871 base = basic_ostream_char_get_basic_ios(this);
5874 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5875 if(init)
5876 basic_ios_char_init(base, strbuf, isstd);
5877 return this;
5880 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
5881 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
5882 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 12)
5883 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
5884 int uninitialized, MSVCP_bool virt_init)
5886 basic_ios_char *base;
5888 TRACE("(%p %d)\n", this, uninitialized);
5890 if(virt_init) {
5891 this->vbtable = basic_ostream_char_vbtable;
5892 base = basic_ostream_char_get_basic_ios(this);
5893 basic_ios_char_ctor(base);
5894 }else {
5895 base = basic_ostream_char_get_basic_ios(this);
5898 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
5899 ios_base_Addstd(&base->base);
5900 return this;
5903 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5904 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5905 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
5906 void __thiscall basic_ostream_char_dtor(basic_ios_char *base)
5908 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5910 /* don't destroy virtual base here */
5911 TRACE("(%p)\n", this);
5914 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5915 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5916 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
5917 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
5919 TRACE("(%p)\n", this);
5920 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(this));
5921 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
5924 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vector_dtor, 8)
5925 basic_ostream_char* __thiscall basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5927 basic_ostream_char *this = basic_ostream_char_from_basic_ios(base);
5929 TRACE("(%p %x)\n", this, flags);
5931 if(flags & 2) {
5932 /* we have an array, with the number of elements stored before the first object */
5933 INT_PTR i, *ptr = (INT_PTR *)this-1;
5935 for(i=*ptr-1; i>=0; i--)
5936 basic_ostream_char_vbase_dtor(this+i);
5937 MSVCRT_operator_delete(ptr);
5938 } else {
5939 basic_ostream_char_vbase_dtor(this);
5940 if(flags & 1)
5941 MSVCRT_operator_delete(this);
5944 return this;
5947 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
5948 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
5949 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
5950 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
5952 /* this function is not matching C++ specification */
5953 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5955 TRACE("(%p)\n", this);
5957 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
5958 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
5959 basic_ios_char_setstate(base, IOSTATE_badbit);
5960 return this;
5963 /* ?flush@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
5964 /* ?flush@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
5965 basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
5967 return basic_ostream_char_flush(ostream);
5970 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5971 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5972 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
5973 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
5975 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
5977 TRACE("(%p)\n", this);
5979 if(base->base.fmtfl & FMTFLAG_unitbuf)
5980 basic_ostream_char_flush(this);
5983 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5984 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5985 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
5986 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
5988 TRACE("(%p)\n", this);
5989 basic_ostream_char__Osfx(this);
5992 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
5994 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
5996 if(basic_ios_char_rdbuf_get(base))
5997 call_basic_streambuf_char__Lock(base->strbuf);
5999 if(ios_base_good(&base->base) && base->stream)
6000 basic_ostream_char_flush(base->stream);
6002 return ios_base_good(&base->base);
6005 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
6007 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6009 if(ios_base_good(&base->base) && !__uncaught_exception())
6010 basic_ostream_char_osfx(ostr);
6012 if(basic_ios_char_rdbuf_get(base))
6013 call_basic_streambuf_char__Unlock(base->strbuf);
6016 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
6017 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
6018 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
6019 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
6021 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6023 TRACE("(%p)\n", this);
6025 if(ios_base_good(&base->base) && base->stream)
6026 basic_ostream_char_flush(base->stream);
6027 return ios_base_good(&base->base);
6030 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
6031 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
6032 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
6033 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
6035 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6037 TRACE("(%p %c)\n", this, ch);
6039 if(!basic_ostream_char_sentry_create(this)
6040 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
6041 basic_ostream_char_sentry_destroy(this);
6042 basic_ios_char_setstate(base, IOSTATE_badbit);
6043 return this;
6046 basic_ostream_char_sentry_destroy(this);
6047 return this;
6050 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
6051 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
6052 #if STREAMOFF_BITS == 64
6053 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 16)
6054 #else
6055 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
6056 #endif
6057 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
6059 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6061 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6063 if(!ios_base_fail(&base->base)) {
6064 fpos_int seek;
6066 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6067 &seek, off, way, OPENMODE_out);
6068 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6069 basic_ios_char_setstate(base, IOSTATE_failbit);
6071 return this;
6074 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6075 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6076 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
6077 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
6079 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6081 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6083 if(!ios_base_fail(&base->base)) {
6084 fpos_int seek;
6086 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
6087 &seek, pos, OPENMODE_out);
6088 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6089 basic_ios_char_setstate(base, IOSTATE_failbit);
6091 return this;
6094 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6095 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6096 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
6097 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
6099 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6101 TRACE("(%p)\n", this);
6103 if(!ios_base_fail(&base->base)) {
6104 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
6105 ret, 0, SEEKDIR_cur, OPENMODE_out);
6106 }else {
6107 ret->off = -1;
6108 ret->pos = 0;
6109 ret->state = 0;
6111 return ret;
6114 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
6115 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
6116 #if STREAMSIZE_BITS == 64
6117 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 16)
6118 #else
6119 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
6120 #endif
6121 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
6123 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6125 TRACE("(%p %s %s)\n", this, debugstr_a(str), wine_dbgstr_longlong(count));
6127 if(!basic_ostream_char_sentry_create(this)
6128 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
6129 basic_ostream_char_sentry_destroy(this);
6130 basic_ios_char_setstate(base, IOSTATE_badbit);
6131 return this;
6134 basic_ostream_char_sentry_destroy(this);
6135 return this;
6138 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
6139 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
6140 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
6141 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
6143 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6144 int state = IOSTATE_goodbit;
6146 TRACE("(%p %d)\n", this, val);
6148 if(basic_ostream_char_sentry_create(this)) {
6149 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6150 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6151 ostreambuf_iterator_char dest;
6153 memset(&dest, 0, sizeof(dest));
6154 dest.strbuf = strbuf;
6155 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base),
6156 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
6157 ? (LONG)((unsigned short)val) : (LONG)val);
6159 basic_ostream_char_sentry_destroy(this);
6161 basic_ios_char_setstate(base, state);
6162 return this;
6165 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
6166 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
6167 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
6168 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
6170 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6171 int state = IOSTATE_goodbit;
6173 TRACE("(%p %u)\n", this, val);
6175 if(basic_ostream_char_sentry_create(this)) {
6176 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6177 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6178 ostreambuf_iterator_char dest;
6180 memset(&dest, 0, sizeof(dest));
6181 dest.strbuf = strbuf;
6182 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6184 basic_ostream_char_sentry_destroy(this);
6186 basic_ios_char_setstate(base, state);
6187 return this;
6190 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
6191 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
6192 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
6193 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
6194 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
6195 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
6197 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6198 int state = IOSTATE_goodbit;
6200 TRACE("(%p %d)\n", this, val);
6202 if(basic_ostream_char_sentry_create(this)) {
6203 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6204 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6205 ostreambuf_iterator_char dest;
6207 memset(&dest, 0, sizeof(dest));
6208 dest.strbuf = strbuf;
6209 num_put_char_put_long(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6211 basic_ostream_char_sentry_destroy(this);
6213 basic_ios_char_setstate(base, state);
6214 return this;
6217 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
6218 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
6219 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
6220 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
6221 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
6222 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
6224 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6225 int state = IOSTATE_goodbit;
6227 TRACE("(%p %u)\n", this, val);
6229 if(basic_ostream_char_sentry_create(this)) {
6230 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6231 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6232 ostreambuf_iterator_char dest;
6234 memset(&dest, 0, sizeof(dest));
6235 dest.strbuf = strbuf;
6236 num_put_char_put_ulong(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6238 basic_ostream_char_sentry_destroy(this);
6240 basic_ios_char_setstate(base, state);
6241 return this;
6244 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
6245 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
6246 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
6247 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
6249 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6250 int state = IOSTATE_goodbit;
6252 TRACE("(%p %f)\n", this, val);
6254 if(basic_ostream_char_sentry_create(this)) {
6255 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6256 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6257 ostreambuf_iterator_char dest;
6259 memset(&dest, 0, sizeof(dest));
6260 dest.strbuf = strbuf;
6261 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6263 basic_ostream_char_sentry_destroy(this);
6265 basic_ios_char_setstate(base, state);
6266 return this;
6269 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
6270 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
6271 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
6272 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
6274 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6275 int state = IOSTATE_goodbit;
6277 TRACE("(%p %lf)\n", this, val);
6279 if(basic_ostream_char_sentry_create(this)) {
6280 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6281 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6282 ostreambuf_iterator_char dest;
6284 memset(&dest, 0, sizeof(dest));
6285 dest.strbuf = strbuf;
6286 num_put_char_put_double(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6288 basic_ostream_char_sentry_destroy(this);
6290 basic_ios_char_setstate(base, state);
6291 return this;
6294 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@O@Z */
6295 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@O@Z */
6296 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ldouble, 12)
6297 basic_ostream_char* __thiscall basic_ostream_char_print_ldouble(basic_ostream_char *this, double val)
6299 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6300 int state = IOSTATE_goodbit;
6302 TRACE("(%p %lf)\n", this, val);
6304 if(basic_ostream_char_sentry_create(this)) {
6305 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6306 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6307 ostreambuf_iterator_char dest;
6309 memset(&dest, 0, sizeof(dest));
6310 dest.strbuf = strbuf;
6311 num_put_char_put_ldouble(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6313 basic_ostream_char_sentry_destroy(this);
6315 basic_ios_char_setstate(base, state);
6316 return this;
6319 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6320 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
6321 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
6322 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
6324 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6325 IOSB_iostate state = IOSTATE_badbit;
6326 int c = '\n';
6328 TRACE("(%p %p)\n", this, val);
6330 if(basic_ostream_char_sentry_create(this)) {
6331 for(c = basic_streambuf_char_sgetc(val); c!=EOF;
6332 c = basic_streambuf_char_snextc(val)) {
6333 state = IOSTATE_goodbit;
6335 if(basic_streambuf_char_sputc(base->strbuf, c) == EOF) {
6336 state = IOSTATE_badbit;
6337 break;
6340 }else {
6341 state = IOSTATE_badbit;
6343 basic_ostream_char_sentry_destroy(this);
6345 ios_base_width_set(&base->base, 0);
6346 basic_ios_char_setstate(base, state);
6347 return this;
6350 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
6351 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
6352 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
6353 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
6355 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6356 int state = IOSTATE_goodbit;
6358 TRACE("(%p %p)\n", this, val);
6360 if(basic_ostream_char_sentry_create(this)) {
6361 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6362 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6363 ostreambuf_iterator_char dest;
6365 memset(&dest, 0, sizeof(dest));
6366 dest.strbuf = strbuf;
6367 num_put_char_put_ptr(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6369 basic_ostream_char_sentry_destroy(this);
6371 basic_ios_char_setstate(base, state);
6372 return this;
6375 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
6376 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
6377 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
6378 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
6380 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6381 int state = IOSTATE_goodbit;
6383 TRACE("(%p)\n", this);
6385 if(basic_ostream_char_sentry_create(this)) {
6386 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6387 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6388 ostreambuf_iterator_char dest;
6390 memset(&dest, 0, sizeof(dest));
6391 dest.strbuf = strbuf;
6392 num_put_char_put_int64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6394 basic_ostream_char_sentry_destroy(this);
6396 basic_ios_char_setstate(base, state);
6397 return this;
6400 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
6401 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
6402 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
6403 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
6405 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6406 int state = IOSTATE_goodbit;
6408 TRACE("(%p)\n", this);
6410 if(basic_ostream_char_sentry_create(this)) {
6411 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6412 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6413 ostreambuf_iterator_char dest;
6415 memset(&dest, 0, sizeof(dest));
6416 dest.strbuf = strbuf;
6417 num_put_char_put_uint64(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6419 basic_ostream_char_sentry_destroy(this);
6421 basic_ios_char_setstate(base, state);
6422 return this;
6425 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
6426 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
6427 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
6428 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
6430 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
6431 int state = IOSTATE_goodbit;
6433 TRACE("(%p %x)\n", this, val);
6435 if(basic_ostream_char_sentry_create(this)) {
6436 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
6437 const num_put *numput = num_put_char_use_facet(IOS_LOCALE(strbuf));
6438 ostreambuf_iterator_char dest;
6440 memset(&dest, 0, sizeof(dest));
6441 dest.strbuf = strbuf;
6442 num_put_char_put_bool(numput, &dest, dest, &base->base, basic_ios_char_fill_get(base), val);
6444 basic_ostream_char_sentry_destroy(this);
6446 basic_ios_char_setstate(base, state);
6447 return this;
6450 /* ?ends@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6451 /* ?ends@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6452 basic_ostream_char* __cdecl basic_ostream_char_ends(basic_ostream_char *ostr)
6454 TRACE("(%p)\n", ostr);
6456 basic_ostream_char_put(ostr, 0);
6457 return ostr;
6460 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
6461 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
6462 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
6464 TRACE("(%p)\n", ostr);
6466 basic_ostream_char_put(ostr, '\n');
6467 basic_ostream_char_flush(ostr);
6468 return ostr;
6471 /* ??$?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 */
6472 /* ??$?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 */
6473 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
6475 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6476 IOSB_iostate state = IOSTATE_goodbit;
6478 TRACE("(%p %p)\n", ostr, str);
6480 if(basic_ostream_char_sentry_create(ostr)) {
6481 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
6482 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6484 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6485 for(; pad!=0; pad--) {
6486 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6487 state = IOSTATE_badbit;
6488 break;
6493 if(state == IOSTATE_goodbit) {
6494 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
6495 state = IOSTATE_badbit;
6498 if(state == IOSTATE_goodbit) {
6499 for(; pad!=0; pad--) {
6500 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6501 state = IOSTATE_badbit;
6502 break;
6507 base->base.wide = 0;
6508 }else {
6509 state = IOSTATE_badbit;
6511 basic_ostream_char_sentry_destroy(ostr);
6513 basic_ios_char_setstate(base, state);
6514 return ostr;
6517 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@C@Z */
6518 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@C@Z */
6519 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@D@Z */
6520 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z */
6521 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@E@Z */
6522 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@E@Z */
6523 basic_ostream_char* __cdecl basic_ostream_char_print_ch(basic_ostream_char *ostr, char ch)
6525 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6526 IOSB_iostate state = IOSTATE_goodbit;
6528 TRACE("(%p %d)\n", ostr, ch);
6530 if(basic_ostream_char_sentry_create(ostr)) {
6531 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
6533 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6534 for(; pad!=0; pad--) {
6535 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6536 state = IOSTATE_badbit;
6537 break;
6542 if(state == IOSTATE_goodbit) {
6543 if(basic_streambuf_char_sputc(base->strbuf, ch) == EOF)
6544 state = IOSTATE_badbit;
6547 if(state == IOSTATE_goodbit) {
6548 for(; pad!=0; pad--) {
6549 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6550 state = IOSTATE_badbit;
6551 break;
6556 base->base.wide = 0;
6557 }else {
6558 state = IOSTATE_badbit;
6560 basic_ostream_char_sentry_destroy(ostr);
6562 basic_ios_char_setstate(base, state);
6563 return ostr;
6566 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBC@Z */
6567 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBC@Z */
6568 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z */
6569 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z */
6570 /* ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z */
6571 /* ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z */
6572 basic_ostream_char* __cdecl basic_ostream_char_print_str(basic_ostream_char *ostr, const char *str)
6574 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
6575 IOSB_iostate state = IOSTATE_goodbit;
6577 TRACE("(%p %s)\n", ostr, str);
6579 if(basic_ostream_char_sentry_create(ostr)) {
6580 MSVCP_size_t len = strlen(str);
6581 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
6583 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6584 for(; pad!=0; pad--) {
6585 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6586 state = IOSTATE_badbit;
6587 break;
6592 if(state == IOSTATE_goodbit) {
6593 if(basic_streambuf_char_sputn(base->strbuf, str, len) != len)
6594 state = IOSTATE_badbit;
6597 if(state == IOSTATE_goodbit) {
6598 for(; pad!=0; pad--) {
6599 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
6600 state = IOSTATE_badbit;
6601 break;
6606 base->base.wide = 0;
6607 }else {
6608 state = IOSTATE_badbit;
6610 basic_ostream_char_sentry_destroy(ostr);
6612 basic_ios_char_setstate(base, state);
6613 return ostr;
6616 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
6617 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
6618 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func, 8)
6619 basic_ostream_char* __thiscall basic_ostream_char_print_func(basic_ostream_char *this,
6620 basic_ostream_char* (__cdecl *pfunc)(basic_ostream_char*))
6622 TRACE("(%p %p)\n", this, pfunc);
6623 pfunc(this);
6624 return this;
6627 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
6628 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
6629 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_basic_ios, 8)
6630 basic_ostream_char* __thiscall basic_ostream_char_print_func_basic_ios(basic_ostream_char *this,
6631 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
6633 TRACE("(%p %p)\n", this, pfunc);
6634 pfunc(basic_ostream_char_get_basic_ios(this));
6635 return this;
6638 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
6639 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
6640 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_func_ios_base, 8)
6641 basic_ostream_char* __thiscall basic_ostream_char_print_func_ios_base(
6642 basic_ostream_char *this, ios_base* (__cdecl *pfunc)(ios_base*))
6644 TRACE("(%p %p)\n", this, pfunc);
6645 pfunc(&basic_ostream_char_get_basic_ios(this)->base);
6646 return this;
6649 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IAEXAAV12@@Z */
6650 /* ?swap@?$basic_ostream@DU?$char_traits@D@std@@@std@@IEAAXAEAV12@@Z */
6651 DEFINE_THISCALL_WRAPPER(basic_ostream_char_swap, 8)
6652 void __thiscall basic_ostream_char_swap(basic_ostream_char *this, basic_ostream_char *r)
6654 TRACE("(%p %p)\n", this, r);
6656 if(this == r)
6657 return;
6659 basic_ios_char_swap(basic_ostream_char_get_basic_ios(this),
6660 basic_ostream_char_get_basic_ios(r));
6663 /* Caution: basic_ostream uses virtual inheritance. */
6664 static inline basic_ios_wchar* basic_ostream_wchar_get_basic_ios(basic_ostream_wchar *this)
6666 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
6669 static inline basic_ios_wchar* basic_ostream_wchar_to_basic_ios(basic_ostream_wchar *ptr)
6671 return (basic_ios_wchar*)((char*)ptr+basic_ostream_wchar_vbtable[1]);
6674 static inline basic_ostream_wchar* basic_ostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
6676 return (basic_ostream_wchar*)((char*)ptr-basic_ostream_wchar_vbtable[1]);
6679 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
6680 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
6681 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor, 20)
6682 basic_ostream_wchar* __thiscall basic_ostream_short_ctor(basic_ostream_wchar *this,
6683 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool init, MSVCP_bool virt_init)
6685 basic_ios_wchar *base;
6687 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
6689 if(virt_init) {
6690 this->vbtable = basic_ostream_wchar_vbtable;
6691 base = basic_ostream_wchar_get_basic_ios(this);
6692 basic_ios_wchar_ctor(base);
6693 }else {
6694 base = basic_ostream_wchar_get_basic_ios(this);
6697 base->base.vtable = &MSVCP_basic_ostream_short_vtable;
6698 if(init)
6699 basic_ios_wchar_init(base, strbuf, isstd);
6700 return this;
6703 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
6704 /* ??0?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
6705 DEFINE_THISCALL_WRAPPER(basic_ostream_short_ctor_uninitialized, 12)
6706 basic_ostream_wchar* __thiscall basic_ostream_short_ctor_uninitialized(basic_ostream_wchar *this,
6707 int uninitialized, MSVCP_bool virt_init)
6709 basic_ios_wchar *base;
6711 TRACE("(%p %d)\n", this, uninitialized);
6713 if(virt_init) {
6714 this->vbtable = basic_ostream_wchar_vbtable;
6715 base = basic_ostream_wchar_get_basic_ios(this);
6716 basic_ios_wchar_ctor(base);
6717 }else {
6718 base = basic_ostream_wchar_get_basic_ios(this);
6721 base->base.vtable = &MSVCP_basic_ostream_short_vtable;
6722 ios_base_Addstd(&base->base);
6723 return this;
6726 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
6727 /* ??1?$basic_ostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
6728 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
6729 /* ??1?$basic_ostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
6730 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_dtor, 4)
6731 void __thiscall basic_ostream_wchar_dtor(basic_ios_wchar *base)
6733 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6735 /* don't destroy virtual base here */
6736 TRACE("(%p)\n", this);
6739 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6740 /* ??_D?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6741 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6742 /* ??_D?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6743 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vbase_dtor, 4)
6744 void __thiscall basic_ostream_wchar_vbase_dtor(basic_ostream_wchar *this)
6746 TRACE("(%p)\n", this);
6747 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(this));
6748 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(this));
6751 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_vector_dtor, 8)
6752 basic_ostream_wchar* __thiscall basic_ostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
6754 basic_ostream_wchar *this = basic_ostream_wchar_from_basic_ios(base);
6756 TRACE("(%p %x)\n", this, flags);
6758 if(flags & 2) {
6759 /* we have an array, with the number of elements stored before the first object */
6760 INT_PTR i, *ptr = (INT_PTR *)this-1;
6762 for(i=*ptr-1; i>=0; i--)
6763 basic_ostream_wchar_vbase_dtor(this+i);
6764 MSVCRT_operator_delete(ptr);
6765 } else {
6766 basic_ostream_wchar_vbase_dtor(this);
6767 if(flags & 1)
6768 MSVCRT_operator_delete(this);
6771 return this;
6774 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
6775 /* ?flush@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
6776 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
6777 /* ?flush@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
6778 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_flush, 4)
6779 basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *this)
6781 /* this function is not matching C++ specification */
6782 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6784 TRACE("(%p)\n", this);
6786 if(basic_ios_wchar_rdbuf_get(base) && ios_base_good(&base->base)
6787 && basic_streambuf_wchar_pubsync(basic_ios_wchar_rdbuf_get(base))==-1)
6788 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6789 return this;
6792 /* ?flush@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
6793 /* ?flush@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
6794 /* ?flush@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
6795 /* ?flush@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
6796 basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
6798 return basic_ostream_wchar_flush(ostream);
6801 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6802 /* ?_Osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6803 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6804 /* ?_Osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6805 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar__Osfx, 4)
6806 void __thiscall basic_ostream_wchar__Osfx(basic_ostream_wchar *this)
6808 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6810 TRACE("(%p)\n", this);
6812 if(base->base.fmtfl & FMTFLAG_unitbuf)
6813 basic_ostream_wchar_flush(this);
6816 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
6817 /* ?osfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
6818 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
6819 /* ?osfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
6820 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_osfx, 4)
6821 void __thiscall basic_ostream_wchar_osfx(basic_ostream_wchar *this)
6823 TRACE("(%p)\n", this);
6824 basic_ostream_wchar__Osfx(this);
6827 static BOOL basic_ostream_wchar_sentry_create(basic_ostream_wchar *ostr)
6829 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6831 if(basic_ios_wchar_rdbuf_get(base))
6832 basic_streambuf_wchar__Lock(base->strbuf);
6834 if(ios_base_good(&base->base) && base->stream)
6835 basic_ostream_wchar_flush(base->stream);
6837 return ios_base_good(&base->base);
6840 static void basic_ostream_wchar_sentry_destroy(basic_ostream_wchar *ostr)
6842 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
6844 if(ios_base_good(&base->base) && !__uncaught_exception())
6845 basic_ostream_wchar_osfx(ostr);
6847 if(basic_ios_wchar_rdbuf_get(base))
6848 basic_streambuf_wchar__Unlock(base->strbuf);
6851 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE_NXZ */
6852 /* ?opfx@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA_NXZ */
6853 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE_NXZ */
6854 /* ?opfx@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA_NXZ */
6855 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_opfx, 4)
6856 MSVCP_bool __thiscall basic_ostream_wchar_opfx(basic_ostream_wchar *this)
6858 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6860 TRACE("(%p)\n", this);
6862 if(ios_base_good(&base->base) && base->stream)
6863 basic_ostream_wchar_flush(base->stream);
6864 return ios_base_good(&base->base);
6867 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
6868 /* ?put@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
6869 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
6870 /* ?put@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
6871 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_put, 8)
6872 basic_ostream_wchar* __thiscall basic_ostream_wchar_put(basic_ostream_wchar *this, wchar_t ch)
6874 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6876 TRACE("(%p %c)\n", this, ch);
6878 if(!basic_ostream_wchar_sentry_create(this)
6879 || basic_streambuf_wchar_sputc(base->strbuf, ch)==WEOF) {
6880 basic_ostream_wchar_sentry_destroy(this);
6881 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6882 return this;
6885 basic_ostream_wchar_sentry_destroy(this);
6886 return this;
6889 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
6890 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
6891 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
6892 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
6893 #if STREAMOFF_BITS == 64
6894 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 16)
6895 #else
6896 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp, 12)
6897 #endif
6898 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp(basic_ostream_wchar *this, streamoff off, int way)
6900 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6902 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), way);
6904 if(!ios_base_fail(&base->base)) {
6905 fpos_int seek;
6907 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6908 &seek, off, way, OPENMODE_out);
6909 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6910 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6912 return this;
6915 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6916 /* ?seekp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6917 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
6918 /* ?seekp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
6919 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_seekp_fpos, 28)
6920 basic_ostream_wchar* __thiscall basic_ostream_wchar_seekp_fpos(basic_ostream_wchar *this, fpos_int pos)
6922 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6924 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
6926 if(!ios_base_fail(&base->base)) {
6927 fpos_int seek;
6929 basic_streambuf_wchar_pubseekpos(basic_ios_wchar_rdbuf_get(base),
6930 &seek, pos, OPENMODE_out);
6931 if(seek.off==-1 && seek.pos==0 && seek.state==0)
6932 basic_ios_wchar_setstate(base, IOSTATE_failbit);
6934 return this;
6937 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6938 /* ?tellp@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6939 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
6940 /* ?tellp@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
6941 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_tellp, 8)
6942 fpos_int* __thiscall basic_ostream_wchar_tellp(basic_ostream_wchar *this, fpos_int *ret)
6944 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6946 TRACE("(%p)\n", this);
6948 if(!ios_base_fail(&base->base)) {
6949 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
6950 ret, 0, SEEKDIR_cur, OPENMODE_out);
6951 }else {
6952 ret->off = -1;
6953 ret->pos = 0;
6954 ret->state = 0;
6956 return ret;
6959 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PB_WH@Z */
6960 /* ?write@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEB_W_J@Z */
6961 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV12@PBGH@Z */
6962 /* ?write@?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEBG_J@Z */
6963 #if STREAMSIZE_BITS == 64
6964 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 16)
6965 #else
6966 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_write, 12)
6967 #endif
6968 basic_ostream_wchar* __thiscall basic_ostream_wchar_write(basic_ostream_wchar *this, const wchar_t *str, streamsize count)
6970 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6972 TRACE("(%p %s %s)\n", this, debugstr_w(str), wine_dbgstr_longlong(count));
6974 if(!basic_ostream_wchar_sentry_create(this)
6975 || basic_streambuf_wchar_sputn(base->strbuf, str, count)!=count) {
6976 basic_ostream_wchar_sentry_destroy(this);
6977 basic_ios_wchar_setstate(base, IOSTATE_badbit);
6978 return this;
6981 basic_ostream_wchar_sentry_destroy(this);
6982 return this;
6985 static basic_ostream_wchar* basic_ostream_print_short(basic_ostream_wchar *this, short val, const num_put *numput)
6987 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
6988 int state = IOSTATE_goodbit;
6990 TRACE("(%p %d)\n", this, val);
6992 if(basic_ostream_wchar_sentry_create(this)) {
6993 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
6994 ostreambuf_iterator_wchar dest;
6996 memset(&dest, 0, sizeof(dest));
6997 dest.strbuf = strbuf;
6998 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base),
6999 (ios_base_flags_get(&base->base) & FMTFLAG_basefield & (FMTFLAG_oct | FMTFLAG_hex))
7000 ? (LONG)((unsigned short)val) : (LONG)val);
7002 basic_ostream_wchar_sentry_destroy(this);
7004 basic_ios_wchar_setstate(base, state);
7005 return this;
7008 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@F@Z */
7009 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@F@Z */
7010 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_short, 8)
7011 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_short(basic_ostream_wchar *this, short val)
7013 return basic_ostream_print_short(this, val, num_put_wchar_use_facet(
7014 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7017 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@F@Z */
7018 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@F@Z */
7019 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_short, 8)
7020 basic_ostream_wchar* __thiscall basic_ostream_short_print_short(basic_ostream_wchar *this, short val)
7022 return basic_ostream_print_short(this, val, num_put_short_use_facet(
7023 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7026 static basic_ostream_wchar* basic_ostream_print_ushort(basic_ostream_wchar *this, unsigned short val, const num_put *numput)
7028 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7029 int state = IOSTATE_goodbit;
7031 TRACE("(%p %d)\n", this, val);
7033 if(basic_ostream_wchar_sentry_create(this)) {
7034 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7035 ostreambuf_iterator_wchar dest;
7037 memset(&dest, 0, sizeof(dest));
7038 dest.strbuf = strbuf;
7039 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7041 basic_ostream_wchar_sentry_destroy(this);
7043 basic_ios_wchar_setstate(base, state);
7044 return this;
7047 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@G@Z */
7048 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@G@Z */
7049 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ushort, 8)
7050 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ushort(basic_ostream_wchar *this, unsigned short val)
7052 return basic_ostream_print_ushort(this, val, num_put_wchar_use_facet(
7053 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7056 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@G@Z */
7057 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@G@Z */
7058 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ushort, 8)
7059 basic_ostream_wchar* __thiscall basic_ostream_short_print_ushort(basic_ostream_wchar *this, unsigned short val)
7061 return basic_ostream_print_ushort(this, val, num_put_short_use_facet(
7062 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7065 /* ??6std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7066 /* ??6std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7067 basic_ostream_wchar* __cdecl basic_ostream_short_print_ushort_global(basic_ostream_wchar *ostr, unsigned short val)
7069 return basic_ostream_print_ushort(ostr, val, num_put_short_use_facet(
7070 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(ostr)))));
7073 static basic_ostream_wchar* basic_ostream_print_int(basic_ostream_wchar *this, int val, const num_put *numput)
7075 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7076 int state = IOSTATE_goodbit;
7078 TRACE("(%p %d)\n", this, val);
7080 if(basic_ostream_wchar_sentry_create(this)) {
7081 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7082 ostreambuf_iterator_wchar dest;
7084 memset(&dest, 0, sizeof(dest));
7085 dest.strbuf = strbuf;
7086 num_put_wchar_put_long(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7088 basic_ostream_wchar_sentry_destroy(this);
7090 basic_ios_wchar_setstate(base, state);
7091 return this;
7094 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@H@Z */
7095 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@H@Z */
7096 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@J@Z */
7097 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@J@Z */
7098 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int, 8)
7099 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int(basic_ostream_wchar *this, int val)
7101 return basic_ostream_print_int(this, val, num_put_wchar_use_facet(
7102 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7105 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@H@Z */
7106 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@H@Z */
7107 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@J@Z */
7108 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@J@Z */
7109 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int, 8)
7110 basic_ostream_wchar* __thiscall basic_ostream_short_print_int(basic_ostream_wchar *this, int val)
7112 return basic_ostream_print_int(this, val, num_put_short_use_facet(
7113 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7116 static basic_ostream_wchar* basic_ostream_print_uint(basic_ostream_wchar *this, unsigned int val, const num_put *numput)
7118 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7119 int state = IOSTATE_goodbit;
7121 TRACE("(%p %u)\n", this, val);
7123 if(basic_ostream_wchar_sentry_create(this)) {
7124 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7125 ostreambuf_iterator_wchar dest;
7127 memset(&dest, 0, sizeof(dest));
7128 dest.strbuf = strbuf;
7129 num_put_wchar_put_ulong(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7131 basic_ostream_wchar_sentry_destroy(this);
7133 basic_ios_wchar_setstate(base, state);
7134 return this;
7137 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@I@Z */
7138 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@I@Z */
7139 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@K@Z */
7140 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@K@Z */
7141 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint, 8)
7142 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint(basic_ostream_wchar *this, unsigned int val)
7144 return basic_ostream_print_uint(this, val, num_put_wchar_use_facet(
7145 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7148 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@I@Z */
7149 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@I@Z */
7150 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@K@Z */
7151 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@K@Z */
7152 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint, 8)
7153 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint(basic_ostream_wchar *this, unsigned int val)
7155 return basic_ostream_print_uint(this, val, num_put_short_use_facet(
7156 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7159 static basic_ostream_wchar* basic_ostream_print_float(basic_ostream_wchar *this, float val, const num_put *numput)
7161 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7162 int state = IOSTATE_goodbit;
7164 TRACE("(%p %f)\n", this, val);
7166 if(basic_ostream_wchar_sentry_create(this)) {
7167 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7168 ostreambuf_iterator_wchar dest;
7170 memset(&dest, 0, sizeof(dest));
7171 dest.strbuf = strbuf;
7172 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7174 basic_ostream_wchar_sentry_destroy(this);
7176 basic_ios_wchar_setstate(base, state);
7177 return this;
7180 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@M@Z */
7181 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@M@Z */
7182 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_float, 8)
7183 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_float(basic_ostream_wchar *this, float val)
7185 return basic_ostream_print_float(this, val, num_put_wchar_use_facet(
7186 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7189 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@M@Z */
7190 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@M@Z */
7191 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_float, 8)
7192 basic_ostream_wchar* __thiscall basic_ostream_short_print_float(basic_ostream_wchar *this, float val)
7194 return basic_ostream_print_float(this, val, num_put_short_use_facet(
7195 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7198 static basic_ostream_wchar* basic_ostream_print_double(basic_ostream_wchar *this, double val, const num_put *numput)
7200 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7201 int state = IOSTATE_goodbit;
7203 TRACE("(%p %lf)\n", this, val);
7205 if(basic_ostream_wchar_sentry_create(this)) {
7206 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7207 ostreambuf_iterator_wchar dest;
7209 memset(&dest, 0, sizeof(dest));
7210 dest.strbuf = strbuf;
7211 num_put_wchar_put_double(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7213 basic_ostream_wchar_sentry_destroy(this);
7215 basic_ios_wchar_setstate(base, state);
7216 return this;
7219 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@N@Z */
7220 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@N@Z */
7221 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_double, 12)
7222 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_double(basic_ostream_wchar *this, double val)
7224 return basic_ostream_print_double(this, val, num_put_wchar_use_facet(
7225 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7228 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@N@Z */
7229 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@N@Z */
7230 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_double, 12)
7231 basic_ostream_wchar* __thiscall basic_ostream_short_print_double(basic_ostream_wchar *this, double val)
7233 return basic_ostream_print_double(this, val, num_put_short_use_facet(
7234 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7237 static basic_ostream_wchar* basic_ostream_print_ldouble(basic_ostream_wchar *this, double val, const num_put *numput)
7239 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7240 int state = IOSTATE_goodbit;
7242 TRACE("(%p %lf)\n", this, val);
7244 if(basic_ostream_wchar_sentry_create(this)) {
7245 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7246 ostreambuf_iterator_wchar dest;
7248 memset(&dest, 0, sizeof(dest));
7249 dest.strbuf = strbuf;
7250 num_put_wchar_put_ldouble(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7252 basic_ostream_wchar_sentry_destroy(this);
7254 basic_ios_wchar_setstate(base, state);
7255 return this;
7258 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@O@Z */
7259 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@O@Z */
7260 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ldouble, 12)
7261 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_wchar *this, double val)
7263 return basic_ostream_print_ldouble(this, val, num_put_wchar_use_facet(
7264 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7267 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@O@Z */
7268 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@O@Z */
7269 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ldouble, 12)
7270 basic_ostream_wchar* __thiscall basic_ostream_short_print_ldouble(basic_ostream_wchar *this, double val)
7272 return basic_ostream_print_ldouble(this, val, num_put_short_use_facet(
7273 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7276 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7277 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
7278 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7279 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
7280 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
7281 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
7283 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7284 IOSB_iostate state = IOSTATE_badbit;
7285 unsigned short c = '\n';
7287 TRACE("(%p %p)\n", this, val);
7289 if(basic_ostream_wchar_sentry_create(this)) {
7290 for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
7291 c = basic_streambuf_wchar_snextc(val)) {
7292 state = IOSTATE_goodbit;
7294 if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
7295 state = IOSTATE_badbit;
7296 break;
7299 }else {
7300 state = IOSTATE_badbit;
7302 basic_ostream_wchar_sentry_destroy(this);
7304 ios_base_width_set(&base->base, 0);
7305 basic_ios_wchar_setstate(base, state);
7306 return this;
7309 static basic_ostream_wchar* basic_ostream_print_ptr(basic_ostream_wchar *this, const void *val, const num_put *numput)
7311 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7312 int state = IOSTATE_goodbit;
7314 TRACE("(%p %p)\n", this, val);
7316 if(basic_ostream_wchar_sentry_create(this)) {
7317 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7318 ostreambuf_iterator_wchar dest;
7320 memset(&dest, 0, sizeof(dest));
7321 dest.strbuf = strbuf;
7322 num_put_wchar_put_ptr(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7324 basic_ostream_wchar_sentry_destroy(this);
7326 basic_ios_wchar_setstate(base, state);
7327 return this;
7330 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
7331 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEBX@Z */
7332 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_ptr, 8)
7333 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ptr(basic_ostream_wchar *this, const void *val)
7335 return basic_ostream_print_ptr(this, val, num_put_wchar_use_facet(
7336 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7339 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@PBX@Z */
7340 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEBX@Z */
7341 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_ptr, 8)
7342 basic_ostream_wchar* __thiscall basic_ostream_short_print_ptr(basic_ostream_wchar *this, const void *val)
7344 return basic_ostream_print_ptr(this, val, num_put_short_use_facet(
7345 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7348 static basic_ostream_wchar* basic_ostream_print_int64(basic_ostream_wchar *this, __int64 val, const num_put *numput)
7350 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7351 int state = IOSTATE_goodbit;
7353 TRACE("(%p)\n", this);
7355 if(basic_ostream_wchar_sentry_create(this)) {
7356 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7357 ostreambuf_iterator_wchar dest;
7359 memset(&dest, 0, sizeof(dest));
7360 dest.strbuf = strbuf;
7361 num_put_wchar_put_int64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7363 basic_ostream_wchar_sentry_destroy(this);
7365 basic_ios_wchar_setstate(base, state);
7366 return this;
7369 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_J@Z */
7370 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_J@Z */
7371 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_int64, 12)
7372 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_int64(basic_ostream_wchar *this, __int64 val)
7374 return basic_ostream_print_int64(this, val, num_put_wchar_use_facet(
7375 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7378 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_J@Z */
7379 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_J@Z */
7380 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_int64, 12)
7381 basic_ostream_wchar* __thiscall basic_ostream_short_print_int64(basic_ostream_wchar *this, __int64 val)
7383 return basic_ostream_print_int64(this, val, num_put_short_use_facet(
7384 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7387 static basic_ostream_wchar* basic_ostream_print_uint64(basic_ostream_wchar *this, unsigned __int64 val, const num_put *numput)
7389 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7390 int state = IOSTATE_goodbit;
7392 TRACE("(%p)\n", this);
7394 if(basic_ostream_wchar_sentry_create(this)) {
7395 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7396 ostreambuf_iterator_wchar dest;
7398 memset(&dest, 0, sizeof(dest));
7399 dest.strbuf = strbuf;
7400 num_put_wchar_put_uint64(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7402 basic_ostream_wchar_sentry_destroy(this);
7404 basic_ios_wchar_setstate(base, state);
7405 return this;
7408 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_K@Z */
7409 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_K@Z */
7410 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_uint64, 12)
7411 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7413 return basic_ostream_print_uint64(this, val, num_put_wchar_use_facet(
7414 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7417 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_K@Z */
7418 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_K@Z */
7419 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_uint64, 12)
7420 basic_ostream_wchar* __thiscall basic_ostream_short_print_uint64(basic_ostream_wchar *this, unsigned __int64 val)
7422 return basic_ostream_print_uint64(this, val, num_put_short_use_facet(
7423 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7426 static basic_ostream_wchar* basic_ostream_print_bool(basic_ostream_wchar *this, MSVCP_bool val, const num_put *numput)
7428 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
7429 int state = IOSTATE_goodbit;
7431 TRACE("(%p %x)\n", this, val);
7433 if(basic_ostream_wchar_sentry_create(this)) {
7434 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
7435 ostreambuf_iterator_wchar dest;
7437 memset(&dest, 0, sizeof(dest));
7438 dest.strbuf = strbuf;
7439 num_put_wchar_put_bool(numput, &dest, dest, &base->base, basic_ios_wchar_fill_get(base), val);
7441 basic_ostream_wchar_sentry_destroy(this);
7443 basic_ios_wchar_setstate(base, state);
7444 return this;
7447 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@_N@Z */
7448 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@_N@Z */
7449 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_bool, 8)
7450 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7452 return basic_ostream_print_bool(this, val, num_put_wchar_use_facet(
7453 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7456 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@_N@Z */
7457 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@_N@Z */
7458 DEFINE_THISCALL_WRAPPER(basic_ostream_short_print_bool, 8)
7459 basic_ostream_wchar* __thiscall basic_ostream_short_print_bool(basic_ostream_wchar *this, MSVCP_bool val)
7461 return basic_ostream_print_bool(this, val, num_put_short_use_facet(
7462 IOS_LOCALE(basic_ios_wchar_rdbuf_get(basic_ostream_wchar_get_basic_ios(this)))));
7465 /* ?ends@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7466 /* ?ends@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7467 /* ?ends@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7468 /* ?ends@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7469 basic_ostream_wchar* __cdecl basic_ostream_wchar_ends(basic_ostream_wchar *ostr)
7471 TRACE("(%p)\n", ostr);
7473 basic_ostream_wchar_put(ostr, 0);
7474 return ostr;
7477 /* ?endl@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
7478 /* ?endl@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
7479 /* ?endl@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@1@AAV21@@Z */
7480 /* ?endl@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
7481 basic_ostream_wchar* __cdecl basic_ostream_wchar_endl(basic_ostream_wchar *ostr)
7483 TRACE("(%p)\n", ostr);
7485 basic_ostream_wchar_put(ostr, '\n');
7486 basic_ostream_wchar_flush(ostr);
7487 return ostr;
7490 /* ??$?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 */
7491 /* ??$?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 */
7492 /* ??$?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 */
7493 /* ??$?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 */
7494 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar *ostr, const basic_string_wchar *str)
7496 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7497 IOSB_iostate state = IOSTATE_goodbit;
7499 TRACE("(%p %p)\n", ostr, str);
7501 if(basic_ostream_wchar_sentry_create(ostr)) {
7502 MSVCP_size_t len = MSVCP_basic_string_wchar_length(str);
7503 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7505 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7506 for(; pad!=0; pad--) {
7507 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7508 state = IOSTATE_badbit;
7509 break;
7514 if(state == IOSTATE_goodbit) {
7515 if(basic_streambuf_wchar_sputn(base->strbuf, MSVCP_basic_string_wchar_c_str(str), len) != len)
7516 state = IOSTATE_badbit;
7519 if(state == IOSTATE_goodbit) {
7520 for(; pad!=0; pad--) {
7521 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7522 state = IOSTATE_badbit;
7523 break;
7528 base->base.wide = 0;
7529 }else {
7530 state = IOSTATE_badbit;
7532 basic_ostream_wchar_sentry_destroy(ostr);
7534 basic_ios_wchar_setstate(base, state);
7535 return ostr;
7538 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
7539 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
7540 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@G@Z */
7541 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@G@Z */
7542 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
7544 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7545 IOSB_iostate state = IOSTATE_goodbit;
7547 TRACE("(%p %d)\n", ostr, ch);
7549 if(basic_ostream_wchar_sentry_create(ostr)) {
7550 streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
7552 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7553 for(; pad!=0; pad--) {
7554 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7555 state = IOSTATE_badbit;
7556 break;
7561 if(state == IOSTATE_goodbit) {
7562 if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
7563 state = IOSTATE_badbit;
7566 if(state == IOSTATE_goodbit) {
7567 for(; pad!=0; pad--) {
7568 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7569 state = IOSTATE_badbit;
7570 break;
7575 base->base.wide = 0;
7576 }else {
7577 state = IOSTATE_badbit;
7579 basic_ostream_wchar_sentry_destroy(ostr);
7581 basic_ios_wchar_setstate(base, state);
7582 return ostr;
7585 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
7586 /* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
7587 /* ??$?6GU?$char_traits@G@std@@@std@@YAAAV?$basic_ostream@GU?$char_traits@G@std@@@0@AAV10@PBG@Z */
7588 /* ??$?6GU?$char_traits@G@std@@@std@@YAAEAV?$basic_ostream@GU?$char_traits@G@std@@@0@AEAV10@PEBG@Z */
7589 basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
7591 basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
7592 IOSB_iostate state = IOSTATE_goodbit;
7594 TRACE("(%p %s)\n", ostr, debugstr_w(str));
7596 if(basic_ostream_wchar_sentry_create(ostr)) {
7597 MSVCP_size_t len = wcslen(str);
7598 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
7600 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7601 for(; pad!=0; pad--) {
7602 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7603 state = IOSTATE_badbit;
7604 break;
7609 if(state == IOSTATE_goodbit) {
7610 if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
7611 state = IOSTATE_badbit;
7614 if(state == IOSTATE_goodbit) {
7615 for(; pad!=0; pad--) {
7616 if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
7617 state = IOSTATE_badbit;
7618 break;
7623 base->base.wide = 0;
7624 }else {
7625 state = IOSTATE_badbit;
7627 basic_ostream_wchar_sentry_destroy(ostr);
7629 basic_ios_wchar_setstate(base, state);
7630 return ostr;
7633 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7634 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7635 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
7636 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
7637 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func, 8)
7638 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func(basic_ostream_wchar *this,
7639 basic_ostream_wchar* (__cdecl *pfunc)(basic_ostream_wchar*))
7641 TRACE("(%p %p)\n", this, pfunc);
7642 pfunc(this);
7643 return this;
7646 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
7647 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
7648 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
7649 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
7650 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_basic_ios, 8)
7651 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_basic_ios(basic_ostream_wchar *this,
7652 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
7654 TRACE("(%p %p)\n", this, pfunc);
7655 pfunc(basic_ostream_wchar_get_basic_ios(this));
7656 return this;
7659 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7660 /* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7661 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
7662 /* ??6?$basic_ostream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
7663 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_func_ios_base, 8)
7664 basic_ostream_wchar* __thiscall basic_ostream_wchar_print_func_ios_base(
7665 basic_ostream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
7667 TRACE("(%p %p)\n", this, pfunc);
7668 pfunc(&basic_ostream_wchar_get_basic_ios(this)->base);
7669 return this;
7672 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IAEXAAV12@@Z */
7673 /* ?swap@?$basic_ostream@GU?$char_traits@G@std@@@std@@IEAAXAEAV12@@Z */
7674 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IAEXAAV12@@Z */
7675 /* ?swap@?$basic_ostream@_WU?$char_traits@_W@std@@@std@@IEAAXAEAV12@@Z */
7676 DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_swap, 8)
7677 void __thiscall basic_ostream_wchar_swap(basic_ostream_wchar *this, basic_ostream_wchar *r)
7679 TRACE("(%p %p)\n", this, r);
7681 if(this == r)
7682 return;
7684 basic_ios_wchar_swap(basic_ostream_wchar_get_basic_ios(this),
7685 basic_ostream_wchar_get_basic_ios(r));
7688 /* Caution: basic_istream uses virtual inheritance. */
7689 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
7691 return (basic_ios_char*)((char*)this+this->vbtable[1]);
7694 static inline basic_ios_char* basic_istream_char_to_basic_ios(basic_istream_char *ptr)
7696 return (basic_ios_char*)((char*)ptr+basic_istream_char_vbtable[1]);
7699 static inline basic_istream_char* basic_istream_char_from_basic_ios(basic_ios_char *ptr)
7701 return (basic_istream_char*)((char*)ptr-basic_istream_char_vbtable[1]);
7704 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7705 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
7706 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
7707 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)
7709 basic_ios_char *base;
7711 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
7713 if(virt_init) {
7714 this->vbtable = basic_istream_char_vbtable;
7715 base = basic_istream_char_get_basic_ios(this);
7716 basic_ios_char_ctor(base);
7717 }else {
7718 base = basic_istream_char_get_basic_ios(this);
7721 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7722 this->count = 0;
7723 if(!noinit)
7724 basic_ios_char_init(base, strbuf, isstd);
7725 return this;
7728 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7729 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
7730 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
7731 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
7733 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
7736 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
7737 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
7738 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
7739 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
7741 basic_ios_char *base;
7743 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
7745 if(virt_init) {
7746 this->vbtable = basic_istream_char_vbtable;
7747 base = basic_istream_char_get_basic_ios(this);
7748 basic_ios_char_ctor(base);
7749 }else {
7750 base = basic_istream_char_get_basic_ios(this);
7753 base->base.vtable = &MSVCP_basic_istream_char_vtable;
7754 ios_base_Addstd(&base->base);
7755 return this;
7758 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
7759 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
7760 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
7761 void __thiscall basic_istream_char_dtor(basic_ios_char *base)
7763 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7765 /* don't destroy virtual base here */
7766 TRACE("(%p)\n", this);
7769 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7770 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7771 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
7772 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
7774 TRACE("(%p)\n", this);
7775 basic_istream_char_dtor(basic_istream_char_to_basic_ios(this));
7776 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
7779 DEFINE_THISCALL_WRAPPER(basic_istream_char_vector_dtor, 8)
7780 basic_istream_char* __thiscall basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
7782 basic_istream_char *this = basic_istream_char_from_basic_ios(base);
7784 TRACE("(%p %x)\n", this, flags);
7786 if(flags & 2) {
7787 /* we have an array, with the number of elements stored before the first object */
7788 INT_PTR i, *ptr = (INT_PTR *)this-1;
7790 for(i=*ptr-1; i>=0; i--)
7791 basic_istream_char_vbase_dtor(this+i);
7792 MSVCRT_operator_delete(ptr);
7793 } else {
7794 basic_istream_char_vbase_dtor(this);
7795 if(flags & 1)
7796 MSVCRT_operator_delete(this);
7799 return this;
7802 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7803 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7804 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
7805 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
7807 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7809 TRACE("(%p %d)\n", this, noskip);
7811 if(ios_base_good(&base->base)) {
7812 if(basic_ios_char_tie_get(base))
7813 basic_ostream_char_flush(basic_ios_char_tie_get(base));
7815 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
7816 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7817 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
7818 int ch;
7820 for(ch = basic_streambuf_char_sgetc(strbuf); ;
7821 ch = basic_streambuf_char_snextc(strbuf)) {
7822 if(ch==EOF || !ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
7823 break;
7828 if(!ios_base_good(&base->base)) {
7829 basic_ios_char_setstate(base, IOSTATE_failbit);
7830 return FALSE;
7833 return TRUE;
7836 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
7837 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
7838 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
7839 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
7841 return basic_istream_char__Ipfx(this, noskip);
7844 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
7845 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
7846 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
7847 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
7849 TRACE("(%p)\n", this);
7852 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
7854 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7856 if(basic_ios_char_rdbuf_get(base))
7857 call_basic_streambuf_char__Lock(base->strbuf);
7859 return basic_istream_char_ipfx(istr, noskip);
7862 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
7864 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
7866 if(basic_ios_char_rdbuf_get(base))
7867 call_basic_streambuf_char__Unlock(base->strbuf);
7870 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
7871 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
7872 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBA_JXZ */
7873 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBE_JXZ */
7874 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
7875 streamsize __thiscall basic_istream_char_gcount(const basic_istream_char *this)
7877 TRACE("(%p)\n", this);
7878 return this->count;
7881 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
7882 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
7883 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
7884 int __thiscall basic_istream_char_get(basic_istream_char *this)
7886 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7887 int ret;
7889 TRACE("(%p)\n", this);
7891 this->count = 0;
7893 if(!basic_istream_char_sentry_create(this, TRUE)) {
7894 basic_istream_char_sentry_destroy(this);
7895 return EOF;
7898 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
7899 basic_istream_char_sentry_destroy(this);
7900 if(ret == EOF)
7901 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
7902 else
7903 this->count++;
7905 return ret;
7908 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
7909 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
7910 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
7911 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
7913 int ret;
7915 TRACE("(%p %p)\n", this, ch);
7917 ret = basic_istream_char_get(this);
7918 if(ret != EOF)
7919 *ch = (char)ret;
7920 return this;
7923 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
7924 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
7925 #if STREAMSIZE_BITS == 64
7926 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 20)
7927 #else
7928 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
7929 #endif
7930 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
7932 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7933 int ch = delim;
7935 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_an(&delim, 1));
7937 this->count = 0;
7939 if(basic_istream_char_sentry_create(this, TRUE)) {
7940 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
7942 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
7943 ch = basic_streambuf_char_snextc(strbuf)) {
7944 if(ch==EOF || ch==delim)
7945 break;
7947 *str++ = ch;
7948 this->count++;
7949 count--;
7952 basic_istream_char_sentry_destroy(this);
7954 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
7955 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
7956 if(count > 0)
7957 *str = 0;
7958 return this;
7961 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
7962 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
7963 #if STREAMSIZE_BITS == 64
7964 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 16)
7965 #else
7966 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
7967 #endif
7968 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
7970 return basic_istream_char_get_str_delim(this, str, count, '\n');
7973 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7974 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
7975 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
7976 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
7978 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
7979 int ch = delim;
7981 TRACE("(%p %p %s)\n", this, strbuf, debugstr_an(&delim, 1));
7983 this->count = 0;
7985 if(basic_istream_char_sentry_create(this, TRUE)) {
7986 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
7988 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
7989 ch = basic_streambuf_char_snextc(strbuf_read)) {
7990 if(ch==EOF || ch==delim)
7991 break;
7993 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
7994 break;
7995 this->count++;
7998 basic_istream_char_sentry_destroy(this);
8000 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
8001 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8002 return this;
8005 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8006 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
8007 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
8008 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
8010 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
8013 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
8014 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
8015 #if STREAMSIZE_BITS == 64
8016 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 20)
8017 #else
8018 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
8019 #endif
8020 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
8022 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8023 int ch = (unsigned char)delim;
8025 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_an(&delim, 1));
8027 this->count = 0;
8029 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
8030 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8032 while(count > 1) {
8033 ch = basic_streambuf_char_sbumpc(strbuf);
8035 if(ch==EOF || ch==(unsigned char)delim)
8036 break;
8038 *str++ = ch;
8039 this->count++;
8040 count--;
8043 if(ch == (unsigned char)delim)
8044 this->count++;
8045 else if(ch != EOF) {
8046 ch = basic_streambuf_char_sgetc(strbuf);
8048 if(ch == (unsigned char)delim) {
8049 basic_streambuf_char__Gninc(strbuf);
8050 this->count++;
8054 basic_istream_char_sentry_destroy(this);
8056 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
8057 (!this->count || (ch!=(unsigned char)delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
8058 if(count > 0)
8059 *str = 0;
8060 return this;
8063 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8064 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8065 #if STREAMSIZE_BITS == 64
8066 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 16)
8067 #else
8068 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
8069 #endif
8070 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
8072 return basic_istream_char_getline_delim(this, str, count, '\n');
8075 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
8076 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8077 #if STREAMSIZE_BITS == 64
8078 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 16)
8079 #else
8080 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
8081 #endif
8082 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
8084 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8085 int ch = (unsigned char)delim;
8086 unsigned int state;
8088 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
8090 this->count = 0;
8092 if(basic_istream_char_sentry_create(this, TRUE)) {
8093 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8094 state = IOSTATE_goodbit;
8096 while(count > 0) {
8097 ch = basic_streambuf_char_sbumpc(strbuf);
8099 if(ch==EOF) {
8100 state = IOSTATE_eofbit;
8101 break;
8104 if(ch==(unsigned char)delim)
8105 break;
8107 this->count++;
8108 if(count != INT_MAX)
8109 count--;
8111 }else
8112 state = IOSTATE_failbit;
8113 basic_istream_char_sentry_destroy(this);
8115 basic_ios_char_setstate(base, state);
8116 return this;
8119 /* ?ws@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@1@AAV21@@Z */
8120 /* ?ws@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
8121 basic_istream_char* __cdecl ws_basic_istream_char(basic_istream_char *istream)
8123 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8124 int ch = '\n';
8126 TRACE("(%p)\n", istream);
8128 if(basic_istream_char_sentry_create(istream, TRUE)) {
8129 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8130 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(strbuf));
8132 for(ch = basic_streambuf_char_sgetc(strbuf); ctype_char_is_ch(ctype, _SPACE, ch);
8133 ch = basic_streambuf_char_snextc(strbuf)) {
8134 if(ch == EOF)
8135 break;
8138 basic_istream_char_sentry_destroy(istream);
8140 if(ch == EOF)
8141 basic_ios_char_setstate(base, IOSTATE_eofbit);
8142 return istream;
8145 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8146 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8147 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
8148 int __thiscall basic_istream_char_peek(basic_istream_char *this)
8150 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8151 int ret = EOF;
8153 TRACE("(%p)\n", this);
8155 this->count = 0;
8157 if(basic_istream_char_sentry_create(this, TRUE))
8158 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8159 basic_istream_char_sentry_destroy(this);
8161 if (ret == EOF)
8162 basic_ios_char_setstate(base, IOSTATE_eofbit);
8164 return ret;
8167 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
8168 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
8169 #if STREAMSIZE_BITS == 64
8170 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 20)
8171 #else
8172 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
8173 #endif
8174 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8176 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8177 IOSB_iostate state = IOSTATE_goodbit;
8179 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8181 if(basic_istream_char_sentry_create(this, TRUE)) {
8182 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8184 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
8185 if(this->count != count)
8186 state |= IOSTATE_failbit | IOSTATE_eofbit;
8187 }else {
8188 this->count = 0;
8190 basic_istream_char_sentry_destroy(this);
8192 basic_ios_char_setstate(base, state);
8193 return this;
8196 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
8197 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
8198 #if STREAMSIZE_BITS == 64
8199 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 16)
8200 #else
8201 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
8202 #endif
8203 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
8205 return basic_istream_char__Read_s(this, str, -1, count);
8208 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
8209 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
8210 #if STREAMSIZE_BITS == 64
8211 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 20)
8212 #else
8213 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
8214 #endif
8215 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
8217 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8218 IOSB_iostate state = IOSTATE_goodbit;
8220 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
8222 this->count = 0;
8224 if(basic_istream_char_sentry_create(this, TRUE)) {
8225 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
8226 if(avail > count)
8227 avail = count;
8229 if(avail == -1)
8230 state |= IOSTATE_eofbit;
8231 else if(avail > 0)
8232 basic_istream_char__Read_s(this, str, size, avail);
8233 }else {
8234 state |= IOSTATE_failbit;
8236 basic_istream_char_sentry_destroy(this);
8238 basic_ios_char_setstate(base, state);
8239 return this->count;
8242 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
8243 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
8244 #if STREAMSIZE_BITS == 64
8245 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 16)
8246 #else
8247 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
8248 #endif
8249 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
8251 return basic_istream_char__Readsome_s(this, str, count, count);
8254 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
8255 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
8256 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
8257 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
8259 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8260 IOSB_iostate state = IOSTATE_goodbit;
8262 TRACE("(%p %c)\n", this, ch);
8264 this->count = 0;
8266 if(basic_istream_char_sentry_create(this, TRUE)) {
8267 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8269 if(!ios_base_good(&base->base))
8270 state |= IOSTATE_failbit;
8271 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
8272 state |= IOSTATE_badbit;
8274 basic_istream_char_sentry_destroy(this);
8276 basic_ios_char_setstate(base, state);
8277 return this;
8280 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
8281 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
8282 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
8283 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
8285 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8286 IOSB_iostate state = IOSTATE_goodbit;
8288 TRACE("(%p)\n", this);
8290 this->count = 0;
8292 if(basic_istream_char_sentry_create(this, TRUE)) {
8293 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8295 if(!ios_base_good(&base->base))
8296 state |= IOSTATE_failbit;
8297 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
8298 state |= IOSTATE_badbit;
8300 basic_istream_char_sentry_destroy(this);
8302 basic_ios_char_setstate(base, state);
8303 return this;
8306 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
8307 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
8308 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
8309 int __thiscall basic_istream_char_sync(basic_istream_char *this)
8311 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8312 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8314 TRACE("(%p)\n", this);
8316 if(!strbuf)
8317 return -1;
8319 if(basic_istream_char_sentry_create(this, TRUE)) {
8320 if(basic_streambuf_char_pubsync(strbuf) != -1) {
8321 basic_istream_char_sentry_destroy(this);
8322 return 0;
8325 basic_istream_char_sentry_destroy(this);
8327 basic_ios_char_setstate(base, IOSTATE_badbit);
8328 return -1;
8331 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
8332 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
8333 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
8334 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
8336 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8338 TRACE("(%p %p)\n", this, ret);
8340 if(ios_base_fail(&base->base)) {
8341 ret->off = -1;
8342 ret->pos = 0;
8343 ret->state = 0;
8344 return ret;
8347 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
8348 ret, 0, SEEKDIR_cur, OPENMODE_in);
8350 if(ret->off==-1 && ret->pos==0 && ret->state==0)
8351 basic_ios_char_setstate(base, IOSTATE_failbit);
8353 return ret;
8356 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
8357 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
8358 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
8359 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
8360 #if STREAMOFF_BITS == 64
8361 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 16)
8362 #else
8363 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
8364 #endif
8365 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
8367 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8369 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
8371 if(!ios_base_fail(&base->base)) {
8372 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8373 fpos_int ret;
8375 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
8378 return this;
8381 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
8382 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
8383 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
8384 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
8386 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8388 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
8390 if(!ios_base_fail(&base->base)) {
8391 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8392 fpos_int ret;
8394 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
8397 return this;
8400 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
8401 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
8402 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
8403 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *v)
8405 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8406 int state = IOSTATE_goodbit;
8408 TRACE("(%p %p)\n", this, v);
8410 if(basic_istream_char_sentry_create(this, FALSE)) {
8411 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8412 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8413 istreambuf_iterator_char first={0}, last={0};
8414 LONG tmp;
8416 first.strbuf = strbuf;
8417 num_get_char_get_long(numget, &last, first, last, &base->base, &state, &tmp);
8419 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
8420 *v = tmp;
8421 else
8422 state |= IOSTATE_failbit;
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@AAG@Z */
8431 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
8432 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
8433 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *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(IOS_LOCALE(strbuf));
8443 istreambuf_iterator_char first={0}, last={0};
8445 first.strbuf = strbuf;
8446 num_get_char_get_ushort(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@AAH@Z */
8455 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
8456 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
8457 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *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(IOS_LOCALE(strbuf));
8467 istreambuf_iterator_char first={0}, last={0};
8469 first.strbuf = strbuf;
8470 num_get_char_get_long(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@AAI@Z */
8479 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
8480 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
8481 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *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(IOS_LOCALE(strbuf));
8491 istreambuf_iterator_char first={0}, last={0};
8493 first.strbuf = strbuf;
8494 num_get_char_get_uint(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@AAJ@Z */
8503 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
8504 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
8505 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *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(IOS_LOCALE(strbuf));
8515 istreambuf_iterator_char first={0}, last={0};
8517 first.strbuf = strbuf;
8518 num_get_char_get_long(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@AAK@Z */
8527 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
8528 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
8529 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *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(IOS_LOCALE(strbuf));
8539 istreambuf_iterator_char first={0}, last={0};
8541 first.strbuf = strbuf;
8542 num_get_char_get_ulong(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@AAM@Z */
8551 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
8552 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
8553 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *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(IOS_LOCALE(strbuf));
8563 istreambuf_iterator_char first={0}, last={0};
8565 first.strbuf = strbuf;
8566 num_get_char_get_float(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@AAN@Z */
8575 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
8576 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
8577 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *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(IOS_LOCALE(strbuf));
8587 istreambuf_iterator_char first={0}, last={0};
8589 first.strbuf = strbuf;
8590 num_get_char_get_double(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@AAO@Z */
8599 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
8600 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
8601 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, double *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(IOS_LOCALE(strbuf));
8611 istreambuf_iterator_char first={0}, last={0};
8613 first.strbuf = strbuf;
8614 num_get_char_get_ldouble(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@AAPAX@Z */
8623 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
8624 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
8625 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **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(IOS_LOCALE(strbuf));
8635 istreambuf_iterator_char first={0}, last={0};
8637 first.strbuf = strbuf;
8638 num_get_char_get_void(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 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
8647 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
8648 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
8649 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *v)
8651 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8652 int state = IOSTATE_goodbit;
8654 TRACE("(%p %p)\n", this, v);
8656 if(basic_istream_char_sentry_create(this, FALSE)) {
8657 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8658 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8659 istreambuf_iterator_char first={0}, last={0};
8661 first.strbuf = strbuf;
8662 num_get_char_get_int64(numget, &last, first, last, &base->base, &state, v);
8664 basic_istream_char_sentry_destroy(this);
8666 basic_ios_char_setstate(base, state);
8667 return this;
8670 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
8671 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
8672 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
8673 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *v)
8675 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8676 int state = IOSTATE_goodbit;
8678 TRACE("(%p %p)\n", this, v);
8680 if(basic_istream_char_sentry_create(this, FALSE)) {
8681 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8682 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8683 istreambuf_iterator_char first={0}, last={0};
8685 first.strbuf = strbuf;
8686 num_get_char_get_uint64(numget, &last, first, last, &base->base, &state, v);
8688 basic_istream_char_sentry_destroy(this);
8690 basic_ios_char_setstate(base, state);
8691 return this;
8694 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
8695 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
8696 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
8697 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *v)
8699 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8700 int state = IOSTATE_goodbit;
8702 TRACE("(%p %p)\n", this, v);
8704 if(basic_istream_char_sentry_create(this, FALSE)) {
8705 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8706 const num_get *numget = num_get_char_use_facet(IOS_LOCALE(strbuf));
8707 istreambuf_iterator_char first={0}, last={0};
8709 first.strbuf = strbuf;
8710 num_get_char_get_bool(numget, &last, first, last, &base->base, &state, v);
8712 basic_istream_char_sentry_destroy(this);
8714 basic_ios_char_setstate(base, state);
8715 return this;
8718 /* ??$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 */
8719 /* ??$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 */
8720 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
8721 basic_istream_char *istream, basic_string_char *str, char delim)
8723 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8724 IOSB_iostate state = IOSTATE_goodbit;
8725 int c = (unsigned char)delim;
8727 TRACE("(%p %p %s)\n", istream, str, debugstr_an(&delim, 1));
8729 MSVCP_basic_string_char_clear(str);
8730 if(basic_istream_char_sentry_create(istream, TRUE)) {
8731 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
8733 c = basic_streambuf_char_sgetc(strbuf);
8734 for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf))
8735 MSVCP_basic_string_char_append_ch(str, c);
8736 if(c==EOF) state |= IOSTATE_eofbit;
8737 else if(c==(unsigned char)delim) basic_streambuf_char_sbumpc(strbuf);
8739 if(!MSVCP_basic_string_char_length(str) && c!=(unsigned char)delim) state |= IOSTATE_failbit;
8741 basic_istream_char_sentry_destroy(istream);
8743 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream), state);
8744 return istream;
8747 /* ??$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 */
8748 /* ??$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 */
8749 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
8750 basic_istream_char *istream, basic_string_char *str)
8752 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
8755 /* ??$?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 */
8756 /* ??$?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 */
8757 basic_istream_char* __cdecl basic_istream_char_read_bstr(
8758 basic_istream_char *istream, basic_string_char *str)
8760 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8761 IOSB_iostate state = IOSTATE_failbit;
8762 int c = '\n';
8764 TRACE("(%p %p)\n", istream, str);
8766 if(basic_istream_char_sentry_create(istream, FALSE)) {
8767 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8768 MSVCP_size_t count = ios_base_width_get(&base->base);
8770 if(!count)
8771 count = -1;
8773 MSVCP_basic_string_char_clear(str);
8775 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8776 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8777 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8778 state = IOSTATE_goodbit;
8779 MSVCP_basic_string_char_append_ch(str, c);
8782 basic_istream_char_sentry_destroy(istream);
8784 ios_base_width_set(&base->base, 0);
8785 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8786 return istream;
8789 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAD@Z */
8790 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAD@Z */
8791 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAC@Z */
8792 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAC@Z */
8793 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@PAE@Z */
8794 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@PEAE@Z */
8795 basic_istream_char* __cdecl basic_istream_char_read_str(basic_istream_char *istream, char *str)
8797 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
8798 IOSB_iostate state = IOSTATE_failbit;
8799 int c = '\n';
8801 TRACE("(%p %p)\n", istream, str);
8803 if(basic_istream_char_sentry_create(istream, FALSE)) {
8804 const ctype_char *ctype = ctype_char_use_facet(IOS_LOCALE(base->strbuf));
8805 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
8807 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
8808 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
8809 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base)), count--) {
8810 state = IOSTATE_goodbit;
8811 *str++ = c;
8814 basic_istream_char_sentry_destroy(istream);
8816 *str = 0;
8817 ios_base_width_set(&base->base, 0);
8818 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8819 return istream;
8822 /* ??$?5DU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAD@Z */
8823 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAD@Z */
8824 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAC@Z */
8825 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAC@Z */
8826 /* ??$?5U?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAE@Z */
8827 /* ??$?5U?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAE@Z */
8828 basic_istream_char* __cdecl basic_istream_char_read_ch(basic_istream_char *istream, char *ch)
8830 IOSB_iostate state = IOSTATE_failbit;
8831 int c = 0;
8833 TRACE("(%p %p)\n", istream, ch);
8835 if(basic_istream_char_sentry_create(istream, FALSE)) {
8836 c = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(
8837 basic_istream_char_get_basic_ios(istream)));
8838 if(c != EOF) {
8839 state = IOSTATE_goodbit;
8840 *ch = c;
8843 basic_istream_char_sentry_destroy(istream);
8845 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
8846 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8847 return istream;
8850 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8851 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
8852 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_streambuf, 8)
8853 basic_istream_char* __thiscall basic_istream_char_read_streambuf(
8854 basic_istream_char *this, basic_streambuf_char *streambuf)
8856 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8857 IOSB_iostate state = IOSTATE_failbit;
8858 int c = '\n';
8860 TRACE("(%p %p)\n", this, streambuf);
8862 if(basic_istream_char_sentry_create(this, FALSE)) {
8863 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base)); c!=EOF;
8864 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
8865 state = IOSTATE_goodbit;
8866 if(basic_streambuf_char_sputc(streambuf, c) == EOF)
8867 break;
8870 basic_istream_char_sentry_destroy(this);
8872 basic_ios_char_setstate(base, state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
8873 return this;
8876 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
8877 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
8878 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func, 8)
8879 basic_istream_char* __thiscall basic_istream_char_read_func(basic_istream_char *this,
8880 basic_istream_char* (__cdecl *pfunc)(basic_istream_char*))
8882 TRACE("(%p %p)\n", this, pfunc);
8883 pfunc(this);
8884 return this;
8887 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@DU?$char_traits@D@std@@@1@AAV21@@Z@Z */
8888 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@DU?$char_traits@D@std@@@1@AEAV21@@Z@Z */
8889 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_basic_ios, 8)
8890 basic_istream_char* __thiscall basic_istream_char_read_func_basic_ios(basic_istream_char *this,
8891 basic_ios_char* (__cdecl *pfunc)(basic_ios_char*))
8893 TRACE("(%p %p)\n", this, pfunc);
8894 pfunc(basic_istream_char_get_basic_ios(this));
8895 return this;
8898 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
8899 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
8900 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_func_ios_base, 8)
8901 basic_istream_char* __thiscall basic_istream_char_read_func_ios_base(basic_istream_char *this,
8902 ios_base* (__cdecl *pfunc)(ios_base*))
8904 TRACE("(%p %p)\n", this, pfunc);
8905 pfunc(&basic_istream_char_get_basic_ios(this)->base);
8906 return this;
8909 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@M@0@@Z */
8910 /* ??$?5MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@M@0@@Z */
8911 basic_istream_char* __cdecl basic_istream_char_read_complex_float(basic_istream_char *this, complex_float *v)
8913 float r;
8914 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8916 TRACE("(%p %p)\n", this, v);
8918 ws_basic_istream_char(this);
8919 if(basic_istream_char_peek(this) == '(') {
8920 char c;
8921 basic_istream_char_get(this);
8922 basic_istream_char_read_float(this, &r);
8924 if(ios_base_fail(&base->base))
8925 return this;
8927 ws_basic_istream_char(this);
8928 c = basic_istream_char_peek(this);
8929 if(c == ',') {
8930 float i;
8931 basic_istream_char_get(this);
8932 basic_istream_char_read_float(this, &i);
8934 if(ios_base_fail(&base->base))
8935 return this;
8937 ws_basic_istream_char(this);
8938 c = basic_istream_char_peek(this);
8939 if(c == ')') { /* supported format: (real, imag) */
8940 basic_istream_char_get(this);
8941 v->real = r;
8942 v->imag = i;
8943 }else {
8944 basic_ios_char_setstate(base, IOSTATE_failbit);
8945 return this;
8947 }else if(c == ')') { /* supported format: (real) */
8948 basic_istream_char_get(this);
8949 v->real = r;
8950 v->imag = 0;
8951 }else {
8952 basic_ios_char_setstate(base, IOSTATE_failbit);
8953 return this;
8955 }else { /* supported format: real */
8956 basic_istream_char_read_float(this, &r);
8958 if(ios_base_fail(&base->base))
8959 return this;
8961 v->real = r;
8962 v->imag = 0;
8965 return this;
8968 /* ??$?5NDU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@N@0@@Z */
8969 /* ??$?5DU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@N@0@@Z */
8970 basic_istream_char* __cdecl basic_istream_char_read_complex_double(basic_istream_char *this, complex_double *v)
8972 double r;
8973 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
8975 TRACE("(%p %p)\n", this, v);
8977 ws_basic_istream_char(this);
8978 if(basic_istream_char_peek(this) == '(') {
8979 char c;
8980 basic_istream_char_get(this);
8981 basic_istream_char_read_double(this, &r);
8983 if(ios_base_fail(&base->base))
8984 return this;
8986 ws_basic_istream_char(this);
8987 c = basic_istream_char_peek(this);
8988 if(c == ',') {
8989 double i;
8990 basic_istream_char_get(this);
8991 basic_istream_char_read_double(this, &i);
8993 if(ios_base_fail(&base->base))
8994 return this;
8996 ws_basic_istream_char(this);
8997 c = basic_istream_char_peek(this);
8998 if(c == ')') { /* supported format: (real, imag) */
8999 basic_istream_char_get(this);
9000 v->real = r;
9001 v->imag = i;
9002 }else {
9003 basic_ios_char_setstate(base, IOSTATE_failbit);
9004 return this;
9006 }else if(c == ')') { /* supported format: (real) */
9007 basic_istream_char_get(this);
9008 v->real = r;
9009 v->imag = 0;
9010 }else {
9011 basic_ios_char_setstate(base, IOSTATE_failbit);
9012 return this;
9014 }else { /* supported format: real */
9015 basic_istream_char_read_double(this, &r);
9017 if(ios_base_fail(&base->base))
9018 return this;
9020 v->real = r;
9021 v->imag = 0;
9024 return this;
9027 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$complex@O@0@@Z */
9028 /* ??$?5ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$complex@O@0@@Z */
9029 basic_istream_char* __cdecl basic_istream_char_read_complex_ldouble(basic_istream_char *this, complex_double *v)
9031 double r;
9032 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
9034 TRACE("(%p %p)\n", this, v);
9036 ws_basic_istream_char(this);
9037 if(basic_istream_char_peek(this) == '(') {
9038 char c;
9039 basic_istream_char_get(this);
9040 basic_istream_char_read_ldouble(this, &r);
9042 if(ios_base_fail(&base->base))
9043 return this;
9045 ws_basic_istream_char(this);
9046 c = basic_istream_char_peek(this);
9047 if(c == ',') {
9048 double i;
9049 basic_istream_char_get(this);
9050 basic_istream_char_read_ldouble(this, &i);
9052 if(ios_base_fail(&base->base))
9053 return this;
9055 ws_basic_istream_char(this);
9056 c = basic_istream_char_peek(this);
9057 if(c == ')') { /* supported format: (real, imag) */
9058 basic_istream_char_get(this);
9059 v->real = r;
9060 v->imag = i;
9061 }else {
9062 basic_ios_char_setstate(base, IOSTATE_failbit);
9063 return this;
9065 }else if(c == ')') { /* supported format: (real) */
9066 basic_istream_char_get(this);
9067 v->real = r;
9068 v->imag = 0;
9069 }else {
9070 basic_ios_char_setstate(base, IOSTATE_failbit);
9071 return this;
9073 }else { /* supported format: real */
9074 basic_istream_char_read_ldouble(this, &r);
9076 if(ios_base_fail(&base->base))
9077 return this;
9079 v->real = r;
9080 v->imag = 0;
9083 return this;
9086 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
9087 /* ?swap@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
9088 DEFINE_THISCALL_WRAPPER(basic_istream_char_swap, 8)
9089 void __thiscall basic_istream_char_swap(basic_istream_char *this, basic_istream_char *r)
9091 TRACE("(%p %p)\n", this, r);
9093 if(this == r)
9094 return;
9096 basic_ios_char_swap(basic_istream_char_get_basic_ios(this),
9097 basic_istream_char_get_basic_ios(r));
9098 this->count ^= r->count;
9099 r->count ^= this->count;
9100 this->count ^= r->count;
9103 /* Caution: basic_istream uses virtual inheritance. */
9104 static inline basic_ios_wchar* basic_istream_wchar_get_basic_ios(basic_istream_wchar *this)
9106 return (basic_ios_wchar*)((char*)this+this->vbtable[1]);
9109 static inline basic_ios_wchar* basic_istream_wchar_to_basic_ios(basic_istream_wchar *ptr)
9111 return (basic_ios_wchar*)((char*)ptr+basic_istream_wchar_vbtable[1]);
9114 static inline basic_istream_wchar* basic_istream_wchar_from_basic_ios(basic_ios_wchar *ptr)
9116 return (basic_istream_wchar*)((char*)ptr-basic_istream_wchar_vbtable[1]);
9119 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9120 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N1@Z */
9121 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_init, 20)
9122 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_init(basic_istream_wchar *this,
9123 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9125 basic_ios_wchar *base;
9127 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
9129 if(virt_init) {
9130 this->vbtable = basic_istream_wchar_vbtable;
9131 base = basic_istream_wchar_get_basic_ios(this);
9132 basic_ios_wchar_ctor(base);
9133 }else {
9134 base = basic_istream_wchar_get_basic_ios(this);
9137 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9138 this->count = 0;
9139 if(!noinit)
9140 basic_ios_wchar_init(base, strbuf, isstd);
9141 return this;
9144 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9145 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N1@Z */
9146 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_init, 20)
9147 basic_istream_wchar* __thiscall basic_istream_short_ctor_init(basic_istream_wchar *this,
9148 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool noinit, MSVCP_bool virt_init)
9150 basic_istream_wchar_ctor_init(this, strbuf, isstd, noinit, virt_init);
9151 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9152 return this;
9155 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9156 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@_N@Z */
9157 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor, 16)
9158 basic_istream_wchar* __thiscall basic_istream_wchar_ctor(basic_istream_wchar *this,
9159 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9161 return basic_istream_wchar_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9164 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9165 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@_N@Z */
9166 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor, 16)
9167 basic_istream_wchar* __thiscall basic_istream_short_ctor(basic_istream_wchar *this,
9168 basic_streambuf_wchar *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
9170 return basic_istream_short_ctor_init(this, strbuf, isstd, FALSE, virt_init);
9173 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9174 /* ??0?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9175 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ctor_uninitialized, 12)
9176 basic_istream_wchar* __thiscall basic_istream_wchar_ctor_uninitialized(
9177 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9179 basic_ios_wchar *base;
9181 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
9183 if(virt_init) {
9184 this->vbtable = basic_istream_wchar_vbtable;
9185 base = basic_istream_wchar_get_basic_ios(this);
9186 basic_ios_wchar_ctor(base);
9187 }else {
9188 base = basic_istream_wchar_get_basic_ios(this);
9191 base->base.vtable = &MSVCP_basic_istream_wchar_vtable;
9192 ios_base_Addstd(&base->base);
9193 return this;
9196 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QAE@W4_Uninitialized@1@@Z */
9197 /* ??0?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
9198 DEFINE_THISCALL_WRAPPER(basic_istream_short_ctor_uninitialized, 12)
9199 basic_istream_wchar* __thiscall basic_istream_short_ctor_uninitialized(
9200 basic_istream_wchar *this, int uninitialized, MSVCP_bool virt_init)
9202 basic_istream_wchar_ctor_uninitialized(this, uninitialized, virt_init);
9203 basic_istream_wchar_get_basic_ios(this)->base.vtable = &MSVCP_basic_istream_short_vtable;
9204 return this;
9207 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
9208 /* ??1?$basic_istream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
9209 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UAE@XZ */
9210 /* ??1?$basic_istream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
9211 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_dtor, 4)
9212 void __thiscall basic_istream_wchar_dtor(basic_ios_wchar *base)
9214 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9216 /* don't destroy virtual base here */
9217 TRACE("(%p)\n", this);
9220 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9221 /* ??_D?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9222 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9223 /* ??_D?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9224 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vbase_dtor, 4)
9225 void __thiscall basic_istream_wchar_vbase_dtor(basic_istream_wchar *this)
9227 TRACE("(%p)\n", this);
9228 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(this));
9229 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(this));
9232 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_vector_dtor, 8)
9233 basic_istream_wchar* __thiscall basic_istream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
9235 basic_istream_wchar *this = basic_istream_wchar_from_basic_ios(base);
9237 TRACE("(%p %x)\n", this, flags);
9239 if(flags & 2) {
9240 /* we have an array, with the number of elements stored before the first object */
9241 INT_PTR i, *ptr = (INT_PTR *)this-1;
9243 for(i=*ptr-1; i>=0; i--)
9244 basic_istream_wchar_vbase_dtor(this+i);
9245 MSVCRT_operator_delete(ptr);
9246 } else {
9247 basic_istream_wchar_vbase_dtor(this);
9248 if(flags & 1)
9249 MSVCRT_operator_delete(this);
9252 return this;
9255 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9256 /* ?_Ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9257 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9258 /* ?_Ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9259 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Ipfx, 8)
9260 MSVCP_bool __thiscall basic_istream_wchar__Ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9262 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9264 TRACE("(%p %d)\n", this, noskip);
9266 if(ios_base_good(&base->base)) {
9267 if(basic_ios_wchar_tie_get(base))
9268 basic_ostream_wchar_flush(basic_ios_wchar_tie_get(base));
9270 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
9271 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9272 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(base->strbuf));
9273 int ch;
9275 for(ch = basic_streambuf_wchar_sgetc(strbuf); ;
9276 ch = basic_streambuf_wchar_snextc(strbuf)) {
9277 if(ch==WEOF || !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, ch))
9278 break;
9283 if(!ios_base_good(&base->base)) {
9284 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9285 return FALSE;
9287 return TRUE;
9290 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE_N_N@Z */
9291 /* ?ipfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_N_N@Z */
9292 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE_N_N@Z */
9293 /* ?ipfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_N_N@Z */
9294 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ipfx, 8)
9295 MSVCP_bool __thiscall basic_istream_wchar_ipfx(basic_istream_wchar *this, MSVCP_bool noskip)
9297 return basic_istream_wchar__Ipfx(this, noskip);
9300 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
9301 /* ?isfx@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
9302 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXXZ */
9303 /* ?isfx@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
9304 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_isfx, 4)
9305 void __thiscall basic_istream_wchar_isfx(basic_istream_wchar *this)
9307 TRACE("(%p)\n", this);
9310 static BOOL basic_istream_wchar_sentry_create(basic_istream_wchar *istr, MSVCP_bool noskip)
9312 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9314 if(basic_ios_wchar_rdbuf_get(base))
9315 basic_streambuf_wchar__Lock(base->strbuf);
9317 return basic_istream_wchar_ipfx(istr, noskip);
9320 static void basic_istream_wchar_sentry_destroy(basic_istream_wchar *istr)
9322 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istr);
9324 if(basic_ios_wchar_rdbuf_get(base))
9325 basic_streambuf_wchar__Unlock(base->strbuf);
9328 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBEHXZ */
9329 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEBA_JXZ */
9330 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBEHXZ */
9331 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QEBA_JXZ */
9332 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBA_JXZ */
9333 /* ?gcount@?$basic_istream@GU?$char_traits@G@std@@@std@@QBE_JXZ */
9334 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBA_JXZ */
9335 /* ?gcount@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QBE_JXZ */
9336 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_gcount, 4)
9337 streamsize __thiscall basic_istream_wchar_gcount(const basic_istream_wchar *this)
9339 TRACE("(%p)\n", this);
9340 return this->count;
9343 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9344 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9345 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9346 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9347 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get, 4)
9348 unsigned short __thiscall basic_istream_wchar_get(basic_istream_wchar *this)
9350 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9351 int ret;
9353 TRACE("(%p)\n", this);
9355 this->count = 0;
9357 if(!basic_istream_wchar_sentry_create(this, TRUE)) {
9358 basic_istream_wchar_sentry_destroy(this);
9359 return WEOF;
9362 ret = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(base));
9363 basic_istream_wchar_sentry_destroy(this);
9364 if(ret == WEOF)
9365 basic_ios_wchar_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
9366 else
9367 this->count++;
9369 return ret;
9372 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AA_W@Z */
9373 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEA_W@Z */
9374 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAG@Z */
9375 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAG@Z */
9376 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_ch, 8)
9377 basic_istream_wchar* __thiscall basic_istream_wchar_get_ch(basic_istream_wchar *this, wchar_t *ch)
9379 unsigned short ret;
9381 TRACE("(%p %p)\n", this, ch);
9383 ret = basic_istream_wchar_get(this);
9384 if(ret != WEOF)
9385 *ch = (wchar_t)ret;
9386 return this;
9389 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9390 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9391 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9392 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9393 #if STREAMSIZE_BITS == 64
9394 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 20)
9395 #else
9396 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str_delim, 16)
9397 #endif
9398 basic_istream_wchar* __thiscall basic_istream_wchar_get_str_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9400 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9401 unsigned short ch = delim;
9403 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_wn(&delim, 1));
9405 this->count = 0;
9407 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9408 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9410 for(ch = basic_streambuf_wchar_sgetc(strbuf); count>1;
9411 ch = basic_streambuf_wchar_snextc(strbuf)) {
9412 if(ch==WEOF || ch==delim)
9413 break;
9415 *str++ = ch;
9416 this->count++;
9417 count--;
9420 basic_istream_wchar_sentry_destroy(this);
9422 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9423 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9424 if(count > 0)
9425 *str = 0;
9426 return this;
9429 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9430 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9431 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9432 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9433 #if STREAMSIZE_BITS == 64
9434 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 16)
9435 #else
9436 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_str, 12)
9437 #endif
9438 basic_istream_wchar* __thiscall basic_istream_wchar_get_str(basic_istream_wchar *this, wchar_t *str, streamsize count)
9440 return basic_istream_wchar_get_str_delim(this, str, count, '\n');
9443 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9444 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_W@Z */
9445 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9446 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@G@Z */
9447 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf_delim, 12)
9448 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf_delim(basic_istream_wchar *this, basic_streambuf_wchar *strbuf, wchar_t delim)
9450 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9451 unsigned short ch = delim;
9453 TRACE("(%p %p %s)\n", this, strbuf, debugstr_wn(&delim, 1));
9455 this->count = 0;
9457 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9458 basic_streambuf_wchar *strbuf_read = basic_ios_wchar_rdbuf_get(base);
9460 for(ch = basic_streambuf_wchar_sgetc(strbuf_read); ;
9461 ch = basic_streambuf_wchar_snextc(strbuf_read)) {
9462 if(ch==WEOF || ch==delim)
9463 break;
9465 if(basic_streambuf_wchar_sputc(strbuf, ch) == WEOF)
9466 break;
9467 this->count++;
9470 basic_istream_wchar_sentry_destroy(this);
9472 basic_ios_wchar_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
9473 (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
9474 return this;
9477 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@AAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9478 /* ?get@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@@Z */
9479 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@AAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9480 /* ?get@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@@Z */
9481 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_get_streambuf, 8)
9482 basic_istream_wchar* __thiscall basic_istream_wchar_get_streambuf(basic_istream_wchar *this, basic_streambuf_wchar *strbuf)
9484 return basic_istream_wchar_get_streambuf_delim(this, strbuf, '\n');
9487 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH_W@Z */
9488 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J_W@Z */
9489 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGHG@Z */
9490 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_JG@Z */
9491 #if STREAMSIZE_BITS == 64
9492 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 20)
9493 #else
9494 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline_delim, 16)
9495 #endif
9496 basic_istream_wchar* __thiscall basic_istream_wchar_getline_delim(basic_istream_wchar *this, wchar_t *str, streamsize count, wchar_t delim)
9498 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9499 unsigned short ch = delim;
9501 TRACE("(%p %p %s %s)\n", this, str, wine_dbgstr_longlong(count), debugstr_wn(&delim, 1));
9503 this->count = 0;
9505 if(basic_istream_wchar_sentry_create(this, TRUE) && count>0) {
9506 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9508 while(count > 1) {
9509 ch = basic_streambuf_wchar_sbumpc(strbuf);
9511 if(ch==WEOF || ch==delim)
9512 break;
9514 *str++ = ch;
9515 this->count++;
9516 count--;
9519 if(ch == delim)
9520 this->count++;
9521 else if(ch != WEOF) {
9522 ch = basic_streambuf_wchar_sgetc(strbuf);
9524 if(ch == delim) {
9525 basic_streambuf_wchar__Gninc(strbuf);
9526 this->count++;
9530 basic_istream_wchar_sentry_destroy(this);
9532 basic_ios_wchar_setstate(base, (ch==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
9533 (!this->count || (ch!=delim && ch!=WEOF) ? IOSTATE_failbit : IOSTATE_goodbit));
9534 if(count > 0)
9535 *str = 0;
9536 return this;
9539 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9540 /* ?getline@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9541 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9542 /* ?getline@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9543 #if STREAMSIZE_BITS == 64
9544 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 16)
9545 #else
9546 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_getline, 12)
9547 #endif
9548 basic_istream_wchar* __thiscall basic_istream_wchar_getline(basic_istream_wchar *this, wchar_t *str, streamsize count)
9550 return basic_istream_wchar_getline_delim(this, str, count, '\n');
9553 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@HG@Z */
9554 /* ?ignore@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JG@Z */
9555 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@HG@Z */
9556 /* ?ignore@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JG@Z */
9557 #if STREAMSIZE_BITS == 64
9558 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 16)
9559 #else
9560 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_ignore, 12)
9561 #endif
9562 basic_istream_wchar* __thiscall basic_istream_wchar_ignore(basic_istream_wchar *this, streamsize count, unsigned short delim)
9564 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9565 unsigned short ch = delim;
9566 unsigned int state;
9568 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(count), delim);
9570 this->count = 0;
9572 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9573 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9574 state = IOSTATE_goodbit;
9576 while(count > 0) {
9577 ch = basic_streambuf_wchar_sbumpc(strbuf);
9579 if(ch==WEOF) {
9580 state = IOSTATE_eofbit;
9581 break;
9584 if(ch==delim)
9585 break;
9587 this->count++;
9588 if(count != INT_MAX)
9589 count--;
9591 }else
9592 state = IOSTATE_failbit;
9593 basic_istream_wchar_sentry_destroy(this);
9595 basic_ios_wchar_setstate(base, state);
9596 return this;
9599 /* ?ws@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AAV21@@Z */
9600 /* ?ws@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@AEAV21@@Z */
9601 /* ?ws@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@1@AAV21@@Z */
9602 /* ?ws@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@1@AEAV21@@Z */
9603 basic_istream_wchar* __cdecl ws_basic_istream_wchar(basic_istream_wchar *istream)
9605 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
9606 unsigned short ch = '\n';
9608 TRACE("(%p)\n", istream);
9610 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
9611 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9612 const ctype_wchar *ctype = ctype_wchar_use_facet(IOS_LOCALE(strbuf));
9614 for(ch = basic_streambuf_wchar_sgetc(strbuf); ctype_wchar_is_ch(ctype, _SPACE, ch);
9615 ch = basic_streambuf_wchar_snextc(strbuf)) {
9616 if(ch == WEOF)
9617 break;
9620 basic_istream_wchar_sentry_destroy(istream);
9622 if(ch == WEOF)
9623 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9624 return istream;
9627 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
9628 /* ?peek@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
9629 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEGXZ */
9630 /* ?peek@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAGXZ */
9631 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_peek, 4)
9632 unsigned short __thiscall basic_istream_wchar_peek(basic_istream_wchar *this)
9634 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9635 unsigned short ret = WEOF;
9637 TRACE("(%p)\n", this);
9639 this->count = 0;
9641 if(basic_istream_wchar_sentry_create(this, TRUE))
9642 ret = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
9643 basic_istream_wchar_sentry_destroy(this);
9645 if (ret == WEOF)
9646 basic_ios_wchar_setstate(base, IOSTATE_eofbit);
9648 return ret;
9651 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WIH@Z */
9652 /* ?_Read_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_K_J@Z */
9653 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z */
9654 /* ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_K_J@Z */
9655 #if STREAMSIZE_BITS == 64
9656 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 20)
9657 #else
9658 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Read_s, 16)
9659 #endif
9660 basic_istream_wchar* __thiscall basic_istream_wchar__Read_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
9662 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9663 IOSB_iostate state = IOSTATE_goodbit;
9665 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9667 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9668 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9670 this->count = basic_streambuf_wchar__Sgetn_s(strbuf, str, size, count);
9671 if(this->count != count)
9672 state |= IOSTATE_failbit | IOSTATE_eofbit;
9673 }else {
9674 this->count = 0;
9676 basic_istream_wchar_sentry_destroy(this);
9678 basic_ios_wchar_setstate(base, state);
9679 return this;
9682 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@PA_WH@Z */
9683 /* ?read@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@PEA_W_J@Z */
9684 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGH@Z */
9685 /* ?read@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@PEAG_J@Z */
9686 #if STREAMSIZE_BITS == 64
9687 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 16)
9688 #else
9689 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read, 12)
9690 #endif
9691 basic_istream_wchar* __thiscall basic_istream_wchar_read(basic_istream_wchar *this, wchar_t *str, streamsize count)
9693 return basic_istream_wchar__Read_s(this, str, -1, count);
9696 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
9697 /* ?_Readsome_s@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
9698 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
9699 /* ?_Readsome_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
9700 #if STREAMSIZE_BITS == 64
9701 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 20)
9702 #else
9703 DEFINE_THISCALL_WRAPPER(basic_istream_wchar__Readsome_s, 16)
9704 #endif
9705 streamsize __thiscall basic_istream_wchar__Readsome_s(basic_istream_wchar *this, wchar_t *str, MSVCP_size_t size, streamsize count)
9707 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9708 IOSB_iostate state = IOSTATE_goodbit;
9710 TRACE("(%p %p %lu %s)\n", this, str, size, wine_dbgstr_longlong(count));
9712 this->count = 0;
9714 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9715 streamsize avail = basic_streambuf_wchar_in_avail(basic_ios_wchar_rdbuf_get(base));
9716 if(avail > count)
9717 avail = count;
9719 if(avail == -1)
9720 state |= IOSTATE_eofbit;
9721 else if(avail > 0)
9722 basic_istream_wchar__Read_s(this, str, size, avail);
9723 }else {
9724 state |= IOSTATE_failbit;
9726 basic_istream_wchar_sentry_destroy(this);
9728 basic_ios_wchar_setstate(base, state);
9729 return this->count;
9732 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
9733 /* ?readsome@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
9734 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
9735 /* ?readsome@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
9736 #if STREAMSIZE_BITS == 64
9737 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 16)
9738 #else
9739 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_readsome, 12)
9740 #endif
9741 streamsize __thiscall basic_istream_wchar_readsome(basic_istream_wchar *this, wchar_t *str, streamsize count)
9743 return basic_istream_wchar__Readsome_s(this, str, count, count);
9746 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@_W@Z */
9747 /* ?putback@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_W@Z */
9748 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@G@Z */
9749 /* ?putback@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@G@Z */
9750 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_putback, 8)
9751 basic_istream_wchar* __thiscall basic_istream_wchar_putback(basic_istream_wchar *this, wchar_t ch)
9753 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9754 IOSB_iostate state = IOSTATE_goodbit;
9756 TRACE("(%p %c)\n", this, ch);
9758 this->count = 0;
9760 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9761 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9763 if(!ios_base_good(&base->base))
9764 state |= IOSTATE_failbit;
9765 else if(!strbuf || basic_streambuf_wchar_sputbackc(strbuf, ch)==WEOF)
9766 state |= IOSTATE_badbit;
9768 basic_istream_wchar_sentry_destroy(this);
9770 basic_ios_wchar_setstate(base, state);
9771 return this;
9774 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@XZ */
9775 /* ?unget@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@XZ */
9776 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@XZ */
9777 /* ?unget@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@XZ */
9778 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_unget, 4)
9779 basic_istream_wchar* __thiscall basic_istream_wchar_unget(basic_istream_wchar *this)
9781 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9782 IOSB_iostate state = IOSTATE_goodbit;
9784 TRACE("(%p)\n", this);
9786 this->count = 0;
9788 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9789 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9791 if(!ios_base_good(&base->base))
9792 state |= IOSTATE_failbit;
9793 else if(!strbuf || basic_streambuf_wchar_sungetc(strbuf)==WEOF)
9794 state |= IOSTATE_badbit;
9796 basic_istream_wchar_sentry_destroy(this);
9798 basic_ios_wchar_setstate(base, state);
9799 return this;
9802 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
9803 /* ?sync@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
9804 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEHXZ */
9805 /* ?sync@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAHXZ */
9806 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_sync, 4)
9807 int __thiscall basic_istream_wchar_sync(basic_istream_wchar *this)
9809 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9810 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9812 TRACE("(%p)\n", this);
9814 if(!strbuf)
9815 return -1;
9817 if(basic_istream_wchar_sentry_create(this, TRUE)) {
9818 if(basic_streambuf_wchar_pubsync(strbuf) != -1) {
9819 basic_istream_wchar_sentry_destroy(this);
9820 return 0;
9823 basic_istream_wchar_sentry_destroy(this);
9825 basic_ios_wchar_setstate(base, IOSTATE_badbit);
9826 return -1;
9829 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9830 /* ?tellg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9831 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@XZ */
9832 /* ?tellg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
9833 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_tellg, 8)
9834 fpos_int* __thiscall basic_istream_wchar_tellg(basic_istream_wchar *this, fpos_int *ret)
9836 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9838 TRACE("(%p %p)\n", this, ret);
9840 if(ios_base_fail(&base->base)) {
9841 ret->off = -1;
9842 ret->pos = 0;
9843 ret->state = 0;
9844 return ret;
9847 basic_streambuf_wchar_pubseekoff(basic_ios_wchar_rdbuf_get(base),
9848 ret, 0, SEEKDIR_cur, OPENMODE_in);
9849 if(ret->off==-1 && ret->pos==0 && ret->state==0)
9850 basic_ios_wchar_setstate(base, IOSTATE_failbit);
9852 return ret;
9855 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JW4seekdir@ios_base@2@@Z */
9856 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JW4seekdir@ios_base@2@@Z */
9857 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@JH@Z */
9858 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@_JH@Z */
9859 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@JH@Z */
9860 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@_JH@Z */
9861 #if STREAMOFF_BITS == 64
9862 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 16)
9863 #else
9864 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg, 12)
9865 #endif
9866 basic_istream_wchar* __thiscall basic_istream_wchar_seekg(basic_istream_wchar *this, streamoff off, int dir)
9868 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9870 TRACE("(%p %s %d)\n", this, wine_dbgstr_longlong(off), dir);
9872 if(!ios_base_fail(&base->base)) {
9873 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9874 fpos_int ret;
9876 basic_streambuf_wchar_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
9879 return this;
9882 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9883 /* ?seekg@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9884 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
9885 /* ?seekg@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
9886 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_seekg_fpos, 28)
9887 basic_istream_wchar* __thiscall basic_istream_wchar_seekg_fpos(basic_istream_wchar *this, fpos_int pos)
9889 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9891 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
9893 if(!ios_base_fail(&base->base)) {
9894 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9895 fpos_int ret;
9897 basic_streambuf_wchar_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
9900 return this;
9903 static basic_istream_wchar* basic_istream_read_short(basic_istream_wchar *this, short *v, const num_get *numget)
9905 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9906 int state = IOSTATE_goodbit;
9908 TRACE("(%p %p)\n", this, v);
9910 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9911 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9912 istreambuf_iterator_wchar first={0}, last={0};
9913 LONG tmp;
9915 first.strbuf = strbuf;
9916 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, &tmp);
9918 if(!(state&IOSTATE_failbit) && tmp==(LONG)((short)tmp))
9919 *v = tmp;
9920 else
9921 state |= IOSTATE_failbit;
9923 basic_istream_wchar_sentry_destroy(this);
9925 basic_ios_wchar_setstate(base, state);
9926 return this;
9929 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAF@Z */
9930 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAF@Z */
9931 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_short, 8)
9932 basic_istream_wchar* __thiscall basic_istream_wchar_read_short(basic_istream_wchar *this, short *v)
9934 return basic_istream_read_short(this, v, num_get_wchar_use_facet(
9935 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9938 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAF@Z */
9939 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAF@Z */
9940 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_short, 8)
9941 basic_istream_wchar* __thiscall basic_istream_short_read_short(basic_istream_wchar *this, short *v)
9943 return basic_istream_read_short(this, v, num_get_short_use_facet(
9944 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
9947 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAG@Z */
9948 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAG@Z */
9949 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ushort, 8)
9950 basic_istream_wchar* __thiscall basic_istream_wchar_read_ushort(basic_istream_wchar *this, unsigned short *v)
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 const num_get *numget = num_get_wchar_use_facet(IOS_LOCALE(strbuf));
9960 istreambuf_iterator_wchar first={0}, last={0};
9962 first.strbuf = strbuf;
9963 num_get_wchar_get_ushort(numget, &last, first, last, &base->base, &state, v);
9965 basic_istream_wchar_sentry_destroy(this);
9967 basic_ios_wchar_setstate(base, state);
9968 return this;
9971 static basic_istream_wchar* basic_istream_read_int(basic_istream_wchar *this, int *v, const num_get *numget)
9973 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
9974 int state = IOSTATE_goodbit;
9976 TRACE("(%p %p)\n", this, v);
9978 if(basic_istream_wchar_sentry_create(this, FALSE)) {
9979 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
9980 istreambuf_iterator_wchar first={0}, last={0};
9982 first.strbuf = strbuf;
9983 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
9985 basic_istream_wchar_sentry_destroy(this);
9987 basic_ios_wchar_setstate(base, state);
9988 return this;
9991 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAH@Z */
9992 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAH@Z */
9993 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int, 8)
9994 basic_istream_wchar* __thiscall basic_istream_wchar_read_int(basic_istream_wchar *this, int *v)
9996 return basic_istream_read_int(this, v, num_get_wchar_use_facet(
9997 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10000 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAH@Z */
10001 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAH@Z */
10002 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int, 8)
10003 basic_istream_wchar* __thiscall basic_istream_short_read_int(basic_istream_wchar *this, int *v)
10005 return basic_istream_read_int(this, v, num_get_short_use_facet(
10006 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10009 static basic_istream_wchar* basic_istream_read_uint(basic_istream_wchar *this, unsigned int *v, const num_get *numget)
10011 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10012 int state = IOSTATE_goodbit;
10014 TRACE("(%p %p)\n", this, v);
10016 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10017 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10018 istreambuf_iterator_wchar first={0}, last={0};
10020 first.strbuf = strbuf;
10021 num_get_wchar_get_uint(numget, &last, first, last, &base->base, &state, v);
10023 basic_istream_wchar_sentry_destroy(this);
10025 basic_ios_wchar_setstate(base, state);
10026 return this;
10029 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAI@Z */
10030 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAI@Z */
10031 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint, 8)
10032 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint(basic_istream_wchar *this, unsigned int *v)
10034 return basic_istream_read_uint(this, v, num_get_wchar_use_facet(
10035 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10038 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAI@Z */
10039 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAI@Z */
10040 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint, 8)
10041 basic_istream_wchar* __thiscall basic_istream_short_read_uint(basic_istream_wchar *this, unsigned int *v)
10043 return basic_istream_read_uint(this, v, num_get_short_use_facet(
10044 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10047 static basic_istream_wchar* basic_istream_read_long(basic_istream_wchar *this, LONG *v, const num_get *numget)
10049 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10050 int state = IOSTATE_goodbit;
10052 TRACE("(%p %p)\n", this, v);
10054 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10055 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10056 istreambuf_iterator_wchar first={0}, last={0};
10058 first.strbuf = strbuf;
10059 num_get_wchar_get_long(numget, &last, first, last, &base->base, &state, v);
10061 basic_istream_wchar_sentry_destroy(this);
10063 basic_ios_wchar_setstate(base, state);
10064 return this;
10067 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10068 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10069 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_long, 8)
10070 basic_istream_wchar* __thiscall basic_istream_wchar_read_long(basic_istream_wchar *this, LONG *v)
10072 return basic_istream_read_long(this, v, num_get_wchar_use_facet(
10073 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10076 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAJ@Z */
10077 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAJ@Z */
10078 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_long, 8)
10079 basic_istream_wchar* __thiscall basic_istream_short_read_long(basic_istream_wchar *this, LONG *v)
10081 return basic_istream_read_long(this, v, num_get_short_use_facet(
10082 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10085 static basic_istream_wchar* basic_istream_read_ulong(basic_istream_wchar *this, ULONG *v, const num_get *numget)
10087 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10088 int state = IOSTATE_goodbit;
10090 TRACE("(%p %p)\n", this, v);
10092 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10093 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10094 istreambuf_iterator_wchar first={0}, last={0};
10096 first.strbuf = strbuf;
10097 num_get_wchar_get_ulong(numget, &last, first, last, &base->base, &state, v);
10099 basic_istream_wchar_sentry_destroy(this);
10101 basic_ios_wchar_setstate(base, state);
10102 return this;
10105 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAK@Z */
10106 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAK@Z */
10107 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ulong, 8)
10108 basic_istream_wchar* __thiscall basic_istream_wchar_read_ulong(basic_istream_wchar *this, ULONG *v)
10110 return basic_istream_read_ulong(this, v, num_get_wchar_use_facet(
10111 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10114 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAK@Z */
10115 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAK@Z */
10116 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ulong, 8)
10117 basic_istream_wchar* __thiscall basic_istream_short_read_ulong(basic_istream_wchar *this, ULONG *v)
10119 return basic_istream_read_ulong(this, v, num_get_short_use_facet(
10120 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10123 static basic_istream_wchar* basic_istream_read_float(basic_istream_wchar *this, float *v, const num_get *numget)
10125 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10126 int state = IOSTATE_goodbit;
10128 TRACE("(%p %p)\n", this, v);
10130 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10131 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10132 istreambuf_iterator_wchar first={0}, last={0};
10134 first.strbuf = strbuf;
10135 num_get_wchar_get_float(numget, &last, first, last, &base->base, &state, v);
10137 basic_istream_wchar_sentry_destroy(this);
10139 basic_ios_wchar_setstate(base, state);
10140 return this;
10143 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAM@Z */
10144 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAM@Z */
10145 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_float, 8)
10146 basic_istream_wchar* __thiscall basic_istream_wchar_read_float(basic_istream_wchar *this, float *v)
10148 return basic_istream_read_float(this, v, num_get_wchar_use_facet(
10149 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10152 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAM@Z */
10153 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAM@Z */
10154 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_float, 8)
10155 basic_istream_wchar* __thiscall basic_istream_short_read_float(basic_istream_wchar *this, float *v)
10157 return basic_istream_read_float(this, v, num_get_short_use_facet(
10158 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10161 static basic_istream_wchar* basic_istream_read_double(basic_istream_wchar *this, double *v, const num_get *numget)
10163 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10164 int state = IOSTATE_goodbit;
10166 TRACE("(%p %p)\n", this, v);
10168 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10169 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10170 istreambuf_iterator_wchar first={0}, last={0};
10172 first.strbuf = strbuf;
10173 num_get_wchar_get_double(numget, &last, first, last, &base->base, &state, v);
10175 basic_istream_wchar_sentry_destroy(this);
10177 basic_ios_wchar_setstate(base, state);
10178 return this;
10181 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAN@Z */
10182 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAN@Z */
10183 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_double, 8)
10184 basic_istream_wchar* __thiscall basic_istream_wchar_read_double(basic_istream_wchar *this, double *v)
10186 return basic_istream_read_double(this, v, num_get_wchar_use_facet(
10187 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10190 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAN@Z */
10191 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAN@Z */
10192 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_double, 8)
10193 basic_istream_wchar* __thiscall basic_istream_short_read_double(basic_istream_wchar *this, double *v)
10195 return basic_istream_read_double(this, v, num_get_short_use_facet(
10196 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10199 static basic_istream_wchar* basic_istream_read_ldouble(basic_istream_wchar *this, double *v, const num_get *numget)
10201 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10202 int state = IOSTATE_goodbit;
10204 TRACE("(%p %p)\n", this, v);
10206 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10207 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10208 istreambuf_iterator_wchar first={0}, last={0};
10210 first.strbuf = strbuf;
10211 num_get_wchar_get_ldouble(numget, &last, first, last, &base->base, &state, v);
10213 basic_istream_wchar_sentry_destroy(this);
10215 basic_ios_wchar_setstate(base, state);
10216 return this;
10219 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAO@Z */
10220 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAO@Z */
10221 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ldouble, 8)
10222 basic_istream_wchar* __thiscall basic_istream_wchar_read_ldouble(basic_istream_wchar *this, double *v)
10224 return basic_istream_read_ldouble(this, v, num_get_wchar_use_facet(
10225 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10228 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAO@Z */
10229 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAO@Z */
10230 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ldouble, 8)
10231 basic_istream_wchar* __thiscall basic_istream_short_read_ldouble(basic_istream_wchar *this, double *v)
10233 return basic_istream_read_ldouble(this, v, num_get_short_use_facet(
10234 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10237 static basic_istream_wchar* basic_istream_read_ptr(basic_istream_wchar *this, void **v, const num_get *numget)
10239 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10240 int state = IOSTATE_goodbit;
10242 TRACE("(%p %p)\n", this, v);
10244 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10245 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10246 istreambuf_iterator_wchar first={0}, last={0};
10248 first.strbuf = strbuf;
10249 num_get_wchar_get_void(numget, &last, first, last, &base->base, &state, v);
10251 basic_istream_wchar_sentry_destroy(this);
10253 basic_ios_wchar_setstate(base, state);
10254 return this;
10257 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AAPAX@Z */
10258 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10259 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_ptr, 8)
10260 basic_istream_wchar* __thiscall basic_istream_wchar_read_ptr(basic_istream_wchar *this, void **v)
10262 return basic_istream_read_ptr(this, v, num_get_wchar_use_facet(
10263 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10266 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AAPAX@Z */
10267 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
10268 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_ptr, 8)
10269 basic_istream_wchar* __thiscall basic_istream_short_read_ptr(basic_istream_wchar *this, void **v)
10271 return basic_istream_read_ptr(this, v, num_get_short_use_facet(
10272 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10275 static basic_istream_wchar* basic_istream_read_int64(basic_istream_wchar *this, __int64 *v, const num_get *numget)
10277 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10278 int state = IOSTATE_goodbit;
10280 TRACE("(%p %p)\n", this, v);
10282 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10283 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10284 istreambuf_iterator_wchar first={0}, last={0};
10286 first.strbuf = strbuf;
10287 num_get_wchar_get_int64(numget, &last, first, last, &base->base, &state, v);
10289 basic_istream_wchar_sentry_destroy(this);
10291 basic_ios_wchar_setstate(base, state);
10292 return this;
10295 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_J@Z */
10296 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_J@Z */
10297 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_int64, 8)
10298 basic_istream_wchar* __thiscall basic_istream_wchar_read_int64(basic_istream_wchar *this, __int64 *v)
10300 return basic_istream_read_int64(this, v, num_get_wchar_use_facet(
10301 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10304 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_J@Z */
10305 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_J@Z */
10306 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_int64, 8)
10307 basic_istream_wchar* __thiscall basic_istream_short_read_int64(basic_istream_wchar *this, __int64 *v)
10309 return basic_istream_read_int64(this, v, num_get_short_use_facet(
10310 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10313 static basic_istream_wchar* basic_istream_read_uint64(basic_istream_wchar *this, unsigned __int64 *v, const num_get *numget)
10315 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10316 int state = IOSTATE_goodbit;
10318 TRACE("(%p %p)\n", this, v);
10320 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10321 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10322 istreambuf_iterator_wchar first={0}, last={0};
10324 first.strbuf = strbuf;
10325 num_get_wchar_get_uint64(numget, &last, first, last, &base->base, &state, v);
10327 basic_istream_wchar_sentry_destroy(this);
10329 basic_ios_wchar_setstate(base, state);
10330 return this;
10333 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_K@Z */
10334 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_K@Z */
10335 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_uint64, 8)
10336 basic_istream_wchar* __thiscall basic_istream_wchar_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10338 return basic_istream_read_uint64(this, v, num_get_wchar_use_facet(
10339 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10342 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_K@Z */
10343 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_K@Z */
10344 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_uint64, 8)
10345 basic_istream_wchar* __thiscall basic_istream_short_read_uint64(basic_istream_wchar *this, unsigned __int64 *v)
10347 return basic_istream_read_uint64(this, v, num_get_short_use_facet(
10348 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10351 static basic_istream_wchar* basic_istream_read_bool(basic_istream_wchar *this, MSVCP_bool *v, const num_get *numget)
10353 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10354 int state = IOSTATE_goodbit;
10356 TRACE("(%p %p)\n", this, v);
10358 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10359 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10360 istreambuf_iterator_wchar first={0}, last={0};
10362 first.strbuf = strbuf;
10363 num_get_wchar_get_bool(numget, &last, first, last, &base->base, &state, v);
10365 basic_istream_wchar_sentry_destroy(this);
10367 basic_ios_wchar_setstate(base, state);
10368 return this;
10371 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@AA_N@Z */
10372 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@AEA_N@Z */
10373 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_bool, 8)
10374 basic_istream_wchar* __thiscall basic_istream_wchar_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10376 return basic_istream_read_bool(this, v, num_get_wchar_use_facet(
10377 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10380 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@AA_N@Z */
10381 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@AEA_N@Z */
10382 DEFINE_THISCALL_WRAPPER(basic_istream_short_read_bool, 8)
10383 basic_istream_wchar* __thiscall basic_istream_short_read_bool(basic_istream_wchar *this, MSVCP_bool *v)
10385 return basic_istream_read_bool(this, v, num_get_short_use_facet(
10386 IOS_LOCALE(basic_istream_wchar_get_basic_ios(this)->strbuf)));
10389 /* ??$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 */
10390 /* ??$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 */
10391 /* ??$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 */
10392 /* ??$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 */
10393 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim(
10394 basic_istream_wchar *istream, basic_string_wchar *str, wchar_t delim)
10396 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10397 IOSB_iostate state = IOSTATE_goodbit;
10398 int c = delim;
10400 TRACE("(%p %p %s)\n", istream, str, debugstr_wn(&delim, 1));
10402 MSVCP_basic_string_wchar_clear(str);
10403 if(basic_istream_wchar_sentry_create(istream, TRUE)) {
10404 basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base);
10406 c = basic_streambuf_wchar_sgetc(strbuf);
10407 for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf))
10408 MSVCP_basic_string_wchar_append_ch(str, c);
10409 if(c==delim) basic_streambuf_wchar_sbumpc(strbuf);
10410 else if(c==WEOF) state |= IOSTATE_eofbit;
10412 if(!MSVCP_basic_string_wchar_length(str) && c!=delim) state |= IOSTATE_failbit;
10414 basic_istream_wchar_sentry_destroy(istream);
10416 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream), state);
10417 return istream;
10420 /* ??$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 */
10421 /* ??$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 */
10422 /* ??$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 */
10423 /* ??$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 */
10424 basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr(
10425 basic_istream_wchar *istream, basic_string_wchar *str)
10427 return basic_istream_wchar_getline_bstr_delim(istream, str, '\n');
10430 static basic_istream_wchar* basic_istream_read_bstr(basic_istream_wchar *istream,
10431 basic_string_wchar *str, const ctype_wchar *ctype)
10433 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10434 IOSB_iostate state = IOSTATE_failbit;
10435 int c = '\n';
10437 TRACE("(%p %p)\n", istream, str);
10439 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10440 MSVCP_size_t count = ios_base_width_get(&base->base);
10442 if(!count)
10443 count = -1;
10445 MSVCP_basic_string_wchar_clear(str);
10447 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10448 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10449 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10450 state = IOSTATE_goodbit;
10451 MSVCP_basic_string_wchar_append_ch(str, c);
10454 basic_istream_wchar_sentry_destroy(istream);
10456 ios_base_width_set(&base->base, 0);
10457 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10458 return istream;
10461 /* ??$?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 */
10462 /* ??$?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 */
10463 basic_istream_wchar* __cdecl basic_istream_wchar_read_bstr(
10464 basic_istream_wchar *istream, basic_string_wchar *str)
10466 return basic_istream_read_bstr(istream, str, ctype_wchar_use_facet(
10467 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10470 /* ??$?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 */
10471 /* ??$?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 */
10472 basic_istream_wchar* __cdecl basic_istream_short_read_bstr(
10473 basic_istream_wchar *istream, basic_string_wchar *str)
10475 return basic_istream_read_bstr(istream, str, ctype_short_use_facet(
10476 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10479 static basic_istream_wchar* basic_istream_read_str(basic_istream_wchar *istream, wchar_t *str, const ctype_wchar *ctype)
10481 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(istream);
10482 IOSB_iostate state = IOSTATE_failbit;
10483 unsigned short c = '\n';
10485 TRACE("(%p %p)\n", istream, str);
10487 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10488 MSVCP_size_t count = ios_base_width_get(&base->base)-1;
10490 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base));
10491 c!=WEOF && !ctype_wchar_is_ch(ctype, _SPACE|_BLANK, c) && count>0;
10492 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base)), count--) {
10493 state = IOSTATE_goodbit;
10494 *str++ = c;
10497 basic_istream_wchar_sentry_destroy(istream);
10499 *str = 0;
10500 ios_base_width_set(&base->base, 0);
10501 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10502 return istream;
10505 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@PA_W@Z */
10506 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@PEA_W@Z */
10507 basic_istream_wchar* __cdecl basic_istream_wchar_read_str(basic_istream_wchar *istream, wchar_t *str)
10509 return basic_istream_read_str(istream, str, ctype_wchar_use_facet(
10510 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10513 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@PAG@Z */
10514 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@PEAG@Z */
10515 basic_istream_wchar* __cdecl basic_istream_short_read_str(basic_istream_wchar *istream, wchar_t *str)
10517 return basic_istream_read_str(istream, str, ctype_short_use_facet(
10518 IOS_LOCALE(basic_istream_wchar_get_basic_ios(istream)->strbuf)));
10521 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AAV10@AA_W@Z */
10522 /* ??$?5_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_istream@_WU?$char_traits@_W@std@@@0@AEAV10@AEA_W@Z */
10523 /* ??$?5GU?$char_traits@G@std@@@std@@YAAAV?$basic_istream@GU?$char_traits@G@std@@@0@AAV10@AAG@Z */
10524 /* ??$?5GU?$char_traits@G@std@@@std@@YAAEAV?$basic_istream@GU?$char_traits@G@std@@@0@AEAV10@AEAG@Z */
10525 basic_istream_wchar* __cdecl basic_istream_wchar_read_ch(basic_istream_wchar *istream, wchar_t *ch)
10527 IOSB_iostate state = IOSTATE_failbit;
10528 unsigned short c = 0;
10530 TRACE("(%p %p)\n", istream, ch);
10532 if(basic_istream_wchar_sentry_create(istream, FALSE)) {
10533 c = basic_streambuf_wchar_sbumpc(basic_ios_wchar_rdbuf_get(
10534 basic_istream_wchar_get_basic_ios(istream)));
10535 if(c != WEOF) {
10536 state = IOSTATE_goodbit;
10537 *ch = c;
10540 basic_istream_wchar_sentry_destroy(istream);
10542 basic_ios_wchar_setstate(basic_istream_wchar_get_basic_ios(istream),
10543 state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10544 return istream;
10547 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10548 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10549 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10550 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10551 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_streambuf, 8)
10552 basic_istream_wchar* __thiscall basic_istream_wchar_read_streambuf(
10553 basic_istream_wchar *this, basic_streambuf_wchar *streambuf)
10555 basic_ios_wchar *base = basic_istream_wchar_get_basic_ios(this);
10556 IOSB_iostate state = IOSTATE_failbit;
10557 unsigned short c = '\n';
10559 TRACE("(%p %p)\n", this, streambuf);
10561 if(basic_istream_wchar_sentry_create(this, FALSE)) {
10562 for(c = basic_streambuf_wchar_sgetc(basic_ios_wchar_rdbuf_get(base)); c!=WEOF;
10563 c = basic_streambuf_wchar_snextc(basic_ios_wchar_rdbuf_get(base))) {
10564 state = IOSTATE_goodbit;
10565 if(basic_streambuf_wchar_sputc(streambuf, c) == WEOF)
10566 break;
10569 basic_istream_wchar_sentry_destroy(this);
10571 basic_ios_wchar_setstate(base, state | (c==WEOF ? IOSTATE_eofbit : IOSTATE_goodbit));
10572 return this;
10575 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10576 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10577 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z */
10578 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z */
10579 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func, 8)
10580 basic_istream_wchar* __thiscall basic_istream_wchar_read_func(basic_istream_wchar *this,
10581 basic_istream_wchar* (__cdecl *pfunc)(basic_istream_wchar*))
10583 TRACE("(%p %p)\n", this, pfunc);
10584 pfunc(this);
10585 return this;
10588 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AAV21@@Z@Z */
10589 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@_WU?$char_traits@_W@std@@@1@AEAV21@@Z@Z */
10590 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAV?$basic_ios@GU?$char_traits@G@std@@@1@AAV21@@Z@Z */
10591 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAV?$basic_ios@GU?$char_traits@G@std@@@1@AEAV21@@Z@Z */
10592 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_basic_ios, 8)
10593 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_basic_ios(basic_istream_wchar *this,
10594 basic_ios_wchar* (__cdecl *pfunc)(basic_ios_wchar*))
10596 TRACE("(%p %p)\n", this, pfunc);
10597 pfunc(basic_istream_wchar_get_basic_ios(this));
10598 return this;
10601 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10602 /* ??5?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10603 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV01@P6AAAVios_base@1@AAV21@@Z@Z */
10604 /* ??5?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAAEAV01@P6AAEAVios_base@1@AEAV21@@Z@Z */
10605 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_read_func_ios_base, 8)
10606 basic_istream_wchar* __thiscall basic_istream_wchar_read_func_ios_base(
10607 basic_istream_wchar *this, ios_base* (__cdecl *pfunc)(ios_base*))
10609 TRACE("(%p %p)\n", this, pfunc);
10610 pfunc(&basic_istream_wchar_get_basic_ios(this)->base);
10611 return this;
10614 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
10615 /* ?swap@?$basic_istream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
10616 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
10617 /* ?swap@?$basic_istream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
10618 DEFINE_THISCALL_WRAPPER(basic_istream_wchar_swap, 8)
10619 void __thiscall basic_istream_wchar_swap(basic_istream_wchar *this, basic_istream_wchar *r)
10621 TRACE("(%p %p)\n", this, r);
10623 if(this == r)
10624 return;
10626 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(this),
10627 basic_istream_wchar_get_basic_ios(r));
10628 this->count ^= r->count;
10629 r->count ^= this->count;
10630 this->count ^= r->count;
10633 static inline basic_ios_char* basic_iostream_char_to_basic_ios(basic_iostream_char *ptr)
10635 return (basic_ios_char*)((char*)ptr+basic_iostream_char_vbtable1[1]);
10638 static inline basic_iostream_char* basic_iostream_char_from_basic_ios(basic_ios_char *ptr)
10640 return (basic_iostream_char*)((char*)ptr-basic_iostream_char_vbtable1[1]);
10643 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10644 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
10645 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
10646 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
10648 basic_ios_char *basic_ios;
10650 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10652 if(virt_init) {
10653 this->base1.vbtable = basic_iostream_char_vbtable1;
10654 this->base2.vbtable = basic_iostream_char_vbtable2;
10655 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10656 basic_ios_char_ctor(basic_ios);
10657 }else {
10658 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
10661 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
10663 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
10664 basic_ostream_char_ctor(&this->base2, NULL, FALSE, FALSE, FALSE);
10665 return this;
10668 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10669 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10670 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
10671 void __thiscall basic_iostream_char_dtor(basic_ios_char *base)
10673 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10675 TRACE("(%p)\n", this);
10676 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base2));
10677 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base1));
10680 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10681 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10682 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
10683 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
10685 TRACE("(%p)\n", this);
10686 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(this));
10687 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
10690 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vector_dtor, 8)
10691 basic_iostream_char* __thiscall basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10693 basic_iostream_char *this = basic_iostream_char_from_basic_ios(base);
10695 TRACE("(%p %x)\n", this, flags);
10697 if(flags & 2) {
10698 /* we have an array, with the number of elements stored before the first object */
10699 INT_PTR i, *ptr = (INT_PTR *)this-1;
10701 for(i=*ptr-1; i>=0; i--)
10702 basic_iostream_char_vbase_dtor(this+i);
10703 MSVCRT_operator_delete(ptr);
10704 } else {
10705 basic_iostream_char_vbase_dtor(this);
10706 if(flags & 1)
10707 MSVCRT_operator_delete(this);
10710 return this;
10713 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXAAV12@@Z */
10714 /* ?swap@?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXAEAV12@@Z */
10715 DEFINE_THISCALL_WRAPPER(basic_iostream_char_swap, 8)
10716 void __thiscall basic_iostream_char_swap(basic_iostream_char *this, basic_iostream_char *r)
10718 TRACE("(%p %p)\n", this, r);
10720 if(this == r)
10721 return;
10723 basic_ios_char_swap(basic_istream_char_get_basic_ios(&this->base1),
10724 basic_istream_char_get_basic_ios(&r->base1));
10727 static inline basic_ios_wchar* basic_iostream_wchar_to_basic_ios(basic_iostream_wchar *ptr)
10729 return (basic_ios_wchar*)((char*)ptr+basic_iostream_wchar_vbtable1[1]);
10732 static inline basic_iostream_wchar* basic_iostream_wchar_from_basic_ios(basic_ios_wchar *ptr)
10734 return (basic_iostream_wchar*)((char*)ptr-basic_iostream_wchar_vbtable1[1]);
10737 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10738 /* ??0?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
10739 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_ctor, 12)
10740 basic_iostream_wchar* __thiscall basic_iostream_wchar_ctor(basic_iostream_wchar *this,
10741 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
10743 basic_ios_wchar *basic_ios;
10745 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
10747 if(virt_init) {
10748 this->base1.vbtable = basic_iostream_wchar_vbtable1;
10749 this->base2.vbtable = basic_iostream_wchar_vbtable2;
10750 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10751 basic_ios_wchar_ctor(basic_ios);
10752 }else {
10753 basic_ios = basic_istream_wchar_get_basic_ios(&this->base1);
10756 basic_istream_wchar_ctor(&this->base1, strbuf, FALSE, FALSE);
10757 basic_ostream_short_ctor(&this->base2, NULL, FALSE, FALSE, FALSE);
10759 basic_ios->base.vtable = &MSVCP_basic_iostream_wchar_vtable;
10760 return this;
10763 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10764 /* ??0?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
10765 DEFINE_THISCALL_WRAPPER(basic_iostream_short_ctor, 12)
10766 basic_iostream_wchar* __thiscall basic_iostream_short_ctor(basic_iostream_wchar *this,
10767 basic_streambuf_wchar *strbuf, MSVCP_bool virt_init)
10769 basic_iostream_wchar_ctor(this, strbuf, virt_init);
10770 basic_istream_wchar_get_basic_ios(&this->base1)->base.vtable = &MSVCP_basic_iostream_short_vtable;
10771 return this;
10774 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
10775 /* ??1?$basic_iostream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
10776 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UAE@XZ */
10777 /* ??1?$basic_iostream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
10778 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_dtor, 4)
10779 void __thiscall basic_iostream_wchar_dtor(basic_ios_wchar *base)
10781 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10783 TRACE("(%p)\n", this);
10784 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base2));
10785 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base1));
10788 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
10789 /* ??_D?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
10790 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXXZ */
10791 /* ??_D?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
10792 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vbase_dtor, 4)
10793 void __thiscall basic_iostream_wchar_vbase_dtor(basic_iostream_wchar *this)
10795 TRACE("(%p)\n", this);
10796 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(this));
10797 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base1));
10800 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_vector_dtor, 8)
10801 basic_iostream_wchar* __thiscall basic_iostream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
10803 basic_iostream_wchar *this = basic_iostream_wchar_from_basic_ios(base);
10805 TRACE("(%p %x)\n", this, flags);
10807 if(flags & 2) {
10808 /* we have an array, with the number of elements stored before the first object */
10809 INT_PTR i, *ptr = (INT_PTR *)this-1;
10811 for(i=*ptr-1; i>=0; i--)
10812 basic_iostream_wchar_vbase_dtor(this+i);
10813 MSVCRT_operator_delete(ptr);
10814 } else {
10815 basic_iostream_wchar_vbase_dtor(this);
10816 if(flags & 1)
10817 MSVCRT_operator_delete(this);
10820 return this;
10823 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QAEXAAV12@@Z */
10824 /* ?swap@?$basic_iostream@GU?$char_traits@G@std@@@std@@QEAAXAEAV12@@Z */
10825 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QAEXAAV12@@Z */
10826 /* ?swap@?$basic_iostream@_WU?$char_traits@_W@std@@@std@@QEAAXAEAV12@@Z */
10827 DEFINE_THISCALL_WRAPPER(basic_iostream_wchar_swap, 8)
10828 void __thiscall basic_iostream_wchar_swap(basic_iostream_wchar *this, basic_iostream_wchar *r)
10830 TRACE("(%p %p)\n", this, r);
10832 if(this == r)
10833 return;
10835 basic_ios_wchar_swap(basic_istream_wchar_get_basic_ios(&this->base1),
10836 basic_istream_wchar_get_basic_ios(&r->base1));
10839 static inline basic_ios_char* basic_ofstream_char_to_basic_ios(basic_ofstream_char *ptr)
10841 return (basic_ios_char*)((char*)ptr+basic_ofstream_char_vbtable[1]);
10844 static inline basic_ofstream_char* basic_ofstream_char_from_basic_ios(basic_ios_char *ptr)
10846 return (basic_ofstream_char*)((char*)ptr-basic_ofstream_char_vbtable[1]);
10849 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
10850 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
10851 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
10852 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
10854 basic_ios_char *basic_ios;
10856 TRACE("(%p %d)\n", this, virt_init);
10858 if(virt_init) {
10859 this->base.vbtable = basic_ofstream_char_vbtable;
10860 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10861 basic_ios_char_ctor(basic_ios);
10862 }else {
10863 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10866 basic_filebuf_char_ctor(&this->filebuf);
10867 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
10868 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10869 return this;
10872 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
10873 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
10874 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
10875 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
10876 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
10878 basic_ios_char *basic_ios;
10880 TRACE("(%p %p %d)\n", this, file, virt_init);
10882 if(virt_init) {
10883 this->base.vbtable = basic_ofstream_char_vbtable;
10884 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10885 basic_ios_char_ctor(basic_ios);
10886 }else {
10887 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10890 basic_filebuf_char_ctor_file(&this->filebuf, file);
10891 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
10892 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
10893 return this;
10896 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
10897 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
10898 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_copy_ctor, 12)
10899 basic_ofstream_char* __thiscall basic_ofstream_char_copy_ctor(basic_ofstream_char *this,
10900 basic_ofstream_char *copy, MSVCP_bool virt_init)
10902 TRACE("(%p %p %d)\n", this, copy, virt_init);
10903 return basic_ofstream_char_ctor_file(this, copy->filebuf.file, virt_init);
10906 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
10907 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
10908 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 16)
10909 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
10910 const char *name, int mode, MSVCP_bool virt_init)
10912 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
10914 basic_ofstream_char_ctor(this, virt_init);
10916 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
10917 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10918 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10920 return this;
10923 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
10924 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
10925 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
10926 void __thiscall basic_ofstream_char_dtor(basic_ios_char *base)
10928 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10930 TRACE("(%p)\n", this);
10932 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
10933 basic_filebuf_char_dtor(&this->filebuf);
10936 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10937 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10938 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
10939 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
10941 TRACE("(%p)\n", this);
10943 basic_ofstream_char_dtor(basic_ofstream_char_to_basic_ios(this));
10944 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
10947 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vector_dtor, 8)
10948 basic_ofstream_char* __thiscall basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
10950 basic_ofstream_char *this = basic_ofstream_char_from_basic_ios(base);
10952 TRACE("(%p %x)\n", this, flags);
10954 if(flags & 2) {
10955 /* we have an array, with the number of elements stored before the first object */
10956 INT_PTR i, *ptr = (INT_PTR *)this-1;
10958 for(i=*ptr-1; i>=0; i--)
10959 basic_ofstream_char_vbase_dtor(this+i);
10960 MSVCRT_operator_delete(ptr);
10961 } else {
10962 basic_ofstream_char_vbase_dtor(this);
10963 if(flags & 1)
10964 MSVCRT_operator_delete(this);
10967 return this;
10970 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
10971 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
10972 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
10973 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
10975 TRACE("(%p)\n", this);
10977 if(!basic_filebuf_char_close(&this->filebuf)) {
10978 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
10979 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
10983 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
10984 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
10985 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
10986 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
10988 TRACE("(%p)\n", this);
10989 return basic_filebuf_char_is_open(&this->filebuf);
10992 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
10993 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
10994 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 12)
10995 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
10996 const char *name, int mode)
10998 TRACE("(%p %s %d)\n", this, name, mode);
11000 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
11001 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
11002 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11006 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
11007 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
11008 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
11009 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
11010 const char *name, short mode)
11012 basic_ofstream_char_open(this, name, mode);
11015 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11016 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11017 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
11018 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
11020 TRACE("(%p)\n", this);
11021 return (basic_filebuf_char*)&this->filebuf;
11024 static inline basic_ios_wchar* basic_ofstream_wchar_to_basic_ios(basic_ofstream_wchar *ptr)
11026 return (basic_ios_wchar*)((char*)ptr+basic_ofstream_wchar_vbtable[1]);
11029 static inline basic_ofstream_wchar* basic_ofstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11031 return (basic_ofstream_wchar*)((char*)ptr-basic_ofstream_wchar_vbtable[1]);
11034 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11035 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11036 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor, 8)
11037 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11039 basic_ios_wchar *basic_ios;
11041 TRACE("(%p %d)\n", this, virt_init);
11043 if(virt_init) {
11044 this->base.vbtable = basic_ofstream_wchar_vbtable;
11045 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11046 basic_ios_wchar_ctor(basic_ios);
11047 }else {
11048 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11051 basic_filebuf_wchar_ctor(&this->filebuf);
11052 basic_ostream_short_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
11053 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11054 return this;
11057 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11058 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11059 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor, 8)
11060 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor(basic_ofstream_wchar *this, MSVCP_bool virt_init)
11062 basic_ofstream_wchar_ctor(this, virt_init);
11063 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11064 return this;
11067 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11068 /* ??0?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11069 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_ctor_file, 12)
11070 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_ctor_file(
11071 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11073 basic_ios_wchar *basic_ios;
11075 TRACE("(%p %p %d)\n", this, file, virt_init);
11077 if(virt_init) {
11078 this->base.vbtable = basic_ofstream_wchar_vbtable;
11079 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11080 basic_ios_wchar_ctor(basic_ios);
11081 }else {
11082 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11085 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11086 basic_ostream_short_ctor(&this->base, &this->filebuf.base, FALSE, TRUE, FALSE);
11087 basic_ios->base.vtable = &MSVCP_basic_ofstream_wchar_vtable;
11088 return this;
11091 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11092 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11093 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_file, 12)
11094 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_file(
11095 basic_ofstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11097 basic_ofstream_wchar_ctor_file(this, file, virt_init);
11098 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ofstream_short_vtable;
11099 return this;
11102 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
11103 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
11104 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_copy_ctor, 12)
11105 basic_ofstream_wchar* __thiscall basic_ofstream_short_copy_ctor(basic_ofstream_wchar *this,
11106 basic_ofstream_wchar *copy, MSVCP_bool virt_init)
11108 TRACE("(%p %p %d)\n", this, copy, virt_init);
11109 return basic_ofstream_short_ctor_file(this, copy->filebuf.file, virt_init);
11112 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
11113 /* ??0?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
11114 DEFINE_THISCALL_WRAPPER(basic_ofstream_short_ctor_name, 16)
11115 basic_ofstream_wchar* __thiscall basic_ofstream_short_ctor_name(basic_ofstream_wchar *this,
11116 const char *name, int mode, MSVCP_bool virt_init)
11118 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11120 basic_ofstream_short_ctor(this, virt_init);
11122 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
11123 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11124 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11126 return this;
11129 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11130 /* ??1?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11131 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11132 /* ??1?$basic_ofstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11133 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_dtor, 4)
11134 void __thiscall basic_ofstream_wchar_dtor(basic_ios_wchar *base)
11136 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11138 TRACE("(%p)\n", this);
11140 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
11141 basic_filebuf_wchar_dtor(&this->filebuf);
11144 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11145 /* ??_D?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11146 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11147 /* ??_D?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11148 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vbase_dtor, 4)
11149 void __thiscall basic_ofstream_wchar_vbase_dtor(basic_ofstream_wchar *this)
11151 TRACE("(%p)\n", this);
11153 basic_ofstream_wchar_dtor(basic_ofstream_wchar_to_basic_ios(this));
11154 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
11157 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_vector_dtor, 8)
11158 basic_ofstream_wchar* __thiscall basic_ofstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11160 basic_ofstream_wchar *this = basic_ofstream_wchar_from_basic_ios(base);
11162 TRACE("(%p %x)\n", this, flags);
11164 if(flags & 2) {
11165 /* we have an array, with the number of elements stored before the first object */
11166 INT_PTR i, *ptr = (INT_PTR *)this-1;
11168 for(i=*ptr-1; i>=0; i--)
11169 basic_ofstream_wchar_vbase_dtor(this+i);
11170 MSVCRT_operator_delete(ptr);
11171 } else {
11172 basic_ofstream_wchar_vbase_dtor(this);
11173 if(flags & 1)
11174 MSVCRT_operator_delete(this);
11177 return this;
11180 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11181 /* ?close@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11182 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11183 /* ?close@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11184 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_close, 4)
11185 void __thiscall basic_ofstream_wchar_close(basic_ofstream_wchar *this)
11187 TRACE("(%p)\n", this);
11189 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11190 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11191 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11195 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11196 /* ?is_open@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11197 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11198 /* ?is_open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11199 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_is_open, 4)
11200 MSVCP_bool __thiscall basic_ofstream_wchar_is_open(const basic_ofstream_wchar *this)
11202 TRACE("(%p)\n", this);
11203 return basic_filebuf_wchar_is_open(&this->filebuf);
11206 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
11207 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
11208 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open, 12)
11209 void __thiscall basic_ofstream_wchar_open(basic_ofstream_wchar *this,
11210 const char *name, int mode)
11212 TRACE("(%p %s %d)\n", this, name, mode);
11214 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_out, _SH_DENYNO)) {
11215 basic_ios_wchar *basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
11216 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11220 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
11221 /* ?open@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
11222 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_open_old, 12)
11223 void __thiscall basic_ofstream_wchar_open_old(basic_ofstream_wchar *this,
11224 const char *name, int mode)
11226 basic_ofstream_wchar_open(this, name, mode);
11229 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11230 /* ?rdbuf@?$basic_ofstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11231 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11232 /* ?rdbuf@?$basic_ofstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11233 DEFINE_THISCALL_WRAPPER(basic_ofstream_wchar_rdbuf, 4)
11234 basic_filebuf_wchar* __thiscall basic_ofstream_wchar_rdbuf(const basic_ofstream_wchar *this)
11236 TRACE("(%p)\n", this);
11237 return (basic_filebuf_wchar*)&this->filebuf;
11240 static inline basic_ios_char* basic_ifstream_char_to_basic_ios(basic_ifstream_char *ptr)
11242 return (basic_ios_char*)((char*)ptr+basic_ifstream_char_vbtable[1]);
11245 static inline basic_ifstream_char* basic_ifstream_char_from_basic_ios(basic_ios_char *ptr)
11247 return (basic_ifstream_char*)((char*)ptr-basic_ifstream_char_vbtable[1]);
11250 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11251 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11252 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
11253 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
11255 basic_ios_char *basic_ios;
11257 TRACE("(%p %d)\n", this, virt_init);
11259 if(virt_init) {
11260 this->base.vbtable = basic_ifstream_char_vbtable;
11261 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11262 basic_ios_char_ctor(basic_ios);
11263 }else {
11264 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11267 basic_filebuf_char_ctor(&this->filebuf);
11268 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11269 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11270 return this;
11273 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11274 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11275 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
11276 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
11277 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
11279 basic_ios_char *basic_ios;
11281 TRACE("(%p %p %d)\n", this, file, virt_init);
11283 if(virt_init) {
11284 this->base.vbtable = basic_ifstream_char_vbtable;
11285 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11286 basic_ios_char_ctor(basic_ios);
11287 }else {
11288 basic_ios = basic_istream_char_get_basic_ios(&this->base);
11291 basic_filebuf_char_ctor_file(&this->filebuf, file);
11292 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11293 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
11294 return this;
11297 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
11298 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
11299 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_copy_ctor, 12)
11300 basic_ifstream_char* __thiscall basic_ifstream_char_copy_ctor(basic_ifstream_char *this,
11301 const basic_ifstream_char *copy, MSVCP_bool virt_init)
11303 TRACE("(%p %p %d)\n", this, copy, virt_init);
11304 return basic_ifstream_char_ctor_file(this, copy->filebuf.file, virt_init);
11307 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
11308 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
11309 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 16)
11310 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
11311 const char *name, int mode, MSVCP_bool virt_init)
11313 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11315 basic_ifstream_char_ctor(this, virt_init);
11317 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11318 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11319 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11321 return this;
11324 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11325 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11326 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
11327 void __thiscall basic_ifstream_char_dtor(basic_ios_char *base)
11329 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11331 TRACE("(%p)\n", this);
11333 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
11334 basic_filebuf_char_dtor(&this->filebuf);
11337 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11338 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11339 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
11340 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
11342 TRACE("(%p)\n", this);
11344 basic_ifstream_char_dtor(basic_ifstream_char_to_basic_ios(this));
11345 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
11348 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vector_dtor, 8)
11349 basic_ifstream_char* __thiscall basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11351 basic_ifstream_char *this = basic_ifstream_char_from_basic_ios(base);
11353 TRACE("(%p %x)\n", this, flags);
11355 if(flags & 2) {
11356 /* we have an array, with the number of elements stored before the first object */
11357 INT_PTR i, *ptr = (INT_PTR *)this-1;
11359 for(i=*ptr-1; i>=0; i--)
11360 basic_ifstream_char_vbase_dtor(this+i);
11361 MSVCRT_operator_delete(ptr);
11362 } else {
11363 basic_ifstream_char_vbase_dtor(this);
11364 if(flags & 1)
11365 MSVCRT_operator_delete(this);
11368 return this;
11371 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11372 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11373 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
11374 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
11376 TRACE("(%p)\n", this);
11378 if(!basic_filebuf_char_close(&this->filebuf)) {
11379 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11380 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11384 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11385 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11386 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
11387 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
11389 TRACE("(%p)\n", this);
11390 return basic_filebuf_char_is_open(&this->filebuf);
11393 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
11394 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
11395 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 12)
11396 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
11397 const char *name, int mode)
11399 TRACE("(%p %s %d)\n", this, name, mode);
11401 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11402 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
11403 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11407 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
11408 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
11409 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
11410 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
11411 const char *name, short mode)
11413 basic_ifstream_char_open(this, name, mode);
11416 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11417 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11418 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
11419 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
11421 TRACE("(%p)\n", this);
11422 return (basic_filebuf_char*)&this->filebuf;
11425 static inline basic_ios_wchar* basic_ifstream_wchar_to_basic_ios(basic_ifstream_wchar *ptr)
11427 return (basic_ios_wchar*)((char*)ptr+basic_ifstream_wchar_vbtable[1]);
11430 static inline basic_ifstream_wchar* basic_ifstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11432 return (basic_ifstream_wchar*)((char*)ptr-basic_ifstream_wchar_vbtable[1]);
11435 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11436 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11437 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor, 8)
11438 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
11440 basic_ios_wchar *basic_ios;
11442 TRACE("(%p %d)\n", this, virt_init);
11444 if(virt_init) {
11445 this->base.vbtable = basic_ifstream_wchar_vbtable;
11446 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11447 basic_ios_wchar_ctor(basic_ios);
11448 }else {
11449 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11452 basic_filebuf_wchar_ctor(&this->filebuf);
11453 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11454 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11455 return this;
11458 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11459 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11460 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor, 8)
11461 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor(basic_ifstream_wchar *this, MSVCP_bool virt_init)
11463 basic_ifstream_wchar_ctor(this, virt_init);
11464 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11465 return this;
11468 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11469 /* ??0?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11470 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_ctor_file, 12)
11471 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_ctor_file(
11472 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11474 basic_ios_wchar *basic_ios;
11476 TRACE("(%p %p %d)\n", this, file, virt_init);
11478 if(virt_init) {
11479 this->base.vbtable = basic_ifstream_wchar_vbtable;
11480 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11481 basic_ios_wchar_ctor(basic_ios);
11482 }else {
11483 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11486 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11487 basic_istream_wchar_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
11488 basic_ios->base.vtable = &MSVCP_basic_ifstream_wchar_vtable;
11489 return this;
11492 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11493 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11494 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_file, 12)
11495 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_file(
11496 basic_ifstream_wchar *this, FILE *file, MSVCP_bool virt_init)
11498 basic_ifstream_wchar_ctor_file(this, file, virt_init);
11499 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ifstream_short_vtable;
11500 return this;
11503 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
11504 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
11505 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_copy_ctor, 12)
11506 basic_ifstream_wchar* __thiscall basic_ifstream_short_copy_ctor(basic_ifstream_wchar *this,
11507 basic_ifstream_wchar *copy, MSVCP_bool virt_init)
11509 TRACE("(%p %p %d)\n", this, copy, virt_init);
11510 return basic_ifstream_short_ctor_file(this, copy->filebuf.file, virt_init);
11513 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAE@PBDH@Z */
11514 /* ??0?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDH@Z */
11515 DEFINE_THISCALL_WRAPPER(basic_ifstream_short_ctor_name, 16)
11516 basic_ifstream_wchar* __thiscall basic_ifstream_short_ctor_name(basic_ifstream_wchar *this,
11517 const char *name, int mode, MSVCP_bool virt_init)
11519 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11521 basic_ifstream_short_ctor(this, virt_init);
11523 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11524 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11525 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11527 return this;
11530 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11531 /* ??1?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11532 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11533 /* ??1?$basic_ifstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11534 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_dtor, 4)
11535 void __thiscall basic_ifstream_wchar_dtor(basic_ios_wchar *base)
11537 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11539 TRACE("(%p)\n", this);
11541 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
11542 basic_filebuf_wchar_dtor(&this->filebuf);
11545 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11546 /* ??_D?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11547 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11548 /* ??_D?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11549 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vbase_dtor, 4)
11550 void __thiscall basic_ifstream_wchar_vbase_dtor(basic_ifstream_wchar *this)
11552 TRACE("(%p)\n", this);
11554 basic_ifstream_wchar_dtor(basic_ifstream_wchar_to_basic_ios(this));
11555 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
11558 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_vector_dtor, 8)
11559 basic_ifstream_wchar* __thiscall basic_ifstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11561 basic_ifstream_wchar *this = basic_ifstream_wchar_from_basic_ios(base);
11563 TRACE("(%p %x)\n", this, flags);
11565 if(flags & 2) {
11566 /* we have an array, with the number of elements stored before the first object */
11567 INT_PTR i, *ptr = (INT_PTR *)this-1;
11569 for(i=*ptr-1; i>=0; i--)
11570 basic_ifstream_wchar_vbase_dtor(this+i);
11571 MSVCRT_operator_delete(ptr);
11572 } else {
11573 basic_ifstream_wchar_vbase_dtor(this);
11574 if(flags & 1)
11575 MSVCRT_operator_delete(this);
11578 return this;
11581 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11582 /* ?close@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11583 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11584 /* ?close@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11585 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_close, 4)
11586 void __thiscall basic_ifstream_wchar_close(basic_ifstream_wchar *this)
11588 TRACE("(%p)\n", this);
11590 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11591 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11592 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11596 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
11597 /* ?is_open@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
11598 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
11599 /* ?is_open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
11600 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_is_open, 4)
11601 MSVCP_bool __thiscall basic_ifstream_wchar_is_open(const basic_ifstream_wchar *this)
11603 TRACE("(%p)\n", this);
11604 return basic_filebuf_wchar_is_open(&this->filebuf);
11607 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDH@Z */
11608 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDH@Z */
11609 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open, 12)
11610 void __thiscall basic_ifstream_wchar_open(basic_ifstream_wchar *this,
11611 const char *name, int mode)
11613 TRACE("(%p %s %d)\n", this, name, mode);
11615 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode|OPENMODE_in, _SH_DENYNO)) {
11616 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
11617 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
11621 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QAEXPBDF@Z */
11622 /* ?open@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEAAXPEBDF@Z */
11623 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_open_old, 12)
11624 void __thiscall basic_ifstream_wchar_open_old(basic_ifstream_wchar *this,
11625 const char *name, short mode)
11627 basic_ifstream_wchar_open(this, name, mode);
11630 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11631 /* ?rdbuf@?$basic_ifstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
11632 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11633 /* ?rdbuf@?$basic_ifstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
11634 DEFINE_THISCALL_WRAPPER(basic_ifstream_wchar_rdbuf, 4)
11635 basic_filebuf_wchar* __thiscall basic_ifstream_wchar_rdbuf(const basic_ifstream_wchar *this)
11637 TRACE("(%p)\n", this);
11638 return (basic_filebuf_wchar*)&this->filebuf;
11641 static inline basic_ios_char* basic_fstream_char_to_basic_ios(basic_fstream_char *ptr)
11643 return (basic_ios_char*)((char*)ptr+basic_fstream_char_vbtable1[1]);
11646 static inline basic_fstream_char* basic_fstream_char_from_basic_ios(basic_ios_char *ptr)
11648 return (basic_fstream_char*)((char*)ptr-basic_fstream_char_vbtable1[1]);
11651 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
11652 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
11653 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
11654 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
11656 basic_ios_char *basic_ios;
11658 TRACE("(%p %d)\n", this, virt_init);
11660 if(virt_init) {
11661 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11662 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11663 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11664 basic_ios_char_ctor(basic_ios);
11665 }else {
11666 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11669 basic_filebuf_char_ctor(&this->filebuf);
11670 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11671 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11672 return this;
11675 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
11676 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11677 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
11678 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
11679 FILE *file, MSVCP_bool virt_init)
11681 basic_ios_char *basic_ios;
11683 TRACE("(%p %p %d)\n", this, file, virt_init);
11685 if(virt_init) {
11686 this->base.base1.vbtable = basic_fstream_char_vbtable1;
11687 this->base.base2.vbtable = basic_fstream_char_vbtable2;
11688 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11689 basic_ios_char_ctor(basic_ios);
11690 }else {
11691 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11694 basic_filebuf_char_ctor_file(&this->filebuf, file);
11695 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
11696 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
11697 return this;
11700 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@ABV01@@Z */
11701 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@AEBV01@@Z */
11702 DEFINE_THISCALL_WRAPPER(basic_fstream_char_copy_ctor, 12)
11703 basic_fstream_char* __thiscall basic_fstream_char_copy_ctor(basic_fstream_char *this,
11704 basic_fstream_char *copy, MSVCP_bool virt_init)
11706 TRACE("(%p %p %d)\n", this, copy, virt_init);
11707 return basic_fstream_char_ctor_file(this, copy->filebuf.file, virt_init);
11710 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDH@Z */
11711 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDH@Z */
11712 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 16)
11713 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
11714 const char *name, int mode, MSVCP_bool virt_init)
11716 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11718 basic_fstream_char_ctor(this, virt_init);
11720 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
11721 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11722 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11724 return this;
11727 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
11728 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
11729 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
11730 void __thiscall basic_fstream_char_dtor(basic_ios_char *base)
11732 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11734 TRACE("(%p)\n", this);
11736 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
11737 basic_filebuf_char_dtor(&this->filebuf);
11740 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11741 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11742 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
11743 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
11745 TRACE("(%p)\n", this);
11747 basic_fstream_char_dtor(basic_fstream_char_to_basic_ios(this));
11748 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
11751 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vector_dtor, 8)
11752 basic_fstream_char* __thiscall basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
11754 basic_fstream_char *this = basic_fstream_char_from_basic_ios(base);
11756 TRACE("(%p %x)\n", this, flags);
11758 if(flags & 2) {
11759 /* we have an array, with the number of elements stored before the first object */
11760 INT_PTR i, *ptr = (INT_PTR *)this-1;
11762 for(i=*ptr-1; i>=0; i--)
11763 basic_fstream_char_vbase_dtor(this+i);
11764 MSVCRT_operator_delete(ptr);
11765 } else {
11766 basic_fstream_char_vbase_dtor(this);
11767 if(flags & 1)
11768 MSVCRT_operator_delete(this);
11771 return this;
11774 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
11775 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
11776 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
11777 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
11779 TRACE("(%p)\n", this);
11781 if(!basic_filebuf_char_close(&this->filebuf)) {
11782 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11783 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11787 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
11788 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
11789 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
11790 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
11792 TRACE("(%p)\n", this);
11793 return basic_filebuf_char_is_open(&this->filebuf);
11796 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z */
11797 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDH@Z */
11798 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 12)
11799 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
11800 const char *name, int mode)
11802 TRACE("(%p %s %d)\n", this, name, mode);
11804 if(!basic_filebuf_char_open(&this->filebuf, name, mode, _SH_DENYNO)) {
11805 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
11806 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
11810 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDF@Z */
11811 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDF@Z */
11812 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
11813 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
11814 const char *name, int mode)
11816 basic_fstream_char_open(this, name, mode);
11819 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11820 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
11821 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
11822 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
11824 TRACE("(%p)\n", this);
11825 return (basic_filebuf_char*)&this->filebuf;
11828 static inline basic_ios_wchar* basic_fstream_wchar_to_basic_ios(basic_fstream_wchar *ptr)
11830 return (basic_ios_wchar*)((char*)ptr+basic_fstream_wchar_vbtable1[1]);
11833 static inline basic_fstream_wchar* basic_fstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
11835 return (basic_fstream_wchar*)((char*)ptr-basic_fstream_wchar_vbtable1[1]);
11838 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ */
11839 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ */
11840 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor, 8)
11841 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
11843 basic_ios_wchar *basic_ios;
11845 TRACE("(%p %d)\n", this, virt_init);
11847 if(virt_init) {
11848 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11849 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11850 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11851 basic_ios_wchar_ctor(basic_ios);
11852 }else {
11853 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11856 basic_filebuf_wchar_ctor(&this->filebuf);
11857 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11858 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11859 return this;
11862 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ */
11863 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ */
11864 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor, 8)
11865 basic_fstream_wchar* __thiscall basic_fstream_short_ctor(basic_fstream_wchar *this, MSVCP_bool virt_init)
11867 basic_fstream_wchar_ctor(this, virt_init);
11868 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11869 return this;
11872 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z */
11873 /* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11874 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_file, 12)
11875 basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_file(basic_fstream_wchar *this,
11876 FILE *file, MSVCP_bool virt_init)
11878 basic_ios_wchar *basic_ios;
11880 TRACE("(%p %p %d)\n", this, file, virt_init);
11882 if(virt_init) {
11883 this->base.base1.vbtable = basic_fstream_wchar_vbtable1;
11884 this->base.base2.vbtable = basic_fstream_wchar_vbtable2;
11885 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11886 basic_ios_wchar_ctor(basic_ios);
11887 }else {
11888 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11891 basic_filebuf_wchar_ctor_file(&this->filebuf, file);
11892 basic_iostream_wchar_ctor(&this->base, &this->filebuf.base, FALSE);
11893 basic_ios->base.vtable = &MSVCP_basic_fstream_wchar_vtable;
11894 return this;
11897 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z */
11898 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z */
11899 DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_file, 12)
11900 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_file(basic_fstream_wchar *this,
11901 FILE *file, MSVCP_bool virt_init)
11903 basic_fstream_wchar_ctor_file(this, file, virt_init);
11904 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
11905 return this;
11908 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@ABV01@@Z */
11909 /* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@AEBV01@@Z */
11910 DEFINE_THISCALL_WRAPPER(basic_fstream_short_copy_ctor, 12)
11911 basic_fstream_wchar* __thiscall basic_fstream_short_copy_ctor(basic_fstream_wchar *this,
11912 basic_fstream_wchar *copy, MSVCP_bool virt_init)
11914 TRACE("(%p %p %d)\n", this, copy, virt_init);
11915 return basic_fstream_short_ctor_file(this, copy->filebuf.file, virt_init);
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_short_ctor_name, 16)
11921 basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
11922 const char *name, int mode, MSVCP_bool virt_init)
11924 TRACE("(%p %s %d %d)\n", this, name, mode, virt_init);
11926 basic_fstream_short_ctor(this, virt_init);
11928 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
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 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
11936 /* ??1?$basic_fstream@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
11937 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UAE@XZ */
11938 /* ??1?$basic_fstream@GU?$char_traits@G@std@@@std@@UEAA@XZ */
11939 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_dtor, 4)
11940 void __thiscall basic_fstream_wchar_dtor(basic_ios_wchar *base)
11942 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11944 TRACE("(%p)\n", this);
11946 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
11947 basic_filebuf_wchar_dtor(&this->filebuf);
11950 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11951 /* ??_D?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11952 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11953 /* ??_D?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11954 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vbase_dtor, 4)
11955 void __thiscall basic_fstream_wchar_vbase_dtor(basic_fstream_wchar *this)
11957 TRACE("(%p)\n", this);
11959 basic_fstream_wchar_dtor(basic_fstream_wchar_to_basic_ios(this));
11960 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
11963 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_vector_dtor, 8)
11964 basic_fstream_wchar* __thiscall basic_fstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
11966 basic_fstream_wchar *this = basic_fstream_wchar_from_basic_ios(base);
11968 TRACE("(%p %x)\n", this, flags);
11970 if(flags & 2) {
11971 /* we have an array, with the number of elements stored before the first object */
11972 INT_PTR i, *ptr = (INT_PTR *)this-1;
11974 for(i=*ptr-1; i>=0; i--)
11975 basic_fstream_wchar_vbase_dtor(this+i);
11976 MSVCRT_operator_delete(ptr);
11977 } else {
11978 basic_fstream_wchar_vbase_dtor(this);
11979 if(flags & 1)
11980 MSVCRT_operator_delete(this);
11983 return this;
11986 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
11987 /* ?close@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
11988 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QAEXXZ */
11989 /* ?close@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAAXXZ */
11990 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_close, 4)
11991 void __thiscall basic_fstream_wchar_close(basic_fstream_wchar *this)
11993 TRACE("(%p)\n", this);
11995 if(!basic_filebuf_wchar_close(&this->filebuf)) {
11996 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
11997 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12001 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBE_NXZ */
12002 /* ?is_open@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBA_NXZ */
12003 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBE_NXZ */
12004 /* ?is_open@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBA_NXZ */
12005 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_is_open, 4)
12006 MSVCP_bool __thiscall basic_fstream_wchar_is_open(const basic_fstream_wchar *this)
12008 TRACE("(%p)\n", this);
12009 return basic_filebuf_wchar_is_open(&this->filebuf);
12012 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDH@Z */
12013 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDH@Z */
12014 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open, 12)
12015 void __thiscall basic_fstream_wchar_open(basic_fstream_wchar *this,
12016 const char *name, int mode)
12018 TRACE("(%p %s %d)\n", this, name, mode);
12020 if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, _SH_DENYNO)) {
12021 basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12022 basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
12026 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PBDF@Z */
12027 /* ?open@?$basic_filebuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEBDF@Z */
12028 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_open_old, 12)
12029 void __thiscall basic_fstream_wchar_open_old(basic_fstream_wchar *this,
12030 const char *name, int mode)
12032 basic_fstream_wchar_open(this, name, mode);
12035 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12036 /* ?rdbuf@?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_filebuf@_WU?$char_traits@_W@std@@@2@XZ */
12037 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12038 /* ?rdbuf@?$basic_fstream@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_filebuf@GU?$char_traits@G@std@@@2@XZ */
12039 DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_rdbuf, 4)
12040 basic_filebuf_wchar* __thiscall basic_fstream_wchar_rdbuf(const basic_fstream_wchar *this)
12042 TRACE("(%p)\n", this);
12043 return (basic_filebuf_wchar*)&this->filebuf;
12046 static inline basic_ios_char* basic_ostringstream_char_to_basic_ios(basic_ostringstream_char *ptr)
12048 return (basic_ios_char*)((char*)ptr+basic_ostringstream_char_vbtable[1]);
12051 static inline basic_ostringstream_char* basic_ostringstream_char_from_basic_ios(basic_ios_char *ptr)
12053 return (basic_ostringstream_char*)((char*)ptr-basic_ostringstream_char_vbtable[1]);
12056 /* ??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 */
12057 /* ??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 */
12058 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_str, 16)
12059 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_str(basic_ostringstream_char *this,
12060 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12062 basic_ios_char *basic_ios;
12064 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12066 if(virt_init) {
12067 this->base.vbtable = basic_ostringstream_char_vbtable;
12068 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12069 basic_ios_char_ctor(basic_ios);
12070 }else {
12071 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12074 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12075 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12076 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12077 return this;
12080 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12081 /* ??0?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12082 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor_mode, 12)
12083 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor_mode(
12084 basic_ostringstream_char *this, int mode, MSVCP_bool virt_init)
12086 basic_ios_char *basic_ios;
12088 TRACE("(%p %d %d)\n", this, mode, virt_init);
12090 if(virt_init) {
12091 this->base.vbtable = basic_ostringstream_char_vbtable;
12092 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12093 basic_ios_char_ctor(basic_ios);
12094 }else {
12095 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
12098 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12099 basic_ostream_char_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12100 basic_ios->base.vtable = &MSVCP_basic_ostringstream_char_vtable;
12101 return this;
12104 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12105 /* ??_F?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12106 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_ctor, 4)
12107 basic_ostringstream_char* __thiscall basic_ostringstream_char_ctor(
12108 basic_ostringstream_char *this)
12110 return basic_ostringstream_char_ctor_mode(this, 0, TRUE);
12113 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12114 /* ??1?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12115 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_dtor, 4)
12116 void __thiscall basic_ostringstream_char_dtor(basic_ios_char *base)
12118 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12120 TRACE("(%p)\n", this);
12122 basic_stringbuf_char_dtor(&this->strbuf);
12123 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
12126 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12127 /* ??_D?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12128 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vbase_dtor, 4)
12129 void __thiscall basic_ostringstream_char_vbase_dtor(basic_ostringstream_char *this)
12131 TRACE("(%p)\n", this);
12133 basic_ostringstream_char_dtor(basic_ostringstream_char_to_basic_ios(this));
12134 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
12137 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_vector_dtor, 8)
12138 basic_ostringstream_char* __thiscall basic_ostringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12140 basic_ostringstream_char *this = basic_ostringstream_char_from_basic_ios(base);
12142 TRACE("(%p %x)\n", this, flags);
12144 if(flags & 2) {
12145 /* we have an array, with the number of elements stored before the first object */
12146 INT_PTR i, *ptr = (INT_PTR *)this-1;
12148 for(i=*ptr-1; i>=0; i--)
12149 basic_ostringstream_char_vbase_dtor(this+i);
12150 MSVCRT_operator_delete(ptr);
12151 } else {
12152 basic_ostringstream_char_vbase_dtor(this);
12153 if(flags & 1)
12154 MSVCRT_operator_delete(this);
12157 return this;
12160 /* ?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 */
12161 /* ?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 */
12162 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_rdbuf, 4)
12163 basic_stringbuf_char* __thiscall basic_ostringstream_char_rdbuf(const basic_ostringstream_char *this)
12165 TRACE("(%p)\n", this);
12166 return (basic_stringbuf_char*)&this->strbuf;
12169 /* ?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 */
12170 /* ?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 */
12171 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_set, 8)
12172 void __thiscall basic_ostringstream_char_str_set(basic_ostringstream_char *this, const basic_string_char *str)
12174 TRACE("(%p %p)\n", this, str);
12175 basic_stringbuf_char_str_set(&this->strbuf, str);
12178 /* ?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 */
12179 /* ?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 */
12180 DEFINE_THISCALL_WRAPPER(basic_ostringstream_char_str_get, 8)
12181 basic_string_char* __thiscall basic_ostringstream_char_str_get(const basic_ostringstream_char *this, basic_string_char *ret)
12183 TRACE("(%p %p)\n", this, ret);
12184 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12187 static inline basic_ios_wchar* basic_ostringstream_wchar_to_basic_ios(basic_ostringstream_wchar *ptr)
12189 return (basic_ios_wchar*)((char*)ptr+basic_ostringstream_wchar_vbtable[1]);
12192 static inline basic_ostringstream_wchar* basic_ostringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12194 return (basic_ostringstream_wchar*)((char*)ptr-basic_ostringstream_wchar_vbtable[1]);
12197 /* ??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 */
12198 /* ??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 */
12199 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_str, 16)
12200 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_str(basic_ostringstream_wchar *this,
12201 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12203 basic_ios_wchar *basic_ios;
12205 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12207 if(virt_init) {
12208 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12209 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12210 basic_ios_wchar_ctor(basic_ios);
12211 }else {
12212 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12215 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_out);
12216 basic_ostream_short_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12217 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12218 return this;
12221 /* ??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 */
12222 /* ??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 */
12223 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_str, 16)
12224 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_str(basic_ostringstream_wchar *this,
12225 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12227 basic_ostringstream_wchar_ctor_str(this, str, mode, virt_init);
12228 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12229 return this;
12232 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12233 /* ??0?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12234 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor_mode, 12)
12235 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor_mode(
12236 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
12238 basic_ios_wchar *basic_ios;
12240 TRACE("(%p %d %d)\n", this, mode, virt_init);
12242 if(virt_init) {
12243 this->base.vbtable = basic_ostringstream_wchar_vbtable;
12244 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12245 basic_ios_wchar_ctor(basic_ios);
12246 }else {
12247 basic_ios = basic_ostream_wchar_get_basic_ios(&this->base);
12250 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_out);
12251 basic_ostream_short_ctor(&this->base, &this->strbuf.base, FALSE, TRUE, FALSE);
12252 basic_ios->base.vtable = &MSVCP_basic_ostringstream_wchar_vtable;
12253 return this;
12256 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12257 /* ??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12258 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor_mode, 12)
12259 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor_mode(
12260 basic_ostringstream_wchar *this, int mode, MSVCP_bool virt_init)
12262 basic_ostringstream_wchar_ctor_mode(this, mode, virt_init);
12263 basic_ostream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_ostringstream_short_vtable;
12264 return this;
12267 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12268 /* ??_F?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12269 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_ctor, 4)
12270 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_ctor(
12271 basic_ostringstream_wchar *this)
12273 return basic_ostringstream_wchar_ctor_mode(this, 0, TRUE);
12276 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12277 /* ??_F?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12278 DEFINE_THISCALL_WRAPPER(basic_ostringstream_short_ctor, 4)
12279 basic_ostringstream_wchar* __thiscall basic_ostringstream_short_ctor(
12280 basic_ostringstream_wchar *this)
12282 return basic_ostringstream_short_ctor_mode(this, 0, TRUE);
12285 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12286 /* ??1?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12287 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12288 /* ??1?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12289 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_dtor, 4)
12290 void __thiscall basic_ostringstream_wchar_dtor(basic_ios_wchar *base)
12292 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12294 TRACE("(%p)\n", this);
12296 basic_stringbuf_wchar_dtor(&this->strbuf);
12297 basic_ostream_wchar_dtor(basic_ostream_wchar_to_basic_ios(&this->base));
12300 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12301 /* ??_D?$basic_ostringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12302 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12303 /* ??_D?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12304 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vbase_dtor, 4)
12305 void __thiscall basic_ostringstream_wchar_vbase_dtor(basic_ostringstream_wchar *this)
12307 TRACE("(%p)\n", this);
12309 basic_ostringstream_wchar_dtor(basic_ostringstream_wchar_to_basic_ios(this));
12310 basic_ios_wchar_dtor(basic_ostream_wchar_get_basic_ios(&this->base));
12313 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_vector_dtor, 8)
12314 basic_ostringstream_wchar* __thiscall basic_ostringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12316 basic_ostringstream_wchar *this = basic_ostringstream_wchar_from_basic_ios(base);
12318 TRACE("(%p %x)\n", this, flags);
12320 if(flags & 2) {
12321 /* we have an array, with the number of elements stored before the first object */
12322 INT_PTR i, *ptr = (INT_PTR *)this-1;
12324 for(i=*ptr-1; i>=0; i--)
12325 basic_ostringstream_wchar_vbase_dtor(this+i);
12326 MSVCRT_operator_delete(ptr);
12327 } else {
12328 basic_ostringstream_wchar_vbase_dtor(this);
12329 if(flags & 1)
12330 MSVCRT_operator_delete(this);
12333 return this;
12336 /* ?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 */
12337 /* ?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 */
12338 /* ?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 */
12339 /* ?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 */
12340 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_rdbuf, 4)
12341 basic_stringbuf_wchar* __thiscall basic_ostringstream_wchar_rdbuf(const basic_ostringstream_wchar *this)
12343 TRACE("(%p)\n", this);
12344 return (basic_stringbuf_wchar*)&this->strbuf;
12347 /* ?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 */
12348 /* ?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 */
12349 /* ?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 */
12350 /* ?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 */
12351 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_set, 8)
12352 void __thiscall basic_ostringstream_wchar_str_set(basic_ostringstream_wchar *this, const basic_string_wchar *str)
12354 TRACE("(%p %p)\n", this, str);
12355 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12358 /* ?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 */
12359 /* ?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 */
12360 /* ?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 */
12361 /* ?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 */
12362 DEFINE_THISCALL_WRAPPER(basic_ostringstream_wchar_str_get, 8)
12363 basic_string_wchar* __thiscall basic_ostringstream_wchar_str_get(const basic_ostringstream_wchar *this, basic_string_wchar *ret)
12365 TRACE("(%p %p)\n", this, ret);
12366 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12369 static inline basic_ios_char* basic_istringstream_char_to_basic_ios(basic_istringstream_char *ptr)
12371 return (basic_ios_char*)((char*)ptr+basic_istringstream_char_vbtable[1]);
12374 static inline basic_istringstream_char* basic_istringstream_char_from_basic_ios(basic_ios_char *ptr)
12376 return (basic_istringstream_char*)((char*)ptr-basic_istringstream_char_vbtable[1]);
12379 /* ??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 */
12380 /* ??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 */
12381 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_str, 16)
12382 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_str(basic_istringstream_char *this,
12383 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12385 basic_ios_char *basic_ios;
12387 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12389 if(virt_init) {
12390 this->base.vbtable = basic_istringstream_char_vbtable;
12391 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12392 basic_ios_char_ctor(basic_ios);
12393 }else {
12394 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12397 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12398 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12399 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12400 return this;
12403 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12404 /* ??0?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12405 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor_mode, 12)
12406 basic_istringstream_char* __thiscall basic_istringstream_char_ctor_mode(
12407 basic_istringstream_char *this, int mode, MSVCP_bool virt_init)
12409 basic_ios_char *basic_ios;
12411 TRACE("(%p %d %d)\n", this, mode, virt_init);
12413 if(virt_init) {
12414 this->base.vbtable = basic_istringstream_char_vbtable;
12415 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12416 basic_ios_char_ctor(basic_ios);
12417 }else {
12418 basic_ios = basic_istream_char_get_basic_ios(&this->base);
12421 basic_stringbuf_char_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12422 basic_istream_char_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12423 basic_ios->base.vtable = &MSVCP_basic_istringstream_char_vtable;
12424 return this;
12427 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12428 /* ??_F?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12429 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_ctor, 4)
12430 basic_istringstream_char* __thiscall basic_istringstream_char_ctor(
12431 basic_istringstream_char *this)
12433 return basic_istringstream_char_ctor_mode(this, 0, TRUE);
12436 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12437 /* ??1?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12438 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_dtor, 4)
12439 void __thiscall basic_istringstream_char_dtor(basic_ios_char *base)
12441 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12443 TRACE("(%p)\n", this);
12445 basic_stringbuf_char_dtor(&this->strbuf);
12446 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
12449 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12450 /* ??_D?$basic_istringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12451 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vbase_dtor, 4)
12452 void __thiscall basic_istringstream_char_vbase_dtor(basic_istringstream_char *this)
12454 TRACE("(%p)\n", this);
12456 basic_istringstream_char_dtor(basic_istringstream_char_to_basic_ios(this));
12457 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
12460 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_vector_dtor, 8)
12461 basic_istringstream_char* __thiscall basic_istringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12463 basic_istringstream_char *this = basic_istringstream_char_from_basic_ios(base);
12465 TRACE("(%p %x)\n", this, flags);
12467 if(flags & 2) {
12468 /* we have an array, with the number of elements stored before the first object */
12469 INT_PTR i, *ptr = (INT_PTR *)this-1;
12471 for(i=*ptr-1; i>=0; i--)
12472 basic_istringstream_char_vbase_dtor(this+i);
12473 MSVCRT_operator_delete(ptr);
12474 } else {
12475 basic_istringstream_char_vbase_dtor(this);
12476 if(flags & 1)
12477 MSVCRT_operator_delete(this);
12480 return this;
12483 /* ?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 */
12484 /* ?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 */
12485 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_rdbuf, 4)
12486 basic_stringbuf_char* __thiscall basic_istringstream_char_rdbuf(const basic_istringstream_char *this)
12488 TRACE("(%p)\n", this);
12489 return (basic_stringbuf_char*)&this->strbuf;
12492 /* ?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 */
12493 /* ?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 */
12494 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_set, 8)
12495 void __thiscall basic_istringstream_char_str_set(basic_istringstream_char *this, const basic_string_char *str)
12497 TRACE("(%p %p)\n", this, str);
12498 basic_stringbuf_char_str_set(&this->strbuf, str);
12501 /* ?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 */
12502 /* ?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 */
12503 DEFINE_THISCALL_WRAPPER(basic_istringstream_char_str_get, 8)
12504 basic_string_char* __thiscall basic_istringstream_char_str_get(const basic_istringstream_char *this, basic_string_char *ret)
12506 TRACE("(%p %p)\n", this, ret);
12507 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12510 static inline basic_ios_wchar* basic_istringstream_wchar_to_basic_ios(basic_istringstream_wchar *ptr)
12512 return (basic_ios_wchar*)((char*)ptr+basic_istringstream_wchar_vbtable[1]);
12515 static inline basic_istringstream_wchar* basic_istringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12517 return (basic_istringstream_wchar*)((char*)ptr-basic_istringstream_wchar_vbtable[1]);
12520 /* ??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 */
12521 /* ??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 */
12522 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_str, 16)
12523 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_str(basic_istringstream_wchar *this,
12524 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12526 basic_ios_wchar *basic_ios;
12528 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12530 if(virt_init) {
12531 this->base.vbtable = basic_istringstream_wchar_vbtable;
12532 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12533 basic_ios_wchar_ctor(basic_ios);
12534 }else {
12535 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12538 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode|OPENMODE_in);
12539 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12540 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12541 return this;
12544 /* ??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 */
12545 /* ??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 */
12546 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_str, 16)
12547 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_str(basic_istringstream_wchar *this,
12548 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12550 basic_istringstream_wchar_ctor_str(this, str, mode, virt_init);
12551 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12552 return this;
12555 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12556 /* ??0?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12557 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor_mode, 12)
12558 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor_mode(
12559 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12561 basic_ios_wchar *basic_ios;
12563 TRACE("(%p %d %d)\n", this, mode, virt_init);
12565 if(virt_init) {
12566 this->base.vbtable = basic_istringstream_wchar_vbtable;
12567 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12568 basic_ios_wchar_ctor(basic_ios);
12569 }else {
12570 basic_ios = basic_istream_wchar_get_basic_ios(&this->base);
12573 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode|OPENMODE_in);
12574 basic_istream_wchar_ctor(&this->base, &this->strbuf.base, FALSE, FALSE);
12575 basic_ios->base.vtable = &MSVCP_basic_istringstream_wchar_vtable;
12576 return this;
12579 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12580 /* ??0?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12581 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor_mode, 12)
12582 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor_mode(
12583 basic_istringstream_wchar *this, int mode, MSVCP_bool virt_init)
12585 basic_istringstream_wchar_ctor_mode(this, mode, virt_init);
12586 basic_istream_wchar_get_basic_ios(&this->base)->base.vtable = &MSVCP_basic_istringstream_short_vtable;
12587 return this;
12590 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12591 /* ??_F?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12592 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_ctor, 4)
12593 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_ctor(
12594 basic_istringstream_wchar *this)
12596 return basic_istringstream_wchar_ctor_mode(this, 0, TRUE);
12599 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12600 /* ??_F?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12601 DEFINE_THISCALL_WRAPPER(basic_istringstream_short_ctor, 4)
12602 basic_istringstream_wchar* __thiscall basic_istringstream_short_ctor(
12603 basic_istringstream_wchar *this)
12605 return basic_istringstream_short_ctor_mode(this, 0, TRUE);
12608 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12609 /* ??1?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12610 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12611 /* ??1?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12612 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_dtor, 4)
12613 void __thiscall basic_istringstream_wchar_dtor(basic_ios_wchar *base)
12615 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12617 TRACE("(%p)\n", this);
12619 basic_stringbuf_wchar_dtor(&this->strbuf);
12620 basic_istream_wchar_dtor(basic_istream_wchar_to_basic_ios(&this->base));
12623 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12624 /* ??_D?$basic_istringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12625 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12626 /* ??_D?$basic_istringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12627 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vbase_dtor, 4)
12628 void __thiscall basic_istringstream_wchar_vbase_dtor(basic_istringstream_wchar *this)
12630 TRACE("(%p)\n", this);
12632 basic_istringstream_wchar_dtor(basic_istringstream_wchar_to_basic_ios(this));
12633 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base));
12636 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_vector_dtor, 8)
12637 basic_istringstream_wchar* __thiscall basic_istringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12639 basic_istringstream_wchar *this = basic_istringstream_wchar_from_basic_ios(base);
12641 TRACE("(%p %x)\n", this, flags);
12643 if(flags & 2) {
12644 /* we have an array, with the number of elements stored before the first object */
12645 INT_PTR i, *ptr = (INT_PTR *)this-1;
12647 for(i=*ptr-1; i>=0; i--)
12648 basic_istringstream_wchar_vbase_dtor(this+i);
12649 MSVCRT_operator_delete(ptr);
12650 } else {
12651 basic_istringstream_wchar_vbase_dtor(this);
12652 if(flags & 1)
12653 MSVCRT_operator_delete(this);
12656 return this;
12659 /* ?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 */
12660 /* ?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 */
12661 /* ?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 */
12662 /* ?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 */
12663 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_rdbuf, 4)
12664 basic_stringbuf_wchar* __thiscall basic_istringstream_wchar_rdbuf(const basic_istringstream_wchar *this)
12666 TRACE("(%p)\n", this);
12667 return (basic_stringbuf_wchar*)&this->strbuf;
12670 /* ?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 */
12671 /* ?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 */
12672 /* ?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 */
12673 /* ?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 */
12674 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_set, 8)
12675 void __thiscall basic_istringstream_wchar_str_set(basic_istringstream_wchar *this, const basic_string_wchar *str)
12677 TRACE("(%p %p)\n", this, str);
12678 basic_stringbuf_wchar_str_set(&this->strbuf, str);
12681 /* ?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 */
12682 /* ?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 */
12683 /* ?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 */
12684 /* ?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 */
12685 DEFINE_THISCALL_WRAPPER(basic_istringstream_wchar_str_get, 8)
12686 basic_string_wchar* __thiscall basic_istringstream_wchar_str_get(const basic_istringstream_wchar *this, basic_string_wchar *ret)
12688 TRACE("(%p %p)\n", this, ret);
12689 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
12692 static inline basic_ios_char* basic_stringstream_char_to_basic_ios(basic_stringstream_char *ptr)
12694 return (basic_ios_char*)((char*)ptr+basic_stringstream_char_vbtable1[1]);
12697 static inline basic_stringstream_char* basic_stringstream_char_from_basic_ios(basic_ios_char *ptr)
12699 return (basic_stringstream_char*)((char*)ptr-basic_stringstream_char_vbtable1[1]);
12702 /* ??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 */
12703 /* ??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 */
12704 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_str, 16)
12705 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_str(basic_stringstream_char *this,
12706 const basic_string_char *str, int mode, MSVCP_bool virt_init)
12708 basic_ios_char *basic_ios;
12710 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12712 if(virt_init) {
12713 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12714 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12715 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12716 basic_ios_char_ctor(basic_ios);
12717 }else {
12718 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12721 basic_stringbuf_char_ctor_str(&this->strbuf, str, mode);
12722 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12723 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12724 return this;
12727 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@H@Z */
12728 /* ??0?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@H@Z */
12729 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor_mode, 12)
12730 basic_stringstream_char* __thiscall basic_stringstream_char_ctor_mode(
12731 basic_stringstream_char *this, int mode, MSVCP_bool virt_init)
12733 basic_ios_char *basic_ios;
12735 TRACE("(%p %d %d)\n", this, mode, virt_init);
12737 if(virt_init) {
12738 this->base.base1.vbtable = basic_stringstream_char_vbtable1;
12739 this->base.base2.vbtable = basic_stringstream_char_vbtable2;
12740 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12741 basic_ios_char_ctor(basic_ios);
12742 }else {
12743 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
12746 basic_stringbuf_char_ctor_mode(&this->strbuf, mode);
12747 basic_iostream_char_ctor(&this->base, &this->strbuf.base, FALSE);
12748 basic_ios->base.vtable = &MSVCP_basic_stringstream_char_vtable;
12749 return this;
12752 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12753 /* ??_F?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12754 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_ctor, 4)
12755 basic_stringstream_char* __thiscall basic_stringstream_char_ctor(
12756 basic_stringstream_char *this)
12758 return basic_stringstream_char_ctor_mode(
12759 this, OPENMODE_out|OPENMODE_in, TRUE);
12762 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UAE@XZ */
12763 /* ??1?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@UEAA@XZ */
12764 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_dtor, 4)
12765 void __thiscall basic_stringstream_char_dtor(basic_ios_char *base)
12767 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12769 TRACE("(%p)\n", this);
12771 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
12772 basic_stringbuf_char_dtor(&this->strbuf);
12775 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
12776 /* ??_D?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
12777 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vbase_dtor, 4)
12778 void __thiscall basic_stringstream_char_vbase_dtor(basic_stringstream_char *this)
12780 TRACE("(%p)\n", this);
12782 basic_stringstream_char_dtor(basic_stringstream_char_to_basic_ios(this));
12783 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
12786 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_vector_dtor, 8)
12787 basic_stringstream_char* __thiscall basic_stringstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
12789 basic_stringstream_char *this = basic_stringstream_char_from_basic_ios(base);
12791 TRACE("(%p %x)\n", this, flags);
12793 if(flags & 2) {
12794 /* we have an array, with the number of elements stored before the first object */
12795 INT_PTR i, *ptr = (INT_PTR *)this-1;
12797 for(i=*ptr-1; i>=0; i--)
12798 basic_stringstream_char_vbase_dtor(this+i);
12799 MSVCRT_operator_delete(ptr);
12800 } else {
12801 basic_stringstream_char_vbase_dtor(this);
12802 if(flags & 1)
12803 MSVCRT_operator_delete(this);
12806 return this;
12809 /* ?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 */
12810 /* ?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 */
12811 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_rdbuf, 4)
12812 basic_stringbuf_char* __thiscall basic_stringstream_char_rdbuf(const basic_stringstream_char *this)
12814 TRACE("(%p)\n", this);
12815 return (basic_stringbuf_char*)&this->strbuf;
12818 /* ?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 */
12819 /* ?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 */
12820 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_set, 8)
12821 void __thiscall basic_stringstream_char_str_set(basic_stringstream_char *this, const basic_string_char *str)
12823 TRACE("(%p %p)\n", this, str);
12824 basic_stringbuf_char_str_set(&this->strbuf, str);
12827 /* ?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 */
12828 /* ?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 */
12829 DEFINE_THISCALL_WRAPPER(basic_stringstream_char_str_get, 8)
12830 basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_stringstream_char *this, basic_string_char *ret)
12832 TRACE("(%p %p)\n", this, ret);
12833 return basic_stringbuf_char_str_get(&this->strbuf, ret);
12836 static inline basic_ios_wchar* basic_stringstream_wchar_to_basic_ios(basic_stringstream_wchar *ptr)
12838 return (basic_ios_wchar*)((char*)ptr+basic_stringstream_wchar_vbtable1[1]);
12841 static inline basic_stringstream_wchar* basic_stringstream_wchar_from_basic_ios(basic_ios_wchar *ptr)
12843 return (basic_stringstream_wchar*)((char*)ptr-basic_stringstream_wchar_vbtable1[1]);
12846 /* ??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 */
12847 /* ??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 */
12848 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
12849 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
12850 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12852 basic_ios_wchar *basic_ios;
12854 TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
12856 if(virt_init) {
12857 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12858 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12859 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12860 basic_ios_wchar_ctor(basic_ios);
12861 }else {
12862 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12865 basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
12866 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12867 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12868 return this;
12871 /* ??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 */
12872 /* ??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 */
12873 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_str, 16)
12874 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_str(basic_stringstream_wchar *this,
12875 const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
12877 basic_stringstream_wchar_ctor_str(this, str, mode, virt_init);
12878 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12879 return this;
12882 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
12883 /* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
12884 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
12885 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
12886 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
12888 basic_ios_wchar *basic_ios;
12890 TRACE("(%p %d %d)\n", this, mode, virt_init);
12892 if(virt_init) {
12893 this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
12894 this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
12895 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12896 basic_ios_wchar_ctor(basic_ios);
12897 }else {
12898 basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
12901 basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
12902 basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
12903 basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
12904 return this;
12907 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z */
12908 /* ??0?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@H@Z */
12909 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor_mode, 12)
12910 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor_mode(
12911 basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
12913 basic_stringstream_wchar_ctor_mode(this, mode, virt_init);
12914 basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_stringstream_short_vtable;
12915 return this;
12918 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12919 /* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12920 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 4)
12921 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
12922 basic_stringstream_wchar *this)
12924 return basic_stringstream_wchar_ctor_mode(
12925 this, OPENMODE_out|OPENMODE_in, TRUE);
12928 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12929 /* ??_F?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12930 DEFINE_THISCALL_WRAPPER(basic_stringstream_short_ctor, 4)
12931 basic_stringstream_wchar* __thiscall basic_stringstream_short_ctor(
12932 basic_stringstream_wchar *this)
12934 return basic_stringstream_short_ctor_mode(
12935 this, OPENMODE_out|OPENMODE_in, TRUE);
12938 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
12939 /* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
12940 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UAE@XZ */
12941 /* ??1?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@UEAA@XZ */
12942 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
12943 void __thiscall basic_stringstream_wchar_dtor(basic_ios_wchar *base)
12945 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
12947 TRACE("(%p)\n", this);
12949 basic_iostream_wchar_dtor(basic_iostream_wchar_to_basic_ios(&this->base));
12950 basic_stringbuf_wchar_dtor(&this->strbuf);
12953 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
12954 /* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
12955 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
12956 /* ??_D?$basic_stringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
12957 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
12958 void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
12960 TRACE("(%p)\n", this);
12962 basic_stringstream_wchar_dtor(basic_stringstream_wchar_to_basic_ios(this));
12963 basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
12966 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vector_dtor, 8)
12967 basic_stringstream_wchar* __thiscall basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
12969 basic_stringstream_wchar *this = basic_stringstream_wchar_from_basic_ios(base);
12971 TRACE("(%p %x)\n", this, flags);
12973 if(flags & 2) {
12974 /* we have an array, with the number of elements stored before the first object */
12975 INT_PTR i, *ptr = (INT_PTR *)this-1;
12977 for(i=*ptr-1; i>=0; i--)
12978 basic_stringstream_wchar_vbase_dtor(this+i);
12979 MSVCRT_operator_delete(ptr);
12980 } else {
12981 basic_stringstream_wchar_vbase_dtor(this);
12982 if(flags & 1)
12983 MSVCRT_operator_delete(this);
12986 return this;
12989 /* ?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 */
12990 /* ?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 */
12991 /* ?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 */
12992 /* ?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 */
12993 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
12994 basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
12996 TRACE("(%p)\n", this);
12997 return (basic_stringbuf_wchar*)&this->strbuf;
13000 /* ?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 */
13001 /* ?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 */
13002 /* ?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 */
13003 /* ?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 */
13004 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
13005 void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
13007 TRACE("(%p %p)\n", this, str);
13008 basic_stringbuf_wchar_str_set(&this->strbuf, str);
13011 /* ?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 */
13012 /* ?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 */
13013 /* ?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 */
13014 /* ?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 */
13015 DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
13016 basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
13018 TRACE("(%p %p)\n", this, ret);
13019 return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
13022 /* ?_Init@strstreambuf@std@@IAEXHPAD0H@Z */
13023 /* ?_Init@strstreambuf@std@@IEAAX_JPEAD1H@Z */
13024 #if STREAMSIZE_BITS == 64
13025 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 24)
13026 #else
13027 DEFINE_THISCALL_WRAPPER(strstreambuf__Init, 20)
13028 #endif
13029 void __thiscall strstreambuf__Init(strstreambuf *this, streamsize len, char *g, char *p, int mode)
13031 TRACE("(%p %s %p %p %d)\n", this, wine_dbgstr_longlong(len), g, p, mode);
13033 this->minsize = 32;
13034 this->endsave = NULL;
13035 this->strmode = mode;
13036 this->palloc = NULL;
13037 this->pfree = NULL;
13039 if(!g) {
13040 this->strmode |= STRSTATE_Dynamic;
13041 if(len > this->minsize)
13042 this->minsize = len;
13043 this->seekhigh = NULL;
13044 return;
13047 if(len < 0)
13048 len = INT_MAX;
13049 else if(!len)
13050 len = strlen(g);
13052 this->seekhigh = g+len;
13053 basic_streambuf_char_setg(&this->base, g, g, p ? p : this->seekhigh);
13054 if(p)
13055 basic_streambuf_char_setp(&this->base, p, this->seekhigh);
13058 /* ??0strstreambuf@std@@QAE@PACH0@Z */
13059 /* ??0strstreambuf@std@@QEAA@PEAC_J0@Z */
13060 /* ??0strstreambuf@std@@QAE@PADH0@Z */
13061 /* ??0strstreambuf@std@@QEAA@PEAD_J0@Z */
13062 /* ??0strstreambuf@std@@QAE@PAEH0@Z */
13063 /* ??0strstreambuf@std@@QEAA@PEAE_J0@Z */
13064 #if STREAMSIZE_BITS == 64
13065 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 20)
13066 #else
13067 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get_put, 16)
13068 #endif
13069 strstreambuf* __thiscall strstreambuf_ctor_get_put(strstreambuf *this, char *g, streamsize len, char *p)
13071 TRACE("(%p %p %s %p)\n", this, g, wine_dbgstr_longlong(len), p);
13073 basic_streambuf_char_ctor(&this->base);
13074 this->base.vtable = &MSVCP_strstreambuf_vtable;
13076 strstreambuf__Init(this, len, g, p, 0);
13077 return this;
13080 /* ??0strstreambuf@std@@QAE@H@Z */
13081 /* ??0strstreambuf@std@@QEAA@_J@Z */
13082 #if STREAMSIZE_BITS == 64
13083 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 12)
13084 #else
13085 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_len, 8)
13086 #endif
13087 strstreambuf* __thiscall strstreambuf_ctor_len(strstreambuf *this, streamsize len)
13089 return strstreambuf_ctor_get_put(this, NULL, len, NULL);
13092 /* ??0strstreambuf@std@@QAE@P6APAXI@ZP6AXPAX@Z@Z */
13093 /* ??0strstreambuf@std@@QEAA@P6APEAX_K@ZP6AXPEAX@Z@Z */
13094 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_alloc, 12)
13095 strstreambuf* __thiscall strstreambuf_ctor_alloc(strstreambuf *this, void* (__cdecl *palloc)(MSVCP_size_t), void (__cdecl *pfree)(void*))
13097 TRACE("(%p %p %p)\n", this, palloc, pfree);
13099 strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13100 this->palloc = palloc;
13101 this->pfree = pfree;
13102 return this;
13105 /* ??0strstreambuf@std@@QAE@PBCH@Z */
13106 /* ??0strstreambuf@std@@QEAA@PEBC_J@Z */
13107 /* ??0strstreambuf@std@@QAE@PBDH@Z */
13108 /* ??0strstreambuf@std@@QEAA@PEBD_J@Z */
13109 /* ??0strstreambuf@std@@QAE@PBEH@Z */
13110 /* ??0strstreambuf@std@@QEAA@PEBE_J@Z */
13111 #if STREAMSIZE_BITS == 64
13112 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 16)
13113 #else
13114 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor_get, 12)
13115 #endif
13116 strstreambuf* __thiscall strstreambuf_ctor_get(strstreambuf *this, const char *g, streamsize len)
13118 TRACE("(%p %p %s)\n", this, g, wine_dbgstr_longlong(len));
13120 strstreambuf_ctor_get_put(this, (char*)g, len, NULL);
13121 this->strmode |= STRSTATE_Constant;
13122 return this;
13125 /* ??_Fstrstreambuf@std@@QAEXXZ */
13126 /* ??_Fstrstreambuf@std@@QEAAXXZ */
13127 DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4)
13128 strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this)
13130 return strstreambuf_ctor_get_put(this, NULL, 0, NULL);
13133 /* ?_Tidy@strstreambuf@std@@IAEXXZ */
13134 /* ?_Tidy@strstreambuf@std@@IEAAXXZ */
13135 DEFINE_THISCALL_WRAPPER(strstreambuf__Tidy, 4)
13136 void __thiscall strstreambuf__Tidy(strstreambuf *this)
13138 TRACE("(%p)\n", this);
13140 if((this->strmode & STRSTATE_Allocated) && !(this->strmode & STRSTATE_Frozen)) {
13141 if(this->pfree)
13142 this->pfree(basic_streambuf_char_eback(&this->base));
13143 else
13144 MSVCRT_operator_delete(basic_streambuf_char_eback(&this->base));
13147 this->endsave = NULL;
13148 this->seekhigh = NULL;
13149 this->strmode &= ~(STRSTATE_Allocated | STRSTATE_Frozen);
13150 basic_streambuf_char_setg(&this->base, NULL, NULL, NULL);
13151 basic_streambuf_char_setp(&this->base, NULL, NULL);
13154 /* ??1strstreambuf@std@@UAE@XZ */
13155 /* ??1strstreambuf@std@@UEAA@XZ */
13156 DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4)
13157 void __thiscall strstreambuf_dtor(strstreambuf *this)
13159 TRACE("(%p)\n", this);
13161 strstreambuf__Tidy(this);
13162 basic_streambuf_char_dtor(&this->base);
13165 DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8)
13166 strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags)
13168 TRACE("(%p %x)\n", this, flags);
13169 if(flags & 2) {
13170 /* we have an array, with the number of elements stored before the first object */
13171 INT_PTR i, *ptr = (INT_PTR *)this-1;
13173 for(i=*ptr-1; i>=0; i--)
13174 strstreambuf_dtor(this+i);
13175 MSVCRT_operator_delete(ptr);
13176 } else {
13177 strstreambuf_dtor(this);
13178 if(flags & 1)
13179 MSVCRT_operator_delete(this);
13182 return this;
13185 /* ?freeze@strstreambuf@std@@QAEX_N@Z */
13186 /* ?freeze@strstreambuf@std@@QEAAX_N@Z */
13187 DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8)
13188 void __thiscall strstreambuf_freeze(strstreambuf *this, MSVCP_bool freeze)
13190 TRACE("(%p %d)\n", this, freeze);
13192 if(!freeze == !(this->strmode & STRSTATE_Frozen))
13193 return;
13195 if(freeze) {
13196 this->strmode |= STRSTATE_Frozen;
13197 this->endsave = basic_streambuf_char_epptr(&this->base);
13198 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13199 basic_streambuf_char_pptr(&this->base), basic_streambuf_char_eback(&this->base));
13200 }else {
13201 this->strmode &= ~STRSTATE_Frozen;
13202 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base),
13203 basic_streambuf_char_pptr(&this->base), this->endsave);
13207 /* ?str@strstreambuf@std@@QAEPADXZ */
13208 /* ?str@strstreambuf@std@@QEAAPEADXZ */
13209 DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4)
13210 char* __thiscall strstreambuf_str(strstreambuf *this)
13212 TRACE("(%p)\n", this);
13214 strstreambuf_freeze(this, TRUE);
13215 return basic_streambuf_char_gptr(&this->base);
13218 /* ?pcount@strstreambuf@std@@QBEHXZ */
13219 /* ?pcount@strstreambuf@std@@QEBA_JXZ */
13220 DEFINE_THISCALL_WRAPPER(strstreambuf_pcount, 4)
13221 streamsize __thiscall strstreambuf_pcount(const strstreambuf *this)
13223 char *ppos = basic_streambuf_char_pptr(&this->base);
13225 TRACE("(%p)\n", this);
13227 return ppos ? ppos-basic_streambuf_char_pbase(&this->base) : 0;
13230 /* ?overflow@strstreambuf@std@@MAEHH@Z */
13231 /* ?overflow@strstreambuf@std@@MEAAHH@Z */
13232 DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8)
13233 int __thiscall strstreambuf_overflow(strstreambuf *this, int c)
13235 MSVCP_size_t old_size, size;
13236 char *ptr, *buf;
13238 TRACE("(%p %d)\n", this, c);
13240 if(c == EOF)
13241 return !EOF;
13243 if(this->strmode & STRSTATE_Frozen)
13244 return EOF;
13246 ptr = basic_streambuf_char_pptr(&this->base);
13247 if(ptr && ptr<basic_streambuf_char_epptr(&this->base))
13248 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13250 if(!(this->strmode & STRSTATE_Dynamic) || (this->strmode & STRSTATE_Constant))
13251 return EOF;
13253 ptr = basic_streambuf_char_eback(&this->base);
13254 old_size = ptr ? basic_streambuf_char_epptr(&this->base) - ptr : 0;
13256 size = old_size + old_size/2;
13257 if(size < this->minsize)
13258 size = this->minsize;
13260 if(this->palloc)
13261 buf = this->palloc(size);
13262 else
13263 buf = MSVCRT_operator_new(size);
13264 if(!buf)
13265 return EOF;
13267 memcpy(buf, ptr, old_size);
13268 if(this->strmode & STRSTATE_Allocated) {
13269 if(this->pfree)
13270 this->pfree(ptr);
13271 else
13272 MSVCRT_operator_delete(ptr);
13275 this->strmode |= STRSTATE_Allocated;
13276 if(!old_size) {
13277 this->seekhigh = buf;
13278 basic_streambuf_char_setp(&this->base, buf, buf+size);
13279 basic_streambuf_char_setg(&this->base, buf, buf, buf);
13280 }else {
13281 this->seekhigh = this->seekhigh-ptr+buf;
13282 basic_streambuf_char_setp_next(&this->base, basic_streambuf_char_pbase(&this->base)-ptr+buf,
13283 basic_streambuf_char_pptr(&this->base)-ptr+buf, buf+size);
13284 basic_streambuf_char_setg(&this->base, buf, basic_streambuf_char_gptr(&this->base)-ptr+buf,
13285 basic_streambuf_char_pptr(&this->base));
13288 return (unsigned char)(*basic_streambuf_char__Pninc(&this->base) = c);
13291 /* ?pbackfail@strstreambuf@std@@MAEHH@Z */
13292 /* ?pbackfail@strstreambuf@std@@MEAAHH@Z */
13293 DEFINE_THISCALL_WRAPPER(strstreambuf_pbackfail, 8)
13294 int __thiscall strstreambuf_pbackfail(strstreambuf *this, int c)
13296 char *ptr = basic_streambuf_char_gptr(&this->base);
13298 TRACE("(%p %d)\n", this, c);
13300 if(ptr<=basic_streambuf_char_eback(&this->base)
13301 || ((this->strmode & STRSTATE_Constant) && c!=ptr[-1]))
13302 return EOF;
13304 basic_streambuf_char_gbump(&this->base, -1);
13305 if(c == EOF)
13306 return !EOF;
13307 if(this->strmode & STRSTATE_Constant)
13308 return (unsigned char)c;
13310 return (unsigned char)(ptr[0] = c);
13313 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JW4seekdir@ios_base@2@H@Z */
13314 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JW4seekdir@ios_base@2@H@Z */
13315 /* ?seekoff@strstreambuf@std@@MAE?AV?$fpos@H@2@JHH@Z */
13316 /* ?seekoff@strstreambuf@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
13317 #if STREAMOFF_BITS == 64
13318 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 24)
13319 #else
13320 DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 20)
13321 #endif
13322 fpos_int* __thiscall strstreambuf_seekoff(strstreambuf *this, fpos_int *ret, streamoff off, int way, int mode)
13324 char *eback = basic_streambuf_char_eback(&this->base);
13325 char *pptr = basic_streambuf_char_pptr(&this->base);
13326 char *gptr = basic_streambuf_char_gptr(&this->base);
13328 TRACE("(%p %p %s %d %d)\n", this, ret, wine_dbgstr_longlong(off), way, mode);
13330 ret->off = 0;
13331 ret->state = 0;
13333 if(pptr > this->seekhigh)
13334 this->seekhigh = pptr;
13336 if((mode & OPENMODE_in) && gptr) {
13337 if(way==SEEKDIR_cur && !(mode & OPENMODE_out))
13338 off += gptr-eback;
13339 else if(way == SEEKDIR_end)
13340 off += this->seekhigh-eback;
13341 else if(way != SEEKDIR_beg)
13342 off = -1;
13344 if(off<0 || off>this->seekhigh-eback) {
13345 off = -1;
13346 }else {
13347 basic_streambuf_char_gbump(&this->base, eback-gptr+off);
13348 if((mode & OPENMODE_out) && pptr) {
13349 basic_streambuf_char_setp_next(&this->base, eback,
13350 gptr, basic_streambuf_char_epptr(&this->base));
13353 }else if((mode & OPENMODE_out) && pptr) {
13354 if(way == SEEKDIR_cur)
13355 off += pptr-eback;
13356 else if(way == SEEKDIR_end)
13357 off += this->seekhigh-eback;
13358 else if(way != SEEKDIR_beg)
13359 off = -1;
13361 if(off<0 || off>this->seekhigh-eback)
13362 off = -1;
13363 else
13364 basic_streambuf_char_pbump(&this->base, eback-pptr+off);
13365 }else {
13366 off = -1;
13369 ret->pos = off;
13370 return ret;
13373 /* ?seekpos@strstreambuf@std@@MAE?AV?$fpos@H@2@V32@H@Z */
13374 /* ?seekpos@strstreambuf@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
13375 DEFINE_THISCALL_WRAPPER(strstreambuf_seekpos, 36)
13376 fpos_int* __thiscall strstreambuf_seekpos(strstreambuf *this, fpos_int *ret, fpos_int pos, int mode)
13378 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
13380 if(pos.off==-1 && pos.pos==0 && pos.state==0) {
13381 *ret = pos;
13382 return ret;
13385 return strstreambuf_seekoff(this, ret, pos.pos+pos.off, SEEKDIR_beg, mode);
13388 /* ?underflow@strstreambuf@std@@MAEHXZ */
13389 /* ?underflow@strstreambuf@std@@MEAAHXZ */
13390 DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4)
13391 int __thiscall strstreambuf_underflow(strstreambuf *this)
13393 char *gptr = basic_streambuf_char_gptr(&this->base);
13394 char *pptr;
13396 TRACE("(%p)\n", this);
13398 if(!gptr)
13399 return EOF;
13401 if(gptr < basic_streambuf_char_egptr(&this->base))
13402 return (unsigned char)(*gptr);
13404 pptr = basic_streambuf_char_gptr(&this->base);
13405 if(pptr > this->seekhigh)
13406 this->seekhigh = pptr;
13408 if(this->seekhigh <= gptr)
13409 return EOF;
13411 basic_streambuf_char_setg(&this->base, basic_streambuf_char_eback(&this->base),
13412 gptr, this->seekhigh);
13413 return (unsigned char)(*gptr);
13416 static inline basic_ios_char* ostrstream_to_basic_ios(ostrstream *ptr)
13418 return (basic_ios_char*)((char*)ptr+ostrstream_vbtable[1]);
13421 static inline ostrstream* ostrstream_from_basic_ios(basic_ios_char *ptr)
13423 return (ostrstream*)((char*)ptr-ostrstream_vbtable[1]);
13426 /* ??0ostrstream@std@@QAE@PADHH@Z */
13427 #if STREAMSIZE_BITS == 64
13428 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 24)
13429 #else
13430 DEFINE_THISCALL_WRAPPER(ostrstream_ctor, 20)
13431 #endif
13432 ostrstream* __thiscall ostrstream_ctor(ostrstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
13434 basic_ios_char *basic_ios;
13436 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13438 if(virt_init) {
13439 this->base.vbtable = ostrstream_vbtable;
13440 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13441 basic_ios_char_ctor(basic_ios);
13442 }else {
13443 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
13446 strstreambuf_ctor_get_put(&this->buf, buf, size,
13447 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13448 basic_ostream_char_ctor(&this->base, &this->buf.base, FALSE, TRUE, FALSE);
13449 basic_ios->base.vtable = &MSVCP_ostrstream_vtable;
13450 return this;
13453 /* ??1ostrstream@std@@UAE@XZ */
13454 /* ??1ostrstream@std@@UEAA@XZ */
13455 DEFINE_THISCALL_WRAPPER(ostrstream_dtor, 4)
13456 void __thiscall ostrstream_dtor(basic_ios_char *base)
13458 ostrstream *this = ostrstream_from_basic_ios(base);
13460 TRACE("(%p)\n", this);
13462 basic_ostream_char_dtor(basic_ostream_char_to_basic_ios(&this->base));
13463 strstreambuf_dtor(&this->buf);
13466 static void ostrstream_vbase_dtor(ostrstream *this)
13468 TRACE("(%p)\n", this);
13470 ostrstream_dtor(ostrstream_to_basic_ios(this));
13471 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
13474 DEFINE_THISCALL_WRAPPER(ostrstream_vector_dtor, 8)
13475 ostrstream* __thiscall ostrstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13477 ostrstream *this = ostrstream_from_basic_ios(base);
13479 TRACE("(%p %x)\n", this, flags);
13481 if(flags & 2) {
13482 /* we have an array, with the number of elements stored before the first object */
13483 INT_PTR i, *ptr = (INT_PTR *)this-1;
13485 for(i=*ptr-1; i>=0; i--)
13486 ostrstream_vbase_dtor(this+i);
13487 MSVCRT_operator_delete(ptr);
13488 } else {
13489 ostrstream_vbase_dtor(this);
13490 if(flags & 1)
13491 MSVCRT_operator_delete(this);
13494 return this;
13497 static inline istrstream* istrstream_from_basic_ios(basic_ios_char *ptr)
13499 return (istrstream*)((char*)ptr-istrstream_vbtable[1]);
13502 /* ??1istrstream@std@@UAE@XZ */
13503 /* ??1istrstream@std@@UEAA@XZ */
13504 DEFINE_THISCALL_WRAPPER(istrstream_dtor, 4)
13505 void __thiscall istrstream_dtor(basic_ios_char *base)
13507 istrstream *this = istrstream_from_basic_ios(base);
13509 TRACE("(%p)\n", this);
13511 basic_istream_char_dtor(basic_istream_char_to_basic_ios(&this->base));
13512 strstreambuf_dtor(&this->buf);
13515 static inline basic_ios_char* strstream_to_basic_ios(strstream *ptr)
13517 return (basic_ios_char*)((char*)ptr+strstream_vbtable1[1]);
13520 static inline strstream* strstream_from_basic_ios(basic_ios_char *ptr)
13522 return (strstream*)((char*)ptr-strstream_vbtable1[1]);
13525 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@M@0@@Z */
13526 /* ??$?6MDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@M@0@@Z */
13527 basic_ostream_char* __cdecl basic_ostream_char_print_complex_float(basic_ostream_char *ostr, const complex_float *val)
13529 struct {
13530 basic_ostringstream_char obj;
13531 basic_ios_char vbase;
13532 } oss;
13533 ios_base *ostringstream_ios_base, *ostream_ios_base;
13534 locale loc;
13535 basic_string_char str;
13536 basic_ostringstream_char_ctor(&oss.obj);
13537 ostringstream_ios_base = &oss.vbase.base;
13538 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13539 TRACE("(%p %p)\n", ostr, val);
13541 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
13542 locale_dtor(&loc);
13543 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13544 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13546 basic_ostream_char_print_ch(&oss.obj.base, '(');
13547 basic_ostream_char_print_float(&oss.obj.base, val->real);
13548 basic_ostream_char_print_ch(&oss.obj.base, ',');
13549 basic_ostream_char_print_float(&oss.obj.base, val->imag);
13550 basic_ostream_char_print_ch(&oss.obj.base, ')');
13552 basic_ostringstream_char_str_get(&oss.obj, &str);
13553 basic_ostringstream_char_dtor(&oss.vbase);
13554 basic_ostream_char_print_bstr(ostr, &str);
13555 MSVCP_basic_string_char_dtor(&str);
13556 return ostr;
13559 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$complex@N@0@@Z */
13560 /* ??$?6NDU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@N@0@@Z */
13561 basic_ostream_char* __cdecl basic_ostream_char_print_complex_double(basic_ostream_char *ostr, const complex_double *val)
13563 struct {
13564 basic_ostringstream_char obj;
13565 basic_ios_char vbase;
13566 } oss;
13567 ios_base *ostringstream_ios_base, *ostream_ios_base;
13568 locale loc;
13569 basic_string_char str;
13570 basic_ostringstream_char_ctor(&oss.obj);
13571 ostringstream_ios_base = &oss.vbase.base;
13572 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13573 TRACE("(%p %p)\n", ostr, val);
13575 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
13576 locale_dtor(&loc);
13577 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13578 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13580 basic_ostream_char_print_ch(&oss.obj.base, '(');
13581 basic_ostream_char_print_double(&oss.obj.base, val->real);
13582 basic_ostream_char_print_ch(&oss.obj.base, ',');
13583 basic_ostream_char_print_double(&oss.obj.base, val->imag);
13584 basic_ostream_char_print_ch(&oss.obj.base, ')');
13586 basic_ostringstream_char_str_get(&oss.obj, &str);
13587 basic_ostringstream_char_dtor(&oss.vbase);
13588 basic_ostream_char_print_bstr(ostr, &str);
13589 MSVCP_basic_string_char_dtor(&str);
13590 return ostr;
13593 /* ??$?6odu?$char_traits@d@std@@@std@@yaaav?$basic_ostream@du?$char_traits@d@std@@@0@aav10@abv?$complex@o@0@@Z */
13594 /* ??$?6ODU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@AEBV?$complex@O@0@@Z */
13595 basic_ostream_char* __cdecl basic_ostream_char_print_complex_ldouble(basic_ostream_char *ostr, const complex_double *val)
13597 struct {
13598 basic_ostringstream_char obj;
13599 basic_ios_char vbase;
13600 } oss;
13601 ios_base *ostringstream_ios_base, *ostream_ios_base;
13602 locale loc;
13603 basic_string_char str;
13604 basic_ostringstream_char_ctor(&oss.obj);
13605 ostringstream_ios_base = &oss.vbase.base;
13606 ostream_ios_base = &basic_ostream_char_get_basic_ios(ostr)->base;
13607 TRACE("(%p %p)\n", ostr, val);
13609 ios_base_imbue(ostringstream_ios_base, &loc, IOS_LOCALE(ostream_ios_base));
13610 locale_dtor(&loc);
13611 ios_base_precision_set(ostringstream_ios_base, ios_base_precision_get(ostream_ios_base));
13612 ios_base_flags_set(ostringstream_ios_base, ios_base_flags_get(ostream_ios_base));
13614 basic_ostream_char_print_ch(&oss.obj.base, '(');
13615 basic_ostream_char_print_ldouble(&oss.obj.base, val->real);
13616 basic_ostream_char_print_ch(&oss.obj.base, ',');
13617 basic_ostream_char_print_ldouble(&oss.obj.base, val->imag);
13618 basic_ostream_char_print_ch(&oss.obj.base, ')');
13620 basic_ostringstream_char_str_get(&oss.obj, &str);
13621 basic_ostringstream_char_dtor(&oss.vbase);
13622 basic_ostream_char_print_bstr(ostr, &str);
13623 MSVCP_basic_string_char_dtor(&str);
13624 return ostr;
13627 /* ??0strstream@std@@QAE@PADHH@Z */
13628 /* ??0strstream@std@@QEAA@PEAD_JH@Z */
13629 #if STREAMSIZE_BITS == 64
13630 DEFINE_THISCALL_WRAPPER(strstream_ctor, 24)
13631 #else
13632 DEFINE_THISCALL_WRAPPER(strstream_ctor, 20)
13633 #endif
13634 strstream* __thiscall strstream_ctor(strstream *this, char *buf, streamsize size, int mode, MSVCP_bool virt_init)
13636 basic_ios_char *basic_ios;
13638 TRACE("(%p %p %s %d %d)\n", this, buf, wine_dbgstr_longlong(size), mode, virt_init);
13640 if(virt_init) {
13641 this->base.base1.vbtable = strstream_vbtable1;
13642 this->base.base2.vbtable = strstream_vbtable2;
13643 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13644 basic_ios_char_ctor(basic_ios);
13645 }else {
13646 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
13649 strstreambuf_ctor_get_put(&this->buf, buf, size,
13650 buf && (mode & OPENMODE_app) ? buf+strlen(buf) : buf);
13651 basic_iostream_char_ctor(&this->base, &this->buf.base, FALSE);
13652 basic_ios->base.vtable = &MSVCP_strstream_vtable;
13653 return this;
13656 /* ??1strstream@std@@UAE@XZ */
13657 /* ??1strstream@std@@UEAA@XZ */
13658 DEFINE_THISCALL_WRAPPER(strstream_dtor, 4)
13659 void __thiscall strstream_dtor(basic_ios_char *base)
13661 strstream *this = strstream_from_basic_ios(base);
13663 TRACE("(%p)\n", this);
13665 basic_iostream_char_dtor(basic_iostream_char_to_basic_ios(&this->base));
13666 strstreambuf_dtor(&this->buf);
13669 static void strstream_vbase_dtor(strstream *this)
13671 TRACE("(%p)\n", this);
13673 strstream_dtor(strstream_to_basic_ios(this));
13674 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
13677 DEFINE_THISCALL_WRAPPER(strstream_vector_dtor, 8)
13678 strstream* __thiscall strstream_vector_dtor(basic_ios_char *base, unsigned int flags)
13680 strstream *this = strstream_from_basic_ios(base);
13682 TRACE("(%p %x)\n", this, flags);
13684 if(flags & 2) {
13685 /* we have an array, with the number of elements stored before the first object */
13686 INT_PTR i, *ptr = (INT_PTR *)this-1;
13688 for(i=*ptr-1; i>=0; i--)
13689 strstream_vbase_dtor(this+i);
13690 MSVCRT_operator_delete(ptr);
13691 } else {
13692 strstream_vbase_dtor(this);
13693 if(flags & 1)
13694 MSVCRT_operator_delete(this);
13697 return this;
13700 static void __cdecl setprecision_func(ios_base *base, streamsize prec)
13702 ios_base_precision_set(base, prec);
13705 /* ?setprecision@std@@YA?AU?$_Smanip@H@1@H@Z */
13706 /* ?setprecision@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13707 manip_streamsize* __cdecl setprecision(manip_streamsize *ret, streamsize prec)
13709 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(prec));
13711 ret->pfunc = setprecision_func;
13712 ret->arg = prec;
13713 return ret;
13716 static void __cdecl setw_func(ios_base *base, streamsize width)
13718 ios_base_width_set(base, width);
13721 /* ?setw@std@@YA?AU?$_Smanip@H@1@H@Z */
13722 /* ?setw@std@@YA?AU?$_Smanip@_J@1@_J@Z */
13723 manip_streamsize* __cdecl setw(manip_streamsize *ret, streamsize width)
13725 TRACE("(%p %s)\n", ret, wine_dbgstr_longlong(width));
13727 ret->pfunc = setw_func;
13728 ret->arg = width;
13729 return ret;
13732 static void __cdecl resetioflags_func(ios_base *base, int mask)
13734 ios_base_setf_mask(base, 0, mask);
13737 /* ?resetiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
13738 manip_int* __cdecl resetiosflags(manip_int *ret, int mask)
13740 TRACE("(%p %d)\n", ret, mask);
13742 ret->pfunc = resetioflags_func;
13743 ret->arg = mask;
13744 return ret;
13747 static void __cdecl setiosflags_func(ios_base *base, int mask)
13749 ios_base_setf_mask(base, FMTFLAG_mask, mask);
13752 /* ?setiosflags@std@@YA?AU?$_Smanip@H@1@H@Z */
13753 manip_int* __cdecl setiosflags(manip_int *ret, int mask)
13755 TRACE("(%p %d)\n", ret, mask);
13757 ret->pfunc = setiosflags_func;
13758 ret->arg = mask;
13759 return ret;
13762 static void __cdecl setbase_func(ios_base *base, int set_base)
13764 if(set_base == 10)
13765 set_base = FMTFLAG_dec;
13766 else if(set_base == 8)
13767 set_base = FMTFLAG_oct;
13768 else if(set_base == 16)
13769 set_base = FMTFLAG_hex;
13770 else
13771 set_base = 0;
13773 ios_base_setf_mask(base, set_base, FMTFLAG_basefield);
13776 /* ?setbase@std@@YA?AU?$_Smanip@H@1@H@Z */
13777 manip_int* __cdecl setbase(manip_int *ret, int base)
13779 TRACE("(%p %d)\n", ret, base);
13781 ret->pfunc = setbase_func;
13782 ret->arg = base;
13783 return ret;
13786 static basic_filebuf_char filebuf_char_stdin;
13787 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
13788 struct {
13789 basic_istream_char obj;
13790 basic_ios_char vbase;
13791 } cin = { { 0 } };
13792 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
13793 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
13794 basic_istream_char *_Ptr_cin = &cin.obj;
13796 static basic_filebuf_wchar filebuf_short_stdin;
13797 /* ?wcin@std@@3V?$basic_istream@GU?$char_traits@G@std@@@1@A */
13798 struct {
13799 basic_istream_wchar obj;
13800 basic_ios_wchar vbase;
13801 } ucin = { { 0 } };
13802 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@GU?$char_traits@G@std@@@1@A */
13803 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@GU?$char_traits@G@std@@@1@EA */
13804 basic_istream_wchar *_Ptr_ucin = &ucin.obj;
13806 static basic_filebuf_wchar filebuf_wchar_stdin;
13807 /* ?wcin@std@@3V?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13808 struct {
13809 basic_istream_wchar obj;
13810 basic_ios_wchar vbase;
13811 } wcin = { { 0 } };
13812 /* ?_Ptr_wcin@std@@3PAV?$basic_istream@_WU?$char_traits@_W@std@@@1@A */
13813 /* ?_Ptr_wcin@std@@3PEAV?$basic_istream@_WU?$char_traits@_W@std@@@1@EA */
13814 basic_istream_wchar *_Ptr_wcin = &wcin.obj;
13816 static basic_filebuf_char filebuf_char_stdout;
13817 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13818 struct {
13819 basic_ostream_char obj;
13820 basic_ios_char vbase;
13821 } cout = { { 0 } };
13822 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13823 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13824 basic_ostream_char *_Ptr_cout = &cout.obj;
13826 static basic_filebuf_wchar filebuf_short_stdout;
13827 /* ?wcout@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13828 struct {
13829 basic_ostream_wchar obj;
13830 basic_ios_wchar vbase;
13831 } ucout = { { 0 } };
13832 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13833 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13834 basic_ostream_wchar *_Ptr_ucout = &ucout.obj;
13836 static basic_filebuf_wchar filebuf_wchar_stdout;
13837 /* ?wcout@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13838 struct {
13839 basic_ostream_wchar obj;
13840 basic_ios_wchar vbase;
13841 } wcout = { { 0 } };
13842 /* ?_Ptr_wcout@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13843 /* ?_Ptr_wcout@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13844 basic_ostream_wchar *_Ptr_wcout = &wcout.obj;
13846 static basic_filebuf_char filebuf_char_stderr;
13847 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13848 struct {
13849 basic_ostream_char obj;
13850 basic_ios_char vbase;
13851 } cerr = { { 0 } };
13852 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13853 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13854 basic_ostream_char *_Ptr_cerr = &cerr.obj;
13856 static basic_filebuf_wchar filebuf_short_stderr;
13857 /* ?wcerr@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13858 struct {
13859 basic_ostream_wchar obj;
13860 basic_ios_wchar vbase;
13861 } ucerr = { { 0 } };
13862 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13863 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13864 basic_ostream_wchar *_Ptr_ucerr = &ucerr.obj;
13866 static basic_filebuf_wchar filebuf_wchar_stderr;
13867 /* ?wcerr@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13868 struct {
13869 basic_ostream_wchar obj;
13870 basic_ios_wchar vbase;
13871 } wcerr = { { 0 } };
13872 /* ?_Ptr_wcerr@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13873 /* ?_Ptr_wcerr@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13874 basic_ostream_wchar *_Ptr_wcerr = &wcerr.obj;
13876 static basic_filebuf_char filebuf_char_log;
13877 /* ?clog@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13878 struct {
13879 basic_ostream_char obj;
13880 basic_ios_char vbase;
13881 } clog = { { 0 } };
13882 /* ?_Ptr_clog@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
13883 /* ?_Ptr_clog@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
13884 basic_ostream_char *_Ptr_clog = &clog.obj;
13886 static basic_filebuf_wchar filebuf_short_log;
13887 /* ?wclog@std@@3V?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13888 struct {
13889 basic_ostream_wchar obj;
13890 basic_ios_wchar vbase;
13891 } uclog = { { 0 } };
13892 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@GU?$char_traits@G@std@@@1@A */
13893 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@GU?$char_traits@G@std@@@1@EA */
13894 basic_ostream_wchar *_Ptr_uclog = &uclog.obj;
13896 static basic_filebuf_wchar filebuf_wchar_log;
13897 /* ?wclog@std@@3V?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13898 struct {
13899 basic_ostream_wchar obj;
13900 basic_ios_wchar vbase;
13901 } wclog = { { 0 } };
13902 /* ?_Ptr_wclog@std@@3PAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@A */
13903 /* ?_Ptr_wclog@std@@3PEAV?$basic_ostream@_WU?$char_traits@_W@std@@@1@EA */
13904 basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
13906 /* ?_Init_cnt@Init@ios_base@std@@0HA */
13907 int ios_base_Init__Init_cnt = -1;
13909 /* ?_Init_cnt_func@Init@ios_base@std@@CAAAHXZ */
13910 /* ?_Init_cnt_func@Init@ios_base@std@@CAAEAHXZ */
13911 int* __cdecl ios_base_Init__Init_cnt_func(void)
13913 return &ios_base_Init__Init_cnt;
13916 /* ?_Init_ctor@Init@ios_base@std@@CAXPAV123@@Z */
13917 /* ?_Init_ctor@Init@ios_base@std@@CAXPEAV123@@Z */
13918 void __cdecl ios_base_Init__Init_ctor(void *this)
13920 TRACE("(%p)\n", this);
13922 if(ios_base_Init__Init_cnt < 0)
13923 ios_base_Init__Init_cnt = 1;
13924 else
13925 ios_base_Init__Init_cnt++;
13928 /* ??0Init@ios_base@std@@QAE@XZ */
13929 /* ??0Init@ios_base@std@@QEAA@XZ */
13930 DEFINE_THISCALL_WRAPPER(ios_base_Init_ctor, 4)
13931 void* __thiscall ios_base_Init_ctor(void *this)
13933 ios_base_Init__Init_ctor(this);
13934 return this;
13937 /* ?_Init_dtor@Init@ios_base@std@@CAXPAV123@@Z */
13938 /* ?_Init_dtor@Init@ios_base@std@@CAXPEAV123@@Z */
13939 void __cdecl ios_base_Init__Init_dtor(void *this)
13941 TRACE("(%p)\n", this);
13943 ios_base_Init__Init_cnt--;
13944 if(!ios_base_Init__Init_cnt) {
13945 basic_ostream_char_flush(&cout.obj);
13946 basic_ostream_char_flush(&cerr.obj);
13947 basic_ostream_char_flush(&clog.obj);
13951 /* ??1Init@ios_base@std@@QAE@XZ */
13952 /* ??1Init@ios_base@std@@QEAA@XZ */
13953 DEFINE_THISCALL_WRAPPER(ios_base_Init_dtor, 4)
13954 void __thiscall ios_base_Init_dtor(void *this)
13956 ios_base_Init__Init_dtor(this);
13959 /* ??4Init@ios_base@std@@QAEAAV012@ABV012@@Z */
13960 /* ??4Init@ios_base@std@@QEAAAEAV012@AEBV012@@Z */
13961 DEFINE_THISCALL_WRAPPER(ios_base_Init_op_assign, 8)
13962 void* __thiscall ios_base_Init_op_assign(void *this, void *rhs)
13964 TRACE("(%p %p)\n", this, rhs);
13965 return this;
13968 /* ?_Init_cnt@_Winit@std@@0HA */
13969 int _Winit__Init_cnt = -1;
13971 /* ??0_Winit@std@@QAE@XZ */
13972 /* ??0_Winit@std@@QEAA@XZ */
13973 DEFINE_THISCALL_WRAPPER(_Winit_ctor, 4)
13974 void* __thiscall _Winit_ctor(void *this)
13976 TRACE("(%p)\n", this);
13978 if(_Winit__Init_cnt < 0)
13979 _Winit__Init_cnt = 1;
13980 else
13981 _Winit__Init_cnt++;
13983 return this;
13986 /* ??1_Winit@std@@QAE@XZ */
13987 /* ??1_Winit@std@@QAE@XZ */
13988 DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
13989 void __thiscall _Winit_dtor(void *this)
13991 TRACE("(%p)\n", this);
13993 _Winit__Init_cnt--;
13994 if(!_Winit__Init_cnt) {
13995 basic_ostream_wchar_flush(&wcout.obj);
13996 basic_ostream_wchar_flush(&wcerr.obj);
13997 basic_ostream_wchar_flush(&wclog.obj);
14001 /* ??4_Winit@std@@QAEAAV01@ABV01@@Z */
14002 /* ??4_Winit@std@@QEAAAEAV01@AEBV01@@Z */
14003 DEFINE_THISCALL_WRAPPER(_Winit_op_assign, 8)
14004 void* __thiscall _Winit_op_assign(void *this, void *rhs)
14006 TRACE("(%p %p)\n", this, rhs);
14007 return this;
14010 void init_io(void *base)
14012 #ifdef __x86_64__
14013 init_iosb_rtti(base);
14014 init_ios_base_rtti(base);
14015 init_basic_ios_char_rtti(base);
14016 init_basic_ios_wchar_rtti(base);
14017 init_basic_ios_short_rtti(base);
14018 init_basic_streambuf_char_rtti(base);
14019 init_basic_streambuf_wchar_rtti(base);
14020 init_basic_streambuf_short_rtti(base);
14021 init_basic_filebuf_char_rtti(base);
14022 init_basic_filebuf_wchar_rtti(base);
14023 init_basic_filebuf_short_rtti(base);
14024 init_basic_stringbuf_char_rtti(base);
14025 init_basic_stringbuf_wchar_rtti(base);
14026 init_basic_stringbuf_short_rtti(base);
14027 init_basic_ostream_char_rtti(base);
14028 init_basic_ostream_wchar_rtti(base);
14029 init_basic_ostream_short_rtti(base);
14030 init_basic_istream_char_rtti(base);
14031 init_basic_istream_wchar_rtti(base);
14032 init_basic_istream_short_rtti(base);
14033 init_basic_iostream_char_rtti(base);
14034 init_basic_iostream_wchar_rtti(base);
14035 init_basic_iostream_short_rtti(base);
14036 init_basic_ofstream_char_rtti(base);
14037 init_basic_ofstream_wchar_rtti(base);
14038 init_basic_ofstream_short_rtti(base);
14039 init_basic_ifstream_char_rtti(base);
14040 init_basic_ifstream_wchar_rtti(base);
14041 init_basic_ifstream_short_rtti(base);
14042 init_basic_fstream_char_rtti(base);
14043 init_basic_fstream_wchar_rtti(base);
14044 init_basic_fstream_short_rtti(base);
14045 init_basic_ostringstream_char_rtti(base);
14046 init_basic_ostringstream_wchar_rtti(base);
14047 init_basic_ostringstream_short_rtti(base);
14048 init_basic_istringstream_char_rtti(base);
14049 init_basic_istringstream_wchar_rtti(base);
14050 init_basic_istringstream_short_rtti(base);
14051 init_basic_stringstream_char_rtti(base);
14052 init_basic_stringstream_wchar_rtti(base);
14053 init_basic_stringstream_short_rtti(base);
14054 init_strstreambuf_rtti(base);
14055 init_strstream_rtti(base);
14056 init_ostrstream_rtti(base);
14057 #endif
14059 basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
14060 basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
14062 basic_filebuf_short_ctor_file(&filebuf_short_stdin, stdin);
14063 basic_istream_short_ctor(&ucin.obj, &filebuf_short_stdin.base, FALSE/*FIXME*/, TRUE);
14065 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdin, stdin);
14066 basic_istream_wchar_ctor(&wcin.obj, &filebuf_wchar_stdin.base, FALSE/*FIXME*/, TRUE);
14068 basic_filebuf_char_ctor_file(&filebuf_char_stdout, stdout);
14069 basic_ostream_char_ctor(&cout.obj, &filebuf_char_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
14071 basic_filebuf_short_ctor_file(&filebuf_short_stdout, stdout);
14072 basic_ostream_short_ctor(&ucout.obj, &filebuf_short_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
14074 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stdout, stdout);
14075 basic_ostream_short_ctor(&wcout.obj, &filebuf_wchar_stdout.base, FALSE/*FIXME*/, TRUE, TRUE);
14077 basic_filebuf_char_ctor_file(&filebuf_char_stderr, stderr);
14078 basic_ostream_char_ctor(&cerr.obj, &filebuf_char_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
14080 basic_filebuf_short_ctor_file(&filebuf_short_stderr, stderr);
14081 basic_ostream_short_ctor(&ucerr.obj, &filebuf_short_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
14083 basic_filebuf_wchar_ctor_file(&filebuf_wchar_stderr, stderr);
14084 basic_ostream_short_ctor(&wcerr.obj, &filebuf_wchar_stderr.base, FALSE/*FIXME*/, TRUE, TRUE);
14086 basic_filebuf_char_ctor_file(&filebuf_char_log, stderr);
14087 basic_ostream_char_ctor(&clog.obj, &filebuf_char_log.base, FALSE/*FIXME*/, TRUE, TRUE);
14089 basic_filebuf_short_ctor_file(&filebuf_short_log, stderr);
14090 basic_ostream_short_ctor(&uclog.obj, &filebuf_short_log.base, FALSE/*FIXME*/, TRUE, TRUE);
14092 basic_filebuf_wchar_ctor_file(&filebuf_wchar_log, stderr);
14093 basic_ostream_short_ctor(&wclog.obj, &filebuf_wchar_log.base, FALSE/*FIXME*/, TRUE, TRUE);
14096 void free_io(void)
14098 basic_istream_char_vbase_dtor(&cin.obj);
14099 basic_filebuf_char_dtor(&filebuf_char_stdin);
14101 basic_istream_wchar_vbase_dtor(&ucin.obj);
14102 basic_filebuf_wchar_dtor(&filebuf_short_stdin);
14104 basic_istream_wchar_vbase_dtor(&wcin.obj);
14105 basic_filebuf_wchar_dtor(&filebuf_wchar_stdin);
14107 basic_ostream_char_vbase_dtor(&cout.obj);
14108 basic_filebuf_char_dtor(&filebuf_char_stdout);
14110 basic_ostream_wchar_vbase_dtor(&ucout.obj);
14111 basic_filebuf_wchar_dtor(&filebuf_short_stdout);
14113 basic_ostream_wchar_vbase_dtor(&wcout.obj);
14114 basic_filebuf_wchar_dtor(&filebuf_wchar_stdout);
14116 basic_ostream_char_vbase_dtor(&cerr.obj);
14117 basic_filebuf_char_dtor(&filebuf_char_stderr);
14119 basic_ostream_wchar_vbase_dtor(&ucerr.obj);
14120 basic_filebuf_wchar_dtor(&filebuf_short_stderr);
14122 basic_ostream_wchar_vbase_dtor(&wcerr.obj);
14123 basic_filebuf_wchar_dtor(&filebuf_wchar_stderr);
14125 basic_ostream_char_vbase_dtor(&clog.obj);
14126 basic_filebuf_char_dtor(&filebuf_char_log);
14128 basic_ostream_wchar_vbase_dtor(&uclog.obj);
14129 basic_filebuf_wchar_dtor(&filebuf_short_log);
14131 basic_ostream_wchar_vbase_dtor(&wclog.obj);
14132 basic_filebuf_wchar_dtor(&filebuf_wchar_log);