~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/time.h

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 19:11:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704191147-s99ojek811zi1fzj
Remove unused Name_resolution_context::error_reporter

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_TIME_H
22
 
#define DRIZZLED_FIELD_TIME_H
 
21
#pragma once
23
22
 
24
23
#include <drizzled/field/str.h>
25
24
 
26
 
namespace drizzled
27
 
{
28
 
 
29
 
class Time;
30
 
 
31
 
namespace field
32
 
{
33
 
 
34
 
class TableShare;
35
 
typedef struct charset_info_st CHARSET_INFO;
 
25
namespace drizzled {
 
26
namespace field {
36
27
 
37
28
class Time :public Field_str {
38
29
public:
40
31
                  uint32_t len_arg,
41
32
                  unsigned char *null_ptr_arg,
42
33
                  unsigned char null_bit_arg,
43
 
                  const char *field_name_arg,
44
 
                  const CHARSET_INFO * const cs);
 
34
                  const char *field_name_arg);
 
35
 
45
36
  Time(bool maybe_null_arg,
46
 
                  const char *field_name_arg,
47
 
                  const CHARSET_INFO * const cs);
 
37
                  const char *field_name_arg);
 
38
 
48
39
  enum_field_types type() const { return DRIZZLE_TYPE_TIMESTAMP;}
49
40
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_LONG_INT; }
50
41
  enum Item_result cmp_type () const { return INT_RESULT; }
51
42
  int  store(const char *to,uint32_t length,
52
 
             const CHARSET_INFO * const charset);
 
43
             const charset_info_st * const charset);
53
44
  int  store(double nr);
54
45
  int  store(int64_t nr, bool unsigned_val);
55
46
  int  reset(void) { ptr[0]= ptr[1]= ptr[2]= ptr[3]= 0; return 0; }
56
 
  double val_real(void);
57
 
  int64_t val_int(void);
58
 
  String *val_str(String*,String *);
 
47
  double val_real(void) const;
 
48
  int64_t val_int(void) const;
 
49
  String *val_str(String*,String *) const;
59
50
  int cmp(const unsigned char *,const unsigned char *);
60
51
  void sort_string(unsigned char *buff,uint32_t length);
61
52
  uint32_t pack_length() const { return 4; }
62
 
  void sql_type(String &str) const;
63
53
  bool can_be_compared_as_int64_t() const { return true; }
64
54
  bool zero_pack() const { return 0; }
65
55
 
66
56
  /* Get TIME field value as seconds since begging of Unix Epoch */
67
 
  long get_timestamp(bool *null_value);
 
57
  long get_timestamp(bool *null_value) const;
68
58
private:
69
 
  bool get_date(type::Time &ltime,uint32_t fuzzydate);
70
 
  bool get_time(type::Time &ltime);
 
59
  bool get_date(type::Time &ltime, uint32_t fuzzydate) const;
 
60
  bool get_time(type::Time &ltime) const;
71
61
 
72
62
public:
73
63
  timestamp_auto_set_type get_auto_set_type() const;
74
64
  static size_t max_string_length();
75
65
  void pack_time(drizzled::Time &arg);
76
 
  void unpack_time(drizzled::Time &arg);
77
 
  void unpack_time(int32_t &destination, const unsigned char *source);
 
66
  void unpack_time(drizzled::Time &arg) const;
 
67
  void unpack_time(int32_t &destination, const unsigned char *source) const;
78
68
};
79
69
 
80
70
} /* namespace field */
81
71
} /* namespace drizzled */
82
72
 
83
 
#endif /* DRIZZLED_FIELD_TIME_H */
84
73