From eb6ecdcc85ece4eb84b90f3c9bb920dc1ad2b6d1 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 27 Jan 2015 16:01:53 +0100 Subject: Parsers do no longer return the node they have parsed (as this may be ill-defined -- if a parser only parses a partial document via include, there may be many to no nodes that are returned). Parsers should just use the ParserScope.push funciton. All nodes pushed onto the top-level of the ParserScope are added treated as the nodes the parser has parsed. Adapted all code and all tests accordingly. --- src/core/resource/ResourceManager.hpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/core/resource/ResourceManager.hpp') diff --git a/src/core/resource/ResourceManager.hpp b/src/core/resource/ResourceManager.hpp index e98e8f4..559112b 100644 --- a/src/core/resource/ResourceManager.hpp +++ b/src/core/resource/ResourceManager.hpp @@ -35,14 +35,13 @@ #include #include #include -#include +#include #include "Resource.hpp" namespace ousia { // Forward declarations -class Node; class Parser; class ParserContext; class ResourceRequest; @@ -130,9 +129,9 @@ private: * can deal with. Note that only the types the parser claims to return are * checked, not the actual result. * @param mode describes whether the file should be included or linked. - * @return the parsed node or nullptr if something goes wrong. + * @return the parsed nodes or an empty list if something went wrong. */ - Rooted parse(ParserContext &ctx, const std::string &path, + NodeVector parse(ParserContext &ctx, const std::string &path, const std::string &mimetype, const std::string &rel, const RttiSet &supportedTypes, ParseMode mode); @@ -159,9 +158,9 @@ public: * @param supportedTypes contains the types of the returned Node the caller * can deal with. Note that only the types the parser claims to return are * checked, not the actual result. - * @return the parsed node or nullptr if something goes wrong. + * @return the parsed nodes or an empty list if something went wrong. */ - Rooted link(ParserContext &ctx, const std::string &path, + NodeVector link(ParserContext &ctx, const std::string &path, const std::string &mimetype, const std::string &rel, const RttiSet &supportedTypes); @@ -190,9 +189,9 @@ public: * @param supportedTypes contains the types of the returned Node the caller * can deal with. Note that only the types the parser claims to return are * checked, not the actual result. - * @return the parsed node or nullptr if something goes wrong. + * @return the parsed nodes or an empty list if something went wrong. */ - Rooted include(ParserContext &ctx, const std::string &path, + NodeVector include(ParserContext &ctx, const std::string &path, const std::string &mimetype, const std::string &rel, const RttiSet &supportedTypes); -- cgit v1.2.3