Commit 500f279e authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp60: Added basic_string<char> support.

string.c file is based on msvcp90/string.c, there are many differences between these files. Other files were copied from msvcp90.
parent 40199873
MODULE = msvcp60.dll
IMPORTS = msvcrt
MODCFLAGS = @BUILTINFLAG@
EXTRAINCL = -I$(top_srcdir)/include/msvcrt
C_SRCS = msvcp60.c
C_SRCS = \
exception.c \
main.c \
memory.c \
misc.c \
string.c
@MAKE_DLL_RULES@
/*
* 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 "windef.h"
#include "winbase.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
/* dlls/msvcrt/cppexcept.h */
typedef void (*cxx_copy_ctor)(void);
/* complete information about a C++ type */
typedef struct __cxx_type_info
{
UINT flags; /* flags (see CLASS_* flags below) */
const type_info *type_info; /* C++ type info */
this_ptr_offsets offsets; /* offsets for computing the this pointer */
unsigned int size; /* object size */
cxx_copy_ctor copy_ctor; /* copy constructor */
} cxx_type_info;
#define CLASS_IS_SIMPLE_TYPE 1
#define CLASS_HAS_VIRTUAL_BASE_CLASS 4
/* table of C++ types that apply for a given object */
typedef struct __cxx_type_info_table
{
UINT count; /* number of types */
const cxx_type_info *info[3]; /* variable length, we declare it large enough for static RTTI */
} cxx_type_info_table;
/* type information for an exception object */
typedef struct __cxx_exception_type
{
UINT flags; /* TYPE_FLAG flags */
void (*destructor)(void);/* exception object destructor */
void* /*cxx_exc_custom_handler*/ custom_handler; /* custom handler for this exception */
const cxx_type_info_table *type_info_table; /* list of types for this exception object */
} cxx_exception_type;
void WINAPI _CxxThrowException(exception*,const cxx_exception_type*);
/* vtables */
extern const vtable_ptr MSVCP_bad_alloc_vtable;
extern const vtable_ptr MSVCP_logic_error_vtable;
extern const vtable_ptr MSVCP_length_error_vtable;
extern const vtable_ptr MSVCP_out_of_range_vtable;
extern const vtable_ptr MSVCP_invalid_argument_vtable;
extern const vtable_ptr MSVCP_runtime_error_vtable;
/* exception class data */
static type_info exception_type_info = {
NULL, /* set by set_exception_vtable */
NULL,
".?AVexception@std@@"
};
DEFINE_THISCALL_WRAPPER(MSVCP_exception_ctor, 8)
exception* __thiscall MSVCP_exception_ctor(exception *this, const char **name)
{
TRACE("(%p %s)\n", this, *name);
this->vtable = exception_type_info.vtable;
if(*name) {
unsigned int name_len = strlen(*name) + 1;
this->name = malloc(name_len);
memcpy(this->name, *name, name_len);
this->do_free = TRUE;
} else {
this->name = NULL;
this->do_free = FALSE;
}
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_exception_copy_ctor,8)
exception* __thiscall MSVCP_exception_copy_ctor(exception *this, const exception *rhs)
{
TRACE("(%p,%p)\n", this, rhs);
if(!rhs->do_free) {
this->vtable = exception_type_info.vtable;
this->name = rhs->name;
this->do_free = FALSE;
} else
MSVCP_exception_ctor(this, (const char**)&rhs->name);
TRACE("name = %s\n", this->name);
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_exception_dtor,4)
void __thiscall MSVCP_exception_dtor(exception *this)
{
TRACE("(%p)\n", this);
this->vtable = exception_type_info.vtable;
if(this->do_free)
free(this->name);
}
static const rtti_base_descriptor exception_rtti_base_descriptor = {
&exception_type_info,
0,
{ 0, -1, 0 },
0
};
static const cxx_type_info exception_cxx_type_info = {
0,
&exception_type_info,
{ 0, -1, 0 },
sizeof(exception),
(cxx_copy_ctor)THISCALL(MSVCP_exception_dtor)
};
static const cxx_type_info_table exception_cxx_type_table = {
1,
{
&exception_cxx_type_info,
NULL,
NULL
}
};
static const cxx_exception_type exception_cxx_type = {
0,
(cxx_copy_ctor)THISCALL(MSVCP_exception_copy_ctor),
NULL,
&exception_cxx_type_table
};
void set_exception_vtable(void)
{
HMODULE hmod = GetModuleHandleA("msvcrt.dll");
exception_type_info.vtable = (void*)GetProcAddress(hmod, "??_7exception@@6B@");
}
/* bad_alloc class data */
typedef exception bad_alloc;
DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_ctor, 8)
bad_alloc* __thiscall MSVCP_bad_alloc_ctor(bad_alloc *this, const char **name)
{
TRACE("%p %s\n", this, *name);
MSVCP_exception_ctor(this, name);
this->vtable = &MSVCP_bad_alloc_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_copy_ctor, 8)
bad_alloc* __thiscall MSVCP_bad_alloc_copy_ctor(bad_alloc *this, const bad_alloc *rhs)
{
TRACE("%p %p\n", this, rhs);
MSVCP_exception_copy_ctor(this, rhs);
this->vtable = &MSVCP_bad_alloc_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_dtor, 4)
void __thiscall MSVCP_bad_alloc_dtor(bad_alloc *this)
{
TRACE("%p\n", this);
MSVCP_exception_dtor(this);
}
DEFINE_THISCALL_WRAPPER(MSVCP_bad_alloc_vector_dtor, 8)
void * __thiscall MSVCP_bad_alloc_vector_dtor(bad_alloc *this, unsigned int flags)
{
TRACE("%p %x\n", this, flags);
if(flags & 2) {
/* we have an array, with the number of elements stored before the first object */
int i, *ptr = (int *)this-1;
for(i=*ptr-1; i>=0; i--)
MSVCP_bad_alloc_dtor(this+i);
MSVCRT_operator_delete(ptr);
} else {
MSVCP_bad_alloc_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
}
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_what_exception,4)
const char* __thiscall MSVCP_what_exception(exception * this)
{
TRACE("(%p) returning %s\n", this, this->name);
return this->name ? this->name : "Unknown exception";
}
DEFINE_RTTI_DATA(bad_alloc, 0, 1, &exception_rtti_base_descriptor, NULL, NULL, ".?AVbad_alloc@std@@");
static const cxx_type_info bad_alloc_cxx_type_info = {
0,
&bad_alloc_type_info,
{ 0, -1, 0 },
sizeof(bad_alloc),
(cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_copy_ctor)
};
static const cxx_type_info_table bad_alloc_cxx_type_table = {
2,
{
&bad_alloc_cxx_type_info,
&exception_cxx_type_info,
NULL
}
};
static const cxx_exception_type bad_alloc_cxx_type = {
0,
(cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_dtor),
NULL,
&bad_alloc_cxx_type_table
};
/* logic_error class data */
typedef struct _logic_error {
exception e;
basic_string_char str;
} logic_error;
DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_ctor, 8)
logic_error* __thiscall MSVCP_logic_error_ctor(
logic_error *this, const char **name)
{
TRACE("%p %s\n", this, *name);
this->e.vtable = &MSVCP_logic_error_vtable;
this->e.name = NULL;
this->e.do_free = FALSE;
MSVCP_basic_string_char_ctor_cstr(&this->str, *name);
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_copy_ctor, 8)
logic_error* __thiscall MSVCP_logic_error_copy_ctor(
logic_error *this, logic_error *rhs)
{
TRACE("%p %p\n", this, rhs);
MSVCP_exception_copy_ctor(&this->e, &rhs->e);
MSVCP_basic_string_char_copy_ctor(&this->str, &rhs->str);
this->e.vtable = &MSVCP_logic_error_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_dtor, 4)
void __thiscall MSVCP_logic_error_dtor(logic_error *this)
{
TRACE("%p\n", this);
MSVCP_exception_dtor(&this->e);
MSVCP_basic_string_char_dtor(&this->str);
}
DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_vector_dtor, 8)
void* __thiscall MSVCP_logic_error_vector_dtor(
logic_error *this, unsigned int flags)
{
TRACE("%p %x\n", this, flags);
if(flags & 2) {
/* we have an array, with the number of elements stored before the first object */
int i, *ptr = (int *)this-1;
for(i=*ptr-1; i>=0; i--)
MSVCP_logic_error_dtor(this+i);
MSVCRT_operator_delete(ptr);
} else {
MSVCP_logic_error_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
}
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_logic_error_what, 4)
const char* __thiscall MSVCP_logic_error_what(logic_error *this)
{
TRACE("%p\n", this);
return MSVCP_basic_string_char_c_str(&this->str);
}
DEFINE_RTTI_DATA(logic_error, 0, 1, &exception_rtti_base_descriptor, NULL, NULL, ".?AVlogic_error@std@@");
static const cxx_type_info logic_error_cxx_type_info = {
0,
&logic_error_type_info,
{ 0, -1, 0 },
sizeof(logic_error),
(cxx_copy_ctor)THISCALL(MSVCP_logic_error_copy_ctor)
};
static const cxx_type_info_table logic_error_cxx_type_table = {
2,
{
&logic_error_cxx_type_info,
&exception_cxx_type_info,
NULL
}
};
static const cxx_exception_type logic_error_cxx_type = {
0,
(cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
NULL,
&logic_error_cxx_type_table
};
/* length_error class data */
typedef logic_error length_error;
DEFINE_THISCALL_WRAPPER(MSVCP_length_error_ctor, 8)
length_error* __thiscall MSVCP_length_error_ctor(
length_error *this, const char **name)
{
TRACE("%p %s\n", this, *name);
MSVCP_logic_error_ctor(this, name);
this->e.vtable = &MSVCP_length_error_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_length_error_copy_ctor, 8)
length_error* __thiscall MSVCP_length_error_copy_ctor(
length_error *this, length_error *rhs)
{
TRACE("%p %p\n", this, rhs);
MSVCP_logic_error_copy_ctor(this, rhs);
this->e.vtable = &MSVCP_length_error_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_length_error_vector_dtor, 8)
void* __thiscall MSVCP_length_error_vector_dtor(
length_error *this, unsigned int flags)
{
TRACE("%p %x\n", this, flags);
return MSVCP_logic_error_vector_dtor(this, flags);
}
DEFINE_RTTI_DATA(length_error, 0, 2, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, NULL, ".?AVlength_error@std@@");
static const cxx_type_info length_error_cxx_type_info = {
0,
&length_error_type_info,
{ 0, -1, 0 },
sizeof(length_error),
(cxx_copy_ctor)THISCALL(MSVCP_length_error_copy_ctor)
};
static const cxx_type_info_table length_error_cxx_type_table = {
3,
{
&length_error_cxx_type_info,
&logic_error_cxx_type_info,
&exception_cxx_type_info
}
};
static const cxx_exception_type length_error_cxx_type = {
0,
(cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
NULL,
&length_error_cxx_type_table
};
/* out_of_range class data */
typedef logic_error out_of_range;
DEFINE_THISCALL_WRAPPER(MSVCP_out_of_range_ctor, 8)
out_of_range* __thiscall MSVCP_out_of_range_ctor(
out_of_range *this, const char **name)
{
TRACE("%p %s\n", this, *name);
MSVCP_logic_error_ctor(this, name);
this->e.vtable = &MSVCP_out_of_range_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_out_of_range_copy_ctor, 8)
out_of_range* __thiscall MSVCP_out_of_range_copy_ctor(
out_of_range *this, out_of_range *rhs)
{
TRACE("%p %p\n", this, rhs);
MSVCP_logic_error_copy_ctor(this, rhs);
this->e.vtable = &MSVCP_out_of_range_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_out_of_range_vector_dtor, 8)
void* __thiscall MSVCP_out_of_range_vector_dtor(
out_of_range *this, unsigned int flags)
{
TRACE("%p %x\n", this, flags);
return MSVCP_logic_error_vector_dtor(this, flags);
}
DEFINE_RTTI_DATA(out_of_range, 0, 2, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, NULL, ".?AVout_of_range@std@@");
static const cxx_type_info out_of_range_cxx_type_info = {
0,
&out_of_range_type_info,
{ 0, -1, 0 },
sizeof(out_of_range),
(cxx_copy_ctor)THISCALL(MSVCP_out_of_range_copy_ctor)
};
static const cxx_type_info_table out_of_range_cxx_type_table = {
3,
{
&out_of_range_cxx_type_info,
&logic_error_cxx_type_info,
&exception_cxx_type_info
}
};
static const cxx_exception_type out_of_range_cxx_type = {
0,
(cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
NULL,
&out_of_range_cxx_type_table
};
/* invalid_argument class data */
typedef logic_error invalid_argument;
DEFINE_THISCALL_WRAPPER(MSVCP_invalid_argument_ctor, 8)
invalid_argument* __thiscall MSVCP_invalid_argument_ctor(
invalid_argument *this, const char **name)
{
TRACE("%p %s\n", this, *name);
MSVCP_logic_error_ctor(this, name);
this->e.vtable = &MSVCP_invalid_argument_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_invalid_argument_copy_ctor, 8)
invalid_argument* __thiscall MSVCP_invalid_argument_copy_ctor(
invalid_argument *this, invalid_argument *rhs)
{
TRACE("%p %p\n", this, rhs);
MSVCP_logic_error_copy_ctor(this, rhs);
this->e.vtable = &MSVCP_invalid_argument_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_invalid_argument_vector_dtor, 8)
void* __thiscall MSVCP_invalid_argument_vector_dtor(
invalid_argument *this, unsigned int flags)
{
TRACE("%p %x\n", this, flags);
return MSVCP_logic_error_vector_dtor(this, flags);
}
DEFINE_RTTI_DATA(invalid_argument, 0, 2, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, NULL, ".?AVinvalid_argument@std@@");
static const cxx_type_info invalid_argument_cxx_type_info = {
0,
&invalid_argument_type_info,
{ 0, -1, 0 },
sizeof(invalid_argument),
(cxx_copy_ctor)THISCALL(MSVCP_invalid_argument_copy_ctor)
};
static const cxx_type_info_table invalid_argument_cxx_type_table = {
3,
{
&invalid_argument_cxx_type_info,
&logic_error_cxx_type_info,
&exception_cxx_type_info
}
};
static const cxx_exception_type invalid_argument_cxx_type = {
0,
(cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
NULL,
&invalid_argument_cxx_type_table
};
/* runtime_error class data */
typedef struct {
exception e;
basic_string_char str;
} runtime_error;
DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_ctor, 8)
runtime_error* __thiscall MSVCP_runtime_error_ctor(
runtime_error *this, const char **name)
{
TRACE("%p %s\n", this, *name);
this->e.vtable = &MSVCP_runtime_error_vtable;
this->e.name = NULL;
this->e.do_free = FALSE;
MSVCP_basic_string_char_ctor_cstr(&this->str, *name);
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_copy_ctor, 8)
runtime_error* __thiscall MSVCP_runtime_error_copy_ctor(
runtime_error *this, runtime_error *rhs)
{
TRACE("%p %p\n", this, rhs);
MSVCP_exception_copy_ctor(&this->e, &rhs->e);
MSVCP_basic_string_char_copy_ctor(&this->str, &rhs->str);
this->e.vtable = &MSVCP_runtime_error_vtable;
return this;
}
DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_dtor, 4)
void __thiscall MSVCP_runtime_error_dtor(runtime_error *this)
{
TRACE("%p\n", this);
MSVCP_exception_dtor(&this->e);
MSVCP_basic_string_char_dtor(&this->str);
}
DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_vector_dtor, 8)
void* __thiscall MSVCP_runtime_error_vector_dtor(
runtime_error *this, unsigned int flags)
{
TRACE("%p %x\n", this, flags);
if(flags & 2) {
/* we have an array, with the number of elements stored before the first object */
int i, *ptr = (int *)this-1;
for(i=*ptr-1; i>=0; i--)
MSVCP_runtime_error_dtor(this+i);
MSVCRT_operator_delete(ptr);
} else {
MSVCP_runtime_error_dtor(this);
if(flags & 1)
MSVCRT_operator_delete(this);
}
return this;
}
DEFINE_RTTI_DATA(runtime_error, 0, 1, &exception_rtti_base_descriptor, NULL, NULL, ".?AVruntime_error@std@@");
static const cxx_type_info runtime_error_cxx_type_info = {
0,
&runtime_error_type_info,
{ 0, -1, 0 },
sizeof(runtime_error),
(cxx_copy_ctor)THISCALL(MSVCP_runtime_error_copy_ctor)
};
static const cxx_type_info_table runtime_error_cxx_type_table = {
2,
{
&runtime_error_cxx_type_info,
&exception_cxx_type_info,
NULL
}
};
static const cxx_exception_type runtime_error_cxx_type = {
0,
(cxx_copy_ctor)THISCALL(MSVCP_runtime_error_dtor),
NULL,
&runtime_error_cxx_type_table
};
DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_what, 4)
const char* __thiscall MSVCP_runtime_error_what(runtime_error *this)
{
TRACE("%p\n", this);
return MSVCP_basic_string_char_c_str(&this->str);
}
#ifndef __GNUC__
void __asm_dummy_vtables(void) {
#endif
__ASM_VTABLE(bad_alloc, VTABLE_ADD_FUNC(MSVCP_what_exception));
__ASM_VTABLE(logic_error, VTABLE_ADD_FUNC(MSVCP_logic_error_what));
__ASM_VTABLE(length_error, VTABLE_ADD_FUNC(MSVCP_logic_error_what));
__ASM_VTABLE(out_of_range, VTABLE_ADD_FUNC(MSVCP_logic_error_what));
__ASM_VTABLE(invalid_argument, VTABLE_ADD_FUNC(MSVCP_logic_error_what));
__ASM_VTABLE(runtime_error, VTABLE_ADD_FUNC(MSVCP_runtime_error_what));
#ifndef __GNUC__
}
#endif
/* Internal: throws selected exception */
void throw_exception(exception_type et, const char *str)
{
const char *addr = str;
switch(et) {
case EXCEPTION: {
exception e;
MSVCP_exception_ctor(&e, &addr);
_CxxThrowException(&e, &exception_cxx_type);
}
case EXCEPTION_BAD_ALLOC: {
bad_alloc e;
MSVCP_bad_alloc_ctor(&e, &addr);
_CxxThrowException(&e, &bad_alloc_cxx_type);
}
case EXCEPTION_LOGIC_ERROR: {
logic_error e;
MSVCP_logic_error_ctor(&e, &addr);
_CxxThrowException((exception*)&e, &logic_error_cxx_type);
}
case EXCEPTION_LENGTH_ERROR: {
length_error e;
MSVCP_length_error_ctor(&e, &addr);
_CxxThrowException((exception*)&e, &length_error_cxx_type);
}
case EXCEPTION_OUT_OF_RANGE: {
out_of_range e;
MSVCP_out_of_range_ctor(&e, &addr);
_CxxThrowException((exception*)&e, &out_of_range_cxx_type);
}
case EXCEPTION_INVALID_ARGUMENT: {
invalid_argument e;
MSVCP_invalid_argument_ctor(&e, &addr);
_CxxThrowException((exception*)&e, &invalid_argument_cxx_type);
}
case EXCEPTION_RUNTIME_ERROR: {
runtime_error e;
MSVCP_runtime_error_ctor(&e, &addr);
_CxxThrowException((exception*)&e, &runtime_error_cxx_type);
}
}
}
/*
* 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 "windef.h"
#include "winbase.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
#ifdef __i386__
#define DEFINE_VTBL_WRAPPER(off) \
__ASM_GLOBAL_FUNC(vtbl_wrapper_ ## off, \
"popl %eax\n\t" \
"popl %ecx\n\t" \
"pushl %eax\n\t" \
"movl 0(%ecx), %eax\n\t" \
"jmp *" #off "(%eax)\n\t")
DEFINE_VTBL_WRAPPER(0);
DEFINE_VTBL_WRAPPER(4);
DEFINE_VTBL_WRAPPER(8);
DEFINE_VTBL_WRAPPER(12);
DEFINE_VTBL_WRAPPER(16);
DEFINE_VTBL_WRAPPER(20);
DEFINE_VTBL_WRAPPER(24);
DEFINE_VTBL_WRAPPER(28);
DEFINE_VTBL_WRAPPER(32);
DEFINE_VTBL_WRAPPER(36);
DEFINE_VTBL_WRAPPER(40);
DEFINE_VTBL_WRAPPER(44);
DEFINE_VTBL_WRAPPER(48);
DEFINE_VTBL_WRAPPER(52);
DEFINE_VTBL_WRAPPER(56);
DEFINE_VTBL_WRAPPER(60);
#endif
void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t);
void (__cdecl *MSVCRT_operator_delete)(void*);
void* (__cdecl *MSVCRT_set_new_handler)(void*);
static void init_cxx_funcs(void)
{
HMODULE hmod = GetModuleHandleA("msvcrt.dll");
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
{
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z");
}
else
{
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z");
}
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
switch (fdwReason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
init_cxx_funcs();
set_exception_vtable();
init_lockit();
break;
case DLL_PROCESS_DETACH:
free_lockit();
break;
}
return TRUE;
}
/* ?_BADOFF@std@@3JB -> long const std::_BADOFF */
/* ?_BADOFF@std@@3_JB -> __int64 const std::_BADOFF */
const INT_PTR std_BADOFF = -1;
/* ?_BADOFF_func@std@@YAABJXZ -> long const & __cdecl std::_BADOFF_func(void) */
/* ?_BADOFF_func@std@@YAAEB_JXZ -> __int64 const & __ptr64 __cdecl std::_BADOFF_func(void) */
const INT_PTR * __cdecl std_BADOFF_func(void)
{
return &std_BADOFF;
}
/* ?_Fpz@std@@3_JA __int64 std::_Fpz */
__int64 std_Fpz = 0;
/* ?_Fpz_func@std@@YAAA_JXZ -> __int64 & __cdecl std::_Fpz_func(void) */
/* ?_Fpz_func@std@@YAAEA_JXZ -> __int64 & __ptr64 __cdecl std::_Fpz_func(void) */
__int64 * __cdecl std_Fpz_func(void)
{
return &std_Fpz;
}
/*
* 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 <limits.h>
#include "msvcp.h"
#include "windef.h"
#include "winbase.h"
/* ?address@?$allocator@D@std@@QBEPADAAD@Z */
/* ?address@?$allocator@D@std@@QEBAPEADAEAD@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_address, 8)
char* __thiscall MSVCP_allocator_char_address(void *this, char *ptr)
{
return ptr;
}
/* ?address@?$allocator@D@std@@QBEPBDABD@Z */
/* ?address@?$allocator@D@std@@QEBAPEBDAEBD@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_const_address, 8)
const char* __thiscall MSVCP_allocator_char_const_address(void *this, const char *ptr)
{
return ptr;
}
/* ??0?$allocator@D@std@@QAE@XZ */
/* ??0?$allocator@D@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_ctor, 4)
void* __thiscall MSVCP_allocator_char_ctor(void *this)
{
return this;
}
/* ??0?$allocator@D@std@@QAE@ABV01@@Z */
/* ??0?$allocator@D@std@@QEAA@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_copy_ctor, 8)
void* __thiscall MSVCP_allocator_char_copy_ctor(void *this, const void *copy)
{
return this;
}
/* ??4?$allocator@D@std@@QAEAAV01@ABV01@@Z */
/* ??4?$allocator@D@std@@QEAAAEAV01@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_assign, 8)
void* __thiscall MSVCP_allocator_char_assign(void *this, const void *assign)
{
return this;
}
/* ?deallocate@?$allocator@D@std@@QAEXPADI@Z */
/* ?deallocate@?$allocator@D@std@@QEAAXPEAD_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_deallocate, 12)
void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, MSVCP_size_t size)
{
MSVCRT_operator_delete(ptr);
}
/* ?allocate@?$allocator@D@std@@QAEPADI@Z */
/* ?allocate@?$allocator@D@std@@QEAAPEAD_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate, 8)
char* __thiscall MSVCP_allocator_char_allocate(void *this, MSVCP_size_t count)
{
return MSVCRT_operator_new(sizeof(char[count]));
}
/* ?allocate@?$allocator@D@std@@QAEPADIPBX@Z */
/* ?allocate@?$allocator@D@std@@QEAAPEAD_KPEBX@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate_hint, 12)
char* __thiscall MSVCP_allocator_char_allocate_hint(void *this,
MSVCP_size_t count, const void *hint)
{
/* Native ignores hint */
return MSVCP_allocator_char_allocate(this, count);
}
/* ?construct@?$allocator@D@std@@QAEXPADABD@Z */
/* ?construct@?$allocator@D@std@@QEAAXPEADAEBD@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_construct, 12)
void __thiscall MSVCP_allocator_char_construct(void *this, char *ptr, const char *val)
{
*ptr = *val;
}
/* ?destroy@?$allocator@D@std@@QAEXPAD@Z */
/* ?destroy@?$allocator@D@std@@QEAAXPEAD@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_destroy, 8)
void __thiscall MSVCP_allocator_char_destroy(void *this, char *ptr)
{
}
/* ?max_size@?$allocator@D@std@@QBEIXZ */
/* ?max_size@?$allocator@D@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_max_size, 4)
MSVCP_size_t __thiscall MSVCP_allocator_char_max_size(void *this)
{
return UINT_MAX/sizeof(char);
}
/* allocator<wchar_t> */
/* ?address@?$allocator@_W@std@@QBEPA_WAA_W@Z */
/* ?address@?$allocator@_W@std@@QEBAPEA_WAEA_W@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_address, 8)
wchar_t* __thiscall MSVCP_allocator_wchar_address(void *this, wchar_t *ptr)
{
return ptr;
}
/* ?address@?$allocator@_W@std@@QBEPB_WAB_W@Z */
/* ?address@?$allocator@_W@std@@QEBAPEB_WAEB_W@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_const_address, 8)
const wchar_t* __thiscall MSVCP_allocator_wchar_const_address(void *this, const wchar_t *ptr)
{
return ptr;
}
/* ??0?$allocator@_W@std@@QAE@XZ */
/* ??0?$allocator@_W@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_ctor, 4)
void* __thiscall MSVCP_allocator_wchar_ctor(void *this)
{
return this;
}
/* ??0?$allocator@_W@std@@QAE@ABV01@@Z */
/* ??0?$allocator@_W@std@@QEAA@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_copy_ctor, 8)
void* __thiscall MSVCP_allocator_wchar_copy_ctor(void *this, void *copy)
{
return this;
}
/* ??4?$allocator@_W@std@@QAEAAV01@ABV01@@Z */
/* ??4?$allocator@_W@std@@QEAAAEAV01@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_assign, 8)
void* __thiscall MSVCP_allocator_wchar_assign(void *this, void *assign)
{
return this;
}
/* ?deallocate@?$allocator@_W@std@@QAEXPA_WI@Z */
/* ?deallocate@?$allocator@_W@std@@QEAAXPEA_W_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_deallocate, 12)
void __thiscall MSVCP_allocator_wchar_deallocate(void *this,
wchar_t *ptr, MSVCP_size_t size)
{
MSVCRT_operator_delete(ptr);
}
/* ?allocate@?$allocator@_W@std@@QAEPA_WI@Z */
/* ?allocate@?$allocator@_W@std@@QEAAPEA_W_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_allocate, 8)
wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, MSVCP_size_t count)
{
if(UINT_MAX/count < sizeof(wchar_t)) {
throw_exception(EXCEPTION_BAD_ALLOC, NULL);
return NULL;
}
return MSVCRT_operator_new(sizeof(wchar_t[count]));
}
/* ?allocate@?$allocator@_W@std@@QAEPA_WIPBX@Z */
/* ?allocate@?$allocator@_W@std@@QEAAPEA_W_KPEBX@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_allocate_hint, 12)
wchar_t* __thiscall MSVCP_allocator_wchar_allocate_hint(void *this,
MSVCP_size_t count, const void *hint)
{
return MSVCP_allocator_wchar_allocate(this, count);
}
/* ?construct@?$allocator@_W@std@@QAEXPA_WAB_W@Z */
/* ?construct@?$allocator@_W@std@@QEAAXPEA_WAEB_W@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_construct, 12)
void __thiscall MSVCP_allocator_wchar_construct(void *this,
wchar_t *ptr, const wchar_t *val)
{
*ptr = *val;
}
/* ?destroy@?$allocator@_W@std@@QAEXPA_W@Z */
/* ?destroy@?$allocator@_W@std@@QEAAXPEA_W@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_destroy, 8)
void __thiscall MSVCP_allocator_wchar_destroy(void *this, char *ptr)
{
}
/* ?max_size@?$allocator@_W@std@@QBEIXZ */
/* ?max_size@?$allocator@_W@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_max_size, 4)
MSVCP_size_t __thiscall MSVCP_allocator_wchar_max_size(void *this)
{
return UINT_MAX/sizeof(wchar_t);
}
/* allocator<unsigned short> */
/* ?address@?$allocator@G@std@@QBEPAGAAG@Z */
/* ?address@?$allocator@G@std@@QEBAPEAGAEAG@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_address, 8)
unsigned short* __thiscall MSVCP_allocator_short_address(
void *this, unsigned short *ptr)
{
return ptr;
}
/* ?address@?$allocator@G@std@@QBEPBGABG@Z */
/* ?address@?$allocator@G@std@@QEBAPEBGAEBG@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_const_address, 8)
const unsigned short* __thiscall MSVCP_allocator_short_const_address(
void *this, const unsigned short *ptr)
{
return ptr;
}
/* ??0?$allocator@G@std@@QAE@XZ */
/* ??0?$allocator@G@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_ctor, 4)
void* __thiscall MSVCP_allocator_short_ctor(void *this)
{
return this;
}
/* ??0?$allocator@G@std@@QAE@ABV01@@Z */
/* ??0?$allocator@G@std@@QEAA@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_copy_ctor, 8)
void* __thiscall MSVCP_allocator_short_copy_ctor(void *this, void *copy)
{
return this;
}
/* ??4?$allocator@G@std@@QAEAAV01@ABV01@@Z */
/* ??4?$allocator@G@std@@QEAAAEAV01@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_assign, 8)
void* __thiscall MSVCP_allocator_short_assign(void *this, void *assign)
{
return this;
}
/* ?deallocate@?$allocator@G@std@@QAEXPAGI@Z */
/* ?deallocate@?$allocator@G@std@@QEAAXPEAG_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_deallocate, 12)
void __thiscall MSVCP_allocator_short_deallocate(void *this,
unsigned short *ptr, MSVCP_size_t size)
{
MSVCRT_operator_delete(ptr);
}
/* ?allocate@?$allocator@G@std@@QAEPAGI@Z */
/* ?allocate@?$allocator@G@std@@QEAAPEAG_K@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_allocate, 8)
unsigned short* __thiscall MSVCP_allocator_short_allocate(
void *this, MSVCP_size_t count)
{
if(UINT_MAX/count < sizeof(unsigned short)) {
throw_exception(EXCEPTION_BAD_ALLOC, NULL);
return NULL;
}
return MSVCRT_operator_new(sizeof(unsigned short[count]));
}
/* ?allocate@?$allocator@G@std@@QAEPAGIPBX@Z */
/* ?allocate@?$allocator@G@std@@QEAAPEAG_KPEBX@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_allocate_hint, 12)
unsigned short* __thiscall MSVCP_allocator_short_allocate_hint(
void *this, MSVCP_size_t count, const void *hint)
{
return MSVCP_allocator_short_allocate(this, count);
}
/* ?construct@?$allocator@G@std@@QAEXPAGABG@Z */
/* ?construct@?$allocator@G@std@@QEAAXPEAGAEBG@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_construct, 12)
void __thiscall MSVCP_allocator_short_construct(void *this,
unsigned short *ptr, unsigned short *val)
{
*ptr = *val;
}
/* ?destroy@?$allocator@G@std@@QAEXPAG@Z */
/* ?destroy@?$allocator@G@std@@QEAAXPEAG@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_destroy, 8)
void __thiscall MSVCP_allocator_short_destroy(void *this, MSVCP_size_t *ptr)
{
}
/* ?max_size@?$allocator@G@std@@QBEIXZ */
/* ?max_size@?$allocator@G@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_max_size, 4)
MSVCP_size_t __thiscall MSVCP_allocator_short_max_size(void *this)
{
return UINT_MAX/sizeof(unsigned short);
}
/* allocator<void> */
/* ??0?$allocator@X@std@@QAE@XZ */
/* ??0?$allocator@X@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_void_ctor, 4)
void* __thiscall MSVCP_allocator_void_ctor(void *this)
{
return this;
}
/* ??0?$allocator@X@std@@QAE@ABV01@@Z */
/* ??0?$allocator@X@std@@QEAA@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_void_copy_ctor, 8)
void* __thiscall MSVCP_allocator_void_copy_ctor(void *this, void *copy)
{
return this;
}
/* ??4?$allocator@X@std@@QAEAAV01@ABV01@@Z */
/* ??4?$allocator@X@std@@QEAAAEAV01@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_void_assign, 8)
void* __thiscall MSVCP_allocator_void_assign(void *this, void *assign)
{
return this;
}
/*
* 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 <limits.h>
#include "msvcp.h"
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
/* ??0_Mutex@std@@QAE@XZ */
/* ??0_Mutex@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(mutex_ctor, 4)
mutex* __thiscall mutex_ctor(mutex *this)
{
this->mutex = CreateMutexW(NULL, FALSE, NULL);
return this;
}
/* ??1_Mutex@std@@QAE@XZ */
/* ??1_Mutex@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(mutex_dtor, 4)
void __thiscall mutex_dtor(mutex *this)
{
CloseHandle(this->mutex);
}
/* ?_Lock@_Mutex@std@@QAEXXZ */
/* ?_Lock@_Mutex@std@@QEAAXXZ */
DEFINE_THISCALL_WRAPPER(mutex_lock, 4)
void __thiscall mutex_lock(mutex *this)
{
WaitForSingleObject(this->mutex, INFINITE);
}
/* ?_Unlock@_Mutex@std@@QAEXXZ */
/* ?_Unlock@_Mutex@std@@QEAAXXZ */
DEFINE_THISCALL_WRAPPER(mutex_unlock, 4)
void __thiscall mutex_unlock(mutex *this)
{
ReleaseMutex(this->mutex);
}
/* ?_Mutex_Lock@_Mutex@std@@CAXPAV12@@Z */
/* ?_Mutex_Lock@_Mutex@std@@CAXPEAV12@@Z */
void CDECL mutex_mutex_lock(mutex *m)
{
mutex_lock(m);
}
/* ?_Mutex_Unlock@_Mutex@std@@CAXPAV12@@Z */
/* ?_Mutex_Unlock@_Mutex@std@@CAXPEAV12@@Z */
void CDECL mutex_mutex_unlock(mutex *m)
{
mutex_unlock(m);
}
/* ?_Mutex_ctor@_Mutex@std@@CAXPAV12@@Z */
/* ?_Mutex_ctor@_Mutex@std@@CAXPEAV12@@Z */
void CDECL mutex_mutex_ctor(mutex *m)
{
mutex_ctor(m);
}
/* ?_Mutex_dtor@_Mutex@std@@CAXPAV12@@Z */
/* ?_Mutex_dtor@_Mutex@std@@CAXPEAV12@@Z */
void CDECL mutex_mutex_dtor(mutex *m)
{
mutex_dtor(m);
}
static CRITICAL_SECTION lockit_cs[_MAX_LOCK];
/* ?_Lockit_ctor@_Lockit@std@@SAXH@Z */
void __cdecl _Lockit_init(int locktype) {
InitializeCriticalSection(&lockit_cs[locktype]);
lockit_cs[locktype].DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": _Lockit critical section");
}
/* ?_Lockit_dtor@_Lockit@std@@SAXH@Z */
void __cdecl _Lockit_free(int locktype)
{
lockit_cs[locktype].DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&lockit_cs[locktype]);
}
void init_lockit(void) {
int i;
for(i=0; i<_MAX_LOCK; i++)
_Lockit_init(i);
}
void free_lockit(void) {
int i;
for(i=0; i<_MAX_LOCK; i++)
_Lockit_free(i);
}
/* ?_Lockit_ctor@_Lockit@std@@CAXPAV12@H@Z */
/* ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@H@Z */
void __cdecl _Lockit__Lockit_ctor_locktype(_Lockit *lockit, int locktype)
{
lockit->locktype = locktype;
EnterCriticalSection(&lockit_cs[locktype]);
}
/* ?_Lockit_ctor@_Lockit@std@@CAXPAV12@@Z */
/* ?_Lockit_ctor@_Lockit@std@@CAXPEAV12@@Z */
void __cdecl _Lockit__Lockit_ctor(_Lockit *lockit)
{
_Lockit__Lockit_ctor_locktype(lockit, 0);
}
/* ??0_Lockit@std@@QAE@H@Z */
/* ??0_Lockit@std@@QEAA@H@Z */
DEFINE_THISCALL_WRAPPER(_Lockit_ctor_locktype, 8)
_Lockit* __thiscall _Lockit_ctor_locktype(_Lockit *this, int locktype)
{
_Lockit__Lockit_ctor_locktype(this, locktype);
return this;
}
/* ??0_Lockit@std@@QAE@XZ */
/* ??0_Lockit@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(_Lockit_ctor, 4)
_Lockit* __thiscall _Lockit_ctor(_Lockit *this)
{
_Lockit__Lockit_ctor_locktype(this, 0);
return this;
}
/* ?_Lockit_dtor@_Lockit@std@@CAXPAV12@@Z */
/* ?_Lockit_dtor@_Lockit@std@@CAXPEAV12@@Z */
void __cdecl _Lockit__Lockit_dtor(_Lockit *lockit)
{
LeaveCriticalSection(&lockit_cs[lockit->locktype]);
}
/* ??1_Lockit@std@@QAE@XZ */
/* ??1_Lockit@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(_Lockit_dtor, 4)
void __thiscall _Lockit_dtor(_Lockit *this)
{
_Lockit__Lockit_dtor(this);
}
/* wctype */
unsigned short __cdecl wctype(const char *property)
{
static const struct {
const char *name;
unsigned short mask;
} properties[] = {
{ "alnum", _DIGIT|_ALPHA },
{ "alpha", _ALPHA },
{ "cntrl", _CONTROL },
{ "digit", _DIGIT },
{ "graph", _DIGIT|_PUNCT|_ALPHA },
{ "lower", _LOWER },
{ "print", _DIGIT|_PUNCT|_BLANK|_ALPHA },
{ "punct", _PUNCT },
{ "space", _SPACE },
{ "upper", _UPPER },
{ "xdigit", _HEX }
};
int i;
for(i=0; i<sizeof(properties)/sizeof(properties[0]); i++)
if(!strcmp(property, properties[i].name))
return properties[i].mask;
return 0;
}
typedef void (__cdecl *MSVCP_new_handler_func)(void);
static MSVCP_new_handler_func MSVCP_new_handler;
static int __cdecl new_handler_wrapper(MSVCP_size_t unused)
{
MSVCP_new_handler();
return 1;
}
/* ?set_new_handler@std@@YAP6AXXZP6AXXZ@Z */
MSVCP_new_handler_func __cdecl set_new_handler(MSVCP_new_handler_func new_handler)
{
MSVCP_new_handler_func old_handler = MSVCP_new_handler;
TRACE("%p\n", new_handler);
MSVCP_new_handler = new_handler;
MSVCRT_set_new_handler(new_handler ? new_handler_wrapper : NULL);
return old_handler;
}
/* ?set_new_handler@std@@YAP6AXXZH@Z */
MSVCP_new_handler_func __cdecl set_new_handler_reset(int unused)
{
return set_new_handler(NULL);
}
/*
* 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 "stdlib.h"
#include "windef.h"
typedef unsigned char MSVCP_bool;
typedef SIZE_T MSVCP_size_t;
typedef SIZE_T streamoff;
typedef SIZE_T streamsize;
void __cdecl _invalid_parameter(const wchar_t*, const wchar_t*,
const wchar_t*, unsigned int, uintptr_t);
extern void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t);
extern void (__cdecl *MSVCRT_operator_delete)(void*);
extern void* (__cdecl *MSVCRT_set_new_handler)(void*);
/* Copied from dlls/msvcrt/cpp.c */
#ifdef __i386__ /* thiscall functions are i386-specific */
#define THISCALL(func) __thiscall_ ## func
#define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func)
#define __thiscall __stdcall
#define DEFINE_THISCALL_WRAPPER(func,args) \
extern void THISCALL(func)(void); \
__ASM_GLOBAL_FUNC(__thiscall_ ## func, \
"popl %eax\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
"jmp " __ASM_NAME(#func) __ASM_STDCALL(args) )
#else /* __i386__ */
#define THISCALL(func) func
#define THISCALL_NAME(func) __ASM_NAME(#func)
#define __thiscall __cdecl
#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */
#endif /* __i386__ */
#ifdef _WIN64
#define VTABLE_ADD_FUNC(name) "\t.quad " THISCALL_NAME(name) "\n"
#define __ASM_VTABLE(name,funcs) \
__asm__(".data\n" \
"\t.align 8\n" \
"\t.quad " __ASM_NAME(#name "_rtti") "\n" \
"\t.globl " __ASM_NAME("MSVCP_" #name "_vtable") "\n" \
__ASM_NAME("MSVCP_" #name "_vtable") ":\n" \
"\t.quad " THISCALL_NAME(MSVCP_ ## name ## _vector_dtor) "\n" \
funcs "\n\t.text")
#else
#define VTABLE_ADD_FUNC(name) "\t.long " THISCALL_NAME(name) "\n"
#define __ASM_VTABLE(name,funcs) \
__asm__(".data\n" \
"\t.align 4\n" \
"\t.long " __ASM_NAME(#name "_rtti") "\n" \
"\t.globl " __ASM_NAME("MSVCP_" #name "_vtable") "\n" \
__ASM_NAME("MSVCP_" #name "_vtable") ":\n" \
"\t.long " THISCALL_NAME(MSVCP_ ## name ## _vector_dtor) "\n" \
funcs "\n\t.text")
#endif /* _WIN64 */
#define DEFINE_RTTI_DATA(name, off, base_classes, cl1, cl2, cl3, mangled_name) \
static const type_info name ## _type_info = { \
&MSVCP_ ## name ## _vtable, \
NULL, \
mangled_name \
}; \
\
static const rtti_base_descriptor name ## _rtti_base_descriptor = { \
&name ##_type_info, \
base_classes, \
{ 0, -1, 0}, \
64 \
}; \
\
static const rtti_base_array name ## _rtti_base_array = { \
{ \
&name ## _rtti_base_descriptor, \
cl1, \
cl2, \
cl3 \
} \
}; \
\
static const rtti_object_hierarchy name ## _hierarchy = { \
0, \
0, \
base_classes+1, \
&name ## _rtti_base_array \
}; \
\
const rtti_object_locator name ## _rtti = { \
0, \
off, \
0, \
&name ## _type_info, \
&name ## _hierarchy \
}
#ifdef __i386__
#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (WINAPI*)type)&vtbl_wrapper_##off)args
extern void *vtbl_wrapper_0;
extern void *vtbl_wrapper_4;
extern void *vtbl_wrapper_8;
extern void *vtbl_wrapper_12;
extern void *vtbl_wrapper_16;
extern void *vtbl_wrapper_20;
extern void *vtbl_wrapper_24;
extern void *vtbl_wrapper_28;
extern void *vtbl_wrapper_32;
extern void *vtbl_wrapper_36;
extern void *vtbl_wrapper_40;
extern void *vtbl_wrapper_44;
extern void *vtbl_wrapper_48;
extern void *vtbl_wrapper_52;
extern void *vtbl_wrapper_56;
extern void *vtbl_wrapper_60;
#else
#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (__cdecl***)type)this)[0][off/4]args
#endif
/* exception object */
typedef void (*vtable_ptr)(void);
typedef struct __exception
{
const vtable_ptr *vtable;
char *name; /* Name of this exception, always a new copy for each object */
int do_free; /* Whether to free 'name' in our dtor */
} exception;
/* Internal: throws selected exception */
typedef enum __exception_type {
EXCEPTION,
EXCEPTION_BAD_ALLOC,
EXCEPTION_LOGIC_ERROR,
EXCEPTION_LENGTH_ERROR,
EXCEPTION_OUT_OF_RANGE,
EXCEPTION_INVALID_ARGUMENT,
EXCEPTION_RUNTIME_ERROR
} exception_type;
void throw_exception(exception_type, const char *);
void set_exception_vtable(void);
/* rtti */
typedef struct __type_info
{
const vtable_ptr *vtable;
char *name; /* Unmangled name, allocated lazily */
char mangled[64]; /* Variable length, but we declare it large enough for static RTTI */
} type_info;
/* offsets for computing the this pointer */
typedef struct
{
int this_offset; /* offset of base class this pointer from start of object */
int vbase_descr; /* offset of virtual base class descriptor */
int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */
} this_ptr_offsets;
typedef struct _rtti_base_descriptor
{
const type_info *type_descriptor;
int num_base_classes;
this_ptr_offsets offsets; /* offsets for computing the this pointer */
unsigned int attributes;
} rtti_base_descriptor;
typedef struct _rtti_base_array
{
const rtti_base_descriptor *bases[4]; /* First element is the class itself */
} rtti_base_array;
typedef struct _rtti_object_hierarchy
{
unsigned int signature;
unsigned int attributes;
int array_len; /* Size of the array pointed to by 'base_classes' */
const rtti_base_array *base_classes;
} rtti_object_hierarchy;
typedef struct _rtti_object_locator
{
unsigned int signature;
int base_class_offset;
unsigned int flags;
const type_info *type_descriptor;
const rtti_object_hierarchy *type_hierarchy;
} rtti_object_locator;
/* basic_string<char, char_traits<char>, allocator<char>> */
#define BUF_SIZE_CHAR 16
typedef struct _basic_string_char
{
void *allocator;
char *ptr;
MSVCP_size_t size;
MSVCP_size_t res;
} basic_string_char;
basic_string_char* __stdcall MSVCP_basic_string_char_ctor_cstr(basic_string_char*, const char*);
basic_string_char* __stdcall MSVCP_basic_string_char_copy_ctor(basic_string_char*, const basic_string_char*);
void __stdcall MSVCP_basic_string_char_dtor(basic_string_char*);
const char* __stdcall MSVCP_basic_string_char_c_str(const basic_string_char*);
#define BUF_SIZE_WCHAR 8
typedef struct _basic_string_wchar
{
void *allocator;
wchar_t *ptr;
MSVCP_size_t size;
MSVCP_size_t res;
} basic_string_wchar;
char* __stdcall MSVCP_allocator_char_allocate(void*, MSVCP_size_t);
void __stdcall MSVCP_allocator_char_deallocate(void*, char*, MSVCP_size_t);
MSVCP_size_t __stdcall MSVCP_allocator_char_max_size(void*);
wchar_t* __stdcall MSVCP_allocator_wchar_allocate(void*, MSVCP_size_t);
void __stdcall MSVCP_allocator_wchar_deallocate(void*, wchar_t*, MSVCP_size_t);
MSVCP_size_t __stdcall MSVCP_allocator_wchar_max_size(void*);
/* class locale */
typedef struct
{
struct _locale__Locimp *ptr;
} locale;
locale* __thiscall locale_ctor(locale*);
void __thiscall locale_dtor(locale*);
/* class _Lockit */
typedef struct {
int locktype;
} _Lockit;
#define _LOCK_LOCALE 0
#define _LOCK_MALLOC 1
#define _LOCK_STREAM 2
#define _LOCK_DEBUG 3
#define _MAX_LOCK 4
void init_lockit(void);
void free_lockit(void);
_Lockit* __thiscall _Lockit_ctor_locktype(_Lockit*, int);
void __thiscall _Lockit_dtor(_Lockit*);
/* class mutex */
typedef struct {
void *mutex;
} mutex;
mutex* __thiscall mutex_ctor(mutex*);
void __thiscall mutex_dtor(mutex*);
void __thiscall mutex_lock(mutex*);
void __thiscall mutex_unlock(mutex*);
/*
* msvcp60 specific functions
*
* 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 <stdarg.h>
#include "windef.h"
#include "winbase.h"
BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
{
switch (reason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hdll);
}
return TRUE;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* Copyright 2012 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(msvcp90);
#define FROZEN 255
/* _String_iterator<char> and _String_const_iterator<char> class */
typedef struct {
char *ptr;
} String_reverse_iterator_char;
typedef struct {
wchar_t *ptr;
} String_reverse_iterator_wchar;
/* allocator class */
typedef struct {
char empty_struct;
} allocator;
/* ?_Xran@std@@YAXXZ */
void __cdecl _Xran(void)
{
static const char msg[] = "invalid string position";
TRACE("\n");
throw_exception(EXCEPTION_OUT_OF_RANGE, msg);
}
/* ?_Xlen@std@@YAXXZ */
void __cdecl _Xlen(void)
{
static const char msg[] = "string too long";
TRACE("\n");
throw_exception(EXCEPTION_LENGTH_ERROR, msg);
}
static char* char_traits_char__Move_s(char *dest,
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);
}
static char* char_traits_char__Copy_s(char *dest,
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);
}
static MSVCP_size_t char_traits_char_length(const char *str)
{
return strlen(str);
}
static char* char_traits_char_assignn(char *str, MSVCP_size_t num, char c)
{
return memset(str, c, num);
}
static int char_traits_char_compare(const char *s1,
const char *s2, MSVCP_size_t count)
{
int ret = memcmp(s1, s2, count);
return (ret>0 ? 1 : (ret<0 ? -1 : 0));
}
static const char* char_traits_char_find(const char *str,
MSVCP_size_t range, const char *c)
{
return memchr(str, *c, range);
}
static MSVCP_bool basic_string_char_inside(
basic_string_char *this, const char *ptr)
{
return (ptr<this->ptr || ptr>=this->ptr+this->size) ? FALSE : TRUE;
}
/* ?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 */
const MSVCP_size_t basic_string_char_npos = -1;
/* ?_C@?1??_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDXZ@4DB */
/* ?_C@?1??_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEBDXZ@4DB */
const char nullbyte = '\0';
/* ?_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDXZ */
/* ?_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEBDXZ */
const char* __cdecl basic_string_char__Nullstr(void)
{
return &nullbyte;
}
/* ?_Refcnt@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAEPBD@Z */
/* ?_Refcnt@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAAEAEPEBD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char__Refcnt, 8)
unsigned char* __thiscall basic_string_char__Refcnt(basic_string_char *this, const char *ptr)
{
TRACE("(%p %p)\n", this, ptr);
return (unsigned char*)ptr-1;
}
/* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z */
/* ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAX_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char__Eos, 8)
void __thiscall basic_string_char__Eos(basic_string_char *this, MSVCP_size_t len)
{
this->size = len;
this->ptr[len] = 0;
}
/* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z */
/* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAX_N@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char__Tidy, 8)
void __thiscall basic_string_char__Tidy(basic_string_char *this, MSVCP_bool built)
{
TRACE("(%p %d)\n", this, built);
if(!this->ptr || !built);
else if(!this->ptr[-1] || (unsigned char)this->ptr[-1]==FROZEN)
MSVCP_allocator_char_deallocate(NULL, this->ptr, this->res+2);
else
this->ptr[-1]--;
memset(this, 0, sizeof(*this));
}
MSVCP_bool __thiscall basic_string_char__Grow(basic_string_char*, MSVCP_size_t, MSVCP_bool);
/* ?_Split@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ */
/* ?_Split@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char__Split, 4)
void __thiscall basic_string_char__Split(basic_string_char *this)
{
MSVCP_size_t len;
char *ptr;
TRACE("(%p)\n", this);
if(!this->ptr || !this->ptr[-1] || (unsigned char)this->ptr[-1]==FROZEN)
return;
ptr = this->ptr;
len = this->size;
basic_string_char__Tidy(this, TRUE);
if(basic_string_char__Grow(this, len, FALSE)) {
char_traits_char__Copy_s(this->ptr, this->res, ptr, len);
basic_string_char__Eos(this, len);
}
}
/* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE_NI_N@Z */
/* ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAA_N_K_N@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char__Grow, 12)
MSVCP_bool __thiscall basic_string_char__Grow(basic_string_char *this, MSVCP_size_t new_size, MSVCP_bool trim)
{
/* Fixme: grow string using one reallocation, don't ignore trim flag */
basic_string_char__Split(this);
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);
return FALSE;
}
if(this->ptr)
char_traits_char__Copy_s(ptr, new_size, this->ptr, this->size);
basic_string_char__Tidy(this, TRUE);
this->ptr = ptr;
this->res = new_size;
basic_string_char__Eos(this, len);
} else if(new_size == 0)
basic_string_char__Eos(this, 0);
return (new_size>0);
}
/* ?_Freeze@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ */
/* ?_Freeze@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char__Freeze, 4)
void __thiscall basic_string_char__Freeze(basic_string_char *this)
{
TRACE("(%p)\n", this);
basic_string_char__Split(this);
if(this->ptr)
this->ptr[-1] = FROZEN;
}
/* ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z */
/* ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAX_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char__Copy, 8)
void __thiscall basic_string_char__Copy(basic_string_char *this, MSVCP_size_t copy_len)
{
TRACE("%p %lu\n", this, copy_len);
if(!basic_string_char__Grow(this, copy_len, FALSE))
return;
basic_string_char__Eos(this, copy_len);
}
/* ?_Pdif@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAIPBD0@Z */
/* ?_Pdif@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CA_KPEBD0@Z */
MSVCP_size_t __cdecl basic_string_char__Pdif(const char *i1, const char *i2)
{
TRACE("(%p %p)\n", i1, i2);
return !i1 ? 0 : i1-i2;
}
/* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPADPADI@Z */
/* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEADPEAD_K@Z */
/* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDPBDI@Z */
/* ?_Psum@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPEBDPEBD_K@Z */
char* __cdecl basic_string_char__Psum(char *iter, MSVCP_size_t add)
{
TRACE("(%p %lu)", iter, add);
return iter ? iter+add : iter;
}
/* ?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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_erase, 12)
basic_string_char* __thiscall basic_string_char_erase(
basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t len)
{
TRACE("%p %lu %lu\n", this, pos, len);
if(pos > this->size)
_Xran();
if(len > this->size-pos)
len = this->size-pos;
if(len) {
basic_string_char__Split(this);
char_traits_char__Move_s(this->ptr+pos, this->res-pos,
this->ptr+pos+len, this->size-pos-len);
basic_string_char__Eos(this, this->size-len);
}
return this;
}
/* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADPAD0@Z */
/* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADPEAD0@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_erase_iter, 12)
char* __thiscall basic_string_char_erase_iter(basic_string_char *this, char *beg, char *end)
{
MSVCP_size_t pos = basic_string_char__Pdif(beg, this->ptr);
basic_string_char_erase(this, pos, basic_string_char__Pdif(end, beg));
return basic_string_char__Psum(this->ptr, pos);
}
/* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADPAD@Z */
/* ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADPEAD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_erase_beg, 8)
char* __thiscall basic_string_char_erase_beg(basic_string_char *this, char *beg)
{
MSVCP_size_t pos = beg-this->ptr;
basic_string_char_erase(this, pos, 1);
return this->ptr+pos;
}
/* ?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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_assign_substr, 16)
basic_string_char* __thiscall basic_string_char_assign_substr(
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)
_Xran();
if(len > assign->size-pos)
len = assign->size-pos;
if(this == assign) {
basic_string_char_erase(this, pos+len, basic_string_char_npos);
basic_string_char_erase(this, 0, pos);
} else if(basic_string_char__Grow(this, len, FALSE)) {
char_traits_char__Copy_s(this->ptr, this->res,
assign->ptr+pos, len);
basic_string_char__Eos(this, len);
}
return this;
}
/* ?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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_assign_cstr_len, 12)
basic_string_char* __thiscall basic_string_char_assign_cstr_len(
basic_string_char *this, const char *str, MSVCP_size_t len)
{
TRACE("%p %s %lu\n", this, debugstr_a(str), len);
if(basic_string_char_inside(this, str))
return basic_string_char_assign_substr(this, this, str-this->ptr, len);
else if(basic_string_char__Grow(this, len, FALSE)) {
char_traits_char__Copy_s(this->ptr, this->res, str, len);
basic_string_char__Eos(this, len);
}
return this;
}
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
/* ??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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_assign, 8)
basic_string_char* __thiscall basic_string_char_assign(
basic_string_char *this, const basic_string_char *assign)
{
return basic_string_char_assign_substr(this, assign,
0, basic_string_char_npos);
}
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
/* ??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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_assign_cstr, 8)
basic_string_char* __thiscall basic_string_char_assign_cstr(
basic_string_char *this, const char *str)
{
return basic_string_char_assign_cstr_len(this, str,
char_traits_char_length(str));
}
/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z */
/* ??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@D@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_assign_ch, 8)
basic_string_char* __thiscall basic_string_char_assign_ch(
basic_string_char *this, char ch)
{
return basic_string_char_assign_cstr_len(this, &ch, 1);
}
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ID@Z */
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_assignn, 12)
basic_string_char* __thiscall basic_string_char_assignn(
basic_string_char *this, MSVCP_size_t count, char ch)
{
TRACE("%p %ld %c\n", this, count, ch);
basic_string_char__Grow(this, count, FALSE);
char_traits_char_assignn(this->ptr, count, ch);
basic_string_char__Eos(this, count);
return this;
}
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD0@Z */
/* ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD0@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_assign_ptr_ptr, 12)
basic_string_char* __thiscall basic_string_char_assign_ptr_ptr(
basic_string_char *this, const char *first, const char *last)
{
return basic_string_char_assign_cstr_len(this, first, last-first);
}
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDIABV?$allocator@D@1@@Z */
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD_KAEBV?$allocator@D@1@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_cstr_len_alloc, 16)
basic_string_char* __thiscall basic_string_char_ctor_cstr_len_alloc(
basic_string_char *this, const char *str, MSVCP_size_t len, const void *alloc)
{
TRACE("%p %s %ld\n", this, debugstr_a(str), len);
basic_string_char__Tidy(this, FALSE);
basic_string_char_assign_cstr_len(this, str, len);
return this;
}
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@IIABV?$allocator@D@1@@Z */
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@_K1AEBV?$allocator@D@1@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_substr_alloc, 20)
basic_string_char* __thiscall basic_string_char_ctor_substr_alloc(
basic_string_char *this, const basic_string_char *assign,
MSVCP_size_t pos, MSVCP_size_t len, const void *alloc)
{
TRACE("%p %p %lu %lu\n", this, assign, pos, len);
basic_string_char__Tidy(this, FALSE);
basic_string_char_assign_substr(this, assign, pos, len);
return this;
}
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z */
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBDAEBV?$allocator@D@1@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_cstr_alloc, 12)
basic_string_char* __thiscall basic_string_char_ctor_cstr_alloc(
basic_string_char *this, const char *str, const void *alloc)
{
TRACE("%p %s\n", this, debugstr_a(str));
basic_string_char__Tidy(this, FALSE);
basic_string_char_assign_cstr(this, str);
return this;
}
basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr(
basic_string_char *this, const char *str)
{
return basic_string_char_ctor_cstr_alloc(this, str, NULL);
}
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@IDABV?$allocator@D@1@@Z */
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@_KDAEBV?$allocator@D@1@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_ch_alloc, 16)
basic_string_char* __thiscall basic_string_char_ctor_ch_alloc(basic_string_char *this,
MSVCP_size_t count, char ch, const void *alloc)
{
TRACE("%p %ld %c\n", this, count, ch);
basic_string_char__Tidy(this, FALSE);
basic_string_char_assignn(this, count, ch);
return this;
}
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD0ABV?$allocator@D@1@@Z */
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@PEBD0AEBV?$allocator@D@1@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_iter, 16)
basic_string_char* __thiscall basic_string_char_ctor_iter(basic_string_char *this,
const char *first, const char *last, allocator *alloc)
{
TRACE("(%p %p %p %p)\n", this, first, last, alloc);
basic_string_char__Tidy(this, FALSE);
basic_string_char_assign_cstr_len(this, first, basic_string_char__Pdif(last, first));
return this;
}
/* ??_F?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXXZ */
/* ??_F?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_ctor, 4)
basic_string_char* __thiscall basic_string_char_ctor(basic_string_char *this)
{
TRACE("%p\n", this);
basic_string_char__Tidy(this, FALSE);
return this;
}
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z */
/* ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV?$allocator@D@1@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_ctor_alloc, 8)
basic_string_char* __thiscall basic_string_char_ctor_alloc(
basic_string_char *this, const void *alloc)
{
TRACE("%p %p\n", this, alloc);
basic_string_char__Tidy(this, FALSE);
return 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 */
DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_copy_ctor, 8)
basic_string_char* __thiscall MSVCP_basic_string_char_copy_ctor(
basic_string_char *this, const basic_string_char *copy)
{
TRACE("%p %p\n", this, copy);
basic_string_char__Tidy(this, FALSE);
basic_string_char_assign(this, copy);
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 */
DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_dtor, 4)
void __thiscall MSVCP_basic_string_char_dtor(basic_string_char *this)
{
TRACE("%p\n", this);
basic_string_char__Tidy(this, TRUE);
}
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBDI@Z */
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD0@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr_cstr_len, 20)
int __thiscall basic_string_char_compare_substr_cstr_len(
const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
const char *str, MSVCP_size_t count)
{
int ans;
TRACE("%p %lu %lu %s %lu\n", this, pos, num, debugstr_a(str), count);
if(this->size < pos)
_Xran();
if(pos+num > this->size)
num = this->size-pos;
ans = char_traits_char_compare(this->ptr+pos,
str, num>count ? count : num);
if(ans)
return ans;
if(num > count)
ans = 1;
else if(num < count)
ans = -1;
return ans;
}
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHPBD@Z */
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHPEBD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_compare_cstr, 8)
int __thiscall basic_string_char_compare_cstr(
const basic_string_char *this, const char *str)
{
return basic_string_char_compare_substr_cstr_len(this, 0, this->size,
str, char_traits_char_length(str));
}
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@II@Z */
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@00@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr_substr, 24)
int __thiscall basic_string_char_compare_substr_substr(
const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
const basic_string_char *compare, MSVCP_size_t off, MSVCP_size_t count)
{
TRACE("%p %lu %lu %p %lu %lu\n", this, pos, num, compare, off, count);
if(compare->size < off)
_Xran();
if(off+count > compare->size)
count = compare->size-off;
return basic_string_char_compare_substr_cstr_len(this, pos, num,
compare->ptr+off, count);
}
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIABV12@@Z */
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0AEBV12@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr, 16)
int __thiscall basic_string_char_compare_substr(
const basic_string_char *this, MSVCP_size_t pos, MSVCP_size_t num,
const basic_string_char *compare)
{
return basic_string_char_compare_substr_cstr_len(this, pos, num,
compare->ptr, compare->size);
}
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHABV12@@Z */
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAHAEBV12@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_compare, 8)
int __thiscall basic_string_char_compare(
const basic_string_char *this, const basic_string_char *compare)
{
return basic_string_char_compare_substr_cstr_len(this, 0, this->size,
compare->ptr, compare->size);
}
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHIIPBD@Z */
/* ?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAH_K0PEBD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_compare_substr_cstr, 16)
int __thiscall basic_string_char_compare_substr_cstr(const basic_string_char *this,
MSVCP_size_t pos, MSVCP_size_t num, const char *str)
{
return basic_string_char_compare_substr_cstr_len(this, pos, num,
str, char_traits_char_length(str));
}
/* ??$?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 */
/* ??$?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 */
/* ??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
/* ??8std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
MSVCP_bool __cdecl basic_string_char_equal(
const basic_string_char *left, const basic_string_char *right)
{
return basic_string_char_compare(left, right) == 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??8std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
/* ??8std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
MSVCP_bool __cdecl basic_string_char_equal_str_cstr(
const basic_string_char *left, const char *right)
{
return basic_string_char_compare_cstr(left, right) == 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??8std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
/* ??8std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
MSVCP_bool __cdecl basic_string_char_equal_cstr_str(
const char *left, const basic_string_char *right)
{
return basic_string_char_compare_cstr(right, left) == 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??9std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
/* ??9std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
MSVCP_bool __cdecl basic_string_char_not_equal(
const basic_string_char *left, const basic_string_char *right)
{
return basic_string_char_compare(left, right) != 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??9std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
/* ??9std@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
MSVCP_bool __cdecl basic_string_char_not_equal_str_cstr(
const basic_string_char *left, const char *right)
{
return basic_string_char_compare_cstr(left, right) != 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??9std@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
/* ??9std@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
MSVCP_bool __cdecl basic_string_char_not_equal_cstr_str(
const char *left, const basic_string_char *right)
{
return basic_string_char_compare_cstr(right, left) != 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Mstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
/* ??Mstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
MSVCP_bool __cdecl basic_string_char_lower(
const basic_string_char *left, const basic_string_char *right)
{
return basic_string_char_compare(left, right) < 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Mstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
/* ??Mstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
MSVCP_bool __cdecl basic_string_char_lower_bstr_cstr(
const basic_string_char *left, const char *right)
{
return basic_string_char_compare_cstr(left, right) < 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Mstd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
/* ??Mstd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
MSVCP_bool __cdecl basic_string_char_lower_cstr_bstr(
const char *left, const basic_string_char *right)
{
return basic_string_char_compare_cstr(right, left) > 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Nstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
/* ??Nstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
MSVCP_bool __cdecl basic_string_char_leq(
const basic_string_char *left, const basic_string_char *right)
{
return basic_string_char_compare(left, right) <= 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Nstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
/* ??Nstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
MSVCP_bool __cdecl basic_string_char_leq_bstr_cstr(
const basic_string_char *left, const char *right)
{
return basic_string_char_compare_cstr(left, right) <= 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Nstd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
/* ??Nstd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
MSVCP_bool __cdecl basic_string_char_leq_cstr_bstr(
const char *left, const basic_string_char *right)
{
return basic_string_char_compare_cstr(right, left) >= 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Ostd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
/* ??Ostd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
MSVCP_bool __cdecl basic_string_char_greater(
const basic_string_char *left, const basic_string_char *right)
{
return basic_string_char_compare(left, right) > 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Ostd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
/* ??Ostd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
MSVCP_bool __cdecl basic_string_char_greater_bstr_cstr(
const basic_string_char *left, const char *right)
{
return basic_string_char_compare_cstr(left, right) > 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Ostd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
/* ??Ostd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
MSVCP_bool __cdecl basic_string_char_greater_cstr_bstr(
const char *left, const basic_string_char *right)
{
return basic_string_char_compare_cstr(right, left) < 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Pstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
/* ??Pstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z */
MSVCP_bool __cdecl basic_string_char_geq(
const basic_string_char *left, const basic_string_char *right)
{
return basic_string_char_compare(left, right) >= 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Pstd@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBD@Z */
/* ??Pstd@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBD@Z */
MSVCP_bool __cdecl basic_string_char_geq_bstr_cstr(
const basic_string_char *left, const char *right)
{
return basic_string_char_compare_cstr(left, right) >= 0;
}
/* ??$?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 */
/* ??$?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 */
/* ??Pstd@@YA_NPBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
/* ??Pstd@@YA_NPEBDAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z */
MSVCP_bool __cdecl basic_string_char_geq_cstr_bstr(
const char *left, const basic_string_char *right)
{
return basic_string_char_compare_cstr(right, left) <= 0;
}
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_cstr_substr, 16)
MSVCP_size_t __thiscall basic_string_char_find_cstr_substr(
const basic_string_char *this, const char *find, MSVCP_size_t pos, MSVCP_size_t len)
{
const char *p, *end;
TRACE("%p %s %lu %lu\n", this, debugstr_a(find), pos, len);
if(len==0 && pos<=this->size)
return pos;
end = this->ptr+this->size-len+1;
for(p=this->ptr+pos; p<end; p++) {
p = char_traits_char_find(p, end-p, find);
if(!p)
break;
if(!char_traits_char_compare(p, find, len))
return p-this->ptr;
}
return basic_string_char_npos;
}
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_off, 12)
MSVCP_size_t __thiscall basic_string_char_find_off(
const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
{
return basic_string_char_find_cstr_substr(this, find->ptr, off, find->size);
}
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_ch, 12)
MSVCP_size_t __thiscall basic_string_char_find_ch(
const basic_string_char *this, char ch, MSVCP_size_t pos)
{
return basic_string_char_find_cstr_substr(this, &ch, pos, 1);
}
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
/* ?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_cstr_off, 12)
MSVCP_size_t __thiscall basic_string_char_find_cstr_off(
const basic_string_char *this, const char *find, MSVCP_size_t pos)
{
return basic_string_char_find_cstr_substr(this, find, pos,
char_traits_char_length(find));
}
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_cstr_substr, 16)
MSVCP_size_t __thiscall basic_string_char_rfind_cstr_substr(
const basic_string_char *this, const char *find, MSVCP_size_t pos, MSVCP_size_t len)
{
const char *p, *end;
TRACE("%p %s %lu %lu\n", this, debugstr_a(find), pos, len);
if(len==0)
return pos<this->size ? pos : this->size;
if(len > this->size)
return basic_string_char_npos;
if(pos > this->size-len+1)
pos = this->size-len+1;
end = this->ptr;
for(p=end+pos-1; p>=end; p--) {
if(*p==*find && !char_traits_char_compare(p, find, len))
return p-this->ptr;
}
return basic_string_char_npos;
}
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_off, 12)
MSVCP_size_t __thiscall basic_string_char_rfind_off(
const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
{
return basic_string_char_rfind_cstr_substr(this, find->ptr, off, find->size);
}
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_ch, 12)
MSVCP_size_t __thiscall basic_string_char_rfind_ch(
const basic_string_char *this, char ch, MSVCP_size_t pos)
{
return basic_string_char_find_cstr_substr(this, &ch, pos, 1);
}
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
/* ?rfind@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_rfind_cstr_off, 12)
MSVCP_size_t __thiscall basic_string_char_rfind_cstr_off(
const basic_string_char *this, const char *find, MSVCP_size_t pos)
{
return basic_string_char_rfind_cstr_substr(this, find, pos,
char_traits_char_length(find));
}
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of_cstr_substr, 16)
MSVCP_size_t __thiscall basic_string_char_find_first_not_of_cstr_substr(
const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
{
const char *p, *end;
TRACE("%p %p %lu %lu\n", this, find, off, len);
if(off<this->size) {
end = this->ptr+this->size;
for(p=this->ptr+off; p<end; p++)
if(!char_traits_char_find(find, len, p))
return p-this->ptr;
}
return basic_string_char_npos;
}
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of, 12)
MSVCP_size_t __thiscall basic_string_char_find_first_not_of(
const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
{
return basic_string_char_find_first_not_of_cstr_substr(this,
find->ptr, off, find->size);
}
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of_ch, 12)
MSVCP_size_t __thiscall basic_string_char_find_first_not_of_ch(
const basic_string_char *this, char ch, MSVCP_size_t off)
{
return basic_string_char_find_first_not_of_cstr_substr(this, &ch, off, 1);
}
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
/* ?find_first_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_not_of_cstr, 12)
MSVCP_size_t __thiscall basic_string_char_find_first_not_of_cstr(
const basic_string_char *this, const char *find, MSVCP_size_t off)
{
return basic_string_char_find_first_not_of_cstr_substr(
this, find, off, char_traits_char_length(find));
}
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of_cstr_substr, 16)
MSVCP_size_t __thiscall basic_string_char_find_first_of_cstr_substr(
const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
{
const char *p, *end;
TRACE("%p %p %lu %lu\n", this, find, off, len);
if(len>0 && off<this->size) {
end = this->ptr+this->size;
for(p=this->ptr+off; p<end; p++)
if(char_traits_char_find(find, len, p))
return p-this->ptr;
}
return basic_string_char_npos;
}
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of, 12)
MSVCP_size_t __thiscall basic_string_char_find_first_of(
const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
{
return basic_string_char_find_first_of_cstr_substr(this,
find->ptr, off, find->size);
}
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of_ch, 12)
MSVCP_size_t __thiscall basic_string_char_find_first_of_ch(
const basic_string_char *this, char ch, MSVCP_size_t off)
{
return basic_string_char_find_first_of_cstr_substr(this, &ch, off, 1);
}
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
/* ?find_first_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_first_of_cstr, 12)
MSVCP_size_t __thiscall basic_string_char_find_first_of_cstr(
const basic_string_char *this, const char *find, MSVCP_size_t off)
{
return basic_string_char_find_first_of_cstr_substr(
this, find, off, char_traits_char_length(find));
}
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of_cstr_substr, 16)
MSVCP_size_t __thiscall basic_string_char_find_last_not_of_cstr_substr(
const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
{
const char *p, *beg;
TRACE("%p %p %lu %lu\n", this, find, off, len);
if(len>0 && this->size>0) {
if(off >= this->size)
off = this->size-1;
beg = this->ptr;
for(p=beg+off; p>=beg; p--)
if(!char_traits_char_find(find, len, p))
return p-beg;
}
return basic_string_char_npos;
}
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of, 12)
MSVCP_size_t __thiscall basic_string_char_find_last_not_of(
const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
{
return basic_string_char_find_last_not_of_cstr_substr(this,
find->ptr, off, find->size);
}
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of_ch, 12)
MSVCP_size_t __thiscall basic_string_char_find_last_not_of_ch(
const basic_string_char *this, char ch, MSVCP_size_t off)
{
return basic_string_char_find_last_not_of_cstr_substr(this, &ch, off, 1);
}
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
/* ?find_last_not_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_not_of_cstr, 12)
MSVCP_size_t __thiscall basic_string_char_find_last_not_of_cstr(
const basic_string_char *this, const char *find, MSVCP_size_t off)
{
return basic_string_char_find_last_not_of_cstr_substr(
this, find, off, char_traits_char_length(find));
}
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDII@Z */
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of_cstr_substr, 16)
MSVCP_size_t __thiscall basic_string_char_find_last_of_cstr_substr(
const basic_string_char *this, const char *find, MSVCP_size_t off, MSVCP_size_t len)
{
const char *p, *beg;
TRACE("%p %p %lu %lu\n", this, find, off, len);
if(len>0 && this->size>0) {
if(off >= this->size)
off = this->size-1;
beg = this->ptr;
for(p=beg+off; p>=beg; p--)
if(char_traits_char_find(find, len, p))
return p-beg;
}
return basic_string_char_npos;
}
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIABV12@I@Z */
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KAEBV12@_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of, 12)
MSVCP_size_t __thiscall basic_string_char_find_last_of(
const basic_string_char *this, const basic_string_char *find, MSVCP_size_t off)
{
return basic_string_char_find_last_of_cstr_substr(this,
find->ptr, off, find->size);
}
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z */
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of_ch, 12)
MSVCP_size_t __thiscall basic_string_char_find_last_of_ch(
const basic_string_char *this, char ch, MSVCP_size_t off)
{
return basic_string_char_find_last_of_cstr_substr(this, &ch, off, 1);
}
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPBDI@Z */
/* ?find_last_of@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_find_last_of_cstr, 12)
MSVCP_size_t __thiscall basic_string_char_find_last_of_cstr(
const basic_string_char *this, const char *find, MSVCP_size_t off)
{
return basic_string_char_find_last_of_cstr_substr(
this, find, off, char_traits_char_length(find));
}
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z */
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_append_substr, 16)
basic_string_char* __thiscall basic_string_char_append_substr(basic_string_char *this,
const basic_string_char *append, MSVCP_size_t offset, MSVCP_size_t count)
{
TRACE("%p %p %lu %lu\n", this, append, offset, count);
if(append->size < offset)
_Xran();
if(count > append->size-offset)
count = append->size-offset;
if(basic_string_char_npos-this->size<=count || this->size+count<this->size)
_Xlen();
if(basic_string_char__Grow(this, this->size+count, FALSE)) {
char_traits_char__Copy_s(this->ptr+this->size,
this->res-this->size, append->ptr+offset, count);
basic_string_char__Eos(this, this->size+count);
}
return this;
}
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z */
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_append_cstr_len, 12)
basic_string_char* __thiscall basic_string_char_append_cstr_len(
basic_string_char *this, const char *append, MSVCP_size_t count)
{
TRACE("%p %s %lu\n", this, debugstr_a(append), count);
if(basic_string_char_inside(this, append))
return basic_string_char_append_substr(this, this, append-this->ptr, count);
if(basic_string_char_npos-this->size<=count || this->size+count<this->size)
_Xlen();
if(basic_string_char__Grow(this, this->size+count, FALSE)) {
char_traits_char__Copy_s(this->ptr+this->size,
this->res-this->size, append, count);
basic_string_char__Eos(this, this->size+count);
}
return this;
}
/* ?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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_append_len_ch, 12)
basic_string_char* __thiscall 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(basic_string_char_npos-this->size <= count)
_Xlen();
if(basic_string_char__Grow(this, this->size+count, FALSE)) {
char_traits_char_assignn(this->ptr+this->size, count, ch);
basic_string_char__Eos(this, this->size+count);
}
return this;
}
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z */
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@AEBV12@@Z */
/* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z */
/* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@AEBV01@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_append, 8)
basic_string_char* __thiscall basic_string_char_append(
basic_string_char *this, const basic_string_char *append)
{
return basic_string_char_append_substr(this, append,
0, basic_string_char_npos);
}
/* ??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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_append_ch, 8)
basic_string_char* __thiscall basic_string_char_append_ch(
basic_string_char *this, char ch)
{
return basic_string_char_append_len_ch(this, 1, ch);
}
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD0@Z */
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD0@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_append_beg_end, 12)
basic_string_char* __thiscall basic_string_char_append_beg_end(
basic_string_char *this, const char *beg, const char *end)
{
return basic_string_char_append_cstr_len(this, beg, end-beg);
}
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z */
/* ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEBD@Z */
/* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z */
/* ??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV01@PEBD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_append_cstr, 8)
basic_string_char* __thiscall basic_string_char_append_cstr(
basic_string_char *this, const char *append)
{
return basic_string_char_append_cstr_len(this, append,
char_traits_char_length(append));
}
/* ??$?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 */
/* ??$?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 */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@0@Z */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@0@Z */
basic_string_char* __cdecl basic_string_char_concatenate(basic_string_char *ret,
const basic_string_char *left, const basic_string_char *right)
{
TRACE("%p %p\n", left, right);
MSVCP_basic_string_char_copy_ctor(ret, left);
basic_string_char_append(ret, right);
return ret;
}
/* ??$?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 */
/* ??$?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 */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@D@Z */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@D@Z */
basic_string_char* __cdecl basic_string_char_concatenate_bstr_ch(basic_string_char *ret,
const basic_string_char *left, char right)
{
TRACE("%p %c\n", left, right);
MSVCP_basic_string_char_copy_ctor(ret, left);
basic_string_char_append_ch(ret, right);
return ret;
}
/* ??$?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 */
/* ??$?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 */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@PEBD@Z */
basic_string_char* __cdecl basic_string_char_concatenate_bstr_cstr(basic_string_char *ret,
const basic_string_char *left, const char *right)
{
TRACE("%p %s\n", left, debugstr_a(right));
MSVCP_basic_string_char_copy_ctor(ret, left);
basic_string_char_append_cstr(ret, right);
return ret;
}
/* ??$?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 */
/* ??$?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 */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@DABV10@@Z */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@DAEBV10@@Z */
basic_string_char* __cdecl basic_string_char_concatenate_ch_bstr(basic_string_char *ret,
char left, const basic_string_char *right)
{
TRACE("%c %p\n", left, right);
basic_string_char_ctor_cstr_len_alloc(ret, &left, 1, NULL);
basic_string_char_append(ret, right);
return ret;
}
/* ??$?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 */
/* ??$?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 */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PBDABV10@@Z */
/* ??Hstd@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@PEBDAEBV10@@Z */
basic_string_char* __cdecl basic_string_char_concatenate_cstr_bstr(basic_string_char *ret,
const char *left, const basic_string_char *right)
{
TRACE("%s %p\n", debugstr_a(left), right);
basic_string_char_ctor_cstr_alloc(ret, left, NULL);
basic_string_char_append(ret, right);
return ret;
}
/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_operator_at, 8)
char* __thiscall basic_string_char_operator_at(
basic_string_char *this, MSVCP_size_t pos)
{
TRACE("%p %lu\n", this, pos);
assert(this->size >= pos);
return this->ptr+pos;
}
/* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */
/* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */
/* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */
/* ?at@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_at, 8)
char* __thiscall basic_string_char_at(
basic_string_char *this, MSVCP_size_t pos)
{
TRACE("%p %lu\n", this, pos);
if(this->size <= pos)
_Xran();
return this->ptr+pos;
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIPBDI@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0PEBD0@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_cstr_len, 20)
basic_string_char* __thiscall basic_string_char_replace_cstr_len(basic_string_char *this,
MSVCP_size_t off, MSVCP_size_t len, const char *str, MSVCP_size_t str_len)
{
MSVCP_size_t inside_pos = -1;
char *ptr = this->ptr;
TRACE("%p %ld %ld %p %ld\n", this, off, len, str, str_len);
if(this->size < off)
_Xran();
if(off+len > this->size)
len = this->size-off;
if(basic_string_char_npos-str_len <= this->size-len)
_Xlen();
if(basic_string_char_inside(this, str))
inside_pos = str-ptr;
if(this->size-len+str_len)
basic_string_char__Grow(this, this->size-len+str_len, FALSE);
ptr = this->ptr;
if(inside_pos == -1) {
memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
memcpy(ptr+off, str, str_len*sizeof(char));
} else if(len >= str_len) {
memmove(ptr+off, ptr+inside_pos, str_len*sizeof(char));
memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
} else {
MSVCP_size_t size;
memmove(ptr+off+str_len, ptr+off+len, (this->size-off-len)*sizeof(char));
if(inside_pos < off+len) {
size = off+len-inside_pos;
if(size > str_len)
size = str_len;
memmove(ptr+off, ptr+inside_pos, size*sizeof(char));
} else {
size = 0;
}
if(str_len > size)
memmove(ptr+off+size, ptr+off+str_len, (str_len-size)*sizeof(char));
}
basic_string_char__Eos(this, this->size-len+str_len);
return this;
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIABV12@II@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0AEBV12@00@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_substr, 24)
basic_string_char* __thiscall basic_string_char_replace_substr(basic_string_char *this, MSVCP_size_t off,
MSVCP_size_t len, const basic_string_char *str, MSVCP_size_t str_off, MSVCP_size_t str_len)
{
if(str->size < str_off)
_Xran();
if(str_off+str_len > str->size)
str_len = str->size-str_off;
return basic_string_char_replace_cstr_len(this, off, len,
str->ptr+str_off, str_len);
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIABV12@@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0AEBV12@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace, 16)
basic_string_char* __thiscall basic_string_char_replace(basic_string_char *this,
MSVCP_size_t off, MSVCP_size_t len, const basic_string_char *str)
{
return basic_string_char_replace_cstr_len(this, off, len,
str->ptr, str->size);
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIID@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K00D@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_ch, 20)
basic_string_char* __thiscall basic_string_char_replace_ch(basic_string_char *this,
MSVCP_size_t off, MSVCP_size_t len, MSVCP_size_t count, char ch)
{
char *ptr = this->ptr;
TRACE("%p %ld %ld %ld %c\n", this, off, len, count, ch);
if(this->size < off)
_Xran();
if(off+len > this->size)
len = this->size-off;
if(basic_string_char_npos-count <= this->size-len)
_Xlen();
if(this->size-len+count)
basic_string_char__Grow(this, this->size-len+count, FALSE);
ptr = this->ptr;
memmove(ptr+off+count, ptr+off+len, (this->size-off-len)*sizeof(char));
char_traits_char_assignn(ptr+off, count, ch);
basic_string_char__Eos(this, this->size-len+count);
return this;
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IIPBD@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0PEBD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_cstr, 16)
basic_string_char* __thiscall basic_string_char_replace_cstr(basic_string_char *this,
MSVCP_size_t off, MSVCP_size_t len, const char *str)
{
return basic_string_char_replace_cstr_len(this, off, len, str,
char_traits_char_length(str));
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0ABV12@@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0AEBV12@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_bstr, 16)
basic_string_char* __thiscall basic_string_char_replace_iter_bstr(basic_string_char *this,
char *beg, char *end, const basic_string_char *str)
{
return basic_string_char_replace(this, basic_string_char__Pdif(beg, this->ptr),
basic_string_char__Pdif(end, beg), str);
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0ID@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0_KD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_chn, 20)
basic_string_char* __thiscall basic_string_char_replace_iter_chn(basic_string_char *this,
char *beg, char *end, MSVCP_size_t count, char ch)
{
return basic_string_char_replace_ch(this, basic_string_char__Pdif(beg, this->ptr),
basic_string_char__Pdif(end, beg), count, ch);
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0PBD1@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0PEBD1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_iter, 20)
basic_string_char* __thiscall basic_string_char_replace_iter_iter(basic_string_char *this,
char *beg1, char *end1, const char *beg2, const char *end2)
{
return basic_string_char_replace_cstr_len(this, basic_string_char__Pdif(beg1, this->ptr),
basic_string_char__Pdif(end1, beg1), beg2, basic_string_char__Pdif(end2, beg2));
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0PBD@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0PEBD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_cstr, 16)
basic_string_char* __thiscall basic_string_char_replace_iter_cstr(basic_string_char *this,
char *beg, char *end, const char *str)
{
return basic_string_char_replace_cstr(this, basic_string_char__Pdif(beg, this->ptr),
basic_string_char__Pdif(end, beg), str);
}
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PAD0PBDI@Z */
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@PEAD0PEBD_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_cstr_len, 20)
basic_string_char* __thiscall basic_string_char_replace_iter_cstr_len(basic_string_char *this,
char *beg, char *end, const char *str, MSVCP_size_t len)
{
return basic_string_char_replace_cstr_len(this, basic_string_char__Pdif(beg, this->ptr),
basic_string_char__Pdif(end, beg), str, len);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IABV12@@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KAEBV12@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert, 12)
basic_string_char* __thiscall basic_string_char_insert(basic_string_char *this,
MSVCP_size_t off, const basic_string_char *str)
{
return basic_string_char_replace(this, off, 0, str);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IABV12@II@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KAEBV12@00@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert_substr, 20)
basic_string_char* __thiscall basic_string_char_insert_substr(
basic_string_char *this, MSVCP_size_t off, const basic_string_char *str,
MSVCP_size_t str_off, MSVCP_size_t str_count)
{
return basic_string_char_replace_substr(this, off, 0, str, str_off, str_count);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IPBD@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KPEBD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert_cstr, 12)
basic_string_char* __thiscall basic_string_char_insert_cstr(
basic_string_char *this, MSVCP_size_t off, const char *str)
{
return basic_string_char_replace_cstr(this, off, 0, str);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IPBDI@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_KPEBD0@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert_cstr_len, 16)
basic_string_char* __thiscall basic_string_char_insert_cstr_len(basic_string_char *this,
MSVCP_size_t off, const char *str, MSVCP_size_t str_len)
{
return basic_string_char_replace_cstr_len(this, off, 0, str, str_len);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@IID@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@_K0D@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert_chn, 16)
basic_string_char* __thiscall basic_string_char_insert_chn(basic_string_char *this,
MSVCP_size_t off, MSVCP_size_t count, char ch)
{
return basic_string_char_replace_ch(this, off, 0, count, ch);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADPADD@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADPEADD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter_ch, 12)
char* __thiscall basic_string_char_insert_iter_ch(basic_string_char *this, char *pos, char ch)
{
MSVCP_size_t off = basic_string_char__Pdif(pos, this->ptr);
basic_string_char_insert_chn(this, off, 1, ch);
return basic_string_char__Psum(this->ptr, off);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXPADID@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXPEAD_KD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter_chn, 16)
void __thiscall basic_string_char_insert_iter_chn(basic_string_char *this,
char *pos, MSVCP_size_t n, char ch)
{
basic_string_char_insert_chn(this, basic_string_char__Pdif(pos, this->ptr), n, ch);
}
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXPADPBD1@Z */
/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXPEADPEBD1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter, 16)
void __thiscall basic_string_char_insert_iter(basic_string_char *this,
char *pos, const char *beg, const char *end)
{
basic_string_char_insert_cstr_len(this, basic_string_char__Pdif(pos, this->ptr),
beg, basic_string_char__Pdif(end, beg));
}
/* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXID@Z */
/* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_KD@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_resize_ch, 12)
void __thiscall basic_string_char_resize_ch(
basic_string_char *this, MSVCP_size_t size, char ch)
{
TRACE("%p %lu %c\n", this, size, ch);
if(size <= this->size)
basic_string_char_erase(this, size, this->size);
else
basic_string_char_append_len_ch(this, size-this->size, ch);
}
/* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z */
/* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_resize, 8)
void __thiscall basic_string_char_resize(
basic_string_char *this, MSVCP_size_t size)
{
basic_string_char_resize_ch(this, size, '\0');
}
/* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ */
/* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADXZ */
/* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
/* ?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_begin, 4)
char* __thiscall basic_string_char_begin(basic_string_char *this)
{
TRACE("(%p)\n", this);
basic_string_char__Freeze(this);
return this->ptr;
}
/* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEPADXZ */
/* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAPEADXZ */
/* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ */
/* ?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAPEBDXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_end, 4)
char* __thiscall basic_string_char_end(basic_string_char *this)
{
TRACE("(%p)\n", this);
basic_string_char__Freeze(this);
return this->ptr+this->size;
}
/* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AV?$reverse_iterator@PADDAADPADH@2@XZ */
/* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA?AV?$reverse_iterator@PEADDAEADPEAD_J@2@XZ */
/* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$reverse_iterator@PBDDABDPBDH@2@XZ */
/* ?rbegin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$reverse_iterator@PEBDDAEBDPEBD_J@2@XZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_rbegin, 8)
String_reverse_iterator_char* __thiscall basic_string_char_rbegin(
basic_string_char *this, String_reverse_iterator_char *ret)
{
TRACE("(%p %p)\n", this, ret);
ret->ptr = basic_string_char_end(this);
return ret;
}
/* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE?AV?$reverse_iterator@PADDAADPADH@2@XZ */
/* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA?AV?$reverse_iterator@PEADDAEADPEAD_J@2@XZ */
/* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$reverse_iterator@PBDDABDPBDH@2@XZ */
/* ?rend@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$reverse_iterator@PEBDDAEBDPEBD_J@2@XZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_rend, 8)
String_reverse_iterator_char* __thiscall basic_string_char_rend(
basic_string_char *this, String_reverse_iterator_char *ret)
{
TRACE("(%p %p)\n", this, ret);
ret->ptr = basic_string_char_begin(this);
return ret;
}
/* ?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 */
DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_c_str, 4)
const char* __thiscall MSVCP_basic_string_char_c_str(const basic_string_char *this)
{
TRACE("%p\n", this);
return this->ptr;
}
/* ?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 */
DEFINE_THISCALL_WRAPPER(basic_string_char_length, 4)
MSVCP_size_t __thiscall basic_string_char_length(basic_string_char *this)
{
TRACE("%p\n", this);
return this->size;
}
/* ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
/* ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_max_size, 4)
MSVCP_size_t __thiscall basic_string_char_max_size(const basic_string_char *this)
{
TRACE("%p\n", this);
return MSVCP_allocator_char_max_size(NULL)-1;
}
/* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
/* ?capacity@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_capacity, 4)
MSVCP_size_t __thiscall basic_string_char_capacity(basic_string_char *this)
{
TRACE("%p\n", this);
return this->res;
}
/* ?reserve@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z */
/* ?reserve@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_K@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_reserve, 8)
void __thiscall basic_string_char_reserve(basic_string_char *this, MSVCP_size_t size)
{
MSVCP_size_t len;
TRACE("%p %ld\n", this, size);
len = this->size;
if(len > size)
return;
basic_string_char__Grow(this, size, FALSE);
basic_string_char__Eos(this, len);
}
/* ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE_NXZ */
/* ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_NXZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_empty, 4)
MSVCP_bool __thiscall basic_string_char_empty(basic_string_char *this)
{
TRACE("%p\n", this);
return this->size == 0;
}
/* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXAAV12@@Z */
/* ?swap@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAXAEAV12@@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_swap, 8)
void __thiscall basic_string_char_swap(basic_string_char *this, basic_string_char *str)
{
basic_string_char tmp;
TRACE("%p %p\n", this, str);
tmp = *this;
*this = *str;
*str = tmp;
}
/* ?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV12@II@Z */
/* ?substr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV12@_K0@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_substr, 16)
basic_string_char* __thiscall basic_string_char_substr(basic_string_char *this,
basic_string_char *ret, MSVCP_size_t off, MSVCP_size_t len)
{
TRACE("%p %lu %lu\n", this, off, len);
basic_string_char_ctor_substr_alloc(ret, this, off, len, NULL);
return ret;
}
/* ?copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIPADII@Z */
/* ?copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA_KPEAD_K1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_copy, 16)
MSVCP_size_t __thiscall basic_string_char_copy(const basic_string_char *this,
char *dest, MSVCP_size_t count, MSVCP_size_t off)
{
TRACE("%p %p %lu %lu\n", this, dest, count, off);
if(off > this->size)
_Xran();
if(count > this->size-off)
count = this->size-off;
char_traits_char__Copy_s(dest, count, this->ptr+off, count);
return count;
}
/* ?get_allocator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AV?$allocator@D@2@XZ */
/* ?get_allocator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBA?AV?$allocator@D@2@XZ */
DEFINE_THISCALL_WRAPPER(basic_string_char_get_allocator, 8)
allocator* __thiscall basic_string_char_get_allocator(const basic_string_char *this, allocator *ret)
{
TRACE("%p\n", this);
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment