rework ui related scripting stuff

This commit is contained in:
Eduardo Bart
2011-07-17 03:56:57 -03:00
parent 571801ae39
commit bddcfb08fd
46 changed files with 740 additions and 507 deletions

View File

@@ -5,8 +5,8 @@
OTMLParser::OTMLParser(std::istream& in, std::string what) :
m_currentDepth(0), m_currentLine(0),
m_rootNode(new OTMLNode), m_currentParent(m_rootNode), m_previousNode(0),
m_what(what), m_in(in)
m_rootNode(new OTMLNode(what)), m_currentParent(m_rootNode), m_previousNode(0),
m_in(in)
{
parse();
}
@@ -20,8 +20,8 @@ void OTMLParser::throwError(const std::string& message, int line)
{
std::stringstream ss;
ss << "OTML syntax error";
if(!m_what.empty())
ss << " in '" << m_what << "'";
if(!what().empty())
ss << " in '" << what() << "'";
if(line > 0)
ss << " at line " << line;
ss << ": " << message;

View File

@@ -1,11 +1,9 @@
#ifndef OTMLPARSER_H
#define OTMLPARSER_H
#include <string>
#include <vector>
#include <istream>
#include <otml/otmlnode.h>
class OTMLNode;
#include <istream>
class OTMLParser
{
@@ -14,7 +12,7 @@ public:
~OTMLParser();
OTMLNode* getDocument() const { return m_rootNode; }
std::string what() { return m_what; }
std::string what() { return m_rootNode->what(); }
void throwError(const std::string& message, int line);
@@ -33,7 +31,6 @@ private:
OTMLNode* m_rootNode;
OTMLNode* m_currentParent;
OTMLNode* m_previousNode;
std::string m_what;
std::istream& m_in;
};