Change return value of Schema::childNodes
I'll need to use this method to generate what can be parsed as paths in
the upcoming path parser rework. As a side effect, path completion
generation gets a little bit simpler, because now I don't have to parse
the strings of format "[module:]node" and just trust whatever the schema
gives me.
Change-Id: I881cdbbd8254b846c21cee1ac0a3b7af1e40a696
diff --git a/src/interpreter.cpp b/src/interpreter.cpp
index 9912584..0a4f59e 100644
--- a/src/interpreter.cpp
+++ b/src/interpreter.cpp
@@ -76,7 +76,7 @@
recursion = Recursion::Recursive;
}
- std::set<std::string> toPrint;
+ std::set<ModuleNodePair> toPrint;
auto pathArg = dataPathToSchemaPath(m_parser.currentPath());
if (ls.m_path) {
@@ -95,8 +95,9 @@
toPrint = m_datastore.schema()->availableNodes(pathArg, recursion);
}
- for (const auto& it : toPrint)
- std::cout << it << std::endl;
+ for (const auto& it : toPrint) {
+ std::cout << (it.first ? *it.first + ":" : "" ) + it.second << std::endl;
+ }
}
void Interpreter::operator()(const copy_& copy) const