MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / write_binary_file

Function write_binary_file

include_all_in_one/include/fplus/fplus.hpp:13998–14007  ·  view source on GitHub ↗

API search type: write_binary_file : (String, [Int]) -> Io Bool Returns a function that (when called) writes content into a binary file, replacing it if it already exists.

Source from the content-addressed store, hash-verified

13996// Returns a function that (when called) writes content into a binary file,
13997// replacing it if it already exists.
13998inline std::function<bool()> write_binary_file(const std::string& filename,
13999 const std::vector<uint8_t>& content)
14000{
14001 return [filename, content]() -> bool {
14002 std::ofstream file(filename, std::ios::binary);
14003 file.write(reinterpret_cast<const char*>(&content[0]),
14004 static_cast<std::streamsize>(content.size()));
14005 return file.good();
14006 };
14007}
14008
14009// API search type: write_text_file_lines : (String, [String], Bool) -> Io Bool
14010// Returns a function that (when called) writes lines into a text file,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected