cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
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/node.h>
12# include <cutelee/safestring.h>
13# include <cutelee/util.h>
14
15class UriForTag final : public Cutelee::AbstractNodeFactory
16{
17 Cutelee::Node *getNode(const QString &tagContent, Cutelee::Parser *p) const override;
18};
19
20class UriFor final : public Cutelee::Node
21{
22 Q_OBJECT
23public:
24 explicit UriFor(const QString &path,
25 const QStringList &args,
26 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 Cutelee::FilterExpression m_path;
33 std::vector<Cutelee::FilterExpression> m_argsExpressions;
34 std::vector<Cutelee::FilterExpression> m_queryExpressions;
35};
36
37#endif
38
39#endif // URIFOR_H