23
23
/* This file is originally from the mysql distribution. Coded by monty */
25
#ifdef USE_PRAGMA_INTERFACE
26
#pragma interface /* gcc class implementation */
26
29
#ifndef NOT_FIXED_DEC
27
30
#define NOT_FIXED_DEC 31
30
33
#include <libdrizzle/drizzle_com.h>
31
#include <mysys/iocache.h>
34
36
int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
35
37
String *copy_if_not_alloced(String *a,String *b,uint32_t arg_length);
36
38
uint32_t copy_and_convert(char *to, uint32_t to_length, const CHARSET_INFO * const to_cs,
37
39
const char *from, uint32_t from_length,
38
const CHARSET_INFO * const from_cs, uint32_t *errors);
40
const CHARSET_INFO * const from_cs, uint *errors);
39
41
uint32_t well_formed_copy_nchars(const CHARSET_INFO * const to_cs,
40
char *to, uint32_t to_length,
42
char *to, uint to_length,
41
43
const CHARSET_INFO * const from_cs,
42
const char *from, uint32_t from_length,
44
const char *from, uint from_length,
44
46
const char **well_formed_error_pos,
45
47
const char **cannot_convert_error_pos,
46
48
const char **from_end_pos);
54
56
uint32_t str_length,Alloced_length;
56
58
const CHARSET_INFO *str_charset;
59
Ptr(NULL), str_length(0), Alloced_length(0),
60
alloced(false), str_charset(&my_charset_bin)
63
String(uint32_t length_arg) :
64
Ptr(NULL), str_length(0), Alloced_length(0),
65
alloced(false), str_charset(&my_charset_bin)
67
(void) real_alloc(length_arg);
70
String(const char *str, const CHARSET_INFO * const cs) :
71
Ptr(str), str_length(0), Alloced_length(0),
72
alloced(false), str_charset(cs)
74
str_length= strlen(str);
77
String(const char *str,uint32_t len, const CHARSET_INFO * const cs) :
78
str_length(len), Alloced_length(0), alloced(false),
79
Ptr(str), str_charset(cs)
62
Ptr=0; str_length=Alloced_length=0; alloced=0;
63
str_charset= &my_charset_bin;
65
String(uint32_t length_arg)
67
alloced=0; Alloced_length=0; (void) real_alloc(length_arg);
68
str_charset= &my_charset_bin;
70
String(const char *str, const CHARSET_INFO * const cs)
72
Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0;
75
String(const char *str,uint32_t len, const CHARSET_INFO * const cs)
77
Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0;
80
String(char *str,uint32_t len, const CHARSET_INFO * const cs)
82
Ptr=(char*) str; Alloced_length=str_length=len; alloced=0;
83
85
String(const String &str)
84
str_length(str.Ptr), Alloced_length(0), alloced(false),
85
Ptr(str), str_charset(cs)
87
87
Ptr=str.Ptr ; str_length=str.str_length ;
88
Alloced_length=str.Alloced_length; alloced=0;
88
Alloced_length=str.Alloced_length; alloced=0;
89
89
str_charset=str.str_charset;
91
91
static void *operator new(size_t size, MEM_ROOT *mem_root)
167
167
{ return set_int(num, false, cs); }
168
168
bool set(uint64_t num, const CHARSET_INFO * const cs)
169
169
{ return set_int((int64_t)num, true, cs); }
170
bool set_real(double num,uint32_t decimals, const CHARSET_INFO * const cs);
170
bool set_real(double num,uint decimals, const CHARSET_INFO * const cs);
259
259
const CHARSET_INFO * const cs);
260
260
bool set_or_copy_aligned(const char *s, uint32_t arg_length, const CHARSET_INFO * const cs);
261
261
bool copy(const char*s,uint32_t arg_length, const CHARSET_INFO * const csfrom,
262
const CHARSET_INFO * const csto, uint32_t *errors);
262
const CHARSET_INFO * const csto, uint *errors);
263
263
bool append(const String &s);
264
264
bool append(const char *s);
265
265
bool append(const char *s,uint32_t arg_length);