src/parser.h

changeset 1306
be85306198a2
parent 1295
ac8f0297885b
child 1326
69a90bd2dba2
equal deleted inserted replaced
1305:31627acdd4b5 1306:be85306198a2
30 public: 30 public:
31 enum { EndOfModel = -1 }; 31 enum { EndOfModel = -1 };
32 32
33 Parser(QIODevice& device, QObject* parent = nullptr); 33 Parser(QIODevice& device, QObject* parent = nullptr);
34 34
35 LDHeader parseHeader(); 35 LDHeader parseHeader(Winding& winding);
36 void parseBody(Model& model); 36 void parseBody(Model& model);
37 37
38 static LDObject* parseFromString(Model& model, int position, QString line); 38 static LDObject* parseFromString(Model& model, int position, QString line);
39 39
40 static const QMap<QString, decltype(LDHeader::type)> typeStrings; 40 static const QMap<QString, decltype(LDHeader::type)> typeStrings;
46 46
47 private: 47 private:
48 enum HeaderParseResult {ParseSuccess, ParseFailure, StopParsing}; 48 enum HeaderParseResult {ParseSuccess, ParseFailure, StopParsing};
49 49
50 QString readLine(); 50 QString readLine();
51 HeaderParseResult parseHeaderLine(LDHeader& header, const QString& line); 51 HeaderParseResult parseHeaderLine(LDHeader& header, Winding& winding, const QString& line);
52 52
53 QIODevice& device; 53 QIODevice& device;
54 QStringList bag; 54 QStringList bag;
55 }; 55 };

mercurial