MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / readString

Function readString

TactilityCore/Source/file/File.cpp:199–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199std::unique_ptr<uint8_t[]> readString(const std::string& filepath) {
200 size_t size = 0;
201 auto data = readBinaryInternal(filepath, size, 1);
202 if (data == nullptr) {
203 return nullptr;
204 }
205
206 data.get()[size] = 0; // Append null terminator
207 return data;
208}
209
210bool writeString(const std::string& filepath, const std::string& content) {
211 std::ofstream fileStream(filepath);

Callers 4

downloadFunction · 0.85
openFileMethod · 0.85
parseJsonFunction · 0.85
label_set_text_fileFunction · 0.85

Calls 2

readBinaryInternalFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected