#include "core/resources/resource_helper.hpp" #include #include namespace Resource::Helper { auto loadFile(const std::string& filepath) -> std::vector { std::ifstream file(filepath, std::ios::binary | std::ios::ate); if (!file) { std::cerr << "Resource::Helper: cannot open " << filepath << '\n'; return {}; } std::streamsize size = file.tellg(); file.seekg(0, std::ios::beg); std::vector data(static_cast(size)); if (!file.read(reinterpret_cast(data.data()), size)) { std::cerr << "Resource::Helper: failed to read " << filepath << '\n'; return {}; } return data; } } // namespace Resource::Helper