20 lines
401 B
C++
20 lines
401 B
C++
//
|
|
// Created by Vicente Ferrari Smith on 13.02.26.
|
|
//
|
|
|
|
#include "misc.h"
|
|
#include <fstream>
|
|
|
|
std::vector<char> loadFile(const char* path) {
|
|
std::ifstream f(path, std::ios::binary | std::ios::ate);
|
|
if (f.good()) {
|
|
const uint32_t size = f.tellg();
|
|
std::vector<char> data(size);
|
|
f.seekg(0);
|
|
f.read(data.data(), size);
|
|
return data;
|
|
}
|
|
|
|
return {};
|
|
}
|