2012-08-16 10:35:15 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Piotr Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "msvcp.h"
|
|
|
|
#include "stdio.h"
|
|
|
|
#include "assert.h"
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
|
|
|
|
|
|
|
|
/* _String_iterator<char> and _String_const_iterator<char> class */
|
|
|
|
/* char_traits<char> */
|
|
|
|
/* ?assign@?$char_traits@D@std@@SAXAADABD@Z */
|
|
|
|
/* ?assign@?$char_traits@D@std@@SAXAEADAEBD@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static void MSVCP_char_traits_char_assign(char *ch, const char *assign)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
*ch = *assign;
|
|
|
|
}
|
|
|
|
|
2012-10-11 23:21:49 +02:00
|
|
|
/* ?assign@?$char_traits@D@std@@SAPADPADID@Z */
|
|
|
|
/* ?assign@?$char_traits@D@std@@SAPEADPEAD_KD@Z */
|
|
|
|
static char* MSVCP_char_traits_char_assignn(char *str, MSVCP_size_t num, char c)
|
|
|
|
{
|
|
|
|
return memset(str, c, num);
|
|
|
|
}
|
|
|
|
|
2012-08-16 10:35:15 +02:00
|
|
|
/* ?length@?$char_traits@D@std@@SAIPBD@Z */
|
|
|
|
/* ?length@?$char_traits@D@std@@SA_KPEBD@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static MSVCP_size_t MSVCP_char_traits_char_length(const char *str)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
return strlen(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Copy_s@?$char_traits@D@std@@SAPADPADIPBDI@Z */
|
|
|
|
/* ?_Copy_s@?$char_traits@D@std@@SAPEADPEAD_KPEBD1@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static char* MSVCP_char_traits_char__Copy_s(char *dest,
|
2012-08-16 10:35:15 +02:00
|
|
|
MSVCP_size_t size, const char *src, MSVCP_size_t count)
|
|
|
|
{
|
|
|
|
if(!dest || !src || size<count) {
|
|
|
|
if(dest && size)
|
|
|
|
dest[0] = '\0';
|
|
|
|
_invalid_parameter(NULL, NULL, NULL, 0, 0);
|
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
return memcpy(dest, src, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Move_s@?$char_traits@D@std@@SAPADPADIPBDI@Z */
|
|
|
|
/* ?_Move_s@?$char_traits@D@std@@SAPEADPEAD_KPEBD1@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static char* MSVCP_char_traits_char__Move_s(char *dest,
|
2012-08-16 10:35:15 +02:00
|
|
|
MSVCP_size_t size, const char *src, MSVCP_size_t count)
|
|
|
|
{
|
|
|
|
if(!dest || !src || size<count) {
|
|
|
|
if(dest && size)
|
|
|
|
dest[0] = '\0';
|
|
|
|
_invalid_parameter(NULL, NULL, NULL, 0, 0);
|
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
return memmove(dest, src, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* char_traits<wchar_t> */
|
|
|
|
/* ?assign@?$char_traits@_W@std@@SAXAA_WAB_W@Z */
|
|
|
|
/* ?assign@?$char_traits@_W@std@@SAXAEA_WAEB_W@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static void MSVCP_char_traits_wchar_assign(wchar_t *ch,
|
2012-08-16 10:35:15 +02:00
|
|
|
const wchar_t *assign)
|
|
|
|
{
|
|
|
|
*ch = *assign;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?length@?$char_traits@_W@std@@SAIPB_W@Z */
|
|
|
|
/* ?length@?$char_traits@_W@std@@SA_KPEB_W@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static MSVCP_size_t MSVCP_char_traits_wchar_length(const wchar_t *str)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
return wcslen((WCHAR*)str);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Copy_s@?$char_traits@_W@std@@SAPA_WPA_WIPB_WI@Z */
|
|
|
|
/* ?_Copy_s@?$char_traits@_W@std@@SAPEA_WPEA_W_KPEB_W1@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static wchar_t* MSVCP_char_traits_wchar__Copy_s(wchar_t *dest,
|
2012-08-16 10:35:15 +02:00
|
|
|
MSVCP_size_t size, const wchar_t *src, MSVCP_size_t count)
|
|
|
|
{
|
|
|
|
if(!dest || !src || size<count) {
|
|
|
|
if(dest && size)
|
|
|
|
dest[0] = '\0';
|
|
|
|
_invalid_parameter(NULL, NULL, NULL, 0, 0);
|
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
return memcpy(dest, src, count * sizeof(wchar_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Move_s@?$char_traits@_W@std@@SAPA_WPA_WIPB_WI@Z */
|
|
|
|
/* ?_Move_s@?$char_traits@_W@std@@SAPEA_WPEA_W_KPEB_W1@Z */
|
2012-09-17 10:23:01 +02:00
|
|
|
static wchar_t* MSVCP_char_traits_wchar__Move_s(wchar_t *dest,
|
2012-08-16 10:35:15 +02:00
|
|
|
MSVCP_size_t size, const wchar_t *src, MSVCP_size_t count)
|
|
|
|
{
|
|
|
|
if(!dest || !src || size<count) {
|
|
|
|
if(dest && size)
|
|
|
|
dest[0] = '\0';
|
|
|
|
_invalid_parameter(NULL, NULL, NULL, 0, 0);
|
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
return memmove(dest, src, count * sizeof(WCHAR));
|
|
|
|
}
|
|
|
|
|
2012-10-11 23:21:49 +02:00
|
|
|
/* _String_base */
|
|
|
|
/* ?_Xlen@_String_base@std@@SAXXZ */
|
|
|
|
static void MSVCP__String_base_Xlen(void)
|
|
|
|
{
|
|
|
|
static const char msg[] = "string too long";
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
throw_exception(EXCEPTION_LENGTH_ERROR, msg);
|
|
|
|
}
|
|
|
|
|
2012-08-16 10:35:15 +02:00
|
|
|
/* _String_base */
|
|
|
|
/* ?_Xran@_String_base@std@@SAXXZ */
|
2012-09-17 10:23:01 +02:00
|
|
|
static void MSVCP__String_base_Xran(void)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
static const char msg[] = "invalid string position";
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
throw_exception(EXCEPTION_OUT_OF_RANGE, msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* basic_string<char, char_traits<char>, allocator<char>> */
|
|
|
|
/* ?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2IB */
|
|
|
|
/* ?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2_KB */
|
2012-08-28 00:40:39 +02:00
|
|
|
static const MSVCP_size_t MSVCP_basic_string_char_npos = -1;
|
2012-08-16 10:35:15 +02:00
|
|
|
|
|
|
|
/* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEPADXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAPEADXZ */
|
2012-09-14 12:45:01 +02:00
|
|
|
static char* basic_string_char_ptr(basic_string_char *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
if(this->res == BUF_SIZE_CHAR-1)
|
|
|
|
return this->data.buf;
|
|
|
|
return this->data.ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IBEPBDXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEBAPEBDXZ */
|
2012-09-14 12:45:01 +02:00
|
|
|
static const char* basic_string_char_const_ptr(const basic_string_char *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
if(this->res == BUF_SIZE_CHAR-1)
|
|
|
|
return this->data.buf;
|
|
|
|
return this->data.ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEXI@Z */
|
|
|
|
/* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAX_K@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static void basic_string_char_eos(basic_string_char *this, MSVCP_size_t len)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
static const char nullbyte = '\0';
|
|
|
|
|
|
|
|
this->size = len;
|
|
|
|
MSVCP_char_traits_char_assign(basic_string_char_ptr(this)+len, &nullbyte);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NPBD@Z */
|
|
|
|
/* ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAA_NPEBD@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static MSVCP_bool basic_string_char_inside(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, const char *ptr)
|
|
|
|
{
|
|
|
|
char *cstr = basic_string_char_ptr(this);
|
|
|
|
|
|
|
|
return (ptr<cstr || ptr>=cstr+this->size) ? FALSE : TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEX_NI@Z */
|
|
|
|
/* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAAX_N_K@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static void basic_string_char_tidy(basic_string_char *this,
|
2012-08-16 10:35:15 +02:00
|
|
|
MSVCP_bool built, MSVCP_size_t new_size)
|
|
|
|
{
|
|
|
|
if(built && BUF_SIZE_CHAR<=this->res) {
|
|
|
|
char *ptr = this->data.ptr;
|
|
|
|
|
|
|
|
if(new_size > 0)
|
|
|
|
MSVCP_char_traits_char__Copy_s(this->data.buf, BUF_SIZE_CHAR, ptr, new_size);
|
|
|
|
MSVCP_allocator_char_deallocate(this->allocator, ptr, this->res+1);
|
|
|
|
}
|
|
|
|
|
|
|
|
this->res = BUF_SIZE_CHAR-1;
|
|
|
|
basic_string_char_eos(this, new_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z */
|
|
|
|
/* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IEAA_N_K_N@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static MSVCP_bool basic_string_char_grow(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, MSVCP_size_t new_size, MSVCP_bool trim)
|
|
|
|
{
|
|
|
|
if(this->res < new_size) {
|
|
|
|
MSVCP_size_t new_res = new_size, len = this->size;
|
|
|
|
char *ptr;
|
|
|
|
|
|
|
|
new_res |= 0xf;
|
|
|
|
|
|
|
|
if(new_res/3 < this->res/2)
|
|
|
|
new_res = this->res + this->res/2;
|
|
|
|
|
|
|
|
ptr = MSVCP_allocator_char_allocate(this->allocator, new_res+1);
|
|
|
|
if(!ptr)
|
|
|
|
ptr = MSVCP_allocator_char_allocate(this->allocator, new_size+1);
|
|
|
|
else
|
|
|
|
new_size = new_res;
|
|
|
|
if(!ptr) {
|
|
|
|
ERR("Out of memory\n");
|
|
|
|
basic_string_char_tidy(this, TRUE, 0);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
MSVCP_char_traits_char__Copy_s(ptr, new_size,
|
|
|
|
basic_string_char_ptr(this), this->size);
|
|
|
|
basic_string_char_tidy(this, TRUE, 0);
|
|
|
|
this->data.ptr = ptr;
|
|
|
|
this->res = new_size;
|
|
|
|
basic_string_char_eos(this, len);
|
|
|
|
} else if(trim && new_size < BUF_SIZE_CHAR)
|
|
|
|
basic_string_char_tidy(this, TRUE,
|
|
|
|
new_size<this->size ? new_size : this->size);
|
|
|
|
else if(new_size == 0)
|
|
|
|
basic_string_char_eos(this, 0);
|
|
|
|
|
|
|
|
return (new_size>0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z */
|
|
|
|
/* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static basic_string_char* MSVCP_basic_string_char_erase(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t len)
|
|
|
|
{
|
|
|
|
TRACE("%p %lu %lu\n", this, pos, len);
|
|
|
|
|
|
|
|
if(pos > this->size)
|
|
|
|
MSVCP__String_base_Xran();
|
|
|
|
|
|
|
|
if(len > this->size-pos)
|
|
|
|
len = this->size-pos;
|
|
|
|
|
|
|
|
if(len) {
|
|
|
|
MSVCP_char_traits_char__Move_s(basic_string_char_ptr(this)+pos,
|
|
|
|
this->res-pos, basic_string_char_ptr(this)+pos+len,
|
|
|
|
this->size-pos-len);
|
|
|
|
basic_string_char_eos(this, this->size-len);
|
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
|
|
|
|
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static basic_string_char* MSVCP_basic_string_char_assign_substr(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, const basic_string_char *assign,
|
|
|
|
MSVCP_size_t pos, MSVCP_size_t len)
|
|
|
|
{
|
|
|
|
TRACE("%p %p %lu %lu\n", this, assign, pos, len);
|
|
|
|
|
|
|
|
if(assign->size < pos)
|
|
|
|
MSVCP__String_base_Xran();
|
|
|
|
|
|
|
|
if(len > assign->size-pos)
|
|
|
|
len = assign->size-pos;
|
|
|
|
|
|
|
|
if(this == assign) {
|
|
|
|
MSVCP_basic_string_char_erase(this, pos+len, MSVCP_basic_string_char_npos);
|
|
|
|
MSVCP_basic_string_char_erase(this, 0, pos);
|
|
|
|
} else if(basic_string_char_grow(this, len, FALSE)) {
|
|
|
|
MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this),
|
|
|
|
this->res, basic_string_char_const_ptr(assign)+pos, len);
|
|
|
|
basic_string_char_eos(this, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
|
|
|
|
/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static basic_string_char* MSVCP_basic_string_char_assign(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, const basic_string_char *assign)
|
|
|
|
{
|
|
|
|
return MSVCP_basic_string_char_assign_substr(this, assign,
|
|
|
|
0, MSVCP_basic_string_char_npos);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
|
|
|
|
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static basic_string_char* MSVCP_basic_string_char_assign_cstr_len(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, const char *str, MSVCP_size_t len)
|
|
|
|
{
|
2012-09-12 13:27:42 +02:00
|
|
|
TRACE("%p %s %lu\n", this, debugstr_an(str, len), len);
|
2012-08-16 10:35:15 +02:00
|
|
|
|
|
|
|
if(basic_string_char_inside(this, str))
|
|
|
|
return MSVCP_basic_string_char_assign_substr(this, this,
|
|
|
|
str-basic_string_char_ptr(this), len);
|
|
|
|
else if(basic_string_char_grow(this, len, FALSE)) {
|
|
|
|
MSVCP_char_traits_char__Copy_s(basic_string_char_ptr(this),
|
|
|
|
this->res, str, len);
|
|
|
|
basic_string_char_eos(this, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
|
|
|
|
/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
static basic_string_char* MSVCP_basic_string_char_assign_cstr(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, const char *str)
|
|
|
|
{
|
|
|
|
return MSVCP_basic_string_char_assign_cstr_len(this, str,
|
|
|
|
MSVCP_char_traits_char_length(str));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
|
|
|
|
/* ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
|
|
|
|
/* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
|
|
|
|
/* ?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
|
2012-09-14 12:45:01 +02:00
|
|
|
const char* MSVCP_basic_string_char_c_str(const basic_string_char *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
TRACE("%p\n", this);
|
|
|
|
return basic_string_char_const_ptr(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z */
|
|
|
|
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
basic_string_char* MSVCP_basic_string_char_copy_ctor(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, const basic_string_char *copy)
|
|
|
|
{
|
|
|
|
TRACE("%p %p\n", this, copy);
|
|
|
|
|
|
|
|
basic_string_char_tidy(this, FALSE, 0);
|
|
|
|
MSVCP_basic_string_char_assign(this, copy);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2012-10-11 23:21:49 +02:00
|
|
|
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
|
|
|
|
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
|
|
|
|
basic_string_char* MSVCP_basic_string_char_ctor(basic_string_char *this)
|
|
|
|
{
|
|
|
|
TRACE("%p\n", this);
|
|
|
|
|
|
|
|
basic_string_char_tidy(this, FALSE, 0);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2012-08-16 10:35:15 +02:00
|
|
|
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z */
|
|
|
|
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD@Z */
|
2012-09-14 12:45:01 +02:00
|
|
|
basic_string_char* MSVCP_basic_string_char_ctor_cstr(
|
2012-08-16 10:35:15 +02:00
|
|
|
basic_string_char *this, const char *str)
|
|
|
|
{
|
|
|
|
TRACE("%p %s\n", this, debugstr_a(str));
|
|
|
|
|
|
|
|
basic_string_char_tidy(this, FALSE, 0);
|
|
|
|
MSVCP_basic_string_char_assign_cstr(this, str);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
|
|
|
|
/* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
|
2012-09-14 12:45:01 +02:00
|
|
|
void MSVCP_basic_string_char_dtor(basic_string_char *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
TRACE("%p\n", this);
|
|
|
|
basic_string_char_tidy(this, TRUE, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
|
|
|
|
/* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
|
|
|
|
/* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
|
|
|
|
/* ?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
|
2012-09-14 12:45:01 +02:00
|
|
|
MSVCP_size_t MSVCP_basic_string_char_length(const basic_string_char *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
TRACE("%p\n", this);
|
|
|
|
return this->size;
|
|
|
|
}
|
|
|
|
|
2012-10-11 23:21:49 +02:00
|
|
|
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z */
|
|
|
|
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KD@Z */
|
|
|
|
basic_string_char* MSVCP_basic_string_char_append_len_ch(basic_string_char *this, MSVCP_size_t count, char ch)
|
|
|
|
{
|
|
|
|
TRACE("%p %lu %c\n", this, count, ch);
|
|
|
|
|
|
|
|
if(MSVCP_basic_string_char_npos-this->size <= count)
|
|
|
|
MSVCP__String_base_Xlen();
|
|
|
|
|
|
|
|
if(basic_string_char_grow(this, this->size+count, FALSE)) {
|
|
|
|
MSVCP_char_traits_char_assignn(basic_string_char_ptr(this)+this->size, count, ch);
|
|
|
|
basic_string_char_eos(this, this->size+count);
|
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z */
|
|
|
|
/* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z */
|
|
|
|
/* ?push_back@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXD@Z */
|
|
|
|
/* ?push_back@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXD@Z */
|
|
|
|
basic_string_char* MSVCP_basic_string_char_append_ch(basic_string_char *this, char ch)
|
|
|
|
{
|
|
|
|
return MSVCP_basic_string_char_append_len_ch(this, 1, ch);
|
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t>> */
|
|
|
|
/* basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short>> */
|
|
|
|
/* ?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2IB */
|
|
|
|
/* ?npos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@2_KB */
|
|
|
|
/* ?npos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@2IB */
|
|
|
|
/* ?npos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@2_KB */
|
|
|
|
const MSVCP_size_t MSVCP_basic_string_wchar_npos = -1;
|
|
|
|
|
|
|
|
/* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEPA_WXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAPEA_WXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEPAGXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAPEAGXZ */
|
|
|
|
static wchar_t* basic_string_wchar_ptr(basic_string_wchar *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
if(this->res == BUF_SIZE_WCHAR-1)
|
|
|
|
return this->data.buf;
|
|
|
|
return this->data.ptr;
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IBEPB_WXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEBAPEB_WXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IBEPBGXZ */
|
|
|
|
/* ?_Myptr@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEBAPEBGXZ */
|
|
|
|
static const wchar_t* basic_string_wchar_const_ptr(const basic_string_wchar *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
if(this->res == BUF_SIZE_WCHAR-1)
|
|
|
|
return this->data.buf;
|
|
|
|
return this->data.ptr;
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?_Eos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXI@Z */
|
|
|
|
/* ?_Eos@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAX_K@Z */
|
|
|
|
/* ?_Eos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEXI@Z */
|
|
|
|
/* ?_Eos@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAX_K@Z */
|
|
|
|
static void basic_string_wchar_eos(basic_string_wchar *this, MSVCP_size_t len)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
static const wchar_t nullbyte_w = '\0';
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
this->size = len;
|
|
|
|
MSVCP_char_traits_wchar_assign(basic_string_wchar_ptr(this)+len, &nullbyte_w);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?_Inside@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAE_NPB_W@Z */
|
|
|
|
/* ?_Inside@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAA_NPEB_W@Z */
|
|
|
|
/* ?_Inside@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAE_NPBG@Z */
|
|
|
|
/* ?_Inside@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAA_NPEBG@Z */
|
|
|
|
static MSVCP_bool basic_string_wchar_inside(
|
|
|
|
basic_string_wchar *this, const wchar_t *ptr)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
wchar_t *cstr = basic_string_wchar_ptr(this);
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
return (ptr<cstr || ptr>=cstr+this->size) ? FALSE : TRUE;
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?_Tidy@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEX_NI@Z */
|
|
|
|
/* ?_Tidy@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAAX_N_K@Z */
|
|
|
|
/* ?_Tidy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAEX_NI@Z */
|
|
|
|
/* ?_Tidy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAAX_N_K@Z */
|
|
|
|
static void basic_string_wchar_tidy(basic_string_wchar *this,
|
|
|
|
MSVCP_bool built, MSVCP_size_t new_size)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
if(built && BUF_SIZE_WCHAR<=this->res) {
|
|
|
|
wchar_t *ptr = this->data.ptr;
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(new_size > 0)
|
|
|
|
MSVCP_char_traits_wchar__Copy_s(this->data.buf, BUF_SIZE_WCHAR, ptr, new_size);
|
|
|
|
MSVCP_allocator_wchar_deallocate(this->allocator, ptr, this->res+1);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
this->res = BUF_SIZE_WCHAR-1;
|
|
|
|
basic_string_wchar_eos(this, new_size);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?_Grow@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAE_NI_N@Z */
|
|
|
|
/* ?_Grow@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IEAA_N_K_N@Z */
|
|
|
|
/* ?_Grow@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IAE_NI_N@Z */
|
|
|
|
/* ?_Grow@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@IEAA_N_K_N@Z */
|
|
|
|
static MSVCP_bool basic_string_wchar_grow(
|
|
|
|
basic_string_wchar *this, MSVCP_size_t new_size, MSVCP_bool trim)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
if(this->res < new_size) {
|
|
|
|
MSVCP_size_t new_res = new_size, len = this->size;
|
|
|
|
wchar_t *ptr;
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
new_res |= 0xf;
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(new_res/3 < this->res/2)
|
|
|
|
new_res = this->res + this->res/2;
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_res+1);
|
|
|
|
if(!ptr)
|
|
|
|
ptr = MSVCP_allocator_wchar_allocate(this->allocator, new_size+1);
|
|
|
|
else
|
|
|
|
new_size = new_res;
|
|
|
|
if(!ptr) {
|
|
|
|
ERR("Out of memory\n");
|
|
|
|
basic_string_wchar_tidy(this, TRUE, 0);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
MSVCP_char_traits_wchar__Copy_s(ptr, new_size,
|
|
|
|
basic_string_wchar_ptr(this), this->size);
|
|
|
|
basic_string_wchar_tidy(this, TRUE, 0);
|
|
|
|
this->data.ptr = ptr;
|
|
|
|
this->res = new_size;
|
|
|
|
basic_string_wchar_eos(this, len);
|
|
|
|
} else if(trim && new_size < BUF_SIZE_WCHAR)
|
|
|
|
basic_string_wchar_tidy(this, TRUE,
|
|
|
|
new_size<this->size ? new_size : this->size);
|
|
|
|
else if(new_size == 0)
|
|
|
|
basic_string_wchar_eos(this, 0);
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
return (new_size>0);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@II@Z */
|
|
|
|
/* ?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@_K0@Z */
|
|
|
|
/* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@II@Z */
|
|
|
|
/* ?erase@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@_K0@Z */
|
|
|
|
static basic_string_wchar* MSVCP_basic_string_wchar_erase(
|
|
|
|
basic_string_wchar *this, MSVCP_size_t pos, MSVCP_size_t len)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
TRACE("%p %lu %lu\n", this, pos, len);
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(pos > this->size)
|
|
|
|
MSVCP__String_base_Xran();
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(len > this->size-pos)
|
|
|
|
len = this->size-pos;
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(len) {
|
|
|
|
MSVCP_char_traits_wchar__Move_s(basic_string_wchar_ptr(this)+pos,
|
|
|
|
this->res-pos, basic_string_wchar_ptr(this)+pos+len,
|
|
|
|
this->size-pos-len);
|
|
|
|
basic_string_wchar_eos(this, this->size-len);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@ABV12@II@Z */
|
|
|
|
/* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
|
|
|
|
/* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@ABV12@II@Z */
|
|
|
|
/* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
|
|
|
|
static basic_string_wchar* MSVCP_basic_string_wchar_assign_substr(
|
|
|
|
basic_string_wchar *this, const basic_string_wchar *assign,
|
|
|
|
MSVCP_size_t pos, MSVCP_size_t len)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
TRACE("%p %p %lu %lu\n", this, assign, pos, len);
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(assign->size < pos)
|
2012-08-16 10:35:15 +02:00
|
|
|
MSVCP__String_base_Xran();
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(len > assign->size-pos)
|
|
|
|
len = assign->size-pos;
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(this == assign) {
|
|
|
|
MSVCP_basic_string_wchar_erase(this, pos+len, MSVCP_basic_string_wchar_npos);
|
|
|
|
MSVCP_basic_string_wchar_erase(this, 0, pos);
|
|
|
|
} else if(basic_string_wchar_grow(this, len, FALSE)) {
|
|
|
|
MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this),
|
|
|
|
this->res, basic_string_wchar_const_ptr(assign)+pos, len);
|
|
|
|
basic_string_wchar_eos(this, len);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_WI@Z */
|
|
|
|
/* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W_K@Z */
|
|
|
|
/* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBGI@Z */
|
|
|
|
/* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG_K@Z */
|
|
|
|
static basic_string_wchar* MSVCP_basic_string_wchar_assign_cstr_len(
|
|
|
|
basic_string_wchar *this, const wchar_t *str, MSVCP_size_t len)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
TRACE("%p %s %lu\n", this, debugstr_wn(str, len), len);
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
if(basic_string_wchar_inside(this, str))
|
|
|
|
return MSVCP_basic_string_wchar_assign_substr(this, this,
|
|
|
|
str-basic_string_wchar_ptr(this), len);
|
|
|
|
else if(basic_string_wchar_grow(this, len, FALSE)) {
|
|
|
|
MSVCP_char_traits_wchar__Copy_s(basic_string_wchar_ptr(this),
|
|
|
|
this->res, str, len);
|
|
|
|
basic_string_wchar_eos(this, len);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@PB_W@Z */
|
|
|
|
/* ?assign@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@PEB_W@Z */
|
|
|
|
/* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV01@PB_W@Z */
|
|
|
|
/* ??4?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV01@PEB_W@Z */
|
|
|
|
/* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV12@PBG@Z */
|
|
|
|
/* ?assign@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV12@PEBG@Z */
|
|
|
|
/* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAV01@PBG@Z */
|
|
|
|
/* ??4?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAV01@PEBG@Z */
|
|
|
|
static basic_string_wchar* MSVCP_basic_string_wchar_assign_cstr(
|
|
|
|
basic_string_wchar *this, const wchar_t *str)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
return MSVCP_basic_string_wchar_assign_cstr_len(this, str,
|
|
|
|
MSVCP_char_traits_wchar_length(str));
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ */
|
|
|
|
/* ?c_str@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ */
|
|
|
|
/* ?data@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEPB_WXZ */
|
|
|
|
/* ?data@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBAPEB_WXZ */
|
|
|
|
/* ?c_str@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPBGXZ */
|
|
|
|
/* ?c_str@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEBGXZ */
|
|
|
|
/* ?data@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEPBGXZ */
|
|
|
|
/* ?data@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAPEBGXZ */
|
|
|
|
const wchar_t* MSVCP_basic_string_wchar_c_str(const basic_string_wchar *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
TRACE("%p\n", this);
|
2012-09-14 12:45:01 +02:00
|
|
|
return basic_string_wchar_const_ptr(this);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@PB_W@Z */
|
|
|
|
/* ??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@PEB_W@Z */
|
|
|
|
/* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@PBG@Z */
|
|
|
|
/* ??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@PEBG@Z */
|
|
|
|
basic_string_wchar* MSVCP_basic_string_wchar_ctor_cstr(
|
|
|
|
basic_string_wchar *this, const wchar_t *str)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
TRACE("%p %s\n", this, debugstr_w(str));
|
2012-08-16 10:35:15 +02:00
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
basic_string_wchar_tidy(this, FALSE, 0);
|
|
|
|
MSVCP_basic_string_wchar_assign_cstr(this, str);
|
|
|
|
return this;
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@XZ */
|
|
|
|
/* ??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@XZ */
|
|
|
|
/* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@XZ */
|
|
|
|
/* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@XZ */
|
|
|
|
void MSVCP_basic_string_wchar_dtor(basic_string_wchar *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
|
|
|
TRACE("%p\n", this);
|
2012-09-14 12:45:01 +02:00
|
|
|
basic_string_wchar_tidy(this, TRUE, 0);
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
2012-09-14 12:45:01 +02:00
|
|
|
/* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
|
|
|
|
/* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
|
|
|
|
/* ?length@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
|
|
|
|
/* ?length@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA_KXZ */
|
|
|
|
/* ?size@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIXZ */
|
|
|
|
/* ?size@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KXZ */
|
|
|
|
/* ?length@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEIXZ */
|
|
|
|
/* ?length@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBA_KXZ */
|
|
|
|
MSVCP_size_t MSVCP_basic_string_wchar_length(const basic_string_wchar *this)
|
2012-08-16 10:35:15 +02:00
|
|
|
{
|
2012-09-14 12:45:01 +02:00
|
|
|
TRACE("%p\n", this);
|
|
|
|
return this->size;
|
2012-08-16 10:35:15 +02:00
|
|
|
}
|