[2674] | 1 | /* |
---|
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 3 | * contributor license agreements. See the NOTICE file distributed with |
---|
| 4 | * this work for additional information regarding copyright ownership. |
---|
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 6 | * (the "License"); you may not use this file except in compliance with |
---|
| 7 | * the License. You may obtain a copy of the License at |
---|
| 8 | * |
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 10 | * |
---|
| 11 | * Unless required by applicable law or agreed to in writing, software |
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 14 | * See the License for the specific language governing permissions and |
---|
| 15 | * limitations under the License. |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | * $Id: VecAttrListImpl.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | #if !defined(VECATTRLISTIMPL_HPP) |
---|
| 24 | #define VECATTRLISTIMPL_HPP |
---|
| 25 | |
---|
| 26 | #include <xercesc/sax/AttributeList.hpp> |
---|
| 27 | #include <xercesc/framework/XMLAttr.hpp> |
---|
| 28 | #include <xercesc/util/RefVectorOf.hpp> |
---|
| 29 | |
---|
| 30 | XERCES_CPP_NAMESPACE_BEGIN |
---|
| 31 | |
---|
| 32 | class XMLPARSER_EXPORT VecAttrListImpl : public XMemory, public AttributeList |
---|
| 33 | { |
---|
| 34 | public : |
---|
| 35 | // ----------------------------------------------------------------------- |
---|
| 36 | // Constructors and Destructor |
---|
| 37 | // ----------------------------------------------------------------------- |
---|
| 38 | VecAttrListImpl(); |
---|
| 39 | ~VecAttrListImpl(); |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | // ----------------------------------------------------------------------- |
---|
| 43 | // Implementation of the attribute list interface |
---|
| 44 | // ----------------------------------------------------------------------- |
---|
| 45 | virtual unsigned int getLength() const; |
---|
| 46 | virtual const XMLCh* getName(const unsigned int index) const; |
---|
| 47 | virtual const XMLCh* getType(const unsigned int index) const; |
---|
| 48 | virtual const XMLCh* getValue(const unsigned int index) const; |
---|
| 49 | virtual const XMLCh* getType(const XMLCh* const name) const; |
---|
| 50 | virtual const XMLCh* getValue(const XMLCh* const name) const; |
---|
| 51 | virtual const XMLCh* getValue(const char* const name) const; |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | // ----------------------------------------------------------------------- |
---|
| 55 | // Setter methods |
---|
| 56 | // ----------------------------------------------------------------------- |
---|
| 57 | void setVector |
---|
| 58 | ( |
---|
| 59 | const RefVectorOf<XMLAttr>* const srcVec |
---|
| 60 | , const unsigned int count |
---|
| 61 | , const bool adopt = false |
---|
| 62 | ); |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | private : |
---|
| 66 | // ----------------------------------------------------------------------- |
---|
| 67 | // Unimplemented constructors and operators |
---|
| 68 | // ----------------------------------------------------------------------- |
---|
| 69 | VecAttrListImpl(const VecAttrListImpl&); |
---|
| 70 | VecAttrListImpl& operator=(const VecAttrListImpl&); |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | // ----------------------------------------------------------------------- |
---|
| 74 | // Private data members |
---|
| 75 | // |
---|
| 76 | // fAdopt |
---|
| 77 | // Indicates whether the passed vector is to be adopted or not. If |
---|
| 78 | // so, we destroy it when we are destroyed (and when a new vector is |
---|
| 79 | // set!) |
---|
| 80 | // |
---|
| 81 | // fCount |
---|
| 82 | // The count of elements in the vector that should be considered |
---|
| 83 | // valid. This is an optimization to allow vector elements to be |
---|
| 84 | // reused over and over but a different count of them be valid for |
---|
| 85 | // each use. |
---|
| 86 | // |
---|
| 87 | // fVector |
---|
| 88 | // The vector that provides the backing for the list. |
---|
| 89 | // ----------------------------------------------------------------------- |
---|
| 90 | bool fAdopt; |
---|
| 91 | unsigned int fCount; |
---|
| 92 | const RefVectorOf<XMLAttr>* fVector; |
---|
| 93 | }; |
---|
| 94 | |
---|
| 95 | XERCES_CPP_NAMESPACE_END |
---|
| 96 | |
---|
| 97 | #endif |
---|