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
20
#ifndef DRIZZLED_ITEM_BOOLEAN_H
21
#define DRIZZLED_ITEM_BOOLEAN_H
23
#include "drizzled/item/basic_constant.h"
31
class Boolean: public Item_basic_constant
36
Boolean(const char *str_arg, bool arg) :
37
Item_basic_constant(),
40
max_length= value ? 4 : 5;
42
name= (const_cast<char *>(str_arg));
48
max_length= value ? 4 : 5;
53
name= const_cast<char *>("TRUE");
57
name= const_cast<char *>("FALSE");
61
enum Type type() const { return BOOLEAN_ITEM; }
63
virtual bool val_bool()
78
drizzled::String* val_str(drizzled::String *value_buffer)
80
value_buffer->realloc(5);
84
value_buffer->append("TRUE");
88
value_buffer->append("FALSE");
94
type::Decimal* val_decimal(type::Decimal *dec)
102
} /* namespace item */
103
} /* namespace drizzled */
105
#include "drizzled/item/true.h"
106
#include "drizzled/item/false.h"
108
#endif /* DRIZZLED_ITEM_BOOLEAN_H */