Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

AttributeListImpl.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680)
17 #define ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
30 #include <xercesc/sax/AttributeList.hpp>
31 
32 
33 
34 
35 XALAN_CPP_NAMESPACE_BEGIN
36 
37 
38 
40 
41 
42 
43 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType;
44 
45 
46 
48 {
49 public:
50 
51  explicit
53 
54  virtual
56 
57  AttributeListImpl(const AttributeListImpl& theSource,
58  MemoryManagerType& theManager);
59 
60  AttributeListImpl(const AttributeListType& theSource,
61  MemoryManagerType& theManager);
62 
64  operator=(const AttributeListImpl& theRHS);
65 
67  operator=(const AttributeListType& theRHS);
68 
71  {
72  return m_AttributeVector.getMemoryManager();
73  }
74 
75  // These are inherited from AttributeList
76  virtual unsigned int
77  getLength() const;
78 
79  virtual const XMLCh*
80  getName(const unsigned int index) const;
81 
82  virtual const XMLCh*
83  getType(const unsigned int index) const;
84 
85  virtual const XMLCh*
86  getValue(const unsigned int index) const;
87 
88  virtual const XMLCh*
89  getType(const XMLCh* const name) const;
90 
91  virtual const XMLCh*
92  getValue(const XMLCh* const name) const;
93 
94  virtual const XMLCh*
95  getValue(const char* const name) const;
96  // The mutators are new to this class.
97 
101  virtual void
102  clear();
103 
111  virtual bool
112  addAttribute(
113  const XMLCh* name,
114  const XMLCh* type,
115  const XMLCh* value);
116 
122  virtual bool
123  removeAttribute(const XMLCh* name);
124 
131  void
133  {
134  m_AttributeVector.swap(theOther.m_AttributeVector);
135  }
136 
143  void
144  reserve(unsigned int theCount)
145  {
146  m_AttributeVector.reserve(theCount);
147  }
148 
149  // This vector will hold the entries.
151 
152 #if defined(XALAN_NEEDS_EXPLICIT_TEMPLATE_INSTANTIATION)
153  struct NameCompareFunctor
154  {
155  NameCompareFunctor(const XMLCh* theName) :
156  m_name(theName)
157  {
158  }
159 
160  bool
161  operator()(const AttributeVectorEntry* theEntry) const;
162 
163  private:
164 
165  const XMLCh* const m_name;
166  };
167 #endif
168 
169 private:
170 
171  // This is not implemented.
172  bool
173  operator==(const AttributeListImpl&) const;
174 
175  // Default vector allocation size.
176  enum
177  {
178  eDefaultVectorSize = 5
179  };
180 
182  getNewEntry(
183  const XMLCh* name,
184  const XMLCh* type,
185  const XMLCh* value);
186 
187  // Helper function to delete entries...
188  static void
189  deleteEntries(AttributeVectorType& theVector);
190 
191  AttributeVectorType m_AttributeVector;
192 
193  AttributeVectorType m_cacheVector;
194 };
195 
196 
197 
198 XALAN_CPP_NAMESPACE_END
199 
200 
201 
202 #endif // ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1111
Definition: AttributeVectorEntry.hpp:36
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
Definition: AttributeListImpl.hpp:39
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
Definition: AttributeListImpl.hpp:47
void clear(XalanDOMString &theString)
Remove all elements from target string.
Definition: DOMStringHelper.hpp:2291
XalanVector< AttributeVectorEntry * > AttributeVectorType
Definition: AttributeListImpl.hpp:150
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:33
void reserve(unsigned int theCount)
Reserve room for the given number of attributes.
Definition: AttributeListImpl.hpp:144
MemoryManagerType & getMemoryManager()
Definition: AttributeListImpl.hpp:70
void swap(AttributeListImpl &theOther)
Swap the contents of two instances.
Definition: AttributeListImpl.hpp:132

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo