1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: d_oldcppdocu.cxx,v $
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 ************************************************************************/
32 #include <ary/doc/d_oldcppdocu.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/info/all_tags.hxx>
37 #include <ary/info/docstore.hxx>
38 #include <ary/info/infodisp.hxx>
39 #include <docu_node_ids.hxx>
54 unsigned char C_ucNO_INDEX
= 255;
55 typedef DYN StdTag
* (F_CREATE
)();
58 OldCppDocu::OldCppDocu()
59 : Node(docnt::nt_OldCppDocu
),
64 memset( nTags
, C_ucNO_INDEX
, size_t(C_eAtTag_NrOfClasses
) );
67 OldCppDocu::~OldCppDocu()
72 OldCppDocu::Store2( info::DocuStore
& o_rDocuStore
)
74 o_rDocuStore
.Store2ConnectedDeclaration(*this);
78 OldCppDocu::Create_StdTag( E_AtTagId i_eId
)
80 UINT8 nIndex
= static_cast<UINT8
>(i_eId
);
81 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
83 AtTag
* ret
= new StdTag(i_eId
);
89 return GetTag(nIndex
).GetFollower();
94 OldCppDocu::CheckIn_BaseTag()
96 UINT8 nIndex
= atc_base
;
97 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
99 AtTag
* ret
= new BaseTag();
100 NewTag(nIndex
) = ret
;
105 return GetTag(nIndex
).GetFollower();
110 OldCppDocu::CheckIn_ExceptionTag()
112 UINT8 nIndex
= atc_exception
;
113 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
115 AtTag
* ret
= new ExceptionTag();
116 NewTag(nIndex
) = ret
;
121 return GetTag(nIndex
).GetFollower();
126 OldCppDocu::Create_ImplementsTag()
128 UINT8 nIndex
= atc_implements
;
129 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
131 AtTag
* ret
= new ImplementsTag();
132 NewTag(nIndex
) = ret
;
137 return GetTag(nIndex
).GetFollower();
142 OldCppDocu::Create_KeywordTag()
144 UINT8 nIndex
= atc_keyword
;
145 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
147 AtTag
* ret
= new KeywordTag();
148 NewTag(nIndex
) = ret
;
153 return GetTag(nIndex
).GetFollower();
158 OldCppDocu::CheckIn_ParameterTag()
160 UINT8 nIndex
= atc_parameter
;
161 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
163 AtTag
* ret
= new ParameterTag();
164 NewTag(nIndex
) = ret
;
169 return GetTag(nIndex
).GetFollower();
174 OldCppDocu::CheckIn_SeeTag()
176 UINT8 nIndex
= atc_see
;
177 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
179 AtTag
* ret
= new SeeTag();
180 NewTag(nIndex
) = ret
;
185 return GetTag(nIndex
).GetFollower();
190 OldCppDocu::CheckIn_TemplateTag()
192 UINT8 nIndex
= atc_template
;
193 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
195 AtTag
* ret
= new TemplateTag();
196 NewTag(nIndex
) = ret
;
201 return GetTag(nIndex
).GetFollower();
206 OldCppDocu::Create_LabelTag()
208 UINT8 nIndex
= atc_label
;
209 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
211 AtTag
* ret
= new LabelTag();
212 NewTag(nIndex
) = ret
;
217 return GetTag(nIndex
).GetFollower();
222 OldCppDocu::Create_DefaultTag()
224 UINT8 nIndex
= atid_descr
;
225 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
227 AtTag
* ret
= new StdTag(atid_descr
);
228 NewTag(nIndex
) = ret
;
233 return GetTag(nIndex
).GetFollower();
238 OldCppDocu::Create_SinceTag()
240 UINT8 nIndex
= atc_since
;
241 if ( nTags
[nIndex
] == C_ucNO_INDEX
)
243 AtTag
* ret
= new SinceTag();
244 NewTag(nIndex
) = ret
;
249 return GetTag(nIndex
).GetFollower();
255 OldCppDocu::Replace_AtShort_By_AtDescr()
257 unsigned char nPosInTags
= nTags
[atid_short
];
258 if ( nPosInTags
== C_ucNO_INDEX
)
261 AtTag
* pTag
= aTags
[ nPosInTags
];
262 if ( pTag
== 0 ) // Should be csv_assert().
265 csv_assert( dynamic_cast< StdTag
* >(pTag
) != 0 );
266 StdTag
* pStdTag
= static_cast< StdTag
* >(pTag
);
268 pStdTag
->ChangeId2(atid_descr
);
269 nTags
[atid_short
] = C_ucNO_INDEX
;
270 nTags
[atid_descr
] = nPosInTags
;
274 OldCppDocu::Set_Obsolete()
280 OldCppDocu::Set_Internal()
286 OldCppDocu::Short() const
288 static const StdTag
aNull_(atid_short
);
290 unsigned char nPosInTags
= nTags
[atid_short
];
291 if ( nPosInTags
!= C_ucNO_INDEX
)
293 AtTag
* pTag
= aTags
[ nPosInTags
];
294 if ( pTag
!= 0 ) // Should be csv_assert().
304 OldCppDocu::NewTag(UINT8 i_nIndex
)
306 nTags
[i_nIndex
] = static_cast<UINT8
>(aTags
.size());
312 OldCppDocu::GetTag( UINT8 i_nIndex
)
314 csv_assert( i_nIndex
< C_eAtTag_NrOfClasses
);
315 csv_assert( nTags
[i_nIndex
] != C_ucNO_INDEX
);
316 csv_assert( aTags
[nTags
[i_nIndex
]] != 0 );
317 return * aTags
[nTags
[i_nIndex
]];
321 OldCppDocu::IsInternal() const
327 OldCppDocu::IsInterface() const
333 OldCppDocu::do_Accept(csv::ProcessorIfc
& io_processor
) const
335 csv::CheckedCall(io_processor
, *this);