1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Brian Aker
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.
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.
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
22
#include <drizzled/item/basic_constant.h>
27
class Boolean : public Item_basic_constant
32
Boolean(const char *str_arg, bool arg) :
33
Item_basic_constant(),
36
max_length= value ? 4 : 5;
44
max_length= value ? 4 : 5;
46
name= value ? "TRUE" : "FALSE";
49
enum Type type() const { return BOOLEAN_ITEM; }
51
Item_result result_type() const
56
virtual bool val_bool()
71
drizzled::String* val_str(drizzled::String *value_buffer)
73
value_buffer->realloc(5);
77
value_buffer->copy("TRUE", 4, default_charset());
81
value_buffer->copy("FALSE", 5, default_charset());
87
type::Decimal* val_decimal(type::Decimal *dec)
95
} /* namespace item */
96
} /* namespace drizzled */
98
#include <drizzled/item/true.h>
99
#include <drizzled/item/false.h>