File indexing completed on 2025-02-09 04:28:38

0001 /*
0002   This file is part of the KTextTemplate library
0003 
0004   SPDX-FileCopyrightText: 2009, 2010 Stephen Kelly <steveire@gmail.com>
0005 
0006   SPDX-License-Identifier: LGPL-2.1-or-later
0007 
0008 */
0009 
0010 #include "nodebuiltins_p.h"
0011 
0012 using namespace KTextTemplate;
0013 
0014 TextNode::TextNode(const QString &content, QObject *parent)
0015     : Node(parent)
0016     , m_content(content)
0017 {
0018 }
0019 
0020 VariableNode::VariableNode(const FilterExpression &fe, QObject *parent)
0021     : Node(parent)
0022     , m_filterExpression(fe)
0023 {
0024 }
0025 
0026 void VariableNode::render(OutputStream *stream, Context *c) const
0027 {
0028     const auto v = m_filterExpression.resolve(c);
0029     if (!v.isValid())
0030         return;
0031     streamValueInContext(stream, v, c);
0032 }
0033 
0034 #include "moc_nodebuiltins_p.cpp"