source: NonGTP/Xerces/xerces/include/xercesc/internal/VecAttributesImpl.hpp @ 358

Revision 358, 5.2 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2001,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: VecAttributesImpl.hpp,v $
19 * Revision 1.4  2004/09/08 13:56:13  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.3  2003/03/07 18:08:58  tng
23 * Return a reference instead of void for operator=
24 *
25 * Revision 1.2  2002/11/04 14:58:18  tng
26 * C++ Namespace Support.
27 *
28 * Revision 1.1.1.1  2002/02/01 22:21:58  peiyongz
29 * sane_include
30 *
31 * Revision 1.5  2001/05/11 13:26:16  tng
32 * Copyright update.
33 *
34 * Revision 1.4  2001/03/21 21:56:04  tng
35 * Schema: Add Schema Grammar, Schema Validator, and split the DTDValidator into DTDValidator, DTDScanner, and DTDGrammar.
36 *
37 * Revision 1.3  2001/02/26 19:44:15  tng
38 * Schema: add utility class QName, by Pei Yong Zhang.
39 *
40 * Revision 1.2  2000/08/09 22:11:17  jpolast
41 * changes to allow const instances of the sax2
42 * Attributes class.
43 *
44 * Revision 1.1  2000/08/02 18:09:14  jpolast
45 * initial checkin: attributes vector needed for
46 * Attributes class as defined by sax2 spec
47 *
48 *
49 */
50
51
52#if !defined(VECATTRIBUTESIMPL_HPP)
53#define VECATTRIBUTESIMPL_HPP
54
55#include <xercesc/sax2/Attributes.hpp>
56#include <xercesc/framework/XMLAttr.hpp>
57#include <xercesc/util/RefVectorOf.hpp>
58#include <xercesc/internal/XMLScanner.hpp>
59#include <xercesc/framework/XMLBuffer.hpp>
60
61XERCES_CPP_NAMESPACE_BEGIN
62
63class XMLPARSER_EXPORT VecAttributesImpl : public Attributes
64{
65public :
66    // -----------------------------------------------------------------------
67    //  Constructors and Destructor
68    // -----------------------------------------------------------------------
69    VecAttributesImpl();
70    ~VecAttributesImpl();
71
72
73    // -----------------------------------------------------------------------
74    //  Implementation of the attributes interface
75    // -----------------------------------------------------------------------
76    virtual unsigned int getLength() const ;
77
78        virtual const XMLCh* getURI(const unsigned int index) const;
79    virtual const XMLCh* getLocalName(const unsigned int index) const ;
80    virtual const XMLCh* getQName(const unsigned int index) const ;
81    virtual const XMLCh* getType(const unsigned int index) const ;
82    virtual const XMLCh* getValue(const unsigned int index) const ;
83
84        virtual int getIndex(const XMLCh* const uri, const XMLCh* const localPart ) const  ;
85        virtual int getIndex(const XMLCh* const qName ) const  ;
86
87        virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const localPart ) const  ;
88    virtual const XMLCh* getType(const XMLCh* const qName) const ;
89
90    virtual const XMLCh* getValue(const XMLCh* const qName) const;
91        virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const localPart ) const  ;
92
93
94    // -----------------------------------------------------------------------
95    //  Setter methods
96    // -----------------------------------------------------------------------
97    void setVector
98    (
99        const   RefVectorOf<XMLAttr>* const srcVec
100        , const unsigned int                count
101                , const XMLScanner * const              scanner
102        , const bool                        adopt = false
103    );
104
105private :
106    // -----------------------------------------------------------------------
107    //  Unimplemented constructors and operators
108    // -----------------------------------------------------------------------
109    VecAttributesImpl(const VecAttributesImpl&);
110    VecAttributesImpl& operator=(const VecAttributesImpl&);
111
112
113    // -----------------------------------------------------------------------
114    //  Private data members
115    //
116    //  fAdopt
117    //      Indicates whether the passed vector is to be adopted or not. If
118    //      so, we destroy it when we are destroyed (and when a new vector is
119    //      set!)
120    //
121    //  fCount
122    //      The count of elements in the vector that should be considered
123    //      valid. This is an optimization to allow vector elements to be
124    //      reused over and over but a different count of them be valid for
125    //      each use.
126    //
127    //  fVector
128    //      The vector that provides the backing for the list.
129        //
130        //      fScanner
131        //              This is a pointer to the in use Scanner, so that we can resolve
132        //              namespace URIs from UriIds
133        //
134        //      fURIBuffer
135        //              A temporary buffer which is re-used when getting namespace URI's
136    // -----------------------------------------------------------------------
137    bool                        fAdopt;
138    unsigned int                fCount;
139    const RefVectorOf<XMLAttr>* fVector;
140        const XMLScanner *              fScanner ;
141        //XMLBuffer                                 fURIBuffer ;
142};
143
144XERCES_CPP_NAMESPACE_END
145
146#endif // ! VECATTRIBUTESIMPL_HPP
Note: See TracBrowser for help on using the repository browser.