This file is indexed.

/usr/include/grantlee/variable.h is in libgrantlee5-dev 5.0.0-0ubuntu4.

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
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
  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_VARIABLE_H
#define GRANTLEE_VARIABLE_H

#include "grantlee_templates_export.h"

#include <QtCore/QVariant>

namespace Grantlee
{
class Context;

class VariablePrivate;

/// @headerfile variable.h grantlee/variable.h

/**
  @brief A container for static variables defined in Templates.

  This class is only relevant to Template tag authors.

  When processing a template tag in a AbstractNodeFactory implementation, it will sometimes make sense
  to process arguments to the tag as Grantlee::Variables. Note that usually they should be processed as
  FilterExpression objects instead.

  Arguments to the tag can be used to construct Variables, which may then be resolved into the objects they
  represent in the given Context in the render stage.

  @author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT Variable
{
public:
  /**
    Constructs an invalid Variable
  */
  Variable();

  /**
    Creates a Variable represented by the given @p var
  */
  explicit Variable( const QString &var );

  /**
    Copy constructor
  */
  Variable( const Variable &other );

  /**
    Destructor
  */
  ~Variable();

  /**
    Assignment operator.
  */
  Variable &operator=( const Variable &other );

  /**
    Returns whether this Variable is valid.
  */
  bool isValid() const;

  /**
    Returns whether this Variable evaluates to true with the Context @p c.
  */
  bool isTrue( Context *c ) const;

  /**
    Resolves this Variable with the Context @p c.
  */
  QVariant resolve( Context *c ) const;

  /**
    Returns whether this Variable is a constant in the Template. A constant is represented as a static string in the template

    @code
      Text content
      {% some_tag "constant" variable %}
    @endcode
  */
  bool isConstant() const;

  /**
    Returns whether this variable is localized, that is, if it is wrapped with _(). @see @ref i18n_l10n
   */
  bool isLocalized() const;

  /**
    Returns whether this variable is a literal string or number. A literal Variable does not have any lookup components.
   */
  QVariant literal() const;

  /**
    Returns the lookup components of this variable.
   */
  QStringList lookups() const;

private:
  Q_DECLARE_PRIVATE( Variable )
  VariablePrivate * const d_ptr;
};

}

#endif