pgLab/opendatabase.h
Eelke Klein 37e8882a3c New syntax highlighter not complete.
- Supports comments
- more efficient as it scans the text block instead of repeatedly searching throught the whole block
- type matching based on catalog (but need to add aliases manually)
- added many keywords

todo:
- heap corruption bug
- symbol stops at special char like parenthese or operator or something similar.
2017-02-07 21:39:45 +01:00

40 lines
954 B
C++

#ifndef OPENDATABASE_H
#define OPENDATABASE_H
#include <QObject>
#include "connectionconfig.h"
#include "expected.h"
class PgsqlDatabaseCatalogue;
class TypeSelectionItemModel;
/** Instances of this class represent a single database on which atleast one
* window is opened. This class is used to track details about that database.
*/
class OpenDatabase : public QObject
{
Q_OBJECT
public:
static Expected<OpenDatabase*> createOpenDatabase(const ConnectionConfig &cfg);
OpenDatabase(const OpenDatabase &) = delete;
OpenDatabase& operator=(const OpenDatabase &) = delete;
~OpenDatabase();
PgsqlDatabaseCatalogue* catalogue();
TypeSelectionItemModel* typeSelectionModel();
signals:
public slots:
private:
ConnectionConfig m_config;
PgsqlDatabaseCatalogue *m_catalogue;
TypeSelectionItemModel *m_typeSelectionModel = nullptr;
OpenDatabase(const ConnectionConfig& cfg, QObject *parent = 0);
bool Init();
};
#endif // OPENDATABASE_H