From 4e590891e9723c42858165a96c96a9f19d4e4c94 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 18 Jan 2015 12:58:55 +0100 Subject: added Document validation function and finished implementation of AnnotationEntity validation function. Tests still have to be made, though. --- src/core/model/Document.hpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/core/model/Document.hpp') diff --git a/src/core/model/Document.hpp b/src/core/model/Document.hpp index 5af3ce2..18ec3d5 100644 --- a/src/core/model/Document.hpp +++ b/src/core/model/Document.hpp @@ -161,7 +161,7 @@ protected: fields[getFieldDescriptorIndex(fieldName, true)].push_back(s); } - bool validate(Logger &logger) const; + bool doValidate(Logger &logger) const; public: /** @@ -569,6 +569,9 @@ private: void continueResolve(ResolutionState &state) override; +protected: + bool doValidate(Logger &logger) const override; + public: Document(Manager &mgr, std::string name) // TODO: Can a document have a parent? @@ -622,6 +625,17 @@ public: { domains.insert(domains.end(), d.begin(), d.end()); } + + /** + * Returns true if and only if the given StructureNode is part of this + * document, meaning that there is a path of parent references in the + * Structure Tree leading from the given StructureNode to this Document. + * + * @param s is some StructureNode. + * @return true if and only if the given StructureNode is part of this + * document. + */ + bool hasChild(Handle s) const; }; } -- cgit v1.2.3