18 #ifndef CUTELYST_ENGINE_H 19 #define CUTELYST_ENGINE_H 22 #include <QHostAddress> 24 #include <Cutelyst/cutelyst_global.h> 25 #include <Cutelyst/Headers> 33 class CUTELYST_LIBRARY
Engine :
public QObject
54 virtual int workerId()
const = 0;
59 int workerCore()
const;
68 inline bool isZeroWorker()
const;
73 QVariantMap opts()
const;
80 QVariantMap config(
const QString &entity)
const;
85 void setConfig(
const QVariantMap &config);
90 static QVariantMap loadIniConfig(
const QString &filename);
95 static QVariantMap loadJsonConfig(
const QString &filename);
102 virtual quint64 time();
120 QString key = headerKey;
121 bool lastWasLetter =
false;
122 for (
int i = 0 ; i < key.size() ; ++i) {
126 lastWasLetter =
false;
127 }
else if (lastWasLetter) {
129 }
else if (c.isLetter()) {
130 lastWasLetter =
true;
143 bool lastWasLetter =
false;
144 for (
int i = 0 ; i < key.size() ; ++i) {
148 lastWasLetter =
false;
149 }
else if (lastWasLetter) {
150 c = QChar::toLower(c);
151 }
else if (QChar::isLetter(c)) {
152 lastWasLetter =
true;
160 static const char *httpStatusMessage(quint16 status,
int *len =
nullptr);
182 bool initApplication();
196 bool postForkApplication();
203 EnginePrivate *d_ptr;
214 virtual bool init() = 0;
223 #endif // CUTELYST_ENGINE_H static QString camelCaseHeader(const QString &headerKey)
virtual int workerId() const =0
The id is the number of the spawned engine process, a single process workerId = 0,...
static void camelCaseByteArrayHeader(QByteArray &key)
The Cutelyst namespace holds all public Cutelyst API.
The Cutelyst Application.
int workerCore() const
Each worker process migth have a number of worker cores (threads), a single process with two worker t...
bool isZeroWorker() const