You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
762 B
34 lines
762 B
#ifndef OTMLPARSER_H
|
|
#define OTMLPARSER_H
|
|
|
|
#include "declarations.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
|