Update ooo320-m1
[ooovba.git] / autodoc / source / parser / cpp / icprivow.cxx
blobc01ab116bfd02a7cf28fae7a87cee992d64b6df2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: icprivow.cxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <precomp.h>
32 #include <icprivow.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/cpp/c_namesp.hxx>
37 #include <ary/cpp/c_class.hxx>
41 namespace cpp
46 //****************** Owner_Namespace ********************//
47 Owner_Namespace::Owner_Namespace()
48 : pScope(0)
52 void
53 Owner_Namespace::SetAnotherNamespace( ary::cpp::Namespace & io_rScope )
55 pScope = &io_rScope;
58 bool
59 Owner_Namespace::HasClass( const String & i_sLocalName )
61 return pScope->Search_LocalClass(i_sLocalName).IsValid();
64 void
65 Owner_Namespace::do_Add_Class( const String & i_sLocalName,
66 Cid i_nId )
68 csv_assert(pScope != 0);
69 pScope->Add_LocalClass(i_sLocalName, i_nId);
72 void
73 Owner_Namespace::do_Add_Enum( const String & i_sLocalName,
74 Cid i_nId )
76 csv_assert(pScope != 0);
77 pScope->Add_LocalEnum(i_sLocalName, i_nId);
80 void
81 Owner_Namespace::do_Add_Typedef( const String & i_sLocalName,
82 Cid i_nId )
84 csv_assert(pScope != 0);
85 pScope->Add_LocalTypedef(i_sLocalName, i_nId);
88 void
89 Owner_Namespace::do_Add_Operation( const String & i_sLocalName,
90 Cid i_nId,
91 bool )
93 csv_assert(pScope != 0);
94 pScope->Add_LocalOperation(i_sLocalName, i_nId);
97 void
98 Owner_Namespace::do_Add_Variable( const String & i_sLocalName,
99 Cid i_nId,
100 bool i_bIsConst,
101 bool )
103 csv_assert(pScope != 0);
104 if (i_bIsConst)
105 pScope->Add_LocalConstant(i_sLocalName, i_nId);
106 else
107 pScope->Add_LocalVariable(i_sLocalName, i_nId);
112 Owner_Namespace::inq_CeId() const
114 csv_assert(pScope != 0);
115 return pScope->CeId();
119 //****************** Owner_Class ********************//
121 Owner_Class::Owner_Class()
122 : pScope(0)
126 void
127 Owner_Class::SetAnotherClass( ary::cpp::Class & io_rScope )
129 pScope = &io_rScope;
132 bool
133 Owner_Class::HasClass( const String & )
135 return false;
138 void
139 Owner_Class::do_Add_Class( const String & i_sLocalName,
140 Cid i_nId )
142 csv_assert(pScope != 0);
143 pScope->Add_LocalClass(i_sLocalName, i_nId);
146 void
147 Owner_Class::do_Add_Enum( const String & i_sLocalName,
148 Cid i_nId )
150 csv_assert(pScope != 0);
151 pScope->Add_LocalEnum(i_sLocalName, i_nId);
154 void
155 Owner_Class::do_Add_Typedef( const String & i_sLocalName,
156 Cid i_nId )
158 csv_assert(pScope != 0);
159 pScope->Add_LocalTypedef(i_sLocalName, i_nId);
162 void
163 Owner_Class::do_Add_Operation( const String & i_sLocalName,
164 Cid i_nId,
165 bool i_bIsStatic )
167 csv_assert(pScope != 0);
168 if (i_bIsStatic)
169 pScope->Add_LocalStaticOperation(i_sLocalName, i_nId);
170 else
171 pScope->Add_LocalOperation(i_sLocalName, i_nId);
174 void
175 Owner_Class::do_Add_Variable( const String & i_sLocalName,
176 Cid i_nId,
177 bool ,
178 bool i_bIsStatic )
180 csv_assert(pScope != 0);
181 if (i_bIsStatic)
182 pScope->Add_LocalStaticData(i_sLocalName, i_nId);
183 else
184 pScope->Add_LocalData(i_sLocalName, i_nId);
188 Owner_Class::inq_CeId() const
190 csv_assert(pScope != 0);
191 return pScope->CeId();
195 } // namespace cpp