~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal_interval.h

  • Committer: clint at fewbar
  • Date: 2009-07-21 17:42:23 UTC
  • mto: (1093.1.33 captain)
  • mto: This revision was merged to the branch mainline in revision 1105.
  • Revision ID: clint@fewbar.com-20090721174223-s4srxyar028f3kl7
style/documentation cleanups and replacing copyright notices

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2009 Sun Microsystems
 
5
 *
 
6
 *  Author: Clint Byrum <clint@fewbar.com>
 
7
 *
 
8
 *  This program is free software; you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU General Public License as published by
 
10
 *  the Free Software Foundation; version 2 of the License.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software
 
19
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
20
 */
1
21
#include <drizzled/item.h>
2
22
 
3
23
namespace drizzled {
4
24
  /**
 
25
   * @brief
5
26
   *  Stores time interval for date/time manipulation
6
27
   */
7
28
  class TemporalInterval
47
68
        neg = in_neg;
48
69
      }
49
70
 
50
 
      bool getNeg() const
 
71
      bool getNegative() const
51
72
      {
52
73
        return neg;
53
74
      }
63
84
       * @return true if the string would result in a null interval
64
85
       * 
65
86
       */
66
 
      bool value_from_item(Item *args, interval_type int_type, String *str_value);
 
87
      bool initFromItem(Item *args, interval_type int_type, String *str_value);
67
88
 
68
89
      /**
69
90
       * Adds this interval to a DRIZZLE_LTIME structure
73
94
       * @retval true date was added and value stored properly
74
95
       * @retval false result of addition is a null value
75
96
       */
76
 
      bool add_date(DRIZZLE_TIME *ltime, interval_type int_type);
 
97
      bool addDate(DRIZZLE_TIME *ltime, interval_type int_type);
77
98
 
78
99
    private:
79
100
 
86
107
       *  from the high end. This allows one to give:
87
108
       *  DAY_TO_SECOND as "D MM:HH:SS", "MM:HH:SS" "HH:SS" or as seconds.
88
109
 
89
 
       *  @param length:         length of str
90
 
       *  @param cs:             charset of str
91
 
       *  @param values:         array of results
92
 
       *  @param count:          count of elements in result array
 
110
       *  @param[in] length:         length of str
 
111
       *  @param[in] cs:             charset of str
 
112
       *  @param[out] values:         array of results
 
113
       *  @param[out] count:          count of elements in result array
93
114
       *  @param transform_msec: if value is true we suppose
94
115
       *  that the last part of string value is microseconds
95
116
       *  and we should transform value to six digit value.
96
117
       *  For example, '1.1' -> '1.100000'
97
118
       */
98
 
      bool get_interval_info(const char *str,uint32_t length, const CHARSET_INFO * const cs,
 
119
      bool getIntervalInfo(const char *str,uint32_t length, const CHARSET_INFO * const cs,
99
120
          uint32_t count, uint64_t *values,
100
121
          bool transform_msec);
101
122