bmc/fs: Replace regex with fs functions
Change-Id: I4a5105ffb587dd1d5532d536c32aab1c933d0968
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/bmc/fs.cpp b/bmc/fs.cpp
index 4bad725..5bb958c 100644
--- a/bmc/fs.cpp
+++ b/bmc/fs.cpp
@@ -17,7 +17,6 @@
#include "fs.hpp"
#include <filesystem>
-#include <regex>
#include <string>
#include <system_error>
#include <vector>
@@ -34,14 +33,10 @@
{
for (const auto& p : fs::recursive_directory_iterator(directory))
{
- auto ps = p.path().string();
-
- /** TODO: openbmc/phosphor-ipmi-blobs/blob/de8a16e2e8/fs.cpp#L27 is
- * nicer, may be worth finding a way to make this into a util.
- */
- if (std::regex_match(ps, std::regex(".+.json$")))
+ auto path = p.path();
+ if (path.extension().string() == ".json")
{
- output.push_back(ps);
+ output.push_back(path.string());
}
}
}