summaryrefslogtreecommitdiff
path: root/cabinet/magic.hpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-06-04 19:58:56 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-06-04 19:58:56 +0200
commit7832816c0d239c1cd7a91daef3f15c8f94197e28 (patch)
treed1de8dec25496a3a98234644a60d5c6f98140f06 /cabinet/magic.hpp
parent11df846b1ec951dd35feb9b0bad42486c7b94dca (diff)
downloadcabinet-7832816c0d239c1cd7a91daef3f15c8f94197e28.tar.xz
cabinet-7832816c0d239c1cd7a91daef3f15c8f94197e28.zip
magic: implement file processing
Diffstat (limited to 'cabinet/magic.hpp')
-rw-r--r--cabinet/magic.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/cabinet/magic.hpp b/cabinet/magic.hpp
index 25cf60b..222d488 100644
--- a/cabinet/magic.hpp
+++ b/cabinet/magic.hpp
@@ -4,6 +4,8 @@
#include <magic.h>
#include <expected>
+#include <filesystem>
+#include <string>
#include <string_view>
#include <system_error>
#include <utility>
@@ -52,6 +54,8 @@ namespace cab
auto operator=(magic const &) -> magic & = delete;
auto operator=(magic && other) noexcept -> magic &;
+ auto process(std::filesystem::path path) -> std::expected<std::string, std::string>;
+
private:
explicit magic(::magic_t cookie) noexcept;