Support for OTML inline sequences
This commit is contained in:
parent
19dd96fd02
commit
61d64c7417
|
@ -23,6 +23,7 @@
|
||||||
#include "otmlparser.h"
|
#include "otmlparser.h"
|
||||||
#include "otmldocument.h"
|
#include "otmldocument.h"
|
||||||
#include "otmlexception.h"
|
#include "otmlexception.h"
|
||||||
|
#include <boost/tokenizer.hpp>
|
||||||
|
|
||||||
OTMLParser::OTMLParser(OTMLDocumentPtr doc, std::istream& in) :
|
OTMLParser::OTMLParser(OTMLDocumentPtr doc, std::istream& in) :
|
||||||
currentDepth(0), currentLine(0),
|
currentDepth(0), currentLine(0),
|
||||||
|
@ -186,8 +187,17 @@ void OTMLParser::parseNode(const std::string& data)
|
||||||
// ~ is considered the null value
|
// ~ is considered the null value
|
||||||
if(value == "~")
|
if(value == "~")
|
||||||
node->setNull(true);
|
node->setNull(true);
|
||||||
else
|
else {
|
||||||
node->setValue(value);
|
if(boost::starts_with(value, "[") && boost::ends_with(value, "]")) {
|
||||||
|
std::string tmp = value.substr(1, value.length()-2);
|
||||||
|
boost::tokenizer<boost::escaped_list_separator<char>> tokens(tmp);
|
||||||
|
for(std::string v : tokens) {
|
||||||
|
stdext::trim(v);
|
||||||
|
node->writeIn(v);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
node->setValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
currentParent->addChild(node);
|
currentParent->addChild(node);
|
||||||
previousNode = node;
|
previousNode = node;
|
||||||
|
|
Loading…
Reference in New Issue