many changes and refactoring

This commit is contained in:
Eduardo Bart
2011-07-13 18:12:36 -03:00
parent 6c05ee0e82
commit 8ef1b28546
120 changed files with 1545 additions and 1273 deletions

View 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