TreeFrogFramework  1.18
tinternetmessageheader.h
Go to the documentation of this file.
1 #ifndef TINTERNETMESSAGEHEADER_H
2 #define TINTERNETMESSAGEHEADER_H
3 
4 #include <QList>
5 #include <QPair>
6 #include <QByteArray>
7 #include <QDateTime>
8 #include <TGlobal>
9 
10 
12 {
13 public:
16  TInternetMessageHeader(const QByteArray &str);
18 
19  bool hasRawHeader(const QByteArray &key) const;
20  QByteArray rawHeader(const QByteArray &key) const;
21  QList<QByteArray> rawHeaderList() const;
22  void setRawHeader(const QByteArray &key, const QByteArray &value);
23  void addRawHeader(const QByteArray &key, const QByteArray &value);
24  void removeAllRawHeaders(const QByteArray &key);
25  void removeRawHeader(const QByteArray &key);
26  bool isEmpty() const;
27  void clear();
28 
29  QByteArray contentType() const;
30  void setContentType(const QByteArray &type);
31  uint contentLength() const;
32  void setContentLength(int len);
33  QByteArray date() const;
34  void setDate(const QByteArray &date);
35  void setDate(const QDateTime &dateTime);
36  //void setDateUTC(const QDateTime &utc);
37  void setCurrentDate();
38  virtual QByteArray toByteArray() const;
39  TInternetMessageHeader &operator=(const TInternetMessageHeader &other);
40 
41 protected:
42  void parse(const QByteArray &header);
43 
44  typedef QPair<QByteArray, QByteArray> RawHeaderPair;
45  typedef QList<RawHeaderPair> RawHeaderPairList;
46  RawHeaderPairList headerPairList;
47 };
48 
49 #endif // TINTERNETMESSAGEHEADER_H
#define T_CORE_EXPORT
Definition: tglobal.h:81
The TInternetMessageHeader class contains internet message headers.
Definition: tinternetmessageheader.h:11
virtual ~TInternetMessageHeader()
Definition: tinternetmessageheader.h:17
QList< RawHeaderPair > RawHeaderPairList
Definition: tinternetmessageheader.h:45
RawHeaderPairList headerPairList
Definition: tinternetmessageheader.h:46
TInternetMessageHeader()
Constructs an empty Internet message header.
Definition: tinternetmessageheader.h:14
QPair< QByteArray, QByteArray > RawHeaderPair
Definition: tinternetmessageheader.h:44