7 std::vector<std::string> config_content;
9 std::string path_message = PATH_MESSAGE + path.string();
11 auto end = std::chrono::system_clock::now();
12 std::time_t end_time = std::chrono::system_clock::to_time_t(end);
13 std::string time_message = TIME_MESSAGE + std::string(std::ctime(&end_time));
15 config_content.push_back(path_message);
16 config_content.push_back(time_message);
22 std::vector<std::string> content;
25 std::ifstream infile(file_path);
26 if (!infile.is_open()) {
27 std::cerr <<
"Error: could not open " << file_path <<
"\n";
32 while (std::getline(infile, line)) {
33 if (line.rfind(PATH_MESSAGE, 0) == 0) {
34 line = line.substr(std::string(PATH_MESSAGE).size());
36 else if (line.rfind(TIME_MESSAGE, 0) == 0) {
37 line = line.substr(std::string(TIME_MESSAGE).size());
40 content.push_back(line);
static Config & config()
Gets the singleton configuration instance.
fs::path base_path
Default base path for temporary files.
fs::path name_container
Name of the cache container.
static constexpr const char * CONFIG_PATH
Configuration file path.
static std::vector< std::string > read_current_run_params()
read preprocessing parameters runs
static void save_current_run_params(const fs::path &path)
Saves preprocessing parameters for future runs.
Configuration management interface.
void write_file_generic(const fs::path &file_path, const std::vector< std::string > &content)
Writes content to a file at specified path.
Defines utility functions used across all files.