From bc0f465ea40d60e095123f8021315f5808a8b71c Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Thu, 14 Aug 2014 11:38:44 +0200 Subject: [PATCH] remove parsing as pointer --- alib2data/src/FromXMLParser.hpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/alib2data/src/FromXMLParser.hpp b/alib2data/src/FromXMLParser.hpp index 0e6d22260e..4533e52bf1 100644 --- a/alib2data/src/FromXMLParser.hpp +++ b/alib2data/src/FromXMLParser.hpp @@ -13,6 +13,9 @@ #include <set> #include "sax/Token.h" +#include "exception/AlibException.h" +#include "exception/ExceptionFeatures.h" + namespace alib { /** @@ -26,14 +29,6 @@ class FromXMLParser : public sax::FromXMLParserHelper { public: virtual bool first(std::list<sax::Token>& input) const = 0; - /** - * Parses the XML tokens and returns symbol. The input is destroyed in the process. - * @param input XML tokens represented as list of tokens - * @return Symbol* the parsed symbol or NULL when by first token it is not a symbol - * @throws ParserException when tokens do not represent Symbol but first token seemd as a symbol - */ - T* parsePointer(std::list<sax::Token>& input) const; - /** * Parses the XML tokens and returns symbol. The input is destroyed in the process. * @param input XML tokens represented as list of tokens @@ -46,22 +41,6 @@ public: void tryParseAndThrowException(std::list<sax::Token>& input); -} /* namespace alib */ - -#include "exception/AlibException.h" -#include "exception/ExceptionFeatures.h" - -namespace alib { - -template<class T, class F> -T* FromXMLParser<T, F>::parsePointer(std::list<sax::Token>& input) const { - if(first(input)) { - return new T(parse(input)); - } else { - return NULL; - } -} - template<class T, class F> T FromXMLParser<T, F>::parseValue(std::list<sax::Token>& input) const { tryParseAndThrowException(input); -- GitLab