30
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
30
int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
31
31
String *copy_if_not_alloced(String *a,String *b,uint32_t arg_length);
32
uint32_t copy_and_convert(char *to, uint32_t to_length, CHARSET_INFO *to_cs,
32
uint32_t copy_and_convert(char *to, uint32_t to_length, const CHARSET_INFO * const to_cs,
33
33
const char *from, uint32_t from_length,
34
CHARSET_INFO *from_cs, uint *errors);
35
uint32_t well_formed_copy_nchars(CHARSET_INFO *to_cs,
34
const CHARSET_INFO * const from_cs, uint *errors);
35
uint32_t well_formed_copy_nchars(const CHARSET_INFO * const to_cs,
36
36
char *to, uint to_length,
37
CHARSET_INFO *from_cs,
37
const CHARSET_INFO * const from_cs,
38
38
const char *from, uint from_length,
40
40
const char **well_formed_error_pos,
41
41
const char **cannot_convert_error_pos,
42
42
const char **from_end_pos);
43
size_t my_copy_with_hex_escaping(CHARSET_INFO *cs,
43
size_t my_copy_with_hex_escaping(const CHARSET_INFO * const cs,
44
44
char *dst, size_t dstlen,
45
45
const char *src, size_t srclen);
61
61
alloced=0; Alloced_length=0; (void) real_alloc(length_arg);
62
62
str_charset= &my_charset_bin;
64
String(const char *str, CHARSET_INFO *cs)
64
String(const char *str, const CHARSET_INFO * const cs)
66
66
Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0;
69
String(const char *str,uint32_t len, CHARSET_INFO *cs)
69
String(const char *str,uint32_t len, const CHARSET_INFO * const cs)
71
71
Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0;
74
String(char *str,uint32_t len, CHARSET_INFO *cs)
74
String(char *str,uint32_t len, const CHARSET_INFO * const cs)
76
76
Ptr=(char*) str; Alloced_length=str_length=len; alloced=0;
92
92
{ /* never called */ }
93
93
~String() { free(); }
95
inline void set_charset(CHARSET_INFO *charset_arg)
95
inline void set_charset(const CHARSET_INFO * const charset_arg)
96
96
{ str_charset= charset_arg; }
97
inline CHARSET_INFO *charset() const { return str_charset; }
97
inline const CHARSET_INFO *charset() const { return str_charset; }
98
98
inline uint32_t length() const { return str_length;}
99
99
inline uint32_t alloced_length() const { return Alloced_length;}
100
100
inline char& operator [] (uint32_t i) const { return Ptr[i]; }
135
135
Alloced_length=0;
136
136
str_charset=str.str_charset;
138
inline void set(char *str,uint32_t arg_length, CHARSET_INFO *cs)
138
inline void set(char *str,uint32_t arg_length, const CHARSET_INFO * const cs)
141
141
Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0;
144
inline void set(const char *str,uint32_t arg_length, CHARSET_INFO *cs)
144
inline void set(const char *str,uint32_t arg_length, const CHARSET_INFO * const cs)
147
147
Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0;
150
150
bool set_ascii(const char *str, uint32_t arg_length);
151
inline void set_quick(char *str,uint32_t arg_length, CHARSET_INFO *cs)
151
inline void set_quick(char *str,uint32_t arg_length, const CHARSET_INFO * const cs)
159
bool set_int(int64_t num, bool unsigned_flag, CHARSET_INFO *cs);
160
bool set(int64_t num, CHARSET_INFO *cs)
159
bool set_int(int64_t num, bool unsigned_flag, const CHARSET_INFO * const cs);
160
bool set(int64_t num, const CHARSET_INFO * const cs)
161
161
{ return set_int(num, false, cs); }
162
bool set(uint64_t num, CHARSET_INFO *cs)
162
bool set(uint64_t num, const CHARSET_INFO * const cs)
163
163
{ return set_int((int64_t)num, true, cs); }
164
bool set_real(double num,uint decimals, CHARSET_INFO *cs);
164
bool set_real(double num,uint decimals, const CHARSET_INFO * const cs);
246
246
bool copy(); // Alloc string if not alloced
247
247
bool copy(const String &s); // Allocate new string
248
bool copy(const char *s,uint32_t arg_length, CHARSET_INFO *cs); // Allocate new string
248
bool copy(const char *s,uint32_t arg_length, const CHARSET_INFO * const cs); // Allocate new string
249
249
static bool needs_conversion(uint32_t arg_length,
250
CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
250
const CHARSET_INFO * const cs_from, const CHARSET_INFO * const cs_to,
251
251
uint32_t *offset);
252
252
bool copy_aligned(const char *s, uint32_t arg_length, uint32_t offset,
254
bool set_or_copy_aligned(const char *s, uint32_t arg_length, CHARSET_INFO *cs);
255
bool copy(const char*s,uint32_t arg_length, CHARSET_INFO *csfrom,
256
CHARSET_INFO *csto, uint *errors);
253
const CHARSET_INFO * const cs);
254
bool set_or_copy_aligned(const char *s, uint32_t arg_length, const CHARSET_INFO * const cs);
255
bool copy(const char*s,uint32_t arg_length, const CHARSET_INFO * const csfrom,
256
const CHARSET_INFO * const csto, uint *errors);
257
257
bool append(const String &s);
258
258
bool append(const char *s);
259
259
bool append(const char *s,uint32_t arg_length);
260
bool append(const char *s,uint32_t arg_length, CHARSET_INFO *cs);
260
bool append(const char *s,uint32_t arg_length, const CHARSET_INFO * const cs);
261
261
bool append(IO_CACHE* file, uint32_t arg_length);
262
262
bool append_with_prefill(const char *s, uint32_t arg_length,
263
263
uint32_t full_length, char fill_char);
282
282
bool fill(uint32_t max_length,char fill);
284
friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
284
friend int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
285
285
friend int stringcmp(const String *a,const String *b);
286
286
friend String *copy_if_not_alloced(String *a,String *b,uint32_t arg_length);
287
287
uint32_t numchars();
377
static inline bool check_if_only_end_space(CHARSET_INFO *cs, char *str,
377
static inline bool check_if_only_end_space(const CHARSET_INFO * const cs, char *str,
380
380
return str+ cs->cset->scan(cs, str, end, MY_SEQ_SPACES) == end;