cutelyst 4.3.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/context.h>
9#include <Cutelyst/cutelyst_global.h>
10#include <Cutelyst/plugin.h>
11
12namespace Cutelyst {
13
14class StaticSimplePrivate;
60class CUTELYST_PLUGIN_STATICSIMPLE_EXPORT StaticSimple : public Plugin
61{
62 Q_OBJECT
63 Q_DECLARE_PRIVATE(StaticSimple)
64public:
69
73 virtual ~StaticSimple() override;
74
81 void setIncludePaths(const QStringList &paths);
82
109 void setDirs(const QStringList &dirs);
110
118 void setServeDirsOnly(bool dirsOnly);
119
123 virtual bool setup(Application *app) override;
124
125protected:
126 StaticSimplePrivate *d_ptr;
127
128private:
129 void beforePrepareAction(Context *c, bool *skipMethod);
130 bool locateStaticFile(Context *c, const QString &relPath);
131};
132
133} // namespace Cutelyst
134
135#endif // CPSTATICSIMPLE_H
The Cutelyst application.
Definition application.h:66
The Cutelyst Context.
Definition context.h:42
Base class for Cutelyst Plugins.
Definition plugin.h:25
Serve static files directly from your application.
The Cutelyst namespace holds all public Cutelyst API.