~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_strfunc.h

  • Committer: Monty Taylor
  • Date: 2008-11-07 04:45:58 UTC
  • mfrom: (574.3.4 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: monty@inaugust.com-20081107044558-2me2c70ksfr3qs9i
Merged from Lee (and from trunk by proxy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_ITEM_STRFUNC_H
21
21
#define DRIZZLED_ITEM_STRFUNC_H
22
22
 
23
 
/* This file defines all string functions */
24
 
 
25
 
 
26
 
class Item_str_func :public Item_func
27
 
{
28
 
public:
29
 
  Item_str_func() :Item_func() { decimals=NOT_FIXED_DEC; }
30
 
  Item_str_func(Item *a) :Item_func(a) {decimals=NOT_FIXED_DEC; }
31
 
  Item_str_func(Item *a,Item *b) :Item_func(a,b) { decimals=NOT_FIXED_DEC; }
32
 
  Item_str_func(Item *a,Item *b,Item *c) :Item_func(a,b,c) { decimals=NOT_FIXED_DEC; }
33
 
  Item_str_func(Item *a,Item *b,Item *c,Item *d) :Item_func(a,b,c,d) {decimals=NOT_FIXED_DEC; }
34
 
  Item_str_func(Item *a,Item *b,Item *c,Item *d, Item* e) :Item_func(a,b,c,d,e) {decimals=NOT_FIXED_DEC; }
35
 
  Item_str_func(List<Item> &list) :Item_func(list) {decimals=NOT_FIXED_DEC; }
36
 
  int64_t val_int();
37
 
  double val_real();
38
 
  my_decimal *val_decimal(my_decimal *);
39
 
  enum Item_result result_type () const { return STRING_RESULT; }
40
 
  void left_right_max_length();
41
 
  bool fix_fields(Session *session, Item **ref);
42
 
};
43
 
 
44
 
 
45
 
class Item_func_concat :public Item_str_func
46
 
{
47
 
  String tmp_value;
48
 
public:
49
 
  Item_func_concat(List<Item> &list) :Item_str_func(list) {}
50
 
  Item_func_concat(Item *a,Item *b) :Item_str_func(a,b) {}
51
 
  String *val_str(String *);
52
 
  void fix_length_and_dec();
53
 
  const char *func_name() const { return "concat"; }
54
 
};
55
 
 
56
 
class Item_func_concat_ws :public Item_str_func
57
 
{
58
 
  String tmp_value;
59
 
public:
60
 
  Item_func_concat_ws(List<Item> &list) :Item_str_func(list) {}
61
 
  String *val_str(String *);
62
 
  void fix_length_and_dec();
63
 
  const char *func_name() const { return "concat_ws"; }
64
 
  table_map not_null_tables() const { return 0; }
65
 
};
66
 
 
67
 
class Item_func_reverse :public Item_str_func
68
 
{
69
 
  String tmp_value;
70
 
public:
71
 
  Item_func_reverse(Item *a) :Item_str_func(a) {}
72
 
  String *val_str(String *);
73
 
  void fix_length_and_dec();
74
 
  const char *func_name() const { return "reverse"; }
75
 
};
76
 
 
77
 
 
78
 
class Item_func_replace :public Item_str_func
79
 
{
80
 
  String tmp_value,tmp_value2;
81
 
public:
82
 
  Item_func_replace(Item *org,Item *find,Item *replace)
83
 
    :Item_str_func(org,find,replace) {}
84
 
  String *val_str(String *);
85
 
  void fix_length_and_dec();
86
 
  const char *func_name() const { return "replace"; }
87
 
};
88
 
 
89
 
 
90
 
class Item_func_insert :public Item_str_func
91
 
{
92
 
  String tmp_value;
93
 
public:
94
 
  Item_func_insert(Item *org,Item *start,Item *length,Item *new_str)
95
 
    :Item_str_func(org,start,length,new_str) {}
96
 
  String *val_str(String *);
97
 
  void fix_length_and_dec();
98
 
  const char *func_name() const { return "insert"; }
99
 
};
100
 
 
101
 
 
102
 
class Item_str_conv :public Item_str_func
103
 
{
104
 
protected:
105
 
  uint32_t multiply;
106
 
  my_charset_conv_case converter;
107
 
  String tmp_value;
108
 
public:
109
 
  Item_str_conv(Item *item) :Item_str_func(item) {}
110
 
  String *val_str(String *);
111
 
};
112
 
 
113
 
 
114
 
class Item_func_lcase :public Item_str_conv
115
 
{
116
 
public:
117
 
  Item_func_lcase(Item *item) :Item_str_conv(item) {}
118
 
  const char *func_name() const { return "lcase"; }
119
 
  void fix_length_and_dec();
120
 
};
121
 
 
122
 
class Item_func_ucase :public Item_str_conv
123
 
{
124
 
public:
125
 
  Item_func_ucase(Item *item) :Item_str_conv(item) {}
126
 
  const char *func_name() const { return "ucase"; }
127
 
  void fix_length_and_dec();
128
 
};
129
 
 
130
 
 
131
 
class Item_func_left :public Item_str_func
132
 
{
133
 
  String tmp_value;
134
 
public:
135
 
  Item_func_left(Item *a,Item *b) :Item_str_func(a,b) {}
136
 
  String *val_str(String *);
137
 
  void fix_length_and_dec();
138
 
  const char *func_name() const { return "left"; }
139
 
};
140
 
 
141
 
 
142
 
class Item_func_right :public Item_str_func
143
 
{
144
 
  String tmp_value;
145
 
public:
146
 
  Item_func_right(Item *a,Item *b) :Item_str_func(a,b) {}
147
 
  String *val_str(String *);
148
 
  void fix_length_and_dec();
149
 
  const char *func_name() const { return "right"; }
150
 
};
151
 
 
 
23
#include <drizzled/functions/str/concat.h>
 
24
#include <drizzled/functions/str/conv.h>
 
25
#include <drizzled/functions/str/insert.h>
 
26
#include <drizzled/functions/str/left.h>
 
27
#include <drizzled/functions/str/replace.h>
 
28
#include <drizzled/functions/str/reverse.h>
 
29
#include <drizzled/functions/str/right.h>
152
30
 
153
31
class Item_func_substr :public Item_str_func
154
32
{