Drizzled Public API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
weekday.h
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
*
4
* Copyright (C) 2008 Sun Microsystems, Inc.
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; version 2 of the License.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
20
#pragma once
21
22
#include <drizzled/function/func.h>
23
24
namespace
drizzled
25
{
26
27
class
Item_func_weekday
:
public
Item_func
28
{
29
bool
odbc_type;
30
public
:
31
Item_func_weekday
(
Item
*a,
bool
type_arg)
32
:
Item_func
(a), odbc_type(type_arg) {}
33
int64_t
val_int
();
34
double
val_real
() { assert(
fixed
== 1);
return
(
double
)
val_int
(); }
35
String
*
val_str
(
String
*str)
36
{
37
assert(
fixed
== 1);
38
str->set(
val_int
(), &my_charset_bin);
39
return
null_value
? 0 : str;
40
}
41
const
char
*func_name()
const
42
{
43
return
(odbc_type ?
"dayofweek"
:
"weekday"
);
44
}
45
enum
Item_result result_type ()
const
{
return
INT_RESULT; }
46
void
fix_length_and_dec()
47
{
48
collation.set(&my_charset_bin);
49
decimals=0;
50
max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
51
maybe_null
=1;
52
}
53
};
54
55
}
/* namespace drizzled */
56
drizzled::Item::fixed
bool fixed
Definition:
item.h:120
drizzled::Item_func_weekday::val_str
String * val_str(String *str)
Definition:
weekday.h:35
drizzled::Item_func_weekday::val_int
int64_t val_int()
Definition:
weekday.cc:30
drizzled::Item::null_value
bool null_value
Definition:
item.h:122
drizzled::Item::maybe_null
bool maybe_null
Definition:
item.h:121
drizzled::Item
Definition:
item.h:56
drizzled::Item_func_weekday
Definition:
weekday.h:27
drizzled::Item_func
Definition:
func.h:37
drizzled::String
Definition:
sql_string.h:57
drizzled::Item_func_weekday::val_real
double val_real()
Definition:
weekday.h:34
drizzled
function
time
weekday.h
Generated on Mon Apr 28 2014 10:06:57 for drizzle by
1.8.6