~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.h

  • Committer: Monty Taylor
  • Date: 2009-04-14 19:16:51 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 994.
  • Revision ID: mordred@inaugust.com-20090414191651-ltbww6hpqks8k7qk
Clarified instructions in README.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "drizzled/field/str.h"
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
class Field_enum :public Field_str 
30
27
{
31
28
protected:
39
36
 
40
37
  /** Internal storage for the string values of the ENUM */
41
38
  TYPELIB *typelib;
42
 
  Field_enum(unsigned char *ptr_arg,
43
 
             uint32_t len_arg,
44
 
             unsigned char *null_ptr_arg,
 
39
  Field_enum(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
45
40
             unsigned char null_bit_arg,
46
 
             const char *field_name_arg,
 
41
             enum utype unireg_check_arg, const char *field_name_arg,
47
42
             uint32_t packlength_arg,
48
43
             TYPELIB *typelib_arg,
49
44
             const CHARSET_INFO * const charset_arg)
50
 
    :Field_str(ptr_arg,
51
 
               len_arg,
52
 
               null_ptr_arg,
53
 
               null_bit_arg,
54
 
                     field_name_arg,
55
 
               charset_arg),
56
 
    packlength(packlength_arg),
57
 
    typelib(typelib_arg)
 
45
    :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
 
46
               unireg_check_arg, field_name_arg, charset_arg),
 
47
    packlength(packlength_arg),typelib(typelib_arg)
58
48
  {
59
 
    flags|= ENUM_FLAG;
 
49
      flags|=ENUM_FLAG;
60
50
  }
61
 
  Field *new_field(memory::Root *root, Table *new_table, bool keep_type);
 
51
  Field *new_field(MEM_ROOT *root, Table *new_table, bool keep_type);
62
52
  enum ha_base_keytype key_type() const;
63
53
  int  store(const char *to, uint32_t length, const CHARSET_INFO * const);
64
54
  int  store(double nr);
99
89
  {
100
90
    return (field_metadata & 0x00ff);
101
91
  }
 
92
  uint32_t row_pack_length()
 
93
  { 
 
94
    return pack_length();
 
95
  }
102
96
  virtual bool zero_pack() const
103
97
  {
104
98
    return false;
113
107
  }
114
108
  /* enum and set are sorted as integers */
115
109
  const CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
 
110
private:
 
111
  int do_save_field_metadata(unsigned char *first_byte);
116
112
};
117
113
 
118
 
} /* namespace drizzled */
119
 
 
120
114
#endif /* DRIZZLED_FIELD_ENUM_H */