~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/int32.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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_LONG_H
22
 
#define DRIZZLED_FIELD_LONG_H
 
21
#ifndef DRIZZLED_FIELD_INT32_H
 
22
#define DRIZZLED_FIELD_INT32_H
23
23
 
24
24
#include <drizzled/field/num.h>
25
25
 
26
26
namespace drizzled
27
27
{
28
28
 
29
 
class Field_long :public Field_num {
 
29
namespace field
 
30
{
 
31
 
 
32
class Int32 :public Field_num {
30
33
public:
31
34
 
32
35
  using Field::val_int;
36
39
  using Field::store;
37
40
  using Field::unpack;
38
41
 
39
 
  Field_long(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
40
 
             unsigned char null_bit_arg,
41
 
             enum utype unireg_check_arg, const char *field_name_arg,
42
 
             bool zero_arg, bool unsigned_arg)
43
 
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
44
 
               unireg_check_arg, field_name_arg,
45
 
               0, zero_arg,unsigned_arg)
46
 
    {}
47
 
  Field_long(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
48
 
             bool unsigned_arg)
49
 
    :Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
50
 
               NONE, field_name_arg,0,0,unsigned_arg)
51
 
    {}
 
42
  Int32(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
 
43
        unsigned char null_bit_arg,
 
44
        enum utype unireg_check_arg,
 
45
        const char *field_name_arg) :
 
46
    Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
 
47
              unireg_check_arg, field_name_arg,
 
48
              0, false, false)
 
49
  {}
 
50
 
 
51
  Int32(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
 
52
        bool unsigned_arg) :
 
53
    Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
 
54
              NONE, field_name_arg,0,0,unsigned_arg)
 
55
    {}
 
56
 
52
57
  enum Item_result result_type () const { return INT_RESULT; }
53
58
  enum_field_types type() const { return DRIZZLE_TYPE_LONG;}
54
59
  enum ha_base_keytype key_type() const
55
 
    { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
 
60
  { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
56
61
  int store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
57
62
  int store(double nr);
58
63
  int store(int64_t nr, bool unsigned_val);
66
71
  void sql_type(String &str) const;
67
72
  uint32_t max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; }
68
73
  virtual unsigned char *pack(unsigned char* to, const unsigned char *from,
69
 
                      uint32_t max_length,
70
 
                      bool low_byte_first);
 
74
                              uint32_t max_length,
 
75
                              bool low_byte_first);
71
76
 
72
77
  virtual const unsigned char *unpack(unsigned char* to, const unsigned char *from,
73
 
                              uint32_t param_data,
74
 
                              bool low_byte_first);
 
78
                                      uint32_t param_data,
 
79
                                      bool low_byte_first);
75
80
};
76
81
 
 
82
} /* namespace field */
77
83
} /* namespace drizzled */
78
84
 
79
 
#endif /* DRIZZLED_FIELD_LONG_H */
 
85
#endif /* DRIZZLED_FIELD_INT32_H */
80
86