MCPcopy Create free account
hub / github.com/Tencent/tgfx / ReadFile

Function ReadFile

test/src/utils/TestUtils.cpp:111–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111std::shared_ptr<Data> ReadFile(const std::string& path) {
112 auto stream = Stream::MakeFromFile(ProjectPath::Absolute(path));
113 if (stream == nullptr) {
114 return nullptr;
115 }
116 Buffer buffer(stream->size());
117 stream->read(buffer.data(), buffer.size());
118 return buffer.release();
119}
120
121void SaveFile(std::shared_ptr<Data> data, const std::string& key) {
122 std::filesystem::path path = OUT_ROOT + "/" + key;

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
readMethod · 0.45
dataMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected