Cutelyst  2.13.0
Public Member Functions | List of all members
Cutelyst::DispatchTypePath Class Referencefinal
Inheritance diagram for Cutelyst::DispatchTypePath:
Inheritance graph
[legend]

Public Member Functions

 DispatchTypePath (QObject *parent=nullptr)
 
virtual bool inUse () override
 
virtual QByteArray list () const override
 list the registered actions To be implemented by subclasses
 
virtual MatchType match (Context *c, const QString &path, const QStringList &args) const override
 
virtual bool registerAction (Action *action) override
 registerAction More...
 
virtual QString uriForAction (Action *action, const QStringList &captures) const override
 
- Public Member Functions inherited from Cutelyst::DispatchType
 DispatchType (QObject *parent=nullptr)
 
virtual ActionexpandAction (const Context *c, Action *action) const
 
virtual bool isLowPrecedence () const
 

Additional Inherited Members

- Public Types inherited from Cutelyst::DispatchType
enum  MatchType { NoMatch, PartialMatch, ExactMatch }
 
- Protected Member Functions inherited from Cutelyst::DispatchType
void setupMatchedAction (Context *c, Action *action) const
 

Detailed Description

Definition at line 28 of file dispatchtypepath.h.

Constructor & Destructor Documentation

◆ DispatchTypePath()

DispatchTypePath::DispatchTypePath ( QObject *  parent = nullptr)
explicit

Constructs a DispatchTypePath object with the given parent.

Definition at line 30 of file dispatchtypepath.cpp.

Member Function Documentation

◆ inUse()

bool DispatchTypePath::inUse ( )
overridevirtual

If false the dispatcher will be unregistered for performance reasons. This method can be used to prepare actions for dispatcher as in a Chain of Actions there is no garantee of registering order.

In the common case if the dispatcher has registered any action, or in some special case that it doesn't need actions it will return true.

Implements Cutelyst::DispatchType.

Definition at line 134 of file dispatchtypepath.cpp.

◆ match()

Cutelyst::DispatchType::MatchType DispatchTypePath::match ( Context c,
const QString &  path,
const QStringList &  args 
) const
overridevirtual

Return true if the dispatchType matches the given path

Implements Cutelyst::DispatchType.

Definition at line 77 of file dispatchtypepath.cpp.

References Cutelyst::Request::setArguments(), Cutelyst::Request::setMatch(), and Cutelyst::DispatchType::setupMatchedAction().

◆ registerAction()

bool DispatchTypePath::registerAction ( Action action)
overridevirtual
Parameters
action
Returns

Reimplemented from Cutelyst::DispatchType.

Definition at line 117 of file dispatchtypepath.cpp.

References Cutelyst::Action::attributes().

◆ uriForAction()

QString DispatchTypePath::uriForAction ( Cutelyst::Action action,
const QStringList &  captures 
) const
overridevirtual

Get a URI part for an action Always returns NULL if captures is not empty since Path actions don't have captures

Implements Cutelyst::DispatchType.

Definition at line 140 of file dispatchtypepath.cpp.

References Cutelyst::Action::attributes().