14#include <Cutelyst/Headers>
17#include <QElapsedTimer>
18#include <QHostAddress>
23using TimePointSteady = std::chrono::time_point<std::chrono::steady_clock>;
33 enum StatusFlag : quint8 {
35 FinalizedHeaders = 0x01,
42 Q_DECLARE_FLAGS(Status, StatusFlag)
52 virtual void finalizeBody();
60 virtual void finalizeError();
73 virtual void finalizeCookies();
80 virtual bool finalizeHeaders();
85 qint64 write(
const char *data, qint64 len);
91 virtual bool webSocketSendTextMessage(
const QString &message);
93 virtual bool webSocketSendBinaryMessage(
const QByteArray &message);
95 virtual bool webSocketSendPing(
const QByteArray &payload);
97 virtual bool webSocketClose(quint16 code,
const QString &reason);
103 virtual qint64
doWrite(
const char *data, qint64 len) = 0;
115 virtual void processingFinished();
122 virtual bool webSocketHandshakeDo(
const QByteArray &key,
133 void setPath(
char *rawPath,
const int len);
137 Q_ASSERT_X(path.
startsWith(
'/'),
"leading slash",
"Path must always start with /");
179 quint16 remotePort = 0;
182 Status status = InitialState;
185 bool isSecure =
false;
190Q_DECLARE_OPERATORS_FOR_FLAGS(Cutelyst::EngineRequest::Status)
virtual qint64 doWrite(const char *data, qint64 len)=0
QHostAddress remoteAddress
TimePointSteady startOfRequest
virtual bool writeHeaders(quint16 status, const Headers &headers)=0
The Cutelyst namespace holds all public Cutelyst API.
qsizetype size() const const
bool startsWith(QByteArrayView bv) const const