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.
| 474 | // Returns a function that (when called) writes content into a binary file, |
| 475 | // replacing it if it already exists. |
| 476 | inline std::function<bool()> write_binary_file(const std::string& filename, |
| 477 | const std::vector<uint8_t>& content) |
| 478 | { |
| 479 | return [filename, content]() -> bool { |
| 480 | std::ofstream file(filename, std::ios::binary); |
| 481 | file.write(reinterpret_cast<const char*>(&content[0]), |
| 482 | static_cast<std::streamsize>(content.size())); |
| 483 | return file.good(); |
| 484 | }; |
| 485 | } |
| 486 | |
| 487 | // API search type: write_text_file_lines : (String, [String], Bool) -> Io Bool |
| 488 | // Returns a function that (when called) writes lines into a text file, |
nothing calls this directly
no outgoing calls
no test coverage detected