5namespace Abstract::File {
7u8 *Load(
const char *path,
size_t &size) {
14 snprintf(filepath,
sizeof(filepath),
"./%s", path);
15 std::ifstream file(filepath, std::ios::binary);
17 PANIC(
"File with provided path %s was not loaded correctly!", path);
20 file.seekg(0, std::ios::end);
22 file.seekg(0, std::ios::beg);
24 u8 *buffer =
new u8[size];
25 file.read(
reinterpret_cast<char *
>(buffer), size);
30void Append(
const char *path,
const char *data,
size_t size) {
32 stream.open(path, std::ios::app | std::ios::binary);
33 stream.write(data, size);
36int Remove(
const char *path) {
37 return std::remove(path);