Deprecate std::filesystem namespace include
Clang-tidy is complaining about our using fs = ... directives. These
were originally added to handle boost::filesystem vs
std::experimental::filesystem vs std::filesystem between the various
compilers. Now that we're all on std::filesystem, this redefinition can
be removed.
```
ChassisIntrusionSensor.hpp:11:11: error: namespace alias decl 'fs' is unused [misc-unused-alias-decls,-warnings-as-errors]
11 | namespace fs = std::filesystem;
```
Tested: code compiles
Change-Id: If4b968ff9cceb4038f526321d3c7c11563ffbce9
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/src/adc/ADCSensorMain.cpp b/src/adc/ADCSensorMain.cpp
index ec38908..503b5f9 100644
--- a/src/adc/ADCSensorMain.cpp
+++ b/src/adc/ADCSensorMain.cpp
@@ -54,8 +54,6 @@
static constexpr float pollRateDefault = 0.5;
static constexpr float gpioBridgeSetupTimeDefault = 0.02;
-namespace fs = std::filesystem;
-
static constexpr auto sensorTypes{std::to_array<const char*>({"ADC"})};
static std::regex inputRegex(R"(in(\d+)_input)");
@@ -68,9 +66,9 @@
};
// filter out adc from any other voltage sensor
-bool isAdc(const fs::path& parentPath)
+bool isAdc(const std::filesystem::path& parentPath)
{
- fs::path namePath = parentPath / "name";
+ std::filesystem::path namePath = parentPath / "name";
std::ifstream nameFile(namePath);
if (!nameFile.good())
@@ -99,9 +97,9 @@
[&io, &objectServer, &sensors, &dbusConnection, sensorsChanged,
updateType](const ManagedObjectType& sensorConfigurations) {
bool firstScan = sensorsChanged == nullptr;
- std::vector<fs::path> paths;
- if (!findFiles(fs::path("/sys/class/hwmon"), R"(in\d+_input)",
- paths))
+ std::vector<std::filesystem::path> paths;
+ if (!findFiles(std::filesystem::path("/sys/class/hwmon"),
+ R"(in\d+_input)", paths))
{
std::cerr << "No adc sensors in system\n";
return;