merge the formfield patch from ooo-build
[ooovba.git] / autodoc / inc / ary / cpp / namechain.hxx
blob868c6900333f0a4ac8062583d4a65e3f4b626225
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: namechain.hxx,v $
10 * $Revision: 1.3 $
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 #ifndef ARY_CPP_NAMECHAI_HXX
32 #define ARY_CPP_NAMECHAI_HXX
35 // USED SERVICES
36 // BASE CLASSES
37 // OTHER
40 namespace ary
42 namespace cpp
44 class Gate;
46 namespace ut
48 class List_TplParameter;
50 class NameSegment
52 public:
53 NameSegment(
54 const char * i_sName );
55 /** @precond MPT pTemplate.
56 This cannot be used, except of inserting a new element
57 in the segment list of ary::cpp::ut::NameChain. In that
58 case, the template parameter list doe snot yet exist.
60 NameSegment(
61 const NameSegment & i_rSeg );
62 ~NameSegment();
64 // OPERATIONS
65 List_TplParameter & AddTemplate();
67 // INQUIRY
68 const String & Name() const;
70 /// @return as strcmp().
71 intt Compare(
72 const NameSegment & i_rOther ) const;
73 void Get_Text_AsScope(
74 StreamStr & o_rOut,
75 const ary::cpp::Gate &
76 i_rGate ) const;
77 void Get_Text_AsMainType(
78 StreamStr & o_rName,
79 StreamStr & o_rPostName,
80 const ary::cpp::Gate &
81 i_rGate ) const;
83 NameSegment& operator=(const NameSegment&);
84 private:
85 String sName;
86 Dyn<List_TplParameter>
87 pTemplate;
90 class NameChain
92 public:
93 typedef std::vector<NameSegment>::const_iterator
94 const_iterator;
96 NameChain();
97 ~NameChain();
99 // OPERATIONS
100 void Add_Segment(
101 const char * i_sSeg );
102 /** @precond aSegments.size() > 0.
103 Which means: Add_Segment() has to be called at least once before.
105 List_TplParameter & Templatize_LastSegment();
107 // INQUIRY
108 const_iterator begin() const { return aSegments.begin(); }
109 const_iterator end() const { return aSegments.end(); }
111 /// @return like strcmp.
112 intt Compare(
113 const NameChain & i_rChain ) const;
114 /// @ATTENTION Return value is volatile. Not reentrance enabled.
115 const String & LastSegment() const;
117 void Get_Text(
118 StreamStr & o_rPreName,
119 StreamStr & o_rName,
120 StreamStr & o_rPostName,
121 const ary::cpp::Gate &
122 i_rGate ) const;
123 private:
124 std::vector< NameSegment >
125 aSegments;
130 // IMPLEMENTATION
131 inline const String &
132 NameSegment::Name() const
133 { return sName; }
140 } // namespace ut
141 } // namespace cpp
142 } // namespace ary
143 #endif