drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
sql_to_json_generator.h
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2012 Mohit Srivastava
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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
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.
15 *
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
19 */
23
24#include <config.h>
25#include <json/json.h>
26#include <plugin/json_server/sql_executor.h>
27#include <plugin/json_server/http_handler.h>
28#include <string>
29
30using namespace std;
34namespace drizzle_plugin
35{
39namespace json_server
40{
45 {
46 public:
55 SQLToJsonGenerator(Json::Value& json_out,const char* schema,const char* table,SQLExecutor* sqlExecutor);
64 void generateJson(enum evhttp_cmd_type type);
69 Json::Value getJson() const
70 {
71 return _json_out;
72 }
73
74 private:
84 Json::Value _json_out;
92 const char* _schema;
96 const char* _table;
100 void generateGetJson();
104 void generatePostJson();
108 void generateDeleteJson();
109
110 };
111}
112
113}
114
SQLToJsonGenerator(Json::Value &json_out, const char *schema, const char *table, SQLExecutor *sqlExecutor)
Convert from decimal to binary representation.
Definition common_fwd.h:215
STL namespace.