Xalan-C++ API Reference 1.12.0
AttributeListImpl.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18#if !defined(ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680)
19#define ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680
20
21
22
23// Base include file. Must be first.
25
26
27
29
30
31
32#include <xercesc/sax/AttributeList.hpp>
33
34
35
36
37namespace XALAN_CPP_NAMESPACE {
38
39
40
41class AttributeVectorEntry;
42
43
44
45typedef xercesc::AttributeList AttributeListType;
46
47
48
50{
51public:
52
53 explicit
55
56 virtual
58
60 MemoryManager& theManager);
61
63 MemoryManager& theManager);
64
67
70
71 MemoryManager&
73 {
74 return m_AttributeVector.getMemoryManager();
75 }
76
77 // These are inherited from AttributeList
78 virtual XalanSize_t
79 getLength() const;
80
81 virtual const XMLCh*
82 getName(const XalanSize_t index) const;
83
84 virtual const XMLCh*
85 getType(const XalanSize_t index) const;
86
87 virtual const XMLCh*
88 getValue(const XalanSize_t index) const;
89
90 virtual const XMLCh*
91 getType(const XMLCh* const name) const;
92
93 virtual const XMLCh*
94 getValue(const XMLCh* const name) const;
95
96 virtual const XMLCh*
97 getValue(const char* const name) const;
98 // The mutators are new to this class.
99
100 /**
101 * Remove all attributes from the list
102 */
103 virtual void
105
106 /**
107 * Adds an attribute to the attribute list
108 *
109 * @param name attribute name
110 * @param type attribute type, "CDATA," for example
111 * @param value attribute value
112 */
113 virtual bool
115 const XMLCh* name,
116 const XMLCh* type,
117 const XMLCh* value);
118
119 /**
120 * Removes an attribute from the attribute list
121 *
122 * @param name attribute name
123 */
124 virtual bool
126
127 /**
128 * Swap the contents of two instances. This must _never_
129 * throw an exception.
130 *
131 * @param thOther The instance with which to swap.
132 */
133 void
135 {
136 m_AttributeVector.swap(theOther.m_AttributeVector);
137 }
138
139 /**
140 * Reserve room for the given number of
141 * attributes.
142 *
143 * @param theCount The number to reserve
144 */
145 void
147 {
148 m_AttributeVector.reserve(theCount);
149 }
150
151 // This vector will hold the entries.
153
154private:
155
156 // This is not implemented.
157 bool
158 operator==(const AttributeListImpl&) const;
159
160 // Default vector allocation size.
161 enum
162 {
163 eDefaultVectorSize = 5
164 };
165
167 getNewEntry(
168 const XMLCh* name,
169 const XMLCh* type,
170 const XMLCh* value);
171
172 // Helper function to delete entries...
173 static void
174 deleteEntries(AttributeVectorType& theVector);
175
176 AttributeVectorType m_AttributeVector;
177
178 AttributeVectorType m_cacheVector;
179};
180
181
182
183}
184
185
186
187#endif // ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680
#define XALAN_PLATFORMSUPPORT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
void reserve(XalanSize_t theCount)
Reserve room for the given number of attributes.
virtual const XMLCh * getType(const XMLCh *const name) const
virtual const XMLCh * getValue(const XMLCh *const name) const
virtual const XMLCh * getName(const XalanSize_t index) const
virtual const XMLCh * getValue(const char *const name) const
AttributeListImpl(const AttributeListType &theSource, MemoryManager &theManager)
virtual bool addAttribute(const XMLCh *name, const XMLCh *type, const XMLCh *value)
Adds an attribute to the attribute list.
AttributeListImpl(const AttributeListImpl &theSource, MemoryManager &theManager)
void swap(AttributeListImpl &theOther)
Swap the contents of two instances.
virtual bool removeAttribute(const XMLCh *name)
Removes an attribute from the attribute list.
virtual void clear()
Remove all attributes from the list.
virtual XalanSize_t getLength() const
AttributeListImpl(MemoryManager &theManager)
virtual const XMLCh * getType(const XalanSize_t index) const
XalanVector< AttributeVectorEntry * > AttributeVectorType
MemoryManager & getMemoryManager()
AttributeListImpl & operator=(const AttributeListImpl &theRHS)
AttributeListImpl & operator=(const AttributeListType &theRHS)
virtual const XMLCh * getValue(const XalanSize_t index) const
xercesc::AttributeList AttributeListType
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)