5 #ifndef CUTELYST_ENGINE_H
6 #define CUTELYST_ENGINE_H
9 #include <QHostAddress>
11 #include <Cutelyst/cutelyst_global.h>
12 #include <Cutelyst/Headers>
20 class CUTELYST_LIBRARY
Engine :
public QObject
46 int workerCore()
const;
55 inline bool isZeroWorker()
const;
60 QVariantMap opts()
const;
67 QVariantMap config(
const QString &entity)
const;
72 void setConfig(
const QVariantMap &config);
77 static QVariantMap loadIniConfig(
const QString &filename);
82 static QVariantMap loadJsonConfig(
const QString &filename);
89 virtual quint64 time();
107 QString key = headerKey;
108 bool lastWasLetter =
false;
109 for (
int i = 0 ; i < key.size() ; ++i) {
113 lastWasLetter =
false;
114 }
else if (lastWasLetter) {
115 key[i] = c.toLower();
116 }
else if (c.isLetter()) {
117 lastWasLetter =
true;
130 bool lastWasLetter =
false;
131 for (
int i = 0 ; i < key.size() ; ++i) {
135 lastWasLetter =
false;
136 }
else if (lastWasLetter) {
137 key[i] = QChar::toLower(c);
138 }
else if (QChar::isLetter(c)) {
139 lastWasLetter =
true;
147 static const char *httpStatusMessage(quint16 status,
int *len =
nullptr);
169 bool initApplication();
183 bool postForkApplication();
190 EnginePrivate *d_ptr;
201 virtual bool init() = 0;
The Cutelyst Application.
static QString camelCaseHeader(const QString &headerKey)
static void camelCaseByteArrayHeader(QByteArray &key)
int workerCore() const
Each worker process migth have a number of worker cores (threads), a single process with two worker t...
virtual int workerId() const =0
The id is the number of the spawned engine process, a single process workerId = 0,...
bool isZeroWorker() const
void processRequestAsync(Cutelyst::EngineRequest *request)
The Cutelyst namespace holds all public Cutelyst API.