MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / readFile

Function readFile

src/Renderer/vkRenderer.cpp:1070–1086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1068}
1069
1070static std::vector<char> readFile(const std::string &filename) {
1071 std::ifstream file(filename, std::ios::ate | std::ios::binary);
1072
1073 if (!file.is_open()) {
1074 throw std::runtime_error("failed to open file!");
1075 }
1076
1077 size_t fileSize = (size_t) file.tellg();
1078 std::vector<char> buffer(fileSize);
1079
1080 file.seekg(0);
1081 file.read(buffer.data(), fileSize);
1082
1083 file.close();
1084
1085 return buffer;
1086}
1087
1088static VKAPI_ATTR VkBool32 VKAPI_CALL
1089debugCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objType, uint64_t obj,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected