Commit f5ea4bab authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Added basic_stringstream<wchar> implementation.

parent 1aff1c48
......@@ -212,6 +212,14 @@ typedef struct {
*/
} basic_stringstream_char;
typedef struct {
basic_iostream_wchar base;
basic_stringbuf_wchar strbuf;
/* virtual inheritance
* basic_ios_wchar basic_ios;
*/
} basic_stringstream_wchar;
extern const vtable_ptr MSVCP_iosb_vtable;
/* ??_7ios_base@std@@6B@ */
......@@ -325,6 +333,13 @@ const int basic_stringstream_char_vbtable2[] = {0, sizeof(basic_stringstream_cha
/* ??_7?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@6B@ */
extern const vtable_ptr MSVCP_basic_stringstream_char_vtable;
/* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_istream@_WU?$char_traits@_W@std@@@1@@ */
const int basic_stringstream_wchar_vbtable1[] = {0, sizeof(basic_stringstream_wchar)};
/* ??_8?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@7B?$basic_ostream@_WU?$char_traits@_W@std@@@1@@ */
const int basic_stringstream_wchar_vbtable2[] = {0, sizeof(basic_stringstream_wchar)-FIELD_OFFSET(basic_stringstream_wchar, base.base2)};
/* ??_7?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@6B@ */
extern const vtable_ptr MSVCP_basic_stringstream_wchar_vtable;
DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@");
DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@");
DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
......@@ -407,6 +422,12 @@ DEFINE_RTTI_DATA8(basic_stringstream_char, sizeof(basic_stringstream_char),
&basic_ostream_char_rtti_base_descriptor, &basic_ios_char_rtti_base_descriptor,
&ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
".?AV?$basic_stringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@");
DEFINE_RTTI_DATA8(basic_stringstream_wchar, sizeof(basic_stringstream_wchar),
&basic_istream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
&ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
&basic_ostream_wchar_rtti_base_descriptor, &basic_ios_wchar_rtti_base_descriptor,
&ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
".?AV?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@");
#ifndef __GNUC__
void __asm_dummy_vtables(void) {
......@@ -528,6 +549,7 @@ void __asm_dummy_vtables(void) {
__ASM_VTABLE(basic_istringstream_char, "");
__ASM_VTABLE(basic_istringstream_wchar, "");
__ASM_VTABLE(basic_stringstream_char, "");
__ASM_VTABLE(basic_stringstream_wchar, "");
#ifndef __GNUC__
}
#endif
......@@ -9230,6 +9252,138 @@ basic_string_char* __thiscall basic_stringstream_char_str_get(const basic_string
return basic_stringbuf_char_str_get(&this->strbuf, ret);
}
/* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
/* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@H@Z */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_str, 16)
basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_str(basic_stringstream_wchar *this,
const basic_string_wchar *str, int mode, MSVCP_bool virt_init)
{
basic_ios_wchar *basic_ios;
TRACE("(%p %p %d %d)\n", this, str, mode, virt_init);
if(virt_init) {
this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
basic_ios_wchar_ctor(basic_ios);
}else {
basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
}
basic_stringbuf_wchar_ctor_str(&this->strbuf, str, mode);
basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
return this;
}
/* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@H@Z */
/* ??0?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@H@Z */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor_mode, 12)
basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor_mode(
basic_stringstream_wchar *this, int mode, MSVCP_bool virt_init)
{
basic_ios_wchar *basic_ios;
TRACE("(%p %d %d)\n", this, mode, virt_init);
if(virt_init) {
this->base.base1.vbtable = basic_stringstream_wchar_vbtable1;
this->base.base2.vbtable = basic_stringstream_wchar_vbtable2;
basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
basic_ios_wchar_ctor(basic_ios);
}else {
basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
}
basic_stringbuf_wchar_ctor_mode(&this->strbuf, mode);
basic_iostream_wchar_ctor(&this->base, &this->strbuf.base, FALSE);
basic_ios->base.vtable = &MSVCP_basic_stringstream_wchar_vtable;
return this;
}
/* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
/* ??_F?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_ctor, 8)
basic_stringstream_wchar* __thiscall basic_stringstream_wchar_ctor(
basic_stringstream_wchar *this, MSVCP_bool virt_init)
{
return basic_stringstream_wchar_ctor_mode(
this, OPENMODE_out|OPENMODE_in, virt_init);
}
/* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UAE@XZ */
/* ??1?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@UEAA@XZ */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_dtor, 4)
void __thiscall basic_stringstream_wchar_dtor(basic_stringstream_wchar *this)
{
TRACE("(%p)\n", this);
basic_iostream_wchar_dtor(&this->base);
basic_stringbuf_wchar_dtor(&this->strbuf);
}
/* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
/* ??_D?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_vbase_dtor, 4)
void __thiscall basic_stringstream_wchar_vbase_dtor(basic_stringstream_wchar *this)
{
TRACE("(%p)\n", this);
basic_stringstream_wchar_dtor(this);
basic_ios_wchar_dtor(basic_istream_wchar_get_basic_ios(&this->base.base1));
}
DEFINE_THISCALL_WRAPPER(MSVCP_basic_stringstream_wchar_vector_dtor, 8)
basic_stringstream_wchar* __thiscall MSVCP_basic_stringstream_wchar_vector_dtor(basic_ios_wchar *base, unsigned int flags)
{
basic_stringstream_wchar *this = (basic_stringstream_wchar *)((char*)base - basic_stringstream_wchar_vbtable1[1] + basic_stringstream_wchar_vbtable1[0]);
TRACE("(%p %x)\n", this, flags);
if(flags & 2) {
/* we have an array, with the number of elements stored before the first object */
int i, *ptr = (int *)this-1;
for(i=*ptr-1; i>=0; i--)
basic_stringstream_wchar_vbase_dtor(this+i);
MSVCRT_operator_delete(ptr);
} else {
basic_stringstream_wchar_vbase_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
}
return this;
}
/* ?rdbuf@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
/* ?rdbuf@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEAV?$basic_stringbuf@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_rdbuf, 4)
basic_stringbuf_wchar* __thiscall basic_stringstream_wchar_rdbuf(const basic_stringstream_wchar *this)
{
TRACE("(%p)\n", this);
return (basic_stringbuf_wchar*)&this->strbuf;
}
/* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
/* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_set, 8)
void __thiscall basic_stringstream_wchar_str_set(basic_stringstream_wchar *this, const basic_string_wchar *str)
{
TRACE("(%p %p)\n", this, str);
basic_stringbuf_wchar_str_set(&this->strbuf, str);
}
/* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
/* ?str@?$basic_stringstream@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
DEFINE_THISCALL_WRAPPER(basic_stringstream_wchar_str_get, 8)
basic_string_wchar* __thiscall basic_stringstream_wchar_str_get(const basic_stringstream_wchar *this, basic_string_wchar *ret)
{
TRACE("(%p %p)\n", this, ret);
return basic_stringbuf_wchar_str_get(&this->strbuf, ret);
}
static void __cdecl setprecision_func(ios_base *base, streamsize prec)
{
ios_base_precision_set(base, prec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment