diff options
Diffstat (limited to 'src/core/parser')
-rw-r--r-- | src/core/parser/ParserContext.cpp | 2 | ||||
-rw-r--r-- | src/core/parser/ParserContext.hpp | 2 | ||||
-rw-r--r-- | src/core/parser/ParserScope.cpp | 14 | ||||
-rw-r--r-- | src/core/parser/ParserScope.hpp | 19 | ||||
-rw-r--r-- | src/core/parser/stack/DocumentHandler.cpp | 8 |
5 files changed, 24 insertions, 21 deletions
diff --git a/src/core/parser/ParserContext.cpp b/src/core/parser/ParserContext.cpp index 14b02df..7177126 100644 --- a/src/core/parser/ParserContext.cpp +++ b/src/core/parser/ParserContext.cpp @@ -47,7 +47,7 @@ Rooted<Node> ParserContext::import(const std::string &path, return resourceManager.import(*this, path, mimetype, rel, supportedTypes); } -NodeVector<Node> ParserContext::include(const std::string &path, +ManagedVector<Node> ParserContext::include(const std::string &path, const std::string mimetype, const std::string rel, const RttiSet &supportedTypes) diff --git a/src/core/parser/ParserContext.hpp b/src/core/parser/ParserContext.hpp index 1b889b1..369ce3c 100644 --- a/src/core/parser/ParserContext.hpp +++ b/src/core/parser/ParserContext.hpp @@ -139,7 +139,7 @@ public: * @return the parsed nodes or an empty list if something goes wrong (or * there were indeed no objects to be parsed). */ - NodeVector<Node> include(const std::string &path, + ManagedVector<Node> include(const std::string &path, const std::string mimetype, const std::string rel, const RttiSet &supportedTypes); diff --git a/src/core/parser/ParserScope.cpp b/src/core/parser/ParserScope.cpp index 4b0f376..0be8a22 100644 --- a/src/core/parser/ParserScope.cpp +++ b/src/core/parser/ParserScope.cpp @@ -36,7 +36,8 @@ namespace ousia { ParserScopeBase::ParserScopeBase() {} -ParserScopeBase::ParserScopeBase(const NodeVector<Node> &nodes) : nodes(nodes) +ParserScopeBase::ParserScopeBase(const ManagedVector<Node> &nodes) + : nodes(nodes) { } @@ -74,7 +75,7 @@ Rooted<Node> ParserScopeBase::getRoot() const { return nodes.front(); } Rooted<Node> ParserScopeBase::getLeaf() const { return nodes.back(); } -const NodeVector<Node> &ParserScopeBase::getStack() const { return nodes; } +const ManagedVector<Node> &ParserScopeBase::getStack() const { return nodes; } std::vector<Rtti const *> ParserScopeBase::getStackTypeSignature() const { @@ -118,7 +119,7 @@ Rooted<Node> ParserScopeBase::selectOrThrow(RttiSet types, int maxDepth) /* Class DeferredResolution */ -DeferredResolution::DeferredResolution(const NodeVector<Node> &nodes, +DeferredResolution::DeferredResolution(const ManagedVector<Node> &nodes, const std::vector<std::string> &path, const Rtti *type, ResolutionResultCallback resultCallback, @@ -169,7 +170,7 @@ void DeferredResolution::fail(Logger &logger) /* Class ParserScope */ -ParserScope::ParserScope(const NodeVector<Node> &nodes, +ParserScope::ParserScope(const ManagedVector<Node> &nodes, const std::vector<ParserFlagDescriptor> &flags) : ParserScopeBase(nodes), flags(flags), topLevelDepth(nodes.size()) { @@ -261,7 +262,10 @@ void ParserScope::pop(Logger &logger) #endif } -NodeVector<Node> ParserScope::getTopLevelNodes() const { return topLevelNodes; } +ManagedVector<Node> ParserScope::getTopLevelNodes() const +{ + return topLevelNodes; +} void ParserScope::setFlag(ParserFlag flag, bool value) { diff --git a/src/core/parser/ParserScope.hpp b/src/core/parser/ParserScope.hpp index 0a1e90b..85b5d8b 100644 --- a/src/core/parser/ParserScope.hpp +++ b/src/core/parser/ParserScope.hpp @@ -74,7 +74,7 @@ protected: * List containing all nodes currently on the scope, with the newest nodes * being pushed to the back of the list. */ - NodeVector<Node> nodes; + ManagedVector<Node> nodes; public: /** @@ -84,13 +84,12 @@ public: /** * Creates a new instance of the ParserScopeBase class, copying the the - *given - * nodes as initial start value of the node stack. This could for example - * be initialized with the path of a node. + * given nodes as initial start value of the node stack. This could for + * example be initialized with the path of a node. * * @param nodes is a node vector containing the current node stack. */ - ParserScopeBase(const NodeVector<Node> &nodes); + ParserScopeBase(const ManagedVector<Node> &nodes); /** * Tries to resolve a node for the given type and path for all nodes that @@ -118,7 +117,7 @@ public: * * @return a const reference at the internal node stack. */ - const NodeVector<Node> &getStack() const; + const ManagedVector<Node> &getStack() const; /** * Returns a list containing the Rtti type of each Node that is currently @@ -247,7 +246,7 @@ public: * the desired element has indeed been found. * @param owner is the node for which the resolution takes place. */ - DeferredResolution(const NodeVector<Node> &nodes, + DeferredResolution(const ManagedVector<Node> &nodes, const std::vector<std::string> &path, const Rtti *type, ResolutionResultCallback resultCallback, Handle<Node> owner); @@ -376,12 +375,12 @@ private: * List of a all nodes that have been pushed onto the scope at the top level * depth. */ - NodeVector<Node> topLevelNodes; + ManagedVector<Node> topLevelNodes; /** * Private constructor used to create a ParserScope fork. */ - ParserScope(const NodeVector<Node> &nodes, + ParserScope(const ManagedVector<Node> &nodes, const std::vector<ParserFlagDescriptor> &flags); public: @@ -450,7 +449,7 @@ public: * * @return a node vector containing the top-level nodes. */ - NodeVector<Node> getTopLevelNodes() const; + ManagedVector<Node> getTopLevelNodes() const; /** * Sets a parser flag for the current stack depth. diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp index ce5d8a2..e6af615 100644 --- a/src/core/parser/stack/DocumentHandler.cpp +++ b/src/core/parser/stack/DocumentHandler.cpp @@ -144,7 +144,7 @@ void DocumentChildHandler::pushScopeTokens() // Fetch the current scope stack and search the first non-transparent field // or structure - const NodeVector<Node> &stack = scope().getStack(); + const ManagedVector<Node> &stack = scope().getStack(); for (auto sit = stack.crbegin(); sit != stack.crend(); sit++) { Rooted<Node> nd = *sit; @@ -586,7 +586,7 @@ bool DocumentChildHandler::startToken(Handle<Node> node) EndTokenResult DocumentChildHandler::endToken(Handle<Node> node, size_t maxStackDepth) { // Fetch the current scope stack - const NodeVector<Node> &stack = scope().getStack(); + const ManagedVector<Node> &stack = scope().getStack(); bool found = false; // true once the given node has been found bool repeat = false; @@ -686,7 +686,7 @@ bool DocumentChildHandler::fieldStart(bool &isDefault, size_t fieldIdx) preamble(parentNode, dummy, parent); - NodeVector<FieldDescriptor> fields = + ManagedVector<FieldDescriptor> fields = parent->getDescriptor()->getFieldDescriptors(); if (isDefault) { @@ -780,7 +780,7 @@ bool DocumentChildHandler::data() // Search through all permitted default fields of the parent class that // allow primitive content at this point and could be constructed via // transparent intermediate entities. - NodeVector<FieldDescriptor> defaultFields = field->getDefaultFields(); + ManagedVector<FieldDescriptor> defaultFields = field->getDefaultFields(); // Try to parse the data using the type specified by the respective field. // If that does not work we proceed to the next possible field. |