cutelyst 5.1.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
staticsimple.h
1/*
2 * SPDX-FileCopyrightText: (C) 2014-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CPSTATICSIMPLE_H
6#define CPSTATICSIMPLE_H
7
8#include <Cutelyst/Plugins/staticsimple_export.h>
9#include <Cutelyst/context.h>
10#include <Cutelyst/plugin.h>
11
12namespace Cutelyst {
13
14class StaticSimplePrivate;
73class CUTELYST_PLUGIN_STATICSIMPLE_EXPORT StaticSimple : public Plugin
74{
76 Q_DECLARE_PRIVATE(StaticSimple)
77public:
82
91 StaticSimple(Application *parent, const QVariantMap &defaultConfig);
92
96 virtual ~StaticSimple() override;
97
104 void setIncludePaths(const QStringList &paths);
105
132 void setDirs(const QStringList &dirs);
133
141 void setServeDirsOnly(bool dirsOnly);
142
146 virtual bool setup(Application *app) override;
147
148protected:
149 StaticSimplePrivate *d_ptr;
150
151private:
152 void beforePrepareAction(Context *c, bool *skipMethod) const;
153 bool locateStaticFile(Context *c, const QString &relPath) const;
154};
155
156} // namespace Cutelyst
157
158#endif // CPSTATICSIMPLE_H
The Cutelyst application.
Definition application.h:66
The Cutelyst Context.
Definition context.h:42
Plugin(Application *parent)
Definition plugin.cpp:12
void setServeDirsOnly(bool dirsOnly)
void setDirs(const QStringList &dirs)
virtual bool setup(Application *app) override
StaticSimple(Application *parent)
void setIncludePaths(const QStringList &paths)
The Cutelyst namespace holds all public Cutelyst API.
Q_OBJECTQ_OBJECT
QObject * parent() const const