00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680) 00019 #define ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp> 00025 00026 00027 00028 #include <xalanc/Include/XalanVector.hpp> 00029 00030 00031 00032 #include <xercesc/sax/AttributeList.hpp> 00033 00034 00035 00036 00037 XALAN_CPP_NAMESPACE_BEGIN 00038 00039 00040 00041 class AttributeVectorEntry; 00042 00043 00044 00045 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType; 00046 00047 00048 00049 class XALAN_PLATFORMSUPPORT_EXPORT AttributeListImpl : public AttributeListType 00050 { 00051 public: 00052 00053 explicit 00054 AttributeListImpl(MemoryManager& theManager); 00055 00056 virtual 00057 ~AttributeListImpl(); 00058 00059 AttributeListImpl(const AttributeListImpl& theSource, 00060 MemoryManager& theManager); 00061 00062 AttributeListImpl(const AttributeListType& theSource, 00063 MemoryManager& theManager); 00064 00065 AttributeListImpl& 00066 operator=(const AttributeListImpl& theRHS); 00067 00068 AttributeListImpl& 00069 operator=(const AttributeListType& theRHS); 00070 00071 MemoryManager& 00072 getMemoryManager() 00073 { 00074 return m_AttributeVector.getMemoryManager(); 00075 } 00076 00077 // These are inherited from AttributeList 00078 virtual XalanSize_t 00079 getLength() const; 00080 00081 virtual const XMLCh* 00082 getName(const XalanSize_t index) const; 00083 00084 virtual const XMLCh* 00085 getType(const XalanSize_t index) const; 00086 00087 virtual const XMLCh* 00088 getValue(const XalanSize_t index) const; 00089 00090 virtual const XMLCh* 00091 getType(const XMLCh* const name) const; 00092 00093 virtual const XMLCh* 00094 getValue(const XMLCh* const name) const; 00095 00096 virtual const XMLCh* 00097 getValue(const char* const name) const; 00098 // The mutators are new to this class. 00099 00100 /** 00101 * Remove all attributes from the list 00102 */ 00103 virtual void 00104 clear(); 00105 00106 /** 00107 * Adds an attribute to the attribute list 00108 * 00109 * @param name attribute name 00110 * @param type attribute type, "CDATA," for example 00111 * @param value attribute value 00112 */ 00113 virtual bool 00114 addAttribute( 00115 const XMLCh* name, 00116 const XMLCh* type, 00117 const XMLCh* value); 00118 00119 /** 00120 * Removes an attribute from the attribute list 00121 * 00122 * @param name attribute name 00123 */ 00124 virtual bool 00125 removeAttribute(const XMLCh* name); 00126 00127 /** 00128 * Swap the contents of two instances. This must _never_ 00129 * throw an exception. 00130 * 00131 * @param thOther The instance with which to swap. 00132 */ 00133 void 00134 swap(AttributeListImpl& theOther) 00135 { 00136 m_AttributeVector.swap(theOther.m_AttributeVector); 00137 } 00138 00139 /** 00140 * Reserve room for the given number of 00141 * attributes. 00142 * 00143 * @param theCount The number to reserve 00144 */ 00145 void 00146 reserve(XalanSize_t theCount) 00147 { 00148 m_AttributeVector.reserve(theCount); 00149 } 00150 00151 // This vector will hold the entries. 00152 typedef XalanVector<AttributeVectorEntry*> AttributeVectorType; 00153 00154 private: 00155 00156 // This is not implemented. 00157 bool 00158 operator==(const AttributeListImpl&) const; 00159 00160 // Default vector allocation size. 00161 enum 00162 { 00163 eDefaultVectorSize = 5 00164 }; 00165 00166 AttributeVectorEntry* 00167 getNewEntry( 00168 const XMLCh* name, 00169 const XMLCh* type, 00170 const XMLCh* value); 00171 00172 // Helper function to delete entries... 00173 static void 00174 deleteEntries(AttributeVectorType& theVector); 00175 00176 AttributeVectorType m_AttributeVector; 00177 00178 AttributeVectorType m_cacheVector; 00179 }; 00180 00181 00182 00183 XALAN_CPP_NAMESPACE_END 00184 00185 00186 00187 #endif // ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|