Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


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 
37 XALAN_CPP_NAMESPACE_BEGIN
38 
39 
40 
42 
43 
44 
45 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType;
46 
47 
48 
50 {
51 public:
52 
53  explicit
54  AttributeListImpl(MemoryManager& theManager);
55 
56  virtual
58 
59  AttributeListImpl(const AttributeListImpl& theSource,
60  MemoryManager& theManager);
61 
62  AttributeListImpl(const AttributeListType& theSource,
63  MemoryManager& theManager);
64 
66  operator=(const AttributeListImpl& theRHS);
67 
69  operator=(const AttributeListType& theRHS);
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
104  clear();
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
114  addAttribute(
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
125  removeAttribute(const XMLCh* name);
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
146  reserve(XalanSize_t theCount)
147  {
148  m_AttributeVector.reserve(theCount);
149  }
150 
151  // This vector will hold the entries.
153 
154 private:
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 XALAN_CPP_NAMESPACE_END
184 
185 
186 
187 #endif // ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
void clear(XalanDOMString &theString)
Remove all elements from target string.
XalanVector< AttributeVectorEntry * > AttributeVectorType
MemoryManager & getMemoryManager()
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
#define XALAN_PLATFORMSUPPORT_EXPORT
void reserve(XalanSize_t theCount)
Reserve room for the given number of attributes.
void swap(AttributeListImpl &theOther)
Swap the contents of two instances.

Interpreting class diagrams

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

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

Apache Logo