Grantlee 5.3.0
filterexpression.h
1/*
2 This file is part of the Grantlee template system.
3
4 Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either version
9 2.1 of the Licence, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library. If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef GRANTLEE_FILTEREXPRESSION_H
22#define GRANTLEE_FILTEREXPRESSION_H
23
24#include "variable.h"
25
26#include "grantlee_templates_export.h"
27
28namespace Grantlee
29{
30class Filter;
31class OutputStream;
32class Parser;
33struct Token;
34
35class FilterExpressionPrivate;
36
38
119class GRANTLEE_TEMPLATES_EXPORT FilterExpression
120{
121public:
126
131 FilterExpression(const QString &varString, Grantlee::Parser *parser);
132
137
142
147
152
157 QVariant resolve(OutputStream *stream, Context *c) const;
158
162 QVariant resolve(Context *c) const;
163
168 bool isTrue(Context *c) const;
169
176 QVariantList toList(Context *c) const;
177
184 bool isValid() const;
185
186#ifndef Q_QDOC
191 QStringList filters() const;
192#endif
193
194private:
195 Q_DECLARE_PRIVATE(FilterExpression)
196 FilterExpressionPrivate *const d_ptr;
197};
198}
199
200#endif
The Context class holds the context to render a Template with.
Definition context.h:118
QVariant resolve(Context *c) const
QVariantList toList(Context *c) const
FilterExpression(const FilterExpression &other)
bool isTrue(Context *c) const
Variable variable() const
FilterExpression & operator=(const FilterExpression &other)
QVariant resolve(OutputStream *stream, Context *c) const
FilterExpression(const QString &varString, Grantlee::Parser *parser)
Base class for all filters.
Definition filter.h:60
The OutputStream class is used to render templates to a QTextStream.
The Parser class processes a string template into a tree of nodes.
Definition parser.h:49
A container for static variables defined in Templates.
Definition variable.h:53
The Grantlee namespace holds all public Grantlee API.
Definition Mainpage.dox:8