MCPcopy Create free account
hub / github.com/Tencent/libpag / ReadTextFile

Function ReadTextFile

exporter/src/utils/FileHelper.cpp:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace exporter {
31
32std::string ReadTextFile(const std::string& filename) {
33 std::ifstream inputStream(filename);
34 if (!inputStream.is_open()) {
35 return "";
36 }
37 std::string text((std::istreambuf_iterator<char>(inputStream)),
38 (std::istreambuf_iterator<char>()));
39 inputStream.close();
40 return text;
41}
42
43size_t WriteTextFile(const std::string& fileName, const char* text) {
44 auto path = Utf8ToPath(fileName);

Callers 1

GetPAGViewerPathFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected