File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class QTcpSocket;
3333class QHttpRequest ;
3434class QHttpResponse ;
3535
36- typedef QHash<QString, QString> HeaderMap ;
36+ typedef QHash<QString, QString> HeaderHash ;
3737
3838class QHttpConnection : public QObject
3939{
@@ -75,7 +75,7 @@ private slots:
7575 QHttpRequest *m_request;
7676
7777 // the ones we are reading in from the parser
78- HeaderMap m_currentHeaders;
78+ HeaderHash m_currentHeaders;
7979 QString m_currentHeaderField;
8080 QString m_currentHeaderValue;
8181};
Original file line number Diff line number Diff line change 2525
2626#include < QObject>
2727#include < QHash>
28+ #include < QMetaType>
2829#include < QUrl>
2930
3031class QTcpSocket ;
3132
3233class QHttpConnection ;
3334
34- typedef QHash<QString, QString> HeaderMap ;
35+ typedef QHash<QString, QString> HeaderHash ;
3536
3637/* ! \class QHttpRequest
3738 *
@@ -52,6 +53,8 @@ class QHttpRequest : public QObject
5253{
5354 Q_OBJECT
5455
56+ Q_PROPERTY (HeaderHash headers READ headers);
57+
5558public:
5659 virtual ~QHttpRequest ();
5760
@@ -107,7 +110,7 @@ class QHttpRequest : public QObject
107110 * somewhere else, where the request may be deleted,
108111 * make sure you store them as a copy.
109112 */
110- const HeaderMap & headers () const { return m_headers; };
113+ const HeaderHash & headers () const { return m_headers; };
111114
112115 /* !
113116 * Get the value of a header
@@ -137,10 +140,10 @@ class QHttpRequest : public QObject
137140 void setMethod (const QString &method) { m_method = method; }
138141 void setVersion (const QString &version) { m_version = version; }
139142 void setUrl (const QUrl &url) { m_url = url; }
140- void setHeaders (const HeaderMap headers) { m_headers = headers; }
143+ void setHeaders (const HeaderHash headers) { m_headers = headers; }
141144
142145 QHttpConnection *m_connection;
143- HeaderMap m_headers;
146+ HeaderHash m_headers;
144147 QString m_method;
145148 QUrl m_url;
146149 QString m_version;
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ class QTcpSocket;
3131
3232class QHttpConnection ;
3333
34+ typedef QHash<QString, QString> HeaderHash;
35+
3436/* !
3537 * The QHttpResponse class handles sending
3638 * data back to the client in response to a request.
@@ -109,7 +111,7 @@ public slots:
109111 QHttpConnection *m_connection;
110112
111113 bool m_headerWritten;
112- QHash<QString, QString> m_headers;
114+ HeaderHash m_headers;
113115 friend class QHttpConnection ;
114116
115117 bool m_sentConnectionHeader;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class QHttpResponse;
3838/* !
3939 * A map of request or response headers
4040 */
41- typedef QHash<QString, QString> HeaderMap ;
41+ typedef QHash<QString, QString> HeaderHash ;
4242
4343/* !
4444 * Maps status codes to string reason phrases
You can’t perform that action at this time.
0 commit comments