~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/str.h

Renamed namespace slot to namespace service.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_FIELD_STR_H
22
 
#define DRIZZLED_FIELD_STR_H
 
21
#ifndef DRIZZLE_SERVER_FIELD_STR
 
22
#define DRIZZLE_SERVER_FIELD_STR
23
23
 
24
24
#include <drizzled/field.h>
25
25
 
26
 
#include <drizzled/visibility.h>
27
 
 
28
 
namespace drizzled
29
 
{
30
 
 
31
26
typedef struct charset_info_st CHARSET_INFO;
32
27
 
33
28
/* base class for all string related classes */
34
29
 
35
 
class DRIZZLED_API Field_str :
36
 
  public Field
37
 
{
 
30
class Field_str :public Field {
38
31
protected:
39
32
  const CHARSET_INFO *field_charset;
40
33
  enum Derivation field_derivation;
41
34
  int  report_if_important_data(const char *ptr, const char *end);
42
35
public:
43
 
  Field_str(unsigned char *ptr_arg,
44
 
            uint32_t len_arg,
 
36
  Field_str(unsigned char *ptr_arg,uint32_t len_arg,
45
37
            unsigned char *null_ptr_arg,
46
 
            unsigned char null_bit_arg,
47
 
            const char *field_name_arg,
48
 
            const CHARSET_INFO * const charset);
 
38
            unsigned char null_bit_arg, utype unireg_check_arg,
 
39
            const char *field_name_arg, const CHARSET_INFO * const charset);
49
40
  Item_result result_type () const { return STRING_RESULT; }
50
41
  uint32_t decimals() const { return NOT_FIXED_DEC; }
51
42
 
52
43
  using Field::store;
53
44
  int  store(double nr);
54
45
  int  store(int64_t nr, bool unsigned_val)=0;
55
 
  int  store_decimal(const type::Decimal *);
 
46
  int  store_decimal(const my_decimal *);
56
47
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const cs)=0;
57
48
 
58
49
  uint32_t size_of() const { return sizeof(*this); }
65
56
  bool binary() const { return field_charset == &my_charset_bin; }
66
57
  uint32_t max_display_length() { return field_length; }
67
58
  friend class CreateField;
68
 
  type::Decimal *val_decimal(type::Decimal *) const;
 
59
  my_decimal *val_decimal(my_decimal *);
69
60
  virtual bool str_needs_quotes() { return true; }
 
61
  bool compare_str_field_flags(CreateField *new_field, uint32_t flags);
 
62
  uint32_t is_equal(CreateField *new_field);
70
63
  uint32_t max_data_length() const;
71
64
};
72
65
 
103
96
                             const CHARSET_INFO * const cs);
104
97
 
105
98
 
106
 
} /* namespace drizzled */
107
 
 
108
 
#endif /* DRIZZLED_FIELD_STR_H */
 
99
#endif