summaryrefslogtreecommitdiff
path: root/cabinet/magic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cabinet/magic.cpp')
-rw-r--r--cabinet/magic.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/cabinet/magic.cpp b/cabinet/magic.cpp
new file mode 100644
index 0000000..f8d7337
--- /dev/null
+++ b/cabinet/magic.cpp
@@ -0,0 +1,19 @@
+#include <cabinet/magic.hpp>
+
+#include <magic.h>
+
+#include <utility>
+
+namespace cab
+{
+
+ magic::magic(magic::flags flags)
+ : m_cookie{magic_open(std::to_underlying(flags))}
+ {}
+
+ magic::~magic()
+ {
+ magic_close(m_cookie);
+ }
+
+} // namespace cab