~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2009-12-25 08:50:15 UTC
  • mto: This revision was merged to the branch mainline in revision 1255.
  • Revision ID: mordred@inaugust.com-20091225085015-83sux5qsvy312gew
MEM_ROOT == memory::Root

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
23
23
#include "drizzled/function/time/date.h"
24
24
#include "drizzled/temporal.h"
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
/* Abstract CURDATE function. See also Item_func_curtime. */
30
27
class Item_func_curdate :public Item_date
31
28
{
32
29
protected:
33
 
  type::Time ltime;
34
 
  Date cached_temporal;
 
30
  DRIZZLE_TIME ltime;
 
31
  drizzled::Date cached_temporal;
35
32
public:
36
33
  Item_func_curdate() :Item_date() {}
37
34
  void fix_length_and_dec();
38
35
  /**
39
36
   * All functions which inherit from Item_date must implement
40
37
   * their own get_temporal() method, which takes a supplied
41
 
   * Date reference and populates it with a correct
 
38
   * drizzled::Date reference and populates it with a correct
42
39
   * date based on the semantics of the function.
43
40
   *
44
41
   * For CURDATE() and sisters, there is no argument, and we 
47
44
   * Always returns true, since a Date can always be constructed
48
45
   * from a time_t
49
46
   *
50
 
   * @param Reference to a Date to populate
 
47
   * @param Reference to a drizzled::Date to populate
51
48
   */
52
 
  bool get_temporal(Date &temporal);
53
 
  virtual void store_now_in_TIME(type::Time *now_time)=0;
 
49
  bool get_temporal(drizzled::Date &temporal);
 
50
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time)=0;
54
51
};
55
52
 
56
53
class Item_func_curdate_local :public Item_func_curdate
58
55
public:
59
56
  Item_func_curdate_local() :Item_func_curdate() {}
60
57
  const char *func_name() const { return "curdate"; }
61
 
  void store_now_in_TIME(type::Time *now_time);
 
58
  void store_now_in_TIME(DRIZZLE_TIME *now_time);
62
59
};
63
60
 
64
61
class Item_func_curdate_utc :public Item_func_curdate
66
63
public:
67
64
  Item_func_curdate_utc() :Item_func_curdate() {}
68
65
  const char *func_name() const { return "utc_date"; }
69
 
  void store_now_in_TIME(type::Time *now_time);
 
66
  void store_now_in_TIME(DRIZZLE_TIME *now_time);
70
67
};
71
68
 
72
 
} /* namespace drizzled */
73
 
 
74
69
#endif /* DRIZZLED_FUNCTION_TIME_CURDATE_H */