1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Remove usage of std::filesystem

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2024-02-13 18:06:36 +00:00 committed by Steffen Vogel
parent 272a3fac36
commit 226ccecd19
4 changed files with 11 additions and 5 deletions

View file

@ -33,7 +33,7 @@ protected:
Logger logger;
std::list<std::string> includeDirectories;
std::filesystem::path configPath;
std::string configPath;
// Check if file exists on local system.
static bool isLocalFile(const std::string &uri) {
@ -90,7 +90,7 @@ public:
json_t *load(const std::string &u, bool resolveIncludes = true,
bool resolveEnvVars = true);
std::filesystem::path &getConfigPath() { return configPath; }
std::string &getConfigPath() { return configPath; }
};
} // namespace node

View file

@ -143,7 +143,7 @@ public:
json_t *getConfig() { return config.root; }
std::filesystem::path &getConfigPath() { return config.getConfigPath(); }
std::string &getConfigPath() { return config.getConfigPath(); }
std::string getConfigUri() const { return uri; }

View file

@ -72,7 +72,13 @@ json_t *Config::load(const std::string &u, bool resolveInc,
FILE *Config::loadFromStdio() {
logger->info("Reading configuration from standard input");
configPath = std::filesystem::current_path();
auto *cwd = new char[PATH_MAX];
configPath = getcwd(cwd, PATH_MAX);
delete[] cwd;
return stdin;
}

View file

@ -203,7 +203,7 @@ int FpgaNodeFactory::start(SuperNode *sn) {
vfioContainer = std::make_shared<kernel::vfio::Container>();
if (cards.empty()) {
std::filesystem::path searchPath = sn->getConfigPath().parent_path();
std::string searchPath = sn->getConfigPath() + "/..";
createCards(sn->getConfig(), cards, searchPath);
}