Split path_ into schemaPath_ and dataPath_

This change is necessary because different commands accept different
kinds of paths (for example "cd" only accepts a data path, on the other
hand "ls" doesn't care about data, so it accepts both). One option was to
create a new path struct for every command, but that could get quickly
out of control as new commands get added. The other option was define only
the data path and schema path and then change the commands' grammars, so
that they only accept the relevant paths, but in the end always return a
data path or a schema path.

Change-Id: I7668a446fbf674c7a5deae22d9aacdfb3da9b07e
diff --git a/src/yang_schema.cpp b/src/yang_schema.cpp
index 7127082..522e58a 100644
--- a/src/yang_schema.cpp
+++ b/src/yang_schema.cpp
@@ -30,7 +30,8 @@
     ~InvalidSchemaQueryException() override = default;
 };
 
-std::string pathToYangAbsSchemPath(const path_& path)
+template <typename T>
+std::string pathToYangAbsSchemPath(const T& path)
 {
     std::string res = "/";
     std::string currentModule;
@@ -78,38 +79,38 @@
     }
 }
 
-bool YangSchema::isModule(const path_&, const std::string& name) const
+bool YangSchema::isModule(const schemaPath_&, const std::string& name) const
 {
     const auto set = modules();
     return set.find(name) != set.end();
 }
 
-bool YangSchema::isContainer(const path_& location, const ModuleNodePair& node) const
+bool YangSchema::isContainer(const schemaPath_& location, const ModuleNodePair& node) const
 {
     const auto schemaNode = getSchemaNode(location, node);
     return schemaNode && schemaNode->nodetype() == LYS_CONTAINER;
 }
 
-bool YangSchema::isLeaf(const path_& location, const ModuleNodePair& node) const
+bool YangSchema::isLeaf(const schemaPath_& location, const ModuleNodePair& node) const
 {
     const auto schemaNode = getSchemaNode(location, node);
     return schemaNode && schemaNode->nodetype() == LYS_LEAF;
 }
 
-bool YangSchema::isList(const path_& location, const ModuleNodePair& node) const
+bool YangSchema::isList(const schemaPath_& location, const ModuleNodePair& node) const
 {
     const auto schemaNode = getSchemaNode(location, node);
     return schemaNode && schemaNode->nodetype() == LYS_LIST;
 }
 
-bool YangSchema::isPresenceContainer(const path_& location, const ModuleNodePair& node) const
+bool YangSchema::isPresenceContainer(const schemaPath_& location, const ModuleNodePair& node) const
 {
     if (!isContainer(location, node))
         return false;
     return libyang::Schema_Node_Container(getSchemaNode(location, node)).presence();
 }
 
-bool YangSchema::leafEnumHasValue(const path_& location, const ModuleNodePair& node, const std::string& value) const
+bool YangSchema::leafEnumHasValue(const schemaPath_& location, const ModuleNodePair& node, const std::string& value) const
 {
     if (!isLeaf(location, node) || leafType(location, node) != yang::LeafDataTypes::Enum)
         return false;
@@ -128,7 +129,7 @@
     return std::any_of(enm.begin(), enm.end(), [=](const auto& x) { return x->name() == value; });
 }
 
-bool YangSchema::listHasKey(const path_& location, const ModuleNodePair& node, const std::string& key) const
+bool YangSchema::listHasKey(const schemaPath_& location, const ModuleNodePair& node, const std::string& key) const
 {
     if (!isList(location, node))
         return false;
@@ -143,14 +144,14 @@
     return set->number() == 1;
 }
 
-libyang::S_Set YangSchema::getNodeSet(const path_& location, const ModuleNodePair& node) const
+libyang::S_Set YangSchema::getNodeSet(const schemaPath_& location, const ModuleNodePair& node) const
 {
     std::string absPath = location.m_nodes.empty() ? "" : "/";
     absPath += pathToAbsoluteSchemaString(location) + "/" + fullNodeName(location, node);
     return m_context->find_path(absPath.c_str());
 }
 
-libyang::S_Schema_Node YangSchema::getSchemaNode(const path_& location, const ModuleNodePair& node) const
+libyang::S_Schema_Node YangSchema::getSchemaNode(const schemaPath_& location, const ModuleNodePair& node) const
 {
     const auto set = getNodeSet(location, node);
     if (!set)
@@ -161,7 +162,7 @@
     return *schemaSet.begin();
 }
 
-const std::set<std::string> YangSchema::listKeys(const path_& location, const ModuleNodePair& node) const
+const std::set<std::string> YangSchema::listKeys(const schemaPath_& location, const ModuleNodePair& node) const
 {
     std::set<std::string> keys;
     if (!isList(location, node))
@@ -174,7 +175,7 @@
     return keys;
 }
 
-yang::LeafDataTypes YangSchema::leafType(const path_& location, const ModuleNodePair& node) const
+yang::LeafDataTypes YangSchema::leafType(const schemaPath_& location, const ModuleNodePair& node) const
 {
     using namespace std::string_literals;
     if (!isLeaf(location, node))
@@ -210,7 +211,7 @@
     return res;
 }
 
-std::set<std::string> YangSchema::childNodes(const path_& path, const Recursion recursion) const
+std::set<std::string> YangSchema::childNodes(const schemaPath_& path, const Recursion recursion) const
 {
     using namespace std::string_view_literals;
     std::set<std::string> res;