9#define MIME_TYPES_PATH "config/mime.types"
55 const std::string
getMimeType(
const std::string &extension)
const;
67 const std::string
getMimeExt(
const std::string &mimeType)
const;
#define MIME_TYPES_PATH
Definition MimeTypes.hpp:9
MimeTypes(const std::string &path=MIME_TYPES_PATH)
Constructs the MimeTypes object and loads MIME types from the specified file.
Definition MimeTypes.cpp:11
const std::string getMimeType(const std::string &extension) const
Retrieves the MIME type associated with a given file extension.
Definition MimeTypes.cpp:36
std::map< std::string, std::string > mimeExt_
Definition MimeTypes.hpp:84
static size_t findFirstNonSpace(const std::string &str, size_t startPos)
Definition MimeTypes.cpp:113
std::string filePath_
Definition MimeTypes.hpp:85
bool wasChanged()
checks if the MIME types file has been modified since the last load.
Definition MimeTypes.cpp:58
void reload()
Reloads the MIME types from the configuration file.
Definition MimeTypes.cpp:70
struct timespec rtime_
Definition MimeTypes.hpp:86
std::map< std::string, std::string > mimeTypes_
Definition MimeTypes.hpp:83
static size_t findFirstSpace(const std::string &str)
Definition MimeTypes.cpp:100
MimeTypes & operator=(const MimeTypes &other)
Assignment operator.
Definition MimeTypes.cpp:26
const std::string getMimeExt(const std::string &mimeType) const
Retrieves the file extension associated with a given MIME type.
Definition MimeTypes.cpp:47
~MimeTypes()
Definition MimeTypes.cpp:126
Definition IArgument.hpp:5