mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-14 17:33:25 +00:00
Cleanup.
This commit is contained in:
parent
7efbef37cc
commit
351843ca31
1 changed files with 0 additions and 15 deletions
|
|
@ -11,21 +11,6 @@ fs::path datadir = fs::current_path();
|
|||
#include <CommCtrl.h>
|
||||
#include <objbase.h>
|
||||
|
||||
auto read_file(const fs::path &fn) {
|
||||
auto sz = fs::file_size(fn);
|
||||
std::string s(sz, 0);
|
||||
FILE *f = fopen(fn.string().c_str(), "rb");
|
||||
fread(s.data(), s.size(), 1, f);
|
||||
fclose(f);
|
||||
return s;
|
||||
}
|
||||
void write_file(const fs::path &fn, const std::string &s = {}) {
|
||||
fs::create_directories(fn.parent_path());
|
||||
|
||||
FILE *f = fopen(fn.string().c_str(), "wb");
|
||||
fwrite(s.data(), s.size(), 1, f);
|
||||
fclose(f);
|
||||
}
|
||||
void err(const std::wstring &s) {
|
||||
MessageBox(0, s.c_str(), TEXT("ERROR"), MB_OK);
|
||||
exit(1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue