~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_strfunc.h

  • Committer: Brian Aker
  • Date: 2008-11-07 23:16:58 UTC
  • mfrom: (575.1.14 devel)
  • Revision ID: brian@tangent.org-20081107231658-fboahr524d1or2ya
Merge from Monty.

Show diffs side-by-side

added added

removed removed

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