Validate data paths and schema paths
- a leaf can be only present as a last item
- a leaf-list can be only present as a last item
- a list (without keys) cannot be present in a dataPath unless it's the
last node
Change-Id: I7c28d5b235fd050e218aa2152e3a863d8db78680
diff --git a/src/ast_path.hpp b/src/ast_path.hpp
index 91268e6..83727ff 100644
--- a/src/ast_path.hpp
+++ b/src/ast_path.hpp
@@ -113,6 +113,8 @@
};
struct schemaPath_ {
+ schemaPath_();
+ schemaPath_(const Scope scope, const std::vector<schemaNode_>& nodes, const TrailingSlash trailingSlash = TrailingSlash::NonPresent);
bool operator==(const schemaPath_& b) const;
Scope m_scope = Scope::Relative;
std::vector<schemaNode_> m_nodes;
@@ -122,6 +124,8 @@
};
struct dataPath_ {
+ dataPath_();
+ dataPath_(const Scope scope, const std::vector<dataNode_>& nodes, const TrailingSlash trailingSlash = TrailingSlash::NonPresent);
bool operator==(const dataPath_& b) const;
Scope m_scope = Scope::Relative;
std::vector<dataNode_> m_nodes;