Grantlee 5.3.0

outputstream.h
1/*
2 This file is part of the Grantlee template system.
3
4 Copyright (c) 2010 Stephen Kelly <steveire@gmail.com>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either version
9 2.1 of the Licence, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library. If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef GRANTLEE_OUTPUTSTREAM_H
22#define GRANTLEE_OUTPUTSTREAM_H
23
24#include "grantlee_templates_export.h"
25
26#include <QtCore/QSharedPointer>
27#include <QtCore/QTextStream>
28
29 namespace Grantlee
30{
31
32 class SafeString;
33
35
80 class GRANTLEE_TEMPLATES_EXPORT OutputStream
81{
82 public:
87 OutputStream();
88
93 explicit OutputStream(QTextStream *stream);
94
98 virtual ~OutputStream();
99
104 virtual QString escape(const QString &input) const;
105
110 QString escape(const SafeString &input) const;
111
115 virtual QSharedPointer<OutputStream> clone(QTextStream *stream) const;
116
121 QString conditionalEscape(const Grantlee::SafeString &input) const;
122
126 OutputStream &operator<<(const QString &input);
127
131 OutputStream &operator<<(const SafeString &input);
132
137 OutputStream &operator<<(QTextStream *stream);
138
139 private:
140 QTextStream *m_stream;
141 Q_DISABLE_COPY(OutputStream)
142};
143}
144
145#endif
Grantlee::OutputStream
The OutputStream class is used to render templates to a QTextStream.
Definition: outputstream.h:81
Grantlee::OutputStream::escape
QString escape(const SafeString &input) const
Grantlee::OutputStream::OutputStream
OutputStream(QTextStream *stream)
Grantlee::OutputStream::operator<<
OutputStream & operator<<(const SafeString &input)
Grantlee::OutputStream::operator<<
OutputStream & operator<<(QTextStream *stream)
Grantlee::OutputStream::~OutputStream
virtual ~OutputStream()
Grantlee::OutputStream::OutputStream
OutputStream()
Grantlee::OutputStream::operator<<
OutputStream & operator<<(const QString &input)
Grantlee::OutputStream::clone
virtual QSharedPointer< OutputStream > clone(QTextStream *stream) const
Grantlee::OutputStream::escape
virtual QString escape(const QString &input) const
Grantlee::OutputStream::conditionalEscape
QString conditionalEscape(const Grantlee::SafeString &input) const
Grantlee::SafeString
A QString wrapper class for containing whether a string is safe or needs to be escaped.
Definition: safestring.h:92
Grantlee
The Grantlee namespace holds all public Grantlee API.
Definition: Mainpage.dox:8