5 #include <glog/logging.h>
8 : magic_(CHECK_NOTNULL(magic_open(MAGIC_MIME
)))
10 CHECK_EQ(magic_load(magic_
, nullptr), 0) << magic_error(magic_
);
13 Magic::~Magic() { magic_close(magic_
); }
15 std::string
Magic::buffer(std::string_view bfr
) const
17 auto const data
= reinterpret_cast<void const*>(bfr
.data());
18 return CHECK_NOTNULL(magic_buffer(magic_
, data
, bfr
.size()));
21 std::string
Magic::file(char const* path
) const
23 return CHECK_NOTNULL(magic_file(magic_
, path
));