Merge pathToAbsoluteSchemaString and pathToSchemaString
These functions did almost the same thing, the only difference was that
the former inserted module prefixes everyhwere and the other didn't.
The new function takes an argument specifying whether to insert prefixes
everyhwere.
pathToSchemaString also checks whether a path is absolute or relative
and prepends a slash. This means, that it's no longer possible to
convert and absolute path to a string with no leading slash. The
StaticSchema class had to be changed accordingly, because it stored
absolute paths in strings without a leading slash (because it was
designed before absolute paths existed).
The fact that this was split into two functions helped find an error in
a later patch.
Change-Id: I6112cb5982919b51b61152f355771a52dd467c6e
diff --git a/src/parser.cpp b/src/parser.cpp
index c7644e2..ce6ea01 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -80,7 +80,7 @@
std::string Parser::currentNode() const
{
- return pathToDataString(m_curDir);
+ return pathToDataString(m_curDir, Prefixes::WhenNeeded);
}
struct getSchemaPathVisitor : boost::static_visitor<schemaPath_> {