62
62
const CHARSET_INFO *str_charset;
67
Ptr=0; str_length=Alloced_length=0; alloced=0;
68
str_charset= &my_charset_bin;
70
String(uint32_t length_arg)
72
alloced=0; Alloced_length=0; (void) real_alloc(length_arg);
73
str_charset= &my_charset_bin;
75
String(const char *str, const CHARSET_INFO * const cs)
77
Ptr=(char*) str; str_length=(uint32_t) strlen(str); Alloced_length=0; alloced=0;
80
String(const char *str,uint32_t len, const CHARSET_INFO * const cs)
82
Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0;
85
String(char *str,uint32_t len, const CHARSET_INFO * const cs)
87
Ptr=(char*) str; Alloced_length=str_length=len; alloced=0;
90
String(const String &str)
92
Ptr=str.Ptr ; str_length=str.str_length ;
93
Alloced_length=str.Alloced_length; alloced=0;
94
str_charset=str.str_charset;
70
str_charset(&my_charset_bin) { }
72
String(uint32_t length_arg) :
77
str_charset(&my_charset_bin)
79
(void) real_alloc(length_arg);
82
String(const char *str, const CHARSET_INFO * const cs) :
83
Ptr(const_cast<char*>(str)),
84
str_length(static_cast<uint32_t>(strlen(str))),
89
String(const char *str, uint32_t len, const CHARSET_INFO * const cs) :
90
Ptr(const_cast<char*>(str)),
96
String(char *str,uint32_t len, const CHARSET_INFO * const cs) :
103
String(const String &str) :
105
str_length(str.str_length),
106
Alloced_length(str.Alloced_length),
108
str_charset(str.str_charset) { }
96
110
static void *operator new(size_t size, MEM_ROOT *mem_root)
97
{ return (void*) alloc_root(mem_root, (uint32_t) size); }
111
{ return alloc_root(mem_root, static_cast<uint32_t>(size)); }
98
112
static void operator delete(void *, size_t)
99
113
{ TRASH(ptr_arg, size); }
100
114
static void operator delete(void *, MEM_ROOT *)
151
165
inline void set(char *str,uint32_t arg_length, const CHARSET_INFO * const cs)
154
Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0;
168
Ptr= str; str_length=Alloced_length=arg_length ; alloced=0;
157
171
inline void set(const char *str,uint32_t arg_length, const CHARSET_INFO * const cs)
160
Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0;
174
Ptr= const_cast<char*>(str);
175
str_length=arg_length; Alloced_length=0 ; alloced=0;
163
178
bool set_ascii(const char *str, uint32_t arg_length);
168
Ptr=(char*) str; str_length=Alloced_length=arg_length;
183
Ptr= str; str_length= Alloced_length= arg_length;
172
187
bool set_int(int64_t num, bool unsigned_flag, const CHARSET_INFO * const cs);
173
188
bool set(int64_t num, const CHARSET_INFO * const cs)
174
189
{ return set_int(num, false, cs); }
175
190
bool set(uint64_t num, const CHARSET_INFO * const cs)
176
{ return set_int((int64_t)num, true, cs); }
191
{ return set_int(static_cast<int64_t>(num), true, cs); }
177
192
bool set_real(double num,uint32_t decimals, const CHARSET_INFO * const cs);