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

Method readFileToBuffer

KittyMemoryEx/KittyIOFile.hpp:342–346  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

340 * @return true if the file was read successfully, false otherwise.
341 */
342 inline static bool readFileToBuffer(const std::string &filePath, std::vector<char> *buf)
343 {
344 KittyIOFile f(filePath, O_RDONLY | O_CLOEXEC);
345 return f.open() && f.readToBuffer(buf);
346 }
347
348 /**
349 * @brief Copies the contents of a file to another file.

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
readToBufferMethod · 0.80

Tested by

no test coverage detected