Replace std::experimental::filesystem with std::filesystem
Above c++17, std::filesystem is already supported, so replace
std::experimental::filesystem with std::filesystem.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I864bd80905e9b61428d17b20a91b3482198d20bc
diff --git a/Makefile.am b/Makefile.am
index 14cd3f7..560ba4b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,8 +8,7 @@
phosphor_ledcontroller_LDFLAGS = $(SDBUSPLUS_LIBS) \
$(SYSTEMD_LIBS) \
- $(PHOSPHOR_DBUS_INTERFACES_LIBS) \
- -lstdc++fs
+ $(PHOSPHOR_DBUS_INTERFACES_LIBS)
phosphor_ledcontroller_CFLAGS = $(SDBUSPLUS_CFLAGS) \
$(SYSTEMD_CFLAGS) \
$(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
diff --git a/controller.cpp b/controller.cpp
index 685a4fc..c9f736d 100644
--- a/controller.cpp
+++ b/controller.cpp
@@ -83,7 +83,7 @@
int main(int argc, char** argv)
{
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
// Read arguments.
auto options = phosphor::led::ArgumentParser(argc, argv);
diff --git a/sysfs.cpp b/sysfs.cpp
index 44ad8d6..985a991 100644
--- a/sysfs.cpp
+++ b/sysfs.cpp
@@ -20,7 +20,7 @@
#include <iostream>
#include <string>
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
namespace phosphor
{
diff --git a/sysfs.hpp b/sysfs.hpp
index a8de9bd..fbf5e78 100644
--- a/sysfs.hpp
+++ b/sysfs.hpp
@@ -15,7 +15,7 @@
*/
#pragma once
-#include <experimental/filesystem>
+#include <filesystem>
namespace phosphor
{
@@ -24,7 +24,7 @@
class SysfsLed
{
public:
- SysfsLed(std::experimental::filesystem::path&& root) : root(std::move(root))
+ SysfsLed(std::filesystem::path&& root) : root(std::move(root))
{}
SysfsLed() = delete;
SysfsLed(const SysfsLed& other) = delete;
@@ -48,7 +48,7 @@
static constexpr char DELAY_ON[] = "delay_on";
static constexpr char DELAY_OFF[] = "delay_off";
- std::experimental::filesystem::path root;
+ std::filesystem::path root;
};
} // namespace led
} // namespace phosphor
diff --git a/test/Makefile.am.include b/test/Makefile.am.include
index 98cc6fb..74da526 100644
--- a/test/Makefile.am.include
+++ b/test/Makefile.am.include
@@ -14,7 +14,6 @@
$(PHOSPHOR_DBUS_INTERFACES_CXXFLAGS) \
$(CODE_COVERAGE_CXXFLAGS)
AM_LDFLAGS = \
- -lstdc++fs \
$(SDBUSPLUS_LIBS) \
$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
$(CODE_COVERAGE_LIBS) \
diff --git a/test/physical.cpp b/test/physical.cpp
index c91fb94..ae831a3 100644
--- a/test/physical.cpp
+++ b/test/physical.cpp
@@ -10,7 +10,7 @@
constexpr auto LED_OBJ = "/foo/bar/led";
using Action = sdbusplus::xyz::openbmc_project::Led::server::Physical::Action;
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
fs::path create_sandbox()
{
diff --git a/test/sysfs.cpp b/test/sysfs.cpp
index e8339e7..7a65b94 100644
--- a/test/sysfs.cpp
+++ b/test/sysfs.cpp
@@ -24,7 +24,7 @@
#include <gtest/gtest.h>
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
constexpr unsigned long MAX_BRIGHTNESS_VAL = 128;