KTextTemplate

nodebuiltins.cpp
1/*
2 This file is part of the KTextTemplate library
3
4 SPDX-FileCopyrightText: 2009, 2010 Stephen Kelly <steveire@gmail.com>
5
6 SPDX-License-Identifier: LGPL-2.1-or-later
7
8*/
9
10#include "nodebuiltins_p.h"
11
12using namespace KTextTemplate;
13
14TextNode::TextNode(const QString &content, QObject *parent)
15 : Node(parent)
16 , m_content(content)
17{
18}
19
20VariableNode::VariableNode(const FilterExpression &fe, QObject *parent)
21 : Node(parent)
22 , m_filterExpression(fe)
23{
24}
25
26void VariableNode::render(OutputStream *stream, Context *c) const
27{
28 const auto v = m_filterExpression.resolve(c);
29 if (!v.isValid())
30 return;
31 streamValueInContext(stream, v, c);
32}
33
34#include "moc_nodebuiltins_p.cpp"
The Context class holds the context to render a Template with.
Definition context.h:107
A FilterExpression object represents a filter expression in a template.
The OutputStream class is used to render templates to a QTextStream.
The KTextTemplate namespace holds all public KTextTemplate API.
Definition Mainpage.dox:8
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

KDE's Doxygen guidelines are available online.