videodownloader/network/misc/contentdispositionparser.h

36 lines
760 B
C
Raw Normal View History

2015-04-22 19:32:04 +02:00
#ifndef CONTENTDISPOSITIONPHARSER_H
#define CONTENTDISPOSITIONPHARSER_H
#include <QMap>
2017-05-01 03:22:50 +02:00
#include <QString>
2015-04-22 19:32:04 +02:00
namespace Network {
2017-05-01 03:22:50 +02:00
class ContentDispositionParser {
2015-04-22 19:32:04 +02:00
public:
ContentDispositionParser(const QString &contentDisposition);
void pharse();
const QString &fileName();
bool isAttachment();
const QMap<QString, QString> &data();
private:
/*!
* \brief Specifies the parsing position.
*/
2017-05-01 03:22:50 +02:00
enum PharsingPosition {
2015-04-22 19:32:04 +02:00
FieldName, /**< file name */
Value /**< value */
};
void addData(QString fieldName, QString value);
QString m_contentDisposition;
QString m_fileName;
bool m_attachment;
QMap<QString, QString> m_data;
};
2019-07-20 20:20:58 +02:00
} // namespace Network
2015-04-22 19:32:04 +02:00
#endif // CONTENTDISPOSITIONPHARSER_H