replace fs alias with std::filesystem
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I9072353526c2c18453aa97dc6f9c5d610508609a
diff --git a/ramoops_manager.cpp b/ramoops_manager.cpp
index acd3598..57250cc 100644
--- a/ramoops_manager.cpp
+++ b/ramoops_manager.cpp
@@ -23,10 +23,8 @@
Manager::Manager(const std::string& filePath)
{
- namespace fs = std::filesystem;
-
- fs::path dir(filePath);
- if (!fs::exists(dir) || fs::is_empty(dir))
+ std::filesystem::path dir(filePath);
+ if (!std::filesystem::exists(dir) || std::filesystem::is_empty(dir))
{
return;
}
diff --git a/ramoops_manager.hpp b/ramoops_manager.hpp
index 8158116..f9b0862 100644
--- a/ramoops_manager.hpp
+++ b/ramoops_manager.hpp
@@ -6,8 +6,6 @@
#include <string>
#include <vector>
-namespace fs = std::filesystem;
-
namespace phosphor
{
namespace dump
diff --git a/ramoops_manager_main.cpp b/ramoops_manager_main.cpp
index b737230..6adfef1 100644
--- a/ramoops_manager_main.cpp
+++ b/ramoops_manager_main.cpp
@@ -7,8 +7,8 @@
int main()
{
- fs::path filePath(SYSTEMD_PSTORE_PATH);
- if (!fs::exists(filePath))
+ std::filesystem::path filePath(SYSTEMD_PSTORE_PATH);
+ if (!std::filesystem::exists(filePath))
{
lg2::error("Pstore file path is not exists, FILE_PATH: {FILE_PATH}",
"FILE_PATH", filePath);
diff --git a/test/debug_inif_test.cpp b/test/debug_inif_test.cpp
index 98a0e1d..1dfcf66 100644
--- a/test/debug_inif_test.cpp
+++ b/test/debug_inif_test.cpp
@@ -10,8 +10,6 @@
#include <gtest/gtest.h>
-namespace fs = std::filesystem;
-
class TestDumpSerial : public ::testing::Test
{
public:
@@ -28,17 +26,17 @@
throw std::bad_alloc();
}
dumpDir = std::string(dirPtr);
- fs::create_directories(dumpDir);
+ std::filesystem::create_directories(dumpDir);
dumpFile = dumpDir;
dumpFile /= "elogid";
}
void TearDown()
{
- fs::remove_all(dumpDir);
+ std::filesystem::remove_all(dumpDir);
}
std::string dumpDir;
- fs::path dumpFile;
+ std::filesystem::path dumpFile;
};
TEST_F(TestDumpSerial, Serialization)