6 auto end = std::chrono::system_clock::now();
7 std::time_t end_time = std::chrono::system_clock::to_time_t(end);
8 std::string time_str(std::ctime(&end_time));
10 if (!time_str.empty() && time_str.back() ==
'\n')
23 std::ifstream infile(file_path);
24 if (!infile.is_open()) {
25 std::cerr <<
"Error: could not open " << file_path <<
"\n";
29 json data = json::parse(infile,
nullptr,
false);
30 if (data.is_discarded()) {
31 std::cerr <<
"Error: could not parse " << file_path <<
"\n";
41 int current_major, current_minor, current_patch;
42 int cache_major, cache_minor, cache_patch;
46 >> current_major >> dot >> current_minor >> dot >> current_patch;
48 std::istringstream(cache_version)
49 >> cache_major >> dot >> cache_minor >> dot >> cache_patch;
51 return (current_major == cache_major && current_minor == cache_minor);
static Config & config()
Gets the singleton configuration instance.
static PreprocessRunParams read_current_run_params()
read preprocessing parameters runs
static void save_current_run_params(const fs::path &path, const fs::path &cache_path)
Saves preprocessing parameters for future runs.
static bool is_cache_compatible(const std::string &cache_version)
static constexpr const char * CONFIG_PATH
Configuration file path.
Configuration management interface.
void write_file(const fs::path &path, const std::string &content)
Writes content to a file at specified path.
std::uintmax_t folder_size(const fs::path &folder)
Calculates the total size of all regular files in a folder.
constexpr int MAX_MINOR_VERSION_DIFF
std::filesystem::path base_path
Default base path for temporary files.
std::string project_version
Current project version.
std::filesystem::path name_container
Name of the cache container.
Defines utility functions used across all files.