mirror of
https://github.com/edubart/otclient.git
synced 2026-01-02 04:27:11 +01:00
many changes and refactoring
This commit is contained in:
38
src/framework/otml/otmlparser.h
Normal file
38
src/framework/otml/otmlparser.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef OTMLPARSER_H
|
||||
#define OTMLPARSER_H
|
||||
|
||||
#include <global.h>
|
||||
|
||||
class OTMLNode;
|
||||
|
||||
class OTMLParser
|
||||
{
|
||||
public:
|
||||
OTMLParser(std::istream& in, std::string what = "");
|
||||
~OTMLParser();
|
||||
|
||||
OTMLNode* getDocument() const { return m_rootNode; }
|
||||
std::string what() { return m_what; }
|
||||
|
||||
void throwError(const std::string& message, int line);
|
||||
|
||||
protected:
|
||||
void parse();
|
||||
void parseLine(std::string line);
|
||||
void parseNode(OTMLNode* node, std::string data);
|
||||
void parseNodeValue(OTMLNode* node, std::string value);
|
||||
void parseTextValue(std::string& value);
|
||||
|
||||
void parseTokens(std::string data, std::vector<std::string>& out);
|
||||
|
||||
private:
|
||||
int m_currentDepth;
|
||||
int m_currentLine;
|
||||
OTMLNode* m_rootNode;
|
||||
OTMLNode* m_currentParent;
|
||||
OTMLNode* m_previousNode;
|
||||
std::string m_what;
|
||||
std::istream& m_in;
|
||||
};
|
||||
|
||||
#endif // OTMLPARSER_H
|
||||
Reference in New Issue
Block a user