11 #ifndef COM_BORA_SOFTWARE__BALAU_NETWORK_UTILITIES__MIME_TYPES 12 #define COM_BORA_SOFTWARE__BALAU_NETWORK_UTILITIES__MIME_TYPES 24 #include <unordered_map> 48 public:
MimeTypes(std::unordered_map<std::string, std::string> && data_) noexcept
49 : data(std::move(data_)) {}
56 public: std::string_view
lookup(
const std::string & path)
const;
61 public:
const std::unordered_map<std::string, std::string> &
getData()
const {
67 private:
const std::unordered_map<std::string, std::string> data;
76 #endif // COM_BORA_SOFTWARE__BALAU_NETWORK_UTILITIES__MIME_TYPES MimeTypes(std::unordered_map< std::string, std::string > &&data_) noexcept
Construct a custom mime types instance by moving the supplied data.
Definition: MimeTypes.hpp:48
std::string_view lookup(const std::string &path) const
Lookup a mime type from the supplied path.
static std::shared_ptr< MimeTypes > defaultMimeTypes
The default set of mime types available.
Definition: MimeTypes.hpp:43
Components and utilities working on network data transmission.
Core includes, typedefs and functions.
const std::unordered_map< std::string, std::string > & getData() const
Get the internal data in order to construct a custom mime types instance.
Definition: MimeTypes.hpp:61
Holds a map of mime types, keyed to the corresponding file extension.
Definition: MimeTypes.hpp:39