Reorganize files in pglablib
The enitities and containers of the catalog now go into catalog subfolder Models go into model
This commit is contained in:
parent
56cbeea183
commit
f0c1035378
121 changed files with 226 additions and 183 deletions
51
pglablib/catalog/PgKeywordList.h
Normal file
51
pglablib/catalog/PgKeywordList.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef PGKEYWORDLIST_H
|
||||
#define PGKEYWORDLIST_H
|
||||
|
||||
#include <QString>
|
||||
#include <unordered_set>
|
||||
#include <functional>
|
||||
#include "util.h"
|
||||
|
||||
#define UNRESERVED_KEYWORD 0
|
||||
#define COL_NAME_KEYWORD 1
|
||||
#define TYPE_FUNC_NAME_KEYWORD 2
|
||||
#define RESERVED_KEYWORD 3
|
||||
|
||||
|
||||
|
||||
using t_SymbolSet = std::unordered_set<QString>;
|
||||
|
||||
|
||||
class Keyword {
|
||||
public:
|
||||
Keyword(QString kw, int16_t cat)
|
||||
: m_keyword(kw), m_category(cat)
|
||||
{}
|
||||
|
||||
const QString& getKeyword() const { return m_keyword; }
|
||||
int16_t getCategory() const { return m_category; }
|
||||
|
||||
//bool operator<(const QString &s) const { return m_keyword < s; }
|
||||
bool operator<(const Keyword &kw) const { return m_keyword < kw.m_keyword; }
|
||||
private:
|
||||
QString m_keyword;
|
||||
int16_t m_category;
|
||||
};
|
||||
|
||||
namespace std {
|
||||
|
||||
template <>
|
||||
struct hash<Keyword>
|
||||
{
|
||||
std::size_t operator()(const Keyword& s) const
|
||||
{
|
||||
return qHash(s.getKeyword());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const Keyword* getPgsqlKeyword(QString s);
|
||||
|
||||
|
||||
#endif // PGKEYWORDLIST_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue