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>
30
class Boolean: public Item_basic_constant
35
Boolean(const char *str_arg, bool arg) :
36
Item_basic_constant(),
39
max_length= value ? 4 : 5;
41
name= (const_cast<char *>(str_arg));
47
max_length= value ? 4 : 5;
52
name= const_cast<char *>("TRUE");
56
name= const_cast<char *>("FALSE");
60
enum Type type() const { return BOOLEAN_ITEM; }
62
virtual bool val_bool()
77
drizzled::String* val_str(drizzled::String *value_buffer)
79
value_buffer->realloc(5);
83
value_buffer->append("TRUE");
87
value_buffer->append("FALSE");
93
type::Decimal* val_decimal(type::Decimal *dec)
101
} /* namespace item */
102
} /* namespace drizzled */
104
#include <drizzled/item/true.h>
105
#include <drizzled/item/false.h>