~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/date.h

  • Committer: Stewart Smith
  • Date: 2009-10-08 05:39:17 UTC
  • mto: This revision was merged to the branch mainline in revision 1179.
  • Revision ID: stewart@flamingspork.com-20091008053917-b7u3opyo8997438r
remove unused find_string_in_array

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_DATE_H
22
 
#define DRIZZLED_FIELD_DATE_H
 
21
#ifndef DRIZZLE_SERVER_FIELD_DATE
 
22
#define DRIZZLE_SERVER_FIELD_DATE
23
23
 
24
24
#include <drizzled/field/str.h>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
class Field_date :public Field_str {
30
27
public:
31
28
 
58
55
  {}
59
56
  enum_field_types type() const { return DRIZZLE_TYPE_DATE;}
60
57
  enum_field_types real_type() const { return DRIZZLE_TYPE_DATE; }
61
 
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
 
58
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
62
59
  enum Item_result cmp_type () const { return INT_RESULT; }
63
60
  int  store(const char *to,uint32_t length,
64
61
             const CHARSET_INFO * const charset);
65
62
  int  store(double nr);
66
63
  int  store(int64_t nr, bool unsigned_val);
67
 
  int store_time(type::Time &ltime, type::timestamp_t type);
68
 
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
 
64
  int store_time(DRIZZLE_TIME *ltime, enum enum_drizzle_timestamp_type type);
 
65
  int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; }
69
66
  double val_real(void);
70
67
  int64_t val_int(void);
71
68
  String *val_str(String*,String *);
72
69
  int cmp(const unsigned char *,const unsigned char *);
73
70
  void sort_string(unsigned char *buff,uint32_t length);
74
 
  uint32_t pack_length() const { return 4; }
 
71
  uint32_t pack_length() const { return 3; }
75
72
  void sql_type(String &str) const;
76
73
  bool can_be_compared_as_int64_t() const { return true; }
77
74
  bool zero_pack() const { return 1; }
78
 
  bool get_date(type::Time &ltime,uint32_t fuzzydate);
79
 
  bool get_time(type::Time &ltime);
 
75
  bool get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
 
76
  bool get_time(DRIZZLE_TIME *ltime);
80
77
};
81
78
 
82
 
} /* namespace drizzled */
 
79
#endif
83
80
 
84
 
#endif /* DRIZZLED_FIELD_DATE_H */