MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / readFileToString

Method readFileToString

KittyMemoryEx/KittyIOFile.hpp:329–333  ·  view source on GitHub ↗

* @brief Reads the contents of a file into a string. * * @param filePath The file path to read from. * @param str The string to read into. * @return true if the file was read successfully, false otherwise. */

Source from the content-addressed store, hash-verified

327 * @return true if the file was read successfully, false otherwise.
328 */
329 inline static bool readFileToString(const std::string &filePath, std::string *str)
330 {
331 KittyIOFile f(filePath, O_RDONLY | O_CLOEXEC);
332 return f.open() && f.readToString(str);
333 }
334
335 /**
336 * @brief Reads the contents of a file into a buffer.

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
readToStringMethod · 0.80

Tested by

no test coverage detected