From 768e097abd17d07dd2748894b4dc1b09471dd6da Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 26 Jan 2018 22:34:15 +0900 Subject: started implementing project loader --- src/data/tikzassembler.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/data/tikzassembler.h (limited to 'src/data/tikzassembler.h') diff --git a/src/data/tikzassembler.h b/src/data/tikzassembler.h new file mode 100644 index 0000000..8dbbc9b --- /dev/null +++ b/src/data/tikzassembler.h @@ -0,0 +1,42 @@ +/** + * Convenience class to hold the parser state while loading tikz graphs or projects. + */ + +#ifndef TIKZASSEMBLER_H +#define TIKZASSEMBLER_H + +#include "node.h" +#include "graph.h" +#include "project.h" + +#include +#include + +class TikzAssembler : public QObject +{ + Q_OBJECT +public: + explicit TikzAssembler(Graph *graph, QObject *parent = 0); + explicit TikzAssembler(Project *project, QObject *parent = 0); + void addNodeToMap(Node *n); + Node *nodeWithName(QString name); + bool parse(const QString &tikz); + + Graph *graph() const; + Project *project() const; + bool isGraph() const; + bool isProject() const; + + +signals: + +public slots: + +private: + QHash _nodeMap; + Graph *_graph; + Project *_project; + void *scanner; +}; + +#endif // TIKZASSEMBLER_H -- cgit v1.2.3