Add Schema::nodeType method
Change-Id: Id17e00ebef4820abae3b66d2e262be4b16c7a672
diff --git a/src/schema.hpp b/src/schema.hpp
index 8b7031a..6970fe9 100644
--- a/src/schema.hpp
+++ b/src/schema.hpp
@@ -35,6 +35,13 @@
IdentityRef,
LeafRef,
};
+
+enum class NodeTypes {
+ Container,
+ PresenceContainer,
+ List,
+ Leaf
+};
}
enum class Recursion {
@@ -43,10 +50,7 @@
};
-class InvalidNodeException : public std::invalid_argument {
-public:
- using std::invalid_argument::invalid_argument;
- ~InvalidNodeException() override;
+class InvalidNodeException {
};
/*! \class Schema
@@ -61,6 +65,8 @@
virtual bool isContainer(const schemaPath_& location, const ModuleNodePair& node) const = 0;
virtual bool isLeaf(const schemaPath_& location, const ModuleNodePair& node) const = 0;
+ virtual yang::NodeTypes nodeType(const std::string& path) const = 0;
+ virtual yang::NodeTypes nodeType(const schemaPath_& location, const ModuleNodePair& node) const = 0;
virtual bool isModule(const std::string& name) const = 0;
virtual bool isList(const schemaPath_& location, const ModuleNodePair& node) const = 0;
virtual bool isPresenceContainer(const schemaPath_& location, const ModuleNodePair& node) const = 0;