KTextTemplate::Filter

Search for usage in LXR

KTextTemplate::Filter Class Referenceabstract

#include <KTextTemplate/Filter>

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
 

Detailed Description

Base class for all filters.

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.

See also
Filters
Author
Stephen Kelly steve.nosp@m.ire@.nosp@m.gmail.nosp@m..com

Definition at line 48 of file filter.h.

Constructor & Destructor Documentation

◆ ~Filter()

Filter::~Filter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ conditionalEscape()

SafeString 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.

Definition at line 33 of file filter.cpp.

◆ doFilter()

virtual QVariant KTextTemplate::Filter::doFilter ( const QVariant & input,
const QVariant & argument = {},
bool autoescape = {} ) const
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.

See also
Autoescaping and safe-ness

◆ escape() [1/2]

SafeString Filter::escape ( const QString & input) const

Escapes and returns input.

The OutputStream::escape method is used to escape input.

Definition at line 21 of file filter.cpp.

◆ escape() [2/2]

SafeString Filter::escape ( const SafeString & input) const

Escapes and returns input.

The OutputStream::escape method is used to escape input.

Definition at line 26 of file filter.cpp.

◆ isSafe()

bool Filter::isSafe ( ) const
virtual

Reimplement to return whether this filter is safe.

Definition at line 40 of file filter.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.