/usr/include/Cable/CxxTypes/cxxType.h is in libcableswig-dev 0.1.0+cvs20111009-1.1.
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 | /*=========================================================================
Program: CABLE - CABLE Automates Bindings for Language Extension
Module: $RCSfile: cxxType.h,v $
Language: C++
Date: $Date: 2002-10-23 21:35:02 $
Version: $Revision: 1.19 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _cxxType_h
#define _cxxType_h
#include "cxxUtils.h"
namespace _cxx_
{
/**
* Enumeration of identifiers for representation types.
*/
enum RepresentationType
{
Undefined_id=0,
ArrayType_id, ClassType_id, EnumerationType_id, PointerType_id,
PointerToMemberType_id, ReferenceType_id, FundamentalType_id,
FunctionType_id
};
class CvQualifiedType;
class TypeSystem;
/**
* Abstract interface to a C++ type representation.
*/
class _cxx_EXPORT Type
{
public:
/**
* Retrieve what kind of Type this is.
*/
virtual RepresentationType GetRepresentationType() const = 0;
/*@{
* Quick type representation test.
*/
bool IsArrayType() const { return this->GetRepresentationType() == ArrayType_id; }
bool IsClassType() const { return this->GetRepresentationType() == ClassType_id; }
bool IsEnumerationType() const { return this->GetRepresentationType() == EnumerationType_id; }
bool IsFunctionType() const { return this->GetRepresentationType() == FunctionType_id; }
bool IsFundamentalType() const { return this->GetRepresentationType() == FundamentalType_id; }
bool IsPointerType() const { return this->GetRepresentationType() == PointerType_id; }
bool IsPointerToMemberType() const { return this->GetRepresentationType() == PointerToMemberType_id; }
bool IsReferenceType() const { return this->GetRepresentationType() == ReferenceType_id; }
bool IsEitherPointerType() const { return (this->IsPointerType() || this->IsPointerToMemberType()); }
//@}
virtual CvQualifiedType GetCvQualifiedType(bool, bool) const;
String Name() const;
String CvName(bool isConst, bool isVolatile) const;
virtual String GenerateName(const String& outerType,
bool isConst, bool isVolatile) const =0;
String GenerateDeclaration(const String& name) const;
virtual String GenerateDeclaration(const String& name,
bool isConst, bool isVolatile) const;
///! Compare two types for equality.
static bool Equal(const Type* l, const Type* r) { return l == r; }
///! Provide an ordering function for types.
static bool Less(const Type* l, const Type* r) { return l < r; }
protected:
Type() {}
virtual ~Type() {}
String GetLeftCvString(bool isConst, bool isVolatile) const;
String GetRightCvString(bool isConst, bool isVolatile) const;
String PrepareOuterStringForPostfix(const String&) const;
};
/**
* An exception of this type is thrown when a representation's
* SafeDownCast fails.
*/
class TypeDownCastException
{
public:
TypeDownCastException(RepresentationType from, RepresentationType to);
TypeDownCastException(const Type* from, RepresentationType to);
String GetMessage() const;
private:
RepresentationType m_From;
RepresentationType m_To;
};
} // namespace _cxx_
#endif
|