~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/tztime.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-11-28 22:02:19 UTC
  • mfrom: (1228 push)
  • mto: (1228.4.1 push)
  • mto: This revision was merged to the branch mainline in revision 1234.
  • Revision ID: osullivan.padraig@gmail.com-20091128220219-m3x28m8q2unbirke
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_TZTIME_H
22
22
#define DRIZZLED_TZTIME_H
23
23
 
24
 
#if TIME_WITH_SYS_TIME
25
 
# include <sys/time.h>
26
 
# include <time.h>
27
 
#else
28
 
# if HAVE_SYS_TIME_H
29
 
#  include <sys/time.h>
30
 
# else
31
 
#  include <time.h>
32
 
# endif
33
 
#endif
34
 
 
35
 
#include "drizzled/memory/sql_alloc.h"
36
 
 
37
 
namespace drizzled
38
 
{
39
 
 
40
 
class String;
41
 
typedef struct st_drizzle_time DRIZZLE_TIME;
42
 
 
43
24
/**
44
25
  This class represents abstract time zone and provides
45
26
  basic interface for DRIZZLE_TIME <-> time_t conversion.
46
27
  Actual time zones which are specified by DB, or via offset
47
28
  or use system functions are its descendants.
48
29
*/
49
 
class Time_zone: public memory::SqlAlloc
 
30
class Time_zone: public Sql_alloc
50
31
{
51
32
public:
52
33
  Time_zone() {}                              /* Remove gcc warning */
57
38
    falls into spring time-gap (or lefts it untouched otherwise).
58
39
  */
59
40
  virtual time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t,
60
 
                                 bool *in_dst_time_gap) const = 0;
 
41
                                    bool *in_dst_time_gap) const = 0;
61
42
  /**
62
43
    Converts time in time_t representation to local time in
63
44
    broken down DRIZZLE_TIME representation.
72
53
 
73
54
  /**
74
55
    We need this only for surpressing warnings, objects of this type are
75
 
    allocated on memory::Root and should not require destruction.
 
56
    allocated on MEM_ROOT and should not require destruction.
76
57
  */
77
58
  virtual ~Time_zone() {};
78
59
};
80
61
extern Time_zone * my_tz_SYSTEM;
81
62
extern Time_zone * my_tz_find(Session *session, const String *name);
82
63
extern bool     my_tz_init(Session *org_session, const char *default_tzname);
83
 
 
84
 
} /* namespace drizzled */
 
64
extern time_t   sec_since_epoch_TIME(DRIZZLE_TIME *t);
85
65
 
86
66
#endif /* DRIZZLED_TZTIME_H */