mirror of
https://github.com/edubart/otclient.git
synced 2025-05-04 19:49:21 +02:00
34 lines
766 B
C++
34 lines
766 B
C++
#ifndef OTMLPARSER_H
|
|
#define OTMLPARSER_H
|
|
|
|
#include "otmldeclarations.h"
|
|
|
|
class OTMLParser
|
|
{
|
|
public:
|
|
OTMLParser(OTMLDocumentPtr doc, std::istream& in);
|
|
|
|
/// Parse the entire document
|
|
void parse();
|
|
|
|
private:
|
|
/// Retrieve next line from the input stream
|
|
std::string getNextLine();
|
|
/// Counts depth of a line (every 2 spaces increments one depth)
|
|
int getLineDepth(const std::string& line, bool multilining = false);
|
|
|
|
/// Parse each line of the input stream
|
|
void parseLine(std::string line);
|
|
/// Parse nodes tag and value
|
|
void parseNode(const std::string& data);
|
|
|
|
int currentDepth;
|
|
int currentLine;
|
|
OTMLDocumentPtr doc;
|
|
OTMLNodePtr currentParent;
|
|
OTMLNodePtr previousNode;
|
|
std::istream& in;
|
|
};
|
|
|
|
#endif
|