1 | /*
|
---|
2 | * Copyright 1999-2000,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: VecAttrListImpl.hpp,v $
|
---|
19 | * Revision 1.5 2004/09/08 13:56:13 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.4 2003/05/15 18:26:29 knoaman
|
---|
23 | * Partial implementation of the configurable memory manager.
|
---|
24 | *
|
---|
25 | * Revision 1.3 2003/03/07 18:08:58 tng
|
---|
26 | * Return a reference instead of void for operator=
|
---|
27 | *
|
---|
28 | * Revision 1.2 2002/11/04 14:58:18 tng
|
---|
29 | * C++ Namespace Support.
|
---|
30 | *
|
---|
31 | * Revision 1.1.1.1 2002/02/01 22:21:58 peiyongz
|
---|
32 | * sane_include
|
---|
33 | *
|
---|
34 | * Revision 1.4 2000/02/24 20:18:07 abagchi
|
---|
35 | * Swat for removing Log from API docs
|
---|
36 | *
|
---|
37 | * Revision 1.3 2000/02/06 07:47:53 rahulj
|
---|
38 | * Year 2K copyright swat.
|
---|
39 | *
|
---|
40 | * Revision 1.2 1999/12/15 19:49:37 roddey
|
---|
41 | * Added second getValue() method which takes a short name for the attribute
|
---|
42 | * to get the value for. Just a convenience method.
|
---|
43 | *
|
---|
44 | * Revision 1.1.1.1 1999/11/09 01:08:19 twl
|
---|
45 | * Initial checkin
|
---|
46 | *
|
---|
47 | * Revision 1.2 1999/11/08 20:44:45 rahul
|
---|
48 | * Swat for adding in Product name and CVS comment log variable.
|
---|
49 | *
|
---|
50 | */
|
---|
51 |
|
---|
52 |
|
---|
53 | #if !defined(VECATTRLISTIMPL_HPP)
|
---|
54 | #define VECATTRLISTIMPL_HPP
|
---|
55 |
|
---|
56 | #include <xercesc/sax/AttributeList.hpp>
|
---|
57 | #include <xercesc/framework/XMLAttr.hpp>
|
---|
58 | #include <xercesc/util/RefVectorOf.hpp>
|
---|
59 |
|
---|
60 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
61 |
|
---|
62 | class XMLPARSER_EXPORT VecAttrListImpl : public XMemory, public AttributeList
|
---|
63 | {
|
---|
64 | public :
|
---|
65 | // -----------------------------------------------------------------------
|
---|
66 | // Constructors and Destructor
|
---|
67 | // -----------------------------------------------------------------------
|
---|
68 | VecAttrListImpl();
|
---|
69 | ~VecAttrListImpl();
|
---|
70 |
|
---|
71 |
|
---|
72 | // -----------------------------------------------------------------------
|
---|
73 | // Implementation of the attribute list interface
|
---|
74 | // -----------------------------------------------------------------------
|
---|
75 | virtual unsigned int getLength() const;
|
---|
76 | virtual const XMLCh* getName(const unsigned int index) const;
|
---|
77 | virtual const XMLCh* getType(const unsigned int index) const;
|
---|
78 | virtual const XMLCh* getValue(const unsigned int index) const;
|
---|
79 | virtual const XMLCh* getType(const XMLCh* const name) const;
|
---|
80 | virtual const XMLCh* getValue(const XMLCh* const name) const;
|
---|
81 | virtual const XMLCh* getValue(const char* const name) const;
|
---|
82 |
|
---|
83 |
|
---|
84 | // -----------------------------------------------------------------------
|
---|
85 | // Setter methods
|
---|
86 | // -----------------------------------------------------------------------
|
---|
87 | void setVector
|
---|
88 | (
|
---|
89 | const RefVectorOf<XMLAttr>* const srcVec
|
---|
90 | , const unsigned int count
|
---|
91 | , const bool adopt = false
|
---|
92 | );
|
---|
93 |
|
---|
94 |
|
---|
95 | private :
|
---|
96 | // -----------------------------------------------------------------------
|
---|
97 | // Unimplemented constructors and operators
|
---|
98 | // -----------------------------------------------------------------------
|
---|
99 | VecAttrListImpl(const VecAttrListImpl&);
|
---|
100 | VecAttrListImpl& operator=(const VecAttrListImpl&);
|
---|
101 |
|
---|
102 |
|
---|
103 | // -----------------------------------------------------------------------
|
---|
104 | // Private data members
|
---|
105 | //
|
---|
106 | // fAdopt
|
---|
107 | // Indicates whether the passed vector is to be adopted or not. If
|
---|
108 | // so, we destroy it when we are destroyed (and when a new vector is
|
---|
109 | // set!)
|
---|
110 | //
|
---|
111 | // fCount
|
---|
112 | // The count of elements in the vector that should be considered
|
---|
113 | // valid. This is an optimization to allow vector elements to be
|
---|
114 | // reused over and over but a different count of them be valid for
|
---|
115 | // each use.
|
---|
116 | //
|
---|
117 | // fVector
|
---|
118 | // The vector that provides the backing for the list.
|
---|
119 | // -----------------------------------------------------------------------
|
---|
120 | bool fAdopt;
|
---|
121 | unsigned int fCount;
|
---|
122 | const RefVectorOf<XMLAttr>* fVector;
|
---|
123 | };
|
---|
124 |
|
---|
125 | XERCES_CPP_NAMESPACE_END
|
---|
126 |
|
---|
127 | #endif
|
---|