|
Cutelee 6.1.0
|
The Cutelee namespace holds all public Cutelee API.
Classes | |
| class | AbstractLocalizer |
| Interface for implementing an internationalization system. More... | |
| class | AbstractMarkupBuilder |
| Interface for creating marked-up text output. More... | |
| class | AbstractNodeFactory |
| Base class for all NodeFactories. More... | |
| class | AbstractNodeFactoryPrivate |
| class | AbstractTemplateLoader |
| An retrieval interface to a storage location for Template objects. More... | |
| class | BBCodeBuilder |
| Builder to create BBCode from a QTextDocument. More... | |
| class | CachingLoaderDecorator |
| Implements a loader decorator which caches compiled Template objects. More... | |
| class | CachingLoaderDecoratorPrivate |
| class | Context |
| The Context class holds the context to render a Template with. More... | |
| class | ContextPrivate |
| class | Engine |
| Cutelee::Engine is the main entry point for creating Cutelee Templates. More... | |
| class | Exception |
| An exception for use when implementing template tags. More... | |
| class | FileSystemTemplateLoader |
| The FileSystemTemplateLoader loads Templates from the file system. More... | |
| class | FileSystemTemplateLoaderPrivate |
| class | Filter |
| Base class for all filters. More... | |
| class | FilterExpression |
| A FilterExpression object represents a filter expression in a template. More... | |
| class | FilterExpressionPrivate |
| class | InMemoryTemplateLoader |
| The InMemoryTemplateLoader loads Templates set dynamically in memory. More... | |
| class | MarkupDirector |
| Instructs a builder object to create markup output. More... | |
| class | MediaWikiMarkupBuilder |
| Creates MediaWiki markup from a QTextDocument. More... | |
| class | Node |
| Base class for all nodes. More... | |
| class | NodeList |
| A list of Nodes with some convenience API for rendering them. More... | |
| class | NodePrivate |
| class | OutputStream |
| The OutputStream class is used to render templates to a QTextStream. More... | |
| class | Parser |
| The Parser class processes a string template into a tree of nodes. More... | |
| class | ParserPrivate |
| class | PlainTextMarkupBuilder |
| Creates a simple marked up plain text document. More... | |
| class | PlainTextMarkupBuilderPrivate |
| class | QtLocalizer |
| Provides internationalization based on QLocale and QTranslator. More... | |
| class | QtLocalizerPrivate |
| class | RenderContext |
| Provides storage facility for state while rendering a template. More... | |
| class | RenderContextPrivate |
| class | SafeString |
| A QString wrapper class for containing whether a string is safe or needs to be escaped. More... | |
| class | ScriptableHelperFunctions |
| class | ScriptableTagLibrary |
| class | TagLibraryInterface |
| The TagLibraryInterface returns available tags and filters from libraries. More... | |
| class | Template |
| The Template class is a tree of nodes which may be rendered. More... | |
| class | TextHTMLBuilder |
| The TextHTMLBuilder creates a clean html markup output. More... | |
| class | TextHTMLBuilderPrivate |
| struct | Token |
| class | Variable |
| A container for static variables defined in Templates. More... | |
| class | VariablePrivate |
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 () |
| Cutelee::SafeString | getSafeString (const QVariant &input) |
| static QRegularExpression | getTitleRE () |
| bool | gt (const QVariant &lhs, const QVariant &rhs) |
| bool | gte (const QVariant &lhs, const QVariant &rhs) |
| bool | isSafeString (const QVariant &input) |
| bool | lt (const QVariant &lhs, const QVariant &rhs) |
| bool | lte (const QVariant &lhs, const QVariant &rhs) |
| Cutelee::SafeString | markForEscaping (const Cutelee::SafeString &input) |
| Cutelee::SafeString | markSafe (const Cutelee::SafeString &input) |
| template<typename RealType , typename HandleAs > | |
| int | registerMetaType () |
| Registers the type RealType with the metatype system. | |
| bool | supportedOutputType (const QVariant &input) |
| QString | unescapeStringLiteral (const QString &input) |
| bool | variantIsTrue (const QVariant &variant) |
| enum Cutelee::Error |
Types of errors that can occur while using Cutelee
Definition at line 36 of file exception.h.
| enum Cutelee::TokenType |
| std::pair< qreal, QString > Cutelee::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.
Definition at line 215 of file util.cpp.
Referenced by FileSizeFormatFilter::doFilter(), L10nFileSizeNode::render(), and L10nFileSizeVarNode::render().
Compares lhs and rhs for equality. SafeStrings are compared as raw QStrings. Their safeness is not part of the comparison.
Definition at line 140 of file util.cpp.
Referenced by IfEqualNode::render().
|
static |
Definition at line 33 of file typeaccessors.cpp.
| Cutelee::SafeString Cutelee::getSafeString | ( | const QVariant & | input | ) |
Retrieves and returns a SafeString from the input.
Definition at line 108 of file util.cpp.
Referenced by ScriptableFilter::doFilter(), FileSizeFormatFilter::doFilter(), TruncateCharsFilter::doFilter(), JsonScriptFilter::doFilter(), DateFilter::doFilter(), TimeFilter::doFilter(), AddFilter::doFilter(), GetDigitFilter::doFilter(), JoinFilter::doFilter(), LengthFilter::doFilter(), LengthIsFilter::doFilter(), SliceFilter::doFilter(), MakeListFilter::doFilter(), DictSortFilter::doFilter(), DefaultFilter::doFilter(), DefaultIfNoneFilter::doFilter(), DivisibleByFilter::doFilter(), YesNoFilter::doFilter(), AddSlashesFilter::doFilter(), CapFirstFilter::doFilter(), EscapeJsFilter::doFilter(), FixAmpersandsFilter::doFilter(), CutFilter::doFilter(), SafeFilter::doFilter(), LineNumbersFilter::doFilter(), LowerFilter::doFilter(), StringFormatFilter::doFilter(), TitleFilter::doFilter(), TruncateWordsFilter::doFilter(), UpperFilter::doFilter(), WordCountFilter::doFilter(), LJustFilter::doFilter(), RJustFilter::doFilter(), CenterFilter::doFilter(), EscapeFilter::doFilter(), ForceEscapeFilter::doFilter(), RemoveTagsFilter::doFilter(), StripTagsFilter::doFilter(), WordWrapFilter::doFilter(), FloatFormatFilter::doFilter(), SafeSequenceFilter::doFilter(), LineBreaksFilter::doFilter(), LineBreaksBrFilter::doFilter(), SlugifyFilter::doFilter(), Cutelee::AbstractLocalizer::localize(), Cutelee::Context::lookup(), MediaFinderNode::render(), RegroupNode::render(), L10nFileSizeNode::render(), L10nFileSizeVarNode::render(), L10nMoneyNode::render(), L10nMoneyVarNode::render(), WithLocaleNode::render(), IncludeNode::render(), Cutelee::Variable::resolve(), Cutelee::FilterExpression::resolve(), Cutelee::Node::streamValueInContext(), and variantIsTrue().
|
static |
Definition at line 40 of file typeaccessors.cpp.
| bool Cutelee::isSafeString | ( | const QVariant & | input | ) |
Returns whether input contains a SafeString.
Definition at line 117 of file util.cpp.
Referenced by ScriptableFilter::doFilter(), AddFilter::doFilter(), StringFormatFilter::doFilter(), LineBreaksBrFilter::doFilter(), Cutelee::AbstractLocalizer::localize(), and Cutelee::Variable::resolve().
| Cutelee::SafeString Cutelee::markForEscaping | ( | const Cutelee::SafeString & | input | ) |
Marks the input as requiring escaping.
Definition at line 98 of file util.cpp.
References Cutelee::SafeString::isSafe(), and Cutelee::SafeString::needsEscape().
Referenced by EscapeFilter::doFilter(), and Cutelee::FilterExpression::resolve().
| Cutelee::SafeString Cutelee::markSafe | ( | const Cutelee::SafeString & | input | ) |
Marks the input as safe.
Definition at line 90 of file util.cpp.
References Cutelee::SafeString::IsSafe.
Referenced by Cutelee::Variable::Variable(), JoinFilter::doFilter(), UnorderedListFilter::doFilter(), SafeFilter::doFilter(), ForceEscapeFilter::doFilter(), RemoveTagsFilter::doFilter(), SafeSequenceFilter::doFilter(), LineBreaksFilter::doFilter(), LineBreaksBrFilter::doFilter(), BlockNode::getSuper(), SpacelessNode::render(), and Cutelee::FilterExpression::resolve().
| int Cutelee::registerMetaType | ( | ) |
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 182 of file metatype.h.
| bool Cutelee::supportedOutputType | ( | const QVariant & | input | ) |
Converts the input into its unescaped form.
Double slashes are converted to single slashes, \" is converted to " etc.
Definition at line 31 of file util.cpp.
Referenced by Cutelee::Variable::Variable().
| bool Cutelee::variantIsTrue | ( | const QVariant & | variant | ) |
Returns whether the variant is evaluated to true.
Definition at line 39 of file util.cpp.
References Cutelee::SafeString::get(), and getSafeString().
Referenced by Cutelee::FilterExpression::isTrue(), Cutelee::Variable::isTrue(), and IfNode::render().