cutelyst  4.5.1
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 
12 namespace Cutelyst {
13 
14 class StaticSimplePrivate;
60 class CUTELYST_PLUGIN_STATICSIMPLE_EXPORT StaticSimple : public Plugin
61 {
62  Q_OBJECT
63  Q_DECLARE_PRIVATE(StaticSimple)
64 public:
68  StaticSimple(Application *parent);
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 
125 protected:
126  StaticSimplePrivate *d_ptr;
127 
128 private:
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.
Definition: staticsimple.h:61
The Cutelyst namespace holds all public Cutelyst API.