move sqlhelper into util/. Add convenience methods

This commit is contained in:
Pedro Flemming 2017-04-07 15:47:51 +02:00
parent 1a97db687b
commit e6cd70f029
7 changed files with 19 additions and 9 deletions

View File

@ -6,7 +6,7 @@
#include "SQLParser.h" #include "SQLParser.h"
// contains printing utilities // contains printing utilities
#include "sqlhelper.h" #include "util/sqlhelper.h"
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
if (argc <= 1) { if (argc <= 1) {

View File

@ -29,7 +29,9 @@ namespace hsql {
virtual ~SQLStatement(); virtual ~SQLStatement();
virtual StatementType type() const; StatementType type() const;
bool isType(StatementType type) const;
private: private:
StatementType type_; StatementType type_;

View File

@ -13,6 +13,10 @@ namespace hsql {
return type_; return type_;
} }
bool SQLStatement::isType(StatementType type) const {
return (type_ == type);
}
// ColumnDefinition // ColumnDefinition
ColumnDefinition::ColumnDefinition(char* name, DataType type) : ColumnDefinition::ColumnDefinition(char* name, DataType type) :
name(name), name(name),

View File

@ -1,7 +1,7 @@
#ifndef __SQLHELPER_H__ #ifndef __SQLPARSER__SQLHELPER_H__
#define __SQLHELPER_H__ #define __SQLPARSER__SQLHELPER_H__
#include "sql/statements.h" #include "../sql/statements.h"
namespace hsql { namespace hsql {

View File

@ -3,9 +3,11 @@
*/ */
#include "thirdparty/microtest/microtest.h" #include "thirdparty/microtest/microtest.h"
#include "sql_asserts.h"
#include "SQLParser.h" #include "SQLParser.h"
#include "sqlhelper.h" #include "util/sqlhelper.h"
#include "sql_asserts.h"
using namespace hsql; using namespace hsql;

View File

@ -1,7 +1,9 @@
#include "thirdparty/microtest/microtest.h" #include "thirdparty/microtest/microtest.h"
#include "sql_asserts.h"
#include "SQLParser.h" #include "SQLParser.h"
#include "sqlhelper.h" #include "util/sqlhelper.h"
#include "sql_asserts.h"
#include <string> #include <string>
#include <fstream> #include <fstream>