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
29 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
33 IOSTATE_goodbit = 0x00,
34 IOSTATE_eofbit = 0x01,
35 IOSTATE_failbit = 0x02,
36 IOSTATE_badbit = 0x04,
37 IOSTATE__Hardfail = 0x10,
42 FMTFLAG_skipws = 0x0001,
43 FMTFLAG_unitbuf = 0x0002,
44 FMTFLAG_uppercase = 0x0004,
45 FMTFLAG_showbase = 0x0008,
46 FMTFLAG_showpoint = 0x0010,
47 FMTFLAG_showpos = 0x0020,
48 FMTFLAG_left = 0x0040,
49 FMTFLAG_right = 0x0080,
50 FMTFLAG_internal = 0x0100,
54 FMTFLAG_scientific = 0x1000,
55 FMTFLAG_fixed = 0x2000,
56 FMTFLAG_hexfloat = 0x3000,
57 FMTFLAG_boolalpha = 0x4000,
58 FMTFLAG_stdio = 0x8000,
59 FMTFLAG_adjustfield = FMTFLAG_left|FMTFLAG_right|FMTFLAG_internal,
60 FMTFLAG_basefield = FMTFLAG_dec|FMTFLAG_oct|FMTFLAG_hex,
61 FMTFLAG_floadfield = FMTFLAG_scientific|FMTFLAG_fixed,
70 OPENMODE_trunc = 0x10,
71 OPENMODE__Nocreate = 0x40,
72 OPENMODE__Noreplace = 0x80,
73 OPENMODE_binary = 0x20,
84 typedef struct _iosarray {
85 struct _iosarray *next;
98 typedef void (CDECL *IOS_BASE_event_callback)(IOS_BASE_event, struct _ios_base*, int);
99 typedef struct _fnarray {
100 struct _fnarray *next;
102 IOS_BASE_event_callback event_handler;
105 /* ?_Index@ios_base@std@@0HA */
106 int ios_base_Index = 0;
107 /* ?_Sync@ios_base@std@@0_NA */
108 MSVCP_bool ios_base_Sync = FALSE;
110 typedef struct _ios_base {
111 const vtable_ptr *vtable;
118 IOS_BASE_iosarray *arr;
119 IOS_BASE_fnarray *calls;
125 __int64 DECLSPEC_ALIGN(8) pos;
129 static inline const char* debugstr_fpos_int(fpos_int *fpos)
131 return wine_dbg_sprintf("fpos(%ld %s %d)", fpos->off, wine_dbgstr_longlong(fpos->pos), fpos->state);
135 const vtable_ptr *vtable;
150 } basic_streambuf_char;
153 const vtable_ptr *vtable;
168 } basic_streambuf_wchar;
174 } basic_filebuf__Initfl;
177 basic_streambuf_char base;
180 MSVCP_bool wrotesome;
184 } basic_filebuf_char;
188 basic_streambuf_char *strbuf;
189 struct _basic_ostream_char *stream;
195 basic_streambuf_wchar *strbuf;
196 struct _basic_ostream_wchar *stream;
200 typedef struct _basic_ostream_char {
202 /* virtual inheritance
203 * basic_ios_char basic_ios;
205 } basic_ostream_char;
207 typedef struct _basic_ostream_wchar {
209 /* virtual inheritance
210 * basic_ios_char basic_ios;
212 } basic_ostream_wchar;
217 /* virtual inheritance
218 * basic_ios_char basic_ios;
220 } basic_istream_char;
223 basic_istream_char base1;
224 basic_ostream_char base2;
225 /* virtual inheritance
226 * basic_ios_char basic_ios;
228 } basic_iostream_char;
231 basic_ostream_char base;
232 basic_filebuf_char filebuf;
233 /* virtual inheritance
234 * basic_ios_char basic_ios;
236 } basic_ofstream_char;
239 basic_istream_char base;
240 basic_filebuf_char filebuf;
241 /* virtual inheritance
242 * basic_ios_char basic_ios;
244 } basic_ifstream_char;
247 basic_iostream_char base;
248 basic_filebuf_char filebuf;
249 /* virtual inheritance
250 * basic_ios_char basic_ios;
252 } basic_fstream_char;
254 extern const vtable_ptr MSVCP_iosb_vtable;
256 /* ??_7ios_base@std@@6B@ */
257 extern const vtable_ptr MSVCP_ios_base_vtable;
259 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
260 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
262 /* ??_7?$basic_ios@_WU?$char_traits@_W@std@@@std@@6B@ */
263 extern const vtable_ptr MSVCP_basic_ios_wchar_vtable;
265 /* ??_7?$basic_ios@GU?$char_traits@G@std@@@std@@6B@ */
266 extern const vtable_ptr MSVCP_basic_ios_short_vtable;
268 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
269 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
271 /* ??_7?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@6B@ */
272 extern const vtable_ptr MSVCP_basic_streambuf_wchar_vtable;
274 /* ??_7?$basic_streambuf@GU?$char_traits@G@std@@@std@@6B@ */
275 extern const vtable_ptr MSVCP_basic_streambuf_short_vtable;
277 /* ??_7?$basic_filebuf@DU?$char_traits@D@std@@@std@@6B@ */
278 extern const vtable_ptr MSVCP_basic_filebuf_char_vtable;
280 /* ??_8?$basic_ostream@DU?$char_traits@D@std@@@std@@7B@ */
281 const int basic_ostream_char_vbtable[] = {0, sizeof(basic_ostream_char)};
282 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
283 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
285 /* ??_8?$basic_istream@DU?$char_traits@D@std@@@std@@7B@ */
286 const int basic_istream_char_vbtable[] = {0, sizeof(basic_istream_char)};
287 /* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
288 extern const vtable_ptr MSVCP_basic_istream_char_vtable;
290 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
291 const int basic_iostream_char_vbtable1[] = {0, sizeof(basic_iostream_char)};
292 /* ??_8?$basic_iostream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
293 const int basic_iostream_char_vbtable2[] = {0, sizeof(basic_iostream_char)-FIELD_OFFSET(basic_iostream_char, base2)};
294 /* ??_7?$basic_iostream@DU?$char_traits@D@std@@@std@@6B@ */
295 extern const vtable_ptr MSVCP_basic_iostream_char_vtable;
297 /* ??_8?$basic_ofstream@DU?$char_traits@D@std@@@std@@7B@ */
298 const int basic_ofstream_char_vbtable[] = {0, sizeof(basic_ofstream_char)};
299 /* ??_7?$basic_ofstream@DU?$char_traits@D@std@@@std@@6B@ */
300 extern const vtable_ptr MSVCP_basic_ofstream_char_vtable;
302 /*??_8?$basic_ifstream@DU?$char_traits@D@std@@@std@@7B@ */
303 const int basic_ifstream_char_vbtable[] = {0, sizeof(basic_ifstream_char)};
304 /* ??_7?$basic_ifstream@DU?$char_traits@D@std@@@std@@6B@ */
305 extern const vtable_ptr MSVCP_basic_ifstream_char_vtable;
307 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_istream@DU?$char_traits@D@std@@@1@@ */
308 const int basic_fstream_char_vbtable1[] = {0, sizeof(basic_fstream_char)};
309 /* ??_8?$basic_fstream@DU?$char_traits@D@std@@@std@@7B?$basic_ostream@DU?$char_traits@D@std@@@1@@ */
310 const int basic_fstream_char_vbtable2[] = {0, sizeof(basic_fstream_char)-FIELD_OFFSET(basic_fstream_char, base.base2)};
311 /* ??_7?$basic_fstream@DU?$char_traits@D@std@@@std@@6B@ */
312 extern const vtable_ptr MSVCP_basic_fstream_char_vtable;
314 DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@");
315 DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@");
316 DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
317 ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@");
318 DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
319 ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@");
320 DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
321 ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@");
322 DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
323 ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@");
324 DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
325 ".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@");
326 DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
327 ".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@");
328 DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
329 ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@");
330 DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
331 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
332 ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@");
333 DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
334 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
335 ".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@");
336 DEFINE_RTTI_DATA8(basic_iostream_char, sizeof(basic_iostream_char),
337 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
338 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
339 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
340 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
341 ".?AV?$basic_iostream@DU?$char_traits@D@std@@@std@@");
342 DEFINE_RTTI_DATA4(basic_ofstream_char, sizeof(basic_ofstream_char),
343 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
344 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
345 ".?AV?$basic_ofstream@DU?$char_traits@D@std@@@std@@");
346 DEFINE_RTTI_DATA4(basic_ifstream_char, sizeof(basic_ifstream_char),
347 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
348 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
349 ".?AV?$basic_ifstream@DU?$char_traits@D@std@@@std@@");
350 DEFINE_RTTI_DATA9(basic_fstream_char, sizeof(basic_fstream_char), &basic_istream_char_rtti_base_descriptor,
351 &basic_istream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
352 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
353 &basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
354 &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
355 ".?AV?$basic_fstream@DU?$char_traits@D@std@@@std@@");
358 void __asm_dummy_vtables(void) {
360 __ASM_VTABLE(iosb, "");
361 __ASM_VTABLE(ios_base, "");
362 __ASM_VTABLE(basic_ios_char, "");
363 __ASM_VTABLE(basic_ios_wchar, "");
364 __ASM_VTABLE(basic_ios_short, "");
365 __ASM_VTABLE(basic_streambuf_char,
366 VTABLE_ADD_FUNC(basic_streambuf_char_overflow)
367 VTABLE_ADD_FUNC(basic_streambuf_char_pbackfail)
368 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
369 VTABLE_ADD_FUNC(basic_streambuf_char_underflow)
370 VTABLE_ADD_FUNC(basic_streambuf_char_uflow)
371 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
372 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
373 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
374 VTABLE_ADD_FUNC(basic_streambuf_char_seekoff)
375 VTABLE_ADD_FUNC(basic_streambuf_char_seekpos)
376 VTABLE_ADD_FUNC(basic_streambuf_char_setbuf)
377 VTABLE_ADD_FUNC(basic_streambuf_char_sync)
378 VTABLE_ADD_FUNC(basic_streambuf_char_imbue));
379 __ASM_VTABLE(basic_streambuf_wchar,
380 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
381 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
382 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
383 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
384 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
385 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
386 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
387 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
388 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
389 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
390 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
391 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
392 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
393 __ASM_VTABLE(basic_streambuf_short,
394 VTABLE_ADD_FUNC(basic_streambuf_wchar_overflow)
395 VTABLE_ADD_FUNC(basic_streambuf_wchar_pbackfail)
396 VTABLE_ADD_FUNC(basic_streambuf_wchar_showmanyc)
397 VTABLE_ADD_FUNC(basic_streambuf_wchar_underflow)
398 VTABLE_ADD_FUNC(basic_streambuf_wchar_uflow)
399 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsgetn)
400 VTABLE_ADD_FUNC(basic_streambuf_wchar__Xsgetn_s)
401 VTABLE_ADD_FUNC(basic_streambuf_wchar_xsputn)
402 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekoff)
403 VTABLE_ADD_FUNC(basic_streambuf_wchar_seekpos)
404 VTABLE_ADD_FUNC(basic_streambuf_wchar_setbuf)
405 VTABLE_ADD_FUNC(basic_streambuf_wchar_sync)
406 VTABLE_ADD_FUNC(basic_streambuf_wchar_imbue));
407 __ASM_VTABLE(basic_filebuf_char,
408 VTABLE_ADD_FUNC(basic_filebuf_char_overflow)
409 VTABLE_ADD_FUNC(basic_filebuf_char_pbackfail)
410 VTABLE_ADD_FUNC(basic_streambuf_char_showmanyc)
411 VTABLE_ADD_FUNC(basic_filebuf_char_underflow)
412 VTABLE_ADD_FUNC(basic_filebuf_char_uflow)
413 VTABLE_ADD_FUNC(basic_streambuf_char_xsgetn)
414 VTABLE_ADD_FUNC(basic_streambuf_char__Xsgetn_s)
415 VTABLE_ADD_FUNC(basic_streambuf_char_xsputn)
416 VTABLE_ADD_FUNC(basic_filebuf_char_seekoff)
417 VTABLE_ADD_FUNC(basic_filebuf_char_seekpos)
418 VTABLE_ADD_FUNC(basic_filebuf_char_setbuf)
419 VTABLE_ADD_FUNC(basic_filebuf_char_sync)
420 VTABLE_ADD_FUNC(basic_filebuf_char_imbue));
421 __ASM_VTABLE(basic_ostream_char, "");
422 __ASM_VTABLE(basic_istream_char, "");
423 __ASM_VTABLE(basic_iostream_char, "");
424 __ASM_VTABLE(basic_ofstream_char, "");
425 __ASM_VTABLE(basic_ifstream_char, "");
426 __ASM_VTABLE(basic_fstream_char, "");
431 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
432 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
433 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
434 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
436 TRACE("(%p %p %p %p)\n", this, first, next, last);
440 this->wsize = last-next;
443 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
444 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
445 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
446 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
448 basic_streambuf_char_setp_next(this, first, first, last);
451 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
452 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
453 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
454 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
456 TRACE("(%p %p %p %p)\n", this, first, next, last);
460 this->rsize = last-next;
463 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
464 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXXZ */
465 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
466 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
468 TRACE("(%p)\n", this);
470 this->prbuf = &this->rbuf;
471 this->pwbuf = &this->wbuf;
472 this->prpos = &this->rpos;
473 this->pwpos = &this->wpos;
474 this->prsize = &this->rsize;
475 this->pwsize = &this->wsize;
477 basic_streambuf_char_setp(this, NULL, NULL);
478 basic_streambuf_char_setg(this, NULL, NULL, NULL);
481 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
482 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
483 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
484 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
486 TRACE("(%p %d)\n", this, uninitialized);
487 this->vtable = &MSVCP_basic_streambuf_char_vtable;
488 mutex_ctor(&this->lock);
492 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
493 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
494 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
495 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
497 TRACE("(%p)\n", this);
499 this->vtable = &MSVCP_basic_streambuf_char_vtable;
500 mutex_ctor(&this->lock);
501 this->loc = MSVCRT_operator_new(sizeof(locale));
502 locale_ctor(this->loc);
503 basic_streambuf_char__Init_empty(this);
508 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
509 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
510 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
511 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
513 TRACE("(%p)\n", this);
515 mutex_dtor(&this->lock);
516 locale_dtor(this->loc);
517 MSVCRT_operator_delete(this->loc);
520 DEFINE_THISCALL_WRAPPER(MSVCP_basic_streambuf_char_vector_dtor, 8)
521 basic_streambuf_char* __thiscall MSVCP_basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
523 TRACE("(%p %x)\n", this, flags);
525 /* we have an array, with the number of elements stored before the first object */
526 int i, *ptr = (int *)this-1;
528 for(i=*ptr-1; i>=0; i--)
529 basic_streambuf_char_dtor(this+i);
530 MSVCRT_operator_delete(ptr);
532 basic_streambuf_char_dtor(this);
534 MSVCRT_operator_delete(this);
540 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
541 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
542 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
543 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
545 TRACE("(%p)\n", this);
546 return *this->prpos ? *this->prsize : 0;
549 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
550 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
551 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
552 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
554 TRACE("(%p)\n", this);
560 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
561 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
562 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
563 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
565 TRACE("(%p)\n", this);
567 return (*this->prpos)++;
570 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
571 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
572 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
573 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
575 TRACE("(%p)\n", this);
581 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
582 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
583 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
584 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
586 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
596 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
597 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
598 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
599 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
601 TRACE("(%p)\n", this);
602 mutex_lock(&this->lock);
605 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
606 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
607 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
608 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
610 TRACE("(%p)\n", this);
611 return *this->pwpos ? *this->pwsize : 0;
614 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
615 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
616 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
617 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
619 TRACE("(%p)\n", this);
621 return (*this->pwpos)++;
624 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
625 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
626 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
627 #define call_basic_streambuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, \
628 int, (basic_streambuf_char*), (this))
629 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
631 TRACE("(%p)\n", this);
635 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
636 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
637 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
638 #define call_basic_streambuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, \
639 int, (basic_streambuf_char*), (this))
640 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
644 TRACE("(%p)\n", this);
646 if(call_basic_streambuf_char_underflow(this)==EOF)
655 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
656 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
657 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
658 #define call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
659 streamsize, (basic_streambuf_char*, char*, MSVCP_size_t, streamsize), (this, ptr, size, count))
660 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
662 streamsize copied, chunk;
664 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
666 for(copied=0; copied<count && size;) {
667 chunk = basic_streambuf_char__Gnavail(this);
668 if(chunk > count-copied)
669 chunk = count-copied;
672 memcpy_s(ptr+copied, size, *this->prpos, chunk);
673 *this->prpos += chunk;
674 *this->prsize -= chunk;
677 }else if((ptr[copied] = call_basic_streambuf_char_uflow(this)) != EOF) {
688 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
689 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
690 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
691 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
693 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
694 return call_basic_streambuf_char__Xsgetn_s(this, ptr, size, count);
697 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
698 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
699 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
700 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
702 TRACE("(%p)\n", this);
703 mutex_unlock(&this->lock);
706 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
707 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
708 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
709 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
711 TRACE("(%p)\n", this);
715 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
716 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
717 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
718 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
720 TRACE("(%p)\n", this);
724 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
725 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
726 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
727 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
729 TRACE("(%p)\n", this);
730 return *this->prpos+*this->prsize;
733 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
734 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
735 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
736 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
738 TRACE("(%p)\n", this);
739 return *this->pwpos+*this->pwsize;
742 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
743 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
744 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
745 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
747 TRACE("(%p %d)\n", this, off);
749 *this->prsize -= off;
752 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
753 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
754 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 8)
755 locale* __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this, locale *ret)
757 TRACE("(%p)\n", this);
758 return locale_copy_ctor(ret, this->loc);
761 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
762 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
763 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
764 #define call_basic_streambuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, \
765 void, (basic_streambuf_char*, const locale*), (this, loc))
766 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
768 TRACE("(%p %p)\n", this, loc);
771 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
772 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
773 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
774 #define call_basic_streambuf_char_overflow(this, ch) CALL_VTBL_FUNC(this, 4, \
775 int, (basic_streambuf_char*, int), (this, ch))
776 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
778 TRACE("(%p %d)\n", this, ch);
782 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
783 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
784 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
785 #define call_basic_streambuf_char_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, \
786 int, (basic_streambuf_char*, int), (this, ch))
787 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
789 TRACE("(%p %d)\n", this, ch);
793 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
794 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
795 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
796 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
798 TRACE("(%p)\n", this);
802 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
803 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
804 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
805 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
807 TRACE("(%p %d)\n", this, off);
809 *this->pwsize -= off;
812 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
813 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
814 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
815 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
817 TRACE("(%p)\n", this);
821 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
822 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
823 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 12)
824 locale* __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, locale *ret, const locale *loc)
826 TRACE("(%p %p)\n", this, loc);
827 memcpy(ret, this->loc, sizeof(locale));
828 call_basic_streambuf_char_imbue(this, loc);
829 locale_copy_ctor(this->loc, loc);
833 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
834 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
835 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekoff, 20)
836 #define call_basic_streambuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, \
837 fpos_int*, (basic_streambuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
838 fpos_int* __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this,
839 fpos_int *ret, streamoff off, int way, int mode)
841 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
848 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
849 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
850 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff, 20)
851 fpos_int* __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this,
852 fpos_int *ret, streamoff off, int way, int mode)
854 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
855 return call_basic_streambuf_char_seekoff(this, ret, off, way, mode);
858 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
859 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
860 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekoff_old, 20)
861 fpos_int* __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this,
862 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
864 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
865 return basic_streambuf_char_pubseekoff(this, ret, off, way, mode);
868 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
869 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
870 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_seekpos, 36)
871 #define call_basic_streambuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, \
872 fpos_int*, (basic_streambuf_char*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
873 fpos_int* __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this,
874 fpos_int *ret, fpos_int pos, int mode)
876 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
883 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
884 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
885 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos, 36)
886 fpos_int* __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this,
887 fpos_int *ret, fpos_int pos, int mode)
889 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
890 return call_basic_streambuf_char_seekpos(this, ret, pos, mode);
893 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
894 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
895 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubseekpos_old, 36)
896 fpos_int* __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this,
897 fpos_int *ret, fpos_int pos, unsigned int mode)
899 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
900 return basic_streambuf_char_pubseekpos(this, ret, pos, mode);
903 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
904 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
905 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
906 #define call_basic_streambuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, \
907 basic_streambuf_char*, (basic_streambuf_char*, char*, streamsize), (this, buf, count))
908 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
910 TRACE("(%p %p %ld)\n", this, buf, count);
914 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
915 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
916 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
917 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
919 TRACE("(%p %p %ld)\n", this, buf, count);
920 return call_basic_streambuf_char_setbuf(this, buf, count);
923 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
924 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
925 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
926 #define call_basic_streambuf_char_sync(this) CALL_VTBL_FUNC(this, 48, \
927 int, (basic_streambuf_char*), (this))
928 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
930 TRACE("(%p)\n", this);
934 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
935 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
936 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
937 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
939 TRACE("(%p)\n", this);
940 return call_basic_streambuf_char_sync(this);
943 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
944 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
945 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
946 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
948 TRACE("(%p %p %ld)\n", this, ptr, count);
949 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
952 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
953 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
954 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
955 #define call_basic_streambuf_char_showmanyc(this) CALL_VTBL_FUNC(this, 12, \
956 streamsize, (basic_streambuf_char*), (this))
957 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
959 TRACE("(%p)\n", this);
963 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
964 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
965 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
966 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
970 TRACE("(%p)\n", this);
972 ret = basic_streambuf_char__Gnavail(this);
973 return ret ? ret : call_basic_streambuf_char_showmanyc(this);
976 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
977 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
978 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
979 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
981 TRACE("(%p %d)\n", this, ch);
982 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
988 return call_basic_streambuf_char_pbackfail(this, ch);
991 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
992 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
993 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
994 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
996 TRACE("(%p %d)\n", this, ch);
997 return basic_streambuf_char__Pnavail(this) ?
998 (*basic_streambuf_char__Pninc(this) = ch) :
999 call_basic_streambuf_char_overflow(this, ch);
1002 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1003 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1004 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1005 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1007 TRACE("(%p)\n", this);
1008 if(*this->prpos && *this->prpos>*this->prbuf) {
1011 return **this->prpos;
1014 return call_basic_streambuf_char_pbackfail(this, EOF);
1017 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1018 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1019 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1020 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1022 TRACE("(%p)\n", this);
1023 if(basic_streambuf_char__Gnavail(this))
1024 basic_streambuf_char__Gninc(this);
1026 call_basic_streambuf_char_uflow(this);
1029 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1030 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1031 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1032 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1034 TRACE("(%p)\n", this);
1035 return basic_streambuf_char__Gnavail(this) ?
1036 *basic_streambuf_char__Gninc(this) : call_basic_streambuf_char_uflow(this);
1039 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1040 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1041 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1042 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1044 TRACE("(%p)\n", this);
1045 return basic_streambuf_char__Gnavail(this) ?
1046 *basic_streambuf_char_gptr(this) : call_basic_streambuf_char_underflow(this);
1049 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1050 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1051 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1052 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1054 TRACE("(%p)\n", this);
1056 if(basic_streambuf_char__Gnavail(this) > 1)
1057 return *basic_streambuf_char__Gnpreinc(this);
1058 return basic_streambuf_char_sbumpc(this)==EOF ?
1059 EOF : basic_streambuf_char_sgetc(this);
1062 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1063 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1064 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1065 #define call_basic_streambuf_char_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, \
1066 streamsize, (basic_streambuf_char*, char*, streamsize), (this, ptr, count))
1067 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1069 TRACE("(%p %p %ld)\n", this, ptr, count);
1070 return call_basic_streambuf_char__Xsgetn_s(this, ptr, -1, count);
1073 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1074 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1075 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1076 #define call_basic_streambuf_char_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, \
1077 streamsize, (basic_streambuf_char*, const char*, streamsize), (this, ptr, count))
1078 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1080 streamsize copied, chunk;
1082 TRACE("(%p %p %ld)\n", this, ptr, count);
1084 for(copied=0; copied<count;) {
1085 chunk = basic_streambuf_char__Pnavail(this);
1086 if(chunk > count-copied)
1087 chunk = count-copied;
1090 memcpy(*this->pwpos, ptr+copied, chunk);
1091 *this->pwpos += chunk;
1092 *this->pwsize -= chunk;
1094 }else if(call_basic_streambuf_char_overflow(this, ptr[copied]) != EOF) {
1104 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1105 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1106 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1107 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1109 TRACE("(%p %p %ld)\n", this, ptr, count);
1110 return call_basic_streambuf_char_xsputn(this, ptr, count);
1113 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1114 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1115 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1116 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1117 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp_next, 16)
1118 void __thiscall basic_streambuf_wchar_setp_next(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1120 TRACE("(%p %p %p %p)\n", this, first, next, last);
1124 this->wsize = last-next;
1127 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W0@Z */
1128 /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W0@Z */
1129 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG0@Z */
1130 /* ?setp@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG0@Z */
1131 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setp, 12)
1132 void __thiscall basic_streambuf_wchar_setp(basic_streambuf_wchar *this, wchar_t *first, wchar_t *last)
1134 basic_streambuf_wchar_setp_next(this, first, first, last);
1137 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
1138 /* ?setg@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEA_W00@Z */
1139 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAG00@Z */
1140 /* ?setg@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAG00@Z */
1141 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setg, 16)
1142 void __thiscall basic_streambuf_wchar_setg(basic_streambuf_wchar *this, wchar_t *first, wchar_t *next, wchar_t *last)
1144 TRACE("(%p %p %p %p)\n", this, first, next, last);
1148 this->rsize = last-next;
1151 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXXZ */
1152 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXXZ */
1153 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXXZ */
1154 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1155 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init_empty, 4)
1156 void __thiscall basic_streambuf_wchar__Init_empty(basic_streambuf_wchar *this)
1158 TRACE("(%p)\n", this);
1160 this->prbuf = &this->rbuf;
1161 this->pwbuf = &this->wbuf;
1162 this->prpos = &this->rpos;
1163 this->pwpos = &this->wpos;
1164 this->prsize = &this->rsize;
1165 this->pwsize = &this->wsize;
1167 basic_streambuf_wchar_setp(this, NULL, NULL);
1168 basic_streambuf_wchar_setg(this, NULL, NULL, NULL);
1171 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1172 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1173 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor_uninitialized, 8)
1174 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1176 TRACE("(%p %d)\n", this, uninitialized);
1177 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1178 mutex_ctor(&this->lock);
1182 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@W4_Uninitialized@1@@Z */
1183 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
1184 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor_uninitialized, 8)
1185 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor_uninitialized(basic_streambuf_wchar *this, int uninitialized)
1187 TRACE("(%p %d)\n", this, uninitialized);
1188 basic_streambuf_wchar_ctor_uninitialized(this, uninitialized);
1189 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1193 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
1194 /* ??0?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
1195 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_ctor, 4)
1196 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_ctor(basic_streambuf_wchar *this)
1198 TRACE("(%p)\n", this);
1200 this->vtable = &MSVCP_basic_streambuf_wchar_vtable;
1201 mutex_ctor(&this->lock);
1202 this->loc = MSVCRT_operator_new(sizeof(locale));
1203 locale_ctor(this->loc);
1204 basic_streambuf_wchar__Init_empty(this);
1209 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAE@XZ */
1210 /* ??0?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAA@XZ */
1211 DEFINE_THISCALL_WRAPPER(basic_streambuf_short_ctor, 4)
1212 basic_streambuf_wchar* __thiscall basic_streambuf_short_ctor(basic_streambuf_wchar *this)
1214 TRACE("(%p)\n", this);
1215 basic_streambuf_wchar_ctor(this);
1216 this->vtable = &MSVCP_basic_streambuf_short_vtable;
1220 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
1221 /* ??1?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
1222 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UAE@XZ */
1223 /* ??1?$basic_streambuf@GU?$char_traits@G@std@@@std@@UEAA@XZ */
1224 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_dtor, 4)
1225 void __thiscall basic_streambuf_wchar_dtor(basic_streambuf_wchar *this)
1227 TRACE("(%p)\n", this);
1229 mutex_dtor(&this->lock);
1230 locale_dtor(this->loc);
1231 MSVCRT_operator_delete(this->loc);
1234 DEFINE_THISCALL_WRAPPER(MSVCP_basic_streambuf_wchar_vector_dtor, 8)
1235 basic_streambuf_wchar* __thiscall MSVCP_basic_streambuf_wchar_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1237 TRACE("(%p %x)\n", this, flags);
1239 /* we have an array, with the number of elements stored before the first object */
1240 int i, *ptr = (int *)this-1;
1242 for(i=*ptr-1; i>=0; i--)
1243 basic_streambuf_wchar_dtor(this+i);
1244 MSVCRT_operator_delete(ptr);
1246 basic_streambuf_wchar_dtor(this);
1248 MSVCRT_operator_delete(this);
1254 DEFINE_THISCALL_WRAPPER(MSVCP_basic_streambuf_short_vector_dtor, 8)
1255 basic_streambuf_wchar* __thiscall MSVCP_basic_streambuf_short_vector_dtor(basic_streambuf_wchar *this, unsigned int flags)
1257 TRACE("(%p %x)\n", this, flags);
1258 return MSVCP_basic_streambuf_wchar_vector_dtor(this, flags);
1261 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1262 /* ?_Gnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1263 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1264 /* ?_Gnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1265 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnavail, 4)
1266 streamsize __thiscall basic_streambuf_wchar__Gnavail(const basic_streambuf_wchar *this)
1268 TRACE("(%p)\n", this);
1269 return *this->prpos ? *this->prsize : 0;
1272 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1273 /* ?_Gndec@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1274 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1275 /* ?_Gndec@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1276 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gndec, 4)
1277 wchar_t* __thiscall basic_streambuf_wchar__Gndec(basic_streambuf_wchar *this)
1279 TRACE("(%p)\n", this);
1282 return *this->prpos;
1285 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1286 /* ?_Gninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1287 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1288 /* ?_Gninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1289 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gninc, 4)
1290 wchar_t* __thiscall basic_streambuf_wchar__Gninc(basic_streambuf_wchar *this)
1292 TRACE("(%p)\n", this);
1294 return (*this->prpos)++;
1297 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1298 /* ?_Gnpreinc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1299 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1300 /* ?_Gnpreinc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1301 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Gnpreinc, 4)
1302 wchar_t* __thiscall basic_streambuf_wchar__Gnpreinc(basic_streambuf_wchar *this)
1304 TRACE("(%p)\n", this);
1307 return *this->prpos;
1310 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPAPA_W0PAH001@Z */
1311 /* ?_Init@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXPEAPEA_W0PEAH001@Z */
1312 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXPAPAG0PAH001@Z */
1313 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXPEAPEAG0PEAH001@Z */
1314 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Init, 28)
1315 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)
1317 TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1327 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1328 /* ?_Lock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1329 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1330 /* ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1331 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Lock, 4)
1332 void __thiscall basic_streambuf_wchar__Lock(basic_streambuf_wchar *this)
1334 TRACE("(%p)\n", this);
1335 mutex_lock(&this->lock);
1338 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEHXZ */
1339 /* ?_Pnavail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBA_JXZ */
1340 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEHXZ */
1341 /* ?_Pnavail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBA_JXZ */
1342 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pnavail, 4)
1343 streamsize __thiscall basic_streambuf_wchar__Pnavail(const basic_streambuf_wchar *this)
1345 TRACE("(%p)\n", this);
1346 return *this->pwpos ? *this->pwsize : 0;
1349 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEPA_WXZ */
1350 /* ?_Pninc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAPEA_WXZ */
1351 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEPAGXZ */
1352 /* ?_Pninc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAPEAGXZ */
1353 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Pninc, 4)
1354 wchar_t* __thiscall basic_streambuf_wchar__Pninc(basic_streambuf_wchar *this)
1356 TRACE("(%p)\n", this);
1358 return (*this->pwpos)++;
1361 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1362 /* ?underflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1363 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1364 /* ?underflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1365 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_underflow, 4)
1366 #define call_basic_streambuf_wchar_underflow(this) CALL_VTBL_FUNC(this, 16, \
1367 unsigned short, (basic_streambuf_wchar*), (this))
1368 unsigned short __thiscall basic_streambuf_wchar_underflow(basic_streambuf_wchar *this)
1370 TRACE("(%p)\n", this);
1374 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGXZ */
1375 /* ?uflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGXZ */
1376 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGXZ */
1377 /* ?uflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGXZ */
1378 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_uflow, 4)
1379 #define call_basic_streambuf_wchar_uflow(this) CALL_VTBL_FUNC(this, 20, \
1380 unsigned short, (basic_streambuf_wchar*), (this))
1381 unsigned short __thiscall basic_streambuf_wchar_uflow(basic_streambuf_wchar *this)
1385 TRACE("(%p)\n", this);
1387 if(call_basic_streambuf_wchar_underflow(this)==WEOF)
1390 ret = **this->prpos;
1396 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WIH@Z */
1397 /* ?_Xsgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_K_J@Z */
1398 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGIH@Z */
1399 /* ?_Xsgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_K_J@Z */
1400 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Xsgetn_s, 16)
1401 #define call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count) CALL_VTBL_FUNC(this, 28, \
1402 streamsize, (basic_streambuf_wchar*, wchar_t*, MSVCP_size_t, streamsize), (this, ptr, size, count))
1403 streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1405 streamsize copied, chunk;
1407 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1409 for(copied=0; copied<count && size;) {
1410 chunk = basic_streambuf_wchar__Gnavail(this);
1411 if(chunk > count-copied)
1412 chunk = count-copied;
1415 memcpy_s(ptr+copied, size, *this->prpos, chunk);
1416 *this->prpos += chunk;
1417 *this->prsize -= chunk;
1420 }else if((ptr[copied] = call_basic_streambuf_wchar_uflow(this)) != WEOF) {
1431 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WIH@Z */
1432 /* ?_Sgetn_s@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_K_J@Z */
1433 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGIH@Z */
1434 /* ?_Sgetn_s@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_K_J@Z */
1435 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Sgetn_s, 16)
1436 streamsize __thiscall basic_streambuf_wchar__Sgetn_s(basic_streambuf_wchar *this, wchar_t *ptr, MSVCP_size_t size, streamsize count)
1438 TRACE("(%p %p %lu %ld)\n", this, ptr, size, count);
1439 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, size, count);
1442 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1443 /* ?_Unlock@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1444 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1445 /* ?_Unlock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1446 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar__Unlock, 4)
1447 void __thiscall basic_streambuf_wchar__Unlock(basic_streambuf_wchar *this)
1449 TRACE("(%p)\n", this);
1450 mutex_unlock(&this->lock);
1453 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1454 /* ?eback@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1455 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1456 /* ?eback@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1457 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_eback, 4)
1458 wchar_t* __thiscall basic_streambuf_wchar_eback(const basic_streambuf_wchar *this)
1460 TRACE("(%p)\n", this);
1461 return *this->prbuf;
1464 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1465 /* ?gptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1466 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1467 /* ?gptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1468 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gptr, 4)
1469 wchar_t* __thiscall basic_streambuf_wchar_gptr(const basic_streambuf_wchar *this)
1471 TRACE("(%p)\n", this);
1472 return *this->prpos;
1475 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1476 /* ?egptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1477 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1478 /* ?egptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1479 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_egptr, 4)
1480 wchar_t* __thiscall basic_streambuf_wchar_egptr(const basic_streambuf_wchar *this)
1482 TRACE("(%p)\n", this);
1483 return *this->prpos+*this->prsize;
1486 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1487 /* ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1488 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1489 /* ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1490 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_epptr, 4)
1491 wchar_t* __thiscall basic_streambuf_wchar_epptr(const basic_streambuf_wchar *this)
1493 TRACE("(%p)\n", this);
1494 return *this->pwpos+*this->pwsize;
1497 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
1498 /* ?gbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
1499 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
1500 /* ?gbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
1501 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_gbump, 8)
1502 void __thiscall basic_streambuf_wchar_gbump(basic_streambuf_wchar *this, int off)
1504 TRACE("(%p %d)\n", this, off);
1505 *this->prpos += off;
1506 *this->prsize -= off;
1509 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QBE?AVlocale@2@XZ */
1510 /* ?getloc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEBA?AVlocale@2@XZ */
1511 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QBE?AVlocale@2@XZ */
1512 /* ?getloc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEBA?AVlocale@2@XZ */
1513 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_getloc, 8)
1514 locale* __thiscall basic_streambuf_wchar_getloc(const basic_streambuf_wchar *this, locale *ret)
1516 TRACE("(%p)\n", this);
1517 return locale_copy_ctor(ret, this->loc);
1520 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEXABVlocale@2@@Z */
1521 /* ?imbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAXAEBVlocale@2@@Z */
1522 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEXABVlocale@2@@Z */
1523 /* ?imbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAXAEBVlocale@2@@Z */
1524 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_imbue, 8)
1525 #define call_basic_streambuf_wchar_imbue(this, loc) CALL_VTBL_FUNC(this, 52, \
1526 void, (basic_streambuf_wchar*, const locale*), (this, loc))
1527 void __thiscall basic_streambuf_wchar_imbue(basic_streambuf_wchar *this, const locale *loc)
1529 TRACE("(%p %p)\n", this, loc);
1532 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
1533 /* ?overflow@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
1534 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
1535 /* ?overflow@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
1536 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_overflow, 8)
1537 #define call_basic_streambuf_wchar_overflow(this, ch) CALL_VTBL_FUNC(this, 4, \
1538 unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
1539 unsigned short __thiscall basic_streambuf_wchar_overflow(basic_streambuf_wchar *this, unsigned short ch)
1541 TRACE("(%p %d)\n", this, ch);
1545 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEGG@Z */
1546 /* ?pbackfail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAGG@Z */
1547 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEGG@Z */
1548 /* ?pbackfail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAGG@Z */
1549 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbackfail, 8)
1550 #define call_basic_streambuf_wchar_pbackfail(this, ch) CALL_VTBL_FUNC(this, 8, \
1551 unsigned short, (basic_streambuf_wchar*, unsigned short), (this, ch))
1552 unsigned short __thiscall basic_streambuf_wchar_pbackfail(basic_streambuf_wchar *this, unsigned short ch)
1554 TRACE("(%p %d)\n", this, ch);
1558 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1559 /* ?pbase@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1560 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1561 /* ?pbase@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1562 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbase, 4)
1563 wchar_t* __thiscall basic_streambuf_wchar_pbase(const basic_streambuf_wchar *this)
1565 TRACE("(%p)\n", this);
1566 return *this->pwbuf;
1569 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXH@Z */
1570 /* ?pbump@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEAAXH@Z */
1571 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IAEXH@Z */
1572 /* ?pbump@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXH@Z */
1573 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pbump, 8)
1574 void __thiscall basic_streambuf_wchar_pbump(basic_streambuf_wchar *this, int off)
1576 TRACE("(%p %d)\n", this, off);
1577 *this->pwpos += off;
1578 *this->pwsize -= off;
1581 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ */
1582 /* ?pptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ */
1583 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IBEPAGXZ */
1584 /* ?pptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ */
1585 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pptr, 4)
1586 wchar_t* __thiscall basic_streambuf_wchar_pptr(const basic_streambuf_wchar *this)
1588 TRACE("(%p)\n", this);
1589 return *this->pwpos;
1592 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1593 /* ?pubimbue@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1594 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1595 /* ?pubimbue@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1596 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubimbue, 12)
1597 locale* __thiscall basic_streambuf_wchar_pubimbue(basic_streambuf_wchar *this, locale *ret, const locale *loc)
1599 TRACE("(%p %p)\n", this, loc);
1600 memcpy(ret, this->loc, sizeof(locale));
1601 call_basic_streambuf_wchar_imbue(this, loc);
1602 locale_copy_ctor(this->loc, loc);
1606 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1607 /* ?seekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1608 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1609 /* ?seekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1610 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekoff, 20)
1611 #define call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, \
1612 fpos_int*, (basic_streambuf_wchar*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
1613 fpos_int* __thiscall basic_streambuf_wchar_seekoff(basic_streambuf_wchar *this,
1614 fpos_int *ret, streamoff off, int way, int mode)
1616 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1623 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1624 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1625 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1626 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1627 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff, 20)
1628 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff(basic_streambuf_wchar *this,
1629 fpos_int *ret, streamoff off, int way, int mode)
1631 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1632 return call_basic_streambuf_wchar_seekoff(this, ret, off, way, mode);
1635 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1636 /* ?pubseekoff@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1637 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1638 /* ?pubseekoff@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1639 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekoff_old, 20)
1640 fpos_int* __thiscall basic_streambuf_wchar_pubseekoff_old(basic_streambuf_wchar *this,
1641 fpos_int *ret, streamoff off, unsigned int way, unsigned int mode)
1643 TRACE("(%p %ld %d %d)\n", this, off, way, mode);
1644 return basic_streambuf_wchar_pubseekoff(this, ret, off, way, mode);
1647 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1648 /* ?seekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1649 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1650 /* ?seekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1651 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_seekpos, 36)
1652 #define call_basic_streambuf_wchar_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, \
1653 fpos_int*, (basic_streambuf_wchar*, fpos_int*, fpos_int, int), (this, ret, pos, mode))
1654 fpos_int* __thiscall basic_streambuf_wchar_seekpos(basic_streambuf_wchar *this,
1655 fpos_int *ret, fpos_int pos, int mode)
1657 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1664 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1665 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1666 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1667 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1668 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos, 36)
1669 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos(basic_streambuf_wchar *this,
1670 fpos_int *ret, fpos_int pos, int mode)
1672 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1673 return call_basic_streambuf_wchar_seekpos(this, ret, pos, mode);
1676 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1677 /* ?pubseekpos@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1678 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1679 /* ?pubseekpos@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1680 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubseekpos_old, 36)
1681 fpos_int* __thiscall basic_streambuf_wchar_pubseekpos_old(basic_streambuf_wchar *this,
1682 fpos_int *ret, fpos_int pos, unsigned int mode)
1684 TRACE("(%p %s %d)\n", this, debugstr_fpos_int(&pos), mode);
1685 return basic_streambuf_wchar_pubseekpos(this, ret, pos, mode);
1688 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEPAV12@PA_WH@Z */
1689 /* ?setbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAPEAV12@PEA_W_J@Z */
1690 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEPAV12@PAGH@Z */
1691 /* ?setbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAPEAV12@PEAG_J@Z */
1692 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_setbuf, 12)
1693 #define call_basic_streambuf_wchar_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, \
1694 basic_streambuf_wchar*, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, buf, count))
1695 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_setbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
1697 TRACE("(%p %p %ld)\n", this, buf, count);
1701 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEPAV12@PA_WH@Z */
1702 /* ?pubsetbuf@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAPEAV12@PEA_W_J@Z */
1703 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEPAV12@PAGH@Z */
1704 /* ?pubsetbuf@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAPEAV12@PEAG_J@Z */
1705 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsetbuf, 12)
1706 basic_streambuf_wchar* __thiscall basic_streambuf_wchar_pubsetbuf(basic_streambuf_wchar *this, wchar_t *buf, streamsize count)
1708 TRACE("(%p %p %ld)\n", this, buf, count);
1709 return call_basic_streambuf_wchar_setbuf(this, buf, count);
1712 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
1713 /* ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ */
1714 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
1715 /* ?sync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAAHXZ */
1716 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sync, 4)
1717 #define call_basic_streambuf_wchar_sync(this) CALL_VTBL_FUNC(this, 48, \
1718 int, (basic_streambuf_wchar*), (this))
1719 int __thiscall basic_streambuf_wchar_sync(basic_streambuf_wchar *this)
1721 TRACE("(%p)\n", this);
1725 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
1726 /* ?pubsync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAHXZ */
1727 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
1728 /* ?pubsync@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHXZ */
1729 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_pubsync, 4)
1730 int __thiscall basic_streambuf_wchar_pubsync(basic_streambuf_wchar *this)
1732 TRACE("(%p)\n", this);
1733 return call_basic_streambuf_wchar_sync(this);
1736 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPA_WH@Z */
1737 /* ?sgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEA_W_J@Z */
1738 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPAGH@Z */
1739 /* ?sgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEAG_J@Z */
1740 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetn, 12)
1741 streamsize __thiscall basic_streambuf_wchar_sgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
1743 TRACE("(%p %p %ld)\n", this, ptr, count);
1744 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
1747 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ */
1748 /* ?showmanyc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JXZ */
1749 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHXZ */
1750 /* ?showmanyc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JXZ */
1751 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_showmanyc, 4)
1752 #define call_basic_streambuf_wchar_showmanyc(this) CALL_VTBL_FUNC(this, 12, \
1753 streamsize, (basic_streambuf_wchar*), (this))
1754 streamsize __thiscall basic_streambuf_wchar_showmanyc(basic_streambuf_wchar *this)
1756 TRACE("(%p)\n", this);
1760 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHXZ */
1761 /* ?in_avail@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JXZ */
1762 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHXZ */
1763 /* ?in_avail@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JXZ */
1764 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_in_avail, 4)
1765 streamsize __thiscall basic_streambuf_wchar_in_avail(basic_streambuf_wchar *this)
1769 TRACE("(%p)\n", this);
1771 ret = basic_streambuf_wchar__Gnavail(this);
1772 return ret ? ret : call_basic_streambuf_wchar_showmanyc(this);
1775 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
1776 /* ?sputbackc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
1777 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
1778 /* ?sputbackc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
1779 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputbackc, 8)
1780 unsigned short __thiscall basic_streambuf_wchar_sputbackc(basic_streambuf_wchar *this, wchar_t ch)
1782 TRACE("(%p %d)\n", this, ch);
1783 if(*this->prpos && *this->prpos>*this->prbuf && (*this->prpos)[-1]==ch) {
1789 return call_basic_streambuf_wchar_pbackfail(this, ch);
1792 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEG_W@Z */
1793 /* ?sputc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAG_W@Z */
1794 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGG@Z */
1795 /* ?sputc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAHG@Z */
1796 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputc, 8)
1797 unsigned short __thiscall basic_streambuf_wchar_sputc(basic_streambuf_wchar *this, wchar_t ch)
1799 TRACE("(%p %d)\n", this, ch);
1800 return basic_streambuf_wchar__Pnavail(this) ?
1801 (*basic_streambuf_wchar__Pninc(this) = ch) :
1802 call_basic_streambuf_wchar_overflow(this, ch);
1805 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
1806 /* ?sungetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
1807 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
1808 /* ?sungetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
1809 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sungetc, 4)
1810 unsigned short __thiscall basic_streambuf_wchar_sungetc(basic_streambuf_wchar *this)
1812 TRACE("(%p)\n", this);
1813 if(*this->prpos && *this->prpos>*this->prbuf) {
1816 return **this->prpos;
1819 return call_basic_streambuf_wchar_pbackfail(this, WEOF);
1822 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEXXZ */
1823 /* ?stossc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAXXZ */
1824 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ */
1825 /* ?stossc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAXXZ */
1826 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_stossc, 4)
1827 void __thiscall basic_streambuf_wchar_stossc(basic_streambuf_wchar *this)
1829 TRACE("(%p)\n", this);
1830 if(basic_streambuf_wchar__Gnavail(this))
1831 basic_streambuf_wchar__Gninc(this);
1833 call_basic_streambuf_wchar_uflow(this);
1836 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
1837 /* ?sbumpc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
1838 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
1839 /* ?sbumpc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
1840 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sbumpc, 4)
1841 unsigned short __thiscall basic_streambuf_wchar_sbumpc(basic_streambuf_wchar *this)
1843 TRACE("(%p)\n", this);
1844 return basic_streambuf_wchar__Gnavail(this) ?
1845 *basic_streambuf_wchar__Gninc(this) : call_basic_streambuf_wchar_uflow(this);
1848 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
1849 /* ?sgetc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
1850 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
1851 /* ?sgetc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
1852 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sgetc, 4)
1853 unsigned short __thiscall basic_streambuf_wchar_sgetc(basic_streambuf_wchar *this)
1855 TRACE("(%p)\n", this);
1856 return basic_streambuf_wchar__Gnavail(this) ?
1857 *basic_streambuf_wchar_gptr(this) : call_basic_streambuf_wchar_underflow(this);
1860 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEGXZ */
1861 /* ?snextc@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAAGXZ */
1862 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEGXZ */
1863 /* ?snextc@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAAGXZ */
1864 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_snextc, 4)
1865 unsigned short __thiscall basic_streambuf_wchar_snextc(basic_streambuf_wchar *this)
1867 TRACE("(%p)\n", this);
1869 if(basic_streambuf_wchar__Gnavail(this) > 1)
1870 return *basic_streambuf_wchar__Gnpreinc(this);
1871 return basic_streambuf_wchar_sbumpc(this)==WEOF ?
1872 WEOF : basic_streambuf_wchar_sgetc(this);
1875 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPA_WH@Z */
1876 /* ?xsgetn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEA_W_J@Z */
1877 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPAGH@Z */
1878 /* ?xsgetn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEAG_J@Z */
1879 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsgetn, 12)
1880 #define call_basic_streambuf_wchar_xsgetn(this, ptr, count) CALL_VTBL_FUNC(this, 24, \
1881 streamsize, (basic_streambuf_wchar*, wchar_t*, streamsize), (this, ptr, count))
1882 streamsize __thiscall basic_streambuf_wchar_xsgetn(basic_streambuf_wchar *this, wchar_t *ptr, streamsize count)
1884 TRACE("(%p %p %ld)\n", this, ptr, count);
1885 return call_basic_streambuf_wchar__Xsgetn_s(this, ptr, -1, count);
1888 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHPB_WH@Z */
1889 /* ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z */
1890 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MAEHPBGH@Z */
1891 /* ?xsputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@MEAA_JPEBG_J@Z */
1892 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_xsputn, 12)
1893 #define call_basic_streambuf_wchar_xsputn(this, ptr, count) CALL_VTBL_FUNC(this, 32, \
1894 streamsize, (basic_streambuf_wchar*, const wchar_t*, streamsize), (this, ptr, count))
1895 streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
1897 streamsize copied, chunk;
1899 TRACE("(%p %p %ld)\n", this, ptr, count);
1901 for(copied=0; copied<count;) {
1902 chunk = basic_streambuf_wchar__Pnavail(this);
1903 if(chunk > count-copied)
1904 chunk = count-copied;
1907 memcpy(*this->pwpos, ptr+copied, chunk);
1908 *this->pwpos += chunk;
1909 *this->pwsize -= chunk;
1911 }else if(call_basic_streambuf_wchar_overflow(this, ptr[copied]) != WEOF) {
1921 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QAEHPB_WH@Z */
1922 /* ?sputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@QEAA_JPEB_W_J@Z */
1923 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEHPBGH@Z */
1924 /* ?sputn@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QEAA_JPEBG_J@Z */
1925 DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_sputn, 12)
1926 streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, const wchar_t *ptr, streamsize count)
1928 TRACE("(%p %p %ld)\n", this, ptr, count);
1929 return call_basic_streambuf_wchar_xsputn(this, ptr, count);
1932 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
1933 /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@23@@Z@4HA */
1934 int basic_filebuf_char__Init__Stinit = 0;
1936 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@12@@Z */
1937 /* ?_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAU_iobuf@@W4_Initfl@12@@Z */
1938 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Init, 12)
1939 void __thiscall basic_filebuf_char__Init(basic_filebuf_char *this, FILE *file, basic_filebuf__Initfl which)
1941 TRACE("(%p %p %d)\n", this, file, which);
1944 this->wrotesome = FALSE;
1945 this->state = basic_filebuf_char__Init__Stinit;
1946 this->close = (which == INITFL_open);
1949 basic_streambuf_char__Init_empty(&this->base);
1951 basic_streambuf_char__Init(&this->base, &file->_base, &file->_ptr,
1952 &file->_cnt, &file->_base, &file->_ptr, &file->_cnt);
1955 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAV?$codecvt@DDH@2@@Z */
1956 /* ?_Initcvt@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$codecvt@DDH@2@@Z */
1957 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Initcvt, 8)
1958 void __thiscall basic_filebuf_char__Initcvt(basic_filebuf_char *this, codecvt_char *cvt)
1960 TRACE("(%p %p)\n", this, cvt);
1962 if(codecvt_base_always_noconv(&cvt->base)) {
1965 basic_streambuf_char__Init_empty(&this->base);
1970 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAE_NXZ */
1971 /* ?_Endwrite@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IEAA_NXZ */
1972 DEFINE_THISCALL_WRAPPER(basic_filebuf_char__Endwrite, 4)
1973 MSVCP_bool __thiscall basic_filebuf_char__Endwrite(basic_filebuf_char *this)
1975 TRACE("(%p)\n", this);
1977 if(!this->wrotesome || !this->cvt)
1981 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
1985 /* TODO: check if we need a dynamic buffer here */
1990 ret = codecvt_char_unshift(this->cvt, &this->state, buf, buf+sizeof(buf), &next);
1993 this->wrotesome = FALSE;
1995 case CODECVT_partial:
1996 if(!fwrite(buf, next-buf, 1, this->file))
2001 case CODECVT_noconv:
2002 if(call_basic_streambuf_char_overflow(&this->base, EOF) == EOF)
2011 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@XZ */
2012 /* ?close@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@XZ */
2013 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_close, 4)
2014 basic_filebuf_char* __thiscall basic_filebuf_char_close(basic_filebuf_char *this)
2016 basic_filebuf_char *ret = this;
2018 TRACE("(%p)\n", this);
2023 /* TODO: handle exceptions */
2024 if(!basic_filebuf_char__Endwrite(this))
2026 if(!fclose(this->file))
2029 basic_filebuf_char__Init(this, NULL, INITFL_close);
2033 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
2034 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
2035 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_file, 8)
2036 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_file(basic_filebuf_char *this, FILE *file)
2038 TRACE("(%p %p)\n", this, file);
2040 basic_streambuf_char_ctor(&this->base);
2041 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2043 basic_filebuf_char__Init(this, file, INITFL_new);
2047 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
2048 /* ??_F?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
2049 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor, 4)
2050 basic_filebuf_char* __thiscall basic_filebuf_char_ctor(basic_filebuf_char *this)
2052 return basic_filebuf_char_ctor_file(this, NULL);
2055 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
2056 /* ??0?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
2057 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_ctor_uninitialized, 8)
2058 basic_filebuf_char* __thiscall basic_filebuf_char_ctor_uninitialized(basic_filebuf_char *this, int uninitialized)
2060 TRACE("(%p %d)\n", this, uninitialized);
2062 basic_streambuf_char_ctor(&this->base);
2063 this->base.vtable = &MSVCP_basic_filebuf_char_vtable;
2067 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
2068 /* ??1?$basic_filebuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
2069 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_dtor, 4)
2070 void __thiscall basic_filebuf_char_dtor(basic_filebuf_char *this)
2072 TRACE("(%p)\n", this);
2075 basic_filebuf_char_close(this);
2076 basic_streambuf_char_dtor(&this->base);
2079 DEFINE_THISCALL_WRAPPER(MSVCP_basic_filebuf_char_vector_dtor, 8)
2080 basic_filebuf_char* __thiscall MSVCP_basic_filebuf_char_vector_dtor(basic_filebuf_char *this, unsigned int flags)
2082 TRACE("(%p %x)\n", this, flags);
2084 /* we have an array, with the number of elements stored before the first object */
2085 int i, *ptr = (int *)this-1;
2087 for(i=*ptr-1; i>=0; i--)
2088 basic_filebuf_char_dtor(this+i);
2089 MSVCRT_operator_delete(ptr);
2091 basic_filebuf_char_dtor(this);
2093 MSVCRT_operator_delete(this);
2099 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QBE_NXZ */
2100 /* ?is_open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
2101 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_is_open, 4)
2102 MSVCP_bool __thiscall basic_filebuf_char_is_open(const basic_filebuf_char *this)
2104 TRACE("(%p)\n", this);
2105 return this->file != NULL;
2108 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WHH@Z */
2109 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WHH@Z */
2110 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGHH@Z */
2111 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGHH@Z */
2112 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar, 16)
2113 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar(basic_filebuf_char *this, const wchar_t *name, int mode, int prot)
2115 static const wchar_t rW[] = {'r',0};
2116 static const struct {
2118 const wchar_t str[4];
2119 const wchar_t str_bin[4];
2121 {OPENMODE_out, {'w',0}, {'w','b',0}},
2122 {OPENMODE_out|OPENMODE_app, {'a',0}, {'a','b',0}},
2123 {OPENMODE_app, {'a',0}, {'a','b',0}},
2124 {OPENMODE_out|OPENMODE_trunc, {'w',0}, {'w','b',0}},
2125 {OPENMODE_in, {'r',0}, {'r','b',0}},
2126 {OPENMODE_in|OPENMODE_out, {'r','+',0}, {'r','+','b',0}},
2127 {OPENMODE_in|OPENMODE_out|OPENMODE_trunc, {'w','+',0}, {'w','+','b',0}},
2128 {OPENMODE_in|OPENMODE_out|OPENMODE_app, {'a','+',0}, {'a','+','b',0}},
2129 {OPENMODE_in|OPENMODE_app, {'a','+',0}, {'a','+','b',0}}
2132 int real_mode = mode & ~(OPENMODE_ate|OPENMODE__Nocreate|OPENMODE__Noreplace|OPENMODE_binary);
2136 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
2138 if(basic_filebuf_char_is_open(this))
2141 for(mode_idx=0; mode_idx<sizeof(str_mode)/sizeof(str_mode[0]); mode_idx++)
2142 if(str_mode[mode_idx].mode == real_mode)
2144 if(mode_idx == sizeof(str_mode)/sizeof(str_mode[0]))
2147 if((mode & OPENMODE__Nocreate) && !(f = _wfopen(name, rW)))
2152 if((mode & OPENMODE__Noreplace) && (mode & (OPENMODE_out|OPENMODE_app))
2153 && (f = _wfopen(name, rW))) {
2158 f = _wfsopen(name, (mode & OPENMODE_binary) ? str_mode[mode_idx].str_bin
2159 : str_mode[mode_idx].str, prot);
2163 if((mode & OPENMODE_ate) && fseek(f, 0, SEEK_END)) {
2168 basic_filebuf_char__Init(this, f, INITFL_open);
2169 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(this->base.loc));
2173 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PB_WI@Z */
2174 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEB_WI@Z */
2175 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBGI@Z */
2176 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBGI@Z */
2177 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_wchar_mode, 12)
2178 basic_filebuf_char* __thiscall basic_filebuf_char_open_wchar_mode(basic_filebuf_char *this, const wchar_t *name, unsigned int mode)
2180 return basic_filebuf_char_open_wchar(this, name, mode, SH_DENYNO);
2183 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDHH@Z */
2184 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDHH@Z */
2185 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open, 16)
2186 basic_filebuf_char* __thiscall basic_filebuf_char_open(basic_filebuf_char *this, const char *name, int mode, int prot)
2188 wchar_t nameW[FILENAME_MAX];
2190 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
2192 if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0)
2194 return basic_filebuf_char_open_wchar(this, nameW, mode, prot);
2197 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PBDI@Z */
2198 /* ?open@?$basic_filebuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEBDI@Z */
2199 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_open_mode, 12)
2200 basic_filebuf_char* __thiscall basic_filebuf_char_open_mode(basic_filebuf_char *this, const char *name, unsigned int mode)
2202 return basic_filebuf_char_open(this, name, mode, SH_DENYNO);
2205 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2206 /* ?overflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2207 #define call_basic_filebuf_char_overflow(this, c) CALL_VTBL_FUNC(this, 4, \
2208 int, (basic_filebuf_char*, int), (this, c))
2209 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_overflow, 8)
2210 int __thiscall basic_filebuf_char_overflow(basic_filebuf_char *this, int c)
2212 char buf[8], *dyn_buf;
2213 char ch = c, *to_next;
2214 const char *from_next;
2218 TRACE("(%p %d)\n", this, c);
2220 if(!basic_filebuf_char_is_open(this))
2226 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2230 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
2231 &from_next, buf, buf+sizeof(buf), &to_next);
2234 case CODECVT_partial:
2239 if(!fwrite(buf, to_next-buf, 1, this->file))
2241 if(ret == CODECVT_partial)
2244 case CODECVT_noconv:
2245 return fwrite(&ch, sizeof(char), 1, this->file) ? c : EOF;
2251 max_size = codecvt_base_max_length(&this->cvt->base);
2252 dyn_buf = malloc(max_size);
2256 ret = codecvt_char_out(this->cvt, &this->state, from_next, &ch+1,
2257 &from_next, dyn_buf, dyn_buf+max_size, &to_next);
2261 ret = fwrite(dyn_buf, to_next-dyn_buf, 1, this->file);
2263 return ret ? c : EOF;
2264 case CODECVT_partial:
2265 ERR("buffer should be big enough to store all output\n");
2273 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
2274 /* ?pbackfail@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
2275 #define call_basic_filebuf_char_pbackfail(this, c) CALL_VTBL_FUNC(this, 8, \
2276 int, (basic_filebuf_char*, int), (this, c))
2277 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_pbackfail, 8)
2278 int __thiscall basic_filebuf_char_pbackfail(basic_filebuf_char *this, int c)
2280 TRACE("(%p %d)\n", this, c);
2282 if(!basic_filebuf_char_is_open(this))
2285 if(basic_streambuf_char_gptr(&this->base)>basic_streambuf_char_eback(&this->base)
2286 && (c==EOF || basic_streambuf_char_gptr(&this->base)[-1]==(char)c)) {
2287 basic_streambuf_char__Gndec(&this->base);
2288 return c==EOF ? !c : c;
2289 }else if(c!=EOF && !this->cvt) {
2290 return ungetc(c, this->file);
2296 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2297 /* ?uflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2298 #define call_basic_filebuf_char_uflow(this) CALL_VTBL_FUNC(this, 20, \
2299 int, (basic_filebuf_char*), (this))
2300 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_uflow, 4)
2301 int __thiscall basic_filebuf_char_uflow(basic_filebuf_char *this)
2303 char ch, buf[128], *to_next;
2304 const char *buf_next;
2307 TRACE("(%p)\n", this);
2309 if(!basic_filebuf_char_is_open(this))
2312 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2313 return *basic_streambuf_char__Gninc(&this->base);
2315 c = fgetc(this->file);
2316 if(!this->cvt || !c)
2320 for(i=0; i < sizeof(buf)/sizeof(char); i++) {
2323 switch(codecvt_char_in(this->cvt, &this->state, buf_next,
2324 buf+i+1, &buf_next, &ch, &ch+1, &to_next)) {
2325 case CODECVT_partial:
2327 if(to_next == &ch) {
2328 c = fgetc(this->file);
2334 for(i--; i>=buf_next-buf; i--)
2335 ungetc(buf[i], this->file);
2337 case CODECVT_noconv:
2344 FIXME("buffer is to small\n");
2348 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2349 /* ?underflow@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2350 #define call_basic_filebuf_char_underflow(this) CALL_VTBL_FUNC(this, 16, \
2351 int, (basic_filebuf_char*), (this))
2352 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_underflow, 4)
2353 int __thiscall basic_filebuf_char_underflow(basic_filebuf_char *this)
2357 TRACE("(%p)\n", this);
2359 if(basic_streambuf_char_gptr(&this->base) < basic_streambuf_char_egptr(&this->base))
2360 return *basic_streambuf_char_gptr(&this->base);
2362 ret = call_basic_filebuf_char_uflow(this);
2364 ret = call_basic_filebuf_char_pbackfail(this, ret);
2368 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
2369 /* ?seekoff@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
2370 #define call_basic_filebuf_char_seekoff(this, ret, off, way, mode) CALL_VTBL_FUNC(this, 36, \
2371 fpos_int*, (basic_filebuf_char*, fpos_int*, streamoff, int, int), (this, ret, off, way, mode))
2372 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekoff, 20)
2373 fpos_int* __thiscall basic_filebuf_char_seekoff(basic_filebuf_char *this,
2374 fpos_int *ret, streamoff off, int way, int mode)
2378 TRACE("(%p %p %ld %d %d)\n", this, ret, off, way, mode);
2380 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
2381 || fseek(this->file, off, way)) {
2388 fgetpos(this->file, &pos);
2391 ret->state = this->state;
2395 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
2396 /* ?seekpos@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
2397 #define call_basic_filebuf_char_seekpos(this, ret, pos, mode) CALL_VTBL_FUNC(this, 40, \
2398 fpos_int*, (basic_filebuf_char*, fpos_int*, fpos_int, mode), (this, ret, pos, mode))
2399 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_seekpos, 36)
2400 fpos_int* __thiscall basic_filebuf_char_seekpos(basic_filebuf_char *this,
2401 fpos_int *ret, fpos_int pos, int mode)
2405 TRACE("(%p %p %s %d)\n", this, ret, debugstr_fpos_int(&pos), mode);
2407 if(!basic_filebuf_char_is_open(this) || !basic_filebuf_char__Endwrite(this)
2408 || fseek(this->file, (LONG)pos.pos, SEEK_SET)
2409 || (pos.off && fseek(this->file, pos.off, SEEK_CUR))) {
2416 fgetpos(this->file, &fpos);
2419 ret->state = this->state;
2423 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PADH@Z */
2424 /* ?setbuf@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAD_J@Z */
2425 #define call_basic_filebuf_char_setbuf(this, buf, count) CALL_VTBL_FUNC(this, 44, \
2426 basic_streambuf_char*, (basic_filebuf_char*, char*, streamsize), (this, buf, count))
2427 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_setbuf, 12)
2428 basic_streambuf_char* __thiscall basic_filebuf_char_setbuf(basic_filebuf_char *this, char *buf, streamsize count)
2430 TRACE("(%p %p %ld)\n", this, buf, count);
2432 if(!basic_filebuf_char_is_open(this))
2435 if(setvbuf(this->file, buf, (buf==NULL && count==0) ? _IONBF : _IOFBF, count))
2438 basic_filebuf_char__Init(this, this->file, INITFL_open);
2442 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
2443 /* ?sync@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
2444 #define call_basic_filebuf_char_sync(this) CALL_VTBL_FUNC(this, 48, \
2445 int, (basic_filebuf_char*), (this))
2446 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_sync, 4)
2447 int __thiscall basic_filebuf_char_sync(basic_filebuf_char *this)
2449 TRACE("(%p)\n", this);
2451 if(!basic_filebuf_char_is_open(this))
2454 if(call_basic_filebuf_char_overflow(this, EOF) == EOF)
2456 return fflush(this->file);
2459 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
2460 /* ?imbue@?$basic_filebuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
2461 #define call_basic_filebuf_char_imbue(this, loc) CALL_VTBL_FUNC(this, 52, \
2462 void, (basic_filebuf_char*, const locale*), (this, loc))
2463 DEFINE_THISCALL_WRAPPER(basic_filebuf_char_imbue, 8)
2464 void __thiscall basic_filebuf_char_imbue(basic_filebuf_char *this, const locale *loc)
2466 TRACE("(%p %p)\n", this, loc);
2467 basic_filebuf_char__Initcvt(this, codecvt_char_use_facet(loc));
2470 /* ??0ios_base@std@@IAE@XZ */
2471 /* ??0ios_base@std@@IEAA@XZ */
2472 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
2473 ios_base* __thiscall ios_base_ctor(ios_base *this)
2475 TRACE("(%p)\n", this);
2476 this->vtable = &MSVCP_ios_base_vtable;
2480 /* ??0ios_base@std@@QAE@ABV01@@Z */
2481 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
2482 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
2483 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
2485 TRACE("(%p %p)\n", this, copy);
2487 this->vtable = &MSVCP_ios_base_vtable;
2491 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
2492 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
2493 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
2494 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
2496 IOS_BASE_fnarray *cur;
2498 TRACE("(%p %x)\n", this, event);
2500 for(cur=this->calls; cur; cur=cur->next)
2501 cur->event_handler(event, this, cur->index);
2504 /* ?_Tidy@ios_base@std@@AAAXXZ */
2505 /* ?_Tidy@ios_base@std@@AEAAXXZ */
2506 void CDECL ios_base_Tidy(ios_base *this)
2508 IOS_BASE_iosarray *arr_cur, *arr_next;
2509 IOS_BASE_fnarray *event_cur, *event_next;
2511 TRACE("(%p)\n", this);
2513 ios_base_Callfns(this, EVENT_erase_event);
2515 for(arr_cur=this->arr; arr_cur; arr_cur=arr_next) {
2516 arr_next = arr_cur->next;
2517 MSVCRT_operator_delete(arr_cur);
2521 for(event_cur=this->calls; event_cur; event_cur=event_next) {
2522 event_next = event_cur->next;
2523 MSVCRT_operator_delete(event_cur);
2528 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
2529 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
2530 void CDECL ios_base_Ios_base_dtor(ios_base *obj)
2532 TRACE("(%p)\n", obj);
2534 locale_dtor(obj->loc);
2535 MSVCRT_operator_delete(obj->loc);
2540 /* ??1ios_base@std@@UAE@XZ */
2541 /* ??1ios_base@std@@UEAA@XZ */
2542 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
2543 void __thiscall ios_base_dtor(ios_base *this)
2545 ios_base_Ios_base_dtor(this);
2548 DEFINE_THISCALL_WRAPPER(MSVCP_ios_base_vector_dtor, 8)
2549 ios_base* __thiscall MSVCP_ios_base_vector_dtor(ios_base *this, unsigned int flags)
2551 TRACE("(%p %x)\n", this, flags);
2553 /* we have an array, with the number of elements stored before the first object */
2554 int i, *ptr = (int *)this-1;
2556 for(i=*ptr-1; i>=0; i--)
2557 ios_base_dtor(this+i);
2558 MSVCRT_operator_delete(ptr);
2560 ios_base_dtor(this);
2562 MSVCRT_operator_delete(this);
2568 DEFINE_THISCALL_WRAPPER(MSVCP_iosb_vector_dtor, 8)
2569 void* __thiscall MSVCP_iosb_vector_dtor(void *this, unsigned int flags)
2571 TRACE("(%p %x)\n", this, flags);
2573 int *ptr = (int *)this-1;
2574 MSVCRT_operator_delete(ptr);
2577 MSVCRT_operator_delete(this);
2583 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
2584 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
2585 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
2586 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
2588 IOS_BASE_iosarray *p;
2590 TRACE("(%p %d)\n", this, index);
2592 for(p=this->arr; p; p=p->next) {
2593 if(p->index == index)
2597 for(p=this->arr; p; p=p->next) {
2598 if(!p->long_val && !p->ptr_val) {
2604 p = MSVCRT_operator_new(sizeof(IOS_BASE_iosarray));
2605 p->next = this->arr;
2613 /* ?iword@ios_base@std@@QAEAAJH@Z */
2614 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
2615 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
2616 LONG* __thiscall ios_base_iword(ios_base *this, int index)
2618 TRACE("(%p %d)\n", this, index);
2619 return &ios_base_Findarr(this, index)->long_val;
2622 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
2623 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
2624 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
2625 void** __thiscall ios_base_pword(ios_base *this, int index)
2627 TRACE("(%p %d)\n", this, index);
2628 return &ios_base_Findarr(this, index)->ptr_val;
2631 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
2632 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
2633 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
2634 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
2636 IOS_BASE_fnarray *event;
2638 TRACE("(%p %p %d)\n", this, callback, index);
2640 event = MSVCRT_operator_new(sizeof(IOS_BASE_fnarray));
2641 event->next = this->calls;
2642 event->index = index;
2643 event->event_handler = callback;
2644 this->calls = event;
2647 /* ?clear@ios_base@std@@QAEXH_N@Z */
2648 /* ?clear@ios_base@std@@QEAAXH_N@Z */
2649 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
2650 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
2652 TRACE("(%p %x %x)\n", this, state, reraise);
2654 this->state = state & IOSTATE_mask;
2655 if(!(this->state & this->except))
2659 throw_exception(EXCEPTION_RERAISE, NULL);
2660 else if(this->state & this->except & IOSTATE_eofbit)
2661 throw_exception(EXCEPTION_FAILURE, "eofbit is set");
2662 else if(this->state & this->except & IOSTATE_failbit)
2663 throw_exception(EXCEPTION_FAILURE, "failbit is set");
2664 else if(this->state & this->except & IOSTATE_badbit)
2665 throw_exception(EXCEPTION_FAILURE, "badbit is set");
2666 else if(this->state & this->except & IOSTATE__Hardfail)
2667 throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
2670 /* ?clear@ios_base@std@@QAEXH@Z */
2671 /* ?clear@ios_base@std@@QEAAXH@Z */
2672 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
2673 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
2675 ios_base_clear_reraise(this, state, FALSE);
2678 /* ?clear@ios_base@std@@QAEXI@Z */
2679 /* ?clear@ios_base@std@@QEAAXI@Z */
2680 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
2681 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
2683 ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
2686 /* ?exceptions@ios_base@std@@QAEXH@Z */
2687 /* ?exceptions@ios_base@std@@QEAAXH@Z */
2688 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set, 8)
2689 void __thiscall ios_base_exceptions_set(ios_base *this, IOSB_iostate state)
2691 TRACE("(%p %x)\n", this, state);
2692 this->except = state & IOSTATE_mask;
2693 ios_base_clear(this, this->state);
2696 /* ?exceptions@ios_base@std@@QAEXI@Z */
2697 /* ?exceptions@ios_base@std@@QEAAXI@Z */
2698 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_set_unsigned, 8)
2699 void __thiscall ios_base_exceptions_set_unsigned(ios_base *this, unsigned int state)
2701 TRACE("(%p %x)\n", this, state);
2702 ios_base_exceptions_set(this, state);
2705 /* ?exceptions@ios_base@std@@QBEHXZ */
2706 /* ?exceptions@ios_base@std@@QEBAHXZ */
2707 DEFINE_THISCALL_WRAPPER(ios_base_exceptions_get, 4)
2708 IOSB_iostate __thiscall ios_base_exceptions_get(ios_base *this)
2710 TRACE("(%p)\n", this);
2711 return this->except;
2714 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
2715 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
2716 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
2717 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *rhs)
2719 TRACE("(%p %p)\n", this, rhs);
2722 IOS_BASE_iosarray *arr_cur;
2723 IOS_BASE_fnarray *event_cur;
2725 ios_base_Tidy(this);
2727 for(arr_cur=rhs->arr; arr_cur; arr_cur=arr_cur->next) {
2728 if(arr_cur->long_val)
2729 *ios_base_iword(this, arr_cur->index) = arr_cur->long_val;
2730 if(arr_cur->ptr_val)
2731 *ios_base_pword(this, arr_cur->index) = arr_cur->ptr_val;
2733 this->stdstr = rhs->stdstr;
2734 this->fmtfl = rhs->fmtfl;
2735 this->prec = rhs->prec;
2736 this->wide = rhs->wide;
2737 locale_operator_assign(this->loc, rhs->loc);
2739 for(event_cur=rhs->calls; event_cur; event_cur=event_cur->next)
2740 ios_base_register_callback(this, event_cur->event_handler, event_cur->index);
2742 ios_base_Callfns(this, EVENT_copyfmt_event);
2743 ios_base_exceptions_set(this, rhs->except);
2749 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
2750 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
2751 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
2752 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
2754 TRACE("(%p %p)\n", this, right);
2757 this->state = right->state;
2758 ios_base_copyfmt(this, right);
2764 /* ?fail@ios_base@std@@QBE_NXZ */
2765 /* ?fail@ios_base@std@@QEBA_NXZ */
2766 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
2767 MSVCP_bool __thiscall ios_base_fail(const ios_base *this)
2769 TRACE("(%p)\n", this);
2770 return (this->state & (IOSTATE_failbit|IOSTATE_badbit)) != 0;
2773 /* ??7ios_base@std@@QBE_NXZ */
2774 /* ??7ios_base@std@@QEBA_NXZ */
2775 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
2776 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
2778 TRACE("(%p)\n", this);
2779 return ios_base_fail(this);
2782 /* ??Bios_base@std@@QBEPAXXZ */
2783 /* ??Bios_base@std@@QEBAPEAXXZ */
2784 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
2785 void* __thiscall ios_base_op_fail(const ios_base *this)
2787 TRACE("(%p)\n", this);
2788 return ios_base_fail(this) ? NULL : (void*)this;
2791 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
2792 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
2793 void CDECL ios_base_Addstd(ios_base *add)
2795 FIXME("(%p) stub\n", add);
2798 /* ?_Index_func@ios_base@std@@CAAAHXZ */
2799 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
2800 int* CDECL ios_base_Index_func(void)
2803 return &ios_base_Index;
2806 /* ?_Init@ios_base@std@@IAEXXZ */
2807 /* ?_Init@ios_base@std@@IEAAXXZ */
2808 DEFINE_THISCALL_WRAPPER(ios_base_Init, 4)
2809 void __thiscall ios_base_Init(ios_base *this)
2811 TRACE("(%p)\n", this);
2814 this->state = this->except = IOSTATE_goodbit;
2815 this->fmtfl = FMTFLAG_skipws | FMTFLAG_dec;
2820 this->loc = MSVCRT_operator_new(sizeof(locale));
2821 locale_ctor(this->loc);
2824 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
2825 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
2826 MSVCP_bool* CDECL ios_base_Sync_func(void)
2829 return &ios_base_Sync;
2832 /* ?bad@ios_base@std@@QBE_NXZ */
2833 /* ?bad@ios_base@std@@QEBA_NXZ */
2834 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
2835 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
2837 TRACE("(%p)\n", this);
2838 return (this->state & IOSTATE_badbit) != 0;
2841 /* ?eof@ios_base@std@@QBE_NXZ */
2842 /* ?eof@ios_base@std@@QEBA_NXZ */
2843 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
2844 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
2846 TRACE("(%p)\n", this);
2847 return (this->state & IOSTATE_eofbit) != 0;
2850 /* ?flags@ios_base@std@@QAEHH@Z */
2851 /* ?flags@ios_base@std@@QEAAHH@Z */
2852 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
2853 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
2855 IOSB_fmtflags ret = this->fmtfl;
2857 TRACE("(%p %x)\n", this, flags);
2859 this->fmtfl = flags & FMTFLAG_mask;
2863 /* ?flags@ios_base@std@@QBEHXZ */
2864 /* ?flags@ios_base@std@@QEBAHXZ */
2865 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
2866 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
2868 TRACE("(%p)\n", this);
2872 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
2873 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
2874 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 8)
2875 locale* __thiscall ios_base_getloc(const ios_base *this, locale *ret)
2877 TRACE("(%p)\n", this);
2878 return locale_copy_ctor(ret, this->loc);
2881 /* ?good@ios_base@std@@QBE_NXZ */
2882 /* ?good@ios_base@std@@QEBA_NXZ */
2883 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
2884 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
2886 TRACE("(%p)\n", this);
2887 return this->state == IOSTATE_goodbit;
2890 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
2891 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
2892 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 12)
2893 locale* __thiscall ios_base_imbue(ios_base *this, locale *ret, const locale *loc)
2895 TRACE("(%p %p)\n", this, loc);
2897 locale_copy_ctor(this->loc, loc);
2901 /* ?precision@ios_base@std@@QAEHH@Z */
2902 /* ?precision@ios_base@std@@QEAA_J_J@Z */
2903 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
2904 streamsize __thiscall ios_base_precision_set(ios_base *this, streamsize precision)
2906 streamsize ret = this->prec;
2908 TRACE("(%p %ld)\n", this, precision);
2910 this->prec = precision;
2914 /* ?precision@ios_base@std@@QBEHXZ */
2915 /* ?precision@ios_base@std@@QEBA_JXZ */
2916 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
2917 streamsize __thiscall ios_base_precision_get(const ios_base *this)
2919 TRACE("(%p)\n", this);
2923 /* ?rdstate@ios_base@std@@QBEHXZ */
2924 /* ?rdstate@ios_base@std@@QEBAHXZ */
2925 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
2926 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
2928 TRACE("(%p)\n", this);
2932 /* ?setf@ios_base@std@@QAEHHH@Z */
2933 /* ?setf@ios_base@std@@QEAAHHH@Z */
2934 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
2935 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
2937 IOSB_fmtflags ret = this->fmtfl;
2939 TRACE("(%p %x %x)\n", this, flags, mask);
2941 this->fmtfl = (this->fmtfl & (~mask)) | (flags & mask & FMTFLAG_mask);
2945 /* ?setf@ios_base@std@@QAEHH@Z */
2946 /* ?setf@ios_base@std@@QEAAHH@Z */
2947 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
2948 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
2950 return ios_base_setf_mask(this, flags, ~0);
2953 /* ?setstate@ios_base@std@@QAEXH_N@Z */
2954 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
2955 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
2956 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
2958 TRACE("(%p %x %x)\n", this, state, reraise);
2960 if(state != IOSTATE_goodbit)
2961 ios_base_clear_reraise(this, this->state | state, reraise);
2964 /* ?setstate@ios_base@std@@QAEXH@Z */
2965 /* ?setstate@ios_base@std@@QEAAXH@Z */
2966 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
2967 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
2969 ios_base_setstate_reraise(this, state, FALSE);
2972 /* ?setstate@ios_base@std@@QAEXI@Z */
2973 /* ?setstate@ios_base@std@@QEAAXI@Z */
2974 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
2975 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
2977 ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
2980 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
2981 MSVCP_bool CDECL ios_base_sync_with_stdio(MSVCP_bool sync)
2986 TRACE("(%x)\n", sync);
2988 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
2989 ret = ios_base_Sync;
2990 ios_base_Sync = sync;
2991 _Lockit_dtor(&lock);
2995 /* ?unsetf@ios_base@std@@QAEXH@Z */
2996 /* ?unsetf@ios_base@std@@QEAAXH@Z */
2997 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
2998 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
3000 TRACE("(%p %x)\n", this, flags);
3001 this->fmtfl &= ~flags;
3004 /* ?width@ios_base@std@@QAEHH@Z */
3005 /* ?width@ios_base@std@@QEAA_J_J@Z */
3006 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
3007 streamsize __thiscall ios_base_width_set(ios_base *this, streamsize width)
3009 streamsize ret = this->wide;
3011 TRACE("(%p %ld)\n", this, width);
3017 /* ?width@ios_base@std@@QBEHXZ */
3018 /* ?width@ios_base@std@@QEBA_JXZ */
3019 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
3020 streamsize __thiscall ios_base_width_get(ios_base *this)
3022 TRACE("(%p)\n", this);
3026 /* ?xalloc@ios_base@std@@SAHXZ */
3027 int CDECL ios_base_xalloc(void)
3034 _Lockit_ctor_locktype(&lock, _LOCK_STREAM);
3035 ret = ios_base_Index++;
3036 _Lockit_dtor(&lock);
3040 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
3041 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
3042 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
3043 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
3045 TRACE("(%p)\n", this);
3047 ios_base_ctor(&this->base);
3048 this->base.vtable = &MSVCP_basic_ios_char_vtable;
3052 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
3053 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
3054 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
3055 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
3057 TRACE("(%p %p %x)\n", this, streambuf, isstd);
3058 ios_base_Init(&this->base);
3059 this->strbuf = streambuf;
3060 this->stream = NULL;
3064 ios_base_setstate(&this->base, IOSTATE_badbit);
3067 FIXME("standard streams not handled yet\n");
3070 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
3071 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
3072 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor_streambuf, 8)
3073 basic_ios_char* __thiscall basic_ios_char_ctor_streambuf(basic_ios_char *this, basic_streambuf_char *strbuf)
3075 TRACE("(%p %p)\n", this, strbuf);
3077 basic_ios_char_ctor(this);
3078 basic_ios_char_init(this, strbuf, FALSE);
3082 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
3083 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
3084 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
3085 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
3087 TRACE("(%p)\n", this);
3088 ios_base_dtor(&this->base);
3091 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ios_char_vector_dtor, 8)
3092 basic_ios_char* __thiscall MSVCP_basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
3094 TRACE("(%p %x)\n", this, flags);
3096 /* we have an array, with the number of elements stored before the first object */
3097 int i, *ptr = (int *)this-1;
3099 for(i=*ptr-1; i>=0; i--)
3100 basic_ios_char_dtor(this+i);
3101 MSVCRT_operator_delete(ptr);
3103 basic_ios_char_dtor(this);
3105 MSVCRT_operator_delete(this);
3111 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
3112 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
3113 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
3114 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
3116 TRACE("(%p %x %x)\n", this, state, reraise);
3117 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
3120 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
3121 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
3122 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
3123 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
3125 basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
3128 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
3129 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
3130 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
3131 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
3133 TRACE("(%p %p)\n", this, copy);
3137 this->stream = copy->stream;
3138 this->fillch = copy->fillch;
3139 ios_base_copyfmt(&this->base, ©->base);
3143 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
3144 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
3145 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
3146 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
3148 char ret = this->fillch;
3150 TRACE("(%p %c)\n", this, fill);
3152 this->fillch = fill;
3156 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
3157 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
3158 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
3159 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
3161 TRACE("(%p)\n", this);
3162 return this->fillch;
3165 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
3166 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
3167 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 12)
3168 locale *__thiscall basic_ios_char_imbue(basic_ios_char *this, locale *ret, const locale *loc)
3170 TRACE("(%p %p %p)\n", this, ret, loc);
3173 return basic_streambuf_char_pubimbue(this->strbuf, ret, loc);
3175 locale_copy_ctor(ret, loc);
3179 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
3180 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
3181 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
3182 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
3184 FIXME("(%p %c %c) stub\n", this, ch, def);
3188 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
3189 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
3190 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
3191 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
3193 basic_streambuf_char *ret = this->strbuf;
3195 TRACE("(%p %p)\n", this, streambuf);
3197 this->strbuf = streambuf;
3198 basic_ios_char_clear(this, IOSTATE_goodbit);
3202 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
3203 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
3204 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
3205 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
3207 TRACE("(%p)\n", this);
3208 return this->strbuf;
3211 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
3212 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
3213 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
3214 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
3216 TRACE("(%p %x %x)\n", this, state, reraise);
3218 if(state != IOSTATE_goodbit)
3219 basic_ios_char_clear_reraise(this, this->base.state | state, reraise);
3222 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
3223 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
3224 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
3225 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
3227 basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
3230 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
3231 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
3232 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
3233 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
3235 basic_ostream_char *ret = this->stream;
3237 TRACE("(%p %p)\n", this, ostream);
3239 this->stream = ostream;
3243 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
3244 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
3245 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
3246 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
3248 TRACE("(%p)\n", this);
3249 return this->stream;
3252 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
3253 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
3254 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
3255 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
3257 FIXME("(%p %c) stub\n", this, ch);
3262 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAE@XZ */
3263 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAA@XZ */
3264 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor, 4)
3265 basic_ios_wchar* __thiscall basic_ios_wchar_ctor(basic_ios_wchar *this)
3267 TRACE("(%p)\n", this);
3269 ios_base_ctor(&this->base);
3270 this->base.vtable = &MSVCP_basic_ios_wchar_vtable;
3274 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IAE@XZ */
3275 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@IEAA@XZ */
3276 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor, 4)
3277 basic_ios_wchar* __thiscall basic_ios_short_ctor(basic_ios_wchar *this)
3279 basic_ios_wchar_ctor(this);
3280 this->base.vtable = &MSVCP_basic_ios_short_vtable;
3284 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IAEXPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
3285 /* ?init@?$basic_ios@_WU?$char_traits@_W@std@@@std@@IEAAXPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@_N@Z */
3286 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IAEXPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
3287 /* ?init@?$basic_ios@GU?$char_traits@G@std@@@std@@IEAAXPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@_N@Z */
3288 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_init, 12)
3289 void __thiscall basic_ios_wchar_init(basic_ios_wchar *this, basic_streambuf_wchar *streambuf, MSVCP_bool isstd)
3291 TRACE("(%p %p %x)\n", this, streambuf, isstd);
3292 ios_base_Init(&this->base);
3293 this->strbuf = streambuf;
3294 this->stream = NULL;
3298 ios_base_setstate(&this->base, IOSTATE_badbit);
3301 FIXME("standard streams not handled yet\n");
3304 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE@PAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
3305 /* ??0?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA@PEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@1@@Z */
3306 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_ctor_streambuf, 8)
3307 basic_ios_wchar* __thiscall basic_ios_wchar_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
3309 TRACE("(%p %p)\n", this, strbuf);
3311 basic_ios_wchar_ctor(this);
3312 basic_ios_wchar_init(this, strbuf, FALSE);
3316 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QAE@PAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
3317 /* ??0?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA@PEAV?$basic_streambuf@GU?$char_traits@G@std@@@1@@Z */
3318 DEFINE_THISCALL_WRAPPER(basic_ios_short_ctor_streambuf, 8)
3319 basic_ios_wchar* __thiscall basic_ios_short_ctor_streambuf(basic_ios_wchar *this, basic_streambuf_wchar *strbuf)
3321 basic_ios_wchar_ctor_streambuf(this, strbuf);
3322 this->base.vtable = &MSVCP_basic_ios_short_vtable;
3326 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UAE@XZ */
3327 /* ??1?$basic_ios@_WU?$char_traits@_W@std@@@std@@UEAA@XZ */
3328 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UAE@XZ */
3329 /* ??1?$basic_ios@GU?$char_traits@G@std@@@std@@UEAA@XZ */
3330 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_dtor, 4)
3331 void __thiscall basic_ios_wchar_dtor(basic_ios_wchar *this)
3333 TRACE("(%p)\n", this);
3334 ios_base_dtor(&this->base);
3337 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ios_wchar_vector_dtor, 8)
3338 basic_ios_wchar* __thiscall MSVCP_basic_ios_wchar_vector_dtor(basic_ios_wchar *this, unsigned int flags)
3340 TRACE("(%p %x)\n", this, flags);
3342 /* we have an array, with the number of elements stored before the first object */
3343 int i, *ptr = (int *)this-1;
3345 for(i=*ptr-1; i>=0; i--)
3346 basic_ios_wchar_dtor(this+i);
3347 MSVCRT_operator_delete(ptr);
3349 basic_ios_wchar_dtor(this);
3351 MSVCRT_operator_delete(this);
3357 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ios_short_vector_dtor, 8)
3358 basic_ios_wchar* __thiscall MSVCP_basic_ios_short_vector_dtor(basic_ios_wchar *this, unsigned int flags)
3360 return MSVCP_basic_ios_wchar_vector_dtor(this, flags);
3363 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
3364 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
3365 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
3366 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
3367 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear_reraise, 12)
3368 void __thiscall basic_ios_wchar_clear_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
3370 TRACE("(%p %x %x)\n", this, state, reraise);
3371 ios_base_clear_reraise(&this->base, state | (this->strbuf ? IOSTATE_goodbit : IOSTATE_badbit), reraise);
3374 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
3375 /* ?clear@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
3376 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
3377 /* ?clear@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
3378 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_clear, 8)
3379 void __thiscall basic_ios_wchar_clear(basic_ios_wchar *this, unsigned int state)
3381 basic_ios_wchar_clear_reraise(this, (IOSB_iostate)state, FALSE);
3384 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEAAV12@ABV12@@Z */
3385 /* ?copyfmt@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAAEAV12@AEBV12@@Z */
3386 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEAAV12@ABV12@@Z */
3387 /* ?copyfmt@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAAEAV12@AEBV12@@Z */
3388 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_copyfmt, 8)
3389 basic_ios_wchar* __thiscall basic_ios_wchar_copyfmt(basic_ios_wchar *this, basic_ios_wchar *copy)
3391 TRACE("(%p %p)\n", this, copy);
3395 this->stream = copy->stream;
3396 this->fillch = copy->fillch;
3397 ios_base_copyfmt(&this->base, ©->base);
3401 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE_W_W@Z */
3402 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA_W_W@Z */
3403 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEGG@Z */
3404 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAGG@Z */
3405 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_set, 8)
3406 wchar_t __thiscall basic_ios_wchar_fill_set(basic_ios_wchar *this, wchar_t fill)
3408 wchar_t ret = this->fillch;
3410 TRACE("(%p %c)\n", this, fill);
3412 this->fillch = fill;
3416 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WXZ */
3417 /* ?fill@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WXZ */
3418 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGXZ */
3419 /* ?fill@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGXZ */
3420 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_fill_get, 4)
3421 wchar_t __thiscall basic_ios_wchar_fill_get(basic_ios_wchar *this)
3423 TRACE("(%p)\n", this);
3424 return this->fillch;
3427 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
3428 /* ?imbue@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
3429 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
3430 /* ?imbue@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
3431 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_imbue, 12)
3432 locale *__thiscall basic_ios_wchar_imbue(basic_ios_wchar *this, locale *ret, const locale *loc)
3434 TRACE("(%p %p %p)\n", this, ret, loc);
3437 return basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
3439 locale_copy_ctor(ret, loc);
3443 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
3444 /* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAD_WD@Z */
3445 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEDGD@Z */
3446 /* ?narrow@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBADGD@Z */
3447 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_narrow, 12)
3448 char __thiscall basic_ios_wchar_narrow(basic_ios_wchar *this, wchar_t ch, char def)
3450 FIXME("(%p %c %c) stub\n", this, ch, def);
3454 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
3455 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
3456 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PAV32@@Z */
3457 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@PEAV32@@Z */
3458 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_set, 8)
3459 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_set(basic_ios_wchar *this, basic_streambuf_wchar *streambuf)
3461 basic_streambuf_wchar *ret = this->strbuf;
3463 TRACE("(%p %p)\n", this, streambuf);
3465 this->strbuf = streambuf;
3466 basic_ios_wchar_clear(this, IOSTATE_goodbit);
3470 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
3471 /* ?rdbuf@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@2@XZ */
3472 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
3473 /* ?rdbuf@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_streambuf@GU?$char_traits@G@std@@@2@XZ */
3474 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_rdbuf_get, 4)
3475 basic_streambuf_wchar* __thiscall basic_ios_wchar_rdbuf_get(const basic_ios_wchar *this)
3477 TRACE("(%p)\n", this);
3478 return this->strbuf;
3481 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXH_N@Z */
3482 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXH_N@Z */
3483 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXH_N@Z */
3484 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXH_N@Z */
3485 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate_reraise, 12)
3486 void __thiscall basic_ios_wchar_setstate_reraise(basic_ios_wchar *this, IOSB_iostate state, MSVCP_bool reraise)
3488 TRACE("(%p %x %x)\n", this, state, reraise);
3490 if(state != IOSTATE_goodbit)
3491 basic_ios_wchar_clear_reraise(this, this->base.state | state, reraise);
3494 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEXI@Z */
3495 /* ?setstate@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAXI@Z */
3496 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEXI@Z */
3497 /* ?setstate@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAXI@Z */
3498 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_setstate, 8)
3499 void __thiscall basic_ios_wchar_setstate(basic_ios_wchar *this, IOSB_iostate state)
3501 basic_ios_wchar_setstate_reraise(this, state, FALSE);
3504 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QAEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PAV32@@Z */
3505 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEAAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@PEAV32@@Z */
3506 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QAEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@PAV32@@Z */
3507 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEAAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@PEAV32@@Z */
3508 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_set, 8)
3509 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_set(basic_ios_wchar *this, basic_ostream_wchar *ostream)
3511 basic_ostream_wchar *ret = this->stream;
3513 TRACE("(%p %p)\n", this, ostream);
3515 this->stream = ostream;
3519 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBEPAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
3520 /* ?tie@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBAPEAV?$basic_ostream@_WU?$char_traits@_W@std@@@2@XZ */
3521 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEPAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
3522 /* ?tie@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAPEAV?$basic_ostream@GU?$char_traits@G@std@@@2@XZ */
3523 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_tie_get, 4)
3524 basic_ostream_wchar* __thiscall basic_ios_wchar_tie_get(const basic_ios_wchar *this)
3526 TRACE("(%p)\n", this);
3527 return this->stream;
3530 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBE_WD@Z */
3531 /* ?widen@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QEBA_WD@Z */
3532 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QBEGD@Z */
3533 /* ?widen@?$basic_ios@GU?$char_traits@G@std@@@std@@QEBAGD@Z */
3534 DEFINE_THISCALL_WRAPPER(basic_ios_wchar_widen, 8)
3535 wchar_t __thiscall basic_ios_wchar_widen(basic_ios_wchar *this, char ch)
3537 FIXME("(%p %c)\n", this, ch);
3541 /* Caution: basic_ostream uses virtual inheritance.
3542 * All constructors have additional parameter that says if base class should be initialized.
3543 * Base class needs to be accessed using vbtable.
3545 static inline basic_ios_char* basic_ostream_char_get_basic_ios(basic_ostream_char *this)
3547 return (basic_ios_char*)((char*)this+this->vbtable[1]);
3550 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
3551 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
3552 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 16)
3553 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this,
3554 basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
3556 basic_ios_char *base;
3558 TRACE("(%p %p %d %d)\n", this, strbuf, isstd, virt_init);
3561 this->vbtable = basic_ostream_char_vbtable;
3562 base = basic_ostream_char_get_basic_ios(this);
3563 basic_ios_char_ctor(base);
3565 base = basic_ostream_char_get_basic_ios(this);
3568 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
3569 basic_ios_char_init(base, strbuf, isstd);
3573 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
3574 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
3575 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor_uninitialized, 16)
3576 basic_ostream_char* __thiscall basic_ostream_char_ctor_uninitialized(basic_ostream_char *this,
3577 int uninitialized, MSVCP_bool addstd, MSVCP_bool virt_init)
3579 basic_ios_char *base;
3581 TRACE("(%p %d %x)\n", this, uninitialized, addstd);
3584 this->vbtable = basic_ostream_char_vbtable;
3585 base = basic_ostream_char_get_basic_ios(this);
3586 basic_ios_char_ctor(base);
3588 base = basic_ostream_char_get_basic_ios(this);
3591 base->base.vtable = &MSVCP_basic_ostream_char_vtable;
3593 ios_base_Addstd(&base->base);
3597 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
3598 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
3599 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
3600 void __thiscall basic_ostream_char_dtor(basic_ostream_char *this)
3602 /* don't destroy virtual base here */
3603 TRACE("(%p)\n", this);
3606 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
3607 /* ??_D?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
3608 DEFINE_THISCALL_WRAPPER(basic_ostream_char_vbase_dtor, 4)
3609 void __thiscall basic_ostream_char_vbase_dtor(basic_ostream_char *this)
3611 TRACE("(%p)\n", this);
3612 basic_ostream_char_dtor(this);
3613 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(this));
3616 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ostream_char_vector_dtor, 8)
3617 basic_ostream_char* __thiscall MSVCP_basic_ostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
3619 basic_ostream_char *this = (basic_ostream_char *)((char*)base - basic_ostream_char_vbtable[1] + basic_ostream_char_vbtable[0]);
3621 TRACE("(%p %x)\n", this, flags);
3624 /* we have an array, with the number of elements stored before the first object */
3625 int i, *ptr = (int *)this-1;
3627 for(i=*ptr-1; i>=0; i--)
3628 basic_ostream_char_vbase_dtor(this+i);
3629 MSVCRT_operator_delete(ptr);
3631 basic_ostream_char_vbase_dtor(this);
3633 MSVCRT_operator_delete(this);
3639 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
3640 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
3641 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
3642 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
3644 /* this function is not matching C++ specification */
3645 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3647 TRACE("(%p)\n", this);
3649 if(basic_ios_char_rdbuf_get(base) && ios_base_good(&base->base)
3650 && basic_streambuf_char_pubsync(basic_ios_char_rdbuf_get(base))==-1)
3651 basic_ios_char_setstate(base, IOSTATE_badbit);
3655 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
3656 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
3657 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
3658 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
3660 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3662 TRACE("(%p)\n", this);
3664 if(base->base.fmtfl & FMTFLAG_unitbuf)
3665 basic_ostream_char_flush(this);
3668 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
3669 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
3670 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
3671 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
3673 TRACE("(%p)\n", this);
3674 basic_ostream_char__Osfx(this);
3677 static BOOL basic_ostream_char_sentry_create(basic_ostream_char *ostr)
3679 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
3681 if(basic_ios_char_rdbuf_get(base))
3682 basic_streambuf_char__Lock(base->strbuf);
3684 if(ios_base_good(&base->base) && base->stream)
3685 basic_ostream_char_flush(base->stream);
3687 return ios_base_good(&base->base);
3690 static void basic_ostream_char_sentry_destroy(basic_ostream_char *ostr)
3692 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
3694 if(ios_base_good(&base->base) && !__uncaught_exception())
3695 basic_ostream_char_osfx(ostr);
3697 if(basic_ios_char_rdbuf_get(base))
3698 basic_streambuf_char__Unlock(base->strbuf);
3701 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
3702 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
3703 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
3704 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
3706 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3708 TRACE("(%p)\n", this);
3710 if(ios_base_good(&base->base) && base->stream)
3711 basic_ostream_char_flush(base->stream);
3712 return ios_base_good(&base->base);
3715 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
3716 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
3717 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
3718 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
3720 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3722 TRACE("(%p %c)\n", this, ch);
3724 if(!basic_ostream_char_sentry_create(this)
3725 || basic_streambuf_char_sputc(base->strbuf, ch)==EOF) {
3726 basic_ostream_char_sentry_destroy(this);
3727 basic_ios_char_setstate(base, IOSTATE_badbit);
3731 basic_ostream_char_sentry_destroy(this);
3735 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
3736 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
3737 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
3738 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
3740 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3742 TRACE("(%p %ld %d)\n", this, off, way);
3744 if(!ios_base_fail(&base->base)) {
3747 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
3748 &seek, off, way, OPENMODE_out);
3749 if(seek.off==0 && seek.pos==-1 && seek.state==0)
3750 basic_ios_char_setstate(base, IOSTATE_failbit);
3755 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
3756 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
3757 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
3758 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
3760 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3762 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
3764 if(!ios_base_fail(&base->base)) {
3767 basic_streambuf_char_pubseekpos(basic_ios_char_rdbuf_get(base),
3768 &seek, pos, OPENMODE_out);
3769 if(seek.off==0 && seek.pos==-1 && seek.state==0)
3770 basic_ios_char_setstate(base, IOSTATE_failbit);
3775 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
3776 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
3777 DEFINE_THISCALL_WRAPPER(basic_ostream_char_tellp, 8)
3778 fpos_int* __thiscall basic_ostream_char_tellp(basic_ostream_char *this, fpos_int *ret)
3780 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3782 TRACE("(%p)\n", this);
3784 if(!ios_base_fail(&base->base)) {
3785 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
3786 ret, 0, SEEKDIR_cur, OPENMODE_out);
3795 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
3796 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
3797 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
3798 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
3800 basic_ios_char *base = basic_ostream_char_get_basic_ios(this);
3802 TRACE("(%p %s %ld)\n", this, debugstr_a(str), count);
3804 if(!basic_ostream_char_sentry_create(this)
3805 || basic_streambuf_char_sputn(base->strbuf, str, count)!=count) {
3806 basic_ostream_char_sentry_destroy(this);
3807 basic_ios_char_setstate(base, IOSTATE_badbit);
3811 basic_ostream_char_sentry_destroy(this);
3815 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
3816 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
3817 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
3818 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
3820 FIXME("(%p %d) stub\n", this, val);
3824 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
3825 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
3826 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
3827 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
3829 FIXME("(%p %d) stub\n", this, val);
3833 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
3834 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
3835 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
3836 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
3838 FIXME("(%p %d) stub\n", this, val);
3842 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
3843 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
3844 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
3845 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
3847 FIXME("(%p %d) stub\n", this, val);
3851 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
3852 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
3853 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_long, 8)
3854 basic_ostream_char* __thiscall basic_ostream_char_print_long(basic_ostream_char *this, LONG val)
3856 FIXME("(%p %d) stub\n", this, val);
3860 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
3861 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
3862 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ulong, 8)
3863 basic_ostream_char* __thiscall basic_ostream_char_print_ulong(basic_ostream_char *this, ULONG val)
3865 FIXME("(%p %d) stub\n", this, val);
3869 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
3870 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
3871 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
3872 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
3874 FIXME("(%p %f) stub\n", this, val);
3878 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
3879 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
3880 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
3881 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
3883 FIXME("(%p %lf) stub\n", this, val);
3887 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
3888 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
3889 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
3890 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
3892 FIXME("(%p %p) stub\n", this, val);
3896 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
3897 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
3898 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
3899 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
3901 FIXME("(%p %p) stub\n", this, val);
3905 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
3906 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
3907 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
3908 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
3910 FIXME("(%p) stub\n", this);
3914 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
3915 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
3916 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
3917 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
3919 FIXME("(%p) stub\n", this);
3923 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
3924 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
3925 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
3926 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
3928 FIXME("(%p %x) stub\n", this, val);
3932 /* ?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z */
3933 /* ?endl@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@1@AEAV21@@Z */
3934 basic_ostream_char* __cdecl basic_ostream_char_endl(basic_ostream_char *ostr)
3936 TRACE("(%p)\n", ostr);
3938 basic_ostream_char_put(ostr, '\n');
3939 basic_ostream_char_flush(ostr);
3943 /* $?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 */
3944 /* ??$?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 */
3945 basic_ostream_char* __cdecl basic_ostream_char_print_bstr(basic_ostream_char *ostr, const basic_string_char *str)
3947 basic_ios_char *base = basic_ostream_char_get_basic_ios(ostr);
3948 IOSB_iostate state = IOSTATE_goodbit;
3950 TRACE("(%p %p)\n", ostr, str);
3952 if(basic_ostream_char_sentry_create(ostr)) {
3953 MSVCP_size_t len = MSVCP_basic_string_char_length(str);
3954 streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
3956 if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
3957 for(; pad!=0; pad--) {
3958 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
3959 state = IOSTATE_badbit;
3965 if(state == IOSTATE_goodbit) {
3966 if(basic_streambuf_char_sputn(base->strbuf, MSVCP_basic_string_char_c_str(str), len) != len)
3967 state = IOSTATE_badbit;
3970 for(; pad!=0; pad--) {
3971 if(basic_streambuf_char_sputc(base->strbuf, base->fillch) == EOF) {
3972 state = IOSTATE_badbit;
3977 base->base.wide = 0;
3979 state = IOSTATE_badbit;
3981 basic_ostream_char_sentry_destroy(ostr);
3983 basic_ios_char_setstate(base, state);
3987 /* Caution: basic_istream uses virtual inheritance. */
3988 static inline basic_ios_char* basic_istream_char_get_basic_ios(basic_istream_char *this)
3990 return (basic_ios_char*)((char*)this+this->vbtable[1]);
3993 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
3994 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N1@Z */
3995 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_init, 20)
3996 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)
3998 basic_ios_char *base;
4000 TRACE("(%p %p %d %d %d)\n", this, strbuf, isstd, noinit, virt_init);
4003 this->vbtable = basic_istream_char_vbtable;
4004 base = basic_istream_char_get_basic_ios(this);
4005 basic_ios_char_ctor(base);
4007 base = basic_istream_char_get_basic_ios(this);
4010 base->base.vtable = &MSVCP_basic_istream_char_vtable;
4013 basic_ios_char_init(base, strbuf, isstd);
4017 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
4018 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
4019 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor, 16)
4020 basic_istream_char* __thiscall basic_istream_char_ctor(basic_istream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd, MSVCP_bool virt_init)
4022 return basic_istream_char_ctor_init(this, strbuf, isstd, FALSE, virt_init);
4025 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@@Z */
4026 /* ??0?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@@Z */
4027 DEFINE_THISCALL_WRAPPER(basic_istream_char_ctor_uninitialized, 12)
4028 basic_istream_char* __thiscall basic_istream_char_ctor_uninitialized(basic_istream_char *this, int uninitialized, MSVCP_bool virt_init)
4030 basic_ios_char *base;
4032 TRACE("(%p %d %d)\n", this, uninitialized, virt_init);
4035 this->vbtable = basic_istream_char_vbtable;
4036 base = basic_istream_char_get_basic_ios(this);
4037 basic_ios_char_ctor(base);
4039 base = basic_istream_char_get_basic_ios(this);
4042 base->base.vtable = &MSVCP_basic_istream_char_vtable;
4043 ios_base_Addstd(&base->base);
4047 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UAE@XZ */
4048 /* ??1?$basic_istream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
4049 DEFINE_THISCALL_WRAPPER(basic_istream_char_dtor, 4)
4050 void __thiscall basic_istream_char_dtor(basic_istream_char *this)
4052 /* don't destroy virtual base here */
4053 TRACE("(%p)\n", this);
4056 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
4057 /* ??_D?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
4058 DEFINE_THISCALL_WRAPPER(basic_istream_char_vbase_dtor, 4)
4059 void __thiscall basic_istream_char_vbase_dtor(basic_istream_char *this)
4061 TRACE("(%p)\n", this);
4062 basic_istream_char_dtor(this);
4063 basic_ios_char_dtor(basic_istream_char_get_basic_ios(this));
4066 DEFINE_THISCALL_WRAPPER(MSVCP_basic_istream_char_vector_dtor, 8)
4067 basic_istream_char* __thiscall MSVCP_basic_istream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
4069 basic_istream_char *this = (basic_istream_char *)((char*)base - basic_istream_char_vbtable[1] + basic_istream_char_vbtable[0]);
4071 TRACE("(%p %x)\n", this, flags);
4074 /* we have an array, with the number of elements stored before the first object */
4075 int i, *ptr = (int *)this-1;
4077 for(i=*ptr-1; i>=0; i--)
4078 basic_istream_char_vbase_dtor(this+i);
4079 MSVCRT_operator_delete(ptr);
4081 basic_istream_char_vbase_dtor(this);
4083 MSVCRT_operator_delete(this);
4089 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
4090 /* ?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
4091 DEFINE_THISCALL_WRAPPER(basic_istream_char__Ipfx, 8)
4092 MSVCP_bool __thiscall basic_istream_char__Ipfx(basic_istream_char *this, MSVCP_bool noskip)
4094 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4096 TRACE("(%p %d)\n", this, noskip);
4098 if(!ios_base_good(&base->base)) {
4099 basic_ios_char_setstate(base, IOSTATE_failbit);
4103 if(basic_ios_char_tie_get(base))
4104 basic_ostream_char_flush(basic_ios_char_tie_get(base));
4106 if(!noskip && (ios_base_flags_get(&base->base) & FMTFLAG_skipws)) {
4107 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4108 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
4111 for(ch = basic_streambuf_char_sgetc(strbuf); ;
4112 ch = basic_streambuf_char_snextc(strbuf)) {
4114 basic_ios_char_setstate(base, IOSTATE_eofbit);
4118 if(!ctype_char_is_ch(ctype, _SPACE|_BLANK, ch))
4126 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE_N_N@Z */
4127 /* ?ipfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_N_N@Z */
4128 DEFINE_THISCALL_WRAPPER(basic_istream_char_ipfx, 8)
4129 MSVCP_bool __thiscall basic_istream_char_ipfx(basic_istream_char *this, MSVCP_bool noskip)
4131 return basic_istream_char__Ipfx(this, noskip);
4134 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEXXZ */
4135 /* ?isfx@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
4136 DEFINE_THISCALL_WRAPPER(basic_istream_char_isfx, 4)
4137 void __thiscall basic_istream_char_isfx(basic_istream_char *this)
4139 TRACE("(%p)\n", this);
4142 static BOOL basic_istream_char_sentry_create(basic_istream_char *istr, MSVCP_bool noskip)
4144 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
4146 if(basic_ios_char_rdbuf_get(base))
4147 basic_streambuf_char__Lock(base->strbuf);
4149 return basic_istream_char_ipfx(istr, noskip);
4152 static void basic_istream_char_sentry_destroy(basic_istream_char *istr)
4154 basic_ios_char *base = basic_istream_char_get_basic_ios(istr);
4156 if(basic_ios_char_rdbuf_get(base))
4157 basic_streambuf_char__Unlock(base->strbuf);
4160 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QBEHXZ */
4161 /* ?gcount@?$basic_istream@DU?$char_traits@D@std@@@std@@QEBA_JXZ */
4162 DEFINE_THISCALL_WRAPPER(basic_istream_char_gcount, 4)
4163 int __thiscall basic_istream_char_gcount(const basic_istream_char *this)
4165 TRACE("(%p)\n", this);
4169 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
4170 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
4171 DEFINE_THISCALL_WRAPPER(basic_istream_char_get, 4)
4172 int __thiscall basic_istream_char_get(basic_istream_char *this)
4174 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4177 TRACE("(%p)\n", this);
4181 if(!basic_istream_char_sentry_create(this, TRUE)) {
4182 basic_istream_char_sentry_destroy(this);
4186 ret = basic_streambuf_char_sbumpc(basic_ios_char_rdbuf_get(base));
4187 basic_istream_char_sentry_destroy(this);
4189 basic_ios_char_setstate(base, IOSTATE_eofbit|IOSTATE_failbit);
4196 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAD@Z */
4197 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAD@Z */
4198 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_ch, 8)
4199 basic_istream_char* __thiscall basic_istream_char_get_ch(basic_istream_char *this, char *ch)
4203 TRACE("(%p %p)\n", this, ch);
4205 ret = basic_istream_char_get(this);
4211 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
4212 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
4213 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str_delim, 16)
4214 basic_istream_char* __thiscall basic_istream_char_get_str_delim(basic_istream_char *this, char *str, streamsize count, char delim)
4216 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4219 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
4223 if(basic_istream_char_sentry_create(this, TRUE)) {
4224 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4226 for(ch = basic_streambuf_char_sgetc(strbuf); count>1;
4227 ch = basic_streambuf_char_snextc(strbuf)) {
4228 if(ch==EOF || ch==delim)
4236 basic_istream_char_sentry_destroy(this);
4238 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
4239 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
4245 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
4246 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
4247 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_str, 12)
4248 basic_istream_char* __thiscall basic_istream_char_get_str(basic_istream_char *this, char *str, streamsize count)
4250 return basic_istream_char_get_str_delim(this, str, count, '\n');
4253 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
4254 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@D@Z */
4255 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf_delim, 12)
4256 basic_istream_char* __thiscall basic_istream_char_get_streambuf_delim(basic_istream_char *this, basic_streambuf_char *strbuf, char delim)
4258 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4261 TRACE("(%p %p %c)\n", this, strbuf, delim);
4265 if(basic_istream_char_sentry_create(this, TRUE)) {
4266 basic_streambuf_char *strbuf_read = basic_ios_char_rdbuf_get(base);
4268 for(ch = basic_streambuf_char_sgetc(strbuf_read); ;
4269 ch = basic_streambuf_char_snextc(strbuf_read)) {
4270 if(ch==EOF || ch==delim)
4273 if(basic_streambuf_char_sputc(strbuf, ch) == EOF)
4278 basic_istream_char_sentry_destroy(this);
4280 basic_ios_char_setstate(base, (!this->count ? IOSTATE_failbit : IOSTATE_goodbit) |
4281 (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
4285 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@AAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
4286 /* ?get@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@@Z */
4287 DEFINE_THISCALL_WRAPPER(basic_istream_char_get_streambuf, 8)
4288 basic_istream_char* __thiscall basic_istream_char_get_streambuf(basic_istream_char *this, basic_streambuf_char *strbuf)
4290 return basic_istream_char_get_streambuf_delim(this, strbuf, '\n');
4293 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADHD@Z */
4294 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_JD@Z */
4295 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline_delim, 16)
4296 basic_istream_char* __thiscall basic_istream_char_getline_delim(basic_istream_char *this, char *str, streamsize count, char delim)
4298 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4301 TRACE("(%p %p %ld %c)\n", this, str, count, delim);
4305 if(basic_istream_char_sentry_create(this, TRUE) && count>0) {
4306 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4309 ch = basic_streambuf_char_sbumpc(strbuf);
4311 if(ch==EOF || ch==delim)
4321 else if(ch != EOF) {
4322 ch = basic_streambuf_char_sgetc(strbuf);
4325 basic_streambuf_char__Gninc(strbuf);
4330 basic_istream_char_sentry_destroy(this);
4332 basic_ios_char_setstate(base, (ch==EOF ? IOSTATE_eofbit : IOSTATE_goodbit) |
4333 (!this->count || (ch!=delim && ch!=EOF) ? IOSTATE_failbit : IOSTATE_goodbit));
4339 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
4340 /* ?getline@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
4341 DEFINE_THISCALL_WRAPPER(basic_istream_char_getline, 12)
4342 basic_istream_char* __thiscall basic_istream_char_getline(basic_istream_char *this, char *str, streamsize count)
4344 return basic_istream_char_getline_delim(this, str, count, '\n');
4347 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@HH@Z */
4348 /* ?ignore@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
4349 DEFINE_THISCALL_WRAPPER(basic_istream_char_ignore, 12)
4350 basic_istream_char* __thiscall basic_istream_char_ignore(basic_istream_char *this, streamsize count, int delim)
4352 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4355 TRACE("(%p %ld %d)\n", this, count, delim);
4359 if(basic_istream_char_sentry_create(this, TRUE)) {
4360 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4363 ch = basic_streambuf_char_sbumpc(strbuf);
4365 if(ch==EOF || ch==delim)
4369 if(count != INT_MAX)
4373 basic_istream_char_sentry_destroy(this);
4376 basic_ios_char_setstate(base, IOSTATE_eofbit);
4380 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
4381 /* ?peek@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
4382 DEFINE_THISCALL_WRAPPER(basic_istream_char_peek, 4)
4383 int __thiscall basic_istream_char_peek(basic_istream_char *this)
4385 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4388 TRACE("(%p)\n", this);
4392 if(basic_istream_char_sentry_create(this, TRUE))
4393 ret = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
4394 basic_istream_char_sentry_destroy(this);
4398 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z */
4399 /* ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z */
4400 DEFINE_THISCALL_WRAPPER(basic_istream_char__Read_s, 16)
4401 basic_istream_char* __thiscall basic_istream_char__Read_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
4403 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4404 IOSB_iostate state = IOSTATE_goodbit;
4406 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
4408 if(basic_istream_char_sentry_create(this, TRUE)) {
4409 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4411 this->count = basic_streambuf_char__Sgetn_s(strbuf, str, size, count);
4412 if(this->count != count)
4413 state |= IOSTATE_failbit | IOSTATE_eofbit;
4417 basic_istream_char_sentry_destroy(this);
4419 basic_ios_char_setstate(base, state);
4423 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADH@Z */
4424 /* ?read@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_J@Z */
4425 DEFINE_THISCALL_WRAPPER(basic_istream_char_read, 12)
4426 basic_istream_char* __thiscall basic_istream_char_read(basic_istream_char *this, char *str, streamsize count)
4428 return basic_istream_char__Read_s(this, str, count, count);
4431 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
4432 /* ?_Readsome_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
4433 DEFINE_THISCALL_WRAPPER(basic_istream_char__Readsome_s, 16)
4434 streamsize __thiscall basic_istream_char__Readsome_s(basic_istream_char *this, char *str, MSVCP_size_t size, streamsize count)
4436 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4437 IOSB_iostate state = IOSTATE_goodbit;
4439 TRACE("(%p %p %lu %ld)\n", this, str, size, count);
4443 if(basic_istream_char_sentry_create(this, TRUE)) {
4444 streamsize avail = basic_streambuf_char_in_avail(basic_ios_char_rdbuf_get(base));
4449 state |= IOSTATE_eofbit;
4451 basic_istream_char__Read_s(this, str, size, avail);
4453 state |= IOSTATE_failbit;
4455 basic_istream_char_sentry_destroy(this);
4457 basic_ios_char_setstate(base, state);
4461 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
4462 /* ?readsome@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
4463 DEFINE_THISCALL_WRAPPER(basic_istream_char_readsome, 12)
4464 streamsize __thiscall basic_istream_char_readsome(basic_istream_char *this, char *str, streamsize count)
4466 return basic_istream_char__Readsome_s(this, str, count, count);
4469 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
4470 /* ?putback@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
4471 DEFINE_THISCALL_WRAPPER(basic_istream_char_putback, 8)
4472 basic_istream_char* __thiscall basic_istream_char_putback(basic_istream_char *this, char ch)
4474 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4475 IOSB_iostate state = IOSTATE_goodbit;
4477 TRACE("(%p %c)\n", this, ch);
4481 if(basic_istream_char_sentry_create(this, TRUE)) {
4482 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4484 if(!ios_base_good(&base->base))
4485 state |= IOSTATE_failbit;
4486 else if(!strbuf || basic_streambuf_char_sputbackc(strbuf, ch)==EOF)
4487 state |= IOSTATE_badbit;
4489 basic_istream_char_sentry_destroy(this);
4491 basic_ios_char_setstate(base, state);
4495 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
4496 /* ?unget@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
4497 DEFINE_THISCALL_WRAPPER(basic_istream_char_unget, 4)
4498 basic_istream_char* __thiscall basic_istream_char_unget(basic_istream_char *this)
4500 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4501 IOSB_iostate state = IOSTATE_goodbit;
4503 TRACE("(%p)\n", this);
4507 if(basic_istream_char_sentry_create(this, TRUE)) {
4508 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4510 if(!ios_base_good(&base->base))
4511 state |= IOSTATE_failbit;
4512 else if(!strbuf || basic_streambuf_char_sungetc(strbuf)==EOF)
4513 state |= IOSTATE_badbit;
4515 basic_istream_char_sentry_destroy(this);
4517 basic_ios_char_setstate(base, state);
4521 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEHXZ */
4522 /* ?sync@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAHXZ */
4523 DEFINE_THISCALL_WRAPPER(basic_istream_char_sync, 4)
4524 int __thiscall basic_istream_char_sync(basic_istream_char *this)
4526 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4527 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4529 TRACE("(%p)\n", this);
4534 if(basic_istream_char_sentry_create(this, TRUE)) {
4535 if(basic_streambuf_char_pubsync(strbuf) != -1) {
4536 basic_istream_char_sentry_destroy(this);
4540 basic_istream_char_sentry_destroy(this);
4542 basic_ios_char_setstate(base, IOSTATE_badbit);
4546 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
4547 /* ?tellg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
4548 DEFINE_THISCALL_WRAPPER(basic_istream_char_tellg, 8)
4549 fpos_int* __thiscall basic_istream_char_tellg(basic_istream_char *this, fpos_int *ret)
4551 TRACE("(%p %p)\n", this, ret);
4553 if(basic_istream_char_sentry_create(this, TRUE)) {
4554 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4555 if(!ios_base_fail(&base->base)) {
4556 basic_streambuf_char_pubseekoff(basic_ios_char_rdbuf_get(base),
4557 ret, 0, SEEKDIR_cur, OPENMODE_in);
4558 basic_istream_char_sentry_destroy(this);
4560 if(ret->off==0 && ret->pos==-1 && ret->state==0)
4561 basic_ios_char_setstate(base, IOSTATE_failbit);
4565 basic_istream_char_sentry_destroy(this);
4573 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
4574 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
4575 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg, 12)
4576 basic_istream_char* __thiscall basic_istream_char_seekg(basic_istream_char *this, streamoff off, int dir)
4578 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4580 TRACE("(%p %ld %d)\n", this, off, dir);
4582 if(basic_istream_char_sentry_create(this, TRUE)) {
4583 if(!ios_base_fail(&base->base)) {
4584 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4587 basic_streambuf_char_pubseekoff(strbuf, &ret, off, dir, OPENMODE_in);
4588 basic_istream_char_sentry_destroy(this);
4590 if(ret.off==0 && ret.pos==-1 && ret.state==0)
4591 basic_ios_char_setstate(base, IOSTATE_failbit);
4593 basic_ios_char_clear(base, IOSTATE_goodbit);
4597 basic_istream_char_sentry_destroy(this);
4599 basic_ios_char_setstate(base, IOSTATE_failbit);
4603 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
4604 /* ?seekg@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
4605 DEFINE_THISCALL_WRAPPER(basic_istream_char_seekg_fpos, 28)
4606 basic_istream_char* __thiscall basic_istream_char_seekg_fpos(basic_istream_char *this, fpos_int pos)
4608 basic_ios_char *base = basic_istream_char_get_basic_ios(this);
4610 TRACE("(%p %s)\n", this, debugstr_fpos_int(&pos));
4612 if(basic_istream_char_sentry_create(this, TRUE)) {
4613 if(!ios_base_fail(&base->base)) {
4614 basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base);
4617 basic_streambuf_char_pubseekpos(strbuf, &ret, pos, OPENMODE_in);
4618 basic_istream_char_sentry_destroy(this);
4620 if(ret.off==0 && ret.pos==-1 && ret.state==0)
4621 basic_ios_char_setstate(base, IOSTATE_failbit);
4623 basic_ios_char_clear(base, IOSTATE_goodbit);
4627 basic_istream_char_sentry_destroy(this);
4629 basic_ios_char_setstate(base, IOSTATE_failbit);
4633 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAF@Z */
4634 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAF@Z */
4635 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_short, 8)
4636 basic_istream_char* __thiscall basic_istream_char_read_short(basic_istream_char *this, short *arg1)
4638 FIXME("(%p %p) stub\n", this, arg1);
4642 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAG@Z */
4643 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAG@Z */
4644 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ushort, 8)
4645 basic_istream_char* __thiscall basic_istream_char_read_ushort(basic_istream_char *this, unsigned short *arg1)
4647 FIXME("(%p %p) stub\n", this, arg1);
4651 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAH@Z */
4652 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAH@Z */
4653 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int, 8)
4654 basic_istream_char* __thiscall basic_istream_char_read_int(basic_istream_char *this, int *arg1)
4656 FIXME("(%p %p) stub\n", this, arg1);
4660 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAI@Z */
4661 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAI@Z */
4662 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint, 8)
4663 basic_istream_char* __thiscall basic_istream_char_read_uint(basic_istream_char *this, unsigned int *arg1)
4665 FIXME("(%p %p) stub\n", this, arg1);
4669 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAJ@Z */
4670 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAJ@Z */
4671 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_long, 8)
4672 basic_istream_char* __thiscall basic_istream_char_read_long(basic_istream_char *this, LONG *arg1)
4674 FIXME("(%p %p) stub\n", this, arg1);
4678 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAK@Z */
4679 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAK@Z */
4680 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ulong, 8)
4681 basic_istream_char* __thiscall basic_istream_char_read_ulong(basic_istream_char *this, ULONG *arg1)
4683 FIXME("(%p %p) stub\n", this, arg1);
4687 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAM@Z */
4688 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAM@Z */
4689 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_float, 8)
4690 basic_istream_char* __thiscall basic_istream_char_read_float(basic_istream_char *this, float *arg1)
4692 FIXME("(%p %p) stub\n", this, arg1);
4696 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAN@Z */
4697 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAN@Z */
4698 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_double, 8)
4699 basic_istream_char* __thiscall basic_istream_char_read_double(basic_istream_char *this, double *arg1)
4701 FIXME("(%p %p) stub\n", this, arg1);
4705 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAO@Z */
4706 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAO@Z */
4707 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ldouble, 8)
4708 basic_istream_char* __thiscall basic_istream_char_read_ldouble(basic_istream_char *this, long double *arg1)
4710 FIXME("(%p %p) stub\n", this, arg1);
4714 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AAPAX@Z */
4715 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEAPEAX@Z */
4716 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_ptr, 8)
4717 basic_istream_char* __thiscall basic_istream_char_read_ptr(basic_istream_char *this, void **arg1)
4719 FIXME("(%p %p) stub\n", this, arg1);
4723 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_J@Z */
4724 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_J@Z */
4725 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_int64, 8)
4726 basic_istream_char* __thiscall basic_istream_char_read_int64(basic_istream_char *this, __int64 *arg1)
4728 FIXME("(%p %p) stub\n", this, arg1);
4732 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_K@Z */
4733 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_K@Z */
4734 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_uint64, 8)
4735 basic_istream_char* __thiscall basic_istream_char_read_uint64(basic_istream_char *this, unsigned __int64 *arg1)
4737 FIXME("(%p %p) stub\n", this, arg1);
4741 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV01@AA_N@Z */
4742 /* ??5?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@AEA_N@Z */
4743 DEFINE_THISCALL_WRAPPER(basic_istream_char_read_bool, 8)
4744 basic_istream_char* __thiscall basic_istream_char_read_bool(basic_istream_char *this, MSVCP_bool *arg1)
4746 FIXME("(%p %p) stub\n", this, arg1);
4750 /* ??$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 */
4751 /* ??$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 */
4752 basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim(
4753 basic_istream_char *istream, basic_string_char *str, char delim)
4755 IOSB_iostate state = IOSTATE_failbit;
4758 TRACE("(%p %p %c)\n", istream, str, delim);
4760 if(basic_istream_char_sentry_create(istream, TRUE)) {
4761 MSVCP_basic_string_char_clear(str);
4763 for(c = basic_istream_char_get(istream); c!=delim && c!=EOF;
4764 c = basic_istream_char_get(istream)) {
4765 state = IOSTATE_goodbit;
4766 MSVCP_basic_string_char_append_ch(str, c);
4769 basic_istream_char_sentry_destroy(istream);
4771 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
4772 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
4776 /* ??$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 */
4777 /* ??$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 */
4778 basic_istream_char* __cdecl basic_istream_char_getline_bstr(
4779 basic_istream_char *istream, basic_string_char *str)
4781 return basic_istream_char_getline_bstr_delim(istream, str, '\n');
4784 /* ??$?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 */
4785 /* ??$?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 */
4786 basic_istream_char* __cdecl basic_istream_char_get_bstr(
4787 basic_istream_char *istream, basic_string_char *str)
4789 IOSB_iostate state = IOSTATE_failbit;
4792 TRACE("(%p %p)\n", istream, str);
4794 if(basic_istream_char_sentry_create(istream, FALSE)) {
4795 basic_ios_char *base = basic_istream_char_get_basic_ios(istream);
4796 const ctype_char *ctype = ctype_char_use_facet(base->strbuf->loc);
4798 MSVCP_basic_string_char_clear(str);
4800 for(c = basic_streambuf_char_sgetc(basic_ios_char_rdbuf_get(base));
4801 c!=EOF && !ctype_char_is_ch(ctype, _SPACE|_BLANK, c);
4802 c = basic_streambuf_char_snextc(basic_ios_char_rdbuf_get(base))) {
4803 state = IOSTATE_goodbit;
4804 MSVCP_basic_string_char_append_ch(str, c);
4807 basic_istream_char_sentry_destroy(istream);
4809 basic_ios_char_setstate(basic_istream_char_get_basic_ios(istream),
4810 state | (c==EOF ? IOSTATE_eofbit : IOSTATE_goodbit));
4814 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4815 /* ??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
4816 DEFINE_THISCALL_WRAPPER(basic_iostream_char_ctor, 12)
4817 basic_iostream_char* __thiscall basic_iostream_char_ctor(basic_iostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool virt_init)
4819 basic_ios_char *basic_ios;
4821 TRACE("(%p %p %d)\n", this, strbuf, virt_init);
4824 this->base1.vbtable = basic_iostream_char_vbtable1;
4825 this->base2.vbtable = basic_iostream_char_vbtable2;
4826 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
4827 basic_ios_char_ctor(basic_ios);
4829 basic_ios = basic_istream_char_get_basic_ios(&this->base1);
4832 basic_ios->base.vtable = &MSVCP_basic_iostream_char_vtable;
4834 basic_istream_char_ctor(&this->base1, strbuf, FALSE, FALSE);
4835 basic_ostream_char_ctor_uninitialized(&this->base2, 0, FALSE, FALSE);
4839 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
4840 /* ??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
4841 DEFINE_THISCALL_WRAPPER(basic_iostream_char_dtor, 4)
4842 void __thiscall basic_iostream_char_dtor(basic_iostream_char *this)
4844 TRACE("(%p)\n", this);
4845 basic_ostream_char_dtor(&this->base2);
4846 basic_istream_char_dtor(&this->base1);
4849 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
4850 /* ??_D?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
4851 DEFINE_THISCALL_WRAPPER(basic_iostream_char_vbase_dtor, 4)
4852 void __thiscall basic_iostream_char_vbase_dtor(basic_iostream_char *this)
4854 TRACE("(%p)\n", this);
4855 basic_iostream_char_dtor(this);
4856 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base1));
4859 DEFINE_THISCALL_WRAPPER(MSVCP_basic_iostream_char_vector_dtor, 8)
4860 basic_iostream_char* __thiscall MSVCP_basic_iostream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
4862 basic_iostream_char *this = (basic_iostream_char *)((char*)base - basic_iostream_char_vbtable1[1] + basic_iostream_char_vbtable1[0]);
4864 TRACE("(%p %x)\n", this, flags);
4867 /* we have an array, with the number of elements stored before the first object */
4868 int i, *ptr = (int *)this-1;
4870 for(i=*ptr-1; i>=0; i--)
4871 basic_iostream_char_vbase_dtor(this+i);
4872 MSVCRT_operator_delete(ptr);
4874 basic_iostream_char_vbase_dtor(this);
4876 MSVCRT_operator_delete(this);
4882 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
4883 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
4884 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor, 8)
4885 basic_ofstream_char* __thiscall basic_ofstream_char_ctor(basic_ofstream_char *this, MSVCP_bool virt_init)
4887 basic_ios_char *basic_ios;
4889 TRACE("(%p %d)\n", this, virt_init);
4892 this->base.vbtable = basic_ofstream_char_vbtable;
4893 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
4894 basic_ios_char_ctor(basic_ios);
4896 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
4899 basic_filebuf_char_ctor(&this->filebuf);
4900 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
4901 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
4905 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
4906 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
4907 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_file, 12)
4908 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_file(
4909 basic_ofstream_char *this, FILE *file, MSVCP_bool virt_init)
4911 basic_ios_char *basic_ios;
4913 TRACE("(%p %p %d)\n", this, file, virt_init);
4916 this->base.vbtable = basic_ofstream_char_vbtable;
4917 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
4918 basic_ios_char_ctor(basic_ios);
4920 basic_ios = basic_ostream_char_get_basic_ios(&this->base);
4923 basic_filebuf_char_ctor_file(&this->filebuf, file);
4924 basic_ostream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
4925 basic_ios->base.vtable = &MSVCP_basic_ofstream_char_vtable;
4929 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
4930 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
4931 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name, 20)
4932 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name(basic_ofstream_char *this,
4933 const char *name, int mode, int prot, MSVCP_bool virt_init)
4935 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
4937 basic_ofstream_char_ctor(this, virt_init);
4939 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
4940 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
4941 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
4946 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
4947 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
4948 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
4949 /* ??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
4950 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_ctor_name_wchar, 20)
4951 basic_ofstream_char* __thiscall basic_ofstream_char_ctor_name_wchar(basic_ofstream_char *this,
4952 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
4954 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
4956 basic_ofstream_char_ctor(this, virt_init);
4958 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
4959 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
4960 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
4965 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
4966 /* ??1?$basic_ofstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
4967 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_dtor, 4)
4968 void __thiscall basic_ofstream_char_dtor(basic_ofstream_char *this)
4970 TRACE("(%p)\n", this);
4972 basic_ostream_char_dtor(&this->base);
4973 basic_filebuf_char_dtor(&this->filebuf);
4976 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
4977 /* ??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
4978 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_vbase_dtor, 4)
4979 void __thiscall basic_ofstream_char_vbase_dtor(basic_ofstream_char *this)
4981 TRACE("(%p)\n", this);
4983 basic_ofstream_char_dtor(this);
4984 basic_ios_char_dtor(basic_ostream_char_get_basic_ios(&this->base));
4987 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ofstream_char_vector_dtor, 8)
4988 basic_ofstream_char* __thiscall MSVCP_basic_ofstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
4990 basic_ofstream_char *this = (basic_ofstream_char *)((char*)base - basic_ofstream_char_vbtable[1] + basic_ofstream_char_vbtable[0]);
4992 TRACE("(%p %x)\n", this, flags);
4995 /* we have an array, with the number of elements stored before the first object */
4996 int i, *ptr = (int *)this-1;
4998 for(i=*ptr-1; i>=0; i--)
4999 basic_ofstream_char_vbase_dtor(this+i);
5000 MSVCRT_operator_delete(ptr);
5002 basic_ofstream_char_vbase_dtor(this);
5004 MSVCRT_operator_delete(this);
5010 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5011 /* ?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5012 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_close, 4)
5013 void __thiscall basic_ofstream_char_close(basic_ofstream_char *this)
5015 TRACE("(%p)\n", this);
5017 if(!basic_filebuf_char_close(&this->filebuf)) {
5018 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
5019 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5023 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
5024 /* ?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
5025 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_is_open, 4)
5026 MSVCP_bool __thiscall basic_ofstream_char_is_open(const basic_ofstream_char *this)
5028 TRACE("(%p)\n", this);
5029 return basic_filebuf_char_is_open(&this->filebuf);
5032 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
5033 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
5034 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open, 16)
5035 void __thiscall basic_ofstream_char_open(basic_ofstream_char *this,
5036 const char *name, int mode, int prot)
5038 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
5040 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_out, prot)) {
5041 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
5042 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5046 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
5047 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
5048 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_old, 12)
5049 void __thiscall basic_ofstream_char_open_old(basic_ofstream_char *this,
5050 const char *name, unsigned int mode)
5052 basic_ofstream_char_open(this, name, mode, _SH_DENYNO);
5055 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
5056 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
5057 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
5058 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
5059 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar, 16)
5060 void __thiscall basic_ofstream_char_open_wchar(basic_ofstream_char *this,
5061 const wchar_t *name, int mode, int prot)
5063 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
5065 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_out, prot)) {
5066 basic_ios_char *basic_ios = basic_ostream_char_get_basic_ios(&this->base);
5067 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5071 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
5072 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
5073 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
5074 /* ?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
5075 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_open_wchar_old, 12)
5076 void __thiscall basic_ofstream_char_open_wchar_old(basic_ofstream_char *this,
5077 const wchar_t *name, unsigned int mode)
5079 basic_ofstream_char_open_wchar(this, name, mode, _SH_DENYNO);
5082 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
5083 /* ?rdbuf@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
5084 DEFINE_THISCALL_WRAPPER(basic_ofstream_char_rdbuf, 4)
5085 basic_filebuf_char* __thiscall basic_ofstream_char_rdbuf(const basic_ofstream_char *this)
5087 TRACE("(%p)\n", this);
5088 return (basic_filebuf_char*)&this->filebuf;
5091 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
5092 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
5093 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor, 8)
5094 basic_ifstream_char* __thiscall basic_ifstream_char_ctor(basic_ifstream_char *this, MSVCP_bool virt_init)
5096 basic_ios_char *basic_ios;
5098 TRACE("(%p %d)\n", this, virt_init);
5101 this->base.vbtable = basic_ifstream_char_vbtable;
5102 basic_ios = basic_istream_char_get_basic_ios(&this->base);
5103 basic_ios_char_ctor(basic_ios);
5105 basic_ios = basic_istream_char_get_basic_ios(&this->base);
5108 basic_filebuf_char_ctor(&this->filebuf);
5109 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
5110 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
5114 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
5115 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
5116 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_file, 12)
5117 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_file(
5118 basic_ifstream_char *this, FILE *file, MSVCP_bool virt_init)
5120 basic_ios_char *basic_ios;
5122 TRACE("(%p %p %d)\n", this, file, virt_init);
5125 this->base.vbtable = basic_ifstream_char_vbtable;
5126 basic_ios = basic_istream_char_get_basic_ios(&this->base);
5127 basic_ios_char_ctor(basic_ios);
5129 basic_ios = basic_istream_char_get_basic_ios(&this->base);
5132 basic_filebuf_char_ctor_file(&this->filebuf, file);
5133 basic_istream_char_ctor(&this->base, &this->filebuf.base, FALSE, FALSE);
5134 basic_ios->base.vtable = &MSVCP_basic_ifstream_char_vtable;
5138 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
5139 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
5140 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name, 20)
5141 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name(basic_ifstream_char *this,
5142 const char *name, int mode, int prot, MSVCP_bool virt_init)
5144 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
5146 basic_ifstream_char_ctor(this, virt_init);
5148 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
5149 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
5150 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5155 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
5156 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
5157 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
5158 /* ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
5159 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_ctor_name_wchar, 20)
5160 basic_ifstream_char* __thiscall basic_ifstream_char_ctor_name_wchar(basic_ifstream_char *this,
5161 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
5163 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
5165 basic_ifstream_char_ctor(this, virt_init);
5167 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
5168 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
5169 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5174 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5175 /* ??1?$basic_ifstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5176 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_dtor, 4)
5177 void __thiscall basic_ifstream_char_dtor(basic_ifstream_char *this)
5179 TRACE("(%p)\n", this);
5181 basic_istream_char_dtor(&this->base);
5182 basic_filebuf_char_dtor(&this->filebuf);
5185 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5186 /* ??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5187 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_vbase_dtor, 4)
5188 void __thiscall basic_ifstream_char_vbase_dtor(basic_ifstream_char *this)
5190 TRACE("(%p)\n", this);
5192 basic_ifstream_char_dtor(this);
5193 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base));
5196 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ifstream_char_vector_dtor, 8)
5197 basic_ifstream_char* __thiscall MSVCP_basic_ifstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5199 basic_ifstream_char *this = (basic_ifstream_char *)((char*)base - basic_ifstream_char_vbtable[1] + basic_ifstream_char_vbtable[0]);
5201 TRACE("(%p %x)\n", this, flags);
5204 /* we have an array, with the number of elements stored before the first object */
5205 int i, *ptr = (int *)this-1;
5207 for(i=*ptr-1; i>=0; i--)
5208 basic_ifstream_char_vbase_dtor(this+i);
5209 MSVCRT_operator_delete(ptr);
5211 basic_ifstream_char_vbase_dtor(this);
5213 MSVCRT_operator_delete(this);
5219 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5220 /* ?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5221 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_close, 4)
5222 void __thiscall basic_ifstream_char_close(basic_ifstream_char *this)
5224 TRACE("(%p)\n", this);
5226 if(!basic_filebuf_char_close(&this->filebuf)) {
5227 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
5228 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5232 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
5233 /* ?is_open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
5234 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_is_open, 4)
5235 MSVCP_bool __thiscall basic_ifstream_char_is_open(const basic_ifstream_char *this)
5237 TRACE("(%p)\n", this);
5238 return basic_filebuf_char_is_open(&this->filebuf);
5241 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
5242 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
5243 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open, 16)
5244 void __thiscall basic_ifstream_char_open(basic_ifstream_char *this,
5245 const char *name, int mode, int prot)
5247 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
5249 if(!basic_filebuf_char_open(&this->filebuf, name, mode|OPENMODE_in, prot)) {
5250 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
5251 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5255 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
5256 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
5257 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_old, 12)
5258 void __thiscall basic_ifstream_char_open_old(basic_ifstream_char *this,
5259 const char *name, unsigned int mode)
5261 basic_ifstream_char_open(this, name, mode, _SH_DENYNO);
5264 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
5265 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
5266 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
5267 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
5268 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar, 16)
5269 void __thiscall basic_ifstream_char_open_wchar(basic_ifstream_char *this,
5270 const wchar_t *name, int mode, int prot)
5272 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
5274 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode|OPENMODE_in, prot)) {
5275 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base);
5276 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5280 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
5281 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
5282 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
5283 /* ?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
5284 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_open_wchar_old, 12)
5285 void __thiscall basic_ifstream_char_open_wchar_old(basic_ifstream_char *this,
5286 const wchar_t *name, unsigned int mode)
5288 basic_ifstream_char_open_wchar(this, name, mode, _SH_DENYNO);
5291 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
5292 /* ?rdbuf@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
5293 DEFINE_THISCALL_WRAPPER(basic_ifstream_char_rdbuf, 4)
5294 basic_filebuf_char* __thiscall basic_ifstream_char_rdbuf(const basic_ifstream_char *this)
5296 TRACE("(%p)\n", this);
5297 return (basic_filebuf_char*)&this->filebuf;
5300 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@XZ */
5301 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ */
5302 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor, 8)
5303 basic_fstream_char* __thiscall basic_fstream_char_ctor(basic_fstream_char *this, MSVCP_bool virt_init)
5305 basic_ios_char *basic_ios;
5307 TRACE("(%p %d)\n", this, virt_init);
5310 this->base.base1.vbtable = basic_fstream_char_vbtable1;
5311 this->base.base2.vbtable = basic_fstream_char_vbtable2;
5312 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5313 basic_ios_char_ctor(basic_ios);
5315 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5318 basic_filebuf_char_ctor(&this->filebuf);
5319 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
5320 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
5324 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z */
5325 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEAU_iobuf@@@Z */
5326 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_file, 12)
5327 basic_fstream_char* __thiscall basic_fstream_char_ctor_file(basic_fstream_char *this,
5328 FILE *file, MSVCP_bool virt_init)
5330 basic_ios_char *basic_ios;
5332 TRACE("(%p %p %d)\n", this, file, virt_init);
5335 this->base.base1.vbtable = basic_fstream_char_vbtable1;
5336 this->base.base2.vbtable = basic_fstream_char_vbtable2;
5337 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5338 basic_ios_char_ctor(basic_ios);
5340 basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5343 basic_filebuf_char_ctor_file(&this->filebuf, file);
5344 basic_iostream_char_ctor(&this->base, &this->filebuf.base, FALSE);
5345 basic_ios->base.vtable = &MSVCP_basic_fstream_char_vtable;
5349 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBDHH@Z */
5350 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBDHH@Z */
5351 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name, 20)
5352 basic_fstream_char* __thiscall basic_fstream_char_ctor_name(basic_fstream_char *this,
5353 const char *name, int mode, int prot, MSVCP_bool virt_init)
5355 TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
5357 basic_fstream_char_ctor(this, virt_init);
5359 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
5360 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5361 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5366 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PBGHH@Z */
5367 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEBGHH@Z */
5368 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PB_WHH@Z */
5369 /* ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@PEB_WHH@Z */
5370 DEFINE_THISCALL_WRAPPER(basic_fstream_char_ctor_name_wchar, 20)
5371 basic_fstream_char* __thiscall basic_fstream_char_ctor_name_wchar(basic_fstream_char *this,
5372 const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
5374 TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
5376 basic_fstream_char_ctor(this, virt_init);
5378 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
5379 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5380 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5385 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UAE@XZ */
5386 /* ??1?$basic_fstream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
5387 DEFINE_THISCALL_WRAPPER(basic_fstream_char_dtor, 4)
5388 void __thiscall basic_fstream_char_dtor(basic_fstream_char *this)
5390 TRACE("(%p)\n", this);
5392 basic_iostream_char_dtor(&this->base);
5393 basic_filebuf_char_dtor(&this->filebuf);
5396 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5397 /* ??_D?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5398 DEFINE_THISCALL_WRAPPER(basic_fstream_char_vbase_dtor, 4)
5399 void __thiscall basic_fstream_char_vbase_dtor(basic_fstream_char *this)
5401 TRACE("(%p)\n", this);
5403 basic_fstream_char_dtor(this);
5404 basic_ios_char_dtor(basic_istream_char_get_basic_ios(&this->base.base1));
5407 DEFINE_THISCALL_WRAPPER(MSVCP_basic_fstream_char_vector_dtor, 8)
5408 basic_fstream_char* __thiscall MSVCP_basic_fstream_char_vector_dtor(basic_ios_char *base, unsigned int flags)
5410 basic_fstream_char *this = (basic_fstream_char *)((char*)base - basic_fstream_char_vbtable1[1] + basic_fstream_char_vbtable1[0]);
5412 TRACE("(%p %x)\n", this, flags);
5415 /* we have an array, with the number of elements stored before the first object */
5416 int i, *ptr = (int *)this-1;
5418 for(i=*ptr-1; i>=0; i--)
5419 basic_fstream_char_vbase_dtor(this+i);
5420 MSVCRT_operator_delete(ptr);
5422 basic_fstream_char_vbase_dtor(this);
5424 MSVCRT_operator_delete(this);
5430 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXXZ */
5431 /* ?close@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
5432 DEFINE_THISCALL_WRAPPER(basic_fstream_char_close, 4)
5433 void __thiscall basic_fstream_char_close(basic_fstream_char *this)
5435 TRACE("(%p)\n", this);
5437 if(!basic_filebuf_char_close(&this->filebuf)) {
5438 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5439 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5443 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBE_NXZ */
5444 /* ?is_open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBA_NXZ */
5445 DEFINE_THISCALL_WRAPPER(basic_fstream_char_is_open, 4)
5446 MSVCP_bool __thiscall basic_fstream_char_is_open(const basic_fstream_char *this)
5448 TRACE("(%p)\n", this);
5449 return basic_filebuf_char_is_open(&this->filebuf);
5452 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z */
5453 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDHH@Z */
5454 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open, 16)
5455 void __thiscall basic_fstream_char_open(basic_fstream_char *this,
5456 const char *name, int mode, int prot)
5458 TRACE("(%p %s %d %d)\n", this, name, mode, prot);
5460 if(!basic_filebuf_char_open(&this->filebuf, name, mode, prot)) {
5461 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5462 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5466 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBDI@Z */
5467 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBDI@Z */
5468 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_old, 12)
5469 void __thiscall basic_fstream_char_open_old(basic_fstream_char *this,
5470 const char *name, unsigned int mode)
5472 basic_fstream_char_open(this, name, mode, _SH_DENYNO);
5475 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGHH@Z */
5476 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGHH@Z */
5477 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WHH@Z */
5478 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WHH@Z */
5479 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar, 16)
5480 void __thiscall basic_fstream_char_open_wchar(basic_fstream_char *this,
5481 const wchar_t *name, int mode, int prot)
5483 TRACE("(%p %s %d %d)\n", this, debugstr_w(name), mode, prot);
5485 if(!basic_filebuf_char_open_wchar(&this->filebuf, name, mode, prot)) {
5486 basic_ios_char *basic_ios = basic_istream_char_get_basic_ios(&this->base.base1);
5487 basic_ios_char_setstate(basic_ios, IOSTATE_failbit);
5491 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPBGI@Z */
5492 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEBGI@Z */
5493 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QAEXPB_WI@Z */
5494 /* ?open@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAAXPEB_WI@Z */
5495 DEFINE_THISCALL_WRAPPER(basic_fstream_char_open_wchar_old, 12)
5496 void __thiscall basic_fstream_char_open_wchar_old(basic_fstream_char *this,
5497 const wchar_t *name, unsigned int mode)
5499 basic_fstream_char_open_wchar(this, name, mode, _SH_DENYNO);
5502 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
5503 /* ?rdbuf@?$basic_fstream@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_filebuf@DU?$char_traits@D@std@@@2@XZ */
5504 DEFINE_THISCALL_WRAPPER(basic_fstream_char_rdbuf, 4)
5505 basic_filebuf_char* __thiscall basic_fstream_char_rdbuf(const basic_fstream_char *this)
5507 TRACE("(%p)\n", this);
5508 return (basic_filebuf_char*)&this->filebuf;
5511 static basic_filebuf_char filebuf_stdin;
5512 /* ?cin@std@@3V?$basic_istream@DU?$char_traits@D@std@@@1@A */
5514 basic_istream_char obj;
5515 basic_ios_char vbase;
5517 /* ?_Ptr_cin@std@@3PAV?$basic_istream@DU?$char_traits@D@std@@@1@A */
5518 /* ?_Ptr_cin@std@@3PEAV?$basic_istream@DU?$char_traits@D@std@@@1@EA */
5519 basic_istream_char *_Ptr_cin = &cin.obj;
5521 static basic_filebuf_char filebuf_stdout;
5522 /* ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
5524 basic_ostream_char obj;
5525 basic_ios_char vbase;
5527 /* ?_Ptr_cout@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
5528 /* ?_Ptr_cout@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
5529 basic_ostream_char *_Ptr_cout = &cout.obj;
5531 static basic_filebuf_char filebuf_stderr;
5532 /* ?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A */
5534 basic_ostream_char obj;
5535 basic_ios_char vbase;
5537 /* ?_Ptr_cerr@std@@3PAV?$basic_ostream@DU?$char_traits@D@std@@@1@A */
5538 /* ?_Ptr_cerr@std@@3PEAV?$basic_ostream@DU?$char_traits@D@std@@@1@EA */
5539 basic_ostream_char *_Ptr_cerr = &cerr.obj;
5543 basic_filebuf_char_ctor_file(&filebuf_stdin, stdin);
5544 basic_istream_char_ctor(&cin.obj, &filebuf_stdin.base, FALSE/*FIXME*/, TRUE);
5546 basic_filebuf_char_ctor_file(&filebuf_stdout, stdout);
5547 basic_ostream_char_ctor(&cout.obj, &filebuf_stdout.base, FALSE/*FIXME*/, TRUE);
5549 basic_filebuf_char_ctor_file(&filebuf_stderr, stderr);
5550 basic_ostream_char_ctor(&cerr.obj, &filebuf_stderr.base, FALSE/*FIXME*/, TRUE);
5555 basic_istream_char_dtor(&cin.obj);
5556 basic_filebuf_char_dtor(&filebuf_stdin);
5558 basic_ostream_char_dtor(&cout.obj);
5559 basic_filebuf_char_dtor(&filebuf_stdout);
5561 basic_ostream_char_dtor(&cerr.obj);
5562 basic_filebuf_char_dtor(&filebuf_stderr);