23 #include <boost/property_tree/ptree_fwd.hpp> 28 #include <boost/filesystem.hpp> 29 #include <boost/filesystem/path.hpp> 30 namespace filesys = boost::filesystem;
33 namespace filesys = std::filesystem;
53 static filesys::path
BuildPath(
const std::string& output_prefix,
const std::string& filename);
56 static boost::property_tree::ptree
ReadPtreeFile(
const filesys::path& f_p);
59 static boost::property_tree::ptree
ReadPtreeFile(
const std::string& f_n);
62 static void WritePtreeFile(
const filesys::path& f_p,
const boost::property_tree::ptree& pt);
65 static void WritePtreeFile(
const std::string& f_n,
const boost::property_tree::ptree& pt);
79 std::function<
void(
const std::string&)> logger = std::function<
void(
const std::string&)>());
static Dirs Initialize()
Initialize all paths.
static filesys::path GetDataDir()
/// Return data dir (only relevant when use_install_dirs mode is active)
filesys::path m_config_dir
static filesys::path GetCurrentDir()
Get path to the current directory.
static filesys::path GetExecPath()
Get path of the executable.
static filesys::path GetTestsDir()
Return tests dir (only relevant when use_install_dirs mode is active)
Utilities for interaction with filesystem.
static bool CreateDirectory(std::string s)
Create a directory relative to the current directory with the given path, returns if it was succesful...
static boost::property_tree::ptree ReadPtreeFile(const filesys::path &f_p)
Read ptree from file at path.
static Dirs & Get()
Return paths.
static filesys::path GetConfigDir()
Return config dir (only relevant when use_install_dirs mode is active)
static filesys::path GetRootDir()
Return install root dir (only relevant when use_install_dirs mode is active)
filesys::path m_exec_path
static bool CheckInstallEnv(std::function< void(const std::string &)> logger=std::function< void(const std::string &)>())
Verify that current dir is root dir and all install dirs are present.
static filesys::path BuildPath(const std::string &output_prefix, const std::string &filename)
Interpret prefix (directory or filename prefix) and return appropriate path.
filesys::path m_tests_dir
static void WritePtreeFile(const filesys::path &f_p, const boost::property_tree::ptree &pt)
Write ptree to file at path.
static bool IsDirectoryString(const std::string &s)
String represents a directory path (relative or absolute) iff it contains at least one / (may be a tr...
Namespace for the simulator and related classes.
filesys::path m_current_dir
Using this to avoid global variables & their initialization.
static filesys::path GetBinDir()
Return bin dir (only relevant when use_install_dirs mode is active)