From 61d64c7417c77441c25bc84f0876d7c6e2d8a3cb Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Mon, 23 Jul 2012 17:50:34 -0300 Subject: [PATCH] Support for OTML inline sequences --- src/framework/otml/otmlparser.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/framework/otml/otmlparser.cpp b/src/framework/otml/otmlparser.cpp index 4cda2f2d..361b77f3 100644 --- a/src/framework/otml/otmlparser.cpp +++ b/src/framework/otml/otmlparser.cpp @@ -23,6 +23,7 @@ #include "otmlparser.h" #include "otmldocument.h" #include "otmlexception.h" +#include OTMLParser::OTMLParser(OTMLDocumentPtr doc, std::istream& in) : currentDepth(0), currentLine(0), @@ -186,8 +187,17 @@ void OTMLParser::parseNode(const std::string& data) // ~ is considered the null value if(value == "~") node->setNull(true); - else - node->setValue(value); + else { + if(boost::starts_with(value, "[") && boost::ends_with(value, "]")) { + std::string tmp = value.substr(1, value.length()-2); + boost::tokenizer> tokens(tmp); + for(std::string v : tokens) { + stdext::trim(v); + node->writeIn(v); + } + } else + node->setValue(value); + } currentParent->addChild(node); previousNode = node;