148
if ((new_ptr= (char*) ::realloc(Ptr,len)))
154
return true; // Signal error
146
new_ptr= (char*) ::realloc(Ptr,len);
156
else if ((new_ptr= (char*) malloc(len)))
152
new_ptr= (char*) malloc(len);
158
153
if (str_length) // Avoid bugs in memcpy on AIX
159
memcpy(new_ptr,Ptr,str_length);
154
memcpy(new_ptr,Ptr,str_length);
160
155
new_ptr[str_length]=0;
162
157
Alloced_length=len;
166
return true; // Signal error
168
161
Ptr[alloc_length]=0; // This make other funcs shorter
162
return false; // return void
172
165
bool String::set_int(int64_t num, bool unsigned_flag, const charset_info_st * const cs)
785
778
append("e_char, 1, system_charset_info);
790
Exchange state of this object and argument.
796
Target string will contain state of this object and vice versa.
799
void String::swap(String &s)
801
std::swap(Ptr, s.Ptr);
802
std::swap(str_length, s.str_length);
803
std::swap(Alloced_length, s.Alloced_length);
804
std::swap(alloced, s.alloced);
805
std::swap(str_charset, s.str_charset);
808
void String::q_append(const size_t n)
810
int8store(Ptr + str_length, n);
813
void String::q_append(double d)
815
float8store(Ptr + str_length, d);
818
void String::q_append(double *d)
820
float8store(Ptr + str_length, *d);
823
void String::q_append(const char *data, size_t data_len)
825
memcpy(Ptr + str_length, data, data_len);
826
str_length += data_len;
829
void String::write_at_position(int position, size_t value)
831
int8store(Ptr + position,value);
833
781
bool check_if_only_end_space(const charset_info_st * const cs, char *str,