Cutelee
6.1.0
|
Base class for all nodes. More...
#include <cutelee/node.h>
Public Member Functions | |
Node (QObject *parent={}) | |
~Node () override | |
virtual void | render (OutputStream *stream, Context *c) const =0 |
Protected Member Functions | |
TemplateImpl * | containerTemplate () const |
void | streamValueInContext (OutputStream *stream, const QVariant &input, Cutelee::Context *c) const |
The Node class can be implemented to make additional functionality available to Templates.
A node is represented in template markup as content surrounded by percent signed tokens.
This is parsed into a tree of Node objects by an implementation of AbstractNodeFactory. The Node objects can then later be rendered by their render method.
Rendering a Node will usually mean writing some output to the stream. The content written to the stream could be determined by the arguments to the tag, or by the content of child nodes between a start and end tag, or both.
|
explicit |
|
protected |
Returns a raw pointer to the Template this Node is in.
Definition at line 107 of file node.cpp.
Referenced by MediaFinderNode::render(), IncludeNode::render(), and ConstantIncludeNode::render().
|
pure virtual |
Reimplement this to render the template in the Context c
.
This will also involve calling render on and child nodes.
Implemented in ScriptableNode, ConstantIncludeNode, IncludeNode, ExtendsNode, BlockNode, WithLocaleNode, L10nMoneyVarNode, L10nMoneyNode, L10nFileSizeVarNode, L10nFileSizeNode, I18npVarNode, I18npNode, I18ncpVarNode, I18ncpNode, I18ncVarNode, I18ncNode, I18nVarNode, I18nNode, WithNode, WidthRatioNode, TemplateTagNode, SpacelessNode, RegroupNode, RangeNode, NowNode, MediaFinderNode, LoadNode, IfEqualNode, IfChangedNode, IfNode, ForNode, FirstOfNode, FilterNode, DebugNode, CycleNode, CommentNode, AutoescapeNode, and TestLibraryTag.
|
protected |
Renders the value input
in the Context c
. This will involve escaping input
if necessary.
This is only relevant to developing template tags.
Definition at line 88 of file node.cpp.
References Cutelee::getSafeString(), and Cutelee::SafeString::isSafe().
Referenced by MediaFinderNode::render(), I18nNode::render(), I18ncNode::render(), I18ncpNode::render(), I18npNode::render(), L10nFileSizeNode::render(), and L10nMoneyNode::render().