FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
ResolveNetInputPath.h
1#pragma once
2
3#include <filesystem>
4#include <string>
5
20namespace net_input
21{
31inline std::string ResolveNetInputPath(const std::string& mainInputFilePath)
32{
33 const std::filesystem::path directory = std::filesystem::path(mainInputFilePath).parent_path();
34 return directory.empty() ? std::string(".") : directory.string();
35}
36
44inline std::string NetFilePath(const std::string& directory, const std::string& fileName)
45{
46 if (std::filesystem::path(fileName).is_absolute())
47 return fileName;
48 return directory + "/" + fileName;
49}
50} // namespace net_input