KTextTemplate
Classes | |
class | AbstractLocalizer |
class | AbstractNodeFactory |
class | AbstractTemplateLoader |
class | CachingLoaderDecorator |
class | Context |
class | Engine |
class | Exception |
class | FileSystemTemplateLoader |
class | Filter |
class | FilterExpression |
class | InMemoryTemplateLoader |
class | Node |
class | NodeList |
class | OutputStream |
class | Parser |
class | QtLocalizer |
class | RenderContext |
class | SafeString |
class | TagLibraryInterface |
class | Template |
struct | Token |
class | Variable |
Enumerations | |
enum | Error { NoError , EmptyVariableError , EmptyBlockTagError , InvalidBlockTagError , UnclosedBlockTagError , UnknownFilterError , TagSyntaxError , VariableNotInContext , ObjectReturnTypeInvalid , CompileFunctionError } |
enum | TokenType { TextToken , VariableToken , BlockToken , CommentToken } |
Functions | |
std::pair< qreal, QString > | calcFileSize (qreal size, int unitSystem=10, qreal multiplier=1.0) |
bool | equals (const QVariant &lhs, const QVariant &rhs) |
static QRegularExpression | getIsTitleRE () |
KTextTemplate::SafeString | getSafeString (const QVariant &input) |
static QRegularExpression | getTitleRE () |
bool | isSafeString (const QVariant &input) |
KTextTemplate::SafeString | markForEscaping (const KTextTemplate::SafeString &input) |
KTextTemplate::SafeString | markSafe (const KTextTemplate::SafeString &input) |
template<typename RealType , typename HandleAs > | |
int | registerMetaType () |
bool | supportedOutputType (const QVariant &input) |
QString | unescapeStringLiteral (const QString &input) |
bool | variantIsTrue (const QVariant &variant) |
Detailed Description
The KTextTemplate namespace holds all public KTextTemplate API.
Enumeration Type Documentation
◆ Error
enum KTextTemplate::Error |
Types of errors that can occur while using KTextTemplate.
Definition at line 25 of file exception.h.
◆ TokenType
Function Documentation
◆ calcFileSize()
std::pair< qreal, QString > KTextTemplate::calcFileSize | ( | qreal | size, |
int | unitSystem = 10, | ||
qreal | multiplier = 1.0 ) |
Converts size
into the nearest file size unit like MB or MiB, based on the unitSystem
value.
Use 2
for the unitSystem
to get binary units, use 10
to get decimal units - by default, decimal units will be returned. The multiplier
can be used if the input size
is not in pure bytes. If size
is for example given in KiB, use a multiplier of 1024. The returned pair will have the converted size as first and the unit as second.
◆ equals()
Compares lhs
and rhs
for equality.
SafeStrings are compared as raw QStrings. Their safeness is not part of the comparison.
- See also
- QVariant::operator==
◆ getIsTitleRE()
|
static |
Definition at line 22 of file typeaccessors.cpp.
◆ getSafeString()
KTextTemplate::SafeString KTextTemplate::getSafeString | ( | const QVariant & | input | ) |
Retrieves and returns a SafeString from the input
.
◆ getTitleRE()
|
static |
Definition at line 28 of file typeaccessors.cpp.
◆ isSafeString()
bool KTextTemplate::isSafeString | ( | const QVariant & | input | ) |
Returns whether input
contains a SafeString.
◆ markForEscaping()
KTextTemplate::SafeString KTextTemplate::markForEscaping | ( | const KTextTemplate::SafeString & | input | ) |
◆ markSafe()
KTextTemplate::SafeString KTextTemplate::markSafe | ( | const KTextTemplate::SafeString & | input | ) |
◆ registerMetaType()
int KTextTemplate::registerMetaType | ( | ) |
Registers the type RealType with the metatype system.
This method can take a second template parameter to specify a cast that should be invoked during registration. This is useful if a base type is already supported.
Definition at line 173 of file metatype.h.
◆ supportedOutputType()
bool KTextTemplate::supportedOutputType | ( | const QVariant & | input | ) |
◆ unescapeStringLiteral()
◆ variantIsTrue()
bool KTextTemplate::variantIsTrue | ( | const QVariant & | variant | ) |
Returns whether the variant
is evaluated to true.
- See also
- Truthiness
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.