#include "utilities.h" #include #include "precomp.h" namespace veng { bool streq(gsl::czstring left, gsl::czstring right) { return std::strcmp(left, right) == 0; } std::vector ReadFile(std::filesystem::path shader_path) { if (!std::filesystem::exists(shader_path)) return {}; if (!std::filesystem::is_regular_file(shader_path)) return {}; std::ifstream file(shader_path, std::ios::binary); if (!file.is_open()) return {}; std::uintmax_t file_size = std::filesystem::file_size(shader_path); if (file_size > std::numeric_limits::max()) return {}; // 방어 std::uint32_t size = static_cast(file_size); std::vector buffer(size); file.read(reinterpret_cast(buffer.data()), size); return buffer; } } // namespace veng