~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.cc

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
269
269
  copy(str, arg_length, str_charset);
270
270
}
271
271
 
272
 
void String::append(const String &s)
273
 
{
274
 
  if (s.length())
275
 
  {
276
 
    realloc(str_length+s.length());
277
 
    memcpy(Ptr+str_length,s.ptr(),s.length());
278
 
    str_length+=s.length();
279
 
  }
280
 
}
281
 
 
282
272
 
283
273
/*
284
274
  Append an ASCII string to the a string of the current character set
292
282
  /*
293
283
    For an ASCII compatinble string we can just append.
294
284
  */
295
 
  realloc(str_length+arg_length);
296
 
  memcpy(Ptr +str_length, s, arg_length);
297
 
  str_length+=arg_length;
 
285
  realloc(str_length + arg_length);
 
286
  memcpy(Ptr + str_length, s, arg_length);
 
287
  str_length+= arg_length;
298
288
}
299
289
 
300
 
 
301
290
/*
302
291
  Append a 0-terminated ASCII string
303
292
*/
307
296
  append(s, strlen(s));
308
297
}
309
298
 
 
299
void String::append(str_ref s)
 
300
{
 
301
  append(s.data(), s.size());
 
302
}
 
303
 
310
304
void String::append_with_prefill(const char *s,size_t arg_length, size_t full_length, char fill_char)
311
305
{
312
306
  int t_length= arg_length > full_length ? arg_length : full_length;