2 * Copyright 2010 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
28 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
31 /* char_traits<char> */
32 /* ?assign@?$char_traits@D@std@@SAXAADABD@Z */
33 /* ?assign@?$char_traits@D@std@@SAXAEADAEBD@Z */
34 void CDECL MSVCP_char_traits_char_assign(char *ch, const char *assign)
39 /* ?eq@?$char_traits@D@std@@SA_NABD0@Z */
40 /* ?eq@?$char_traits@D@std@@SA_NAEBD0@Z */
41 MSVCP_bool CDECL MSVCP_char_traits_char_eq(const char *ch1, const char *ch2)
46 /* ?lt@?$char_traits@D@std@@SA_NABD0@Z */
47 /* ?lt@?$char_traits@D@std@@SA_NAEBD0@Z */
48 MSVCP_bool CDECL MSVCP_char_traits_lt(const char *ch1, const char *ch2)
53 /* ?compare@?$char_traits@D@std@@SAHPBD0I@Z */
54 /* ?compare@?$char_traits@D@std@@SAHPEBD0_K@Z */
55 int CDECL MSVCP_char_traits_char_compare(
56 const char *s1, const char *s2, MSVCP_size_t count)
58 int ret = memcmp(s1, s2, count);
59 return (ret>0 ? 1 : (ret<0 ? -1 : 0));
62 /* ?length@?$char_traits@D@std@@SAIPBD@Z */
63 /* ?length@?$char_traits@D@std@@SA_KPEBD@Z */
64 MSVCP_size_t CDECL MSVCP_char_traits_char_length(const char *str)
69 /* ?_Copy_s@?$char_traits@D@std@@SAPADPADIPBDI@Z */
70 /* ?_Copy_s@?$char_traits@D@std@@SAPEADPEAD_KPEBD1@Z */
71 char* CDECL MSVCP_char_traits_char__Copy_s(char *dest,
72 MSVCP_size_t size, const char *src, MSVCP_size_t count)
74 if(!dest || !src || size<count) {
77 _invalid_parameter(NULL, NULL, NULL, 0, 0);
81 return memcpy(dest, src, count);
84 /* ?copy@?$char_traits@D@std@@SAPADPADPBDI@Z */
85 /* ?copy@?$char_traits@D@std@@SAPEADPEADPEBD_K@Z */
86 char* CDECL MSVCP_char_traits_char_copy(
87 char *dest, const char *src, MSVCP_size_t count)
89 return MSVCP_char_traits_char__Copy_s(dest, count, src, count);
92 /* ?find@?$char_traits@D@std@@SAPBDPBDIABD@Z */
93 /* ?find@?$char_traits@D@std@@SAPEBDPEBD_KAEBD@Z */
94 const char * CDECL MSVCP_char_traits_char_find(
95 const char *str, MSVCP_size_t range, const char *c)
97 return memchr(str, *c, range);
100 /* ?_Move_s@?$char_traits@D@std@@SAPADPADIPBDI@Z */
101 /* ?_Move_s@?$char_traits@D@std@@SAPEADPEAD_KPEBD1@Z */
102 char* CDECL MSVCP_char_traits_char__Move_s(char *dest,
103 MSVCP_size_t size, const char *src, MSVCP_size_t count)
105 if(!dest || !src || size<count) {
108 _invalid_parameter(NULL, NULL, NULL, 0, 0);
112 return memmove(dest, src, count);
115 /* ?move@?$char_traits@D@std@@SAPADPADPBDI@Z */
116 /* ?move@?$char_traits@D@std@@SAPEADPEADPEBD_K@Z */
117 char* CDECL MSVCP_char_traits_char_move(
118 char *dest, const char *src, MSVCP_size_t count)
120 return MSVCP_char_traits_char__Move_s(dest, count, src, count);
123 /* ?assign@?$char_traits@D@std@@SAPADPADID@Z */
124 /* ?assign@?$char_traits@D@std@@SAPEADPEAD_KD@Z */
125 char* CDECL MSVCP_char_traits_char_assignn(char *str, MSVCP_size_t num, char c)
127 return memset(str, c, num);
130 /* ?to_char_type@?$char_traits@D@std@@SADABH@Z */
131 /* ?to_char_type@?$char_traits@D@std@@SADAEBH@Z */
132 char CDECL MSVCP_char_traits_char_to_char_type(const int *i)
137 /* ?to_int_type@?$char_traits@D@std@@SAHABD@Z */
138 /* ?to_int_type@?$char_traits@D@std@@SAHAEBD@Z */
139 int CDECL MSVCP_char_traits_char_to_int_type(const char *ch)
144 /* ?eq_int_type@?$char_traits@D@std@@SA_NABH0@Z */
145 /* ?eq_int_type@?$char_traits@D@std@@SA_NAEBH0@Z */
146 MSVCP_bool CDECL MSVCP_char_traits_char_eq_int_type(const int *i1, const int *i2)
151 /* ?eof@?$char_traits@D@std@@SAHXZ */
152 int CDECL MSVCP_char_traits_char_eof(void)
157 /* ?not_eof@?$char_traits@D@std@@SAHABH@Z */
158 /* ?not_eof@?$char_traits@D@std@@SAHAEBH@Z */
159 int CDECL MSVCP_char_traits_char_not_eof(int *in)
161 return (*in==EOF ? !EOF : *in);
165 /* char_traits<wchar_t> */
166 /* ?assign@?$char_traits@_W@std@@SAXAA_WAB_W@Z */
167 /* ?assign@?$char_traits@_W@std@@SAXAEA_WAEB_W@Z */
168 void CDECL MSVCP_char_traits_wchar_assign(wchar_t *ch,
169 const wchar_t *assign)
174 /* ?eq@?$char_traits@_W@std@@SA_NAB_W0@Z */
175 /* ?eq@?$char_traits@_W@std@@SA_NAEB_W0@Z */
176 MSVCP_bool CDECL MSVCP_char_traits_wchar_eq(wchar_t *ch1, wchar_t *ch2)
181 /* ?lt@?$char_traits@_W@std@@SA_NAB_W0@Z */
182 /* ?lt@?$char_traits@_W@std@@SA_NAEB_W0@Z */
183 MSVCP_bool CDECL MSVCP_char_traits_wchar_lt(const wchar_t *ch1,
189 /* ?compare@?$char_traits@_W@std@@SAHPB_W0I@Z */
190 /* ?compare@?$char_traits@_W@std@@SAHPEB_W0_K@Z */
191 int CDECL MSVCP_char_traits_wchar_compare(const wchar_t *s1,
192 const wchar_t *s2, MSVCP_size_t count)
194 int ret = memcmp(s1, s2, sizeof(wchar_t[count]));
195 return (ret>0 ? 1 : (ret<0 ? -1 : 0));
198 /* ?length@?$char_traits@_W@std@@SAIPB_W@Z */
199 /* ?length@?$char_traits@_W@std@@SA_KPEB_W@Z */
200 MSVCP_size_t CDECL MSVCP_char_traits_wchar_length(const wchar_t *str)
202 return wcslen((WCHAR*)str);
205 /* ?_Copy_s@?$char_traits@_W@std@@SAPA_WPA_WIPB_WI@Z */
206 /* ?_Copy_s@?$char_traits@_W@std@@SAPEA_WPEA_W_KPEB_W1@Z */
207 wchar_t* CDECL MSVCP_char_traits_wchar__Copy_s(wchar_t *dest,
208 MSVCP_size_t size, const wchar_t *src, MSVCP_size_t count)
210 if(!dest || !src || size<count) {
213 _invalid_parameter(NULL, NULL, NULL, 0, 0);
217 return memcpy(dest, src, sizeof(wchar_t[count]));
220 /* ?copy@?$char_traits@_W@std@@SAPA_WPA_WPB_WI@Z */
221 /* ?copy@?$char_traits@_W@std@@SAPEA_WPEA_WPEB_W_K@Z */
222 wchar_t* CDECL MSVCP_char_traits_wchar_copy(wchar_t *dest,
223 const wchar_t *src, MSVCP_size_t count)
225 return MSVCP_char_traits_wchar__Copy_s(dest, count, src, count);
228 /* ?find@?$char_traits@_W@std@@SAPB_WPB_WIAB_W@Z */
229 /* ?find@?$char_traits@_W@std@@SAPEB_WPEB_W_KAEB_W@Z */
230 const wchar_t* CDECL MSVCP_char_traits_wchar_find(
231 const wchar_t *str, MSVCP_size_t range, const wchar_t *c)
235 for(i=0; i<range; i++)
242 /* ?_Move_s@?$char_traits@_W@std@@SAPA_WPA_WIPB_WI@Z */
243 /* ?_Move_s@?$char_traits@_W@std@@SAPEA_WPEA_W_KPEB_W1@Z */
244 wchar_t* CDECL MSVCP_char_traits_wchar__Move_s(wchar_t *dest,
245 MSVCP_size_t size, const wchar_t *src, MSVCP_size_t count)
247 if(!dest || !src || size<count) {
250 _invalid_parameter(NULL, NULL, NULL, 0, 0);
254 return memmove(dest, src, sizeof(WCHAR[count]));
257 /* ?move@?$char_traits@_W@std@@SAPA_WPA_WPB_WI@Z */
258 /* ?move@?$char_traits@_W@std@@SAPEA_WPEA_WPEB_W_K@Z */
259 wchar_t* CDECL MSVCP_char_traits_wchar_move(wchar_t *dest,
260 const wchar_t *src, MSVCP_size_t count)
262 return MSVCP_char_traits_wchar__Move_s(dest, count, src, count);
265 /* ?assign@?$char_traits@_W@std@@SAPA_WPA_WI_W@Z */
266 /* ?assign@?$char_traits@_W@std@@SAPEA_WPEA_W_K_W@Z */
267 wchar_t* CDECL MSVCP_char_traits_wchar_assignn(wchar_t *str,
268 MSVCP_size_t num, wchar_t c)
278 /* ?to_char_type@?$char_traits@_W@std@@SA_WABG@Z */
279 /* ?to_char_type@?$char_traits@_W@std@@SA_WAEBG@Z */
280 wchar_t CDECL MSVCP_char_traits_wchar_to_char_type(const unsigned short *i)
285 /* ?to_int_type@?$char_traits@_W@std@@SAGAB_W@Z */
286 /* ?to_int_type@?$char_traits@_W@std@@SAGAEB_W@Z */
287 unsigned short CDECL MSVCP_char_traits_wchar_to_int_type(const wchar_t *ch)
292 /* ?eq_int_type@?$char_traits@_W@std@@SA_NABG0@Z */
293 /* ?eq_int_type@?$char_traits@_W@std@@SA_NAEBG0@Z */
294 MSVCP_bool CDECL MSVCP_char_traits_wchar_eq_int_tpe(const unsigned short *i1,
295 const unsigned short *i2)
300 /* ?eof@?$char_traits@_W@std@@SAGXZ */
301 unsigned short CDECL MSVCP_char_traits_wchar_eof(void)
306 /* ?not_eof@?$char_traits@_W@std@@SAGABG@Z */
307 /* ?not_eof@?$char_traits@_W@std@@SAGAEBG@Z */
308 unsigned short CDECL MSVCP_char_traits_wchar_not_eof(const unsigned short *in)
310 return (*in==WEOF ? !WEOF : *in);
314 /* char_traits<unsigned short> */
315 /* ?assign@?$char_traits@G@std@@SAXAAGABG@Z */
316 /* ?assign@?$char_traits@G@std@@SAXAEAGAEBG@Z */
317 void CDECL MSVCP_char_traits_short_assign(unsigned short *ch,
318 const unsigned short *assign)
323 /* ?eq@?$char_traits@G@std@@SA_NABG0@Z */
324 /* ?eq@?$char_traits@G@std@@SA_NAEBG0@Z */
325 MSVCP_bool CDECL MSVCP_char_traits_short_eq(const unsigned short *ch1,
326 const unsigned short *ch2)
331 /* ?lt@?$char_traits@G@std@@SA_NABG0@Z */
332 /* ?lt@?$char_traits@G@std@@SA_NAEBG0@Z */
333 MSVCP_bool CDECL MSVCP_char_traits_short_lt(const unsigned short *ch1,
334 const unsigned short *ch2)
339 /* ?compare@?$char_traits@G@std@@SAHPBG0I@Z */
340 /* ?compare@?$char_traits@G@std@@SAHPEBG0_K@Z */
341 int CDECL MSVCP_char_traits_short_compare(const unsigned short *s1,
342 const unsigned short *s2, MSVCP_size_t count)
346 for(i=0; i<count; i++)
348 return (s1[i] < s2[i] ? -1 : 1);
353 /* ?length@?$char_traits@G@std@@SAIPBG@Z */
354 /* ?length@?$char_traits@G@std@@SA_KPEBG@Z */
355 MSVCP_size_t CDECL MSVCP_char_traits_short_length(const unsigned short *str)
359 for(len=0; str[len]; len++);
364 /* ?_Copy_s@?$char_traits@G@std@@SAPAGPAGIPBGI@Z */
365 /* ?_Copy_s@?$char_traits@G@std@@SAPEAGPEAG_KPEBG1@Z */
366 unsigned short * CDECL MSVCP_char_traits_short__Copy_s(unsigned short *dest,
367 MSVCP_size_t size, const unsigned short *src, MSVCP_size_t count)
370 _invalid_parameter(NULL, NULL, NULL, 0, 0);
374 return memcpy(dest, src, sizeof(unsigned short[count]));
377 /* ?copy@?$char_traits@G@std@@SAPAGPAGPBGI@Z */
378 /* ?copy@?$char_traits@G@std@@SAPEAGPEAGPEBG_K@Z */
379 unsigned short* CDECL MSVCP_char_traits_short_copy(unsigned short *dest,
380 const unsigned short *src, MSVCP_size_t count)
382 return MSVCP_char_traits_short__Copy_s(dest, count, src, count);
385 /* ?find@?$char_traits@G@std@@SAPBGPBGIABG@Z */
386 /* ?find@?$char_traits@G@std@@SAPEBGPEBG_KAEBG@Z */
387 const unsigned short* CDECL MSVCP_char_traits_short_find(
388 const unsigned short *str, MSVCP_size_t range, const unsigned short *c)
392 for(i=0; i<range; i++)
399 /* ?_Move_s@?$char_traits@G@std@@SAPAGPAGIPBGI@Z */
400 /* ?_Move_s@?$char_traits@G@std@@SAPEAGPEAG_KPEBG1@Z */
401 unsigned short* CDECL MSVCP_char_traits_short__Move_s(unsigned short *dest,
402 MSVCP_size_t size, const unsigned short *src, MSVCP_size_t count)
405 _invalid_parameter(NULL, NULL, NULL, 0, 0);
409 return memmove(dest, src, sizeof(unsigned short[count]));
412 /* ?move@?$char_traits@G@std@@SAPAGPAGPBGI@Z */
413 /* ?move@?$char_traits@G@std@@SAPEAGPEAGPEBG_K@Z */
414 unsigned short* CDECL MSVCP_char_traits_short_move(unsigned short *dest,
415 const unsigned short *src, MSVCP_size_t count)
417 return MSVCP_char_traits_short__Move_s(dest, count, src, count);
420 /* ?assign@?$char_traits@G@std@@SAPAGPAGIG@Z */
421 /* ?assign@?$char_traits@G@std@@SAPEAGPEAG_KG@Z */
422 unsigned short* CDECL MSVCP_char_traits_short_assignn(unsigned short *str,
423 MSVCP_size_t num, unsigned short c)
433 /* ?to_char_type@?$char_traits@G@std@@SAGABG@Z */
434 /* ?to_char_type@?$char_traits@G@std@@SAGAEBG@Z */
435 unsigned short CDECL MSVCP_char_traits_short_to_char_type(const unsigned short *i)
440 /* ?to_int_type@?$char_traits@G@std@@SAGABG@Z */
441 /* ?to_int_type@?$char_traits@G@std@@SAGAEBG@Z */
442 unsigned short CDECL MSVCP_char_traits_short_to_int_type(const unsigned short *ch)
447 /* ?eq_int_type@?$char_traits@G@std@@SA_NABG0@Z */
448 /* ?eq_int_type@?$char_traits@G@std@@SA_NAEBG0@Z */
449 MSVCP_bool CDECL MSVCP_char_traits_short_eq_int_type(unsigned short *i1,
455 /* ?eof@?$char_traits@G@std@@SAGXZ */
456 unsigned short CDECL MSVCP_char_traits_short_eof(void)
461 /* ?not_eof@?$char_traits@G@std@@SAGABG@Z */
462 /* ?not_eof@?$char_traits@G@std@@SAGAEBG@Z */
463 unsigned short CDECL MSVCP_char_traits_short_not_eof(const unsigned short *in)
465 return (*in==(unsigned short)-1 ? 0 : *in);
470 /* ?_Xlen@_String_base@std@@SAXXZ */
471 void CDECL MSVCP__String_base_Xlen(void)
473 static const char msg[] = "string too long";
476 throw_exception(EXCEPTION_LENGTH_ERROR, msg);
479 /* ?_Xran@_String_base@std@@SAXXZ */
480 void CDECL MSVCP__String_base_Xran(void)
482 static const char msg[] = "invalid string position";
485 throw_exception(EXCEPTION_OUT_OF_RANGE, msg);
488 /* ?_Xinvarg@_String_base@std@@SAXXZ */
489 void CDECL MSVCP__String_base_Xinvarg(void)
491 static const char msg[] = "invalid string argument";
494 throw_exception(EXCEPTION_INVALID_ARGUMENT, msg);
498 /* basic_string<char, char_traits<char>, allocator<char>> */
499 /* ?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2IB */
500 /* ?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2_KB */
501 const MSVCP_size_t MSVCP_basic_string_char_npos = -1;
503 /* Internal: basic_string_char_ptr - return pointer to stored string */
504 static char* basic_string_char_ptr(basic_string_char *this)
506 if(this->res == BUF_SIZE_CHAR-1)
507 return this->data.buf;
508 return this->data.ptr;
511 /* Internal: basic_string_char_const_ptr - returns const pointer to stored string */
512 static const char* basic_string_char_const_ptr(const basic_string_char *this)
514 if(this->res == BUF_SIZE_CHAR-1)
515 return this->data.buf;
516 return this->data.ptr;
519 /* Internal: basic_string_char_eos - sets string length, puts '\0' on the end */
520 static void basic_string_char_eos(basic_string_char *this, MSVCP_size_t len)
522 static const char nullbyte = '\0';
525 MSVCP_char_traits_char_assign(basic_string_char_ptr(this)+len, &nullbyte);
528 /* Internal: basic_string_char_inside - checks if given pointer points inside stored string */
529 static MSVCP_bool basic_string_char_inside(
530 basic_string_char *this, const char *ptr)
532 char *cstr = basic_string_char_ptr(this);
534 return (ptr<cstr || ptr>=cstr+this->size) ? FALSE : TRUE;
537 /* Internal: basic_string_char_tidy - initialize basic_string buffer, deallocates data */
538 /* Caution: new_size have to be smaller than BUF_SIZE_CHAR */
539 static void basic_string_char_tidy(basic_string_char *this,
540 MSVCP_bool built, MSVCP_size_t new_size)
542 if(built && BUF_SIZE_CHAR<=this->res) {
543 char *ptr = this->data.ptr;
546 MSVCP_char_traits_char__Copy_s(this->data.buf, BUF_SIZE_CHAR, ptr, new_size);
547 MSVCP_allocator_char_deallocate(this->allocator, ptr, this->res+1);
550 this->res = BUF_SIZE_CHAR-1;
551 basic_string_char_eos(this, new_size);
554 /* Internal: basic_string_char_grow - changes size of internal buffer */
555 static MSVCP_bool basic_string_char_grow(
556 basic_string_char *this, MSVCP_size_t new_size, MSVCP_bool trim)
558 if(this->res < new_size) {
559 MSVCP_size_t new_res = new_size;
564 if(new_res/3 < this->res/2)
565 new_res = this->res + this->res/2;
567 ptr = MSVCP_allocator_char_allocate(this->allocator, new_res);
569 ptr = MSVCP_allocator_char_allocate(this->allocator, new_size+1);
573 ERR("Out of memory\n");
574 basic_string_char_tidy(this, TRUE, 0);
578 MSVCP_char_traits_char__Copy_s(ptr, new_size,
579 basic_string_char_ptr(this), this->size);
580 basic_string_char_tidy(this, TRUE, 0);
581 this->data.ptr = ptr;
582 this->res = new_size;
583 basic_string_char_eos(this, this->size);
584 } else if(trim && new_size < BUF_SIZE_CHAR)
585 basic_string_char_tidy(this, TRUE,
586 new_size<this->size ? new_size : this->size);
587 else if(new_size == 0)
588 basic_string_char_eos(this, 0);
593 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z */
594 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0@Z */
595 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_erase, 12)
596 basic_string_char* __thiscall MSVCP_basic_string_char_erase(
597 basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t len)
599 TRACE("%p %lu %lu\n", this, pos, len);
601 if(pos > this->size) {
602 MSVCP__String_base_Xran();
606 if(len > this->size-pos)
607 len = this->size-pos;
610 MSVCP_char_traits_char__Move_s(basic_string_char_ptr(this)+pos,
611 this->res-pos, basic_string_char_ptr(this)+pos+len,
613 basic_string_char_eos(this, this->size-len);
619 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
620 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
621 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign_substr, 16)
622 basic_string_char* __thiscall MSVCP_basic_string_char_assign_substr(
623 basic_string_char *this, const basic_string_char *assign,
624 MSVCP_size_t pos, MSVCP_size_t len)
626 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
628 if(assign->size < pos) {
629 MSVCP__String_base_Xran();
633 if(len > assign->size-pos)
634 len = assign->size-pos;
637 MSVCP_basic_string_char_erase(this, pos+len, MSVCP_basic_string_char_npos);
638 MSVCP_basic_string_char_erase(this, 0, pos);
639 } else if(basic_string_char_grow(this, len, FALSE)) {
640 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this),
641 this->res, basic_string_char_const_ptr(assign)+pos, len);
642 basic_string_char_eos(this, len);
648 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
649 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
650 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
651 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
652 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign, 8)
653 basic_string_char* __thiscall MSVCP_basic_string_char_assign(
654 basic_string_char *this, const basic_string_char *assign)
656 return MSVCP_basic_string_char_assign_substr(this, assign,
657 0, MSVCP_basic_string_char_npos);
660 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
661 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
662 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign_cstr_len, 12)
663 basic_string_char* __thiscall MSVCP_basic_string_char_assign_cstr_len(
664 basic_string_char *this, const char *str, MSVCP_size_t len)
666 TRACE("%p %s %lu\n", this, debugstr_a(str), len);
668 if(basic_string_char_inside(this, str))
669 return MSVCP_basic_string_char_assign_substr(this, this,
670 str-basic_string_char_ptr(this), len);
671 else if(basic_string_char_grow(this, len, FALSE)) {
672 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this),
673 this->res, str, len);
674 basic_string_char_eos(this, len);
680 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
681 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
682 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
683 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
684 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign_cstr, 8)
685 basic_string_char* __thiscall MSVCP_basic_string_char_assign_cstr(
686 basic_string_char *this, const char *str)
688 return MSVCP_basic_string_char_assign_cstr_len(this, str,
689 MSVCP_char_traits_char_length(str));
692 /* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
693 /* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
694 /* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
695 /* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
696 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_c_str, 4)
697 const char* __thiscall MSVCP_basic_string_char_c_str(basic_string_char *this)
700 return basic_string_char_const_ptr(this);
703 /* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
704 /* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
705 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_capacity, 4)
706 MSVCP_size_t __thiscall MSVCP_basic_string_char_capacity(basic_string_char *this)
712 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
713 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
714 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor, 4)
715 basic_string_char* __thiscall MSVCP_basic_string_char_ctor(basic_string_char *this)
719 basic_string_char_tidy(this, FALSE, 0);
723 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z */
724 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@@Z */
725 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_copy_ctor, 8)
726 basic_string_char* __thiscall MSVCP_basic_string_char_copy_ctor(
727 basic_string_char *this, const basic_string_char *copy)
729 TRACE("%p %p\n", this, copy);
731 basic_string_char_tidy(this, FALSE, 0);
732 MSVCP_basic_string_char_assign(this, copy);
736 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z */
737 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z */
738 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_cstr, 8)
739 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr(
740 basic_string_char *this, const char *str)
742 TRACE("%p %s\n", this, debugstr_a(str));
744 basic_string_char_tidy(this, FALSE, 0);
745 MSVCP_basic_string_char_assign_cstr(this, str);
749 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDI@Z */
750 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD_K@Z */
751 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_cstr_len, 12)
752 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr_len(
753 basic_string_char *this, const char *str, MSVCP_size_t len)
755 TRACE("%p %s %ld\n", this, str, len);
757 basic_string_char_tidy(this, FALSE, 0);
758 MSVCP_basic_string_char_assign_cstr_len(this, str, len);
762 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@II@Z */
763 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@_K1@Z */
764 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_substr, 16)
765 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_substr(
766 basic_string_char *this, const basic_string_char *assign,
767 MSVCP_size_t pos, MSVCP_size_t len)
769 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
771 basic_string_char_tidy(this, FALSE, 0);
772 MSVCP_basic_string_char_assign_substr(this, assign, pos, len);
776 /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
777 /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
778 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_dtor, 4)
779 void __thiscall MSVCP_basic_string_char_dtor(basic_string_char *this)
782 basic_string_char_tidy(this, TRUE, 0);
785 /* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
786 /* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
787 /* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
788 /* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
789 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_length, 4)
790 MSVCP_size_t __thiscall MSVCP_basic_string_char_length(basic_string_char *this)
796 /* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXAAV12@@Z */
797 /* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEAV12@@Z */
798 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_swap, 8)
799 void __thiscall MSVCP_basic_string_char_swap(basic_string_char *this, basic_string_char *str)
802 char tmp[sizeof(this->data)];
803 const MSVCP_size_t size = this->size;
804 const MSVCP_size_t res = this->res;
806 memcpy(tmp, this->data.buf, sizeof(this->data));
807 memcpy(this->data.buf, str->data.buf, sizeof(this->data));
808 memcpy(str->data.buf, tmp, sizeof(this->data));
810 this->size = str->size;
811 this->res = str->res;
818 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
819 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
820 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_substr, 16)
821 basic_string_char* __thiscall MSVCP_basic_string_char_append_substr(basic_string_char *this,
822 const basic_string_char *append, MSVCP_size_t offset, MSVCP_size_t count)
824 TRACE("%p %p %lu %lu\n", this, append, offset, count);
826 if(append->size < offset)
827 MSVCP__String_base_Xran();
829 if(count > append->size-offset)
830 count = append->size-offset;
832 if(MSVCP_basic_string_char_npos-this->size<=count || this->size+count<this->size)
833 MSVCP__String_base_Xlen();
835 if(basic_string_char_grow(this, this->size+count, FALSE)) {
836 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this)+this->size,
837 this->res-this->size, basic_string_char_const_ptr(append)+offset, count);
838 basic_string_char_eos(this, this->size+count);
844 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
845 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
846 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
847 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
848 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append, 8)
849 basic_string_char* __thiscall MSVCP_basic_string_char_append(
850 basic_string_char *this, const basic_string_char *append)
852 return MSVCP_basic_string_char_append_substr(this, append,
853 0, MSVCP_basic_string_char_npos);
856 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
857 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
858 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_cstr_len, 12)
859 basic_string_char* __thiscall MSVCP_basic_string_char_append_cstr_len(
860 basic_string_char *this, const char *append, MSVCP_size_t count)
862 TRACE("%p %s %lu\n", this, append, count);
864 if(basic_string_char_inside(this, append))
865 return MSVCP_basic_string_char_append_substr(this, this,
866 append-basic_string_char_ptr(this), count);
868 if(MSVCP_basic_string_char_npos-this->size<=count || this->size+count<this->size)
869 MSVCP__String_base_Xlen();
871 if(basic_string_char_grow(this, this->size+count, FALSE)) {
872 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this)+this->size,
873 this->res-this->size, append, count);
874 basic_string_char_eos(this, this->size+count);
880 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
881 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
882 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
883 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
884 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_cstr, 8)
885 basic_string_char* __thiscall MSVCP_basic_string_char_append_cstr(
886 basic_string_char *this, const char *append)
888 return MSVCP_basic_string_char_append_cstr_len(this, append,
889 MSVCP_char_traits_char_length(append));
892 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z */
893 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KD@Z */
894 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_len_ch, 12)
895 basic_string_char* __thiscall MSVCP_basic_string_char_append_len_ch(
896 basic_string_char *this, MSVCP_size_t count, char ch)
898 TRACE("%p %lu %c\n", this, count, ch);
900 if(MSVCP_basic_string_char_npos-this->size <= count)
901 MSVCP__String_base_Xlen();
903 if(basic_string_char_grow(this, this->size+count, FALSE)) {
904 MSVCP_char_traits_char_assignn(basic_string_char_ptr(this)+this->size, count, ch);
905 basic_string_char_eos(this, this->size+count);
911 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z */
912 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z */
913 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_ch, 8)
914 basic_string_char* __thiscall MSVCP_basic_string_char_append_ch(
915 basic_string_char *this, char ch)
917 return MSVCP_basic_string_char_append_len_ch(this, 1, ch);
920 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z */
921 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@PEBD@Z */
922 basic_string_char* __cdecl MSVCP_basic_string_char_concatenate_bstr_cstr(basic_string_char *ret,
923 const basic_string_char *left, const char *right)
925 TRACE("%p %s\n", left, right);
927 MSVCP_basic_string_char_copy_ctor(ret, left);
928 MSVCP_basic_string_char_append_cstr(ret, right);
932 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z */
933 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBDAEBV10@@Z */
934 basic_string_char* __cdecl MSVCP_basic_string_char_concatenate_cstr_bstr(basic_string_char *ret,
935 const char *left, const basic_string_char *right)
937 TRACE("%s %p\n", left, right);
939 MSVCP_basic_string_char_ctor_cstr(ret, left);
940 MSVCP_basic_string_char_append(ret, right);
944 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z */
945 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@0@Z */
946 basic_string_char* __cdecl MSVCP_basic_string_char_concatenate(basic_string_char *ret,
947 const basic_string_char *left, const basic_string_char *right)
949 TRACE("%p %p\n", left, right);
951 MSVCP_basic_string_char_copy_ctor(ret, left);
952 MSVCP_basic_string_char_append(ret, right);
956 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBDI@Z */
957 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD0@Z */
958 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr_cstr_len, 20)
959 int __thiscall MSVCP_basic_string_char_compare_substr_cstr_len(
960 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
961 const char *str, MSVCP_size_t count)
965 TRACE("%p %lu %lu %s %lu\n", this, pos, num, str, count);
968 MSVCP__String_base_Xran();
970 if(pos+num > this->size)
971 num = this->size-pos;
973 ans = MSVCP_char_traits_char_compare(basic_string_char_const_ptr(this)+pos,
974 str, num>count ? count : num);
985 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBD@Z */
986 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD@Z */
987 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr_cstr, 16)
988 int __thiscall MSVCP_basic_string_char_compare_substr_cstr(const basic_string_char *this,
989 MSVCP_size_t pos, MSVCP_size_t num, const char *str)
991 return MSVCP_basic_string_char_compare_substr_cstr_len(this, pos, num,
992 str, MSVCP_char_traits_char_length(str));
995 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHPBD@Z */
996 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHPEBD@Z */
997 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_cstr, 8)
998 int __thiscall MSVCP_basic_string_char_compare_cstr(
999 const basic_string_char *this, const char *str)
1001 return MSVCP_basic_string_char_compare_substr_cstr_len(this, 0, this->size,
1002 str, MSVCP_char_traits_char_length(str));
1005 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@II@Z */
1006 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@00@Z */
1007 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr_substr, 24)
1008 int __thiscall MSVCP_basic_string_char_compare_substr_substr(
1009 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
1010 const basic_string_char *compare, MSVCP_size_t off, MSVCP_size_t count)
1012 TRACE("%p %lu %lu %p %lu %lu\n", this, pos, num, compare, off, count);
1014 if(compare->size < off)
1015 MSVCP__String_base_Xran();
1017 if(off+count > compare->size)
1018 count = compare->size-off;
1020 return MSVCP_basic_string_char_compare_substr_cstr_len(this, pos, num,
1021 basic_string_char_const_ptr(compare)+off, count);
1024 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@@Z */
1025 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@@Z */
1026 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr, 16)
1027 int __thiscall MSVCP_basic_string_char_compare_substr(
1028 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
1029 const basic_string_char *compare)
1031 return MSVCP_basic_string_char_compare_substr_cstr_len(this, pos, num,
1032 basic_string_char_const_ptr(compare), compare->size);
1035 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHABV12@@Z */
1036 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHAEBV12@@Z */
1037 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare, 8)
1038 int __thiscall MSVCP_basic_string_char_compare(
1039 const basic_string_char *this, const basic_string_char *compare)
1041 return MSVCP_basic_string_char_compare_substr_cstr_len(this, 0, this->size,
1042 basic_string_char_const_ptr(compare), compare->size);
1045 /* ??$?MDU?$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 */
1046 /* ??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
1047 MSVCP_bool __cdecl MSVCP_basic_string_char_lower(
1048 const basic_string_char *left, const basic_string_char *right)
1050 return MSVCP_basic_string_char_compare(left, right) < 0;
1053 /* ??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
1054 /* ??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
1055 MSVCP_bool __cdecl MSVCP_basic_string_char_lower_bstr_cstr(
1056 const basic_string_char *left, const char *right)
1058 return MSVCP_basic_string_char_compare_cstr(left, right) < 0;
1061 /* ??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
1062 /* ??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
1063 MSVCP_bool __cdecl MSVCP_basic_string_char_lower_cstr_bstr(
1064 const char *left, const basic_string_char *right)
1066 return MSVCP_basic_string_char_compare_cstr(right, left) > 0;
1069 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
1070 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
1071 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_cstr_substr, 16)
1072 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_cstr_substr(
1073 const basic_string_char *this, const char *find, MSVCP_size_t pos, MSVCP_size_t len)
1075 const char *p, *end;
1077 TRACE("%p %s %lu %lu\n", this, find, pos, len);
1079 if(len==0 && pos<=this->size)
1082 end = basic_string_char_const_ptr(this)+this->size-len+1;
1083 for(p=basic_string_char_const_ptr(this)+pos; p<end; p++) {
1084 p = MSVCP_char_traits_char_find(p, end-p, find);
1088 if(!MSVCP_char_traits_char_compare(p, find, len))
1089 return p-basic_string_char_const_ptr(this);
1092 return MSVCP_basic_string_char_npos;
1095 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
1096 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
1097 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_ch, 12)
1098 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_ch(
1099 const basic_string_char *this, char ch, MSVCP_size_t pos)
1101 return MSVCP_basic_string_char_find_cstr_substr(this, &ch, pos, 1);
1104 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
1105 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
1106 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
1107 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
1108 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_at, 8)
1109 char* __thiscall MSVCP_basic_string_char_at(
1110 basic_string_char *this, MSVCP_size_t pos)
1112 TRACE("%p %lu\n", this, pos);
1114 if(this->size <= pos)
1115 MSVCP__String_base_Xran();
1117 return basic_string_char_ptr(this)+pos;
1120 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
1121 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
1122 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
1123 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
1124 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_const_at, 8)
1125 const char* __thiscall MSVCP_basic_string_char_const_at(
1126 const basic_string_char *this, MSVCP_size_t pos)
1128 TRACE("%p %lu\n", this, pos);
1130 if(this->size <= pos)
1131 MSVCP__String_base_Xran();
1133 return basic_string_char_const_ptr(this)+pos;
1136 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXID@Z */
1137 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_KD@Z */
1138 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_resize_ch, 12)
1139 void __thiscall MSVCP_basic_string_char_resize_ch(
1140 basic_string_char *this, MSVCP_size_t size, char ch)
1142 TRACE("%p %lu %c\n", this, size, ch);
1144 if(size <= this->size)
1145 MSVCP_basic_string_char_erase(this, size, this->size);
1147 MSVCP_basic_string_char_append_len_ch(this, size-this->size, ch);
1150 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z */
1151 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K@Z */
1152 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_resize, 8)
1153 void __thiscall MSVCP_basic_string_char_resize(
1154 basic_string_char *this, MSVCP_size_t size)
1156 MSVCP_basic_string_char_resize_ch(this, size, '\0');
1159 /* ?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
1160 /* ?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
1161 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_clear, 4)
1162 void __thiscall MSVCP_basic_string_char_clear(basic_string_char *this)
1164 basic_string_char_eos(this, 0);
1168 /* basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t>> */
1169 /* ?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2IB */
1170 /* ?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2_KB */
1171 const MSVCP_size_t MSVCP_basic_string_wchar_npos = -1;
1173 /* Internal: basic_string_wchar_ptr - return pointer to stored string */
1174 static wchar_t* basic_string_wchar_ptr(basic_string_wchar *this)
1176 if(this->res == BUF_SIZE_WCHAR-1)
1177 return this->data.buf;
1178 return this->data.ptr;
1181 /* Internal: basic_string_wchar_const_ptr - returns const pointer to stored string */
1182 static const wchar_t* basic_string_wchar_const_ptr(const basic_string_wchar *this)
1184 if(this->res == BUF_SIZE_WCHAR-1)
1185 return this->data.buf;
1186 return this->data.ptr;
1189 /* Internal: basic_string_wchar_eos - sets string length, puts '\0' on the end */
1190 static void basic_string_wchar_eos(basic_string_wchar *this, MSVCP_size_t len)
1192 static const wchar_t nullbyte_w = '\0';
1195 MSVCP_char_traits_wchar_assign(basic_string_wchar_ptr(this)+len, &nullbyte_w);
1198 /* Internal: basic_string_char_inside - checks if given pointer points inside stored string */
1199 static MSVCP_bool basic_string_wchar_inside(
1200 basic_string_wchar *this, const wchar_t *ptr)
1202 wchar_t *cstr = basic_string_wchar_ptr(this);
1204 return (ptr<cstr || ptr>=cstr+this->size) ? FALSE : TRUE;
1207 /* Internal: basic_string_char_tidy - initialize basic_string buffer, deallocates data */
1208 /* Caution: new_size have to be smaller than BUF_SIZE_WCHAR */
1209 static void basic_string_wchar_tidy(basic_string_wchar *this,
1210 MSVCP_bool built, MSVCP_size_t new_size)
1212 if(built && BUF_SIZE_WCHAR<=this->res) {
1213 wchar_t *ptr = this->data.ptr;
1216 MSVCP_char_traits_wchar__Copy_s(this->data.buf, BUF_SIZE_WCHAR, ptr, new_size);
1217 MSVCP_allocator_wchar_deallocate(this->allocator, ptr, this->res+1);
1220 this->res = BUF_SIZE_WCHAR-1;
1221 basic_string_wchar_eos(this, new_size);
1224 /* Internal: basic_string_wchar_grow - changes size of internal buffer */
1225 static MSVCP_bool basic_string_wchar_grow(
1226 basic_string_wchar *this, MSVCP_size_t new_size, MSVCP_bool trim)
1228 if(this->res < new_size) {
1229 MSVCP_size_t new_res = new_size;
1234 if(new_res/3 < this->res/2)
1235 new_res = this->res + this->res/2;
1237 ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_res);
1239 ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_size+1);
1243 ERR("Out of memory\n");
1244 basic_string_wchar_tidy(this, TRUE, 0);
1248 MSVCP_char_traits_wchar__Copy_s(ptr, new_size,
1249 basic_string_wchar_ptr(this), this->size);
1250 basic_string_wchar_tidy(this, TRUE, 0);
1251 this->data.ptr = ptr;
1252 this->res = new_size;
1253 basic_string_wchar_eos(this, this->size);
1254 } else if(trim && new_size < BUF_SIZE_WCHAR)
1255 basic_string_wchar_tidy(this, TRUE,
1256 new_size<this->size ? new_size : this->size);
1257 else if(new_size == 0)
1258 basic_string_wchar_eos(this, 0);
1260 return (new_size>0);
1263 /* ?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@II@Z */
1264 /* ?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K0@Z */
1265 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_erase, 12)
1266 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_erase(
1267 basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t len)
1269 TRACE("%p %lu %lu\n", this, pos, len);
1271 if(pos > this->size) {
1272 MSVCP__String_base_Xran();
1276 if(len > this->size-pos)
1277 len = this->size-pos;
1280 MSVCP_char_traits_wchar__Move_s(basic_string_wchar_ptr(this)+pos,
1281 this->res-pos, basic_string_wchar_ptr(this)+pos+len,
1282 this->size-pos-len);
1283 basic_string_wchar_eos(this, this->size-len);
1289 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z */
1290 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
1291 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign_substr, 16)
1292 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign_substr(
1293 basic_string_wchar *this, const basic_string_wchar *assign,
1294 MSVCP_size_t pos, MSVCP_size_t len)
1296 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
1298 if(assign->size < pos) {
1299 MSVCP__String_base_Xran();
1303 if(len > assign->size-pos)
1304 len = assign->size-pos;
1306 if(this == assign) {
1307 MSVCP_basic_string_wchar_erase(this, pos+len, MSVCP_basic_string_wchar_npos);
1308 MSVCP_basic_string_wchar_erase(this, 0, pos);
1309 } else if(basic_string_wchar_grow(this, len, FALSE)) {
1310 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this),
1311 this->res, basic_string_wchar_const_ptr(assign)+pos, len);
1312 basic_string_wchar_eos(this, len);
1318 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@@Z */
1319 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@@Z */
1320 /* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@ABV01@@Z */
1321 /* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z */
1322 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign, 8)
1323 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign(
1324 basic_string_wchar *this, const basic_string_wchar *assign)
1326 return MSVCP_basic_string_wchar_assign_substr(this, assign,
1327 0, MSVCP_basic_string_wchar_npos);
1330 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z */
1331 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W_K@Z */
1332 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign_cstr_len, 12)
1333 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign_cstr_len(
1334 basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len)
1336 TRACE("%p %s %lu\n", this, debugstr_w(str), len);
1338 if(basic_string_wchar_inside(this, str))
1339 return MSVCP_basic_string_wchar_assign_substr(this, this,
1340 str-basic_string_wchar_ptr(this), len);
1341 else if(basic_string_wchar_grow(this, len, FALSE)) {
1342 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this),
1343 this->res, str, len);
1344 basic_string_wchar_eos(this, len);
1350 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z */
1351 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W@Z */
1352 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign_cstr, 8)
1353 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign_cstr(
1354 basic_string_wchar *this, const wchar_t *str)
1356 return MSVCP_basic_string_wchar_assign_cstr_len(this, str,
1357 MSVCP_char_traits_wchar_length(str));
1360 /* ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ */
1361 /* ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ */
1362 /* ?data@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ */
1363 /* ?data@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ */
1364 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_c_str, 4)
1365 const wchar_t* __thiscall MSVCP_basic_string_wchar_c_str(basic_string_wchar *this)
1367 TRACE("%p\n", this);
1368 return basic_string_wchar_const_ptr(this);
1371 /* ?capacity@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
1372 /* ?capacity@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
1373 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_capacity, 4)
1374 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_capacity(basic_string_wchar *this)
1376 TRACE("%p\n", this);
1380 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ */
1381 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ */
1382 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor, 4)
1383 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor(basic_string_wchar *this)
1385 TRACE("%p\n", this);
1387 basic_string_wchar_tidy(this, FALSE, 0);
1391 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV01@@Z */
1392 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV01@@Z */
1393 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_copy_ctor, 8)
1394 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_copy_ctor(
1395 basic_string_wchar *this, const basic_string_wchar *copy)
1397 TRACE("%p %p\n", this, copy);
1399 basic_string_wchar_tidy(this, FALSE, 0);
1400 MSVCP_basic_string_wchar_assign(this, copy);
1404 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_W@Z */
1405 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W@Z */
1406 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_cstr, 8)
1407 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr(
1408 basic_string_wchar *this, const wchar_t *str)
1410 TRACE("%p %s\n", this, debugstr_w(str));
1412 basic_string_wchar_tidy(this, FALSE, 0);
1413 MSVCP_basic_string_wchar_assign_cstr(this, str);
1417 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_WI@Z */
1418 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W_K@Z */
1419 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_cstr_len, 12)
1420 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr_len(
1421 basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len)
1423 TRACE("%p %s %ld\n", this, debugstr_w(str), len);
1425 basic_string_wchar_tidy(this, FALSE, 0);
1426 MSVCP_basic_string_wchar_assign_cstr_len(this, str, len);
1430 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV01@II@Z */
1431 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV01@_K1@Z */
1432 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_substr, 16)
1433 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_substr(
1434 basic_string_wchar *this, const basic_string_wchar *assign,
1435 MSVCP_size_t pos, MSVCP_size_t len)
1437 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
1439 basic_string_wchar_tidy(this, FALSE, 0);
1440 MSVCP_basic_string_wchar_assign_substr(this, assign, pos, len);
1444 /* ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ */
1445 /* ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ */
1446 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_dtor, 4)
1447 void __thiscall MSVCP_basic_string_wchar_dtor(basic_string_wchar *this)
1449 TRACE("%p\n", this);
1450 basic_string_wchar_tidy(this, TRUE, 0);
1453 /* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
1454 /* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
1455 /* ?length@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
1456 /* ?length@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
1457 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_length, 4)
1458 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_length(basic_string_wchar *this)
1460 TRACE("%p\n", this);
1464 /* ?swap@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXAAV12@@Z */
1465 /* ?swap@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXAEAV12@@Z */
1466 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_swap, 8)
1467 void __thiscall MSVCP_basic_string_wchar_swap(basic_string_wchar *this, basic_string_wchar *str)
1470 char tmp[sizeof(this->data)];
1471 const MSVCP_size_t size = this->size;
1472 const MSVCP_size_t res = this->res;
1474 memcpy(tmp, this->data.buf, sizeof(this->data));
1475 memcpy(this->data.buf, str->data.buf, sizeof(this->data));
1476 memcpy(str->data.buf, tmp, sizeof(this->data));
1478 this->size = str->size;
1479 this->res = str->res;
1486 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z */
1487 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
1488 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_substr, 16)
1489 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_substr(basic_string_wchar *this,
1490 const basic_string_wchar *append, MSVCP_size_t offset, MSVCP_size_t count)
1492 TRACE("%p %p %lu %lu\n", this, append, offset, count);
1494 if(append->size < offset)
1495 MSVCP__String_base_Xran();
1497 if(count > append->size-offset)
1498 count = append->size-offset;
1500 if(MSVCP_basic_string_wchar_npos-this->size<=count || this->size+count<this->size)
1501 MSVCP__String_base_Xlen();
1503 if(basic_string_wchar_grow(this, this->size+count, FALSE)) {
1504 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this)+this->size,
1505 this->res-this->size, basic_string_wchar_const_ptr(append)+offset, count);
1506 basic_string_wchar_eos(this, this->size+count);
1512 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@@Z */
1513 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@@Z */
1514 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@ABV01@@Z */
1515 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z */
1516 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append, 8)
1517 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append(
1518 basic_string_wchar *this, const basic_string_wchar *append)
1520 return MSVCP_basic_string_wchar_append_substr(this, append,
1521 0, MSVCP_basic_string_wchar_npos);
1524 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z */
1525 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W_K@Z */
1526 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_cstr_len, 12)
1527 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_cstr_len(
1528 basic_string_wchar *this, const wchar_t *append, MSVCP_size_t count)
1530 TRACE("%p %s %lu\n", this, debugstr_w(append), count);
1532 if(basic_string_wchar_inside(this, append))
1533 return MSVCP_basic_string_wchar_append_substr(this, this,
1534 append-basic_string_wchar_ptr(this), count);
1536 if(MSVCP_basic_string_wchar_npos-this->size<=count || this->size+count<this->size)
1537 MSVCP__String_base_Xlen();
1539 if(basic_string_wchar_grow(this, this->size+count, FALSE)) {
1540 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this)+this->size,
1541 this->res-this->size, append, count);
1542 basic_string_wchar_eos(this, this->size+count);
1548 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z */
1549 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W@Z */
1550 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z */
1551 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@PEB_W@Z */
1552 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_cstr, 8)
1553 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_cstr(
1554 basic_string_wchar *this, const wchar_t *append)
1556 return MSVCP_basic_string_wchar_append_cstr_len(this, append,
1557 MSVCP_char_traits_wchar_length(append));
1560 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@I_W@Z */
1561 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K_W@Z */
1562 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_len_ch, 12)
1563 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_len_ch(
1564 basic_string_wchar *this, MSVCP_size_t count, wchar_t ch)
1566 TRACE("%p %lu %c\n", this, count, ch);
1568 if(MSVCP_basic_string_wchar_npos-this->size <= count)
1569 MSVCP__String_base_Xlen();
1571 if(basic_string_wchar_grow(this, this->size+count, FALSE)) {
1572 MSVCP_char_traits_wchar_assignn(basic_string_wchar_ptr(this)+this->size, count, ch);
1573 basic_string_wchar_eos(this, this->size+count);
1579 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@_W@Z */
1580 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@_W@Z */
1581 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_ch, 8)
1582 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_ch(
1583 basic_string_wchar *this, wchar_t ch)
1585 return MSVCP_basic_string_wchar_append_len_ch(this, 1, ch);
1588 /* ??$?H_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@ABV10@PB_W@Z */
1589 /* ??$?H_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@AEBV10@PEB_W@Z */
1590 basic_string_wchar* __cdecl MSVCP_basic_string_wchar_concatenate_bstr_cstr(basic_string_wchar *ret,
1591 const basic_string_wchar *left, const wchar_t *right)
1593 TRACE("%p %s\n", left, debugstr_w(right));
1595 MSVCP_basic_string_wchar_copy_ctor(ret, left);
1596 MSVCP_basic_string_wchar_append_cstr(ret, right);
1600 /* ??$?H_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@PB_WABV10@@Z */
1601 /* ??$?H_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@PEB_WAEBV10@@Z */
1602 basic_string_wchar* __cdecl MSVCP_basic_string_wchar_concatenate_cstr_bstr(basic_string_wchar *ret,
1603 const wchar_t *left, const basic_string_wchar *right)
1605 TRACE("%s %p\n", debugstr_w(left), right);
1607 MSVCP_basic_string_wchar_ctor_cstr(ret, left);
1608 MSVCP_basic_string_wchar_append(ret, right);
1612 /* ??$?H_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@ABV10@0@Z */
1613 /* ??$?H_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@AEBV10@0@Z */
1614 basic_string_wchar* __cdecl MSVCP_basic_string_wchar_concatenate(basic_string_wchar *ret,
1615 const basic_string_wchar *left, const basic_string_wchar *right)
1617 TRACE("%p %p\n", left, right);
1619 MSVCP_basic_string_wchar_copy_ctor(ret, left);
1620 MSVCP_basic_string_wchar_append(ret, right);
1624 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIPB_WI@Z */
1625 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0PEB_W0@Z */
1626 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr_cstr_len, 20)
1627 int __thiscall MSVCP_basic_string_wchar_compare_substr_cstr_len(
1628 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
1629 const wchar_t *str, MSVCP_size_t count)
1633 TRACE("%p %lu %lu %s %lu\n", this, pos, num, debugstr_w(str), count);
1635 if(this->size < pos)
1636 MSVCP__String_base_Xran();
1638 if(pos+num > this->size)
1639 num = this->size-pos;
1641 ans = MSVCP_char_traits_wchar_compare(basic_string_wchar_const_ptr(this)+pos,
1642 str, num>count ? count : num);
1648 else if(num < count)
1653 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIPB_W@Z */
1654 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0PEB_W@Z */
1655 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr_cstr, 16)
1656 int __thiscall MSVCP_basic_string_wchar_compare_substr_cstr(const basic_string_wchar *this,
1657 MSVCP_size_t pos, MSVCP_size_t num, const wchar_t *str)
1659 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, pos, num,
1660 str, MSVCP_char_traits_wchar_length(str));
1663 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHPB_W@Z */
1664 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAHPEB_W@Z */
1665 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_cstr, 8)
1666 int __thiscall MSVCP_basic_string_wchar_compare_cstr(
1667 const basic_string_wchar *this, const wchar_t *str)
1669 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, 0, this->size,
1670 str, MSVCP_char_traits_wchar_length(str));
1673 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIABV12@II@Z */
1674 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0AEBV12@00@Z */
1675 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr_substr, 24)
1676 int __thiscall MSVCP_basic_string_wchar_compare_substr_substr(
1677 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
1678 const basic_string_wchar *compare, MSVCP_size_t off, MSVCP_size_t count)
1680 TRACE("%p %lu %lu %p %lu %lu\n", this, pos, num, compare, off, count);
1682 if(compare->size < off)
1683 MSVCP__String_base_Xran();
1685 if(off+count > compare->size)
1686 count = compare->size-off;
1688 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, pos, num,
1689 basic_string_wchar_const_ptr(compare)+off, count);
1692 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIABV12@@Z */
1693 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0AEBV12@@Z */
1694 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr, 16)
1695 int __thiscall MSVCP_basic_string_wchar_compare_substr(
1696 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
1697 const basic_string_wchar *compare)
1699 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, pos, num,
1700 basic_string_wchar_const_ptr(compare), compare->size);
1703 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHABV12@@Z */
1704 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAHAEBV12@@Z */
1705 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare, 8)
1706 int __thiscall MSVCP_basic_string_wchar_compare(
1707 const basic_string_wchar *this, const basic_string_wchar *compare)
1709 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, 0, this->size,
1710 basic_string_wchar_const_ptr(compare), compare->size);
1713 /* ??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z */
1714 /* ??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@0@Z */
1715 MSVCP_bool __cdecl MSVCP_basic_string_wchar_lower(
1716 const basic_string_wchar *left, const basic_string_wchar *right)
1718 return MSVCP_basic_string_wchar_compare(left, right) < 0;
1721 /* ??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@PB_W@Z */
1722 /* ??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@PEB_W@Z */
1723 MSVCP_bool __cdecl MSVCP_basic_string_wchar_lower_bstr_cstr(
1724 const basic_string_wchar *left, const wchar_t *right)
1726 return MSVCP_basic_string_wchar_compare_cstr(left, right) < 0;
1729 /* ??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NPB_WABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
1730 /* ??$?M_WU?$char_traits@_W@std@@V?$allocator@_W@1@@std@@YA_NPEB_WAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z */
1731 MSVCP_bool __cdecl MSVCP_basic_string_wchar_lower_cstr_bstr(
1732 const wchar_t *left, const basic_string_wchar *right)
1734 return MSVCP_basic_string_wchar_compare_cstr(right, left) > 0;
1737 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIPB_WII@Z */
1738 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KPEB_W_K1@Z */
1739 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_cstr_substr, 16)
1740 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_cstr_substr(
1741 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t pos, MSVCP_size_t len)
1743 const wchar_t *p, *end;
1745 TRACE("%p %s %lu %lu\n", this, debugstr_w(find), pos, len);
1747 if(len==0 && pos<=this->size)
1750 end = basic_string_wchar_const_ptr(this)+this->size-len+1;
1751 for(p=basic_string_wchar_const_ptr(this)+pos; p<end; p++) {
1752 p = MSVCP_char_traits_wchar_find(p, end-p, find);
1756 if(!MSVCP_char_traits_wchar_compare(p, find, len))
1757 return p-basic_string_wchar_const_ptr(this);
1760 return MSVCP_basic_string_wchar_npos;
1763 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEI_WI@Z */
1764 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_K_W_K@Z */
1765 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_ch, 12)
1766 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_ch(
1767 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t pos)
1769 return MSVCP_basic_string_wchar_find_cstr_substr(this, &ch, pos, 1);
1772 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAA_WI@Z */
1773 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z */
1774 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAA_WI@Z */
1775 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z */
1776 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_at, 8)
1777 wchar_t* __thiscall MSVCP_basic_string_wchar_at(
1778 basic_string_wchar *this, MSVCP_size_t pos)
1780 TRACE("%p %lu\n", this, pos);
1782 if(this->size <= pos)
1783 MSVCP__String_base_Xran();
1785 return basic_string_wchar_ptr(this)+pos;
1788 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEAB_WI@Z */
1789 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAAEB_W_K@Z */
1790 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEAB_WI@Z */
1791 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAAEB_W_K@Z */
1792 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_const_at, 8)
1793 const wchar_t* __thiscall MSVCP_basic_string_wchar_const_at(
1794 const basic_string_wchar *this, MSVCP_size_t pos)
1796 TRACE("%p %lu\n", this, pos);
1798 if(this->size <= pos)
1799 MSVCP__String_base_Xran();
1801 return basic_string_wchar_const_ptr(this)+pos;
1804 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXI_W@Z */
1805 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAX_K_W@Z */
1806 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_resize_ch, 12)
1807 void __thiscall MSVCP_basic_string_wchar_resize_ch(
1808 basic_string_wchar *this, MSVCP_size_t size, wchar_t ch)
1810 TRACE("%p %lu %c\n", this, size, ch);
1812 if(size <= this->size)
1813 MSVCP_basic_string_wchar_erase(this, size, this->size);
1815 MSVCP_basic_string_wchar_append_len_ch(this, size-this->size, ch);
1818 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXI@Z */
1819 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAX_K@Z */
1820 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_resize, 8)
1821 void __thiscall MSVCP_basic_string_wchar_resize(
1822 basic_string_wchar *this, MSVCP_size_t size)
1824 MSVCP_basic_string_wchar_resize_ch(this, size, '\0');
1827 /* ?clear@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
1828 /* ?clear@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
1829 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_clear, 4)
1830 void __thiscall MSVCP_basic_string_wchar_clear(basic_string_wchar *this)
1832 basic_string_wchar_eos(this, 0);