msvcp90: Added basic_string::substr(size_t, size_t) implementation.
[wine/multimedia.git] / dlls / msvcp90 / string.c
blob2ad568c0198749fe534ba1415a6240794ad3921a
1 /*
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
19 #include "config.h"
21 #include <stdarg.h>
23 #include "msvcp90.h"
24 #include "stdio.h"
26 #include "windef.h"
27 #include "winbase.h"
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)
36 *ch = *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)
43 return *ch1 == *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)
50 return *ch1 < *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)
66 return strlen(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) {
75 if(dest && size)
76 dest[0] = '\0';
77 _invalid_parameter(NULL, NULL, NULL, 0, 0);
78 return dest;
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) {
106 if(dest && size)
107 dest[0] = '\0';
108 _invalid_parameter(NULL, NULL, NULL, 0, 0);
109 return dest;
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)
134 return (char)*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)
141 return (int)*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)
148 return *i1 == *i2;
151 /* ?eof@?$char_traits@D@std@@SAHXZ */
152 int CDECL MSVCP_char_traits_char_eof(void)
154 return EOF;
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)
171 *ch = *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)
178 return *ch1 == *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,
184 const wchar_t *ch2)
186 return *ch1 < *ch2;
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) {
211 if(dest && size)
212 dest[0] = '\0';
213 _invalid_parameter(NULL, NULL, NULL, 0, 0);
214 return dest;
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)
233 MSVCP_size_t i=0;
235 for(i=0; i<range; i++)
236 if(str[i] == *c)
237 return str+i;
239 return NULL;
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) {
248 if(dest && size)
249 dest[0] = '\0';
250 _invalid_parameter(NULL, NULL, NULL, 0, 0);
251 return dest;
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)
270 MSVCP_size_t i;
272 for(i=0; i<num; i++)
273 str[i] = c;
275 return str;
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)
282 return *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)
289 return *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)
297 return *i1 == *i2;
300 /* ?eof@?$char_traits@_W@std@@SAGXZ */
301 unsigned short CDECL MSVCP_char_traits_wchar_eof(void)
303 return WEOF;
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)
320 *ch = *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)
328 return *ch1 == *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)
336 return *ch1 < *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)
344 MSVCP_size_t i;
346 for(i=0; i<count; i++)
347 if(s1[i] != s2[i])
348 return (s1[i] < s2[i] ? -1 : 1);
350 return 0;
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)
357 MSVCP_size_t len;
359 for(len=0; str[len]; len++);
361 return 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)
369 if(size<count) {
370 _invalid_parameter(NULL, NULL, NULL, 0, 0);
371 return dest;
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)
390 MSVCP_size_t i;
392 for(i=0; i<range; i++)
393 if(str[i] == *c)
394 return str+i;
396 return NULL;
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)
404 if(size<count) {
405 _invalid_parameter(NULL, NULL, NULL, 0, 0);
406 return dest;
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)
425 MSVCP_size_t i;
427 for(i=0; i<num; i++)
428 str[i] = c;
430 return str;
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)
437 return *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)
444 return *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,
450 unsigned short *i2)
452 return *i1 == *i2;
455 /* ?eof@?$char_traits@G@std@@SAGXZ */
456 unsigned short CDECL MSVCP_char_traits_short_eof(void)
458 return -1;
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);
469 /* _String_base */
470 /* ?_Xlen@_String_base@std@@SAXXZ */
471 void CDECL MSVCP__String_base_Xlen(void)
473 static const char msg[] = "string too long";
475 TRACE("\n");
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";
484 TRACE("\n");
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";
493 TRACE("\n");
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 /* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEPADXZ */
504 /* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAPEADXZ */
505 DEFINE_THISCALL_WRAPPER(basic_string_char_ptr, 4)
506 char* __thiscall basic_string_char_ptr(basic_string_char *this)
508 if(this->res == BUF_SIZE_CHAR-1)
509 return this->data.buf;
510 return this->data.ptr;
513 /* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IBEPBDXZ */
514 /* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEBAPEBDXZ */
515 DEFINE_THISCALL_WRAPPER(basic_string_char_const_ptr, 4)
516 const char* __thiscall basic_string_char_const_ptr(const basic_string_char *this)
518 if(this->res == BUF_SIZE_CHAR-1)
519 return this->data.buf;
520 return this->data.ptr;
523 /* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXI@Z */
524 /* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAX_K@Z */
525 DEFINE_THISCALL_WRAPPER(basic_string_char_eos, 8)
526 void __thiscall basic_string_char_eos(basic_string_char *this, MSVCP_size_t len)
528 static const char nullbyte = '\0';
530 this->size = len;
531 MSVCP_char_traits_char_assign(basic_string_char_ptr(this)+len, &nullbyte);
534 /* ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NPBD@Z */
535 /* ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAA_NPEBD@Z */
536 DEFINE_THISCALL_WRAPPER(basic_string_char_inside, 8)
537 MSVCP_bool __thiscall basic_string_char_inside(
538 basic_string_char *this, const char *ptr)
540 char *cstr = basic_string_char_ptr(this);
542 return (ptr<cstr || ptr>=cstr+this->size) ? FALSE : TRUE;
545 /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEX_NI@Z */
546 /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAX_N_K@Z */
547 DEFINE_THISCALL_WRAPPER(basic_string_char_tidy, 12)
548 void __thiscall basic_string_char_tidy(basic_string_char *this,
549 MSVCP_bool built, MSVCP_size_t new_size)
551 if(built && BUF_SIZE_CHAR<=this->res) {
552 char *ptr = this->data.ptr;
554 if(new_size > 0)
555 MSVCP_char_traits_char__Copy_s(this->data.buf, BUF_SIZE_CHAR, ptr, new_size);
556 MSVCP_allocator_char_deallocate(this->allocator, ptr, this->res+1);
559 this->res = BUF_SIZE_CHAR-1;
560 basic_string_char_eos(this, new_size);
563 /* Exported only from msvcp60/70 */
564 /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z */
565 /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAX_N@Z */
566 DEFINE_THISCALL_WRAPPER(basic_string_char_tidy_built, 8)
567 void __thiscall basic_string_char_tidy_built(basic_string_char *this, MSVCP_bool built)
569 basic_string_char_tidy(this, built, 0);
572 /* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z */
573 /* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAA_N_K_N@Z */
574 DEFINE_THISCALL_WRAPPER(basic_string_char_grow, 12)
575 MSVCP_bool __thiscall basic_string_char_grow(
576 basic_string_char *this, MSVCP_size_t new_size, MSVCP_bool trim)
578 if(this->res < new_size) {
579 MSVCP_size_t new_res = new_size;
580 char *ptr;
582 new_res |= 0xf;
584 if(new_res/3 < this->res/2)
585 new_res = this->res + this->res/2;
587 ptr = MSVCP_allocator_char_allocate(this->allocator, new_res);
588 if(!ptr)
589 ptr = MSVCP_allocator_char_allocate(this->allocator, new_size+1);
590 else
591 new_size = new_res;
592 if(!ptr) {
593 ERR("Out of memory\n");
594 basic_string_char_tidy(this, TRUE, 0);
595 return FALSE;
598 MSVCP_char_traits_char__Copy_s(ptr, new_size,
599 basic_string_char_ptr(this), this->size);
600 basic_string_char_tidy(this, TRUE, 0);
601 this->data.ptr = ptr;
602 this->res = new_size;
603 basic_string_char_eos(this, this->size);
604 } else if(trim && new_size < BUF_SIZE_CHAR)
605 basic_string_char_tidy(this, TRUE,
606 new_size<this->size ? new_size : this->size);
607 else if(new_size == 0)
608 basic_string_char_eos(this, 0);
610 return (new_size>0);
613 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z */
614 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0@Z */
615 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_erase, 12)
616 basic_string_char* __thiscall MSVCP_basic_string_char_erase(
617 basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t len)
619 TRACE("%p %lu %lu\n", this, pos, len);
621 if(pos > this->size) {
622 MSVCP__String_base_Xran();
623 return NULL;
626 if(len > this->size-pos)
627 len = this->size-pos;
629 if(len) {
630 MSVCP_char_traits_char__Move_s(basic_string_char_ptr(this)+pos,
631 this->res-pos, basic_string_char_ptr(this)+pos+len,
632 this->size-pos-len);
633 basic_string_char_eos(this, this->size-len);
636 return this;
639 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
640 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
641 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign_substr, 16)
642 basic_string_char* __thiscall MSVCP_basic_string_char_assign_substr(
643 basic_string_char *this, const basic_string_char *assign,
644 MSVCP_size_t pos, MSVCP_size_t len)
646 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
648 if(assign->size < pos) {
649 MSVCP__String_base_Xran();
650 return NULL;
653 if(len > assign->size-pos)
654 len = assign->size-pos;
656 if(this == assign) {
657 MSVCP_basic_string_char_erase(this, pos+len, MSVCP_basic_string_char_npos);
658 MSVCP_basic_string_char_erase(this, 0, pos);
659 } else if(basic_string_char_grow(this, len, FALSE)) {
660 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this),
661 this->res, basic_string_char_const_ptr(assign)+pos, len);
662 basic_string_char_eos(this, len);
665 return this;
668 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
669 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
670 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
671 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
672 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign, 8)
673 basic_string_char* __thiscall MSVCP_basic_string_char_assign(
674 basic_string_char *this, const basic_string_char *assign)
676 return MSVCP_basic_string_char_assign_substr(this, assign,
677 0, MSVCP_basic_string_char_npos);
680 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
681 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
682 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign_cstr_len, 12)
683 basic_string_char* __thiscall MSVCP_basic_string_char_assign_cstr_len(
684 basic_string_char *this, const char *str, MSVCP_size_t len)
686 TRACE("%p %s %lu\n", this, debugstr_a(str), len);
688 if(basic_string_char_inside(this, str))
689 return MSVCP_basic_string_char_assign_substr(this, this,
690 str-basic_string_char_ptr(this), len);
691 else if(basic_string_char_grow(this, len, FALSE)) {
692 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this),
693 this->res, str, len);
694 basic_string_char_eos(this, len);
697 return this;
700 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
701 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
702 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
703 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
704 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign_cstr, 8)
705 basic_string_char* __thiscall MSVCP_basic_string_char_assign_cstr(
706 basic_string_char *this, const char *str)
708 return MSVCP_basic_string_char_assign_cstr_len(this, str,
709 MSVCP_char_traits_char_length(str));
712 /* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
713 /* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
714 /* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
715 /* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
716 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_c_str, 4)
717 const char* __thiscall MSVCP_basic_string_char_c_str(basic_string_char *this)
719 TRACE("%p\n", this);
720 return basic_string_char_const_ptr(this);
723 /* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
724 /* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
725 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_capacity, 4)
726 MSVCP_size_t __thiscall MSVCP_basic_string_char_capacity(basic_string_char *this)
728 TRACE("%p\n", this);
729 return this->res;
732 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
733 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
734 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor, 4)
735 basic_string_char* __thiscall MSVCP_basic_string_char_ctor(basic_string_char *this)
737 TRACE("%p\n", this);
739 basic_string_char_tidy(this, FALSE, 0);
740 return this;
743 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z */
744 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@@Z */
745 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_copy_ctor, 8)
746 basic_string_char* __thiscall MSVCP_basic_string_char_copy_ctor(
747 basic_string_char *this, const basic_string_char *copy)
749 TRACE("%p %p\n", this, copy);
751 basic_string_char_tidy(this, FALSE, 0);
752 MSVCP_basic_string_char_assign(this, copy);
753 return this;
756 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z */
757 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z */
758 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_cstr, 8)
759 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr(
760 basic_string_char *this, const char *str)
762 TRACE("%p %s\n", this, debugstr_a(str));
764 basic_string_char_tidy(this, FALSE, 0);
765 MSVCP_basic_string_char_assign_cstr(this, str);
766 return this;
769 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDI@Z */
770 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD_K@Z */
771 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_cstr_len, 12)
772 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr_len(
773 basic_string_char *this, const char *str, MSVCP_size_t len)
775 TRACE("%p %s %ld\n", this, str, len);
777 basic_string_char_tidy(this, FALSE, 0);
778 MSVCP_basic_string_char_assign_cstr_len(this, str, len);
779 return this;
782 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@II@Z */
783 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@_K1@Z */
784 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_substr, 16)
785 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_substr(
786 basic_string_char *this, const basic_string_char *assign,
787 MSVCP_size_t pos, MSVCP_size_t len)
789 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
791 basic_string_char_tidy(this, FALSE, 0);
792 MSVCP_basic_string_char_assign_substr(this, assign, pos, len);
793 return this;
796 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z */
797 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV?$allocator@D@1@@Z */
798 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_alloc, 8)
799 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_alloc(
800 basic_string_char *this, const void *alloc)
802 TRACE("%p %p\n", this, alloc);
804 basic_string_char_tidy(this, FALSE, 0);
805 return this;
808 /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
809 /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
810 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_dtor, 4)
811 void __thiscall MSVCP_basic_string_char_dtor(basic_string_char *this)
813 TRACE("%p\n", this);
814 basic_string_char_tidy(this, TRUE, 0);
817 /* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
818 /* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
819 /* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
820 /* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
821 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_length, 4)
822 MSVCP_size_t __thiscall MSVCP_basic_string_char_length(basic_string_char *this)
824 TRACE("%p\n", this);
825 return this->size;
828 /* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXAAV12@@Z */
829 /* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEAV12@@Z */
830 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_swap, 8)
831 void __thiscall MSVCP_basic_string_char_swap(basic_string_char *this, basic_string_char *str)
833 if(this != str) {
834 char tmp[sizeof(this->data)];
835 const MSVCP_size_t size = this->size;
836 const MSVCP_size_t res = this->res;
838 memcpy(tmp, this->data.buf, sizeof(this->data));
839 memcpy(this->data.buf, str->data.buf, sizeof(this->data));
840 memcpy(str->data.buf, tmp, sizeof(this->data));
842 this->size = str->size;
843 this->res = str->res;
845 str->size = size;
846 str->res = res;
850 /* ?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV12@II@Z */
851 /* ?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV12@_K0@Z */
852 DEFINE_THISCALL_WRAPPER_RETPTR(MSVCP_basic_string_char_substr, 12)
853 basic_string_char __thiscall MSVCP_basic_string_char_substr(
854 basic_string_char *this, MSVCP_size_t off, MSVCP_size_t len)
856 basic_string_char ret = { 0 };
857 TRACE("%p %lu %lu\n", this, off, len);
859 MSVCP_basic_string_char_ctor_substr(&ret, this, off, len);
860 return ret;
863 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
864 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
865 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_substr, 16)
866 basic_string_char* __thiscall MSVCP_basic_string_char_append_substr(basic_string_char *this,
867 const basic_string_char *append, MSVCP_size_t offset, MSVCP_size_t count)
869 TRACE("%p %p %lu %lu\n", this, append, offset, count);
871 if(append->size < offset)
872 MSVCP__String_base_Xran();
874 if(count > append->size-offset)
875 count = append->size-offset;
877 if(MSVCP_basic_string_char_npos-this->size<=count || this->size+count<this->size)
878 MSVCP__String_base_Xlen();
880 if(basic_string_char_grow(this, this->size+count, FALSE)) {
881 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this)+this->size,
882 this->res-this->size, basic_string_char_const_ptr(append)+offset, count);
883 basic_string_char_eos(this, this->size+count);
886 return this;
889 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
890 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
891 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
892 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
893 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append, 8)
894 basic_string_char* __thiscall MSVCP_basic_string_char_append(
895 basic_string_char *this, const basic_string_char *append)
897 return MSVCP_basic_string_char_append_substr(this, append,
898 0, MSVCP_basic_string_char_npos);
901 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
902 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
903 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_cstr_len, 12)
904 basic_string_char* __thiscall MSVCP_basic_string_char_append_cstr_len(
905 basic_string_char *this, const char *append, MSVCP_size_t count)
907 TRACE("%p %s %lu\n", this, append, count);
909 if(basic_string_char_inside(this, append))
910 return MSVCP_basic_string_char_append_substr(this, this,
911 append-basic_string_char_ptr(this), count);
913 if(MSVCP_basic_string_char_npos-this->size<=count || this->size+count<this->size)
914 MSVCP__String_base_Xlen();
916 if(basic_string_char_grow(this, this->size+count, FALSE)) {
917 MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this)+this->size,
918 this->res-this->size, append, count);
919 basic_string_char_eos(this, this->size+count);
922 return this;
925 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
926 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
927 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
928 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
929 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_cstr, 8)
930 basic_string_char* __thiscall MSVCP_basic_string_char_append_cstr(
931 basic_string_char *this, const char *append)
933 return MSVCP_basic_string_char_append_cstr_len(this, append,
934 MSVCP_char_traits_char_length(append));
937 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z */
938 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KD@Z */
939 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_len_ch, 12)
940 basic_string_char* __thiscall MSVCP_basic_string_char_append_len_ch(
941 basic_string_char *this, MSVCP_size_t count, char ch)
943 TRACE("%p %lu %c\n", this, count, ch);
945 if(MSVCP_basic_string_char_npos-this->size <= count)
946 MSVCP__String_base_Xlen();
948 if(basic_string_char_grow(this, this->size+count, FALSE)) {
949 MSVCP_char_traits_char_assignn(basic_string_char_ptr(this)+this->size, count, ch);
950 basic_string_char_eos(this, this->size+count);
953 return this;
956 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z */
957 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z */
958 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_ch, 8)
959 basic_string_char* __thiscall MSVCP_basic_string_char_append_ch(
960 basic_string_char *this, char ch)
962 return MSVCP_basic_string_char_append_len_ch(this, 1, ch);
965 /* ??$?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 */
966 /* ??$?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 */
967 basic_string_char* __cdecl MSVCP_basic_string_char_concatenate_bstr_cstr(basic_string_char *ret,
968 const basic_string_char *left, const char *right)
970 TRACE("%p %s\n", left, right);
972 MSVCP_basic_string_char_copy_ctor(ret, left);
973 MSVCP_basic_string_char_append_cstr(ret, right);
974 return ret;
977 /* ??$?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 */
978 /* ??$?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 */
979 basic_string_char* __cdecl MSVCP_basic_string_char_concatenate_cstr_bstr(basic_string_char *ret,
980 const char *left, const basic_string_char *right)
982 TRACE("%s %p\n", left, right);
984 MSVCP_basic_string_char_ctor_cstr(ret, left);
985 MSVCP_basic_string_char_append(ret, right);
986 return ret;
989 /* ??$?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 */
990 /* ??$?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 */
991 basic_string_char* __cdecl MSVCP_basic_string_char_concatenate(basic_string_char *ret,
992 const basic_string_char *left, const basic_string_char *right)
994 TRACE("%p %p\n", left, right);
996 MSVCP_basic_string_char_copy_ctor(ret, left);
997 MSVCP_basic_string_char_append(ret, right);
998 return ret;
1001 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBDI@Z */
1002 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD0@Z */
1003 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr_cstr_len, 20)
1004 int __thiscall MSVCP_basic_string_char_compare_substr_cstr_len(
1005 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
1006 const char *str, MSVCP_size_t count)
1008 int ans;
1010 TRACE("%p %lu %lu %s %lu\n", this, pos, num, str, count);
1012 if(this->size < pos)
1013 MSVCP__String_base_Xran();
1015 if(pos+num > this->size)
1016 num = this->size-pos;
1018 ans = MSVCP_char_traits_char_compare(basic_string_char_const_ptr(this)+pos,
1019 str, num>count ? count : num);
1020 if(ans)
1021 return ans;
1023 if(num > count)
1024 ans = 1;
1025 else if(num < count)
1026 ans = -1;
1027 return ans;
1030 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBD@Z */
1031 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD@Z */
1032 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr_cstr, 16)
1033 int __thiscall MSVCP_basic_string_char_compare_substr_cstr(const basic_string_char *this,
1034 MSVCP_size_t pos, MSVCP_size_t num, const char *str)
1036 return MSVCP_basic_string_char_compare_substr_cstr_len(this, pos, num,
1037 str, MSVCP_char_traits_char_length(str));
1040 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHPBD@Z */
1041 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHPEBD@Z */
1042 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_cstr, 8)
1043 int __thiscall MSVCP_basic_string_char_compare_cstr(
1044 const basic_string_char *this, const char *str)
1046 return MSVCP_basic_string_char_compare_substr_cstr_len(this, 0, this->size,
1047 str, MSVCP_char_traits_char_length(str));
1050 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@II@Z */
1051 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@00@Z */
1052 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr_substr, 24)
1053 int __thiscall MSVCP_basic_string_char_compare_substr_substr(
1054 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
1055 const basic_string_char *compare, MSVCP_size_t off, MSVCP_size_t count)
1057 TRACE("%p %lu %lu %p %lu %lu\n", this, pos, num, compare, off, count);
1059 if(compare->size < off)
1060 MSVCP__String_base_Xran();
1062 if(off+count > compare->size)
1063 count = compare->size-off;
1065 return MSVCP_basic_string_char_compare_substr_cstr_len(this, pos, num,
1066 basic_string_char_const_ptr(compare)+off, count);
1069 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@@Z */
1070 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@@Z */
1071 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare_substr, 16)
1072 int __thiscall MSVCP_basic_string_char_compare_substr(
1073 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
1074 const basic_string_char *compare)
1076 return MSVCP_basic_string_char_compare_substr_cstr_len(this, pos, num,
1077 basic_string_char_const_ptr(compare), compare->size);
1080 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHABV12@@Z */
1081 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHAEBV12@@Z */
1082 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_compare, 8)
1083 int __thiscall MSVCP_basic_string_char_compare(
1084 const basic_string_char *this, const basic_string_char *compare)
1086 return MSVCP_basic_string_char_compare_substr_cstr_len(this, 0, this->size,
1087 basic_string_char_const_ptr(compare), compare->size);
1090 /* ??$?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 */
1091 /* ??$?8DU?$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 */
1092 MSVCP_bool __cdecl MSVCP_basic_string_char_equal(
1093 const basic_string_char *left, const basic_string_char *right)
1095 return MSVCP_basic_string_char_compare(left, right) == 0;
1098 /* ??$?8DU?$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 */
1099 /* ??$?8DU?$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 */
1100 MSVCP_bool __cdecl MSVCP_basic_string_char_equal_str_cstr(
1101 const basic_string_char *left, const char *right)
1103 return MSVCP_basic_string_char_compare_cstr(left, right) == 0;
1106 /* ??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
1107 /* ??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
1108 MSVCP_bool __cdecl MSVCP_basic_string_char_equal_cstr_str(
1109 const char *left, const basic_string_char *right)
1111 return MSVCP_basic_string_char_compare_cstr(right, left) == 0;
1114 /* ??$?9DU?$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 */
1115 /* ??$?9DU?$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 */
1116 MSVCP_bool __cdecl MSVCP_basic_string_char_not_equal(
1117 const basic_string_char *left, const basic_string_char *right)
1119 return MSVCP_basic_string_char_compare(left, right) != 0;
1122 /* ??$?9DU?$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 */
1123 /* ??$?9DU?$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 */
1124 MSVCP_bool __cdecl MSVCP_basic_string_char_not_equal_str_cstr(
1125 const basic_string_char *left, const char *right)
1127 return MSVCP_basic_string_char_compare_cstr(left, right) != 0;
1130 /* ??$?9DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
1131 /* ??$?9DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
1132 MSVCP_bool __cdecl MSVCP_basic_string_char_not_equal_cstr_str(
1133 const char *left, const basic_string_char *right)
1135 return MSVCP_basic_string_char_compare_cstr(right, left) != 0;
1138 /* ??$?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 */
1139 /* ??$?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 */
1140 MSVCP_bool __cdecl MSVCP_basic_string_char_lower(
1141 const basic_string_char *left, const basic_string_char *right)
1143 return MSVCP_basic_string_char_compare(left, right) < 0;
1146 /* ??$?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 */
1147 /* ??$?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 */
1148 MSVCP_bool __cdecl MSVCP_basic_string_char_lower_bstr_cstr(
1149 const basic_string_char *left, const char *right)
1151 return MSVCP_basic_string_char_compare_cstr(left, right) < 0;
1154 /* ??$?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 */
1155 /* ??$?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 */
1156 MSVCP_bool __cdecl MSVCP_basic_string_char_lower_cstr_bstr(
1157 const char *left, const basic_string_char *right)
1159 return MSVCP_basic_string_char_compare_cstr(right, left) > 0;
1162 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
1163 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
1164 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_cstr_substr, 16)
1165 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_cstr_substr(
1166 const basic_string_char *this, const char *find, MSVCP_size_t pos, MSVCP_size_t len)
1168 const char *p, *end;
1170 TRACE("%p %s %lu %lu\n", this, find, pos, len);
1172 if(len==0 && pos<=this->size)
1173 return pos;
1175 end = basic_string_char_const_ptr(this)+this->size-len+1;
1176 for(p=basic_string_char_const_ptr(this)+pos; p<end; p++) {
1177 p = MSVCP_char_traits_char_find(p, end-p, find);
1178 if(!p)
1179 break;
1181 if(!MSVCP_char_traits_char_compare(p, find, len))
1182 return p-basic_string_char_const_ptr(this);
1185 return MSVCP_basic_string_char_npos;
1188 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
1189 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
1190 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_cstr_off, 12)
1191 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_cstr_off(
1192 const basic_string_char *this, const char *find, MSVCP_size_t pos)
1194 return MSVCP_basic_string_char_find_cstr_substr(this, find, pos,
1195 MSVCP_char_traits_char_length(find));
1198 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
1199 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
1200 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_ch, 12)
1201 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_ch(
1202 const basic_string_char *this, char ch, MSVCP_size_t pos)
1204 return MSVCP_basic_string_char_find_cstr_substr(this, &ch, pos, 1);
1207 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
1208 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
1209 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_first_of_cstr_substr, 16)
1210 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_first_of_cstr_substr(
1211 const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
1213 const char *p, *end;
1215 TRACE("%p %p %lu %lu\n", this, find, off, len);
1217 if(len>0 && off<this->size) {
1218 end = basic_string_char_const_ptr(this)+this->size;
1219 for(p=basic_string_char_const_ptr(this)+off; p<end; p++)
1220 if(MSVCP_char_traits_char_find(find, len, p))
1221 return p-basic_string_char_const_ptr(this);
1224 return MSVCP_basic_string_char_npos;
1227 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
1228 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
1229 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_first_of, 12)
1230 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_first_of(
1231 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
1233 return MSVCP_basic_string_char_find_first_of_cstr_substr(this,
1234 basic_string_char_const_ptr(find), off, find->size);
1237 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
1238 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
1239 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_first_of_cstr, 12)
1240 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_first_of_cstr(
1241 const basic_string_char *this, const char *find, MSVCP_size_t off)
1243 return MSVCP_basic_string_char_find_first_of_cstr_substr(
1244 this, find, off, MSVCP_char_traits_char_length(find));
1247 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
1248 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
1249 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_first_of_ch, 12)
1250 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_first_of_ch(
1251 const basic_string_char *this, char ch, MSVCP_size_t off)
1253 return MSVCP_basic_string_char_find_first_of_cstr_substr(this, &ch, off, 1);
1256 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
1257 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
1258 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_last_of_cstr_substr, 16)
1259 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_last_of_cstr_substr(
1260 const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
1262 const char *p, *beg;
1264 TRACE("%p %p %lu %lu\n", this, find, off, len);
1267 if(len>0 && this->size>0) {
1268 if(off >= this->size)
1269 off = this->size-1;
1271 beg = basic_string_char_const_ptr(this);
1272 for(p=beg+off; p>=beg; p--)
1273 if(MSVCP_char_traits_char_find(find, len, p))
1274 return p-beg;
1277 return MSVCP_basic_string_char_npos;
1280 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
1281 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
1282 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_last_of, 12)
1283 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_last_of(
1284 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
1286 return MSVCP_basic_string_char_find_last_of_cstr_substr(this,
1287 basic_string_char_const_ptr(find), off, find->size);
1290 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
1291 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
1292 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_last_of_cstr, 12)
1293 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_last_of_cstr(
1294 const basic_string_char *this, const char *find, MSVCP_size_t off)
1296 return MSVCP_basic_string_char_find_last_of_cstr_substr(
1297 this, find, off, MSVCP_char_traits_char_length(find));
1300 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
1301 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
1302 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_find_last_of_ch, 12)
1303 MSVCP_size_t __thiscall MSVCP_basic_string_char_find_last_of_ch(
1304 const basic_string_char *this, char ch, MSVCP_size_t off)
1306 return MSVCP_basic_string_char_find_last_of_cstr_substr(this, &ch, off, 1);
1309 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
1310 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
1311 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
1312 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
1313 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_at, 8)
1314 char* __thiscall MSVCP_basic_string_char_at(
1315 basic_string_char *this, MSVCP_size_t pos)
1317 TRACE("%p %lu\n", this, pos);
1319 if(this->size <= pos)
1320 MSVCP__String_base_Xran();
1322 return basic_string_char_ptr(this)+pos;
1325 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
1326 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
1327 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
1328 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
1329 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_const_at, 8)
1330 const char* __thiscall MSVCP_basic_string_char_const_at(
1331 const basic_string_char *this, MSVCP_size_t pos)
1333 TRACE("%p %lu\n", this, pos);
1335 if(this->size <= pos)
1336 MSVCP__String_base_Xran();
1338 return basic_string_char_const_ptr(this)+pos;
1341 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXID@Z */
1342 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_KD@Z */
1343 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_resize_ch, 12)
1344 void __thiscall MSVCP_basic_string_char_resize_ch(
1345 basic_string_char *this, MSVCP_size_t size, char ch)
1347 TRACE("%p %lu %c\n", this, size, ch);
1349 if(size <= this->size)
1350 MSVCP_basic_string_char_erase(this, size, this->size);
1351 else
1352 MSVCP_basic_string_char_append_len_ch(this, size-this->size, ch);
1355 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z */
1356 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K@Z */
1357 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_resize, 8)
1358 void __thiscall MSVCP_basic_string_char_resize(
1359 basic_string_char *this, MSVCP_size_t size)
1361 MSVCP_basic_string_char_resize_ch(this, size, '\0');
1364 /* ?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
1365 /* ?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
1366 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_clear, 4)
1367 void __thiscall MSVCP_basic_string_char_clear(basic_string_char *this)
1369 basic_string_char_eos(this, 0);
1373 /* basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t>> */
1374 /* ?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2IB */
1375 /* ?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2_KB */
1376 const MSVCP_size_t MSVCP_basic_string_wchar_npos = -1;
1378 /* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEPA_WXZ */
1379 /* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAPEA_WXZ */
1380 DEFINE_THISCALL_WRAPPER(basic_string_wchar_ptr, 4)
1381 wchar_t* __thiscall basic_string_wchar_ptr(basic_string_wchar *this)
1383 if(this->res == BUF_SIZE_WCHAR-1)
1384 return this->data.buf;
1385 return this->data.ptr;
1388 /* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IBEPB_WXZ */
1389 /* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEBAPEB_WXZ */
1390 DEFINE_THISCALL_WRAPPER(basic_string_wchar_const_ptr, 4)
1391 const wchar_t* __thiscall basic_string_wchar_const_ptr(const basic_string_wchar *this)
1393 if(this->res == BUF_SIZE_WCHAR-1)
1394 return this->data.buf;
1395 return this->data.ptr;
1398 /* ?_Eos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXI@Z */
1399 /* ?_Eos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAX_K@Z */
1400 DEFINE_THISCALL_WRAPPER(basic_string_wchar_eos, 8)
1401 void __thiscall basic_string_wchar_eos(basic_string_wchar *this, MSVCP_size_t len)
1403 static const wchar_t nullbyte_w = '\0';
1405 this->size = len;
1406 MSVCP_char_traits_wchar_assign(basic_string_wchar_ptr(this)+len, &nullbyte_w);
1409 /* ?_Inside@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAE_NPB_W@Z */
1410 /* ?_Inside@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAA_NPEB_W@Z */
1411 DEFINE_THISCALL_WRAPPER(basic_string_wchar_inside, 8)
1412 MSVCP_bool __thiscall basic_string_wchar_inside(
1413 basic_string_wchar *this, const wchar_t *ptr)
1415 wchar_t *cstr = basic_string_wchar_ptr(this);
1417 return (ptr<cstr || ptr>=cstr+this->size) ? FALSE : TRUE;
1420 /* ?_Tidy@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEX_NI@Z */
1421 /* ?_Tidy@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAX_N_K@Z */
1422 DEFINE_THISCALL_WRAPPER(basic_string_wchar_tidy, 12)
1423 void __thiscall basic_string_wchar_tidy(basic_string_wchar *this,
1424 MSVCP_bool built, MSVCP_size_t new_size)
1426 if(built && BUF_SIZE_WCHAR<=this->res) {
1427 wchar_t *ptr = this->data.ptr;
1429 if(new_size > 0)
1430 MSVCP_char_traits_wchar__Copy_s(this->data.buf, BUF_SIZE_WCHAR, ptr, new_size);
1431 MSVCP_allocator_wchar_deallocate(this->allocator, ptr, this->res+1);
1434 this->res = BUF_SIZE_WCHAR-1;
1435 basic_string_wchar_eos(this, new_size);
1438 /* ?_Grow@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAE_NI_N@Z */
1439 /* ?_Grow@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAA_N_K_N@Z */
1440 DEFINE_THISCALL_WRAPPER(basic_string_wchar_grow, 12)
1441 MSVCP_bool __thiscall basic_string_wchar_grow(
1442 basic_string_wchar *this, MSVCP_size_t new_size, MSVCP_bool trim)
1444 if(this->res < new_size) {
1445 MSVCP_size_t new_res = new_size;
1446 wchar_t *ptr;
1448 new_res |= 0xf;
1450 if(new_res/3 < this->res/2)
1451 new_res = this->res + this->res/2;
1453 ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_res);
1454 if(!ptr)
1455 ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_size+1);
1456 else
1457 new_size = new_res;
1458 if(!ptr) {
1459 ERR("Out of memory\n");
1460 basic_string_wchar_tidy(this, TRUE, 0);
1461 return FALSE;
1464 MSVCP_char_traits_wchar__Copy_s(ptr, new_size,
1465 basic_string_wchar_ptr(this), this->size);
1466 basic_string_wchar_tidy(this, TRUE, 0);
1467 this->data.ptr = ptr;
1468 this->res = new_size;
1469 basic_string_wchar_eos(this, this->size);
1470 } else if(trim && new_size < BUF_SIZE_WCHAR)
1471 basic_string_wchar_tidy(this, TRUE,
1472 new_size<this->size ? new_size : this->size);
1473 else if(new_size == 0)
1474 basic_string_wchar_eos(this, 0);
1476 return (new_size>0);
1479 /* ?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@II@Z */
1480 /* ?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K0@Z */
1481 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_erase, 12)
1482 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_erase(
1483 basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t len)
1485 TRACE("%p %lu %lu\n", this, pos, len);
1487 if(pos > this->size) {
1488 MSVCP__String_base_Xran();
1489 return NULL;
1492 if(len > this->size-pos)
1493 len = this->size-pos;
1495 if(len) {
1496 MSVCP_char_traits_wchar__Move_s(basic_string_wchar_ptr(this)+pos,
1497 this->res-pos, basic_string_wchar_ptr(this)+pos+len,
1498 this->size-pos-len);
1499 basic_string_wchar_eos(this, this->size-len);
1502 return this;
1505 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z */
1506 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
1507 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign_substr, 16)
1508 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign_substr(
1509 basic_string_wchar *this, const basic_string_wchar *assign,
1510 MSVCP_size_t pos, MSVCP_size_t len)
1512 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
1514 if(assign->size < pos) {
1515 MSVCP__String_base_Xran();
1516 return NULL;
1519 if(len > assign->size-pos)
1520 len = assign->size-pos;
1522 if(this == assign) {
1523 MSVCP_basic_string_wchar_erase(this, pos+len, MSVCP_basic_string_wchar_npos);
1524 MSVCP_basic_string_wchar_erase(this, 0, pos);
1525 } else if(basic_string_wchar_grow(this, len, FALSE)) {
1526 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this),
1527 this->res, basic_string_wchar_const_ptr(assign)+pos, len);
1528 basic_string_wchar_eos(this, len);
1531 return this;
1534 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@@Z */
1535 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@@Z */
1536 /* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@ABV01@@Z */
1537 /* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z */
1538 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign, 8)
1539 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign(
1540 basic_string_wchar *this, const basic_string_wchar *assign)
1542 return MSVCP_basic_string_wchar_assign_substr(this, assign,
1543 0, MSVCP_basic_string_wchar_npos);
1546 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z */
1547 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W_K@Z */
1548 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign_cstr_len, 12)
1549 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign_cstr_len(
1550 basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len)
1552 TRACE("%p %s %lu\n", this, debugstr_w(str), len);
1554 if(basic_string_wchar_inside(this, str))
1555 return MSVCP_basic_string_wchar_assign_substr(this, this,
1556 str-basic_string_wchar_ptr(this), len);
1557 else if(basic_string_wchar_grow(this, len, FALSE)) {
1558 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this),
1559 this->res, str, len);
1560 basic_string_wchar_eos(this, len);
1563 return this;
1566 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z */
1567 /* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W@Z */
1568 /* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z */
1569 /* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@PEB_W@Z */
1570 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_assign_cstr, 8)
1571 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_assign_cstr(
1572 basic_string_wchar *this, const wchar_t *str)
1574 return MSVCP_basic_string_wchar_assign_cstr_len(this, str,
1575 MSVCP_char_traits_wchar_length(str));
1578 /* ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ */
1579 /* ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ */
1580 /* ?data@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ */
1581 /* ?data@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ */
1582 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_c_str, 4)
1583 const wchar_t* __thiscall MSVCP_basic_string_wchar_c_str(basic_string_wchar *this)
1585 TRACE("%p\n", this);
1586 return basic_string_wchar_const_ptr(this);
1589 /* ?capacity@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
1590 /* ?capacity@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
1591 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_capacity, 4)
1592 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_capacity(basic_string_wchar *this)
1594 TRACE("%p\n", this);
1595 return this->res;
1598 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ */
1599 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ */
1600 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor, 4)
1601 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor(basic_string_wchar *this)
1603 TRACE("%p\n", this);
1605 basic_string_wchar_tidy(this, FALSE, 0);
1606 return this;
1609 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV01@@Z */
1610 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV01@@Z */
1611 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_copy_ctor, 8)
1612 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_copy_ctor(
1613 basic_string_wchar *this, const basic_string_wchar *copy)
1615 TRACE("%p %p\n", this, copy);
1617 basic_string_wchar_tidy(this, FALSE, 0);
1618 MSVCP_basic_string_wchar_assign(this, copy);
1619 return this;
1622 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_W@Z */
1623 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W@Z */
1624 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_cstr, 8)
1625 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr(
1626 basic_string_wchar *this, const wchar_t *str)
1628 TRACE("%p %s\n", this, debugstr_w(str));
1630 basic_string_wchar_tidy(this, FALSE, 0);
1631 MSVCP_basic_string_wchar_assign_cstr(this, str);
1632 return this;
1635 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_WI@Z */
1636 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W_K@Z */
1637 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_cstr_len, 12)
1638 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr_len(
1639 basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len)
1641 TRACE("%p %s %ld\n", this, debugstr_w(str), len);
1643 basic_string_wchar_tidy(this, FALSE, 0);
1644 MSVCP_basic_string_wchar_assign_cstr_len(this, str, len);
1645 return this;
1648 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV01@II@Z */
1649 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV01@_K1@Z */
1650 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_substr, 16)
1651 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_substr(
1652 basic_string_wchar *this, const basic_string_wchar *assign,
1653 MSVCP_size_t pos, MSVCP_size_t len)
1655 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
1657 basic_string_wchar_tidy(this, FALSE, 0);
1658 MSVCP_basic_string_wchar_assign_substr(this, assign, pos, len);
1659 return this;
1662 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV?$allocator@_W@1@@Z */
1663 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@AEBV?$allocator@_W@1@@Z */
1664 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_alloc, 8)
1665 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_alloc(
1666 basic_string_wchar *this, const void *alloc)
1668 TRACE("%p %p\n", this, alloc);
1670 basic_string_wchar_tidy(this, FALSE, 0);
1671 return this;
1674 /* ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ */
1675 /* ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ */
1676 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_dtor, 4)
1677 void __thiscall MSVCP_basic_string_wchar_dtor(basic_string_wchar *this)
1679 TRACE("%p\n", this);
1680 basic_string_wchar_tidy(this, TRUE, 0);
1683 /* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
1684 /* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
1685 /* ?length@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
1686 /* ?length@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
1687 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_length, 4)
1688 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_length(basic_string_wchar *this)
1690 TRACE("%p\n", this);
1691 return this->size;
1694 /* ?swap@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXAAV12@@Z */
1695 /* ?swap@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXAEAV12@@Z */
1696 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_swap, 8)
1697 void __thiscall MSVCP_basic_string_wchar_swap(basic_string_wchar *this, basic_string_wchar *str)
1699 if(this != str) {
1700 char tmp[sizeof(this->data)];
1701 const MSVCP_size_t size = this->size;
1702 const MSVCP_size_t res = this->res;
1704 memcpy(tmp, this->data.buf, sizeof(this->data));
1705 memcpy(this->data.buf, str->data.buf, sizeof(this->data));
1706 memcpy(str->data.buf, tmp, sizeof(this->data));
1708 this->size = str->size;
1709 this->res = str->res;
1711 str->size = size;
1712 str->res = res;
1716 /* ?substr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBE?AV12@II@Z */
1717 /* ?substr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA?AV12@_K0@Z */
1718 DEFINE_THISCALL_WRAPPER_RETPTR(MSVCP_basic_string_wchar_substr, 12)
1719 basic_string_wchar __thiscall MSVCP_basic_string_wchar_substr(
1720 basic_string_wchar *this, MSVCP_size_t off, MSVCP_size_t len)
1722 basic_string_wchar ret = { 0 };
1723 TRACE("%p %lu %lu\n", this, off, len);
1725 MSVCP_basic_string_wchar_ctor_substr(&ret, this, off, len);
1726 return ret;
1729 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z */
1730 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
1731 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_substr, 16)
1732 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_substr(basic_string_wchar *this,
1733 const basic_string_wchar *append, MSVCP_size_t offset, MSVCP_size_t count)
1735 TRACE("%p %p %lu %lu\n", this, append, offset, count);
1737 if(append->size < offset)
1738 MSVCP__String_base_Xran();
1740 if(count > append->size-offset)
1741 count = append->size-offset;
1743 if(MSVCP_basic_string_wchar_npos-this->size<=count || this->size+count<this->size)
1744 MSVCP__String_base_Xlen();
1746 if(basic_string_wchar_grow(this, this->size+count, FALSE)) {
1747 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this)+this->size,
1748 this->res-this->size, basic_string_wchar_const_ptr(append)+offset, count);
1749 basic_string_wchar_eos(this, this->size+count);
1752 return this;
1755 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@@Z */
1756 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@@Z */
1757 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@ABV01@@Z */
1758 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@AEBV01@@Z */
1759 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append, 8)
1760 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append(
1761 basic_string_wchar *this, const basic_string_wchar *append)
1763 return MSVCP_basic_string_wchar_append_substr(this, append,
1764 0, MSVCP_basic_string_wchar_npos);
1767 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z */
1768 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W_K@Z */
1769 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_cstr_len, 12)
1770 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_cstr_len(
1771 basic_string_wchar *this, const wchar_t *append, MSVCP_size_t count)
1773 TRACE("%p %s %lu\n", this, debugstr_w(append), count);
1775 if(basic_string_wchar_inside(this, append))
1776 return MSVCP_basic_string_wchar_append_substr(this, this,
1777 append-basic_string_wchar_ptr(this), count);
1779 if(MSVCP_basic_string_wchar_npos-this->size<=count || this->size+count<this->size)
1780 MSVCP__String_base_Xlen();
1782 if(basic_string_wchar_grow(this, this->size+count, FALSE)) {
1783 MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this)+this->size,
1784 this->res-this->size, append, count);
1785 basic_string_wchar_eos(this, this->size+count);
1788 return this;
1791 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z */
1792 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W@Z */
1793 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z */
1794 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@PEB_W@Z */
1795 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_cstr, 8)
1796 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_cstr(
1797 basic_string_wchar *this, const wchar_t *append)
1799 return MSVCP_basic_string_wchar_append_cstr_len(this, append,
1800 MSVCP_char_traits_wchar_length(append));
1803 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@I_W@Z */
1804 /* ?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K_W@Z */
1805 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_len_ch, 12)
1806 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_len_ch(
1807 basic_string_wchar *this, MSVCP_size_t count, wchar_t ch)
1809 TRACE("%p %lu %c\n", this, count, ch);
1811 if(MSVCP_basic_string_wchar_npos-this->size <= count)
1812 MSVCP__String_base_Xlen();
1814 if(basic_string_wchar_grow(this, this->size+count, FALSE)) {
1815 MSVCP_char_traits_wchar_assignn(basic_string_wchar_ptr(this)+this->size, count, ch);
1816 basic_string_wchar_eos(this, this->size+count);
1819 return this;
1822 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@_W@Z */
1823 /* ??Y?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@_W@Z */
1824 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_ch, 8)
1825 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_ch(
1826 basic_string_wchar *this, wchar_t ch)
1828 return MSVCP_basic_string_wchar_append_len_ch(this, 1, ch);
1831 /* ??$?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 */
1832 /* ??$?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 */
1833 basic_string_wchar* __cdecl MSVCP_basic_string_wchar_concatenate_bstr_cstr(basic_string_wchar *ret,
1834 const basic_string_wchar *left, const wchar_t *right)
1836 TRACE("%p %s\n", left, debugstr_w(right));
1838 MSVCP_basic_string_wchar_copy_ctor(ret, left);
1839 MSVCP_basic_string_wchar_append_cstr(ret, right);
1840 return ret;
1843 /* ??$?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 */
1844 /* ??$?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 */
1845 basic_string_wchar* __cdecl MSVCP_basic_string_wchar_concatenate_cstr_bstr(basic_string_wchar *ret,
1846 const wchar_t *left, const basic_string_wchar *right)
1848 TRACE("%s %p\n", debugstr_w(left), right);
1850 MSVCP_basic_string_wchar_ctor_cstr(ret, left);
1851 MSVCP_basic_string_wchar_append(ret, right);
1852 return ret;
1855 /* ??$?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 */
1856 /* ??$?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 */
1857 basic_string_wchar* __cdecl MSVCP_basic_string_wchar_concatenate(basic_string_wchar *ret,
1858 const basic_string_wchar *left, const basic_string_wchar *right)
1860 TRACE("%p %p\n", left, right);
1862 MSVCP_basic_string_wchar_copy_ctor(ret, left);
1863 MSVCP_basic_string_wchar_append(ret, right);
1864 return ret;
1867 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIPB_WI@Z */
1868 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0PEB_W0@Z */
1869 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr_cstr_len, 20)
1870 int __thiscall MSVCP_basic_string_wchar_compare_substr_cstr_len(
1871 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
1872 const wchar_t *str, MSVCP_size_t count)
1874 int ans;
1876 TRACE("%p %lu %lu %s %lu\n", this, pos, num, debugstr_w(str), count);
1878 if(this->size < pos)
1879 MSVCP__String_base_Xran();
1881 if(pos+num > this->size)
1882 num = this->size-pos;
1884 ans = MSVCP_char_traits_wchar_compare(basic_string_wchar_const_ptr(this)+pos,
1885 str, num>count ? count : num);
1886 if(ans)
1887 return ans;
1889 if(num > count)
1890 ans = 1;
1891 else if(num < count)
1892 ans = -1;
1893 return ans;
1896 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIPB_W@Z */
1897 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0PEB_W@Z */
1898 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr_cstr, 16)
1899 int __thiscall MSVCP_basic_string_wchar_compare_substr_cstr(const basic_string_wchar *this,
1900 MSVCP_size_t pos, MSVCP_size_t num, const wchar_t *str)
1902 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, pos, num,
1903 str, MSVCP_char_traits_wchar_length(str));
1906 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHPB_W@Z */
1907 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAHPEB_W@Z */
1908 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_cstr, 8)
1909 int __thiscall MSVCP_basic_string_wchar_compare_cstr(
1910 const basic_string_wchar *this, const wchar_t *str)
1912 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, 0, this->size,
1913 str, MSVCP_char_traits_wchar_length(str));
1916 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIABV12@II@Z */
1917 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0AEBV12@00@Z */
1918 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr_substr, 24)
1919 int __thiscall MSVCP_basic_string_wchar_compare_substr_substr(
1920 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
1921 const basic_string_wchar *compare, MSVCP_size_t off, MSVCP_size_t count)
1923 TRACE("%p %lu %lu %p %lu %lu\n", this, pos, num, compare, off, count);
1925 if(compare->size < off)
1926 MSVCP__String_base_Xran();
1928 if(off+count > compare->size)
1929 count = compare->size-off;
1931 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, pos, num,
1932 basic_string_wchar_const_ptr(compare)+off, count);
1935 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHIIABV12@@Z */
1936 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAH_K0AEBV12@@Z */
1937 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare_substr, 16)
1938 int __thiscall MSVCP_basic_string_wchar_compare_substr(
1939 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
1940 const basic_string_wchar *compare)
1942 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, pos, num,
1943 basic_string_wchar_const_ptr(compare), compare->size);
1946 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEHABV12@@Z */
1947 /* ?compare@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAHAEBV12@@Z */
1948 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_compare, 8)
1949 int __thiscall MSVCP_basic_string_wchar_compare(
1950 const basic_string_wchar *this, const basic_string_wchar *compare)
1952 return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, 0, this->size,
1953 basic_string_wchar_const_ptr(compare), compare->size);
1956 /* ??$?8_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 */
1957 /* ??$?8_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 */
1958 MSVCP_bool __cdecl MSVCP_basic_string_wchar_equal(
1959 const basic_string_wchar *left, const basic_string_wchar *right)
1961 return MSVCP_basic_string_wchar_compare(left, right) == 0;
1964 /* ??$?8_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 */
1965 /* ??$?8_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 */
1966 MSVCP_bool __cdecl MSVCP_basic_string_wchar_equal_str_cstr(
1967 const basic_string_wchar *left, const wchar_t *right)
1969 return MSVCP_basic_string_wchar_compare_cstr(left, right) == 0;
1972 /* ??$?8_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 */
1973 /* ??$?8_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 */
1974 MSVCP_bool __cdecl MSVCP_basic_string_wchar_equal_cstr_str(
1975 const wchar_t *left, const basic_string_wchar *right)
1977 return MSVCP_basic_string_wchar_compare_cstr(right, left) == 0;
1980 /* ??$?9_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 */
1981 /* ??$?9_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 */
1982 MSVCP_bool __cdecl MSVCP_basic_string_wchar_not_equal(
1983 const basic_string_wchar *left, const basic_string_wchar *right)
1985 return MSVCP_basic_string_wchar_compare(left, right) != 0;
1988 /* ??$?9_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 */
1989 /* ??$?9_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 */
1990 MSVCP_bool __cdecl MSVCP_basic_string_wchar_not_equal_str_cstr(
1991 const basic_string_wchar *left, const wchar_t *right)
1993 return MSVCP_basic_string_wchar_compare_cstr(left, right) != 0;
1996 /* ??$?9_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 */
1997 /* ??$?9_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 */
1998 MSVCP_bool __cdecl MSVCP_basic_string_wchar_not_equal_cstr_str(
1999 const wchar_t *left, const basic_string_wchar *right)
2001 return MSVCP_basic_string_wchar_compare_cstr(right, left) != 0;
2004 /* ??$?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 */
2005 /* ??$?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 */
2006 MSVCP_bool __cdecl MSVCP_basic_string_wchar_lower(
2007 const basic_string_wchar *left, const basic_string_wchar *right)
2009 return MSVCP_basic_string_wchar_compare(left, right) < 0;
2012 /* ??$?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 */
2013 /* ??$?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 */
2014 MSVCP_bool __cdecl MSVCP_basic_string_wchar_lower_bstr_cstr(
2015 const basic_string_wchar *left, const wchar_t *right)
2017 return MSVCP_basic_string_wchar_compare_cstr(left, right) < 0;
2020 /* ??$?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 */
2021 /* ??$?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 */
2022 MSVCP_bool __cdecl MSVCP_basic_string_wchar_lower_cstr_bstr(
2023 const wchar_t *left, const basic_string_wchar *right)
2025 return MSVCP_basic_string_wchar_compare_cstr(right, left) > 0;
2028 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIPB_WII@Z */
2029 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KPEB_W_K1@Z */
2030 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_cstr_substr, 16)
2031 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_cstr_substr(
2032 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t pos, MSVCP_size_t len)
2034 const wchar_t *p, *end;
2036 TRACE("%p %s %lu %lu\n", this, debugstr_w(find), pos, len);
2038 if(len==0 && pos<=this->size)
2039 return pos;
2041 end = basic_string_wchar_const_ptr(this)+this->size-len+1;
2042 for(p=basic_string_wchar_const_ptr(this)+pos; p<end; p++) {
2043 p = MSVCP_char_traits_wchar_find(p, end-p, find);
2044 if(!p)
2045 break;
2047 if(!MSVCP_char_traits_wchar_compare(p, find, len))
2048 return p-basic_string_wchar_const_ptr(this);
2051 return MSVCP_basic_string_wchar_npos;
2054 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIPB_WI@Z */
2055 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KPEB_W_K@Z */
2056 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_cstr_off, 12)
2057 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_cstr_off(
2058 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t pos)
2060 return MSVCP_basic_string_wchar_find_cstr_substr(this, find, pos,
2061 MSVCP_char_traits_wchar_length(find));
2064 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEI_WI@Z */
2065 /* ?find@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_K_W_K@Z */
2066 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_ch, 12)
2067 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_ch(
2068 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t pos)
2070 return MSVCP_basic_string_wchar_find_cstr_substr(this, &ch, pos, 1);
2073 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIPB_WII@Z */
2074 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KPEB_W_K1@Z */
2075 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_first_of_cstr_substr, 16)
2076 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_first_of_cstr_substr(
2077 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off, MSVCP_size_t len)
2079 const wchar_t *p, *end;
2081 TRACE("%p %p %lu %lu\n", this, find, off, len);
2083 if(len>0 && off<this->size) {
2084 end = basic_string_wchar_const_ptr(this)+this->size;
2085 for(p=basic_string_wchar_const_ptr(this)+off; p<end; p++)
2086 if(MSVCP_char_traits_wchar_find(find, len, p))
2087 return p-basic_string_wchar_const_ptr(this);
2090 return MSVCP_basic_string_wchar_npos;
2093 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIABV12@I@Z */
2094 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KAEBV12@_K@Z */
2095 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_first_of, 12)
2096 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_first_of(
2097 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2099 return MSVCP_basic_string_wchar_find_first_of_cstr_substr(this,
2100 basic_string_wchar_const_ptr(find), off, find->size);
2103 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIPB_WI@Z */
2104 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KPEB_W_K@Z */
2105 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_first_of_cstr, 12)
2106 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_first_of_cstr(
2107 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off)
2109 return MSVCP_basic_string_wchar_find_first_of_cstr_substr(
2110 this, find, off, MSVCP_char_traits_wchar_length(find));
2113 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEI_WI@Z */
2114 /* ?find_first_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_K_W_K@Z */
2115 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_first_of_ch, 12)
2116 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_first_of_ch(
2117 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t off)
2119 return MSVCP_basic_string_wchar_find_first_of_cstr_substr(this, &ch, off, 1);
2122 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIPB_WII@Z */
2123 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KPEB_W_K1@Z */
2124 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_last_of_cstr_substr, 16)
2125 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_last_of_cstr_substr(
2126 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off, MSVCP_size_t len)
2128 const wchar_t *p, *beg;
2130 TRACE("%p %p %lu %lu\n", this, find, off, len);
2133 if(len>0 && this->size>0) {
2134 if(off >= this->size)
2135 off = this->size-1;
2137 beg = basic_string_wchar_const_ptr(this);
2138 for(p=beg+off; p>=beg; p--)
2139 if(MSVCP_char_traits_wchar_find(find, len, p))
2140 return p-beg;
2143 return MSVCP_basic_string_wchar_npos;
2146 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIABV12@I@Z */
2147 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KAEBV12@_K@Z */
2148 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_last_of, 12)
2149 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_last_of(
2150 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2152 return MSVCP_basic_string_wchar_find_last_of_cstr_substr(this,
2153 basic_string_wchar_const_ptr(find), off, find->size);
2156 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIPB_WI@Z */
2157 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KPEB_W_K@Z */
2158 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_last_of_cstr, 12)
2159 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_last_of_cstr(
2160 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off)
2162 return MSVCP_basic_string_wchar_find_last_of_cstr_substr(
2163 this, find, off, MSVCP_char_traits_wchar_length(find));
2166 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEI_WI@Z */
2167 /* ?find_last_of@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_K_W_K@Z */
2168 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_find_last_of_ch, 12)
2169 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_find_last_of_ch(
2170 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t off)
2172 return MSVCP_basic_string_wchar_find_last_of_cstr_substr(this, &ch, off, 1);
2175 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAA_WI@Z */
2176 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z */
2177 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAA_WI@Z */
2178 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEA_W_K@Z */
2179 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_at, 8)
2180 wchar_t* __thiscall MSVCP_basic_string_wchar_at(
2181 basic_string_wchar *this, MSVCP_size_t pos)
2183 TRACE("%p %lu\n", this, pos);
2185 if(this->size <= pos)
2186 MSVCP__String_base_Xran();
2188 return basic_string_wchar_ptr(this)+pos;
2191 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEAB_WI@Z */
2192 /* ?at@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAAEB_W_K@Z */
2193 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEAB_WI@Z */
2194 /* ??A?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAAEB_W_K@Z */
2195 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_const_at, 8)
2196 const wchar_t* __thiscall MSVCP_basic_string_wchar_const_at(
2197 const basic_string_wchar *this, MSVCP_size_t pos)
2199 TRACE("%p %lu\n", this, pos);
2201 if(this->size <= pos)
2202 MSVCP__String_base_Xran();
2204 return basic_string_wchar_const_ptr(this)+pos;
2207 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXI_W@Z */
2208 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAX_K_W@Z */
2209 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_resize_ch, 12)
2210 void __thiscall MSVCP_basic_string_wchar_resize_ch(
2211 basic_string_wchar *this, MSVCP_size_t size, wchar_t ch)
2213 TRACE("%p %lu %c\n", this, size, ch);
2215 if(size <= this->size)
2216 MSVCP_basic_string_wchar_erase(this, size, this->size);
2217 else
2218 MSVCP_basic_string_wchar_append_len_ch(this, size-this->size, ch);
2221 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXI@Z */
2222 /* ?resize@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAX_K@Z */
2223 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_resize, 8)
2224 void __thiscall MSVCP_basic_string_wchar_resize(
2225 basic_string_wchar *this, MSVCP_size_t size)
2227 MSVCP_basic_string_wchar_resize_ch(this, size, '\0');
2230 /* ?clear@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
2231 /* ?clear@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
2232 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_clear, 4)
2233 void __thiscall MSVCP_basic_string_wchar_clear(basic_string_wchar *this)
2235 basic_string_wchar_eos(this, 0);