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/ast_path.hpp b/src/ast_path.hpp
index c15351f..338c766 100644
--- a/src/ast_path.hpp
+++ b/src/ast_path.hpp
@@ -16,6 +16,11 @@
 
 #include "ast_values.hpp"
 
+enum class Prefixes {
+    Always,
+    WhenNeeded
+};
+
 struct nodeup_ {
     bool operator==(const nodeup_&) const
     {
@@ -106,10 +111,9 @@
 
 std::string nodeToSchemaString(decltype(dataPath_::m_nodes)::value_type node);
 
-std::string pathToAbsoluteSchemaString(const dataPath_& path);
-std::string pathToAbsoluteSchemaString(const schemaPath_& path);
-std::string pathToDataString(const dataPath_& path);
-std::string pathToSchemaString(const schemaPath_& path);
+std::string pathToDataString(const dataPath_& path, Prefixes prefixes);
+std::string pathToSchemaString(const schemaPath_& path, Prefixes prefixes);
+std::string pathToSchemaString(const dataPath_& path, Prefixes prefixes);
 schemaNode_ dataNodeToSchemaNode(const dataNode_& node);
 schemaPath_ dataPathToSchemaPath(const dataPath_& path);
 std::string escapeListKeyString(const std::string& what);