~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/int64.h

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

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_INT64_H
22
 
#define DRIZZLED_FIELD_INT64_H
 
21
#pragma once
23
22
 
24
23
#include <drizzled/field/num.h>
25
24
 
56
55
  Int64(uint32_t len_arg,bool maybe_null_arg,
57
56
        const char *field_name_arg,
58
57
        bool unsigned_arg) :
59
 
    Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
60
 
              NONE, field_name_arg,0,0,unsigned_arg)
 
58
    Field_num((unsigned char*) 0,
 
59
              len_arg, maybe_null_arg ? (unsigned char*) "": 0,
 
60
              0,
 
61
              NONE,
 
62
              field_name_arg,
 
63
              0,
 
64
              0,
 
65
              unsigned_arg)
61
66
    {
 
67
      assert(not unsigned_arg);
62
68
    }
63
69
 
64
70
  enum Item_result result_type () const { return INT_RESULT; }
65
71
  enum_field_types type() const { return DRIZZLE_TYPE_LONGLONG;}
66
72
  enum ha_base_keytype key_type() const
67
73
  { return unsigned_flag ? HA_KEYTYPE_ULONGLONG : HA_KEYTYPE_LONGLONG; }
68
 
  int store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
 
74
  int store(const char *to,uint32_t length, const charset_info_st * const charset);
69
75
  int store(double nr);
70
76
  int store(int64_t nr, bool unsigned_val);
71
77
  int reset(void)
73
79
    ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
74
80
    return 0;
75
81
  }
76
 
  double val_real(void);
77
 
  int64_t val_int(void);
78
 
  String *val_str(String*,String *);
 
82
  double val_real(void) const;
 
83
  int64_t val_int(void) const;
 
84
  String *val_str(String*,String *) const;
79
85
  int cmp(const unsigned char *,const unsigned char *);
80
86
  void sort_string(unsigned char *buff,uint32_t length);
81
87
  uint32_t pack_length() const { return 8; }
82
88
  void sql_type(String &str) const;
83
89
  bool can_be_compared_as_int64_t() const { return true; }
84
 
  uint32_t max_display_length() { return 20; }
 
90
  uint32_t max_display_length() { return MY_INT64_NUM_DECIMAL_DIGITS; }
85
91
  virtual unsigned char *pack(unsigned char* to, const unsigned char *from,
86
92
                              uint32_t max_length,
87
93
                              bool low_byte_first);
95
101
} /* namespace field */
96
102
} /* namespace drizzled */
97
103
 
98
 
#endif /* DRIZZLED_FIELD_INT64_H */