1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef ARY_CPP_C_DE_HXX 29 #define ARY_CPP_C_DE_HXX 30 31 32 33 // USED SERVICES 34 // BASE CLASSES 35 #include <ary/cpp/c_cppentity.hxx> 36 // OTHER 37 #include <ary/loc/loc_types4loc.hxx> 38 #include <ary/cpp/c_traits.hxx> 39 40 41 42 43 namespace ary 44 { 45 namespace cpp 46 { 47 48 49 /** Describes a C/C++ #define statement. May be a define or a macro, for which 50 two cases the two different constructors are to be used. 51 52 This class is used by cpp::PreProcessor. 53 */ 54 class DefineEntity : public ary::cpp::CppEntity 55 { 56 public: 57 typedef Def_Traits traits_t; 58 59 virtual ~DefineEntity() {} 60 61 // INQUIRY 62 De_id DefId() const { return De_id(Id()); } 63 const String & LocalName() const; 64 loc::Le_id Location() const; 65 const StringVector & 66 DefinitionText() const; 67 // ACCESS 68 protected: 69 DefineEntity( 70 const String & i_name, 71 loc::Le_id i_declaringFile ); 72 private: 73 // Locals 74 virtual const StringVector & 75 inq_DefinitionText() const = 0; 76 77 // DATA 78 String sName; 79 loc::Le_id nLocation; 80 }; 81 82 83 84 85 // IMPLEMENTATION 86 inline const String & 87 DefineEntity::LocalName() const 88 { return sName; } 89 90 inline loc::Le_id 91 DefineEntity::Location() const 92 { return nLocation; } 93 94 inline const StringVector & 95 DefineEntity::DefinitionText() const 96 { return inq_DefinitionText(); } 97 98 99 100 101 102 } // end namespace cpp 103 } // end namespace ary 104 #endif 105