Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

XSECXPathNodeList.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * XSECXPathNodeList := A structure to hold node lists from XPath 
00021  * evaluations
00022  *
00023  * Author(s): Berin Lautenbach
00024  *
00025  * $Id: XSECXPathNodeList.hpp,v 1.9 2005/02/03 13:53:54 milan Exp $
00026  *
00027  */
00028 
00029 #ifndef XSECXPATHNODELIST_INCLUDE
00030 #define XSECXPATHNODELIST_INCLUDE
00031 
00032 // XSEC
00033 #include <xsec/framework/XSECDefs.hpp>
00034 
00035 // Xerces
00036 
00037 XSEC_DECLARE_XERCES_CLASS(DOMNode);
00038 
00039 #define _XSEC_NODELIST_DEFAULT_SIZE 100
00040 
00058 class DSIG_EXPORT XSECXPathNodeList {
00059 
00060 public:
00061 
00064 
00065     XSECXPathNodeList(unsigned int initialSize = _XSEC_NODELIST_DEFAULT_SIZE);
00066 
00075     XSECXPathNodeList(const XSECXPathNodeList &other);
00076 
00077     ~XSECXPathNodeList();
00078 
00091     XSECXPathNodeList & operator= (const XSECXPathNodeList & toCopy);
00092 
00093 
00095 
00096 
00099 
00109     void addNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n);
00110 
00119     void removeNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n);
00120 
00126     void clear(void);
00127 
00129 
00132 
00139     bool hasNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n);
00140 
00149     const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getFirstNode(void);
00150 
00159     const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getNextNode(void);
00160 
00162 
00165 
00174     void intersect(const XSECXPathNodeList &toIntersect);
00175 
00177 
00178 private:
00179 
00180     // Internal functions
00181     unsigned int findNodeIndex(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * n);
00182 
00183     const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode    
00184                                     ** mp_elts;         // The current list of elements
00185 
00186     unsigned int                    m_size;             // How big is the current array
00187     unsigned int                    m_num;              // Number of elements in the array
00188 
00189     unsigned int                    m_current;          // current point in list for getNextNode
00190 };
00191 
00192 
00193 
00194 #endif /* XSECXPATHNODELIST_INCLUDE */
00195 

Generated on Sun Jul 3 17:37:28 2005 for XML-Security-C by  doxygen 1.4.2