~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/str.h

  • Committer: Brian Aker
  • Date: 2009-01-08 22:38:15 UTC
  • Revision ID: brian@tangent.org-20090108223815-i7p6uaajqxapge8a
func_timestamp now working.

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
 
namespace drizzled
27
 
{
28
 
 
29
26
typedef struct charset_info_st CHARSET_INFO;
30
27
 
31
28
/* base class for all string related classes */
34
31
protected:
35
32
  const CHARSET_INFO *field_charset;
36
33
  enum Derivation field_derivation;
37
 
  int  report_if_important_data(const char *ptr, const char *end);
38
34
public:
39
 
  Field_str(unsigned char *ptr_arg,
40
 
            uint32_t len_arg,
 
35
  Field_str(unsigned char *ptr_arg,uint32_t len_arg,
41
36
            unsigned char *null_ptr_arg,
42
 
            unsigned char null_bit_arg,
43
 
            const char *field_name_arg,
44
 
            const CHARSET_INFO * const charset);
 
37
            unsigned char null_bit_arg, utype unireg_check_arg,
 
38
            const char *field_name_arg, const CHARSET_INFO * const charset);
45
39
  Item_result result_type () const { return STRING_RESULT; }
46
40
  uint32_t decimals() const { return NOT_FIXED_DEC; }
47
 
 
48
 
  using Field::store;
49
41
  int  store(double nr);
50
42
  int  store(int64_t nr, bool unsigned_val)=0;
51
43
  int  store_decimal(const my_decimal *);
52
44
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const cs)=0;
53
 
 
54
45
  uint32_t size_of() const { return sizeof(*this); }
55
46
  const CHARSET_INFO *charset(void) const { return field_charset; }
56
47
  void set_charset(const CHARSET_INFO * const charset_arg)
60
51
  { field_derivation= derivation_arg; }
61
52
  bool binary() const { return field_charset == &my_charset_bin; }
62
53
  uint32_t max_display_length() { return field_length; }
63
 
  friend class CreateField;
 
54
  friend class Create_field;
64
55
  my_decimal *val_decimal(my_decimal *);
65
56
  virtual bool str_needs_quotes() { return true; }
66
 
  uint32_t max_data_length() const;
 
57
  bool compare_str_field_flags(Create_field *new_field, uint32_t flags);
 
58
  uint32_t is_equal(Create_field *new_field);
67
59
};
68
60
 
69
61
/*
99
91
                             const CHARSET_INFO * const cs);
100
92
 
101
93
 
102
 
} /* namespace drizzled */
103
 
 
104
 
#endif /* DRIZZLED_FIELD_STR_H */
 
94
#endif