msvcp60: Add MSVCP prefix on exported string functions.
[wine.git] / dlls / msvcp60 / string.c
blob5bd7a1922725c2708ba4a15885a414c9d8c3aad4
1 /*
2 * Copyright 2012 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 "msvcp.h"
24 #include "stdio.h"
25 #include "assert.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
32 #define FROZEN 255
34 /* _String_iterator<char> and _String_const_iterator<char> class */
35 typedef struct {
36 char *ptr;
37 } String_reverse_iterator_char;
39 typedef struct {
40 wchar_t *ptr;
41 } String_reverse_iterator_wchar;
43 /* allocator class */
44 typedef struct {
45 char empty_struct;
46 } allocator;
48 /* ?_Xran@std@@YAXXZ */
49 void __cdecl _Xran(void)
51 static const char msg[] = "invalid string position";
53 TRACE("\n");
54 throw_exception(EXCEPTION_OUT_OF_RANGE, msg);
57 /* ?_Xlen@std@@YAXXZ */
58 void __cdecl _Xlen(void)
60 static const char msg[] = "string too long";
62 TRACE("\n");
63 throw_exception(EXCEPTION_LENGTH_ERROR, msg);
66 static char* char_traits_char__Move_s(char *dest,
67 MSVCP_size_t size, const char *src, MSVCP_size_t count)
69 if(!dest || !src || size<count) {
70 if(dest && size)
71 dest[0] = '\0';
72 _invalid_parameter(NULL, NULL, NULL, 0, 0);
73 return dest;
76 return memmove(dest, src, count);
79 static char* char_traits_char__Copy_s(char *dest,
80 MSVCP_size_t size, const char *src, MSVCP_size_t count)
82 if(!dest || !src || size<count) {
83 if(dest && size)
84 dest[0] = '\0';
85 _invalid_parameter(NULL, NULL, NULL, 0, 0);
86 return dest;
89 return memcpy(dest, src, count);
92 static MSVCP_size_t char_traits_char_length(const char *str)
94 return strlen(str);
97 static char* char_traits_char_assignn(char *str, MSVCP_size_t num, char c)
99 return memset(str, c, num);
102 static int char_traits_char_compare(const char *s1,
103 const char *s2, MSVCP_size_t count)
105 int ret = memcmp(s1, s2, count);
106 return (ret>0 ? 1 : (ret<0 ? -1 : 0));
109 static const char* char_traits_char_find(const char *str,
110 MSVCP_size_t range, const char *c)
112 return memchr(str, *c, range);
115 static MSVCP_bool basic_string_char_inside(
116 basic_string_char *this, const char *ptr)
118 return ptr>=this->ptr && ptr<this->ptr+this->size;
121 /* ?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2IB */
122 /* ?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2_KB */
123 const MSVCP_size_t basic_string_char_npos = -1;
125 /* ?_C@?1??_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDXZ@4DB */
126 /* ?_C@?1??_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEBDXZ@4DB */
127 const char basic_string_char_nullbyte = '\0';
129 /* ?_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDXZ */
130 /* ?_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEBDXZ */
131 const char* __cdecl basic_string_char__Nullstr(void)
133 return &basic_string_char_nullbyte;
136 /* ?_Refcnt@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAEPBD@Z */
137 /* ?_Refcnt@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAEPEBD@Z */
138 DEFINE_THISCALL_WRAPPER(basic_string_char__Refcnt, 8)
139 unsigned char* __thiscall basic_string_char__Refcnt(basic_string_char *this, const char *ptr)
141 TRACE("(%p %p)\n", this, ptr);
142 return (unsigned char*)ptr-1;
145 /* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z */
146 /* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAX_K@Z */
147 DEFINE_THISCALL_WRAPPER(basic_string_char__Eos, 8)
148 void __thiscall basic_string_char__Eos(basic_string_char *this, MSVCP_size_t len)
150 this->size = len;
151 this->ptr[len] = 0;
154 /* ?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
155 /* ?clear@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
156 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_clear, 4)
157 void __thiscall MSVCP_basic_string_char_clear(basic_string_char *this)
159 if(this->ptr)
160 basic_string_char__Eos(this, 0);
163 /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z */
164 /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAX_N@Z */
165 DEFINE_THISCALL_WRAPPER(basic_string_char__Tidy, 8)
166 void __thiscall basic_string_char__Tidy(basic_string_char *this, MSVCP_bool built)
168 TRACE("(%p %d)\n", this, built);
170 if(!built || !this->ptr);
171 else if(!this->ptr[-1] || (unsigned char)this->ptr[-1]==FROZEN)
172 MSVCP_allocator_char_deallocate(NULL, this->ptr-1, this->res+2);
173 else
174 this->ptr[-1]--;
176 memset(this, 0, sizeof(*this));
179 /* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE_NI_N@Z */
180 /* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAA_N_K_N@Z */
181 DEFINE_THISCALL_WRAPPER(basic_string_char__Grow, 12)
182 MSVCP_bool __thiscall basic_string_char__Grow(basic_string_char *this, MSVCP_size_t new_size, MSVCP_bool trim)
184 if(!new_size) {
185 if(trim)
186 basic_string_char__Tidy(this, TRUE);
187 else if(this->ptr)
188 basic_string_char__Eos(this, 0);
189 } else if(this->res<new_size || trim ||
190 (this->ptr && this->ptr[-1] && (unsigned char)this->ptr[-1]!=FROZEN)) {
191 MSVCP_size_t new_res = new_size, len = this->size;
192 char *ptr;
194 if(!trim && this->ptr && !this->ptr[-1]) {
195 new_res |= 0xf;
196 if(new_res/3 < this->res/2)
197 new_res = this->res + this->res/2;
200 ptr = MSVCP_allocator_char_allocate(this->allocator, new_res+2);
201 if(!ptr) {
202 new_res = new_size;
203 ptr = MSVCP_allocator_char_allocate(this->allocator, new_size+2);
205 if(!ptr) {
206 ERR("Out of memory\n");
207 return FALSE;
210 if(len > new_res)
211 len = new_res;
213 *ptr = 0;
214 if(this->ptr)
215 char_traits_char__Copy_s(ptr+1, new_size, this->ptr, len);
216 basic_string_char__Tidy(this, TRUE);
217 this->ptr = ptr+1;
218 this->res = new_res;
219 basic_string_char__Eos(this, len);
222 return new_size>0;
225 /* ?_Split@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ */
226 /* ?_Split@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ */
227 DEFINE_THISCALL_WRAPPER(basic_string_char__Split, 4)
228 void __thiscall basic_string_char__Split(basic_string_char *this)
230 MSVCP_size_t len;
231 char *ptr;
233 TRACE("(%p)\n", this);
235 if(!this->ptr || !this->ptr[-1] || (unsigned char)this->ptr[-1]==FROZEN)
236 return;
238 ptr = this->ptr;
239 len = this->size;
240 basic_string_char__Tidy(this, TRUE);
241 if(basic_string_char__Grow(this, len, FALSE)) {
242 if(ptr)
243 char_traits_char__Copy_s(this->ptr, this->res, ptr, len);
244 basic_string_char__Eos(this, len);
248 /* ?_Freeze@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ */
249 /* ?_Freeze@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ */
250 DEFINE_THISCALL_WRAPPER(basic_string_char__Freeze, 4)
251 void __thiscall basic_string_char__Freeze(basic_string_char *this)
253 TRACE("(%p)\n", this);
254 basic_string_char__Split(this);
255 if(this->ptr)
256 this->ptr[-1] = FROZEN;
259 /* ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z */
260 /* ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAX_K@Z */
261 DEFINE_THISCALL_WRAPPER(basic_string_char__Copy, 8)
262 void __thiscall basic_string_char__Copy(basic_string_char *this, MSVCP_size_t copy_len)
264 TRACE("%p %lu\n", this, copy_len);
266 if(!basic_string_char__Grow(this, copy_len, TRUE))
267 return;
270 /* ?_Pdif@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAIPBD0@Z */
271 /* ?_Pdif@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CA_KPEBD0@Z */
272 MSVCP_size_t __cdecl basic_string_char__Pdif(const char *i1, const char *i2)
274 TRACE("(%p %p)\n", i1, i2);
275 return !i1 ? 0 : i1-i2;
278 /* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPADPADI@Z */
279 /* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEADPEAD_K@Z */
280 /* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDPBDI@Z */
281 /* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEBDPEBD_K@Z */
282 char* __cdecl basic_string_char__Psum(char *iter, MSVCP_size_t add)
284 TRACE("(%p %lu)\n", iter, add);
285 return iter ? iter+add : iter;
288 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z */
289 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0@Z */
290 DEFINE_THISCALL_WRAPPER(basic_string_char_erase, 12)
291 basic_string_char* __thiscall basic_string_char_erase(
292 basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t len)
294 TRACE("%p %lu %lu\n", this, pos, len);
296 if(pos > this->size)
297 _Xran();
299 if(len > this->size-pos)
300 len = this->size-pos;
302 if(len) {
303 basic_string_char__Split(this);
304 char_traits_char__Move_s(this->ptr+pos, this->res-pos,
305 this->ptr+pos+len, this->size-pos-len);
306 basic_string_char__Eos(this, this->size-len);
309 return this;
312 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADPAD0@Z */
313 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADPEAD0@Z */
314 DEFINE_THISCALL_WRAPPER(basic_string_char_erase_iter, 12)
315 char* __thiscall basic_string_char_erase_iter(basic_string_char *this, char *beg, char *end)
317 MSVCP_size_t pos = basic_string_char__Pdif(beg, this->ptr);
318 basic_string_char_erase(this, pos, basic_string_char__Pdif(end, beg));
319 return basic_string_char__Psum(this->ptr, pos);
322 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADPAD@Z */
323 /* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADPEAD@Z */
324 DEFINE_THISCALL_WRAPPER(basic_string_char_erase_beg, 8)
325 char* __thiscall basic_string_char_erase_beg(basic_string_char *this, char *beg)
327 MSVCP_size_t pos = beg-this->ptr;
328 basic_string_char_erase(this, pos, 1);
329 return this->ptr+pos;
332 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
333 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
334 DEFINE_THISCALL_WRAPPER(basic_string_char_assign_substr, 16)
335 basic_string_char* __thiscall basic_string_char_assign_substr(
336 basic_string_char *this, const basic_string_char *assign,
337 MSVCP_size_t pos, MSVCP_size_t len)
339 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
341 if(assign->size < pos)
342 _Xran();
344 if(len > assign->size-pos)
345 len = assign->size-pos;
347 if(this == assign) {
348 basic_string_char_erase(this, pos+len, basic_string_char_npos);
349 basic_string_char_erase(this, 0, pos);
350 } else if(basic_string_char__Grow(this, len, FALSE)) {
351 if(assign->ptr)
352 char_traits_char__Copy_s(this->ptr, this->res, assign->ptr+pos, len);
353 basic_string_char__Eos(this, len);
356 return this;
359 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
360 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
361 DEFINE_THISCALL_WRAPPER(basic_string_char_assign_cstr_len, 12)
362 basic_string_char* __thiscall basic_string_char_assign_cstr_len(
363 basic_string_char *this, const char *str, MSVCP_size_t len)
365 TRACE("%p %s %lu\n", this, debugstr_an(str, len), len);
367 if(basic_string_char_inside(this, str))
368 return basic_string_char_assign_substr(this, this, str-this->ptr, len);
369 else if(basic_string_char__Grow(this, len, FALSE)) {
370 char_traits_char__Copy_s(this->ptr, this->res, str, len);
371 basic_string_char__Eos(this, len);
374 return this;
377 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
378 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
379 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
380 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
381 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_assign, 8)
382 basic_string_char* __thiscall MSVCP_basic_string_char_assign(
383 basic_string_char *this, const basic_string_char *assign)
385 return basic_string_char_assign_substr(this, assign,
386 0, basic_string_char_npos);
389 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
390 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
391 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
392 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
393 DEFINE_THISCALL_WRAPPER(basic_string_char_assign_cstr, 8)
394 basic_string_char* __thiscall basic_string_char_assign_cstr(
395 basic_string_char *this, const char *str)
397 return basic_string_char_assign_cstr_len(this, str,
398 char_traits_char_length(str));
401 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z */
402 /* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z */
403 DEFINE_THISCALL_WRAPPER(basic_string_char_assign_ch, 8)
404 basic_string_char* __thiscall basic_string_char_assign_ch(
405 basic_string_char *this, char ch)
407 return basic_string_char_assign_cstr_len(this, &ch, 1);
410 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z */
411 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KD@Z */
412 DEFINE_THISCALL_WRAPPER(basic_string_char_assignn, 12)
413 basic_string_char* __thiscall basic_string_char_assignn(
414 basic_string_char *this, MSVCP_size_t count, char ch)
416 TRACE("%p %ld %c\n", this, count, ch);
418 basic_string_char__Grow(this, count, FALSE);
419 char_traits_char_assignn(this->ptr, count, ch);
420 basic_string_char__Eos(this, count);
421 return this;
424 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD0@Z */
425 /* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD0@Z */
426 DEFINE_THISCALL_WRAPPER(basic_string_char_assign_ptr_ptr, 12)
427 basic_string_char* __thiscall basic_string_char_assign_ptr_ptr(
428 basic_string_char *this, const char *first, const char *last)
430 return basic_string_char_assign_cstr_len(this, first, last-first);
433 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDIABV?$allocator@D@1@@Z */
434 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD_KAEBV?$allocator@D@1@@Z */
435 DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_cstr_len_alloc, 16)
436 basic_string_char* __thiscall basic_string_char_ctor_cstr_len_alloc(
437 basic_string_char *this, const char *str, MSVCP_size_t len, const void *alloc)
439 TRACE("%p %s %ld\n", this, debugstr_an(str, len), len);
441 basic_string_char__Tidy(this, FALSE);
442 basic_string_char_assign_cstr_len(this, str, len);
443 return this;
446 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDI@Z */
447 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD_K@Z */
448 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_cstr_len, 12)
449 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr_len(
450 basic_string_char *this, const char *str, MSVCP_size_t len)
452 return basic_string_char_ctor_cstr_len_alloc(this, str, len, NULL);
455 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@IIABV?$allocator@D@1@@Z */
456 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@_K1AEBV?$allocator@D@1@@Z */
457 DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_substr_alloc, 20)
458 basic_string_char* __thiscall basic_string_char_ctor_substr_alloc(
459 basic_string_char *this, const basic_string_char *assign,
460 MSVCP_size_t pos, MSVCP_size_t len, const void *alloc)
462 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
464 basic_string_char__Tidy(this, FALSE);
465 basic_string_char_assign_substr(this, assign, pos, len);
466 return this;
469 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z */
470 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBDAEBV?$allocator@D@1@@Z */
471 DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_cstr_alloc, 12)
472 basic_string_char* __thiscall basic_string_char_ctor_cstr_alloc(
473 basic_string_char *this, const char *str, const void *alloc)
475 TRACE("%p %s\n", this, debugstr_a(str));
477 basic_string_char__Tidy(this, FALSE);
478 basic_string_char_assign_cstr(this, str);
479 return this;
482 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z */
483 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z */
484 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor_cstr, 8)
485 basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr(
486 basic_string_char *this, const char *str)
488 return basic_string_char_ctor_cstr_alloc(this, str, NULL);
491 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@IDABV?$allocator@D@1@@Z */
492 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@_KDAEBV?$allocator@D@1@@Z */
493 DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_ch_alloc, 16)
494 basic_string_char* __thiscall basic_string_char_ctor_ch_alloc(basic_string_char *this,
495 MSVCP_size_t count, char ch, const void *alloc)
497 TRACE("%p %ld %c\n", this, count, ch);
499 basic_string_char__Tidy(this, FALSE);
500 basic_string_char_assignn(this, count, ch);
501 return this;
504 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD0ABV?$allocator@D@1@@Z */
505 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD0AEBV?$allocator@D@1@@Z */
506 DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_iter, 16)
507 basic_string_char* __thiscall basic_string_char_ctor_iter(basic_string_char *this,
508 const char *first, const char *last, allocator *alloc)
510 TRACE("(%p %p %p %p)\n", this, first, last, alloc);
512 basic_string_char__Tidy(this, FALSE);
513 basic_string_char_assign_cstr_len(this, first, basic_string_char__Pdif(last, first));
514 return this;
517 /* ??_F?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
518 /* ??_F?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
519 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_ctor, 4)
520 basic_string_char* __thiscall MSVCP_basic_string_char_ctor(basic_string_char *this)
522 TRACE("%p\n", this);
524 basic_string_char__Tidy(this, FALSE);
525 return this;
528 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z */
529 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV?$allocator@D@1@@Z */
530 DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_alloc, 8)
531 basic_string_char* __thiscall basic_string_char_ctor_alloc(
532 basic_string_char *this, const void *alloc)
534 TRACE("%p %p\n", this, alloc);
536 basic_string_char__Tidy(this, FALSE);
537 return this;
540 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z */
541 /* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@@Z */
542 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_copy_ctor, 8)
543 basic_string_char* __thiscall MSVCP_basic_string_char_copy_ctor(
544 basic_string_char *this, const basic_string_char *copy)
546 TRACE("%p %p\n", this, copy);
548 basic_string_char__Tidy(this, FALSE);
549 MSVCP_basic_string_char_assign(this, copy);
550 return this;
553 /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
554 /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
555 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_dtor, 4)
556 void __thiscall MSVCP_basic_string_char_dtor(basic_string_char *this)
558 TRACE("%p\n", this);
559 basic_string_char__Tidy(this, TRUE);
562 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBDI@Z */
563 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD0@Z */
564 DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr_cstr_len, 20)
565 int __thiscall basic_string_char_compare_substr_cstr_len(
566 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
567 const char *str, MSVCP_size_t count)
569 int ans;
571 TRACE("%p %lu %lu %s %lu\n", this, pos, num, debugstr_an(str, count), count);
573 if(this->size < pos)
574 _Xran();
576 if(num > this->size-pos)
577 num = this->size-pos;
579 ans = char_traits_char_compare(this->ptr+pos,
580 str, num>count ? count : num);
581 if(ans)
582 return ans;
584 if(num > count)
585 ans = 1;
586 else if(num < count)
587 ans = -1;
588 return ans;
591 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHPBD@Z */
592 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHPEBD@Z */
593 DEFINE_THISCALL_WRAPPER(basic_string_char_compare_cstr, 8)
594 int __thiscall basic_string_char_compare_cstr(
595 const basic_string_char *this, const char *str)
597 return basic_string_char_compare_substr_cstr_len(this, 0, this->size,
598 str, char_traits_char_length(str));
601 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@II@Z */
602 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@00@Z */
603 DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr_substr, 24)
604 int __thiscall basic_string_char_compare_substr_substr(
605 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
606 const basic_string_char *compare, MSVCP_size_t off, MSVCP_size_t count)
608 TRACE("%p %lu %lu %p %lu %lu\n", this, pos, num, compare, off, count);
610 if(compare->size < off)
611 _Xran();
613 if(count > compare->size-off)
614 count = compare->size-off;
616 return basic_string_char_compare_substr_cstr_len(this, pos, num,
617 compare->ptr+off, count);
620 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@@Z */
621 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@@Z */
622 DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr, 16)
623 int __thiscall basic_string_char_compare_substr(
624 const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
625 const basic_string_char *compare)
627 return basic_string_char_compare_substr_cstr_len(this, pos, num,
628 compare->ptr, compare->size);
631 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHABV12@@Z */
632 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHAEBV12@@Z */
633 DEFINE_THISCALL_WRAPPER(basic_string_char_compare, 8)
634 int __thiscall basic_string_char_compare(
635 const basic_string_char *this, const basic_string_char *compare)
637 return basic_string_char_compare_substr_cstr_len(this, 0, this->size,
638 compare->ptr, compare->size);
641 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBD@Z */
642 /* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD@Z */
643 DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr_cstr, 16)
644 int __thiscall basic_string_char_compare_substr_cstr(const basic_string_char *this,
645 MSVCP_size_t pos, MSVCP_size_t num, const char *str)
647 return basic_string_char_compare_substr_cstr_len(this, pos, num,
648 str, char_traits_char_length(str));
651 /* ??$?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 */
652 /* ??$?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 */
653 /* ??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
654 /* ??8std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
655 MSVCP_bool __cdecl basic_string_char_equal(
656 const basic_string_char *left, const basic_string_char *right)
658 return basic_string_char_compare(left, right) == 0;
661 /* ??$?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 */
662 /* ??$?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 */
663 /* ??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
664 /* ??8std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
665 MSVCP_bool __cdecl basic_string_char_equal_str_cstr(
666 const basic_string_char *left, const char *right)
668 return basic_string_char_compare_cstr(left, right) == 0;
671 /* ??$?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 */
672 /* ??$?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 */
673 /* ??8std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
674 /* ??8std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
675 MSVCP_bool __cdecl basic_string_char_equal_cstr_str(
676 const char *left, const basic_string_char *right)
678 return basic_string_char_compare_cstr(right, left) == 0;
681 /* ??$?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 */
682 /* ??$?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 */
683 /* ??9std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
684 /* ??9std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
685 MSVCP_bool __cdecl basic_string_char_not_equal(
686 const basic_string_char *left, const basic_string_char *right)
688 return basic_string_char_compare(left, right) != 0;
691 /* ??$?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 */
692 /* ??$?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 */
693 /* ??9std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
694 /* ??9std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
695 MSVCP_bool __cdecl basic_string_char_not_equal_str_cstr(
696 const basic_string_char *left, const char *right)
698 return basic_string_char_compare_cstr(left, right) != 0;
701 /* ??$?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 */
702 /* ??$?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 */
703 /* ??9std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
704 /* ??9std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
705 MSVCP_bool __cdecl basic_string_char_not_equal_cstr_str(
706 const char *left, const basic_string_char *right)
708 return basic_string_char_compare_cstr(right, left) != 0;
711 /* ??$?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 */
712 /* ??$?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 */
713 /* ??Mstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
714 /* ??Mstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
715 MSVCP_bool __cdecl basic_string_char_lower(
716 const basic_string_char *left, const basic_string_char *right)
718 return basic_string_char_compare(left, right) < 0;
721 /* ??$?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 */
722 /* ??$?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 */
723 /* ??Mstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
724 /* ??Mstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
725 MSVCP_bool __cdecl basic_string_char_lower_bstr_cstr(
726 const basic_string_char *left, const char *right)
728 return basic_string_char_compare_cstr(left, right) < 0;
731 /* ??$?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 */
732 /* ??$?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 */
733 /* ??Mstd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
734 /* ??Mstd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
735 MSVCP_bool __cdecl basic_string_char_lower_cstr_bstr(
736 const char *left, const basic_string_char *right)
738 return basic_string_char_compare_cstr(right, left) > 0;
741 /* ??$?NDU?$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 */
742 /* ??$?NDU?$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 */
743 /* ??Nstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
744 /* ??Nstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
745 MSVCP_bool __cdecl basic_string_char_leq(
746 const basic_string_char *left, const basic_string_char *right)
748 return basic_string_char_compare(left, right) <= 0;
751 /* ??$?NDU?$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 */
752 /* ??$?NDU?$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 */
753 /* ??Nstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
754 /* ??Nstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
755 MSVCP_bool __cdecl basic_string_char_leq_bstr_cstr(
756 const basic_string_char *left, const char *right)
758 return basic_string_char_compare_cstr(left, right) <= 0;
761 /* ??$?NDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
762 /* ??$?NDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
763 /* ??Nstd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
764 /* ??Nstd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
765 MSVCP_bool __cdecl basic_string_char_leq_cstr_bstr(
766 const char *left, const basic_string_char *right)
768 return basic_string_char_compare_cstr(right, left) >= 0;
771 /* ??$?ODU?$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 */
772 /* ??$?ODU?$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 */
773 /* ??Ostd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
774 /* ??Ostd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
775 MSVCP_bool __cdecl basic_string_char_greater(
776 const basic_string_char *left, const basic_string_char *right)
778 return basic_string_char_compare(left, right) > 0;
781 /* ??$?ODU?$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 */
782 /* ??$?ODU?$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 */
783 /* ??Ostd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
784 /* ??Ostd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
785 MSVCP_bool __cdecl basic_string_char_greater_bstr_cstr(
786 const basic_string_char *left, const char *right)
788 return basic_string_char_compare_cstr(left, right) > 0;
791 /* ??$?ODU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
792 /* ??$?ODU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
793 /* ??Ostd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
794 /* ??Ostd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
795 MSVCP_bool __cdecl basic_string_char_greater_cstr_bstr(
796 const char *left, const basic_string_char *right)
798 return basic_string_char_compare_cstr(right, left) < 0;
801 /* ??$?PDU?$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 */
802 /* ??$?PDU?$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 */
803 /* ??Pstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
804 /* ??Pstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
805 MSVCP_bool __cdecl basic_string_char_geq(
806 const basic_string_char *left, const basic_string_char *right)
808 return basic_string_char_compare(left, right) >= 0;
811 /* ??$?PDU?$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 */
812 /* ??$?PDU?$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 */
813 /* ??Pstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
814 /* ??Pstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
815 MSVCP_bool __cdecl basic_string_char_geq_bstr_cstr(
816 const basic_string_char *left, const char *right)
818 return basic_string_char_compare_cstr(left, right) >= 0;
821 /* ??$?PDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
822 /* ??$?PDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
823 /* ??Pstd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
824 /* ??Pstd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
825 MSVCP_bool __cdecl basic_string_char_geq_cstr_bstr(
826 const char *left, const basic_string_char *right)
828 return basic_string_char_compare_cstr(right, left) <= 0;
831 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
832 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
833 DEFINE_THISCALL_WRAPPER(basic_string_char_find_cstr_substr, 16)
834 MSVCP_size_t __thiscall basic_string_char_find_cstr_substr(
835 const basic_string_char *this, const char *find, MSVCP_size_t pos, MSVCP_size_t len)
837 const char *p, *end;
839 TRACE("%p %s %lu %lu\n", this, debugstr_an(find, len), pos, len);
841 if(len==0 && pos<=this->size)
842 return pos;
843 if(pos>=this->size || len>this->size)
844 return basic_string_char_npos;
846 end = this->ptr+this->size-len+1;
847 for(p=this->ptr+pos; p<end; p++) {
848 p = char_traits_char_find(p, end-p, find);
849 if(!p)
850 break;
852 if(!char_traits_char_compare(p, find, len))
853 return p-this->ptr;
856 return basic_string_char_npos;
859 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
860 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
861 DEFINE_THISCALL_WRAPPER(basic_string_char_find_off, 12)
862 MSVCP_size_t __thiscall basic_string_char_find_off(
863 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
865 return basic_string_char_find_cstr_substr(this, find->ptr, off, find->size);
868 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
869 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
870 DEFINE_THISCALL_WRAPPER(basic_string_char_find_ch, 12)
871 MSVCP_size_t __thiscall basic_string_char_find_ch(
872 const basic_string_char *this, char ch, MSVCP_size_t pos)
874 return basic_string_char_find_cstr_substr(this, &ch, pos, 1);
877 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
878 /* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
879 DEFINE_THISCALL_WRAPPER(basic_string_char_find_cstr_off, 12)
880 MSVCP_size_t __thiscall basic_string_char_find_cstr_off(
881 const basic_string_char *this, const char *find, MSVCP_size_t pos)
883 return basic_string_char_find_cstr_substr(this, find, pos,
884 char_traits_char_length(find));
887 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
888 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
889 DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_cstr_substr, 16)
890 MSVCP_size_t __thiscall basic_string_char_rfind_cstr_substr(
891 const basic_string_char *this, const char *find, MSVCP_size_t pos, MSVCP_size_t len)
893 const char *p, *end;
895 TRACE("%p %s %lu %lu\n", this, debugstr_an(find, len), pos, len);
897 if(len==0)
898 return pos<this->size ? pos : this->size;
900 if(len > this->size)
901 return basic_string_char_npos;
903 if(pos > this->size-len+1)
904 pos = this->size-len+1;
905 end = this->ptr;
906 for(p=end+pos; p>=end; p--) {
907 if(*p==*find && !char_traits_char_compare(p, find, len))
908 return p-this->ptr;
911 return basic_string_char_npos;
914 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
915 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
916 DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_off, 12)
917 MSVCP_size_t __thiscall basic_string_char_rfind_off(
918 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
920 return basic_string_char_rfind_cstr_substr(this, find->ptr, off, find->size);
923 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
924 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
925 DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_ch, 12)
926 MSVCP_size_t __thiscall basic_string_char_rfind_ch(
927 const basic_string_char *this, char ch, MSVCP_size_t pos)
929 return basic_string_char_rfind_cstr_substr(this, &ch, pos, 1);
932 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
933 /* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
934 DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_cstr_off, 12)
935 MSVCP_size_t __thiscall basic_string_char_rfind_cstr_off(
936 const basic_string_char *this, const char *find, MSVCP_size_t pos)
938 return basic_string_char_rfind_cstr_substr(this, find, pos,
939 char_traits_char_length(find));
942 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
943 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
944 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of_cstr_substr, 16)
945 MSVCP_size_t __thiscall basic_string_char_find_first_not_of_cstr_substr(
946 const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
948 const char *p, *end;
950 TRACE("%p %p %lu %lu\n", this, find, off, len);
952 if(off<this->size) {
953 end = this->ptr+this->size;
954 for(p=this->ptr+off; p<end; p++)
955 if(!char_traits_char_find(find, len, p))
956 return p-this->ptr;
959 return basic_string_char_npos;
962 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
963 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
964 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of, 12)
965 MSVCP_size_t __thiscall basic_string_char_find_first_not_of(
966 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
968 return basic_string_char_find_first_not_of_cstr_substr(this,
969 find->ptr, off, find->size);
972 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
973 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
974 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of_ch, 12)
975 MSVCP_size_t __thiscall basic_string_char_find_first_not_of_ch(
976 const basic_string_char *this, char ch, MSVCP_size_t off)
978 return basic_string_char_find_first_not_of_cstr_substr(this, &ch, off, 1);
981 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
982 /* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
983 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of_cstr, 12)
984 MSVCP_size_t __thiscall basic_string_char_find_first_not_of_cstr(
985 const basic_string_char *this, const char *find, MSVCP_size_t off)
987 return basic_string_char_find_first_not_of_cstr_substr(
988 this, find, off, char_traits_char_length(find));
991 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
992 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
993 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of_cstr_substr, 16)
994 MSVCP_size_t __thiscall basic_string_char_find_first_of_cstr_substr(
995 const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
997 const char *p, *end;
999 TRACE("%p %p %lu %lu\n", this, find, off, len);
1001 if(len>0 && off<this->size) {
1002 end = this->ptr+this->size;
1003 for(p=this->ptr+off; p<end; p++)
1004 if(char_traits_char_find(find, len, p))
1005 return p-this->ptr;
1008 return basic_string_char_npos;
1011 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
1012 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
1013 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of, 12)
1014 MSVCP_size_t __thiscall basic_string_char_find_first_of(
1015 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
1017 return basic_string_char_find_first_of_cstr_substr(this,
1018 find->ptr, off, find->size);
1021 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
1022 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
1023 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of_ch, 12)
1024 MSVCP_size_t __thiscall basic_string_char_find_first_of_ch(
1025 const basic_string_char *this, char ch, MSVCP_size_t off)
1027 return basic_string_char_find_first_of_cstr_substr(this, &ch, off, 1);
1030 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
1031 /* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
1032 DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of_cstr, 12)
1033 MSVCP_size_t __thiscall basic_string_char_find_first_of_cstr(
1034 const basic_string_char *this, const char *find, MSVCP_size_t off)
1036 return basic_string_char_find_first_of_cstr_substr(
1037 this, find, off, char_traits_char_length(find));
1040 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
1041 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
1042 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of_cstr_substr, 16)
1043 MSVCP_size_t __thiscall basic_string_char_find_last_not_of_cstr_substr(
1044 const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
1046 const char *p, *beg;
1048 TRACE("%p %p %lu %lu\n", this, find, off, len);
1050 if(len>0 && this->size>0) {
1051 if(off >= this->size)
1052 off = this->size-1;
1054 beg = this->ptr;
1055 for(p=beg+off; p>=beg; p--)
1056 if(!char_traits_char_find(find, len, p))
1057 return p-beg;
1060 return basic_string_char_npos;
1063 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
1064 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
1065 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of, 12)
1066 MSVCP_size_t __thiscall basic_string_char_find_last_not_of(
1067 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
1069 return basic_string_char_find_last_not_of_cstr_substr(this,
1070 find->ptr, off, find->size);
1073 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
1074 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
1075 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of_ch, 12)
1076 MSVCP_size_t __thiscall basic_string_char_find_last_not_of_ch(
1077 const basic_string_char *this, char ch, MSVCP_size_t off)
1079 return basic_string_char_find_last_not_of_cstr_substr(this, &ch, off, 1);
1082 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
1083 /* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
1084 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of_cstr, 12)
1085 MSVCP_size_t __thiscall basic_string_char_find_last_not_of_cstr(
1086 const basic_string_char *this, const char *find, MSVCP_size_t off)
1088 return basic_string_char_find_last_not_of_cstr_substr(
1089 this, find, off, char_traits_char_length(find));
1092 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
1093 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
1094 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of_cstr_substr, 16)
1095 MSVCP_size_t __thiscall basic_string_char_find_last_of_cstr_substr(
1096 const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
1098 const char *p, *beg;
1100 TRACE("%p %p %lu %lu\n", this, find, off, len);
1102 if(len>0 && this->size>0) {
1103 if(off >= this->size)
1104 off = this->size-1;
1106 beg = this->ptr;
1107 for(p=beg+off; p>=beg; p--)
1108 if(char_traits_char_find(find, len, p))
1109 return p-beg;
1112 return basic_string_char_npos;
1115 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
1116 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
1117 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of, 12)
1118 MSVCP_size_t __thiscall basic_string_char_find_last_of(
1119 const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
1121 return basic_string_char_find_last_of_cstr_substr(this,
1122 find->ptr, off, find->size);
1125 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
1126 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
1127 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of_ch, 12)
1128 MSVCP_size_t __thiscall basic_string_char_find_last_of_ch(
1129 const basic_string_char *this, char ch, MSVCP_size_t off)
1131 return basic_string_char_find_last_of_cstr_substr(this, &ch, off, 1);
1134 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
1135 /* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
1136 DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of_cstr, 12)
1137 MSVCP_size_t __thiscall basic_string_char_find_last_of_cstr(
1138 const basic_string_char *this, const char *find, MSVCP_size_t off)
1140 return basic_string_char_find_last_of_cstr_substr(
1141 this, find, off, char_traits_char_length(find));
1144 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
1145 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
1146 DEFINE_THISCALL_WRAPPER(basic_string_char_append_substr, 16)
1147 basic_string_char* __thiscall basic_string_char_append_substr(basic_string_char *this,
1148 const basic_string_char *append, MSVCP_size_t offset, MSVCP_size_t count)
1150 TRACE("%p %p %lu %lu\n", this, append, offset, count);
1152 if(append->size < offset)
1153 _Xran();
1155 if(count > append->size-offset)
1156 count = append->size-offset;
1158 if(basic_string_char_npos-this->size<=count || this->size+count<this->size)
1159 _Xlen();
1161 if(basic_string_char__Grow(this, this->size+count, FALSE)) {
1162 if(append->ptr)
1163 char_traits_char__Copy_s(this->ptr+this->size, this->res-this->size,
1164 append->ptr+offset, count);
1165 basic_string_char__Eos(this, this->size+count);
1168 return this;
1171 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
1172 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
1173 DEFINE_THISCALL_WRAPPER(basic_string_char_append_cstr_len, 12)
1174 basic_string_char* __thiscall basic_string_char_append_cstr_len(
1175 basic_string_char *this, const char *append, MSVCP_size_t count)
1177 TRACE("%p %s %lu\n", this, debugstr_an(append, count), count);
1179 if(basic_string_char_inside(this, append))
1180 return basic_string_char_append_substr(this, this, append-this->ptr, count);
1182 if(basic_string_char_npos-this->size<=count || this->size+count<this->size)
1183 _Xlen();
1185 if(basic_string_char__Grow(this, this->size+count, FALSE)) {
1186 char_traits_char__Copy_s(this->ptr+this->size,
1187 this->res-this->size, append, count);
1188 basic_string_char__Eos(this, this->size+count);
1191 return this;
1194 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z */
1195 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KD@Z */
1196 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_len_ch, 12)
1197 basic_string_char* __thiscall MSVCP_basic_string_char_append_len_ch(
1198 basic_string_char *this, MSVCP_size_t count, char ch)
1200 TRACE("%p %lu %c\n", this, count, ch);
1202 if(basic_string_char_npos-this->size <= count)
1203 _Xlen();
1205 if(basic_string_char__Grow(this, this->size+count, FALSE)) {
1206 char_traits_char_assignn(this->ptr+this->size, count, ch);
1207 basic_string_char__Eos(this, this->size+count);
1210 return this;
1213 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
1214 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
1215 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
1216 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
1217 DEFINE_THISCALL_WRAPPER(basic_string_char_append, 8)
1218 basic_string_char* __thiscall basic_string_char_append(
1219 basic_string_char *this, const basic_string_char *append)
1221 return basic_string_char_append_substr(this, append,
1222 0, basic_string_char_npos);
1225 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z */
1226 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z */
1227 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_append_ch, 8)
1228 basic_string_char* __thiscall MSVCP_basic_string_char_append_ch(
1229 basic_string_char *this, char ch)
1231 return MSVCP_basic_string_char_append_len_ch(this, 1, ch);
1234 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD0@Z */
1235 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD0@Z */
1236 DEFINE_THISCALL_WRAPPER(basic_string_char_append_beg_end, 12)
1237 basic_string_char* __thiscall basic_string_char_append_beg_end(
1238 basic_string_char *this, const char *beg, const char *end)
1240 return basic_string_char_append_cstr_len(this, beg, end-beg);
1243 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
1244 /* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
1245 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
1246 /* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
1247 DEFINE_THISCALL_WRAPPER(basic_string_char_append_cstr, 8)
1248 basic_string_char* __thiscall basic_string_char_append_cstr(
1249 basic_string_char *this, const char *append)
1251 return basic_string_char_append_cstr_len(this, append,
1252 char_traits_char_length(append));
1254 /* ??$?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 */
1255 /* ??$?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 */
1256 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z */
1257 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@0@Z */
1258 basic_string_char* __cdecl basic_string_char_concatenate(basic_string_char *ret,
1259 const basic_string_char *left, const basic_string_char *right)
1261 TRACE("%p %p\n", left, right);
1263 MSVCP_basic_string_char_copy_ctor(ret, left);
1264 basic_string_char_append(ret, right);
1265 return ret;
1268 /* ??$?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@D@Z */
1269 /* ??$?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@D@Z */
1270 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@D@Z */
1271 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@D@Z */
1272 basic_string_char* __cdecl basic_string_char_concatenate_bstr_ch(basic_string_char *ret,
1273 const basic_string_char *left, char right)
1275 TRACE("%p %c\n", left, right);
1277 MSVCP_basic_string_char_copy_ctor(ret, left);
1278 MSVCP_basic_string_char_append_ch(ret, right);
1279 return ret;
1282 /* ??$?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 */
1283 /* ??$?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 */
1284 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z */
1285 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@PEBD@Z */
1286 basic_string_char* __cdecl basic_string_char_concatenate_bstr_cstr(basic_string_char *ret,
1287 const basic_string_char *left, const char *right)
1289 TRACE("%p %s\n", left, debugstr_a(right));
1291 MSVCP_basic_string_char_copy_ctor(ret, left);
1292 basic_string_char_append_cstr(ret, right);
1293 return ret;
1296 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@DABV10@@Z */
1297 /* ??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@DAEBV10@@Z */
1298 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@DABV10@@Z */
1299 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@DAEBV10@@Z */
1300 basic_string_char* __cdecl basic_string_char_concatenate_ch_bstr(basic_string_char *ret,
1301 char left, const basic_string_char *right)
1303 TRACE("%c %p\n", left, right);
1305 basic_string_char_ctor_cstr_len_alloc(ret, &left, 1, NULL);
1306 basic_string_char_append(ret, right);
1307 return ret;
1310 /* ??$?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 */
1311 /* ??$?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 */
1312 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z */
1313 /* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBDAEBV10@@Z */
1314 basic_string_char* __cdecl basic_string_char_concatenate_cstr_bstr(basic_string_char *ret,
1315 const char *left, const basic_string_char *right)
1317 TRACE("%s %p\n", debugstr_a(left), right);
1319 basic_string_char_ctor_cstr_alloc(ret, left, NULL);
1320 basic_string_char_append(ret, right);
1321 return ret;
1324 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
1325 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
1326 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
1327 /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
1328 DEFINE_THISCALL_WRAPPER(basic_string_char_operator_at, 8)
1329 char* __thiscall basic_string_char_operator_at(
1330 basic_string_char *this, MSVCP_size_t pos)
1332 TRACE("%p %lu\n", this, pos);
1334 assert(this->size >= pos);
1335 return this->ptr+pos;
1338 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
1339 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
1340 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
1341 /* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
1342 DEFINE_THISCALL_WRAPPER(basic_string_char_at, 8)
1343 char* __thiscall basic_string_char_at(
1344 basic_string_char *this, MSVCP_size_t pos)
1346 TRACE("%p %lu\n", this, pos);
1348 if(this->size <= pos)
1349 _Xran();
1351 return this->ptr+pos;
1354 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIPBDI@Z */
1355 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0PEBD0@Z */
1356 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_cstr_len, 20)
1357 basic_string_char* __thiscall basic_string_char_replace_cstr_len(basic_string_char *this,
1358 MSVCP_size_t off, MSVCP_size_t len, const char *str, MSVCP_size_t str_len)
1360 MSVCP_size_t inside_pos = -1;
1361 char *ptr = this->ptr;
1363 TRACE("%p %ld %ld %p %ld\n", this, off, len, str, str_len);
1365 if(this->size < off)
1366 _Xran();
1368 if(len > this->size-off)
1369 len = this->size-off;
1371 if(basic_string_char_npos-str_len <= this->size-len)
1372 _Xlen();
1374 if(basic_string_char_inside(this, str))
1375 inside_pos = str-ptr;
1377 if(this->size-len+str_len)
1378 basic_string_char__Grow(this, this->size-len+str_len, FALSE);
1379 ptr = this->ptr;
1381 if(inside_pos == -1) {
1382 memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
1383 memcpy(ptr+off, str, str_len*sizeof(char));
1384 } else if(len >= str_len) {
1385 memmove(ptr+off, ptr+inside_pos, str_len*sizeof(char));
1386 memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
1387 } else {
1388 MSVCP_size_t size;
1390 memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
1392 if(inside_pos < off+len) {
1393 size = off+len-inside_pos;
1394 if(size > str_len)
1395 size = str_len;
1396 memmove(ptr+off, ptr+inside_pos, size*sizeof(char));
1397 } else {
1398 size = 0;
1401 if(str_len > size)
1402 memmove(ptr+off+size, ptr+off+str_len, (str_len-size)*sizeof(char));
1405 if(this->ptr)
1406 basic_string_char__Eos(this, this->size-len+str_len);
1407 return this;
1410 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIABV12@II@Z */
1411 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0AEBV12@00@Z */
1412 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_substr, 24)
1413 basic_string_char* __thiscall basic_string_char_replace_substr(basic_string_char *this, MSVCP_size_t off,
1414 MSVCP_size_t len, const basic_string_char *str, MSVCP_size_t str_off, MSVCP_size_t str_len)
1416 if(str->size < str_off)
1417 _Xran();
1419 if(str_len > str->size-str_off)
1420 str_len = str->size-str_off;
1422 return basic_string_char_replace_cstr_len(this, off, len,
1423 str->ptr+str_off, str_len);
1426 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIABV12@@Z */
1427 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0AEBV12@@Z */
1428 DEFINE_THISCALL_WRAPPER(basic_string_char_replace, 16)
1429 basic_string_char* __thiscall basic_string_char_replace(basic_string_char *this,
1430 MSVCP_size_t off, MSVCP_size_t len, const basic_string_char *str)
1432 return basic_string_char_replace_cstr_len(this, off, len,
1433 str->ptr, str->size);
1436 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIID@Z */
1437 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K00D@Z */
1438 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_ch, 20)
1439 basic_string_char* __thiscall basic_string_char_replace_ch(basic_string_char *this,
1440 MSVCP_size_t off, MSVCP_size_t len, MSVCP_size_t count, char ch)
1442 char *ptr;
1444 TRACE("%p %ld %ld %ld %c\n", this, off, len, count, ch);
1446 if(this->size < off)
1447 _Xran();
1449 if(len > this->size-off)
1450 len = this->size-off;
1452 if(basic_string_char_npos-count <= this->size-len)
1453 _Xlen();
1455 if(this->size-len+count)
1456 basic_string_char__Grow(this, this->size-len+count, FALSE);
1457 ptr = this->ptr;
1459 memmove(ptr+off+count, ptr+off+len, (this->size-off-len)*sizeof(char));
1460 char_traits_char_assignn(ptr+off, count, ch);
1461 basic_string_char__Eos(this, this->size-len+count);
1463 return this;
1466 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIPBD@Z */
1467 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0PEBD@Z */
1468 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_cstr, 16)
1469 basic_string_char* __thiscall basic_string_char_replace_cstr(basic_string_char *this,
1470 MSVCP_size_t off, MSVCP_size_t len, const char *str)
1472 return basic_string_char_replace_cstr_len(this, off, len, str,
1473 char_traits_char_length(str));
1476 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0ABV12@@Z */
1477 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0AEBV12@@Z */
1478 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_bstr, 16)
1479 basic_string_char* __thiscall basic_string_char_replace_iter_bstr(basic_string_char *this,
1480 char *beg, char *end, const basic_string_char *str)
1482 return basic_string_char_replace(this, basic_string_char__Pdif(beg, this->ptr),
1483 basic_string_char__Pdif(end, beg), str);
1486 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0ID@Z */
1487 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0_KD@Z */
1488 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_chn, 20)
1489 basic_string_char* __thiscall basic_string_char_replace_iter_chn(basic_string_char *this,
1490 char *beg, char *end, MSVCP_size_t count, char ch)
1492 return basic_string_char_replace_ch(this, basic_string_char__Pdif(beg, this->ptr),
1493 basic_string_char__Pdif(end, beg), count, ch);
1496 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0PBD1@Z */
1497 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0PEBD1@Z */
1498 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_iter, 20)
1499 basic_string_char* __thiscall basic_string_char_replace_iter_iter(basic_string_char *this,
1500 char *beg1, char *end1, const char *beg2, const char *end2)
1502 return basic_string_char_replace_cstr_len(this, basic_string_char__Pdif(beg1, this->ptr),
1503 basic_string_char__Pdif(end1, beg1), beg2, basic_string_char__Pdif(end2, beg2));
1506 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0PBD@Z */
1507 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0PEBD@Z */
1508 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_cstr, 16)
1509 basic_string_char* __thiscall basic_string_char_replace_iter_cstr(basic_string_char *this,
1510 char *beg, char *end, const char *str)
1512 return basic_string_char_replace_cstr(this, basic_string_char__Pdif(beg, this->ptr),
1513 basic_string_char__Pdif(end, beg), str);
1516 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0PBDI@Z */
1517 /* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0PEBD_K@Z */
1518 DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_cstr_len, 20)
1519 basic_string_char* __thiscall basic_string_char_replace_iter_cstr_len(basic_string_char *this,
1520 char *beg, char *end, const char *str, MSVCP_size_t len)
1522 return basic_string_char_replace_cstr_len(this, basic_string_char__Pdif(beg, this->ptr),
1523 basic_string_char__Pdif(end, beg), str, len);
1526 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IABV12@@Z */
1527 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KAEBV12@@Z */
1528 DEFINE_THISCALL_WRAPPER(basic_string_char_insert, 12)
1529 basic_string_char* __thiscall basic_string_char_insert(basic_string_char *this,
1530 MSVCP_size_t off, const basic_string_char *str)
1532 return basic_string_char_replace(this, off, 0, str);
1535 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IABV12@II@Z */
1536 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KAEBV12@00@Z */
1537 DEFINE_THISCALL_WRAPPER(basic_string_char_insert_substr, 20)
1538 basic_string_char* __thiscall basic_string_char_insert_substr(
1539 basic_string_char *this, MSVCP_size_t off, const basic_string_char *str,
1540 MSVCP_size_t str_off, MSVCP_size_t str_count)
1542 return basic_string_char_replace_substr(this, off, 0, str, str_off, str_count);
1545 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IPBD@Z */
1546 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KPEBD@Z */
1547 DEFINE_THISCALL_WRAPPER(basic_string_char_insert_cstr, 12)
1548 basic_string_char* __thiscall basic_string_char_insert_cstr(
1549 basic_string_char *this, MSVCP_size_t off, const char *str)
1551 return basic_string_char_replace_cstr(this, off, 0, str);
1554 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IPBDI@Z */
1555 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KPEBD0@Z */
1556 DEFINE_THISCALL_WRAPPER(basic_string_char_insert_cstr_len, 16)
1557 basic_string_char* __thiscall basic_string_char_insert_cstr_len(basic_string_char *this,
1558 MSVCP_size_t off, const char *str, MSVCP_size_t str_len)
1560 return basic_string_char_replace_cstr_len(this, off, 0, str, str_len);
1563 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IID@Z */
1564 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0D@Z */
1565 DEFINE_THISCALL_WRAPPER(basic_string_char_insert_chn, 16)
1566 basic_string_char* __thiscall basic_string_char_insert_chn(basic_string_char *this,
1567 MSVCP_size_t off, MSVCP_size_t count, char ch)
1569 return basic_string_char_replace_ch(this, off, 0, count, ch);
1572 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADPADD@Z */
1573 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADPEADD@Z */
1574 DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter_ch, 12)
1575 char* __thiscall basic_string_char_insert_iter_ch(basic_string_char *this, char *pos, char ch)
1577 MSVCP_size_t off = basic_string_char__Pdif(pos, this->ptr);
1578 basic_string_char_insert_chn(this, off, 1, ch);
1579 return basic_string_char__Psum(this->ptr, off);
1582 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXPADID@Z */
1583 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXPEAD_KD@Z */
1584 DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter_chn, 16)
1585 void __thiscall basic_string_char_insert_iter_chn(basic_string_char *this,
1586 char *pos, MSVCP_size_t n, char ch)
1588 basic_string_char_insert_chn(this, basic_string_char__Pdif(pos, this->ptr), n, ch);
1591 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXPADPBD1@Z */
1592 /* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXPEADPEBD1@Z */
1593 DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter, 16)
1594 void __thiscall basic_string_char_insert_iter(basic_string_char *this,
1595 char *pos, const char *beg, const char *end)
1597 basic_string_char_insert_cstr_len(this, basic_string_char__Pdif(pos, this->ptr),
1598 beg, basic_string_char__Pdif(end, beg));
1601 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXID@Z */
1602 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_KD@Z */
1603 DEFINE_THISCALL_WRAPPER(basic_string_char_resize_ch, 12)
1604 void __thiscall basic_string_char_resize_ch(
1605 basic_string_char *this, MSVCP_size_t size, char ch)
1607 TRACE("%p %lu %c\n", this, size, ch);
1609 if(size <= this->size)
1610 basic_string_char_erase(this, size, this->size);
1611 else
1612 MSVCP_basic_string_char_append_len_ch(this, size-this->size, ch);
1615 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z */
1616 /* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K@Z */
1617 DEFINE_THISCALL_WRAPPER(basic_string_char_resize, 8)
1618 void __thiscall basic_string_char_resize(
1619 basic_string_char *this, MSVCP_size_t size)
1621 basic_string_char_resize_ch(this, size, '\0');
1624 /* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ */
1625 /* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADXZ */
1626 /* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
1627 /* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
1628 DEFINE_THISCALL_WRAPPER(basic_string_char_begin, 4)
1629 char* __thiscall basic_string_char_begin(basic_string_char *this)
1631 TRACE("(%p)\n", this);
1632 basic_string_char__Freeze(this);
1633 return this->ptr;
1636 /* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ */
1637 /* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADXZ */
1638 /* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
1639 /* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
1640 DEFINE_THISCALL_WRAPPER(basic_string_char_end, 4)
1641 char* __thiscall basic_string_char_end(basic_string_char *this)
1643 TRACE("(%p)\n", this);
1644 basic_string_char__Freeze(this);
1645 return this->ptr+this->size;
1648 /* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AV?$reverse_iterator@PADDAADPADH@2@XZ */
1649 /* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA?AV?$reverse_iterator@PEADDAEADPEAD_J@2@XZ */
1650 /* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$reverse_iterator@PBDDABDPBDH@2@XZ */
1651 /* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$reverse_iterator@PEBDDAEBDPEBD_J@2@XZ */
1652 DEFINE_THISCALL_WRAPPER(basic_string_char_rbegin, 8)
1653 String_reverse_iterator_char* __thiscall basic_string_char_rbegin(
1654 basic_string_char *this, String_reverse_iterator_char *ret)
1656 TRACE("(%p %p)\n", this, ret);
1657 ret->ptr = basic_string_char_end(this);
1658 return ret;
1661 /* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AV?$reverse_iterator@PADDAADPADH@2@XZ */
1662 /* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA?AV?$reverse_iterator@PEADDAEADPEAD_J@2@XZ */
1663 /* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$reverse_iterator@PBDDABDPBDH@2@XZ */
1664 /* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$reverse_iterator@PEBDDAEBDPEBD_J@2@XZ */
1665 DEFINE_THISCALL_WRAPPER(basic_string_char_rend, 8)
1666 String_reverse_iterator_char* __thiscall basic_string_char_rend(
1667 basic_string_char *this, String_reverse_iterator_char *ret)
1669 TRACE("(%p %p)\n", this, ret);
1670 ret->ptr = basic_string_char_begin(this);
1671 return ret;
1674 /* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
1675 /* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
1676 /* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
1677 /* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
1678 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_c_str, 4)
1679 const char* __thiscall MSVCP_basic_string_char_c_str(const basic_string_char *this)
1681 TRACE("%p\n", this);
1682 return this->ptr ? this->ptr : basic_string_char__Nullstr();
1685 /* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
1686 /* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
1687 /* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
1688 /* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
1689 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_length, 4)
1690 MSVCP_size_t __thiscall MSVCP_basic_string_char_length(const basic_string_char *this)
1692 TRACE("%p\n", this);
1693 return this->size;
1696 /* ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
1697 /* ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
1698 DEFINE_THISCALL_WRAPPER(basic_string_char_max_size, 4)
1699 MSVCP_size_t __thiscall basic_string_char_max_size(const basic_string_char *this)
1701 TRACE("%p\n", this);
1702 return MSVCP_allocator_char_max_size(NULL)-1;
1705 /* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
1706 /* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
1707 DEFINE_THISCALL_WRAPPER(basic_string_char_capacity, 4)
1708 MSVCP_size_t __thiscall basic_string_char_capacity(basic_string_char *this)
1710 TRACE("%p\n", this);
1711 return this->res;
1714 /* ?reserve@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z */
1715 /* ?reserve@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K@Z */
1716 DEFINE_THISCALL_WRAPPER(basic_string_char_reserve, 8)
1717 void __thiscall basic_string_char_reserve(basic_string_char *this, MSVCP_size_t size)
1719 MSVCP_size_t len;
1721 TRACE("%p %ld\n", this, size);
1723 len = this->size;
1724 if(len > size)
1725 return;
1727 if(basic_string_char__Grow(this, size, FALSE))
1728 basic_string_char__Eos(this, len);
1731 /* ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE_NXZ */
1732 /* ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_NXZ */
1733 DEFINE_THISCALL_WRAPPER(basic_string_char_empty, 4)
1734 MSVCP_bool __thiscall basic_string_char_empty(basic_string_char *this)
1736 TRACE("%p\n", this);
1737 return this->size == 0;
1740 /* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXAAV12@@Z */
1741 /* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEAV12@@Z */
1742 DEFINE_THISCALL_WRAPPER(basic_string_char_swap, 8)
1743 void __thiscall basic_string_char_swap(basic_string_char *this, basic_string_char *str)
1745 basic_string_char tmp;
1746 TRACE("%p %p\n", this, str);
1748 tmp = *this;
1749 *this = *str;
1750 *str = tmp;
1753 /* ?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV12@II@Z */
1754 /* ?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV12@_K0@Z */
1755 DEFINE_THISCALL_WRAPPER(basic_string_char_substr, 16)
1756 basic_string_char* __thiscall basic_string_char_substr(basic_string_char *this,
1757 basic_string_char *ret, MSVCP_size_t off, MSVCP_size_t len)
1759 TRACE("%p %lu %lu\n", this, off, len);
1761 basic_string_char_ctor_substr_alloc(ret, this, off, len, NULL);
1762 return ret;
1765 /* ?copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPADII@Z */
1766 /* ?copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEAD_K1@Z */
1767 DEFINE_THISCALL_WRAPPER(basic_string_char_copy, 16)
1768 MSVCP_size_t __thiscall basic_string_char_copy(const basic_string_char *this,
1769 char *dest, MSVCP_size_t count, MSVCP_size_t off)
1771 TRACE("%p %p %lu %lu\n", this, dest, count, off);
1773 if(off > this->size)
1774 _Xran();
1775 if(count > this->size-off)
1776 count = this->size-off;
1777 if(this->ptr)
1778 char_traits_char__Copy_s(dest, count, this->ptr+off, count);
1779 return count;
1782 /* ?get_allocator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$allocator@D@2@XZ */
1783 /* ?get_allocator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$allocator@D@2@XZ */
1784 DEFINE_THISCALL_WRAPPER(basic_string_char_get_allocator, 8)
1785 allocator* __thiscall basic_string_char_get_allocator(const basic_string_char *this, allocator *ret)
1787 TRACE("%p\n", this);
1788 return ret;
1791 static wchar_t* char_traits_wchar__Move_s(wchar_t *dest,
1792 MSVCP_size_t size, const wchar_t *src, MSVCP_size_t count)
1794 if(!dest || !src || size<count) {
1795 if(dest && size)
1796 dest[0] = '\0';
1797 _invalid_parameter(NULL, NULL, NULL, 0, 0);
1798 return dest;
1801 return memmove(dest, src, count * sizeof(WCHAR));
1804 static wchar_t* char_traits_wchar__Copy_s(wchar_t *dest,
1805 MSVCP_size_t size, const wchar_t *src, MSVCP_size_t count)
1807 if(!dest || !src || size<count) {
1808 if(dest && size)
1809 dest[0] = '\0';
1810 _invalid_parameter(NULL, NULL, NULL, 0, 0);
1811 return dest;
1814 return memcpy(dest, src, count * sizeof(wchar_t));
1817 static MSVCP_size_t char_traits_wchar_length(const wchar_t *str)
1819 return wcslen((WCHAR*)str);
1822 static wchar_t* char_traits_wchar_assignn(wchar_t *str,
1823 MSVCP_size_t num, wchar_t c)
1825 MSVCP_size_t i;
1827 for(i=0; i<num; i++)
1828 str[i] = c;
1830 return str;
1833 static int char_traits_wchar_compare(const wchar_t *s1,
1834 const wchar_t *s2, MSVCP_size_t count)
1836 int ret = memcmp(s1, s2, count);
1837 return (ret>0 ? 1 : (ret<0 ? -1 : 0));
1840 static const wchar_t* char_traits_wchar_find(const wchar_t *str,
1841 MSVCP_size_t range, const wchar_t *c)
1843 return memchr(str, *c, range);
1846 static MSVCP_bool basic_string_wchar_inside(
1847 basic_string_wchar *this, const wchar_t *ptr)
1849 return ptr>=this->ptr && ptr<this->ptr+this->size;
1852 /* ?npos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@2IB */
1853 /* ?npos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@2_KB */
1854 const MSVCP_size_t basic_string_wchar_npos = -1;
1856 /* ?_C@?1??_Nullstr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPBGXZ@4GB */
1857 /* ?_C@?1??_Nullstr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPEBGXZ@4GB */
1858 const wchar_t basic_string_wchar_nullbyte = '\0';
1860 /* ?_Nullstr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPBGXZ */
1861 /* ?_Nullstr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPEBGXZ */
1862 const wchar_t* __cdecl basic_string_wchar__Nullstr(void)
1864 return &basic_string_wchar_nullbyte;
1867 /* ?_Refcnt@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEAAEPBG@Z */
1868 /* ?_Refcnt@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAAEAEPEBG@Z */
1869 DEFINE_THISCALL_WRAPPER(basic_string_wchar__Refcnt, 8)
1870 unsigned short* __thiscall basic_string_wchar__Refcnt(basic_string_wchar *this, const wchar_t *ptr)
1872 TRACE("(%p %p)\n", this, ptr);
1873 return (unsigned short*)ptr-1;
1876 /* ?_Eos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEXI@Z */
1877 /* ?_Eos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAX_K@Z */
1878 DEFINE_THISCALL_WRAPPER(basic_string_wchar__Eos, 8)
1879 void __thiscall basic_string_wchar__Eos(basic_string_wchar *this, MSVCP_size_t len)
1881 this->size = len;
1882 this->ptr[len] = 0;
1885 /* ?clear@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEXXZ */
1886 /* ?clear@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAXXZ */
1887 /* ?clear@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
1888 /* ?clear@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
1889 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_clear, 4)
1890 void __thiscall MSVCP_basic_string_wchar_clear(basic_string_wchar *this)
1892 if(this->ptr)
1893 basic_string_wchar__Eos(this, 0);
1896 /* ?_Tidy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEX_N@Z */
1897 /* ?_Tidy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAX_N@Z */
1898 DEFINE_THISCALL_WRAPPER(basic_string_wchar__Tidy, 8)
1899 void __thiscall basic_string_wchar__Tidy(basic_string_wchar *this, MSVCP_bool built)
1901 TRACE("(%p %d)\n", this, built);
1903 if(!built || !this->ptr);
1904 else if(!this->ptr[-1] || (unsigned short)this->ptr[-1]==FROZEN)
1905 MSVCP_allocator_wchar_deallocate(NULL, this->ptr-1, this->res+2);
1906 else
1907 this->ptr[-1]--;
1909 memset(this, 0, sizeof(*this));
1912 /* ?_Grow@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAE_NI_N@Z */
1913 /* ?_Grow@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAA_N_K_N@Z */
1914 DEFINE_THISCALL_WRAPPER(basic_string_wchar__Grow, 12)
1915 MSVCP_bool __thiscall basic_string_wchar__Grow(basic_string_wchar *this, MSVCP_size_t new_size, MSVCP_bool trim)
1917 if(!new_size) {
1918 if(trim)
1919 basic_string_wchar__Tidy(this, TRUE);
1920 else if(this->ptr)
1921 basic_string_wchar__Eos(this, 0);
1922 } else if(this->res<new_size || trim ||
1923 (this->ptr && this->ptr[-1] && (unsigned short)this->ptr[-1]!=FROZEN)) {
1924 MSVCP_size_t new_res = new_size, len = this->size;
1925 wchar_t *ptr;
1927 if(!trim && this->ptr && !this->ptr[-1]) {
1928 new_res |= 0xf;
1929 if(new_res/3 < this->res/2)
1930 new_res = this->res + this->res/2;
1933 ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_res+2);
1934 if(!ptr) {
1935 new_res = new_size;
1936 ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_size+2);
1938 if(!ptr) {
1939 ERR("Out of memory\n");
1940 return FALSE;
1943 if(len > new_res)
1944 len = new_res;
1946 *ptr = 0;
1947 if(this->ptr)
1948 char_traits_wchar__Copy_s(ptr+1, new_size, this->ptr, len);
1949 basic_string_wchar__Tidy(this, TRUE);
1950 this->ptr = ptr+1;
1951 this->res = new_res;
1952 basic_string_wchar__Eos(this, len);
1955 return new_size>0;
1958 /* ?_Split@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEXXZ */
1959 /* ?_Split@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAXXZ */
1960 DEFINE_THISCALL_WRAPPER(basic_string_wchar__Split, 4)
1961 void __thiscall basic_string_wchar__Split(basic_string_wchar *this)
1963 MSVCP_size_t len;
1964 wchar_t *ptr;
1966 TRACE("(%p)\n", this);
1968 if(!this->ptr || !this->ptr[-1] || (unsigned short)this->ptr[-1]==FROZEN)
1969 return;
1971 ptr = this->ptr;
1972 len = this->size;
1973 basic_string_wchar__Tidy(this, TRUE);
1974 if(basic_string_wchar__Grow(this, len, FALSE)) {
1975 if(ptr)
1976 char_traits_wchar__Copy_s(this->ptr, this->res, ptr, len);
1977 basic_string_wchar__Eos(this, len);
1981 /* ?_Freeze@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEXXZ */
1982 /* ?_Freeze@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAXXZ */
1983 DEFINE_THISCALL_WRAPPER(basic_string_wchar__Freeze, 4)
1984 void __thiscall basic_string_wchar__Freeze(basic_string_wchar *this)
1986 TRACE("(%p)\n", this);
1987 basic_string_wchar__Split(this);
1988 if(this->ptr)
1989 this->ptr[-1] = FROZEN;
1992 /* ?_Copy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEXI@Z */
1993 /* ?_Copy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AEAAX_K@Z */
1994 DEFINE_THISCALL_WRAPPER(basic_string_wchar__Copy, 8)
1995 void __thiscall basic_string_wchar__Copy(basic_string_wchar *this, MSVCP_size_t copy_len)
1997 TRACE("%p %lu\n", this, copy_len);
1999 if(!basic_string_wchar__Grow(this, copy_len, TRUE))
2000 return;
2003 /* ?_Pdif@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAIPBG0@Z */
2004 /* ?_Pdif@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CA_KPEBG0@Z */
2005 MSVCP_size_t __cdecl basic_string_wchar__Pdif(const wchar_t *i1, const wchar_t *i2)
2007 TRACE("(%p %p)\n", i1, i2);
2008 return !i1 ? 0 : i1-i2;
2011 /* ?_Psum@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPAGPAGI@Z */
2012 /* ?_Psum@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPEAGPEAG_K@Z */
2013 /* ?_Psum@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPBGPBGI@Z */
2014 /* ?_Psum@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@CAPEBGPEBG_K@Z */
2015 wchar_t* __cdecl basic_string_wchar__Psum(wchar_t *iter, MSVCP_size_t add)
2017 TRACE("(%p %lu)\n", iter, add);
2018 return iter ? iter+add : iter;
2021 /* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@II@Z */
2022 /* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K0@Z */
2023 DEFINE_THISCALL_WRAPPER(basic_string_wchar_erase, 12)
2024 basic_string_wchar* __thiscall basic_string_wchar_erase(
2025 basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t len)
2027 TRACE("%p %lu %lu\n", this, pos, len);
2029 if(pos > this->size)
2030 _Xran();
2032 if(len > this->size-pos)
2033 len = this->size-pos;
2035 if(len) {
2036 basic_string_wchar__Split(this);
2037 char_traits_wchar__Move_s(this->ptr+pos, this->res-pos,
2038 this->ptr+pos+len, this->size-pos-len);
2039 basic_string_wchar__Eos(this, this->size-len);
2042 return this;
2045 /* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEPAGPAG0@Z */
2046 /* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAPEAGPEAG0@Z */
2047 DEFINE_THISCALL_WRAPPER(basic_string_wchar_erase_iter, 12)
2048 wchar_t* __thiscall basic_string_wchar_erase_iter(basic_string_wchar *this, wchar_t *beg, wchar_t *end)
2050 MSVCP_size_t pos = basic_string_wchar__Pdif(beg, this->ptr);
2051 basic_string_wchar_erase(this, pos, basic_string_wchar__Pdif(end, beg));
2052 return basic_string_wchar__Psum(this->ptr, pos);
2055 /* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEPAGPAG@Z */
2056 /* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAPEAGPEAG@Z */
2057 DEFINE_THISCALL_WRAPPER(basic_string_wchar_erase_beg, 8)
2058 wchar_t* __thiscall basic_string_wchar_erase_beg(basic_string_wchar *this, wchar_t *beg)
2060 MSVCP_size_t pos = beg-this->ptr;
2061 basic_string_wchar_erase(this, pos, 1);
2062 return this->ptr+pos;
2065 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@ABV12@II@Z */
2066 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
2067 DEFINE_THISCALL_WRAPPER(basic_string_wchar_assign_substr, 16)
2068 basic_string_wchar* __thiscall basic_string_wchar_assign_substr(
2069 basic_string_wchar *this, const basic_string_wchar *assign,
2070 MSVCP_size_t pos, MSVCP_size_t len)
2072 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
2074 if(assign->size < pos)
2075 _Xran();
2077 if(len > assign->size-pos)
2078 len = assign->size-pos;
2080 if(this == assign) {
2081 basic_string_wchar_erase(this, pos+len, basic_string_wchar_npos);
2082 basic_string_wchar_erase(this, 0, pos);
2083 } else if(basic_string_wchar__Grow(this, len, FALSE)) {
2084 if(assign->ptr)
2085 char_traits_wchar__Copy_s(this->ptr, this->res,
2086 assign->ptr+pos, len);
2087 basic_string_wchar__Eos(this, len);
2090 return this;
2093 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBGI@Z */
2094 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG_K@Z */
2095 DEFINE_THISCALL_WRAPPER(basic_string_wchar_assign_cstr_len, 12)
2096 basic_string_wchar* __thiscall basic_string_wchar_assign_cstr_len(
2097 basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len)
2099 TRACE("%p %s %lu\n", this, debugstr_wn(str, len), len);
2101 if(basic_string_wchar_inside(this, str))
2102 return basic_string_wchar_assign_substr(this, this, str-this->ptr, len);
2103 else if(basic_string_wchar__Grow(this, len, FALSE)) {
2104 char_traits_wchar__Copy_s(this->ptr, this->res, str, len);
2105 basic_string_wchar__Eos(this, len);
2108 return this;
2111 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@ABV12@@Z */
2112 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@AEBV12@@Z */
2113 /* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@ABV01@@Z */
2114 /* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@AEBV01@@Z */
2115 DEFINE_THISCALL_WRAPPER(basic_string_wchar_assign, 8)
2116 basic_string_wchar* __thiscall basic_string_wchar_assign(
2117 basic_string_wchar *this, const basic_string_wchar *assign)
2119 return basic_string_wchar_assign_substr(this, assign,
2120 0, basic_string_wchar_npos);
2123 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBG@Z */
2124 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG@Z */
2125 /* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@PBG@Z */
2126 /* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@PEBG@Z */
2127 DEFINE_THISCALL_WRAPPER(basic_string_wchar_assign_cstr, 8)
2128 basic_string_wchar* __thiscall basic_string_wchar_assign_cstr(
2129 basic_string_wchar *this, const wchar_t *str)
2131 return basic_string_wchar_assign_cstr_len(this, str,
2132 char_traits_wchar_length(str));
2135 /* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@G@Z */
2136 /* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@G@Z */
2137 DEFINE_THISCALL_WRAPPER(basic_string_wchar_assign_ch, 8)
2138 basic_string_wchar* __thiscall basic_string_wchar_assign_ch(
2139 basic_string_wchar *this, wchar_t ch)
2141 return basic_string_wchar_assign_cstr_len(this, &ch, 1);
2144 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IG@Z */
2145 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_KG@Z */
2146 DEFINE_THISCALL_WRAPPER(basic_string_wchar_assignn, 12)
2147 basic_string_wchar* __thiscall basic_string_wchar_assignn(
2148 basic_string_wchar *this, MSVCP_size_t count, wchar_t ch)
2150 TRACE("%p %ld %c\n", this, count, ch);
2152 basic_string_wchar__Grow(this, count, FALSE);
2153 char_traits_wchar_assignn(this->ptr, count, ch);
2154 basic_string_wchar__Eos(this, count);
2155 return this;
2158 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBG0@Z */
2159 /* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG0@Z */
2160 DEFINE_THISCALL_WRAPPER(basic_string_wchar_assign_ptr_ptr, 12)
2161 basic_string_wchar* __thiscall basic_string_wchar_assign_ptr_ptr(
2162 basic_string_wchar *this, const wchar_t *first, const wchar_t *last)
2164 return basic_string_wchar_assign_cstr_len(this, first, last-first);
2167 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@PBGIABV?$allocator@G@1@@Z */
2168 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@PEBG_KAEBV?$allocator@G@1@@Z */
2169 DEFINE_THISCALL_WRAPPER(basic_string_wchar_ctor_cstr_len_alloc, 16)
2170 basic_string_wchar* __thiscall basic_string_wchar_ctor_cstr_len_alloc(
2171 basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len, const void *alloc)
2173 TRACE("%p %s %ld\n", this, debugstr_wn(str, len), len);
2175 basic_string_wchar__Tidy(this, FALSE);
2176 basic_string_wchar_assign_cstr_len(this, str, len);
2177 return this;
2180 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_WI@Z */
2181 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W_K@Z */
2182 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@PBGI@Z */
2183 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@PEBG_K@Z */
2184 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_cstr_len, 12)
2185 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr_len(
2186 basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len)
2188 return basic_string_wchar_ctor_cstr_len_alloc(this, str, len, NULL);
2191 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV01@IIABV?$allocator@G@1@@Z */
2192 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@AEBV01@_K1AEBV?$allocator@G@1@@Z */
2193 DEFINE_THISCALL_WRAPPER(basic_string_wchar_ctor_substr_alloc, 20)
2194 basic_string_wchar* __thiscall basic_string_wchar_ctor_substr_alloc(
2195 basic_string_wchar *this, const basic_string_wchar *assign,
2196 MSVCP_size_t pos, MSVCP_size_t len, const void *alloc)
2198 TRACE("%p %p %lu %lu\n", this, assign, pos, len);
2200 basic_string_wchar__Tidy(this, FALSE);
2201 basic_string_wchar_assign_substr(this, assign, pos, len);
2202 return this;
2205 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@PBGABV?$allocator@G@1@@Z */
2206 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@PEBGAEBV?$allocator@G@1@@Z */
2207 DEFINE_THISCALL_WRAPPER(basic_string_wchar_ctor_cstr_alloc, 12)
2208 basic_string_wchar* __thiscall basic_string_wchar_ctor_cstr_alloc(
2209 basic_string_wchar *this, const wchar_t *str, const void *alloc)
2211 TRACE("%p %s\n", this, debugstr_w(str));
2213 basic_string_wchar__Tidy(this, FALSE);
2214 basic_string_wchar_assign_cstr(this, str);
2215 return this;
2218 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_W@Z */
2219 /* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W@Z */
2220 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@PBG@Z */
2221 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@PEBG@Z */
2222 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor_cstr, 8)
2223 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr(
2224 basic_string_wchar *this, const wchar_t *str)
2226 return basic_string_wchar_ctor_cstr_alloc(this, str, NULL);
2229 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@IGABV?$allocator@G@1@@Z */
2230 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@_KGAEBV?$allocator@G@1@@Z */
2231 DEFINE_THISCALL_WRAPPER(basic_string_wchar_ctor_ch_alloc, 16)
2232 basic_string_wchar* __thiscall basic_string_wchar_ctor_ch_alloc(basic_string_wchar *this,
2233 MSVCP_size_t count, wchar_t ch, const void *alloc)
2235 TRACE("%p %ld %c\n", this, count, ch);
2237 basic_string_wchar__Tidy(this, FALSE);
2238 basic_string_wchar_assignn(this, count, ch);
2239 return this;
2242 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@PBG0ABV?$allocator@G@1@@Z */
2243 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@PEBG0AEBV?$allocator@G@1@@Z */
2244 DEFINE_THISCALL_WRAPPER(basic_string_wchar_ctor_iter, 16)
2245 basic_string_wchar* __thiscall basic_string_wchar_ctor_iter(basic_string_wchar *this,
2246 const wchar_t *first, const wchar_t *last, allocator *alloc)
2248 TRACE("(%p %p %p %p)\n", this, first, last, alloc);
2250 basic_string_wchar__Tidy(this, FALSE);
2251 basic_string_wchar_assign_cstr_len(this, first, basic_string_wchar__Pdif(last, first));
2252 return this;
2255 /* ??_F?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXXZ */
2256 /* ??_F?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXXZ */
2257 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_ctor, 4)
2258 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor(basic_string_wchar *this)
2260 TRACE("%p\n", this);
2262 basic_string_wchar__Tidy(this, FALSE);
2263 return this;
2266 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV?$allocator@G@1@@Z */
2267 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@AEBV?$allocator@G@1@@Z */
2268 DEFINE_THISCALL_WRAPPER(basic_string_wchar_ctor_alloc, 8)
2269 basic_string_wchar* __thiscall basic_string_wchar_ctor_alloc(
2270 basic_string_wchar *this, const void *alloc)
2272 TRACE("%p %p\n", this, alloc);
2274 basic_string_wchar__Tidy(this, FALSE);
2275 return this;
2278 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@ABV01@@Z */
2279 /* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@AEBV01@@Z */
2280 DEFINE_THISCALL_WRAPPER(basic_string_wchar_copy_ctor, 8)
2281 basic_string_wchar* __thiscall basic_string_wchar_copy_ctor(
2282 basic_string_wchar *this, const basic_string_wchar *copy)
2284 TRACE("%p %p\n", this, copy);
2286 basic_string_wchar__Tidy(this, FALSE);
2287 basic_string_wchar_assign(this, copy);
2288 return this;
2291 /* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@XZ */
2292 /* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@XZ */
2293 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_dtor, 4)
2294 void __thiscall MSVCP_basic_string_wchar_dtor(basic_string_wchar *this)
2296 TRACE("%p\n", this);
2297 basic_string_wchar__Tidy(this, TRUE);
2300 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEHIIPBGI@Z */
2301 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAH_K0PEBG0@Z */
2302 DEFINE_THISCALL_WRAPPER(basic_string_wchar_compare_substr_cstr_len, 20)
2303 int __thiscall basic_string_wchar_compare_substr_cstr_len(
2304 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
2305 const wchar_t *str, MSVCP_size_t count)
2307 int ans;
2309 TRACE("%p %lu %lu %s %lu\n", this, pos, num, debugstr_wn(str, count), count);
2311 if(this->size < pos)
2312 _Xran();
2314 if(num > this->size-pos)
2315 num = this->size-pos;
2317 ans = char_traits_wchar_compare(this->ptr+pos,
2318 str, num>count ? count : num);
2319 if(ans)
2320 return ans;
2322 if(num > count)
2323 ans = 1;
2324 else if(num < count)
2325 ans = -1;
2326 return ans;
2329 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEHPBG@Z */
2330 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAHPEBG@Z */
2331 DEFINE_THISCALL_WRAPPER(basic_string_wchar_compare_cstr, 8)
2332 int __thiscall basic_string_wchar_compare_cstr(
2333 const basic_string_wchar *this, const wchar_t *str)
2335 return basic_string_wchar_compare_substr_cstr_len(this, 0, this->size,
2336 str, char_traits_wchar_length(str));
2339 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEHIIABV12@II@Z */
2340 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAH_K0AEBV12@00@Z */
2341 DEFINE_THISCALL_WRAPPER(basic_string_wchar_compare_substr_substr, 24)
2342 int __thiscall basic_string_wchar_compare_substr_substr(
2343 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
2344 const basic_string_wchar *compare, MSVCP_size_t off, MSVCP_size_t count)
2346 TRACE("%p %lu %lu %p %lu %lu\n", this, pos, num, compare, off, count);
2348 if(compare->size < off)
2349 _Xran();
2351 if(count > compare->size-off)
2352 count = compare->size-off;
2354 return basic_string_wchar_compare_substr_cstr_len(this, pos, num,
2355 compare->ptr+off, count);
2358 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEHIIABV12@@Z */
2359 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAH_K0AEBV12@@Z */
2360 DEFINE_THISCALL_WRAPPER(basic_string_wchar_compare_substr, 16)
2361 int __thiscall basic_string_wchar_compare_substr(
2362 const basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t num,
2363 const basic_string_wchar *compare)
2365 return basic_string_wchar_compare_substr_cstr_len(this, pos, num,
2366 compare->ptr, compare->size);
2369 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEHABV12@@Z */
2370 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAHAEBV12@@Z */
2371 DEFINE_THISCALL_WRAPPER(basic_string_wchar_compare, 8)
2372 int __thiscall basic_string_wchar_compare(
2373 const basic_string_wchar *this, const basic_string_wchar *compare)
2375 return basic_string_wchar_compare_substr_cstr_len(this, 0, this->size,
2376 compare->ptr, compare->size);
2379 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEHIIPBG@Z */
2380 /* ?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAH_K0PEBG@Z */
2381 DEFINE_THISCALL_WRAPPER(basic_string_wchar_compare_substr_cstr, 16)
2382 int __thiscall basic_string_wchar_compare_substr_cstr(const basic_string_wchar *this,
2383 MSVCP_size_t pos, MSVCP_size_t num, const wchar_t *str)
2385 return basic_string_wchar_compare_substr_cstr_len(this, pos, num,
2386 str, char_traits_wchar_length(str));
2389 /* ??$?8GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2390 /* ??$?8GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2391 /* ??8std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2392 /* ??8std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2393 MSVCP_bool __cdecl basic_string_wchar_equal(
2394 const basic_string_wchar *left, const basic_string_wchar *right)
2396 return basic_string_wchar_compare(left, right) == 0;
2399 /* ??$?8GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2400 /* ??$?8GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2401 /* ??8std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2402 /* ??8std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2403 MSVCP_bool __cdecl basic_string_wchar_equal_str_cstr(
2404 const basic_string_wchar *left, const wchar_t *right)
2406 return basic_string_wchar_compare_cstr(left, right) == 0;
2409 /* ??$?8GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2410 /* ??$?8GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2411 /* ??8std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2412 /* ??8std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2413 MSVCP_bool __cdecl basic_string_wchar_equal_cstr_str(
2414 const wchar_t *left, const basic_string_wchar *right)
2416 return basic_string_wchar_compare_cstr(right, left) == 0;
2419 /* ??$?9GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2420 /* ??$?9GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2421 /* ??9std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2422 /* ??9std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2423 MSVCP_bool __cdecl basic_string_wchar_not_equal(
2424 const basic_string_wchar *left, const basic_string_wchar *right)
2426 return basic_string_wchar_compare(left, right) != 0;
2429 /* ??$?9GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2430 /* ??$?9GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2431 /* ??9std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2432 /* ??9std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2433 MSVCP_bool __cdecl basic_string_wchar_not_equal_str_cstr(
2434 const basic_string_wchar *left, const wchar_t *right)
2436 return basic_string_wchar_compare_cstr(left, right) != 0;
2439 /* ??$?9GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2440 /* ??$?9GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2441 /* ??9std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2442 /* ??9std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2443 MSVCP_bool __cdecl basic_string_wchar_not_equal_cstr_str(
2444 const wchar_t *left, const basic_string_wchar *right)
2446 return basic_string_wchar_compare_cstr(right, left) != 0;
2449 /* ??$?MGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2450 /* ??$?MGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2451 /* ??Mstd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2452 /* ??Mstd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2453 MSVCP_bool __cdecl basic_string_wchar_lower(
2454 const basic_string_wchar *left, const basic_string_wchar *right)
2456 return basic_string_wchar_compare(left, right) < 0;
2459 /* ??$?MGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2460 /* ??$?MGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2461 /* ??Mstd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2462 /* ??Mstd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2463 MSVCP_bool __cdecl basic_string_wchar_lower_bstr_cstr(
2464 const basic_string_wchar *left, const wchar_t *right)
2466 return basic_string_wchar_compare_cstr(left, right) < 0;
2469 /* ??$?MGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2470 /* ??$?MGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2471 /* ??Mstd@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2472 /* ??Mstd@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2473 MSVCP_bool __cdecl basic_string_wchar_lower_cstr_bstr(
2474 const wchar_t *left, const basic_string_wchar *right)
2476 return basic_string_wchar_compare_cstr(right, left) > 0;
2479 /* ??$?NGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2480 /* ??$?NGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2481 /* ??Nstd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2482 /* ??Nstd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2483 MSVCP_bool __cdecl basic_string_wchar_leq(
2484 const basic_string_wchar *left, const basic_string_wchar *right)
2486 return basic_string_wchar_compare(left, right) <= 0;
2489 /* ??$?NGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2490 /* ??$?NGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2491 /* ??Nstd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2492 /* ??Nstd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2493 MSVCP_bool __cdecl basic_string_wchar_leq_bstr_cstr(
2494 const basic_string_wchar *left, const wchar_t *right)
2496 return basic_string_wchar_compare_cstr(left, right) <= 0;
2499 /* ??$?NGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2500 /* ??$?NGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2501 /* ??Nstd@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2502 /* ??Nstd@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2503 MSVCP_bool __cdecl basic_string_wchar_leq_cstr_bstr(
2504 const wchar_t *left, const basic_string_wchar *right)
2506 return basic_string_wchar_compare_cstr(right, left) >= 0;
2509 /* ??$?OGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2510 /* ??$?OGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2511 /* ??Ostd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2512 /* ??Ostd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2513 MSVCP_bool __cdecl basic_string_wchar_greater(
2514 const basic_string_wchar *left, const basic_string_wchar *right)
2516 return basic_string_wchar_compare(left, right) > 0;
2519 /* ??$?OGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2520 /* ??$?OGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2521 /* ??Ostd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2522 /* ??Ostd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2523 MSVCP_bool __cdecl basic_string_wchar_greater_bstr_cstr(
2524 const basic_string_wchar *left, const wchar_t *right)
2526 return basic_string_wchar_compare_cstr(left, right) > 0;
2529 /* ??$?OGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2530 /* ??$?OGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2531 /* ??Ostd@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2532 /* ??Ostd@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2533 MSVCP_bool __cdecl basic_string_wchar_greater_cstr_bstr(
2534 const wchar_t *left, const basic_string_wchar *right)
2536 return basic_string_wchar_compare_cstr(right, left) < 0;
2539 /* ??$?PGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2540 /* ??$?PGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2541 /* ??Pstd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2542 /* ??Pstd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z */
2543 MSVCP_bool __cdecl basic_string_wchar_geq(
2544 const basic_string_wchar *left, const basic_string_wchar *right)
2546 return basic_string_wchar_compare(left, right) >= 0;
2549 /* ??$?PGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2550 /* ??$?PGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2551 /* ??Pstd@@YA_NABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBG@Z */
2552 /* ??Pstd@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBG@Z */
2553 MSVCP_bool __cdecl basic_string_wchar_geq_bstr_cstr(
2554 const basic_string_wchar *left, const wchar_t *right)
2556 return basic_string_wchar_compare_cstr(left, right) >= 0;
2559 /* ??$?PGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2560 /* ??$?PGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2561 /* ??Pstd@@YA_NPBGABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2562 /* ??Pstd@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z */
2563 MSVCP_bool __cdecl basic_string_wchar_geq_cstr_bstr(
2564 const wchar_t *left, const basic_string_wchar *right)
2566 return basic_string_wchar_compare_cstr(right, left) <= 0;
2569 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGII@Z */
2570 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K1@Z */
2571 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_cstr_substr, 16)
2572 MSVCP_size_t __thiscall basic_string_wchar_find_cstr_substr(
2573 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t pos, MSVCP_size_t len)
2575 const wchar_t *p, *end;
2577 TRACE("%p %s %lu %lu\n", this, debugstr_wn(find, len), pos, len);
2579 if(len==0 && pos<=this->size)
2580 return pos;
2581 if(pos>=this->size || len>this->size)
2582 return basic_string_wchar_npos;
2584 end = this->ptr+this->size-len+1;
2585 for(p=this->ptr+pos; p<end; p++) {
2586 p = char_traits_wchar_find(p, end-p, find);
2587 if(!p)
2588 break;
2590 if(!char_traits_wchar_compare(p, find, len))
2591 return p-this->ptr;
2594 return basic_string_wchar_npos;
2597 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIABV12@I@Z */
2598 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KAEBV12@_K@Z */
2599 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_off, 12)
2600 MSVCP_size_t __thiscall basic_string_wchar_find_off(
2601 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2603 return basic_string_wchar_find_cstr_substr(this, find->ptr, off, find->size);
2606 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIGI@Z */
2607 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KG_K@Z */
2608 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_ch, 12)
2609 MSVCP_size_t __thiscall basic_string_wchar_find_ch(
2610 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t pos)
2612 return basic_string_wchar_find_cstr_substr(this, &ch, pos, 1);
2615 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGI@Z */
2616 /* ?find@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K@Z */
2617 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_cstr_off, 12)
2618 MSVCP_size_t __thiscall basic_string_wchar_find_cstr_off(
2619 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t pos)
2621 return basic_string_wchar_find_cstr_substr(this, find, pos,
2622 char_traits_wchar_length(find));
2625 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGII@Z */
2626 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K1@Z */
2627 DEFINE_THISCALL_WRAPPER(basic_string_wchar_rfind_cstr_substr, 16)
2628 MSVCP_size_t __thiscall basic_string_wchar_rfind_cstr_substr(
2629 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t pos, MSVCP_size_t len)
2631 const wchar_t *p, *end;
2633 TRACE("%p %s %lu %lu\n", this, debugstr_wn(find, len), pos, len);
2635 if(len==0)
2636 return pos<this->size ? pos : this->size;
2638 if(len > this->size)
2639 return basic_string_wchar_npos;
2641 if(pos > this->size-len+1)
2642 pos = this->size-len+1;
2643 end = this->ptr;
2644 for(p=end+pos; p>=end; p--) {
2645 if(*p==*find && !char_traits_wchar_compare(p, find, len))
2646 return p-this->ptr;
2649 return basic_string_wchar_npos;
2652 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIABV12@I@Z */
2653 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KAEBV12@_K@Z */
2654 DEFINE_THISCALL_WRAPPER(basic_string_wchar_rfind_off, 12)
2655 MSVCP_size_t __thiscall basic_string_wchar_rfind_off(
2656 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2658 return basic_string_wchar_rfind_cstr_substr(this, find->ptr, off, find->size);
2661 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIGI@Z */
2662 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KG_K@Z */
2663 DEFINE_THISCALL_WRAPPER(basic_string_wchar_rfind_ch, 12)
2664 MSVCP_size_t __thiscall basic_string_wchar_rfind_ch(
2665 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t pos)
2667 return basic_string_wchar_rfind_cstr_substr(this, &ch, pos, 1);
2670 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGI@Z */
2671 /* ?rfind@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K@Z */
2672 DEFINE_THISCALL_WRAPPER(basic_string_wchar_rfind_cstr_off, 12)
2673 MSVCP_size_t __thiscall basic_string_wchar_rfind_cstr_off(
2674 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t pos)
2676 return basic_string_wchar_rfind_cstr_substr(this, find, pos,
2677 char_traits_wchar_length(find));
2680 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGII@Z */
2681 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K1@Z */
2682 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_not_of_cstr_substr, 16)
2683 MSVCP_size_t __thiscall basic_string_wchar_find_first_not_of_cstr_substr(
2684 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off, MSVCP_size_t len)
2686 const wchar_t *p, *end;
2688 TRACE("%p %p %lu %lu\n", this, find, off, len);
2690 if(off<this->size) {
2691 end = this->ptr+this->size;
2692 for(p=this->ptr+off; p<end; p++)
2693 if(!char_traits_wchar_find(find, len, p))
2694 return p-this->ptr;
2697 return basic_string_wchar_npos;
2700 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIABV12@I@Z */
2701 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KAEBV12@_K@Z */
2702 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_not_of, 12)
2703 MSVCP_size_t __thiscall basic_string_wchar_find_first_not_of(
2704 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2706 return basic_string_wchar_find_first_not_of_cstr_substr(this,
2707 find->ptr, off, find->size);
2710 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIGI@Z */
2711 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KG_K@Z */
2712 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_not_of_ch, 12)
2713 MSVCP_size_t __thiscall basic_string_wchar_find_first_not_of_ch(
2714 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t off)
2716 return basic_string_wchar_find_first_not_of_cstr_substr(this, &ch, off, 1);
2719 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGI@Z */
2720 /* ?find_first_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K@Z */
2721 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_not_of_cstr, 12)
2722 MSVCP_size_t __thiscall basic_string_wchar_find_first_not_of_cstr(
2723 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off)
2725 return basic_string_wchar_find_first_not_of_cstr_substr(
2726 this, find, off, char_traits_wchar_length(find));
2729 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGII@Z */
2730 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K1@Z */
2731 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_of_cstr_substr, 16)
2732 MSVCP_size_t __thiscall basic_string_wchar_find_first_of_cstr_substr(
2733 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off, MSVCP_size_t len)
2735 const wchar_t *p, *end;
2737 TRACE("%p %p %lu %lu\n", this, find, off, len);
2739 if(len>0 && off<this->size) {
2740 end = this->ptr+this->size;
2741 for(p=this->ptr+off; p<end; p++)
2742 if(char_traits_wchar_find(find, len, p))
2743 return p-this->ptr;
2746 return basic_string_wchar_npos;
2749 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIABV12@I@Z */
2750 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KAEBV12@_K@Z */
2751 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_of, 12)
2752 MSVCP_size_t __thiscall basic_string_wchar_find_first_of(
2753 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2755 return basic_string_wchar_find_first_of_cstr_substr(this,
2756 find->ptr, off, find->size);
2759 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIGI@Z */
2760 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KG_K@Z */
2761 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_of_ch, 12)
2762 MSVCP_size_t __thiscall basic_string_wchar_find_first_of_ch(
2763 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t off)
2765 return basic_string_wchar_find_first_of_cstr_substr(this, &ch, off, 1);
2768 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGI@Z */
2769 /* ?find_first_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K@Z */
2770 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_first_of_cstr, 12)
2771 MSVCP_size_t __thiscall basic_string_wchar_find_first_of_cstr(
2772 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off)
2774 return basic_string_wchar_find_first_of_cstr_substr(
2775 this, find, off, char_traits_wchar_length(find));
2778 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGII@Z */
2779 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K1@Z */
2780 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_not_of_cstr_substr, 16)
2781 MSVCP_size_t __thiscall basic_string_wchar_find_last_not_of_cstr_substr(
2782 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off, MSVCP_size_t len)
2784 const wchar_t *p, *beg;
2786 TRACE("%p %p %lu %lu\n", this, find, off, len);
2788 if(len>0 && this->size>0) {
2789 if(off >= this->size)
2790 off = this->size-1;
2792 beg = this->ptr;
2793 for(p=beg+off; p>=beg; p--)
2794 if(!char_traits_wchar_find(find, len, p))
2795 return p-beg;
2798 return basic_string_wchar_npos;
2801 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIABV12@I@Z */
2802 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KAEBV12@_K@Z */
2803 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_not_of, 12)
2804 MSVCP_size_t __thiscall basic_string_wchar_find_last_not_of(
2805 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2807 return basic_string_wchar_find_last_not_of_cstr_substr(this,
2808 find->ptr, off, find->size);
2811 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIGI@Z */
2812 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KG_K@Z */
2813 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_not_of_ch, 12)
2814 MSVCP_size_t __thiscall basic_string_wchar_find_last_not_of_ch(
2815 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t off)
2817 return basic_string_wchar_find_last_not_of_cstr_substr(this, &ch, off, 1);
2820 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGI@Z */
2821 /* ?find_last_not_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K@Z */
2822 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_not_of_cstr, 12)
2823 MSVCP_size_t __thiscall basic_string_wchar_find_last_not_of_cstr(
2824 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off)
2826 return basic_string_wchar_find_last_not_of_cstr_substr(
2827 this, find, off, char_traits_wchar_length(find));
2830 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGII@Z */
2831 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K1@Z */
2832 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_of_cstr_substr, 16)
2833 MSVCP_size_t __thiscall basic_string_wchar_find_last_of_cstr_substr(
2834 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off, MSVCP_size_t len)
2836 const wchar_t *p, *beg;
2838 TRACE("%p %p %lu %lu\n", this, find, off, len);
2840 if(len>0 && this->size>0) {
2841 if(off >= this->size)
2842 off = this->size-1;
2844 beg = this->ptr;
2845 for(p=beg+off; p>=beg; p--)
2846 if(char_traits_wchar_find(find, len, p))
2847 return p-beg;
2850 return basic_string_wchar_npos;
2853 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIABV12@I@Z */
2854 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KAEBV12@_K@Z */
2855 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_of, 12)
2856 MSVCP_size_t __thiscall basic_string_wchar_find_last_of(
2857 const basic_string_wchar *this, const basic_string_wchar *find, MSVCP_size_t off)
2859 return basic_string_wchar_find_last_of_cstr_substr(this,
2860 find->ptr, off, find->size);
2863 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIGI@Z */
2864 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KG_K@Z */
2865 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_of_ch, 12)
2866 MSVCP_size_t __thiscall basic_string_wchar_find_last_of_ch(
2867 const basic_string_wchar *this, wchar_t ch, MSVCP_size_t off)
2869 return basic_string_wchar_find_last_of_cstr_substr(this, &ch, off, 1);
2872 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPBGI@Z */
2873 /* ?find_last_of@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEBG_K@Z */
2874 DEFINE_THISCALL_WRAPPER(basic_string_wchar_find_last_of_cstr, 12)
2875 MSVCP_size_t __thiscall basic_string_wchar_find_last_of_cstr(
2876 const basic_string_wchar *this, const wchar_t *find, MSVCP_size_t off)
2878 return basic_string_wchar_find_last_of_cstr_substr(
2879 this, find, off, char_traits_wchar_length(find));
2882 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@ABV12@II@Z */
2883 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
2884 DEFINE_THISCALL_WRAPPER(basic_string_wchar_append_substr, 16)
2885 basic_string_wchar* __thiscall basic_string_wchar_append_substr(basic_string_wchar *this,
2886 const basic_string_wchar *append, MSVCP_size_t offset, MSVCP_size_t count)
2888 TRACE("%p %p %lu %lu\n", this, append, offset, count);
2890 if(append->size < offset)
2891 _Xran();
2893 if(count > append->size-offset)
2894 count = append->size-offset;
2896 if(basic_string_wchar_npos-this->size<=count || this->size+count<this->size)
2897 _Xlen();
2899 if(basic_string_wchar__Grow(this, this->size+count, FALSE)) {
2900 if(append->ptr)
2901 char_traits_wchar__Copy_s(this->ptr+this->size, this->res-this->size,
2902 append->ptr+offset, count);
2903 basic_string_wchar__Eos(this, this->size+count);
2906 return this;
2909 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBGI@Z */
2910 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG_K@Z */
2911 DEFINE_THISCALL_WRAPPER(basic_string_wchar_append_cstr_len, 12)
2912 basic_string_wchar* __thiscall basic_string_wchar_append_cstr_len(
2913 basic_string_wchar *this, const wchar_t *append, MSVCP_size_t count)
2915 TRACE("%p %s %lu\n", this, debugstr_wn(append, count), count);
2917 if(basic_string_wchar_inside(this, append))
2918 return basic_string_wchar_append_substr(this, this, append-this->ptr, count);
2920 if(basic_string_wchar_npos-this->size<=count || this->size+count<this->size)
2921 _Xlen();
2923 if(basic_string_wchar__Grow(this, this->size+count, FALSE)) {
2924 char_traits_wchar__Copy_s(this->ptr+this->size,
2925 this->res-this->size, append, count);
2926 basic_string_wchar__Eos(this, this->size+count);
2929 return this;
2932 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IG@Z */
2933 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_KG@Z */
2934 DEFINE_THISCALL_WRAPPER(basic_string_wchar_append_len_ch, 12)
2935 basic_string_wchar* __thiscall basic_string_wchar_append_len_ch(
2936 basic_string_wchar *this, MSVCP_size_t count, wchar_t ch)
2938 TRACE("%p %lu %c\n", this, count, ch);
2940 if(basic_string_wchar_npos-this->size <= count)
2941 _Xlen();
2943 if(basic_string_wchar__Grow(this, this->size+count, FALSE)) {
2944 char_traits_wchar_assignn(this->ptr+this->size, count, ch);
2945 basic_string_wchar__Eos(this, this->size+count);
2948 return this;
2951 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@ABV12@@Z */
2952 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@AEBV12@@Z */
2953 /* ??Y?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@ABV01@@Z */
2954 /* ??Y?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@AEBV01@@Z */
2955 DEFINE_THISCALL_WRAPPER(basic_string_wchar_append, 8)
2956 basic_string_wchar* __thiscall basic_string_wchar_append(
2957 basic_string_wchar *this, const basic_string_wchar *append)
2959 return basic_string_wchar_append_substr(this, append,
2960 0, basic_string_wchar_npos);
2963 /* ??Y?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@G@Z */
2964 /* ??Y?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@G@Z */
2965 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_append_ch, 8)
2966 basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_ch(
2967 basic_string_wchar *this, wchar_t ch)
2969 return basic_string_wchar_append_len_ch(this, 1, ch);
2972 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBG0@Z */
2973 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG0@Z */
2974 DEFINE_THISCALL_WRAPPER(basic_string_wchar_append_beg_end, 12)
2975 basic_string_wchar* __thiscall basic_string_wchar_append_beg_end(
2976 basic_string_wchar *this, const wchar_t *beg, const wchar_t *end)
2978 return basic_string_wchar_append_cstr_len(this, beg, end-beg);
2981 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBG@Z */
2982 /* ?append@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG@Z */
2983 /* ??Y?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@PBG@Z */
2984 /* ??Y?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@PEBG@Z */
2985 DEFINE_THISCALL_WRAPPER(basic_string_wchar_append_cstr, 8)
2986 basic_string_wchar* __thiscall basic_string_wchar_append_cstr(
2987 basic_string_wchar *this, const wchar_t *append)
2989 return basic_string_wchar_append_cstr_len(this, append,
2990 char_traits_wchar_length(append));
2992 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@ABV10@0@Z */
2993 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@AEBV10@0@Z */
2994 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@ABV10@0@Z */
2995 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@AEBV10@0@Z */
2996 basic_string_wchar* __cdecl basic_string_wchar_concatenate(basic_string_wchar *ret,
2997 const basic_string_wchar *left, const basic_string_wchar *right)
2999 TRACE("%p %p\n", left, right);
3001 basic_string_wchar_copy_ctor(ret, left);
3002 basic_string_wchar_append(ret, right);
3003 return ret;
3006 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@ABV10@G@Z */
3007 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@AEBV10@G@Z */
3008 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@ABV10@G@Z */
3009 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@AEBV10@G@Z */
3010 basic_string_wchar* __cdecl basic_string_wchar_concatenate_bstr_ch(basic_string_wchar *ret,
3011 const basic_string_wchar *left, wchar_t right)
3013 TRACE("%p %c\n", left, right);
3015 basic_string_wchar_copy_ctor(ret, left);
3016 MSVCP_basic_string_wchar_append_ch(ret, right);
3017 return ret;
3020 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@ABV10@PBG@Z */
3021 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@AEBV10@PEBG@Z */
3022 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@ABV10@PBG@Z */
3023 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@AEBV10@PEBG@Z */
3024 basic_string_wchar* __cdecl basic_string_wchar_concatenate_bstr_cstr(basic_string_wchar *ret,
3025 const basic_string_wchar *left, const wchar_t *right)
3027 TRACE("%p %s\n", left, debugstr_w(right));
3029 basic_string_wchar_copy_ctor(ret, left);
3030 basic_string_wchar_append_cstr(ret, right);
3031 return ret;
3034 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@GABV10@@Z */
3035 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@GAEBV10@@Z */
3036 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@GABV10@@Z */
3037 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@GAEBV10@@Z */
3038 basic_string_wchar* __cdecl basic_string_wchar_concatenate_ch_bstr(basic_string_wchar *ret,
3039 wchar_t left, const basic_string_wchar *right)
3041 TRACE("%c %p\n", left, right);
3043 basic_string_wchar_ctor_cstr_len_alloc(ret, &left, 1, NULL);
3044 basic_string_wchar_append(ret, right);
3045 return ret;
3048 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBGABV10@@Z */
3049 /* ??$?HGU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBGAEBV10@@Z */
3050 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PBGABV10@@Z */
3051 /* ??Hstd@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@PEBGAEBV10@@Z */
3052 basic_string_wchar* __cdecl basic_string_wchar_concatenate_cstr_bstr(basic_string_wchar *ret,
3053 const wchar_t *left, const basic_string_wchar *right)
3055 TRACE("%s %p\n", debugstr_w(left), right);
3057 basic_string_wchar_ctor_cstr_alloc(ret, left, NULL);
3058 basic_string_wchar_append(ret, right);
3059 return ret;
3062 /* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAGI@Z */
3063 /* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAG_K@Z */
3064 /* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z */
3065 /* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAAEBG_K@Z */
3066 DEFINE_THISCALL_WRAPPER(basic_string_wchar_operator_at, 8)
3067 wchar_t* __thiscall basic_string_wchar_operator_at(
3068 basic_string_wchar *this, MSVCP_size_t pos)
3070 TRACE("%p %lu\n", this, pos);
3072 assert(this->size >= pos);
3073 return this->ptr+pos;
3076 /* ?at@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAGI@Z */
3077 /* ?at@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAG_K@Z */
3078 /* ?at@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z */
3079 /* ?at@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAAEBG_K@Z */
3080 DEFINE_THISCALL_WRAPPER(basic_string_wchar_at, 8)
3081 wchar_t* __thiscall basic_string_wchar_at(
3082 basic_string_wchar *this, MSVCP_size_t pos)
3084 TRACE("%p %lu\n", this, pos);
3086 if(this->size <= pos)
3087 _Xran();
3089 return this->ptr+pos;
3092 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IIPBGI@Z */
3093 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K0PEBG0@Z */
3094 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_cstr_len, 20)
3095 basic_string_wchar* __thiscall basic_string_wchar_replace_cstr_len(basic_string_wchar *this,
3096 MSVCP_size_t off, MSVCP_size_t len, const wchar_t *str, MSVCP_size_t str_len)
3098 MSVCP_size_t inside_pos = -1;
3099 wchar_t *ptr = this->ptr;
3101 TRACE("%p %ld %ld %p %ld\n", this, off, len, str, str_len);
3103 if(this->size < off)
3104 _Xran();
3106 if(len > this->size-off)
3107 len = this->size-off;
3109 if(basic_string_wchar_npos-str_len <= this->size-len)
3110 _Xlen();
3112 if(basic_string_wchar_inside(this, str))
3113 inside_pos = str-ptr;
3115 if(this->size-len+str_len)
3116 basic_string_wchar__Grow(this, this->size-len+str_len, FALSE);
3117 ptr = this->ptr;
3119 if(inside_pos == -1) {
3120 memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
3121 memcpy(ptr+off, str, str_len*sizeof(char));
3122 } else if(len >= str_len) {
3123 memmove(ptr+off, ptr+inside_pos, str_len*sizeof(char));
3124 memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
3125 } else {
3126 MSVCP_size_t size;
3128 memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
3130 if(inside_pos < off+len) {
3131 size = off+len-inside_pos;
3132 if(size > str_len)
3133 size = str_len;
3134 memmove(ptr+off, ptr+inside_pos, size*sizeof(char));
3135 } else {
3136 size = 0;
3139 if(str_len > size)
3140 memmove(ptr+off+size, ptr+off+str_len, (str_len-size)*sizeof(char));
3143 if(this->ptr)
3144 basic_string_wchar__Eos(this, this->size-len+str_len);
3145 return this;
3148 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IIABV12@II@Z */
3149 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K0AEBV12@00@Z */
3150 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_substr, 24)
3151 basic_string_wchar* __thiscall basic_string_wchar_replace_substr(basic_string_wchar *this, MSVCP_size_t off,
3152 MSVCP_size_t len, const basic_string_wchar *str, MSVCP_size_t str_off, MSVCP_size_t str_len)
3154 if(str->size < str_off)
3155 _Xran();
3157 if(str_len > str->size-str_off)
3158 str_len = str->size-str_off;
3160 return basic_string_wchar_replace_cstr_len(this, off, len,
3161 str->ptr+str_off, str_len);
3164 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IIABV12@@Z */
3165 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K0AEBV12@@Z */
3166 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace, 16)
3167 basic_string_wchar* __thiscall basic_string_wchar_replace(basic_string_wchar *this,
3168 MSVCP_size_t off, MSVCP_size_t len, const basic_string_wchar *str)
3170 return basic_string_wchar_replace_cstr_len(this, off, len,
3171 str->ptr, str->size);
3174 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IIIG@Z */
3175 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K00G@Z */
3176 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_ch, 20)
3177 basic_string_wchar* __thiscall basic_string_wchar_replace_ch(basic_string_wchar *this,
3178 MSVCP_size_t off, MSVCP_size_t len, MSVCP_size_t count, wchar_t ch)
3180 wchar_t *ptr;
3182 TRACE("%p %ld %ld %ld %c\n", this, off, len, count, ch);
3184 if(this->size < off)
3185 _Xran();
3187 if(len > this->size-off)
3188 len = this->size-off;
3190 if(basic_string_wchar_npos-count <= this->size-len)
3191 _Xlen();
3193 if(this->size-len+count)
3194 basic_string_wchar__Grow(this, this->size-len+count, FALSE);
3195 ptr = this->ptr;
3197 memmove(ptr+off+count, ptr+off+len, (this->size-off-len)*sizeof(char));
3198 char_traits_wchar_assignn(ptr+off, count, ch);
3199 basic_string_wchar__Eos(this, this->size-len+count);
3201 return this;
3204 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IIPBG@Z */
3205 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K0PEBG@Z */
3206 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_cstr, 16)
3207 basic_string_wchar* __thiscall basic_string_wchar_replace_cstr(basic_string_wchar *this,
3208 MSVCP_size_t off, MSVCP_size_t len, const wchar_t *str)
3210 return basic_string_wchar_replace_cstr_len(this, off, len, str,
3211 char_traits_wchar_length(str));
3214 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PAG0ABV12@@Z */
3215 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEAG0AEBV12@@Z */
3216 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_iter_bstr, 16)
3217 basic_string_wchar* __thiscall basic_string_wchar_replace_iter_bstr(basic_string_wchar *this,
3218 wchar_t *beg, wchar_t *end, const basic_string_wchar *str)
3220 return basic_string_wchar_replace(this, basic_string_wchar__Pdif(beg, this->ptr),
3221 basic_string_wchar__Pdif(end, beg), str);
3224 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PAG0IG@Z */
3225 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEAG0_KG@Z */
3226 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_iter_chn, 20)
3227 basic_string_wchar* __thiscall basic_string_wchar_replace_iter_chn(basic_string_wchar *this,
3228 wchar_t *beg, wchar_t *end, MSVCP_size_t count, wchar_t ch)
3230 return basic_string_wchar_replace_ch(this, basic_string_wchar__Pdif(beg, this->ptr),
3231 basic_string_wchar__Pdif(end, beg), count, ch);
3234 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PAG0PBG1@Z */
3235 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEAG0PEBG1@Z */
3236 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_iter_iter, 20)
3237 basic_string_wchar* __thiscall basic_string_wchar_replace_iter_iter(basic_string_wchar *this,
3238 wchar_t *beg1, wchar_t *end1, const wchar_t *beg2, const wchar_t *end2)
3240 return basic_string_wchar_replace_cstr_len(this, basic_string_wchar__Pdif(beg1, this->ptr),
3241 basic_string_wchar__Pdif(end1, beg1), beg2, basic_string_wchar__Pdif(end2, beg2));
3244 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PAG0PBG@Z */
3245 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEAG0PEBG@Z */
3246 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_iter_cstr, 16)
3247 basic_string_wchar* __thiscall basic_string_wchar_replace_iter_cstr(basic_string_wchar *this,
3248 wchar_t *beg, wchar_t *end, const wchar_t *str)
3250 return basic_string_wchar_replace_cstr(this, basic_string_wchar__Pdif(beg, this->ptr),
3251 basic_string_wchar__Pdif(end, beg), str);
3254 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PAG0PBGI@Z */
3255 /* ?replace@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEAG0PEBG_K@Z */
3256 DEFINE_THISCALL_WRAPPER(basic_string_wchar_replace_iter_cstr_len, 20)
3257 basic_string_wchar* __thiscall basic_string_wchar_replace_iter_cstr_len(basic_string_wchar *this,
3258 wchar_t *beg, wchar_t *end, const wchar_t *str, MSVCP_size_t len)
3260 return basic_string_wchar_replace_cstr_len(this, basic_string_wchar__Pdif(beg, this->ptr),
3261 basic_string_wchar__Pdif(end, beg), str, len);
3264 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IABV12@@Z */
3265 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_KAEBV12@@Z */
3266 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert, 12)
3267 basic_string_wchar* __thiscall basic_string_wchar_insert(basic_string_wchar *this,
3268 MSVCP_size_t off, const basic_string_wchar *str)
3270 return basic_string_wchar_replace(this, off, 0, str);
3273 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IABV12@II@Z */
3274 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_KAEBV12@00@Z */
3275 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert_substr, 20)
3276 basic_string_wchar* __thiscall basic_string_wchar_insert_substr(
3277 basic_string_wchar *this, MSVCP_size_t off, const basic_string_wchar *str,
3278 MSVCP_size_t str_off, MSVCP_size_t str_count)
3280 return basic_string_wchar_replace_substr(this, off, 0, str, str_off, str_count);
3283 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IPBG@Z */
3284 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_KPEBG@Z */
3285 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert_cstr, 12)
3286 basic_string_wchar* __thiscall basic_string_wchar_insert_cstr(
3287 basic_string_wchar *this, MSVCP_size_t off, const wchar_t *str)
3289 return basic_string_wchar_replace_cstr(this, off, 0, str);
3292 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IPBGI@Z */
3293 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_KPEBG0@Z */
3294 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert_cstr_len, 16)
3295 basic_string_wchar* __thiscall basic_string_wchar_insert_cstr_len(basic_string_wchar *this,
3296 MSVCP_size_t off, const wchar_t *str, MSVCP_size_t str_len)
3298 return basic_string_wchar_replace_cstr_len(this, off, 0, str, str_len);
3301 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@IIG@Z */
3302 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K0G@Z */
3303 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert_chn, 16)
3304 basic_string_wchar* __thiscall basic_string_wchar_insert_chn(basic_string_wchar *this,
3305 MSVCP_size_t off, MSVCP_size_t count, wchar_t ch)
3307 return basic_string_wchar_replace_ch(this, off, 0, count, ch);
3310 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEPAGPAGG@Z */
3311 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAPEAGPEAGG@Z */
3312 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert_iter_ch, 12)
3313 wchar_t* __thiscall basic_string_wchar_insert_iter_ch(basic_string_wchar *this, wchar_t *pos, wchar_t ch)
3315 MSVCP_size_t off = basic_string_wchar__Pdif(pos, this->ptr);
3316 basic_string_wchar_insert_chn(this, off, 1, ch);
3317 return basic_string_wchar__Psum(this->ptr, off);
3320 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXPAGIG@Z */
3321 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXPEAG_KG@Z */
3322 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert_iter_chn, 16)
3323 void __thiscall basic_string_wchar_insert_iter_chn(basic_string_wchar *this,
3324 wchar_t *pos, MSVCP_size_t n, wchar_t ch)
3326 basic_string_wchar_insert_chn(this, basic_string_wchar__Pdif(pos, this->ptr), n, ch);
3329 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXPAGPBG1@Z */
3330 /* ?insert@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXPEAGPEBG1@Z */
3331 DEFINE_THISCALL_WRAPPER(basic_string_wchar_insert_iter, 16)
3332 void __thiscall basic_string_wchar_insert_iter(basic_string_wchar *this,
3333 wchar_t *pos, const wchar_t *beg, const wchar_t *end)
3335 basic_string_wchar_insert_cstr_len(this, basic_string_wchar__Pdif(pos, this->ptr),
3336 beg, basic_string_wchar__Pdif(end, beg));
3339 /* ?resize@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXIG@Z */
3340 /* ?resize@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAX_KG@Z */
3341 DEFINE_THISCALL_WRAPPER(basic_string_wchar_resize_ch, 12)
3342 void __thiscall basic_string_wchar_resize_ch(
3343 basic_string_wchar *this, MSVCP_size_t size, wchar_t ch)
3345 TRACE("%p %lu %c\n", this, size, ch);
3347 if(size <= this->size)
3348 basic_string_wchar_erase(this, size, this->size);
3349 else
3350 basic_string_wchar_append_len_ch(this, size-this->size, ch);
3353 /* ?resize@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXI@Z */
3354 /* ?resize@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAX_K@Z */
3355 DEFINE_THISCALL_WRAPPER(basic_string_wchar_resize, 8)
3356 void __thiscall basic_string_wchar_resize(
3357 basic_string_wchar *this, MSVCP_size_t size)
3359 basic_string_wchar_resize_ch(this, size, '\0');
3362 /* ?begin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEPAGXZ */
3363 /* ?begin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAPEAGXZ */
3364 /* ?begin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPBGXZ */
3365 /* ?begin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEBGXZ */
3366 DEFINE_THISCALL_WRAPPER(basic_string_wchar_begin, 4)
3367 wchar_t* __thiscall basic_string_wchar_begin(basic_string_wchar *this)
3369 TRACE("(%p)\n", this);
3370 basic_string_wchar__Freeze(this);
3371 return this->ptr;
3374 /* ?end@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEPAGXZ */
3375 /* ?end@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAPEAGXZ */
3376 /* ?end@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPBGXZ */
3377 /* ?end@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEBGXZ */
3378 DEFINE_THISCALL_WRAPPER(basic_string_wchar_end, 4)
3379 wchar_t* __thiscall basic_string_wchar_end(basic_string_wchar *this)
3381 TRACE("(%p)\n", this);
3382 basic_string_wchar__Freeze(this);
3383 return this->ptr+this->size;
3386 /* ?rbegin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE?AV?$reverse_iterator@PAGGAAGPAGH@2@XZ */
3387 /* ?rbegin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA?AV?$reverse_iterator@PEAGGAEAGPEAG_J@2@XZ */
3388 /* ?rbegin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$reverse_iterator@PBGGABGPBGH@2@XZ */
3389 /* ?rbegin@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV?$reverse_iterator@PEBGGAEBGPEBG_J@2@XZ */
3390 DEFINE_THISCALL_WRAPPER(basic_string_wchar_rbegin, 8)
3391 String_reverse_iterator_wchar* __thiscall basic_string_wchar_rbegin(
3392 basic_string_wchar *this, String_reverse_iterator_wchar *ret)
3394 TRACE("(%p %p)\n", this, ret);
3395 ret->ptr = basic_string_wchar_end(this);
3396 return ret;
3399 /* ?rend@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE?AV?$reverse_iterator@PAGGAAGPAGH@2@XZ */
3400 /* ?rend@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA?AV?$reverse_iterator@PEAGGAEAGPEAG_J@2@XZ */
3401 /* ?rend@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$reverse_iterator@PBGGABGPBGH@2@XZ */
3402 /* ?rend@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV?$reverse_iterator@PEBGGAEBGPEBG_J@2@XZ */
3403 DEFINE_THISCALL_WRAPPER(basic_string_wchar_rend, 8)
3404 String_reverse_iterator_wchar* __thiscall basic_string_wchar_rend(
3405 basic_string_wchar *this, String_reverse_iterator_wchar *ret)
3407 TRACE("(%p %p)\n", this, ret);
3408 ret->ptr = basic_string_wchar_begin(this);
3409 return ret;
3412 /* ?c_str@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPBGXZ */
3413 /* ?c_str@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEBGXZ */
3414 /* ?data@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPBGXZ */
3415 /* ?data@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEBGXZ */
3416 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_c_str, 4)
3417 const wchar_t* __thiscall MSVCP_basic_string_wchar_c_str(const basic_string_wchar *this)
3419 TRACE("%p\n", this);
3420 return this->ptr ? this->ptr : basic_string_wchar__Nullstr();
3423 /* ?size@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIXZ */
3424 /* ?size@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KXZ */
3425 /* ?length@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIXZ */
3426 /* ?length@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KXZ */
3427 DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_length, 4)
3428 MSVCP_size_t __thiscall MSVCP_basic_string_wchar_length(const basic_string_wchar *this)
3430 TRACE("%p\n", this);
3431 return this->size;
3434 /* ?max_size@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIXZ */
3435 /* ?max_size@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KXZ */
3436 DEFINE_THISCALL_WRAPPER(basic_string_wchar_max_size, 4)
3437 MSVCP_size_t __thiscall basic_string_wchar_max_size(const basic_string_wchar *this)
3439 TRACE("%p\n", this);
3440 return MSVCP_allocator_wchar_max_size(NULL)-1;
3443 /* ?capacity@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIXZ */
3444 /* ?capacity@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KXZ */
3445 DEFINE_THISCALL_WRAPPER(basic_string_wchar_capacity, 4)
3446 MSVCP_size_t __thiscall basic_string_wchar_capacity(basic_string_wchar *this)
3448 TRACE("%p\n", this);
3449 return this->res;
3452 /* ?reserve@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXI@Z */
3453 /* ?reserve@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAX_K@Z */
3454 DEFINE_THISCALL_WRAPPER(basic_string_wchar_reserve, 8)
3455 void __thiscall basic_string_wchar_reserve(basic_string_wchar *this, MSVCP_size_t size)
3457 MSVCP_size_t len;
3459 TRACE("%p %ld\n", this, size);
3461 len = this->size;
3462 if(len > size)
3463 return;
3465 if(basic_string_wchar__Grow(this, size, FALSE))
3466 basic_string_wchar__Eos(this, len);
3469 /* ?empty@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE_NXZ */
3470 /* ?empty@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_NXZ */
3471 DEFINE_THISCALL_WRAPPER(basic_string_wchar_empty, 4)
3472 MSVCP_bool __thiscall basic_string_wchar_empty(basic_string_wchar *this)
3474 TRACE("%p\n", this);
3475 return this->size == 0;
3478 /* ?swap@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEXAAV12@@Z */
3479 /* ?swap@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAXAEAV12@@Z */
3480 DEFINE_THISCALL_WRAPPER(basic_string_wchar_swap, 8)
3481 void __thiscall basic_string_wchar_swap(basic_string_wchar *this, basic_string_wchar *str)
3483 basic_string_wchar tmp;
3484 TRACE("%p %p\n", this, str);
3486 tmp = *this;
3487 *this = *str;
3488 *str = tmp;
3491 /* ?substr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV12@II@Z */
3492 /* ?substr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV12@_K0@Z */
3493 DEFINE_THISCALL_WRAPPER(basic_string_wchar_substr, 16)
3494 basic_string_wchar* __thiscall basic_string_wchar_substr(basic_string_wchar *this,
3495 basic_string_wchar *ret, MSVCP_size_t off, MSVCP_size_t len)
3497 TRACE("%p %lu %lu\n", this, off, len);
3499 basic_string_wchar_ctor_substr_alloc(ret, this, off, len, NULL);
3500 return ret;
3503 /* ?copy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIPAGII@Z */
3504 /* ?copy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KPEAG_K1@Z */
3505 DEFINE_THISCALL_WRAPPER(basic_string_wchar_copy, 16)
3506 MSVCP_size_t __thiscall basic_string_wchar_copy(const basic_string_wchar *this,
3507 wchar_t *dest, MSVCP_size_t count, MSVCP_size_t off)
3509 TRACE("%p %p %lu %lu\n", this, dest, count, off);
3511 if(off > this->size)
3512 _Xran();
3513 if(count > this->size-off)
3514 count = this->size-off;
3515 if(this->ptr)
3516 char_traits_wchar__Copy_s(dest, count, this->ptr+off, count);
3517 return count;
3520 /* ?get_allocator@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBE?AV?$allocator@G@2@XZ */
3521 /* ?get_allocator@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA?AV?$allocator@G@2@XZ */
3522 DEFINE_THISCALL_WRAPPER(basic_string_wchar_get_allocator, 8)
3523 allocator* __thiscall basic_string_wchar_get_allocator(const basic_string_wchar *this, allocator *ret)
3525 TRACE("%p\n", this);
3526 return ret;