~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.cc

  • Committer: Brian Aker
  • Date: 2009-03-05 16:38:18 UTC
  • Revision ID: brian@tangent.org-20090305163818-7w2vj1jrxti8d87e
Remove dead string class bits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
350
350
}
351
351
 
352
352
 
353
 
bool String::append(IO_CACHE* file, uint32_t arg_length)
354
 
{
355
 
  if (realloc(str_length+arg_length))
356
 
    return true;
357
 
  if (my_b_read(file, (unsigned char*) Ptr + str_length, arg_length))
358
 
  {
359
 
    shrink(str_length);
360
 
    return true;
361
 
  }
362
 
  str_length+=arg_length;
363
 
  return false;
364
 
}
365
 
 
366
353
bool String::append_with_prefill(const char *s,uint32_t arg_length,
367
354
                 uint32_t full_length, char fill_char)
368
355
{
491
478
}
492
479
 
493
480
 
494
 
// added by Holyfoot for "geometry" needs
495
 
int String::reserve(uint32_t space_needed, uint32_t grow_by)
496
 
{
497
 
  if (Alloced_length < str_length + space_needed)
498
 
  {
499
 
    if (realloc(Alloced_length + cmax(space_needed, grow_by) - 1))
500
 
      return true;
501
 
  }
502
 
  return false;
503
 
}
504
 
 
505
 
void String::qs_append(const char *str, uint32_t len)
506
 
{
507
 
  memcpy(Ptr + str_length, str, len + 1);
508
 
  str_length += len;
509
 
}
510
 
 
511
 
void String::qs_append(double d)
512
 
{
513
 
  char *buff = Ptr + str_length;
514
 
  str_length+= my_gcvt(d, MY_GCVT_ARG_DOUBLE, FLOATING_POINT_BUFFER - 1, buff, NULL);
515
 
}
516
 
 
517
 
void String::qs_append(double *d)
518
 
{
519
 
  double ld;
520
 
  float8get(ld, (char*) d);
521
 
  qs_append(ld);
522
 
}
523
 
 
524
 
void String::qs_append(int i)
525
 
{
526
 
  char *buff= Ptr + str_length;
527
 
  char *end= int10_to_str(i, buff, -10);
528
 
  str_length+= (int) (end-buff);
529
 
}
530
 
 
531
 
void String::qs_append(uint32_t i)
532
 
{
533
 
  char *buff= Ptr + str_length;
534
 
  char *end= int10_to_str(i, buff, 10);
535
 
  str_length+= (int) (end-buff);
536
 
}
537
481
 
538
482
/*
539
483
  Compare strings according to collation, without end space.