This file is indexed.

/usr/include/Analitza5/analitza/object.h is in libanalitza-dev 4:15.12.3-0ubuntu1.

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
126
127
128
/*************************************************************************************
 *  Copyright (C) 2007 by Aleix Pol <aleixpol@kde.org>                               *
 *                                                                                   *
 *  This program is free software; you can redistribute it and/or                    *
 *  modify it under the terms of the GNU General Public License                      *
 *  as published by the Free Software Foundation; either version 2                   *
 *  of the License, or (at your option) any later version.                           *
 *                                                                                   *
 *  This program 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 General Public License for more details.                                     *
 *                                                                                   *
 *  You should have received a copy of the GNU General Public License                *
 *  along with this program; if not, write to the Free Software                      *
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA   *
 *************************************************************************************/

#ifndef OBJECT_H
#define OBJECT_H

#include <QDebug>

#include "analitzaexport.h"

namespace Analitza
{

class AbstractExpressionVisitor;

/**
 *    \internal
 *    Abstract expression tree node
 *    @author Aleix Pol <aleixpol@kde.org>  
 */

//FIXME: Check for public -> protected on some members
class ANALITZA_EXPORT Object
{
public:
    /** ObjectType is used to describe objects. */
    enum ObjectType {
        none=0,        /**< No object type, usually means an error. */
        value,        /**< Describes an object as a value. */
        variable,    /**< Describes an object as a variable. */
        vector,        /**< Describes an object as a vector. */
        list,        /**< Describes an object as a list. */
        apply,        /**< Describes an object as an application. */
        oper,        /**< Describes an object as an operator. */
        container,    /**< Describes an object as a container. */
        matrix,        /**< Describes an object as a matrix. */
        matrixrow,    /**< Describes an object as a matrix row. */
        custom        /**< Describes a custom object */
    };
    
    /** Object destructor. Does nothing. */
    virtual ~Object() { /*qDebug() << "Destroying " << this;*/}
    
    /** Returns the object type of the object */
    enum ObjectType type() const { return m_type; }
    
    /** Returns whether it is an apply or not. */
    bool isApply() const { return m_type==apply; }
    
    /** Returns whether it is a container or not. */
    bool isContainer() const { return m_type==container; }
    
    /** Returns whether it is a none object. Useful for checking for errors */
    bool isNone() const { return m_type==none; }

    /** Returns the string representation of the object. */
    QString toString() const;
    
    /** Returns some string depending on the visior */
    virtual QVariant accept(AbstractExpressionVisitor* exp) const = 0;
    
    virtual bool isZero() const { return false; }
    
    /** 
        @p exp is the tree that we will compare to,
        @p found is where we will pass the variables store the results.
        
        It will return whether the object follows the @p pattern structure.
    */
    virtual bool matches(const Object* exp, QMap<QString, const Object*>* found) const=0;
    
    /** @returns a new and equal instance of the tree. */
    virtual Object* copy() const =0;
    
protected:
    /** Creates an object with a @p t type */
    Object(enum ObjectType t) : m_type(t) {}
    
    /** Specifies the Object type. */
    const ObjectType m_type;
};


/**
 * \class None
 * 
 * \ingroup AnalitzaModule
 *
 * \brief A empty object that indicates usually an error in the expression tree. 
 * 
 * The default convention for an error value is None and the default text to print is 
 * an empty string. This class does not hold an error string, since any error string will 
 * be manage mainly in Analyzer, Expression and ExpressionTypeChecker. This class is just a 
 * flag in memory to indicate that something went wrong in the expression tree.
 */

class ANALITZA_EXPORT None : public Object
{
    public:
        explicit None() : Object(Object::none) {}
        virtual ~None() {}
        
        bool operator==(const None& ) const { return true; }
        
        QString toMathML() const { return QString(); }
        QString toHtml() const { return QString(); }
        virtual QVariant accept(Analitza::AbstractExpressionVisitor* visitor) const;
        virtual bool matches(const Object* pattern, QMap<QString, const Object*>* found) const;
        None* copy() const;
};

}
#endif