cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
csrf.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CSRF_H
6#define CSRF_H
7
8#ifndef DOXYGEN_SHOULD_SKIP_THIS
9
10# include <cutelee/filter.h>
11# include <cutelee/node.h>
12# include <cutelee/safestring.h>
13# include <cutelee/util.h>
14
15class CSRFTag final : public Cutelee::AbstractNodeFactory
16{
17 Q_OBJECT
18public:
19 Cutelee::Node *getNode(const QString &tagContent, Cutelee::Parser *p) const override;
20};
21
22class CSRF final : public Cutelee::Node
23{
24 Q_OBJECT
25public:
26 explicit CSRF(Cutelee::Parser *parser = nullptr);
27
28 void render(Cutelee::OutputStream *stream, Cutelee::Context *gc) const override;
29
30private:
31 mutable QString m_cutelystContext = QStringLiteral("c");
32};
33
34class CSRFTokenTag final : public Cutelee::AbstractNodeFactory
35{
36 Q_OBJECT
37public:
38 Cutelee::Node *getNode(const QString &tagContent, Cutelee::Parser *p) const override;
39};
40
41class CSRFToken final : public Cutelee::Node
42{
43 Q_OBJECT
44public:
45 explicit CSRFToken(Cutelee::Parser *parser = nullptr);
46
47 void render(Cutelee::OutputStream *stream, Cutelee::Context *gc) const override;
48
49private:
50 mutable QString m_cutelystContext = QStringLiteral("c");
51};
52
53#endif // DOXYGEN_SHOULD_SKIP_THIS
54
55#endif // CSRF_H