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

Function read_binary_file

include/fplus/side_effects.hpp:421–429  ·  view source on GitHub ↗

API search type: read_binary_file : String -> Io [Int] Returns a function that reads the content of a binary file when executed. This function then returns an empty vector if the file could not be read.

Source from the content-addressed store, hash-verified

419// Returns a function that reads the content of a binary file when executed.
420// This function then returns an empty vector if the file could not be read.
421inline std::function<std::vector<std::uint8_t>()> read_binary_file(
422 const std::string& filename)
423{
424 return [filename]() -> std::vector<std::uint8_t> {
425 return just_with_default(
426 std::vector<std::uint8_t>(),
427 read_binary_file_maybe(filename)());
428 };
429}
430
431// API search type: read_text_file_lines_maybe : (String, Bool) -> Io (Maybe [String])
432// Returns a function that (when called) reads the content of a text file

Callers

nothing calls this directly

Calls 2

just_with_defaultFunction · 0.70
read_binary_file_maybeFunction · 0.70

Tested by

no test coverage detected