~drizzle-trunk/drizzle/development

« back to all changes in this revision

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