mirror of
https://github.com/edubart/otclient.git
synced 2025-12-20 23:47:12 +01:00
rework ui related scripting stuff
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user