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; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
#include "drizzled/display.h"
30
static const std::string PROGRAM_ERROR("PROGRAM_ERROR");
32
static const std::string COM_SLEEP("COM_SLEEP");
33
static const std::string COM_QUIT("COM_QUIT");
34
static const std::string COM_INIT_DB("COM_INIT_DB");
35
static const std::string COM_QUERY("COM_QUERY");
36
static const std::string COM_SHUTDOWN("COM_SHUTDOWN");
37
static const std::string COM_CONNECT("COM_CONNECT");
38
static const std::string COM_PING("COM_PING");
39
static const std::string COM_END("COM_END");
41
static const std::string DRIZZLE_TYPE_LONG("DRIZZLE_TYPE_LONG");
42
static const std::string DRIZZLE_TYPE_DOUBLE("DRIZZLE_TYPE_DOUBLE");
43
static const std::string DRIZZLE_TYPE_NULL("DRIZZLE_TYPE_NULL");
44
static const std::string DRIZZLE_TYPE_TIMESTAMP("DRIZZLE_TYPE_TIMESTAMP");
45
static const std::string DRIZZLE_TYPE_LONGLONG("DRIZZLE_TYPE_LONGLONG");
46
static const std::string DRIZZLE_TYPE_DATETIME("DRIZZLE_TYPE_DATETIME");
47
static const std::string DRIZZLE_TYPE_DATE("DRIZZLE_TYPE_DATE");
48
static const std::string DRIZZLE_TYPE_VARCHAR("DRIZZLE_TYPE_VARCHAR");
49
static const std::string DRIZZLE_TYPE_DECIMAL("DRIZZLE_TYPE_DECIMAL");
50
static const std::string DRIZZLE_TYPE_ENUM("DRIZZLE_TYPE_ENUM");
51
static const std::string DRIZZLE_TYPE_BLOB("DRIZZLE_TYPE_BLOB");
52
static const std::string DRIZZLE_TYPE_MAX("DRIZZLE_TYPE_MAX");
54
static const std::string YES("YES");
55
static const std::string NO("NO");
58
const std::string &type(drizzled::enum_server_command type)
62
case drizzled::COM_SLEEP :
64
case drizzled::COM_QUIT :
66
case drizzled::COM_INIT_DB :
68
case drizzled::COM_QUERY :
70
case drizzled::COM_SHUTDOWN :
72
case drizzled::COM_CONNECT :
74
case drizzled::COM_PING :
76
case drizzled::COM_END :
85
const std::string &type(drizzled::enum_field_types type)
89
case drizzled::DRIZZLE_TYPE_LONG :
90
return DRIZZLE_TYPE_LONG;
91
case drizzled::DRIZZLE_TYPE_DOUBLE :
92
return DRIZZLE_TYPE_DOUBLE;
93
case drizzled::DRIZZLE_TYPE_NULL :
94
return DRIZZLE_TYPE_NULL;
95
case drizzled::DRIZZLE_TYPE_TIMESTAMP :
96
return DRIZZLE_TYPE_TIMESTAMP;
97
case drizzled::DRIZZLE_TYPE_LONGLONG :
98
return DRIZZLE_TYPE_LONGLONG;
99
case drizzled::DRIZZLE_TYPE_DATETIME :
100
return DRIZZLE_TYPE_DATETIME;
101
case drizzled::DRIZZLE_TYPE_DATE :
102
return DRIZZLE_TYPE_DATE;
103
case drizzled::DRIZZLE_TYPE_VARCHAR :
104
return DRIZZLE_TYPE_VARCHAR;
105
case drizzled::DRIZZLE_TYPE_DECIMAL :
106
return DRIZZLE_TYPE_DECIMAL;
107
case drizzled::DRIZZLE_TYPE_ENUM :
108
return DRIZZLE_TYPE_ENUM;
109
case drizzled::DRIZZLE_TYPE_BLOB :
110
return DRIZZLE_TYPE_BLOB;
114
return PROGRAM_ERROR;
117
} /* namespace display */
118
} /* namespace drizzled */