~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.h

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
class String
52
52
{
53
 
  char *Ptr;
 
53
  const char *Ptr;
54
54
  uint32_t str_length,Alloced_length;
55
55
  bool alloced;
56
56
  const CHARSET_INFO *str_charset;
57
57
public:
58
 
  String()
59
 
  { 
60
 
    Ptr=0; str_length=Alloced_length=0; alloced=0; 
61
 
    str_charset= &my_charset_bin; 
62
 
  }
63
 
  String(uint32_t length_arg)
64
 
  { 
65
 
    alloced=0; Alloced_length=0; (void) real_alloc(length_arg); 
66
 
    str_charset= &my_charset_bin;
67
 
  }
68
 
  String(const char *str, const CHARSET_INFO * const cs)
69
 
  { 
70
 
    Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0;
71
 
    str_charset=cs;
72
 
  }
73
 
  String(const char *str,uint32_t len, const CHARSET_INFO * const cs)
74
 
  { 
75
 
    Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0;
76
 
    str_charset=cs;
77
 
  }
78
 
  String(char *str,uint32_t len, const CHARSET_INFO * const cs)
79
 
  { 
80
 
    Ptr=(char*) str; Alloced_length=str_length=len; alloced=0;
81
 
    str_charset=cs;
82
 
  }
 
58
  String() :
 
59
    Ptr(NULL), str_length(0), Alloced_length(0),
 
60
    alloced(false), str_charset(&my_charset_bin)
 
61
  {}
 
62
 
 
63
  String(uint32_t length_arg) :
 
64
    Ptr(NULL), str_length(0), Alloced_length(0),
 
65
    alloced(false), str_charset(&my_charset_bin)
 
66
  {
 
67
    (void) real_alloc(length_arg);
 
68
  }
 
69
 
 
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)
 
73
  {
 
74
    str_length= strlen(str);
 
75
  }
 
76
 
 
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)
 
80
  {
 
81
  }
 
82
 
83
83
  String(const String &str)
84
 
  { 
 
84
    str_length(str.Ptr), Alloced_length(0), alloced(false),
 
85
    Ptr(str), str_charset(cs)
 
86
  {
85
87
    Ptr=str.Ptr ; str_length=str.str_length ;
86
 
    Alloced_length=str.Alloced_length; alloced=0; 
 
88
    Alloced_length=str.Alloced_length; alloced=0;
87
89
    str_charset=str.str_charset;
88
90
  }
89
91
  static void *operator new(size_t size, MEM_ROOT *mem_root)