2021-09-06 16:15:05 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <hex/helpers/literals.hpp>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2022-01-24 20:53:17 +01:00
|
|
|
namespace hex::prv {
|
|
|
|
class Provider;
|
|
|
|
}
|
2021-09-06 16:15:05 +02:00
|
|
|
|
|
|
|
namespace hex::magic {
|
|
|
|
|
|
|
|
using namespace hex::literals;
|
|
|
|
|
|
|
|
bool compile();
|
2024-01-25 20:53:08 +01:00
|
|
|
std::string getDescription(const std::vector<u8> &data, bool firstEntryOnly = false);
|
|
|
|
std::string getDescription(prv::Provider *provider, size_t size = 100_KiB, bool firstEntryOnly = false);
|
|
|
|
std::string getMIMEType(const std::vector<u8> &data, bool firstEntryOnly = false);
|
|
|
|
std::string getMIMEType(prv::Provider *provider, size_t size = 100_KiB, bool firstEntryOnly = false);
|
|
|
|
std::string getExtensions(const std::vector<u8> &data, bool firstEntryOnly = false);
|
|
|
|
std::string getExtensions(prv::Provider *provider, size_t size = 100_KiB, bool firstEntryOnly = false);
|
|
|
|
std::string getAppleCreatorType(const std::vector<u8> &data, bool firstEntryOnly = false);
|
|
|
|
std::string getAppleCreatorType(prv::Provider *provider, size_t size = 100_KiB, bool firstEntryOnly = false);
|
2021-09-06 16:15:05 +02:00
|
|
|
|
2023-01-09 08:38:19 +01:00
|
|
|
bool isValidMIMEType(const std::string &mimeType);
|
|
|
|
|
2021-09-06 16:15:05 +02:00
|
|
|
}
|