summaryrefslogtreecommitdiff
path: root/cabinet/magic.hpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-06-05 10:12:56 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-06-05 10:12:56 +0200
commit79549aab5b9ca8f0cad4f00bc8ad68b7091ab65f (patch)
treeaede76e5f2046838cd966848c1d4a9f5c800923b /cabinet/magic.hpp
parentc1c317014002311874006f319b04121c88ef4672 (diff)
downloadcabinet-79549aab5b9ca8f0cad4f00bc8ad68b7091ab65f.tar.xz
cabinet-79549aab5b9ca8f0cad4f00bc8ad68b7091ab65f.zip
magic: implement buffer processing support
Diffstat (limited to 'cabinet/magic.hpp')
-rw-r--r--cabinet/magic.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/cabinet/magic.hpp b/cabinet/magic.hpp
index 9e078de..68177f9 100644
--- a/cabinet/magic.hpp
+++ b/cabinet/magic.hpp
@@ -3,8 +3,10 @@
#include <magic.h>
+#include <cstddef>
#include <expected>
#include <filesystem>
+#include <span>
#include <string>
#include <string_view>
#include <system_error>
@@ -56,6 +58,7 @@ namespace cab
auto process(std::filesystem::path path) -> std::expected<std::string, std::error_code>;
auto process(int file_descriptor) -> std::expected<std::string, std::error_code>;
+ auto process(std::span<std::byte> data) -> std::expected<std::string, std::error_code>;
private:
auto handle_result(char const * result) -> std::expected<std::string, std::error_code>;