Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:34:13

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  *
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_VECATTRLISTIMPL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_VECATTRLISTIMPL_HPP
0024 
0025 #include <xercesc/sax/AttributeList.hpp>
0026 #include <xercesc/framework/XMLAttr.hpp>
0027 #include <xercesc/util/RefVectorOf.hpp>
0028 
0029 XERCES_CPP_NAMESPACE_BEGIN
0030 
0031 class XMLPARSER_EXPORT VecAttrListImpl : public XMemory, public AttributeList
0032 {
0033 public :
0034     // -----------------------------------------------------------------------
0035     //  Constructors and Destructor
0036     // -----------------------------------------------------------------------
0037     VecAttrListImpl();
0038     ~VecAttrListImpl();
0039 
0040 
0041     // -----------------------------------------------------------------------
0042     //  Implementation of the attribute list interface
0043     // -----------------------------------------------------------------------
0044     virtual XMLSize_t getLength() const;
0045     virtual const XMLCh* getName(const XMLSize_t index) const;
0046     virtual const XMLCh* getType(const XMLSize_t index) const;
0047     virtual const XMLCh* getValue(const XMLSize_t index) const;
0048     virtual const XMLCh* getType(const XMLCh* const name) const;
0049     virtual const XMLCh* getValue(const XMLCh* const name) const;
0050     virtual const XMLCh* getValue(const char* const name) const;
0051 
0052 
0053     // -----------------------------------------------------------------------
0054     //  Setter methods
0055     // -----------------------------------------------------------------------
0056     void setVector
0057     (
0058         const   RefVectorOf<XMLAttr>* const srcVec
0059         , const XMLSize_t                   count
0060         , const bool                        adopt = false
0061     );
0062 
0063 
0064 private :
0065     // -----------------------------------------------------------------------
0066     //  Unimplemented constructors and operators
0067     // -----------------------------------------------------------------------
0068     VecAttrListImpl(const VecAttrListImpl&);
0069     VecAttrListImpl& operator=(const VecAttrListImpl&);
0070 
0071 
0072     // -----------------------------------------------------------------------
0073     //  Private data members
0074     //
0075     //  fAdopt
0076     //      Indicates whether the passed vector is to be adopted or not. If
0077     //      so, we destroy it when we are destroyed (and when a new vector is
0078     //      set!)
0079     //
0080     //  fCount
0081     //      The count of elements in the vector that should be considered
0082     //      valid. This is an optimization to allow vector elements to be
0083     //      reused over and over but a different count of them be valid for
0084     //      each use.
0085     //
0086     //  fVector
0087     //      The vector that provides the backing for the list.
0088     // -----------------------------------------------------------------------
0089     bool                        fAdopt;
0090     XMLSize_t                   fCount;
0091     const RefVectorOf<XMLAttr>* fVector;
0092 };
0093 
0094 XERCES_CPP_NAMESPACE_END
0095 
0096 #endif