5 #ifndef CUTELYST_ACTION_H
6 #define CUTELYST_ACTION_H
8 #include <QtCore/QStringList>
9 #include <QtCore/QMetaMethod>
11 #include <Cutelyst/cutelyst_global.h>
12 #include <Cutelyst/component.h>
13 #include <Cutelyst/context.h>
41 explicit Action(QObject *parent =
nullptr);
42 virtual ~
Action()
override =
default;
44 virtual Modifiers modifiers()
const override;
60 QString attribute(
const QString &name,
const QString &defaultValue = {})
const;
71 QString className()
const;
87 virtual bool match(
int numberOfArgs)
const noexcept;
99 virtual bool matchCaptures(
int numberOfCaptures)
const noexcept;
104 QString ns() const noexcept;
111 virtual qint8 numberOfArgs() const noexcept;
117 virtual qint8 numberOfCaptures() const noexcept;
121 friend class ControllerPrivate;
126 explicit
Action(ActionPrivate *ptr, QObject *parent =
nullptr);
131 virtual
bool doExecute(
Context *c) override;
136 void setMethod(const QMetaMethod &method);
146 void setupAction(const QVariantHash &args,
Application *app);
This class represents a Cutelyst Action.
bool dispatch(Context *c)
The Cutelyst Application.
The Cutelyst Component base class.
bool execute(Component *code)
Cutelyst Controller base class
The Cutelyst namespace holds all public Cutelyst API.
QVector< Action * > ActionList
QMultiMap< QString, QString > ParamsMultiMap