1
/***************************************************************************
2
* This file is part of KDevelop *
3
* Copyright 2009 Milian Wolff <mail@milianw.de> *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU Library General Public License as *
7
* published by the Free Software Foundation; either version 2 of the *
8
* License, or (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU Library General Public *
16
* License along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19
***************************************************************************/
21
#ifndef INTEGRALTYPEEXTENDED_H
22
#define INTEGRALTYPEEXTENDED_H
24
#include <language/duchain/types/integraltype.h>
25
#include <language/duchain/types/typesystemdata.h>
26
#include "phpduchainexport.h"
31
typedef KDevelop::IntegralTypeData IntegralTypeExtendedData;
34
* Drop-In replacement for the IntegralType in KDevplatform with
35
* some extended logic specific for PHP
37
class KDEVPHPDUCHAIN_EXPORT IntegralTypeExtended: public KDevelop::IntegralType
40
typedef TypePtr<IntegralTypeExtended> Ptr;
42
enum PHPIntegralTypes {
43
TypeResource = KDevelop::IntegralType::TypeLanguageSpecific
46
/// Default constructor
47
IntegralTypeExtended(uint type = TypeNone);
48
/// Copy constructor. \param rhs type to copy
49
IntegralTypeExtended(const IntegralTypeExtended& rhs);
50
/// Constructor using raw data. \param data internal data.
51
IntegralTypeExtended(IntegralTypeExtendedData& data);
53
virtual QString toString() const;
55
virtual KDevelop::AbstractType* clone() const;
57
virtual bool equals(const KDevelop::AbstractType* rhs) const;
59
virtual uint hash() const;
62
///TODO: is that value OK?
66
typedef KDevelop::IntegralTypeData Data;
67
typedef KDevelop::IntegralType BaseType;
70
TYPE_DECLARE_DATA(IntegralTypeExtended);
79
inline Php::IntegralTypeExtended* fastCast<Php::IntegralTypeExtended*>(AbstractType* from) {
80
if ( !from || from->whichType() != AbstractType::TypeIntegral ) {
83
return dynamic_cast<Php::IntegralTypeExtended*>(from);
89
#endif // PHPINTEGRALTYPE_H