8 #include "controller.h"
24 return Component::OnlyExecute;
32 d->evaluateBool =
true;
36 d->listSignature =
true;
52 d->ns = args.value(u
"namespace"_qs).toString();
59 d->numberOfArgs = qint8(argsAttr.
toInt());
64 d->numberOfCaptures = qint8(capturesAttr.
toInt());
77 return d->attributes.value(
name, defaultValue);
89 return d->controller->objectName();
105 return d->numberOfArgs == -1 || d->numberOfArgs == numberOfArgs;
115 return d->numberOfCaptures == -1 || d->numberOfCaptures == numberOfCaptures;
127 return d->numberOfArgs;
133 return d->numberOfCaptures;
145 #if (QT_VERSION < QT_VERSION_CHECK(6, 5, 0))
147 if (d->evaluateBool) {
150 if (d->listSignature) {
152 ret = d->method.invoke(d->controller,
154 Q_RETURN_ARG(
bool, methodRet),
161 args.
append(d->emptyArgs);
164 ret = d->method.invoke(d->controller,
166 Q_RETURN_ARG(
bool, methodRet),
191 if (d->listSignature) {
193 ret = d->method.invoke(d->controller,
201 args.
append(d->emptyArgs);
204 ret = d->method.invoke(d->controller,
237 if (d->evaluateBool) {
240 if (d->listSignature) {
241 ret = d->method.invoke(
244 switch (d->method.parameterCount()) {
253 ret = d->method.invoke(
257 ret = d->method.invoke(d->controller,
259 qReturnArg(methodRet),
265 ret = d->method.invoke(d->controller,
267 qReturnArg(methodRet),
274 ret = d->method.invoke(d->controller,
276 qReturnArg(methodRet),
284 ret = d->method.invoke(d->controller,
286 qReturnArg(methodRet),
295 ret = d->method.invoke(d->controller,
297 qReturnArg(methodRet),
307 ret = d->method.invoke(d->controller,
309 qReturnArg(methodRet),
320 ret = d->method.invoke(d->controller,
322 qReturnArg(methodRet),
334 ret = d->method.invoke(d->controller,
336 qReturnArg(methodRet),
362 if (d->listSignature) {
365 switch (d->method.parameterCount()) {
376 ret = d->method.invoke(
380 ret = d->method.invoke(d->controller,
388 ret = d->method.invoke(d->controller,
397 ret = d->method.invoke(d->controller,
407 ret = d->method.invoke(d->controller,
418 ret = d->method.invoke(d->controller,
430 ret = d->method.invoke(d->controller,
443 ret = d->method.invoke(d->controller,
465 #include "moc_action.cpp"
This class represents a Cutelyst Action.
void setAttributes(const ParamsMultiMap &attributes)
void setupAction(const QVariantHash &args, Application *app)
QString ns() const noexcept
virtual qint8 numberOfArgs() const
bool doExecute(Context *c) override
virtual bool match(int numberOfArgs) const noexcept
void setMethod(const QMetaMethod &method)
QString className() const noexcept
Action(QObject *parent=nullptr)
virtual qint8 numberOfCaptures() const
virtual Modifiers modifiers() const override
virtual bool matchCaptures(int numberOfCaptures) const noexcept
ParamsMultiMap attributes() const noexcept
Controller * controller() const noexcept
void setController(Controller *controller)
QString attribute(const QString &name, const QString &defaultValue={}) const
The Cutelyst application.
The Cutelyst Component base class.
virtual bool init(Application *application, const QVariantHash &args)
QString name() const noexcept
void detach(Action *action=nullptr)
void setState(bool state) noexcept
bool detached() const noexcept
Cutelyst Controller base class.
The Cutelyst namespace holds all public Cutelyst API.
void append(QList::parameter_type value)
QList::const_reference at(qsizetype i) const const
T value(qsizetype i) const const
T value(const Key &key, const T &defaultValue) const const
bool isEmpty() const const
int toInt(bool *ok, int base) const const