Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AttributeListImpl.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2004 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #if !defined(ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680)
00017 #define ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
00023 
00024 
00025 
00026 #include <xalanc/Include/XalanVector.hpp>
00027 
00028 
00029 
00030 #include <xercesc/sax/AttributeList.hpp>
00031 
00032 
00033 
00034 
00035 XALAN_CPP_NAMESPACE_BEGIN
00036 
00037 
00038 
00039 class AttributeVectorEntry;
00040 
00041 
00042 
00043 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList    AttributeListType;
00044 
00045 
00046 
00047 class XALAN_PLATFORMSUPPORT_EXPORT AttributeListImpl : public AttributeListType
00048 {
00049 public:
00050 
00051     explicit
00052     AttributeListImpl(MemoryManagerType&      theManager);
00053 
00054     virtual
00055     ~AttributeListImpl();
00056 
00057     AttributeListImpl(const AttributeListImpl&  theSource,
00058                         MemoryManagerType&      theManager);
00059 
00060     AttributeListImpl(const AttributeListType&  theSource,
00061                         MemoryManagerType&      theManager);
00062 
00063     AttributeListImpl&
00064     operator=(const AttributeListImpl&  theRHS);
00065 
00066     AttributeListImpl&
00067     operator=(const AttributeListType&  theRHS);
00068 
00069     MemoryManagerType&
00070     getMemoryManager()
00071     {
00072         return m_AttributeVector.getMemoryManager();
00073     }
00074 
00075     // These are inherited from AttributeList
00076     virtual unsigned int
00077     getLength() const;
00078 
00079     virtual const XMLCh*
00080     getName(const unsigned int index) const;
00081 
00082     virtual const XMLCh*
00083     getType(const unsigned int index) const;
00084 
00085     virtual const XMLCh*
00086     getValue(const unsigned int index) const;
00087 
00088     virtual const XMLCh*
00089     getType(const XMLCh* const name) const;
00090 
00091     virtual const XMLCh*
00092     getValue(const XMLCh* const name) const;
00093 
00094     virtual const XMLCh*
00095     getValue(const char* const name) const;
00096     // The mutators are new to this class.
00097 
00101     virtual void
00102     clear();
00103 
00111     virtual bool
00112     addAttribute(
00113             const XMLCh*    name,
00114             const XMLCh*    type,
00115             const XMLCh*    value);
00116 
00122     virtual bool
00123     removeAttribute(const XMLCh*    name);
00124 
00131     void
00132     swap(AttributeListImpl&     theOther)
00133     {
00134         m_AttributeVector.swap(theOther.m_AttributeVector);
00135     }
00136 
00143     void
00144     reserve(unsigned int    theCount)
00145     {
00146         m_AttributeVector.reserve(theCount);
00147     }
00148 
00149     // This vector will hold the entries.
00150     typedef XalanVector<AttributeVectorEntry*>          AttributeVectorType;
00151 
00152 #if defined(XALAN_NEEDS_EXPLICIT_TEMPLATE_INSTANTIATION)
00153     struct NameCompareFunctor
00154     {
00155         NameCompareFunctor(const XMLCh*     theName) :
00156             m_name(theName)
00157         {
00158         }
00159 
00160         bool
00161         operator()(const AttributeVectorEntry*  theEntry) const;
00162 
00163     private:
00164 
00165         const XMLCh* const  m_name;
00166     };
00167 #endif
00168 
00169 private:
00170 
00171     // This is not implemented.
00172     bool
00173     operator==(const AttributeListImpl&) const;
00174 
00175     // Default vector allocation size.
00176     enum
00177     {
00178         eDefaultVectorSize = 5
00179     };
00180 
00181     AttributeVectorEntry*
00182     getNewEntry(
00183             const XMLCh*    name,
00184             const XMLCh*    type,
00185             const XMLCh*    value);
00186 
00187     // Helper function to delete entries...
00188     static void
00189     deleteEntries(AttributeVectorType&  theVector);
00190 
00191     AttributeVectorType     m_AttributeVector;
00192 
00193     AttributeVectorType     m_cacheVector;
00194 };
00195 
00196 
00197 
00198 XALAN_CPP_NAMESPACE_END
00199 
00200 
00201 
00202 #endif  // ATTRIBUTELISTIMPL_HEADER_GUARD_1357924680

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