Cutelee 6.1.0
util.h
Go to the documentation of this file.
1/*
2 This file is part of the Cutelee template system.
3
4 Copyright (c) 2009,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 CUTELEE_UTIL_P_H
22#define CUTELEE_UTIL_P_H
23
24#include "context.h"
25#include "cutelee_templates_export.h"
26#include "safestring.h"
27
28#include <QtCore/QVariant>
29
31
32namespace Cutelee
33{
34
40CUTELEE_TEMPLATES_EXPORT bool variantIsTrue(const QVariant &variant);
41
48CUTELEE_TEMPLATES_EXPORT QString unescapeStringLiteral(const QString &input);
49
53CUTELEE_TEMPLATES_EXPORT Cutelee::SafeString
54markSafe(const Cutelee::SafeString &input);
55
59CUTELEE_TEMPLATES_EXPORT Cutelee::SafeString
61
65CUTELEE_TEMPLATES_EXPORT Cutelee::SafeString
66getSafeString(const QVariant &input);
67
71CUTELEE_TEMPLATES_EXPORT bool isSafeString(const QVariant &input);
72
79CUTELEE_TEMPLATES_EXPORT bool supportedOutputType(const QVariant &input);
80
87CUTELEE_TEMPLATES_EXPORT bool equals(const QVariant &lhs, const QVariant &rhs);
88CUTELEE_TEMPLATES_EXPORT bool gt(const QVariant& lhs, const QVariant& rhs);
89CUTELEE_TEMPLATES_EXPORT bool gte(const QVariant& lhs, const QVariant& rhs);
90CUTELEE_TEMPLATES_EXPORT bool lt(const QVariant& lhs, const QVariant& rhs);
91CUTELEE_TEMPLATES_EXPORT bool lte(const QVariant& lhs, const QVariant& rhs);
92
101CUTELEE_TEMPLATES_EXPORT std::pair<qreal,QString> calcFileSize(qreal size, int unitSystem = 10, qreal multiplier = 1.0);
102
103#ifndef Q_QDOC
109CUTELEE_TEMPLATES_EXPORT Cutelee::SafeString
110toString(const QVariantList &list);
111#endif
112}
113
114#endif
A QString wrapper class for containing whether a string is safe or needs to be escaped.
Definition safestring.h:92
The Cutelee namespace holds all public Cutelee API.
Definition Mainpage.dox:8
bool equals(const QVariant &lhs, const QVariant &rhs)
Definition util.cpp:140
QString unescapeStringLiteral(const QString &input)
Definition util.cpp:31
std::pair< qreal, QString > calcFileSize(qreal size, int unitSystem=10, qreal multiplier=1.0)
Definition util.cpp:215
bool supportedOutputType(const QVariant &input)
Definition util.cpp:134
bool isSafeString(const QVariant &input)
Definition util.cpp:117
Cutelee::SafeString getSafeString(const QVariant &input)
Definition util.cpp:108
Cutelee::SafeString markSafe(const Cutelee::SafeString &input)
Definition util.cpp:90
Cutelee::SafeString markForEscaping(const Cutelee::SafeString &input)
Definition util.cpp:98
bool variantIsTrue(const QVariant &variant)
Definition util.cpp:39