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

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 #ifndef KTEXTTEMPLATE_TEMPLATE_P_H
0011 #define KTEXTTEMPLATE_TEMPLATE_P_H
0012 
0013 #include "engine.h"
0014 #include "template.h"
0015 
0016 #include <QPointer>
0017 
0018 namespace KTextTemplate
0019 {
0020 
0021 class Engine;
0022 
0023 class TemplatePrivate
0024 {
0025     TemplatePrivate(Engine const *engine, bool smartTrim, TemplateImpl *t)
0026         : q_ptr(t)
0027         , m_error(NoError)
0028         , m_smartTrim(smartTrim)
0029         , m_engine(engine)
0030     {
0031     }
0032 
0033     void parse();
0034     NodeList compileString(const QString &str);
0035     void setError(Error type, const QString &message) const;
0036 
0037     Q_DECLARE_PUBLIC(TemplateImpl)
0038     TemplateImpl *const q_ptr;
0039 
0040     mutable Error m_error;
0041     mutable QString m_errorString;
0042     NodeList m_nodeList;
0043     bool m_smartTrim;
0044     QPointer<const Engine> m_engine;
0045 
0046     friend class KTextTemplate::Engine;
0047     friend class Parser;
0048 };
0049 }
0050 
0051 #endif