Piotr Caban : msvcp90: Added basic_string<wchar_t>::append implementation.

Alexandre Julliard julliard at winehq.org
Thu Nov 18 11:09:29 CST 2010


Module: wine
Branch: master
Commit: b99c582402a23199a979118ad7a16f85a6bf50da
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b99c582402a23199a979118ad7a16f85a6bf50da

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Nov 18 12:20:26 2010 +0100

msvcp90: Added basic_string<wchar_t>::append implementation.

---

 dlls/msvcp90/msvcp90.spec |    8 ++++----
 dlls/msvcp90/string.c     |   31 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index f3bfd74..f41cf79 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -2944,10 +2944,10 @@
 @ stub -arch=win64 ?append@?$basic_string at GU?$char_traits at G@std@@V?$allocator at G@2@@std@@QEAAAEAV12 at V?$_String_const_iterator at GU?$char_traits at G@std@@V?$allocator at G@2@@2 at 0@Z
 @ stub -arch=win32 ?append@?$basic_string at GU?$char_traits at G@std@@V?$allocator at G@2@@std@@QAEAAV12 at V?$_String_const_iterator at GU?$char_traits at G@std@@V?$allocator at G@2@@2 at 0@Z
 @ stub -arch=win64 ?append@?$basic_string at GU?$char_traits at G@std@@V?$allocator at G@2@@std@@QEAAAEAV12 at _KG@Z
-@ stub -arch=win32 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at ABV12@@Z
-@ stub -arch=win64 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QEAAAEAV12 at AEBV12@@Z
-@ stub -arch=win32 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at ABV12@II at Z
-@ stub -arch=win64 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QEAAAEAV12 at AEBV12@_K1 at Z
+@ thiscall -arch=win32 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at ABV12@@Z(ptr ptr) MSVCP_basic_string_wchar_append
+@ cdecl -arch=win64 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QEAAAEAV12 at AEBV12@@Z(ptr ptr) MSVCP_basic_string_wchar_append
+@ thiscall -arch=win32 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at ABV12@II at Z(ptr ptr long long) MSVCP_basic_string_wchar_append_substr
+@ cdecl -arch=win64 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QEAAAEAV12 at AEBV12@_K1 at Z(ptr ptr long long) MSVCP_basic_string_wchar_append_substr
 @ stub -arch=win32 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at I_W@Z
 @ stub -arch=win64 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QEAAAEAV12 at PEB_W0@Z
 @ stub -arch=win32 ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at PB_W0@Z
diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c
index 6fa65bd..db9022f 100644
--- a/dlls/msvcp90/string.c
+++ b/dlls/msvcp90/string.c
@@ -1092,3 +1092,34 @@ void __thiscall MSVCP_basic_string_wchar_swap(basic_string_wchar *this, basic_st
         str->res = res;
     }
 }
+
+/* ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at ABV12@II at Z */
+/* ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QEAAAEAV12 at AEBV12@_K1 at Z */
+DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_substr, 16)
+basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_substr(basic_string_wchar *this,
+        basic_string_wchar *append, size_t offset, size_t count)
+{
+    if(append->size < offset)
+        MSVCP__String_base_Xran();
+
+    if(count > append->size-offset)
+        count = append->size-offset;
+
+    if(basic_string_wchar_grow(this, this->size+count, FALSE)) {
+        MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this)+this->size,
+                this->res-this->size, basic_string_wchar_ptr(append)+offset, count);
+        basic_string_wchar_eos(this, this->size+count);
+    }
+
+    return this;
+}
+
+/* ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QAEAAV12 at ABV12@@Z */
+/* ?append@?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@std@@QEAAAEAV12 at AEBV12@@Z */
+DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append, 8)
+    basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append(
+            basic_string_wchar *this, basic_string_wchar *append)
+{
+    return MSVCP_basic_string_wchar_append_substr(this, append,
+            0, MSVCP_basic_string_wchar_npos);
+}




More information about the wine-cvs mailing list