~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/epoch.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_EPOCH_H
22
 
#define DRIZZLED_FIELD_EPOCH_H
 
21
#pragma once
23
22
 
24
23
#include <drizzled/field/str.h>
25
24
 
26
 
namespace drizzled
27
 
{
28
 
 
29
 
namespace field
30
 
{
31
 
 
32
 
class TableShare;
33
 
typedef struct charset_info_st CHARSET_INFO;
 
25
namespace drizzled {
 
26
namespace field {
34
27
 
35
28
class Epoch :public Field_str {
36
29
public:
52
45
  enum Item_result cmp_type () const { return INT_RESULT; }
53
46
 
54
47
  int store(const char *to,uint32_t length,
55
 
            const CHARSET_INFO * const charset);
 
48
            const charset_info_st * const charset);
56
49
  int store(double nr);
57
50
  int store(int64_t nr, bool unsigned_val);
58
51
  int store_decimal(const type::Decimal *value);
59
52
 
60
53
  int  reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; return 0; }
61
 
  double val_real(void);
62
 
  int64_t val_int(void);
63
 
  String *val_str(String*,String *);
 
54
  double val_real(void) const;
 
55
  int64_t val_int(void) const;
 
56
  String *val_str(String*,String *) const;
64
57
  int cmp(const unsigned char *,const unsigned char *);
65
58
  void sort_string(unsigned char *buff,uint32_t length);
66
59
  uint32_t pack_length() const { return 8; }
67
 
  virtual void sql_type(String &str) const;
68
60
  virtual bool can_be_compared_as_int64_t() const { return true; }
69
61
  bool zero_pack() const { return 0; }
70
62
  virtual void set_time();
71
63
  virtual void set_default();
72
64
 
73
65
  /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */
74
 
  virtual long get_timestamp(bool *null_value);
 
66
  virtual long get_timestamp(bool *null_value) const;
75
67
 
76
68
  virtual bool is_timestamp() const
77
69
  {
79
71
  }
80
72
 
81
73
private:
82
 
  bool get_date(type::Time &ltime,uint32_t fuzzydate);
83
 
  bool get_time(type::Time &ltime);
 
74
  bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
 
75
  bool get_time(type::Time &ltime) const;
84
76
 
85
77
public:
86
78
  virtual timestamp_auto_set_type get_auto_set_type() const;
90
82
} /* namespace field */
91
83
} /* namespace drizzled */
92
84
 
93
 
#endif /* DRIZZLED_FIELD_EPOCH_H */
94
85