33namespace fs = std::filesystem;
46 uint64_t offset_begin = ns_reserved::FIM_RESERVED_OFFSET_NOTIFY_BEGIN;
47 uint64_t offset_end = ns_reserved::FIM_RESERVED_OFFSET_NOTIFY_END;
48 uint64_t size = offset_end - offset_begin;
49 return_if(size !=
sizeof(uint8_t), Error(
"E::Incorrect number of bytes to write notification flag: {} vs {}", size,
sizeof(uint8_t)));
50 return ns_reserved::write(path_file_binary, offset_begin, offset_end,
reinterpret_cast<char*
>(&is_notify),
sizeof(uint8_t));
61 uint64_t offset_begin = ns_reserved::FIM_RESERVED_OFFSET_NOTIFY_BEGIN;
63 ssize_t bytes = Pop(
ns_reserved::read(path_file_binary, offset_begin,
reinterpret_cast<char*
>(&is_notify),
sizeof(uint8_t)));
64 log_if(bytes != 1,
"E::Possible error to read notify byte, count is {}", bytes);
Enhanced error handling framework built on std::expected.
Simplified macros for common control flow patterns with optional logging.
Desktop notification flag management in reserved space.
Value< uint8_t > read(fs::path const &path_file_binary)
Read a notification flag from the flatimage binary.
Value< void > write(fs::path const &path_file_binary, uint8_t is_notify)
Writes a notification flag to the flatimage binary.
Value< void > write(fs::path const &path_file_binary, uint64_t offset_begin, uint64_t offset_end, const char *data, uint64_t length) noexcept
Writes data to a file in binary format.
Value< std::streamsize > read(fs::path const &path_file_binary, uint64_t offset, char *data, uint64_t length) noexcept
Reads data from a file in binary format.
Enhanced expected type with integrated logging capabilities.