Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed some misstakes in the generic query class.

  • Loading branch information...
commit 01c0d00305da95cca6dfc403834b77a27c2deb9d 1 parent 7d79aa9
@mkaring authored
Showing with 11 additions and 12 deletions.
  1. +3 −3 configure.in
  2. +6 −6 db/Query.cpp
  3. +2 −3 db/Query.hpp
View
6 configure.in
@@ -19,13 +19,13 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
-AC_INIT(Item.hpp)
+AC_INIT(Illarion Server, 0.1.0, http://illarion.org)
AM_INIT_AUTOMAKE(illarion_server, 0.1.0)
AC_CONFIG_HEADERS(config.h)
# Checks for programs.
-AC_PROG_CXX(g++-4.4)
-AC_PROG_CC(gcc-4.4)
+AC_PROG_CXX(g++-4.5)
+AC_PROG_CC(gcc-4.5)
# Checks for libraries.
View
12 db/Query.cpp
@@ -74,15 +74,15 @@ void Query::setQuery(const std::string &query) {
dbQuery = query;
}
-PConnection getConnection() {
+PConnection Query::getConnection() {
return dbConnection;
}
-template <typename T> std::string quote(T value) {
- return dbConnection<T>.quote(value);
+template <typename T> std::string Query::quote(T value) {
+ return dbConnection.quote<T>(value);
}
-std::string &SelectQuery::escapeKey(const std::string &key) {
+std::string Query::escapeKey(const std::string &key) {
if (key.at(0) == '"' && key.at(key.length() - 1) == '"' && !key.empty()) {
return key;
}
@@ -90,7 +90,7 @@ std::string &SelectQuery::escapeKey(const std::string &key) {
return "\"" + key + "\"";
}
-std::string &SelectQuery::escapeAndChainKeys(const std::string &key1, const std::string &key2) {
+std::string Query::escapeAndChainKeys(const std::string &key1, const std::string &key2) {
if (!key1.empty() && !key2.empty()) {
return escapeKey(key1) + "." + escapeKey(key2);
} else if (key1.empty()) {
@@ -102,7 +102,7 @@ std::string &SelectQuery::escapeAndChainKeys(const std::string &key1, const std:
return "";
}
-void SelectQuery::appendToStringList(std::string &list, const std::string &newEntry) {
+void Query::appendToStringList(std::string &list, const std::string &newEntry) {
if (list.empty()) {
list += ", ";
}
View
5 db/Query.hpp
@@ -44,13 +44,12 @@ class Query {
Query();
Query(const PConnection connection);
- static std::string &escapeKey(const std::string &key);
- static std::string &escapeAndChainKeys(const std::string &key1, const std::string &key2);
+ static std::string escapeKey(const std::string &key);
+ static std::string escapeAndChainKeys(const std::string &key1, const std::string &key2);
static void appendToStringList(std::string &list, const std::string &newEntry);
void setQuery(const std::string &query);
PConnection getConnection();
-
template <typename T> std::string quote(T value);
};
}
Please sign in to comment.
Something went wrong with that request. Please try again.