~drizzle-trunk/drizzle/development

390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
1 by brian
clean slate
20
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
21
#pragma once
1 by brian
clean slate
22
2154.2.8 by Brian Aker
Additional cleanup.
23
#include <drizzled/memory/sql_alloc.h>
24
#include <drizzled/type/time.h>
1241.9.12 by Monty Taylor
Trims more out of server_includes.h.
25
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
26
#include <drizzled/type/time.h>
2088.8.5 by Brian Aker
Remove duplicate code around store() for type::Time
27
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
28
namespace drizzled
29
{
30
1241.9.12 by Monty Taylor
Trims more out of server_includes.h.
31
class String;
2030.1.5 by Brian Aker
Update for moving DRIZZLE_TIME to type::Time
32
1 by brian
clean slate
33
/**
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
34
  This class represents abstract time zone and provides
2088.8.12 by Brian Aker
Remove time_t reference.
35
  basic interface for type::Time <-> type::Time::epoch_t conversion.
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
36
  Actual time zones which are specified by DB, or via offset
1 by brian
clean slate
37
  or use system functions are its descendants.
38
*/
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
39
class Time_zone: public memory::SqlAlloc
1 by brian
clean slate
40
{
41
public:
42
  Time_zone() {}                              /* Remove gcc warning */
43
  /**
2030.1.5 by Brian Aker
Update for moving DRIZZLE_TIME to type::Time
44
    Converts local time in broken down type::Time representation to
2088.8.12 by Brian Aker
Remove time_t reference.
45
    type::Time::epoch_t (UTC seconds since Epoch) represenation.
1 by brian
clean slate
46
    Returns 0 in case of error. Sets in_dst_time_gap to true if date provided
47
    falls into spring time-gap (or lefts it untouched otherwise).
48
  */
2104.2.8 by Brian Aker
Merge in reference from pointer.
49
  virtual type::Time::epoch_t TIME_to_gmt_sec(const type::Time &t,
2088.8.5 by Brian Aker
Remove duplicate code around store() for type::Time
50
                                              bool *in_dst_time_gap) const = 0;
1 by brian
clean slate
51
  /**
2088.8.12 by Brian Aker
Remove time_t reference.
52
    Converts time in type::Time::epoch_t representation to local time in
2030.1.5 by Brian Aker
Update for moving DRIZZLE_TIME to type::Time
53
    broken down type::Time representation.
1 by brian
clean slate
54
  */
2104.2.8 by Brian Aker
Merge in reference from pointer.
55
  virtual void gmt_sec_to_TIME(type::Time &tmp, type::Time::epoch_t t) const = 0;
2088.8.5 by Brian Aker
Remove duplicate code around store() for type::Time
56
1 by brian
clean slate
57
  /**
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
58
    Because of constness of String returned by get_name() time zone name
1 by brian
clean slate
59
    have to be already zeroended to be able to use String::ptr() instead
60
    of c_ptr().
61
  */
62
  virtual const String * get_name() const = 0;
63
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
64
  /**
1 by brian
clean slate
65
    We need this only for surpressing warnings, objects of this type are
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
66
    allocated on memory::Root and should not require destruction.
1 by brian
clean slate
67
  */
68
  virtual ~Time_zone() {};
69
};
70
71
extern Time_zone * my_tz_SYSTEM;
2154.2.6 by Brian Aker
Merge in small cleanups.
72
bool     my_tz_init(Session *org_session, const char *default_tzname);
1122.2.10 by Monty Taylor
Fixed all of the include guards.
73
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
74
} /* namespace drizzled */
75