Merge changes I4d4f2d49,I472c0b32,Iefc31f83

* changes:
  Allow usage of search dirs in YangSchema
  Rename fillMap and move it for reuse
  Get rid of std::filesystem linking
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99262a3..67fa45e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -133,11 +133,6 @@
 target_compile_definitions(sysrepo-cli PRIVATE SYSREPO_CLI)
 target_include_directories(sysrepo-cli PRIVATE ${REPLXX_PATH})
 target_link_libraries(sysrepo-cli sysrepoaccess yangschema docopt parser ${REPLXX_LIBRARY})
-if(CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
-    target_link_libraries(sysrepo-cli c++experimental)
-elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
-    target_link_libraries(sysrepo-cli stdc++fs)
-endif()
 
 add_dependencies(sysrepo-cli target-NETCONF_CLI_VERSION)
 target_include_directories(sysrepo-cli PRIVATE ${PROJECT_BINARY_DIR})
diff --git a/src/libyang_utils.cpp b/src/libyang_utils.cpp
index 2669151..15b1b06 100644
--- a/src/libyang_utils.cpp
+++ b/src/libyang_utils.cpp
@@ -1,5 +1,7 @@
-#include "libyang_utils.hpp"
 #include <cmath>
+#include "datastore_access.hpp"
+#include "libyang_utils.hpp"
+#include "utils.hpp"
 
 leaf_data_ leafValueFromValue(const libyang::S_Value& value, LY_DATA_TYPE type)
 {
@@ -42,3 +44,34 @@
         return "(can't print)"s;
     }
 }
+
+// This is very similar to the fillMap lambda in SysrepoAccess, however,
+// Sysrepo returns a weird array-like structure, while libnetconf
+// returns libyang::Data_Node
+void lyNodesToTree(DatastoreAccess::Tree& res, const std::vector<std::shared_ptr<libyang::Data_Node>> items, std::optional<std::string> ignoredXPathPrefix)
+{
+    auto stripXPathPrefix = [&ignoredXPathPrefix] (auto path) {
+        return ignoredXPathPrefix ? path.substr(ignoredXPathPrefix->size()) : path;
+    };
+
+    for (const auto& it : items) {
+        if (!it)
+            continue;
+        if (it->schema()->nodetype() == LYS_CONTAINER) {
+            if (libyang::Schema_Node_Container{it->schema()}.presence()) {
+                // The fact that the container is included in the data tree
+                // means that it is present and I don't need to check any
+                // value.
+                res.emplace_back(stripXPathPrefix(it->path()), special_{SpecialValue::PresenceContainer});
+            }
+        }
+        if (it->schema()->nodetype() == LYS_LIST) {
+            res.push_back({stripXPathPrefix(it->path()), special_{SpecialValue::List}});
+        }
+        if (it->schema()->nodetype() == LYS_LEAF || it->schema()->nodetype() == LYS_LEAFLIST) {
+            libyang::Data_Node_Leaf_List leaf(it);
+            auto value = leafValueFromValue(leaf.value(), leaf.leaf_type()->base());
+            res.emplace_back(stripXPathPrefix(it->path()), value);
+        }
+    }
+}
diff --git a/src/libyang_utils.hpp b/src/libyang_utils.hpp
index 42b6198..d8bf4ad 100644
--- a/src/libyang_utils.hpp
+++ b/src/libyang_utils.hpp
@@ -7,5 +7,7 @@
 
 #include <libyang/Tree_Data.hpp>
 #include "ast_values.hpp"
+#include "datastore_access.hpp"
 
 leaf_data_ leafValueFromValue(const libyang::S_Value& value, LY_DATA_TYPE type);
+void lyNodesToTree(DatastoreAccess::Tree& res, const std::vector<std::shared_ptr<libyang::Data_Node>> items, std::optional<std::string> ignoredXPathPrefix = std::nullopt);
diff --git a/src/netconf_access.cpp b/src/netconf_access.cpp
index e4a1859..2a2fa96 100644
--- a/src/netconf_access.cpp
+++ b/src/netconf_access.cpp
@@ -14,40 +14,6 @@
 #include "utils.hpp"
 #include "yang_schema.hpp"
 
-namespace {
-
-// This is very similar to the fillMap lambda in SysrepoAccess, however,
-// Sysrepo returns a weird array-like structure, while libnetconf
-// returns libyang::Data_Node
-void fillMap(DatastoreAccess::Tree& res, const std::vector<std::shared_ptr<libyang::Data_Node>> items, std::optional<std::string> ignoredXPathPrefix = std::nullopt)
-{
-    auto stripXPathPrefix = [&ignoredXPathPrefix] (auto path) {
-        return ignoredXPathPrefix ? path.substr(ignoredXPathPrefix->size()) : path;
-    };
-
-    for (const auto& it : items) {
-        if (!it)
-            continue;
-        if (it->schema()->nodetype() == LYS_CONTAINER) {
-            if (libyang::Schema_Node_Container{it->schema()}.presence()) {
-                // The fact that the container is included in the data tree
-                // means that it is present and I don't need to check any
-                // value.
-                res.emplace_back(stripXPathPrefix(it->path()), special_{SpecialValue::PresenceContainer});
-            }
-        }
-        if (it->schema()->nodetype() == LYS_LIST) {
-            res.push_back({stripXPathPrefix(it->path()), special_{SpecialValue::List}});
-        }
-        if (it->schema()->nodetype() == LYS_LEAF || it->schema()->nodetype() == LYS_LEAFLIST) {
-            libyang::Data_Node_Leaf_List leaf(it);
-            auto value = leafValueFromValue(leaf.value(), leaf.leaf_type()->base());
-            res.emplace_back(stripXPathPrefix(it->path()), value);
-        }
-    }
-}
-}
-
 
 NetconfAccess::~NetconfAccess() = default;
 
@@ -63,11 +29,11 @@
                 auto leafListPath = stripLeafListValueFromPath((*it)->path());
                 res.emplace_back(leafListPath, special_{SpecialValue::LeafList});
                 while (it != siblings.end() && boost::starts_with((*it)->path(), leafListPath)) {
-                    fillMap(res, (*it)->tree_dfs());
+                    lyNodesToTree(res, (*it)->tree_dfs());
                     it++;
                 }
             } else {
-                fillMap(res, (*it)->tree_dfs());
+                lyNodesToTree(res, (*it)->tree_dfs());
             }
         }
     }
@@ -203,7 +169,7 @@
     auto output = m_session->rpc(data);
     if (output) {
         for (auto it : output->tree_for()) {
-            fillMap(res, it->tree_dfs(), joinPaths(path, "/"));
+            lyNodesToTree(res, it->tree_dfs(), joinPaths(path, "/"));
         }
     }
     return res;
diff --git a/src/yang_schema.cpp b/src/yang_schema.cpp
index fd1b8fe..bbfce7c 100644
--- a/src/yang_schema.cpp
+++ b/src/yang_schema.cpp
@@ -33,7 +33,7 @@
 };
 
 YangSchema::YangSchema()
-    : m_context(std::make_shared<libyang::Context>(nullptr, LY_CTX_DISABLE_SEARCHDIRS | LY_CTX_DISABLE_SEARCHDIR_CWD))
+    : m_context(std::make_shared<libyang::Context>(nullptr, LY_CTX_DISABLE_SEARCHDIR_CWD))
 {
 }