filesystem is not experimental anymore since c++17
- filesystem is merged into the mainline ISO C++ standard
since C++ 17.
- As the minimum requirement for the project to compile is
mentioned as C++17, we can now safely remove the experimental
filesystem and use them directly instead.
- This would eliminate the stdc++fs dependency when migrated to
meson.
Tested By;
- Compiled in all sdks, and unit tests are passed.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Icd63297a533c56e2d1952e99e17ec71747bd0e39
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index 648595c..677cdd8 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -19,7 +19,7 @@
#include <unistd.h>
#include <algorithm>
-#include <experimental/filesystem>
+#include <filesystem>
#include <fstream>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
@@ -439,7 +439,7 @@
type = type.substr(type.rfind('.') + 1);
std::transform(type.begin(), type.end(), type.begin(), ::tolower);
- std::experimental::filesystem::path objectPath;
+ std::filesystem::path objectPath;
objectPath /= objPath;
objectPath /= type;
objectPath /= generateId(ipaddress, prefixLength, gateway);
@@ -449,7 +449,7 @@
std::string EthernetInterface::generateStaticNeighborObjectPath(
const std::string& iPAddress, const std::string& mACAddress) const
{
- std::experimental::filesystem::path objectPath;
+ std::filesystem::path objectPath;
objectPath /= objPath;
objectPath /= "static_neighbor";
objectPath /= generateNeighborId(iPAddress, mACAddress);
@@ -783,7 +783,7 @@
using namespace std::string_literals;
using AddressOrigin =
sdbusplus::xyz::openbmc_project::Network::server::IP::AddressOrigin;
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
// if there is vlan interafce then write the configuration file
// for vlan also.