MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / readFile

Function readFile

tools/shader-tool/shader-tool.cpp:179–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177};
178
179static std::optional<std::vector<std::byte>>
180readFile(const std::filesystem::path &path) {
181 std::ifstream f(path, std::ios::binary | std::ios::ate);
182
183 if (!f) {
184 return {};
185 }
186
187 std::vector<std::byte> data(f.tellg());
188 f.seekg(0, std::ios::beg);
189 f.read(reinterpret_cast<char *>(data.data()), data.size());
190 return data;
191}
192
193static void writeSpvHeader(OutputParam &outputParam, std::ostream &out,
194 std::span<const std::uint32_t> spv) {

Callers 1

parseFileFunction · 0.70

Calls 3

readMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected