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
29namespace Grantlee
30{
31
32class SafeString;
33
35
80class GRANTLEE_TEMPLATES_EXPORT OutputStream
81{
82public:
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
132
137 OutputStream &operator<<(QTextStream *stream);
138
139private:
140 QTextStream *m_stream;
141 Q_DISABLE_COPY(OutputStream)
142};
143}
144
145#endif
QString escape(const SafeString &input) const
OutputStream(QTextStream *stream)
OutputStream & operator<<(const SafeString &input)
OutputStream & operator<<(QTextStream *stream)
OutputStream & operator<<(const QString &input)
virtual QSharedPointer< OutputStream > clone(QTextStream *stream) const
virtual QString escape(const QString &input) const
QString conditionalEscape(const Grantlee::SafeString &input) const
A QString wrapper class for containing whether a string is safe or needs to be escaped.
Definition safestring.h:92
The Grantlee namespace holds all public Grantlee API.
Definition Mainpage.dox:8