|
Grantlee
5.2.0
|
Base class for all filters. More...
#include <grantlee/filter.h>
Public Member Functions | |
| virtual | ~Filter () |
| SafeString | conditionalEscape (const SafeString &input) const |
| virtual QVariant | doFilter (const QVariant &input, const QVariant &argument={}, bool autoescape={}) const =0 |
| SafeString | escape (const QString &input) const |
| SafeString | escape (const SafeString &input) const |
| virtual bool | isSafe () const |
The **Filter** class can be implemented in plugin libraries to make additional functionality available to templates.
Developers are required only to implement the doFilter method and integrate the filter as part of a custom plugin, but will never create or access filters directly in application code.
The FilterExpression class is the access interface to a chain of **Filter** objects.
The escape and conditionalEscape methods are available for escaping data where needed.
|
virtual |
Destructor.
| SafeString Grantlee::Filter::conditionalEscape | ( | const SafeString & | input | ) | const |
Escapes input if not already safe from further escaping and returns it. The OutputStream::escape method is used to escape input.
|
pure virtual |
Reimplement to filter input given argument.
autoescape determines whether the autoescape feature is currently on or off. Most filters will not use this.
| SafeString Grantlee::Filter::escape | ( | const QString & | input | ) | const |
Escapes and returns input. The OutputStream::escape method is used to escape input.
| SafeString Grantlee::Filter::escape | ( | const SafeString & | input | ) | const |
Escapes and returns input. The OutputStream::escape method is used to escape input.
|
virtual |
Reimplement to return whether this filter is safe.
1.8.5