1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QHTTPSERVERRESPONDER_P_H
5#define QHTTPSERVERRESPONDER_P_H
6
7#include <QtHttpServer/qthttpserverglobal.h>
8#include <QtHttpServer/qhttpserverrequest.h>
9#include <QtHttpServer/qhttpserverresponder.h>
10
11#include <private/qhttpserverstream_p.h>
12
13#include <QtCore/qcoreapplication.h>
14#include <QtCore/qpair.h>
15#include <QtCore/qpointer.h>
16#include <QtCore/qsysinfo.h>
17
18#include <type_traits>
19
20//
21// W A R N I N G
22// -------------
23//
24// This file is not part of the Qt API. It exists for the convenience
25// of QHttpServer. This header file may change from version to
26// version without notice, or even be removed.
27//
28// We mean it.
29
30QT_BEGIN_NAMESPACE
31
32class QHttpServerResponderPrivate
33{
34public:
35 QHttpServerResponderPrivate(QHttpServerStream *stream);
36 ~QHttpServerResponderPrivate();
37
38 void write(const QByteArray &body, const QHttpHeaders &headers,
39 QHttpServerResponder::StatusCode status);
40 void write(QHttpServerResponder::StatusCode status);
41 void write(QIODevice *data, const QHttpHeaders &headers,
42 QHttpServerResponder::StatusCode status);
43 void writeBeginChunked(const QHttpHeaders &headers, QHttpServerResponder::StatusCode status);
44 void writeChunk(const QByteArray &body);
45 void writeEndChunked(const QByteArray &data, const QHttpHeaders &trailers);
46
47#if defined(QT_DEBUG)
48 const QPointer<QHttpServerStream> stream;
49#else
50 QHttpServerStream *const stream;
51#endif
52 quint32 m_streamId = 0;
53};
54
55QT_END_NAMESPACE
56
57#endif // QHTTPSERVERRESPONDER_P_H
58

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qthttpserver/src/httpserver/qhttpserverresponder_p.h