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

msvcp90: Implement more basic_ostream<wchar>::operator<< functions.

parent ce4cbc7d
......@@ -5674,8 +5674,30 @@ basic_ostream_wchar* __thiscall basic_ostream_wchar_print_ldouble(basic_ostream_
DEFINE_THISCALL_WRAPPER(basic_ostream_wchar_print_streambuf, 8)
basic_ostream_wchar* __thiscall basic_ostream_wchar_print_streambuf(basic_ostream_wchar *this, basic_streambuf_wchar *val)
{
FIXME("(%p %p) stub\n", this, val);
return NULL;
basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(this);
IOSB_iostate state = IOSTATE_badbit;
unsigned short c = '\n';
TRACE("(%p %p)\n", this, val);
if(basic_ostream_wchar_sentry_create(this)) {
for(c = basic_streambuf_wchar_sgetc(val); c!=WEOF;
c = basic_streambuf_wchar_snextc(val)) {
state = IOSTATE_goodbit;
if(basic_streambuf_wchar_sputc(base->strbuf, c) == WEOF) {
state = IOSTATE_badbit;
break;
}
}
}else {
state = IOSTATE_badbit;
}
basic_ostream_wchar_sentry_destroy(this);
ios_base_width_set(&base->base, 0);
basic_ios_wchar_setstate(base, state);
return this;
}
/* ??6?$basic_ostream@_WU?$char_traits@_W@std@@@std@@QAEAAV01@PBX@Z */
......@@ -5808,10 +5830,103 @@ basic_ostream_wchar* __cdecl basic_ostream_wchar_print_bstr(basic_ostream_wchar
state = IOSTATE_badbit;
}
for(; pad!=0; pad--) {
if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
if(state == IOSTATE_goodbit) {
for(; pad!=0; pad--) {
if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
state = IOSTATE_badbit;
break;
}
}
}
base->base.wide = 0;
}else {
state = IOSTATE_badbit;
}
basic_ostream_wchar_sentry_destroy(ostr);
basic_ios_wchar_setstate(base, state);
return ostr;
}
/* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z */
/* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z */
basic_ostream_wchar* __cdecl basic_ostream_wchar_print_ch(basic_ostream_wchar *ostr, wchar_t ch)
{
basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
IOSB_iostate state = IOSTATE_goodbit;
TRACE("(%p %d)\n", ostr, ch);
if(basic_ostream_wchar_sentry_create(ostr)) {
streamsize pad = (base->base.wide>1 ? base->base.wide-1 : 0);
if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
for(; pad!=0; pad--) {
if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
state = IOSTATE_badbit;
break;
}
}
}
if(state == IOSTATE_goodbit) {
if(basic_streambuf_wchar_sputc(base->strbuf, ch) == WEOF)
state = IOSTATE_badbit;
break;
}
if(state == IOSTATE_goodbit) {
for(; pad!=0; pad--) {
if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
state = IOSTATE_badbit;
break;
}
}
}
base->base.wide = 0;
}else {
state = IOSTATE_badbit;
}
basic_ostream_wchar_sentry_destroy(ostr);
basic_ios_wchar_setstate(base, state);
return ostr;
}
/* ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z */
/* ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z */
basic_ostream_wchar* __cdecl basic_ostream_wchar_print_str(basic_ostream_wchar *ostr, const wchar_t *str)
{
basic_ios_wchar *base = basic_ostream_wchar_get_basic_ios(ostr);
IOSB_iostate state = IOSTATE_goodbit;
TRACE("(%p %s)\n", ostr, debugstr_w(str));
if(basic_ostream_wchar_sentry_create(ostr)) {
MSVCP_size_t len = wcslen(str);
streamsize pad = (base->base.wide>len ? base->base.wide-len : 0);
if((base->base.fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
for(; pad!=0; pad--) {
if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
state = IOSTATE_badbit;
break;
}
}
}
if(state == IOSTATE_goodbit) {
if(basic_streambuf_wchar_sputn(base->strbuf, str, len) != len)
state = IOSTATE_badbit;
}
if(state == IOSTATE_goodbit) {
for(; pad!=0; pad--) {
if(basic_streambuf_wchar_sputc(base->strbuf, base->fillch) == WEOF) {
state = IOSTATE_badbit;
break;
}
}
}
......
......@@ -80,10 +80,10 @@
@ cdecl -arch=win64 ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z(ptr str) basic_ostream_char_print_str
@ cdecl -arch=win32 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBE@Z(ptr ptr) basic_ostream_char_print_str
@ cdecl -arch=win64 ??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBE@Z(ptr ptr) basic_ostream_char_print_str
@ stub -arch=win32 ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z
@ stub -arch=win64 ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z
@ stub -arch=win32 ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z
@ stub -arch=win64 ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z
@ cdecl -arch=win32 ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@PB_W@Z(ptr wstr) basic_ostream_wchar_print_str
@ cdecl -arch=win64 ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@PEB_W@Z(ptr wstr) basic_ostream_wchar_print_str
@ cdecl -arch=win32 ??$?6_WU?$char_traits@_W@std@@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@_W@Z(ptr long) basic_ostream_wchar_print_ch
@ cdecl -arch=win64 ??$?6_WU?$char_traits@_W@std@@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@_W@Z(ptr long) basic_ostream_wchar_print_ch
@ cdecl -arch=win32 ??$?6_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YAAAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AAV10@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z(ptr ptr) basic_ostream_wchar_print_bstr
@ cdecl -arch=win64 ??$?6_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YAAEAV?$basic_ostream@_WU?$char_traits@_W@std@@@0@AEAV10@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z(ptr ptr) basic_ostream_wchar_print_bstr
@ cdecl -arch=win32 ??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z(ptr ptr) MSVCP_basic_string_char_equal
......
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