network-experiment/bmrshared-magic/include/bmrshared/magic_file_info.hpp

27 lines
620 B
C++

// GNU Lesser General Public License v3.0
// Copyright (c) 2025 Bart Beumer <bart@4beumer.nl>
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License v3.0 as published by
// the Free Software Foundation.
//
#include <filesystem>
#include <magic.h>
namespace bmrshared
{
class magic_file_info final
{
public:
explicit magic_file_info(const std::filesystem::path& path);
~magic_file_info();
std::string get_mime(const std::filesystem::path& path) const;
private:
magic_t m_magic_cookie;
};
} // namespace bmrshared