~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/now.h

  • Committer: Monty Taylor
  • Date: 2011-03-10 18:09:05 UTC
  • mfrom: (2225.2.2 refactor)
  • mto: This revision was merged to the branch mainline in revision 2228.
  • Revision ID: mordred@inaugust.com-20110310180905-ttx05t7q7ff6nl7c
Merge Olad: Refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <drizzled/function/time/date.h>
24
24
 
25
 
#include "drizzled/temporal.h"
 
25
#include <drizzled/temporal.h>
26
26
 
27
27
namespace drizzled
28
28
{
33
33
{
34
34
protected:
35
35
  int64_t value;
36
 
  char buff[20*2+32];   // +32 to make my_snprintf_{8bit|ucs2} happy
 
36
  char buff[type::Time::MAX_STRING_LENGTH];
37
37
  uint32_t buff_length;
38
 
  DRIZZLE_TIME ltime;
 
38
  type::Time ltime;
39
39
  DateTime cached_temporal;
 
40
 
40
41
public:
41
42
  Item_func_now() :Item_date_func() {}
42
43
  Item_func_now(Item *a) :Item_date_func(a) {}
55
56
   * @param Reference to a DateTime to populate
56
57
   */
57
58
  bool get_temporal(DateTime &temporal);
58
 
  bool get_date(DRIZZLE_TIME *res, uint32_t fuzzy_date);
59
 
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time)=0;
 
59
  bool get_date(type::Time &res, uint32_t fuzzy_date);
 
60
  virtual void store_now_in_TIME(type::Time &now_time)=0;
60
61
};
61
62
 
62
63
class Item_func_now_local :public Item_func_now
65
66
  Item_func_now_local() :Item_func_now() {}
66
67
  Item_func_now_local(Item *a) :Item_func_now(a) {}
67
68
  const char *func_name() const { return "now"; }
68
 
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time);
 
69
  virtual void store_now_in_TIME(type::Time &now_time);
69
70
  virtual enum Functype functype() const { return NOW_FUNC; }
70
71
};
71
72
 
76
77
  Item_func_now_utc() :Item_func_now() {}
77
78
  Item_func_now_utc(Item *a) :Item_func_now(a) {}
78
79
  const char *func_name() const { return "utc_timestamp"; }
79
 
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time);
 
80
  virtual void store_now_in_TIME(type::Time &now_time);
80
81
};
81
82
 
82
83
} /* namespace drizzled */