Cutelyst  2.14.2
csrf.h
1 /*
2  * Copyright (C) 2017 Matthias Fehring <kontakt@buschmann23.de>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef CSRF_H
19 #define CSRF_H
20 
21 #ifndef DOXYGEN_SHOULD_SKIP_THIS
22 
23 #include <cutelee/filter.h>
24 #include <cutelee/safestring.h>
25 #include <cutelee/util.h>
26 #include <cutelee/node.h>
27 
28 class CSRFTag final : public Cutelee::AbstractNodeFactory
29 {
30  Q_OBJECT
31 public:
32  Cutelee::Node *getNode(const QString &tagContent, Cutelee::Parser *p) const override;
33 };
34 
35 class CSRF final : public Cutelee::Node
36 {
37  Q_OBJECT
38 public:
39  explicit CSRF(Cutelee::Parser *parser = nullptr);
40 
41  void render(Cutelee::OutputStream *stream, Cutelee::Context *gc) const override;
42 
43 private:
44  mutable QString m_cutelystContext = QStringLiteral("c");
45 };
46 
47 #endif // DOXYGEN_SHOULD_SKIP_THIS
48 
49 #endif // CSRF_H