Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:55

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_VECATTRIBUTESIMPL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_VECATTRIBUTESIMPL_HPP
0024 
0025 #include <xercesc/sax2/Attributes.hpp>
0026 #include <xercesc/framework/XMLAttr.hpp>
0027 #include <xercesc/util/RefVectorOf.hpp>
0028 #include <xercesc/internal/XMLScanner.hpp>
0029 #include <xercesc/framework/XMLBuffer.hpp>
0030 
0031 XERCES_CPP_NAMESPACE_BEGIN
0032 
0033 class XMLPARSER_EXPORT VecAttributesImpl : public Attributes
0034 {
0035 public :
0036     // -----------------------------------------------------------------------
0037     //  Constructors and Destructor
0038     // -----------------------------------------------------------------------
0039     VecAttributesImpl();
0040     ~VecAttributesImpl();
0041 
0042 
0043     // -----------------------------------------------------------------------
0044     //  Implementation of the attributes interface
0045     // -----------------------------------------------------------------------
0046     virtual XMLSize_t getLength() const ;
0047 
0048     virtual const XMLCh* getURI(const XMLSize_t index) const;
0049     virtual const XMLCh* getLocalName(const XMLSize_t index) const ;
0050     virtual const XMLCh* getQName(const XMLSize_t index) const ;
0051     virtual const XMLCh* getType(const XMLSize_t index) const ;
0052     virtual const XMLCh* getValue(const XMLSize_t index) const ;
0053 
0054     virtual bool getIndex(const XMLCh* const uri, const XMLCh* const localPart, XMLSize_t& index) const;
0055     virtual int getIndex(const XMLCh* const uri, const XMLCh* const localPart ) const  ;
0056     virtual bool getIndex(const XMLCh* const qName, XMLSize_t& index) const;
0057     virtual int getIndex(const XMLCh* const qName ) const  ;
0058 
0059     virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const localPart ) const  ;
0060     virtual const XMLCh* getType(const XMLCh* const qName) const ;
0061 
0062     virtual const XMLCh* getValue(const XMLCh* const qName) const;
0063     virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const localPart ) const  ;
0064 
0065 
0066     // -----------------------------------------------------------------------
0067     //  Setter methods
0068     // -----------------------------------------------------------------------
0069     void setVector
0070     (
0071           const   RefVectorOf<XMLAttr>* const srcVec
0072         , const XMLSize_t                count
0073         , const XMLScanner * const      scanner
0074         , const bool                        adopt = false
0075     );
0076 
0077 private :
0078     // -----------------------------------------------------------------------
0079     //  Unimplemented constructors and operators
0080     // -----------------------------------------------------------------------
0081     VecAttributesImpl(const VecAttributesImpl&);
0082     VecAttributesImpl& operator=(const VecAttributesImpl&);
0083 
0084 
0085     // -----------------------------------------------------------------------
0086     //  Private data members
0087     //
0088     //  fAdopt
0089     //      Indicates whether the passed vector is to be adopted or not. If
0090     //      so, we destroy it when we are destroyed (and when a new vector is
0091     //      set!)
0092     //
0093     //  fCount
0094     //      The count of elements in the vector that should be considered
0095     //      valid. This is an optimization to allow vector elements to be
0096     //      reused over and over but a different count of them be valid for
0097     //      each use.
0098     //
0099     //  fVector
0100     //      The vector that provides the backing for the list.
0101     //
0102     //  fScanner
0103     //      This is a pointer to the in use Scanner, so that we can resolve
0104     //      namespace URIs from UriIds
0105     //
0106     //  fURIBuffer
0107     //      A temporary buffer which is re-used when getting namespace URI's
0108     // -----------------------------------------------------------------------
0109     bool                        fAdopt;
0110     XMLSize_t                   fCount;
0111     const RefVectorOf<XMLAttr>* fVector;
0112     const XMLScanner *      fScanner ;
0113 };
0114 
0115 XERCES_CPP_NAMESPACE_END
0116 
0117 #endif // ! VECATTRIBUTESIMPL_HPP