diff options
Diffstat (limited to 'src/mimeparser.hpp')
| -rw-r--r-- | src/mimeparser.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mimeparser.hpp b/src/mimeparser.hpp new file mode 100644 index 0000000..d76594b --- /dev/null +++ b/src/mimeparser.hpp @@ -0,0 +1,31 @@ +#ifndef MIMEPARSER_HPP +#define MIMEPARSER_HPP + +#include <QMap> +#include <QString> + +struct MimeType +{ + QString type; + QString subtype; + QMap<QString, QString> parameters; + + bool is(QString const & type, QString const & sub_type) const; + + QString parameter(QString const & param_name, QString const & default_value = QString { }) const; + + bool isValid() const { + return not type.isEmpty(); + } +}; + +struct MimeParser +{ + MimeParser() = delete; + + + + static MimeType parse(QString const & mime_text); +}; + +#endif // MIMEPARSER_HPP |
