mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Simplify include file
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user