chore: CRLF to LF

This commit is contained in:
smpn2
2022-12-16 23:18:35 +09:00
parent b7a60638a4
commit 6c914266d9
725 changed files with 131020 additions and 131020 deletions
+23 -23
View File
@@ -1,23 +1,23 @@
#include "resutils.h"
#include "util/utils.h"
const char *resutil::load_file(int name, LPCSTR type, DWORD *size) {
HMODULE handle = GetModuleHandle(NULL);
HRSRC rc = FindResource(handle, MAKEINTRESOURCE(name), type);
HGLOBAL rcData = LoadResource(handle, rc);
if (size != nullptr)
*size = SizeofResource(handle, rc);
return static_cast<const char*>(LockResource(rcData));
}
std::string resutil::load_file_string(int name, LPCSTR type) {
DWORD size = 0;
auto data = resutil::load_file(name, type, &size);
return std::string(data, size);
}
std::string resutil::load_file_string_crlf(int name, LPCSTR type) {
std::string s = load_file_string(name, type);
strreplace(s, "\n", "\r\n");
return s;
}
#include "resutils.h"
#include "util/utils.h"
const char *resutil::load_file(int name, LPCSTR type, DWORD *size) {
HMODULE handle = GetModuleHandle(NULL);
HRSRC rc = FindResource(handle, MAKEINTRESOURCE(name), type);
HGLOBAL rcData = LoadResource(handle, rc);
if (size != nullptr)
*size = SizeofResource(handle, rc);
return static_cast<const char*>(LockResource(rcData));
}
std::string resutil::load_file_string(int name, LPCSTR type) {
DWORD size = 0;
auto data = resutil::load_file(name, type, &size);
return std::string(data, size);
}
std::string resutil::load_file_string_crlf(int name, LPCSTR type) {
std::string s = load_file_string(name, type);
strreplace(s, "\n", "\r\n");
return s;
}