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 ADC_DISPLAY_ARYATTRS_HXX 29 #define ADC_DISPLAY_ARYATTRS_HXX 30 31 // USED SERVICES 32 #include <ary/cpp/c_types4cpp.hxx> 33 #include <ary/doc/d_docu.hxx> 34 #include <ary/doc/d_oldcppdocu.hxx> 35 36 namespace ary 37 { 38 namespace cpp 39 { 40 class CodeEntity; 41 class Class; 42 class DisplayGate; 43 class Function; 44 class Namespace; 45 } 46 } 47 48 49 50 51 const char * Get_ClassTypeKey( 52 const ary::cpp::Class & i_rClass ); 53 const char * Get_TypeKey( 54 const ary::cpp::CodeEntity & 55 i_rCe ); 56 bool Ce_IsInternal( 57 const ary::cpp::CodeEntity & 58 i_rCe ); 59 const char * SyntaxText_PreName( 60 const ary::cpp::Function & 61 i_rFunction, 62 const ary::cpp::Gate & i_rAryGate ); 63 const char * SyntaxText_PostName( 64 const ary::cpp::Function & 65 i_rFunction, 66 const ary::cpp::Gate & i_rAryGate ); 67 68 bool Get_TypeText( 69 const char * & o_rPreName, 70 const char * & o_rName, 71 const char * & o_rPostName, 72 ary::cpp::Type_id i_nTypeid, 73 const ary::cpp::Gate & i_rAryGate ); 74 75 76 inline const ary::doc::OldCppDocu * 77 Get_CppDocu(const ary::doc::Documentation & i_doc) 78 { 79 return dynamic_cast< const ary::doc::OldCppDocu* >(i_doc.Data()); 80 } 81 82 83 class FunctionParam_Iterator 84 { 85 public: 86 FunctionParam_Iterator(); 87 ~FunctionParam_Iterator(); 88 89 operator bool() const; 90 FunctionParam_Iterator & 91 operator++(); 92 93 void Assign( 94 const ary::cpp::Function & 95 i_rFunction ); 96 97 ary::cpp::Type_id 98 CurType() const; 99 const String & CurName() const; 100 101 bool IsFunctionConst() const; 102 bool IsFunctionVolatile() const; 103 104 private: 105 typedef std::vector<ary::cpp::Type_id>::const_iterator Type_Iterator; 106 typedef StringVector::const_iterator Name_Iterator; 107 108 bool IsValid() const; 109 110 // Forbidden 111 FunctionParam_Iterator & 112 operator++(int); 113 // DATA 114 Type_Iterator itTypes; 115 Type_Iterator itTypes_end; 116 Name_Iterator itNames_andMore; /// Name, init-value. 117 Name_Iterator itNames_andMore_end; 118 119 ary::cpp::E_ConVol eConVol; 120 }; 121 122 123 124 125 // IMPLEMENTATION 126 inline 127 FunctionParam_Iterator::operator bool() const 128 { return IsValid(); } 129 130 inline bool 131 FunctionParam_Iterator::IsValid() const 132 { 133 // By C'tor and Assign(), it is assured, that 134 // both iterators are valid, if one is valid. 135 return itTypes != itTypes_end; 136 } 137 138 inline ary::cpp::Type_id 139 FunctionParam_Iterator::CurType() const 140 { return IsValid() ? *itTypes : ary::cpp::Type_id(0); } 141 inline const String & 142 FunctionParam_Iterator::CurName() const 143 { return IsValid() ? *itNames_andMore : String::Null_(); } 144 inline bool 145 FunctionParam_Iterator::IsFunctionConst() const 146 { return (eConVol & ary::cpp::CONVOL_const) != 0; } 147 inline bool 148 FunctionParam_Iterator::IsFunctionVolatile() const 149 { return (eConVol & ary::cpp::CONVOL_volatile) != 0; } 150 151 152 153 154 #endif 155