diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-28 01:11:27 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-28 01:11:27 +0100 |
commit | c6fecd21e3a41b520a86b929aed04f4a4e61fcb2 (patch) | |
tree | a982805ccc1c10499e5a2225c2c7fbfbbd87c0b1 /src/core/resource/ResourceManager.cpp | |
parent | f330623143d76e56a9bd95e4c1658dd3fcf69ac6 (diff) |
Returning again a single node as result of the import function (as this is already explicitly checked for).
Diffstat (limited to 'src/core/resource/ResourceManager.cpp')
-rw-r--r-- | src/core/resource/ResourceManager.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/core/resource/ResourceManager.cpp b/src/core/resource/ResourceManager.cpp index a524be1..1d32a4d 100644 --- a/src/core/resource/ResourceManager.cpp +++ b/src/core/resource/ResourceManager.cpp @@ -188,13 +188,18 @@ NodeVector<Node> ResourceManager::parse( return parsedNodes; } -NodeVector<Node> ResourceManager::import(ParserContext &ctx, - const std::string &path, - const std::string &mimetype, - const std::string &rel, - const RttiSet &supportedTypes) +Rooted<Node> ResourceManager::import(ParserContext &ctx, + const std::string &path, + const std::string &mimetype, + const std::string &rel, + const RttiSet &supportedTypes) { - return parse(ctx, path, mimetype, rel, supportedTypes, ParseMode::IMPORT); + NodeVector<Node> res = + parse(ctx, path, mimetype, rel, supportedTypes, ParseMode::IMPORT); + if (res.size() == 1U) { + return res[0]; + } + return nullptr; } NodeVector<Node> ResourceManager::include(ParserContext &ctx, |