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/static_schema.hpp b/src/static_schema.hpp
index 68f1401..7326120 100644
--- a/src/static_schema.hpp
+++ b/src/static_schema.hpp
@@ -23,17 +23,17 @@
public:
StaticSchema();
- bool isContainer(const path_& location, const ModuleNodePair& node) const override;
- bool isModule(const path_& location, const std::string& name) const override;
- bool isLeaf(const path_& location, const ModuleNodePair& node) const override;
- bool isList(const path_& location, const ModuleNodePair& node) const override;
- bool isPresenceContainer(const path_& location, const ModuleNodePair& node) const override;
- bool leafEnumHasValue(const path_& location, const ModuleNodePair& node, const std::string& value) const override;
- bool listHasKey(const path_& location, const ModuleNodePair& node, const std::string& key) const override;
+ bool isContainer(const schemaPath_& location, const ModuleNodePair& node) const override;
+ bool isModule(const schemaPath_& location, const std::string& name) const override;
+ bool isLeaf(const schemaPath_& location, const ModuleNodePair& node) const override;
+ bool isList(const schemaPath_& location, const ModuleNodePair& node) const override;
+ bool isPresenceContainer(const schemaPath_& location, const ModuleNodePair& node) const override;
+ bool leafEnumHasValue(const schemaPath_& location, const ModuleNodePair& node, const std::string& value) const override;
+ bool listHasKey(const schemaPath_& location, const ModuleNodePair& node, const std::string& key) const override;
bool nodeExists(const std::string& location, const std::string& node) const override;
- const std::set<std::string> listKeys(const path_& location, const ModuleNodePair& node) const override;
- yang::LeafDataTypes leafType(const path_& location, const ModuleNodePair& node) const override;
- std::set<std::string> childNodes(const path_& path, const Recursion) const override;
+ const std::set<std::string> listKeys(const schemaPath_& location, const ModuleNodePair& node) const override;
+ yang::LeafDataTypes leafType(const schemaPath_& location, const ModuleNodePair& node) const override;
+ std::set<std::string> childNodes(const schemaPath_& path, const Recursion) const override;
void addContainer(const std::string& location, const std::string& name, yang::ContainerTraits isPresence = yang::ContainerTraits::None);
void addLeaf(const std::string& location, const std::string& name, const yang::LeafDataTypes& type);