MCPcopy Create free account
hub / github.com/SFML/SFML / loadIntoMemory

Function loadIntoMemory

test/TestUtilities/SystemUtil.cpp:83–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83std::vector<std::byte> loadIntoMemory(const std::filesystem::path& path)
84{
85 std::ifstream file(path, std::ios::binary | std::ios::ate);
86 assert(file);
87 const auto size = file.tellg();
88 file.seekg(0, std::ios::beg);
89 std::vector<std::byte> buffer(static_cast<std::size_t>(size));
90 [[maybe_unused]] const auto& result = file.read(reinterpret_cast<char*>(buffer.data()),
91 static_cast<std::streamsize>(size));
92 assert(result);
93 return buffer;
94}

Callers 5

Font.test.cppFile · 0.85
Texture.test.cppFile · 0.85
Music.test.cppFile · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected