KTextTemplate
parser.cpp
69 for (auto filterIt = filters.begin(), filterEnd = filters.end(); filterIt != filterEnd; ++filterIt) {
121 QStringLiteral("Node appeared twice in template: %1").arg(QLatin1String(node->metaObject()->className())));
135 throw KTextTemplate::Exception(UnclosedBlockTagError, QStringLiteral("No closing tag found for %1").arg(tag));
145 throw KTextTemplate::Exception(UnknownFilterError, QStringLiteral("Unknown filter: %1").arg(name));
192 QStringLiteral("%1, line %2, %3").arg(e.what()).arg(token.linenumber).arg(q->parent()->objectName()));
230 QStringLiteral("%1, line %2, %3").arg(e.what()).arg(token.linenumber).arg(q->parent()->objectName()));
235 QStringLiteral("Failed to get node from %1, line %2, %3").arg(command).arg(token.linenumber).arg(q->parent()->objectName()));
246 QStringLiteral("Unclosed tag in template %1. Expected one of: (%2)").arg(q->parent()->objectName(), stopAt.join(QChar::fromLatin1(' ')));
271void Parser::invalidBlockTag(const Token &token, const QString &command, const QStringList &stopAt)
276 QStringLiteral("Invalid block tag on line %1: '%2', expected '%3'").arg(token.linenumber).arg(command, stopAt.join(QStringLiteral("', '"))));
KTextTemplate::Engine is the main entry point for creating KTextTemplate Templates.
Definition engine.h:110
An exception for use when implementing template tags.
Definition exception.h:74
A FilterExpression object represents a filter expression in a template.
Definition filterexpression.h:109
A list of Nodes with some convenience API for rendering them.
Definition node.h:141
The Parser class processes a string template into a tree of nodes.
Definition parser.h:38
bool hasNextToken() const
Returns whether the parser has another token to process.
Definition parser.cpp:253
void prependToken(const Token &token)
Puts the token token to the front of the list to be processed by the parser.
Definition parser.cpp:285
QSharedPointer< Filter > getFilter(const QString &name) const
Returns the filter object called name or an invalid object if no filter with that name is loaded.
Definition parser.cpp:138
NodeList parse(Node *parent, const QStringList &stopAt={})
Advance the parser, using parent as the parent of new Nodes.
Definition parser.cpp:160
The TagLibraryInterface returns available tags and filters from libraries.
Definition taglibraryinterface.h:68
virtual QHash< QString, AbstractNodeFactory * > nodeFactories(const QString &name={})
Returns the AbstractNodeFactory implementations available in this library.
Definition taglibraryinterface.h:77
virtual QHash< QString, Filter * > filters(const QString &name={})
Returns the Filter implementations available in this library.
Definition taglibraryinterface.h:87
KIOCORE_EXPORT QStringList list(const QString &fileClass)
The KTextTemplate namespace holds all public KTextTemplate API.
Definition Mainpage.dox:8
QChar fromLatin1(char c)
void append(QList< T > &&value)
bool empty() const const
bool isEmpty() const const
const char * className() const const
virtual const QMetaObject * metaObject() const const
QObject * parent() const const
T qobject_cast(QObject *object)
void setParent(QObject *parent)
VariableNode
QString arg(Args &&... args) const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QString join(QChar separator) const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.