cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Cutelyst::ClearSilver Class Referencefinal
Inheritance diagram for Cutelyst::ClearSilver:

Signals

void changed ()
 

Public Member Functions

 ClearSilver (QObject *parent=nullptr, const QString &name=QString())
 Constructs a ClearSilver object with the given parent and name.
 
QStringList includePaths () const
 Returns the list of include paths.
 
QByteArray render (Context *c) const final
 
void setIncludePaths (const QStringList &paths)
 Sets the list of include paths which will be looked for when resolving templates files.
 
void setTemplateExtension (const QString &extension)
 Sets the template extension, defaults to ".html".
 
void setWrapper (const QString &name)
 Sets the template wrapper name, the template will be rendered into content variable in which the wrapper template should render.
 
QString templateExtension () const
 Returns the template extension.
 
QString wrapper () const
 Returns the template wrapper.
 
- Public Member Functions inherited from Cutelyst::View
 View (QObject *parent, const QString &name)
 
virtual Modifiers modifiers () const override
 
void setMinimalSizeToDeflate (qint32 minSize=-1)
 
- Public Member Functions inherited from Cutelyst::Component
 Component (QObject *parent=nullptr)
 
bool execute (Context *c)
 
virtual bool init (Application *application, const QVariantHash &args)
 
QString name () const
 
QString reverse () const
 
void setName (const QString &name)
 
void setReverse (const QString &reverse)
 

Properties

QStringList includePaths
 
QString templateExtension
 
QString wrapper
 

Additional Inherited Members

- Public Types inherited from Cutelyst::Component
enum  Modifier {
  None , OnlyExecute , BeforeExecute , AroundExecute ,
  AfterExecute
}
 
- Protected Member Functions inherited from Cutelyst::View
 View (ViewPrivate *d, QObject *parent, const QString &name)
 A derived class using pimpl should call this constructor, to reduce the number of memory allocations.
 
- Protected Member Functions inherited from Cutelyst::Component
 Component (ComponentPrivate *d, QObject *parent=nullptr)
 A derived class using pimpl should call this constructor, to reduce the number of memory allocations.
 
virtual bool afterExecute (Context *c)
 
void applyRoles (const QStack< Component * > &roles)
 
virtual bool aroundExecute (Context *c, QStack< Component * > stack)
 
virtual bool beforeExecute (Context *c)
 
virtual bool dispatcherReady (const Dispatcher *dispatch, Controller *controller)
 

Detailed Description

Definition at line 16 of file clearsilver.h.

Constructor & Destructor Documentation

◆ ClearSilver()

ClearSilver::ClearSilver ( QObject * parent = nullptr,
const QString & name = QString() )
explicit

Member Function Documentation

◆ includePaths()

QStringList ClearSilver::includePaths ( ) const

Definition at line 23 of file clearsilver.cpp.

References ClearSilver().

◆ render()

QByteArray ClearSilver::render ( Context * c) const
finalvirtual

All subclasses must reimplement this when doing it's rendering. If an error (c->error()) is not set c->response()->body() is defined with the returned value, this is useful if the view is not meant to be used as a body.

Implements Cutelyst::View.

Definition at line 72 of file clearsilver.cpp.

References ClearSilver(), Cutelyst::Context::error(), Cutelyst::Component::reverse(), and Cutelyst::Context::stash().

◆ setIncludePaths()

void ClearSilver::setIncludePaths ( const QStringList & paths)

Definition at line 29 of file clearsilver.cpp.

References ClearSilver().

◆ setTemplateExtension()

void ClearSilver::setTemplateExtension ( const QString & extension)

Definition at line 42 of file clearsilver.cpp.

References ClearSilver().

◆ setWrapper()

void ClearSilver::setWrapper ( const QString & name)

Definition at line 55 of file clearsilver.cpp.

References ClearSilver(), and Cutelyst::Component::name().

◆ templateExtension()

QString ClearSilver::templateExtension ( ) const

Definition at line 36 of file clearsilver.cpp.

References ClearSilver().

◆ wrapper()

QString ClearSilver::wrapper ( ) const

Definition at line 49 of file clearsilver.cpp.

References ClearSilver().

Property Documentation

◆ includePaths

QStringList Cutelyst::ClearSilver::includePaths
readwrite

Definition at line 26 of file clearsilver.h.

◆ templateExtension

QString Cutelyst::ClearSilver::templateExtension
readwrite

Definition at line 37 of file clearsilver.h.

◆ wrapper

QString Cutelyst::ClearSilver::wrapper
readwrite

Definition at line 49 of file clearsilver.h.