~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.h

  • Committer: Mark Atwood
  • Date: 2010-06-24 03:15:21 UTC
  • mto: (1637.2.4 build)
  • mto: This revision was merged to the branch mainline in revision 1639.
  • Revision ID: me@mark.atwood.name-20100624031521-gafmppfbf5afm68w
new syslog module, with plugins for query log, error message, and SYSLOG() function

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_FIELD_ENUM_H
22
22
#define DRIZZLED_FIELD_ENUM_H
23
23
 
24
 
#include <drizzled/field/str.h>
 
24
#include "drizzled/field/str.h"
25
25
 
26
26
namespace drizzled
27
27
{
28
28
 
29
29
class Field_enum :public Field_str
30
30
{
 
31
protected:
 
32
  uint32_t packlength;
31
33
public:
32
34
 
33
35
  using Field::store;
44
46
             unsigned char *null_ptr_arg,
45
47
             unsigned char null_bit_arg,
46
48
             const char *field_name_arg,
 
49
             uint32_t packlength_arg,
47
50
             TYPELIB *typelib_arg,
48
51
             const CHARSET_INFO * const charset_arg)
49
52
    :Field_str(ptr_arg,
52
55
               null_bit_arg,
53
56
                     field_name_arg,
54
57
               charset_arg),
 
58
    packlength(packlength_arg),
55
59
    typelib(typelib_arg)
56
60
  {
57
61
    flags|= ENUM_FLAG;
58
62
  }
59
63
  Field *new_field(memory::Root *root, Table *new_table, bool keep_type);
60
 
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
 
64
  enum ha_base_keytype key_type() const;
61
65
  int  store(const char *to, uint32_t length, const CHARSET_INFO * const);
62
66
  int  store(double nr);
63
67
  int  store(int64_t nr, bool unsigned_val);
64
 
  double val_real(void) const;
65
 
  int64_t val_int(void) const;
66
 
  String *val_str(String*, String *) const;
 
68
  double val_real(void);
 
69
  int64_t val_int(void);
 
70
  String *val_str(String*, String *);
67
71
  int cmp(const unsigned char *, const unsigned char *);
68
72
  void sort_string(unsigned char *buff, uint32_t length);
69
73
  void store_type(uint64_t value);
81
85
  {
82
86
    return INT_RESULT;
83
87
  }
84
 
  uint32_t pack_length() const { return 4; }
 
88
  uint32_t pack_length() const
 
89
  {
 
90
    return (uint32_t) packlength;
 
91
  }
85
92
  uint32_t size_of() const
86
93
  {
87
94
    return sizeof(*this);