c++17: drop experimental::filesystem
Use std::filesystem, and drop support for building with experimental
under c++14.
Tested: Build the repo.
Change-Id: I4af0d9c034dbfef5a65153ba5447b86c961aebf1
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/phosphor-ldap-mapper/ldap_mapper_mgr.cpp b/phosphor-ldap-mapper/ldap_mapper_mgr.cpp
index a1d6e11..b8d755b 100644
--- a/phosphor-ldap-mapper/ldap_mapper_mgr.cpp
+++ b/phosphor-ldap-mapper/ldap_mapper_mgr.cpp
@@ -1,3 +1,4 @@
+#include <filesystem>
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/User/Common/error.hpp>
#include <phosphor-logging/log.hpp>
@@ -52,9 +53,9 @@
void LDAPMapperMgr::deletePrivilegeMapper(Id id)
{
// Delete the persistent representation of the privilege mapper.
- fs::path mapperPath(persistPath);
+ std::filesystem::path mapperPath(persistPath);
mapperPath /= std::to_string(id);
- fs::remove(mapperPath);
+ std::filesystem::remove(mapperPath);
PrivilegeMapperList.erase(id);
}
@@ -97,15 +98,13 @@
void LDAPMapperMgr::restore()
{
- namespace fs = std::experimental::filesystem;
-
- fs::path dir(persistPath);
- if (!fs::exists(dir) || fs::is_empty(dir))
+ std::filesystem::path dir(persistPath);
+ if (!std::filesystem::exists(dir) || std::filesystem::is_empty(dir))
{
return;
}
- for (auto &file : fs::directory_iterator(dir))
+ for (auto &file : std::filesystem::directory_iterator(dir))
{
std::string id = file.path().filename().c_str();
size_t idNum = std::stol(id);