Use file backup system for config files (#335)

* Use file backup system for config files

* Add -fexceptions to windows cxxflags in workflow
This commit is contained in:
Wiseguy
2024-06-01 17:22:33 -04:00
committed by GitHub
parent 3e5efc935e
commit ce406e9c5d
6 changed files with 159 additions and 79 deletions
+14
View File
@@ -0,0 +1,14 @@
#ifndef __RECOMP_FILES_H__
#define __RECOMP_FILES_H__
#include <filesystem>
#include <fstream>
namespace recomp {
std::ifstream open_input_file_with_backup(const std::filesystem::path& filepath, std::ios_base::openmode mode = std::ios_base::in);
std::ifstream open_input_backup_file(const std::filesystem::path& filepath, std::ios_base::openmode mode = std::ios_base::in);
std::ofstream open_output_file_with_backup(const std::filesystem::path& filepath, std::ios_base::openmode mode = std::ios_base::out);
bool finalize_output_file_with_backup(const std::filesystem::path& filepath);
};
#endif