Cutelyst  3.5.0
urifor.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017-2022 Daniel Nicoletti <dantti12@gmail.com>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef URIFOR_H
6 #define URIFOR_H
7 
8 #ifndef DOXYGEN_SHOULD_SKIP_THIS
9 
10 #include <cutelee/filter.h>
11 #include <cutelee/safestring.h>
12 #include <cutelee/util.h>
13 #include <cutelee/node.h>
14 
15 class UriForTag final : public Cutelee::AbstractNodeFactory
16 {
17  Cutelee::Node *getNode(const QString &tagContent, Cutelee::Parser *p) const override;
18 };
19 
20 class UriFor final : public Cutelee::Node
21 {
22  Q_OBJECT
23 public:
24  explicit UriFor(const QString &path, const QStringList &args, Cutelee::Parser *parser = nullptr);
25 
26  void render(Cutelee::OutputStream *stream, Cutelee::Context *gc) const override;
27 
28 private:
29  mutable QString m_cutelystContext = QStringLiteral("c");
30  Cutelee::FilterExpression m_path;
31  std::vector<Cutelee::FilterExpression> m_argsExpressions;
32  std::vector<Cutelee::FilterExpression> m_queryExpressions;
33 };
34 
35 #endif
36 
37 #endif // URIFOR_H