Simplify include file

This commit is contained in:
Martin Kleusberg
2017-01-23 13:35:22 +01:00
parent 00ac4aaa51
commit 649f2b8b93
2 changed files with 45 additions and 49 deletions

View File

@@ -22,6 +22,48 @@ QStringList fieldVectorToFieldNames(const FieldVector& vector)
return result;
}
/**
* @brief The CreateTableWalker class
* Goes trough the createtable AST and returns
* Table object.
*/
class CreateTableWalker
{
public:
explicit CreateTableWalker(antlr::RefAST r)
: m_root(r)
{}
TablePtr table();
private:
void parsecolumn(Table* table, antlr::RefAST c);
private:
antlr::RefAST m_root;
};
/**
* @brief The CreateIndexWalker class
* Goes trough the createtable AST and returns
* Index object.
*/
class CreateIndexWalker
{
public:
explicit CreateIndexWalker(antlr::RefAST r)
: m_root(r)
{}
IndexPtr index();
private:
void parsecolumn(Index* index, antlr::RefAST c);
private:
antlr::RefAST m_root;
};
ObjectPtr Object::parseSQL(Object::ObjectTypes type, const QString& sSQL)
{
// Parse SQL statement according to type

View File

@@ -2,13 +2,10 @@
#ifndef SQLITETYPES_H
#define SQLITETYPES_H
#include "antlr/ASTRefCount.hpp"
#include <QString>
#include <QSharedPointer>
#include <QVector>
#include <QStringList>
#include <QPair>
#include <QMultiHash>
namespace sqlb {
@@ -29,6 +26,9 @@ typedef QSharedPointer<Constraint> ConstraintPtr;
typedef QVector<FieldPtr> FieldVector;
typedef QSharedPointer<IndexedColumn> IndexedColumnPtr;
typedef QVector<IndexedColumnPtr> IndexedColumnVector;
typedef QMultiHash<FieldVector, ConstraintPtr> ConstraintMap;
QStringList fieldVectorToFieldNames(const sqlb::FieldVector& vector);
class Object
{
@@ -217,8 +217,6 @@ private:
bool m_unique;
};
typedef QMultiHash<FieldVector, ConstraintPtr> ConstraintMap;
class Table : public Object
{
public:
@@ -289,29 +287,6 @@ private:
QString m_virtual;
};
/**
* @brief The CreateTableWalker class
* Goes trough the createtable AST and returns
* Table object.
*/
class CreateTableWalker
{
public:
explicit CreateTableWalker(antlr::RefAST r)
: m_root(r)
{}
TablePtr table();
private:
void parsecolumn(Table* table, antlr::RefAST c);
private:
antlr::RefAST m_root;
};
QStringList fieldVectorToFieldNames(const sqlb::FieldVector& vector);
class IndexedColumn
{
public:
@@ -390,27 +365,6 @@ private:
IndexedColumnVector m_columns;
};
/**
* @brief The CreateIndexWalker class
* Goes trough the createtable AST and returns
* Index object.
*/
class CreateIndexWalker
{
public:
explicit CreateIndexWalker(antlr::RefAST r)
: m_root(r)
{}
IndexPtr index();
private:
void parsecolumn(Index* index, antlr::RefAST c);
private:
antlr::RefAST m_root;
};
} //namespace sqlb
#endif // SQLITETYPES_H