~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/tztime.h

  • Committer: Brian Aker
  • Date: 2011-01-19 18:03:32 UTC
  • mfrom: (2088.8.12 timestamp)
  • mto: This revision was merged to the branch mainline in revision 2098.
  • Revision ID: brian@tangent.org-20110119180332-acfk5i8oofp63s40
Merge in time code.

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
24
#include "drizzled/memory/sql_alloc.h"
36
25
 
 
26
#include "drizzled/type/time.h"
 
27
 
37
28
namespace drizzled
38
29
{
39
30
 
45
36
 
46
37
/**
47
38
  This class represents abstract time zone and provides
48
 
  basic interface for type::Time <-> time_t conversion.
 
39
  basic interface for type::Time <-> type::Time::epoch_t conversion.
49
40
  Actual time zones which are specified by DB, or via offset
50
41
  or use system functions are its descendants.
51
42
*/
55
46
  Time_zone() {}                              /* Remove gcc warning */
56
47
  /**
57
48
    Converts local time in broken down type::Time representation to
58
 
    time_t (UTC seconds since Epoch) represenation.
 
49
    type::Time::epoch_t (UTC seconds since Epoch) represenation.
59
50
    Returns 0 in case of error. Sets in_dst_time_gap to true if date provided
60
51
    falls into spring time-gap (or lefts it untouched otherwise).
61
52
  */
62
 
  virtual time_t TIME_to_gmt_sec(const type::Time *t,
63
 
                                 bool *in_dst_time_gap) const = 0;
 
53
  virtual type::Time::epoch_t TIME_to_gmt_sec(const type::Time *t,
 
54
                                              bool *in_dst_time_gap) const = 0;
64
55
  /**
65
 
    Converts time in time_t representation to local time in
 
56
    Converts time in type::Time::epoch_t representation to local time in
66
57
    broken down type::Time representation.
67
58
  */
68
 
  virtual void   gmt_sec_to_TIME(type::Time *tmp, time_t t) const = 0;
 
59
  virtual void gmt_sec_to_TIME(type::Time *tmp, type::Time::epoch_t t) const = 0;
 
60
 
69
61
  /**
70
62
    Because of constness of String returned by get_name() time zone name
71
63
    have to be already zeroended to be able to use String::ptr() instead