~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/tztime.h

  • Committer: Monty Taylor
  • Date: 2009-03-25 21:06:47 UTC
  • mto: This revision was merged to the branch mainline in revision 964.
  • Revision ID: mordred@inaugust.com-20090325210647-7j1tm98gvct3jxsu
Removed legacy_db_type.

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
 
#ifdef USE_PRAGMA_INTERFACE
22
 
#pragma interface                       /* gcc class interface */
23
 
#endif
24
21
 
25
22
/**
26
 
  This class represents abstract time zone and provides 
27
 
  basic interface for DRIZZLE_TIME <-> my_time_t conversion.
28
 
  Actual time zones which are specified by DB, or via offset 
 
23
  This class represents abstract time zone and provides
 
24
  basic interface for DRIZZLE_TIME <-> time_t conversion.
 
25
  Actual time zones which are specified by DB, or via offset
29
26
  or use system functions are its descendants.
30
27
*/
31
 
class Time_zone: public Sql_alloc 
 
28
class Time_zone: public Sql_alloc
32
29
{
33
30
public:
34
31
  Time_zone() {}                              /* Remove gcc warning */
35
32
  /**
36
 
    Converts local time in broken down DRIZZLE_TIME representation to 
37
 
    my_time_t (UTC seconds since Epoch) represenation.
 
33
    Converts local time in broken down DRIZZLE_TIME representation to
 
34
    time_t (UTC seconds since Epoch) represenation.
38
35
    Returns 0 in case of error. Sets in_dst_time_gap to true if date provided
39
36
    falls into spring time-gap (or lefts it untouched otherwise).
40
37
  */
41
 
  virtual my_time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t, 
 
38
  virtual time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
42
39
                                    bool *in_dst_time_gap) const = 0;
43
40
  /**
44
 
    Converts time in my_time_t representation to local time in
 
41
    Converts time in time_t representation to local time in
45
42
    broken down DRIZZLE_TIME representation.
46
43
  */
47
 
  virtual void   gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const = 0;
 
44
  virtual void   gmt_sec_to_TIME(DRIZZLE_TIME *tmp, time_t t) const = 0;
48
45
  /**
49
 
    Because of constness of String returned by get_name() time zone name 
 
46
    Because of constness of String returned by get_name() time zone name
50
47
    have to be already zeroended to be able to use String::ptr() instead
51
48
    of c_ptr().
52
49
  */
53
50
  virtual const String * get_name() const = 0;
54
51
 
55
 
  /** 
 
52
  /**
56
53
    We need this only for surpressing warnings, objects of this type are
57
54
    allocated on MEM_ROOT and should not require destruction.
58
55
  */
62
59
extern Time_zone * my_tz_UTC;
63
60
extern Time_zone * my_tz_SYSTEM;
64
61
extern Time_zone * my_tz_OFFSET0;
65
 
extern Time_zone * my_tz_find(THD *thd, const String *name);
66
 
extern bool     my_tz_init(THD *org_thd, const char *default_tzname, bool bootstrap);
 
62
extern Time_zone * my_tz_find(Session *session, const String *name);
 
63
extern bool     my_tz_init(Session *org_session, const char *default_tzname);
67
64
extern void        my_tz_free();
68
 
extern my_time_t   sec_since_epoch_TIME(DRIZZLE_TIME *t);
 
65
extern time_t   sec_since_epoch_TIME(DRIZZLE_TIME *t);