/usr/include/grantlee/util.h is in libgrantlee-dev 0.4.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | /*
This file is part of the Grantlee template system.
Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_UTIL_P_H
#define GRANTLEE_UTIL_P_H
#include "context.h"
#include "grantlee_core_export.h"
#include "safestring.h"
#include <QtCore/QVariant>
/// @file util.h Utility functions used throughout %Grantlee.
namespace Grantlee
{
/**
Returns whether the @p variant is evaluated to true.
@see @ref truthiness
*/
GRANTLEE_CORE_EXPORT bool variantIsTrue( const QVariant &variant );
/**
@deprecated Use MetaType::toVariantList instead.
Converts the @p variant into a list.
*/
GRANTLEE_CORE_EXPORT QVariantList variantToList( const QVariant &variant );
/**
Converts the @p input into its unescaped form.
Double slashes are converted to single slashes, \\" is converted to " etc.
*/
GRANTLEE_CORE_EXPORT QString unescapeStringLiteral( const QString &input );
/**
Marks the @p input as safe.
*/
GRANTLEE_CORE_EXPORT Grantlee::SafeString markSafe( const Grantlee::SafeString &input );
/**
Marks the @p input as requiring escaping.
*/
GRANTLEE_CORE_EXPORT Grantlee::SafeString markForEscaping( const Grantlee::SafeString &input );
/**
Retrieves and returns a SafeString from the @p input.
*/
GRANTLEE_CORE_EXPORT Grantlee::SafeString getSafeString( const QVariant &input );
/**
Returns whether @p input contains a SafeString.
*/
GRANTLEE_CORE_EXPORT bool isSafeString( const QVariant &input );
/**
Returns true if the type of @p input can be inserted into a rendered template directly.
Not that lists, hashes and QObject*s can not be.
*/
GRANTLEE_CORE_EXPORT bool supportedOutputType( const QVariant &input );
/**
Compares @p lhs and @p rhs for equality. SafeStrings are compared as raw QStrings. Their safeness is not part of the comparison.
@see QVariant::operator==
*/
GRANTLEE_CORE_EXPORT bool equals( const QVariant &lhs, const QVariant &rhs );
#ifndef Q_QDOC
/**
@internal
Returns the @p list as a formatted string. This is for debugging purposes only.
*/
GRANTLEE_CORE_EXPORT Grantlee::SafeString toString( const QVariantList &list );
#endif
}
#endif
|