Reordered files in all libs - now all includes are in "libname/include" dir - logical, isn't it? This should break compilation however.

This commit is contained in:
pelya
2010-10-26 14:43:54 +03:00
parent fc58bc53c0
commit 6b9b163689
520 changed files with 41 additions and 43205 deletions

View File

@@ -0,0 +1,137 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMAttrImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include "DOMParentNode.hpp"
#include "DOMNodeImpl.hpp"
#include "DOMDocumentImpl.hpp"
#include <xercesc/dom/DOMAttr.hpp>
#include <xercesc/framework/XMLBuffer.hpp>
#include "DOMNodeIDMap.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class DOMElementImpl;
class DOMTypeInfoImpl;
class CDOM_EXPORT DOMAttrImpl: public DOMAttr {
public:
DOMNodeImpl fNode;
DOMParentNode fParent;
const XMLCh *fName;
protected:
const DOMTypeInfoImpl *fSchemaType;
public:
DOMAttrImpl(DOMDocument *ownerDocument, const XMLCh *aName);
DOMAttrImpl(const DOMAttrImpl &other, bool deep=false);
virtual ~DOMAttrImpl();
public:
// Add all functions that are pure virtual in DOMNODE
DOMNODE_FUNCTIONS;
public:
virtual const XMLCh * getName() const;
virtual bool getSpecified() const;
virtual const XMLCh * getValue() const;
virtual void setSpecified(bool arg);
virtual void setValue(const XMLCh * value);
virtual DOMElement * getOwnerElement() const;
virtual bool isId() const;
virtual const DOMTypeInfo* getSchemaTypeInfo() const;
void setOwnerElement(DOMElement *ownerElem); //internal use only
// helper function for DOM Level 3 renameNode
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
//helper function for DOM Level 3 TypeInfo
virtual void setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo);
// helper method that sets this attr to an idnode and places it into the document map
virtual void addAttrToIDNodeMap();
// helper to remove this attr from from the id map if it is in there
virtual void removeAttrFromIDNodeMap();
public:
// Set attribute value fast. Assumptions:
//
// - node is not read-only
// - no ID management is performed
// - this attribute does not have a value
//
virtual void setValueFast (const XMLCh * value);
protected:
void getTextValue(DOMNode* node, XMLBuffer& buf) const;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMAttrImpl& operator=(const DOMAttrImpl&);
};
inline void DOMAttrImpl::removeAttrFromIDNodeMap()
{
if (fNode.isIdAttr()) {
((DOMDocumentImpl *)fParent.fOwnerDocument)->getNodeIDMap()->remove(this);
fNode.isIdAttr(false);
}
}
inline void DOMAttrImpl::addAttrToIDNodeMap()
{
if (fNode.isIdAttr())
return;
fNode.isIdAttr(true);
// REVIST For now, we don't worry about what happens if the new
// name conflicts as per setValue
DOMDocumentImpl *doc = (DOMDocumentImpl *)(fParent.fOwnerDocument);
if (doc->fNodeIDMap == 0)
doc->fNodeIDMap = new (doc) DOMNodeIDMap(500, doc);
doc->getNodeIDMap()->add(this);
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,125 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMAttrMapImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMATTRMAPIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMATTRMAPIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMNamedNodeMap.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class DOMNodeVector;
class CDOM_EXPORT DOMAttrMapImpl : public DOMNamedNodeMap
{
protected:
DOMNodeVector* fNodes;
DOMNode* fOwnerNode; // the node this map belongs to
bool attrDefaults;
virtual void cloneContent(const DOMAttrMapImpl *srcmap);
bool readOnly(); // revisit. Look at owner node read-only.
public:
DOMAttrMapImpl(DOMNode *ownerNod);
// revisit. This "copy" constructor is used for cloning an Element with Attributes,
// and for setting up default attributes. It's probably not right
// for one or the other or both.
DOMAttrMapImpl(DOMNode *ownerNod, const DOMAttrMapImpl *defaults);
DOMAttrMapImpl();
virtual ~DOMAttrMapImpl();
virtual DOMAttrMapImpl *cloneAttrMap(DOMNode *ownerNode);
virtual bool hasDefaults();
virtual void hasDefaults(bool value);
virtual int findNamePoint(const XMLCh *name) const;
virtual int findNamePoint(const XMLCh *namespaceURI,
const XMLCh *localName) const;
virtual DOMNode* removeNamedItemAt(XMLSize_t index);
virtual void setReadOnly(bool readOnly, bool deep);
virtual XMLSize_t getLength() const;
virtual DOMNode* item(XMLSize_t index) const;
virtual DOMNode* getNamedItem(const XMLCh *name) const;
virtual DOMNode* setNamedItem(DOMNode *arg);
virtual DOMNode* removeNamedItem(const XMLCh *name);
virtual DOMNode* getNamedItemNS(const XMLCh *namespaceURI,
const XMLCh *localName) const;
virtual DOMNode* setNamedItemNS(DOMNode *arg);
virtual DOMNode* removeNamedItemNS(const XMLCh *namespaceURI, const XMLCh *localName);
// Fast versions of the above functions which bypass validity checks.
// It also assumes that fNode is not 0 (call reserve) and that there
// is no previous node with this name. These are used in parsing.
//
void setNamedItemFast(DOMNode *arg);
void setNamedItemNSFast(DOMNode *arg);
// Tries to reserve space for the specified number of elements.
// Currently only works on newly-created instances (fNodes == 0).
//
void reserve (XMLSize_t);
void reconcileDefaultAttributes(const DOMAttrMapImpl* defaults);
void moveSpecifiedAttributes(DOMAttrMapImpl* srcmap);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMAttrMapImpl(const DOMAttrMapImpl &);
DOMAttrMapImpl & operator = (const DOMAttrMapImpl &);
};
// ---------------------------------------------------------------------------
// DOMAttrMapImpl: Getters & Setters
// ---------------------------------------------------------------------------
inline bool DOMAttrMapImpl::hasDefaults()
{
return attrDefaults;
}
inline void DOMAttrMapImpl::hasDefaults(bool value)
{
attrDefaults = value;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,85 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMAttrNSImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMATTRNSIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMATTRNSIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include "DOMAttrImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMAttrNSImpl: public DOMAttrImpl {
protected:
//Introduced in DOM Level 2
const XMLCh * fNamespaceURI; //namespace URI of this node
const XMLCh * fLocalName; //local part of qualified name
const XMLCh * fPrefix; // prefix part of qualified name
// revisit - can return local part
// by pointing into the qualified (L1) name.
public:
DOMAttrNSImpl(DOMDocument *ownerDoc, const XMLCh *name);
DOMAttrNSImpl(DOMDocument *ownerDoc, //DOM Level 2
const XMLCh *namespaceURI, const XMLCh *qualifiedName);
DOMAttrNSImpl(const DOMAttrNSImpl &other, bool deep=false);
// Fast construction without any checks for name validity. Used in
// parsing. Note that if prefix is not specified and localName is
// 'xmlns', this constructor expects proper namespaceURI.
//
DOMAttrNSImpl(DOMDocument *ownerDoc,
const XMLCh *namespaceURI,
const XMLCh *prefix, // Null or empty - no prefix.
const XMLCh *localName,
const XMLCh *qualifiedName);
virtual DOMNode * cloneNode(bool deep) const;
//Introduced in DOM Level 2
virtual const XMLCh * getNamespaceURI() const;
virtual const XMLCh * getPrefix() const;
virtual const XMLCh * getLocalName() const;
virtual void setPrefix(const XMLCh *prefix);
virtual void release();
// helper function for DOM Level 3 renameNode
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
void setName(const XMLCh* namespaceURI, const XMLCh* name);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMAttrNSImpl & operator = (const DOMAttrNSImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,98 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMCDATASectionImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMCDATASECTIONIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMCDATASECTIONIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMCDATASection.hpp>
#include "DOMNodeImpl.hpp"
#include "DOMChildNode.hpp"
#include "DOMParentNode.hpp"
#include "DOMCharacterDataImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMCDATASectionImpl: public DOMCDATASection {
protected:
DOMNodeImpl fNode;
DOMChildNode fChild;
DOMCharacterDataImpl fCharacterData;
public:
DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh* data);
DOMCDATASectionImpl(DOMDocument *ownerDoc, const XMLCh* data, XMLSize_t n);
DOMCDATASectionImpl(const DOMCDATASectionImpl &other, bool deep = false);
virtual ~DOMCDATASectionImpl();
// Functions inherited from TEXT
virtual DOMText* splitText(XMLSize_t offset);
// DOM Level 3
virtual bool getIsElementContentWhitespace() const;
virtual const XMLCh* getWholeText() const;
virtual DOMText* replaceWholeText(const XMLCh* content);
// non-standard extension
virtual bool isIgnorableWhitespace() const;
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
public:
// Functions introduced by DOMCharacterData
virtual const XMLCh* getData() const;
virtual XMLSize_t getLength() const;
virtual const XMLCh* substringData(XMLSize_t offset,
XMLSize_t count) const;
virtual void appendData(const XMLCh *arg);
virtual void insertData(XMLSize_t offset, const XMLCh *arg);
virtual void deleteData(XMLSize_t offset,
XMLSize_t count);
virtual void replaceData(XMLSize_t offset,
XMLSize_t count,
const XMLCh *arg);
virtual void setData(const XMLCh *data);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMCDATASectionImpl & operator = (const DOMCDATASectionImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,146 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMCasts.hpp 673975 2008-07-04 09:23:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMCASTS_HPP)
#define XERCESC_INCLUDE_GUARD_DOMCASTS_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
//
// Define inline casting functions to convert from
// (DOMNode *) to DOMParentNode or DOMChildNode *.
//
// This requires knowledge of the structure of the fields of
// for all node types. There are three categories -
//
// Nodetypes that can have children and can be a child themselves.
// e.g. Elements
//
// Object
// DOMNodeImpl fNode;
// DOMParentNode fParent;
// DOMChildNode fChild;
// ... // other fields, depending on node type.
//
// Nodetypes that can not have children, e.g. TEXT
//
// Object
// DOMNodeImpl fNode;
// DOMChildNode fChild;
// ... // other fields, depending on node type
//
// Nodetypes that can not be a child of other nodes, but that can
// have children (are a parent) e.g. ATTR
// Object
// DOMNodeImpl fNode;
// DOMParentNode fParent
// ... // other fields, depending on node type
//
// The casting functions make these assumptions:
// 1. The cast is possible. Using code will not attempt to
// cast to something that does not exist, such as the child
// part of an ATTR
//
// 2. The nodes belong to this implementation.
//
// Some of the casts use the LEAFNODE flag in the common fNode part to
// determine whether an fParent field exists, and thus the
// position of the fChild part within the node.
//
// These functions also cast off const. It was either do that, or make
// a second overloaded set that took and returned const arguements.
//
//
// Note that using offsetof, or taking the offset of an object member at
// a 0 address, is now undefined in C++. And gcc now warns about this behavior.
// This is because doing do so is unreliable for some types of objects.
// See: http://gcc.gnu.org/ml/gcc/2004-06/msg00227.html
// : http://gcc.gnu.org/ml/gcc-bugs/2000-03/msg00805.html
// The casting code below works around gcc's warnings by using a dummy
// pointer, which the compiler cannot tell is null. The defeats the warning,
// but also masks the potential problem.
// The gcc option -Wno-invalid-offsetof may also be used to turn off this warning.
//
#include "DOMElementImpl.hpp"
#include "DOMTextImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
static inline DOMNodeImpl *castToNodeImpl(const DOMNode *p)
{
DOMElementImpl *pE = (DOMElementImpl *)p;
return &(pE->fNode);
}
static inline DOMParentNode *castToParentImpl(const DOMNode *p) {
DOMElementImpl *pE = (DOMElementImpl *)p;
return &(pE->fParent);
}
static inline DOMChildNode *castToChildImpl(const DOMNode *p) {
DOMElementImpl *pE = (DOMElementImpl *)p;
if (pE->fNode.isLeafNode()) {
DOMTextImpl *pT = (DOMTextImpl *)p;
return &(pT->fChild);
}
return &(pE->fChild);
}
static inline DOMNode *castToNode(const DOMParentNode *p ) {
DOMElementImpl* dummy = 0;
XMLSize_t parentOffset = (char *)&(dummy->fParent) - (char *)dummy;
char *retPtr = (char *)p - parentOffset;
return (DOMNode *)retPtr;
}
static inline DOMNode *castToNode(const DOMNodeImpl *p) {
DOMElementImpl* dummy = 0;
XMLSize_t nodeImplOffset = (char *)&(dummy->fNode) - (char *)dummy;
char *retPtr = (char *)p - nodeImplOffset;
return (DOMNode *)retPtr;
}
static inline DOMNodeImpl *castToNodeImpl(const DOMParentNode *p)
{
DOMElementImpl* dummy = 0;
XMLSize_t nodeImplOffset = (char *)&(dummy->fNode) - (char *)dummy;
XMLSize_t parentOffset = (char *)&(dummy->fParent) - (char *)dummy;
char *retPtr = (char *)p - parentOffset + nodeImplOffset;
return (DOMNodeImpl *)retPtr;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,89 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMCharacterDataImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMCHARACTERDATAIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMCHARACTERDATAIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/util/XMLString.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class DOMDocument;
class DOMDocumentImpl;
class DOMBuffer;
// Instances of DOMCharacterDataImpl appear as members of node types
// that implement the DOMCharacterData interfaces.
// Operations in those classes are delegated to this class.
//
class CDOM_EXPORT DOMCharacterDataImpl
{
public:
DOMBuffer* fDataBuf;
// for the buffer bid
DOMDocumentImpl* fDoc;
public:
DOMCharacterDataImpl(DOMDocument *doc, const XMLCh *dat);
DOMCharacterDataImpl(DOMDocument *doc, const XMLCh* data, XMLSize_t n);
DOMCharacterDataImpl(const DOMCharacterDataImpl &other);
~DOMCharacterDataImpl();
const XMLCh * getNodeValue() const;
void setNodeValue(const XMLCh * value);
void appendData(const DOMNode *node, const XMLCh *data);
void appendData(const DOMNode *node, const XMLCh *data, XMLSize_t n);
void deleteData(const DOMNode *node, XMLSize_t offset, XMLSize_t count);
const XMLCh* getData() const;
XMLSize_t getLength() const;
void insertData(const DOMNode *node, XMLSize_t offset, const XMLCh * data);
void replaceData(const DOMNode *node, XMLSize_t offset, XMLSize_t count, const XMLCh * data);
void setData(const DOMNode *node, const XMLCh * arg);
void setNodeValue(const DOMNode *node, const XMLCh *value);
const XMLCh* substringData(const DOMNode *node, XMLSize_t offset, XMLSize_t count) const;
void releaseBuffer();
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMCharacterDataImpl & operator = (const DOMCharacterDataImpl &);
};
#define GetDOMCharacterDataImplMemoryManager GET_DIRECT_MM(fDoc)
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,72 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMChildNode.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMCHILDNODE_HPP)
#define XERCESC_INCLUDE_GUARD_DOMCHILDNODE_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
/**
* ChildNode adds to NodeImpl the capability of being a child, this is having
* siblings.
**/
#include <xercesc/util/XercesDefs.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMDocument;
class DOMNode;
class CDOM_EXPORT DOMChildNode {
public:
DOMNode *previousSibling;
DOMNode *nextSibling;
DOMChildNode();
DOMChildNode(const DOMChildNode &other);
~DOMChildNode();
DOMNode * getNextSibling() const;
DOMNode * getParentNode(const DOMNode *thisNode) const;
DOMNode * getPreviousSibling(const DOMNode *thisNode) const;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMChildNode & operator = (const DOMChildNode &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,84 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMCommentImpl.hpp 676911 2008-07-15 13:27:32Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMCOMMENTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMCOMMENTIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMComment.hpp>
#include "DOMNodeImpl.hpp"
#include "DOMChildNode.hpp"
#include "DOMCharacterDataImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMCommentImpl: public DOMComment {
public:
DOMNodeImpl fNode;
DOMChildNode fChild;
DOMCharacterDataImpl fCharacterData;
public:
DOMCommentImpl(DOMDocument *, const XMLCh *);
DOMCommentImpl(const DOMCommentImpl &other, bool deep);
virtual ~DOMCommentImpl();
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
public:
// Functions from DOMCharacterData
virtual void appendData(const XMLCh *data);
virtual void deleteData(XMLSize_t offset, XMLSize_t count);
virtual const XMLCh * getData() const;
virtual XMLSize_t getLength() const;
virtual void insertData(XMLSize_t offset, const XMLCh * data);
virtual void replaceData(XMLSize_t offset, XMLSize_t count, const XMLCh * data);
virtual void setData(const XMLCh * arg);
virtual const XMLCh * substringData(XMLSize_t offset, XMLSize_t count) const;
// Non standard extension for the range to work
DOMComment* splitText(XMLSize_t offset);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMCommentImpl & operator = (const DOMCommentImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,150 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#if !defined(XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP
//------------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------------
#include <xercesc/dom/DOMConfiguration.hpp>
#include <xercesc/dom/DOMErrorHandler.hpp>
#include <xercesc/util/XMLString.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMDocumentImpl;
class DOMStringListImpl;
class CDOM_EXPORT DOMConfigurationImpl : public DOMConfiguration
{
private:
//unimplemented
DOMConfigurationImpl(const DOMConfiguration &);
DOMConfigurationImpl & operator = (const DOMConfiguration &);
public:
//-----------------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------------
DOMConfigurationImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~DOMConfigurationImpl();
enum DOMConfigurationFeature {
FEATURE_CANONICAL_FORM = 0x0001,
FEATURE_CDATA_SECTIONS = 0x0002,
FEATURE_COMMENTS = 0x0004,
FEATURE_DATATYPE_NORMALIZATION = 0x0008,
FEATURE_DISCARD_DEFAULT_CONTENT = 0x0010,
FEATURE_ENTITIES = 0x0020,
FEATURE_INFOSET = 0x0040,
FEATURE_NAMESPACES = 0x0080,
FEATURE_NAMESPACE_DECLARATIONS = 0x0100,
FEATURE_NORMALIZE_CHARACTERS = 0x0200,
FEATURE_SPLIT_CDATA_SECTIONS = 0x0400,
FEATURE_VALIDATE = 0x0800,
FEATURE_VALIDATE_IF_SCHEMA = 0x1000,
FEATURE_ELEMENT_CONTENT_WHITESPACE = 0x2000
};
unsigned short featureValues;
// -----------------------------------------------------------------------
// Setter methods
// -----------------------------------------------------------------------
virtual void setParameter(const XMLCh* name, const void* value);
virtual void setParameter(const XMLCh* name, bool value);
// -----------------------------------------------------------------------
// Getter methods
// -----------------------------------------------------------------------
virtual const void* getParameter(const XMLCh* name) const;
// -----------------------------------------------------------------------
// Query methods
// -----------------------------------------------------------------------
virtual bool canSetParameter(const XMLCh* name, const void* value) const;
virtual bool canSetParameter(const XMLCh* name, bool value) const;
virtual const DOMStringList* getParameterNames() const;
// ---------------------------------------------------------------------------
// Impl specific methods
// ---------------------------------------------------------------------------
/* specific get and set methods for non-boolean parameters
* */
DOMErrorHandler* getErrorHandler() const;
const XMLCh* getSchemaType() const;
const XMLCh* getSchemaLocation() const;
void setErrorHandler(DOMErrorHandler *erHandler);
void setSchemaType(const XMLCh* st);
void setSchemaLocation(const XMLCh* sl);
// The default values for the boolean parameters
// from CANONICAL_FORM to ELEMENT_CONTENT_WHITESPACE
// 10010110010110 = 0x2596
static const unsigned short fDEFAULT_VALUES;
protected:
// implements a simple map between the name and its enum value
DOMConfigurationFeature getFeatureFlag(const XMLCh* name) const;
// the error handler
DOMErrorHandler* fErrorHandler;
// the schema type
const XMLCh* fSchemaType;
// the schema location
const XMLCh* fSchemaLocation;
// the list of supported parameters
DOMStringListImpl* fSupportedParameters;
MemoryManager* fMemoryManager;
};
XERCES_CPP_NAMESPACE_END
#endif
/**
* End of file DOMConfigurationImpl.hpp
*/

View File

@@ -0,0 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMDeepNodeListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMNodeList.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class CDOM_EXPORT DOMDeepNodeListImpl: public DOMNodeList {
protected:
const DOMNode* fRootNode;
const XMLCh* fTagName;
bool fMatchAll;
int fChanges;
DOMNode* fCurrentNode;
XMLSize_t fCurrentIndexPlus1;
//DOM Level 2
const XMLCh* fNamespaceURI;
bool fMatchAllURI;
bool fMatchURIandTagname; //match both namespaceURI and tagName
public:
DOMDeepNodeListImpl(const DOMNode *rootNode, const XMLCh *tagName);
DOMDeepNodeListImpl(const DOMNode *rootNode, //DOM Level 2
const XMLCh *namespaceURI,
const XMLCh *localName);
virtual ~DOMDeepNodeListImpl();
virtual XMLSize_t getLength() const;
virtual DOMNode* item(XMLSize_t index) const;
DOMNode* cacheItem(XMLSize_t index);
protected:
DOMNode* nextMatchingElementAfter(DOMNode *current);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMDeepNodeListImpl(const DOMDeepNodeListImpl &);
DOMDeepNodeListImpl & operator = (const DOMDeepNodeListImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,200 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMDeepNodeListPool.hpp 883368 2009-11-23 15:28:19Z amassari $
*/
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#if !defined(XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTPOOL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMDEEPNODELISTPOOL_HPP
#include <xercesc/util/Hashers.hpp>
#include <xercesc/util/IllegalArgumentException.hpp>
#include <xercesc/util/NoSuchElementException.hpp>
#include <xercesc/util/RuntimeException.hpp>
#include <xercesc/util/XMLExceptMsgs.hpp>
#include <xercesc/util/XMLEnumerator.hpp>
XERCES_CPP_NAMESPACE_BEGIN
//
// This should really be a nested class, but some of the compilers we
// have to support cannot deal with that!
//
template <class TVal>
struct DOMDeepNodeListPoolTableBucketElem : public XMemory
{
DOMDeepNodeListPoolTableBucketElem
(
void* key1
, XMLCh* key2
, XMLCh* key3
, TVal* const value
, DOMDeepNodeListPoolTableBucketElem<TVal>* next
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
) :
fData(value)
, fNext(next)
, fKey1(key1)
, fKey2(0)
, fKey3(0)
{
if (key2)
fKey2 = XMLString::replicate(key2, manager);
if (key3)
fKey3 = XMLString::replicate(key3, manager);
}
TVal* fData;
DOMDeepNodeListPoolTableBucketElem<TVal>* fNext;
void* fKey1;
XMLCh* fKey2;
XMLCh* fKey3;
~DOMDeepNodeListPoolTableBucketElem() {};
};
template <class TVal, class THasher = PtrHasher>
class DOMDeepNodeListPool
{
public:
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
DOMDeepNodeListPool
(
const XMLSize_t modulus
, const XMLSize_t initSize = 128
);
DOMDeepNodeListPool
(
const XMLSize_t modulus
, const bool adoptElems
, const XMLSize_t initSize = 128
);
DOMDeepNodeListPool
(
const XMLSize_t modulus
, const bool adoptElems
, const THasher& hasher
, const XMLSize_t initSize = 128
);
~DOMDeepNodeListPool();
// -----------------------------------------------------------------------
// Element management
// -----------------------------------------------------------------------
bool isEmpty() const;
bool containsKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const;
void removeAll();
void cleanup();
// -----------------------------------------------------------------------
// Getters
// -----------------------------------------------------------------------
TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3);
const TVal* getByKey(const void* const key1, const XMLCh* const key2, const XMLCh* const key3) const;
TVal* getById(const XMLSize_t elemId);
const TVal* getById(const XMLSize_t elemId) const;
// -----------------------------------------------------------------------
// Putters
// -----------------------------------------------------------------------
XMLSize_t put(void* key1, XMLCh* key2, XMLCh* key3, TVal* const valueToAdopt);
private:
// -----------------------------------------------------------------------
// Private methods
// -----------------------------------------------------------------------
DOMDeepNodeListPoolTableBucketElem<TVal>* findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal);
const DOMDeepNodeListPoolTableBucketElem<TVal>* findBucketElem(const void* const key1, const XMLCh* const key2, const XMLCh* const key3, XMLSize_t& hashVal) const;
void initialize(const XMLSize_t modulus);
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMDeepNodeListPool(const DOMDeepNodeListPool<TVal, THasher> &);
DOMDeepNodeListPool<TVal, THasher> & operator = (const DOMDeepNodeListPool<TVal, THasher> &);
// -----------------------------------------------------------------------
// Data members
//
// fAdoptedElems
// Indicates whether the values added are adopted or just referenced.
// If adopted, then they are deleted when they are removed from the
// hash table.
//
// fBucketList
// This is the array that contains the heads of all of the list
// buckets, one for each possible hash value.
//
// fHashModulus
// The modulus used for this hash table, to hash the keys. This is
// also the number of elements in the bucket list.
//
// fHash
// The hasher for the key1 data type.
//
// fIdPtrs
// fIdPtrsCount
// This is the array of pointers to the bucket elements in order of
// their assigned ids. So taking id N and referencing this array
// gives you the element with that id. The count field indicates
// the current size of this list. When fIdCounter+1 reaches this
// value the list must be expanded.
//
// fIdCounter
// This is used to give out unique ids to added elements. It starts
// at zero (which means empty), and is bumped up for each newly added
// element. So the first element is 1, the next is 2, etc... This
// means that this value is set to the top index of the fIdPtrs array.
// -----------------------------------------------------------------------
bool fAdoptedElems;
DOMDeepNodeListPoolTableBucketElem<TVal>** fBucketList;
XMLSize_t fHashModulus;
TVal** fIdPtrs;
XMLSize_t fIdPtrsCount;
XMLSize_t fIdCounter;
MemoryManager* fMemoryManager;
THasher fHasher;
};
XERCES_CPP_NAMESPACE_END
#if !defined(XERCES_TMPLSINC)
#include <xercesc/dom/impl/DOMDeepNodeListPool.c>
#endif
#endif

View File

@@ -0,0 +1,69 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMDocumentFragmentImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTFRAGMENTIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMDocumentFragment.hpp>
#include "DOMParentNode.hpp"
#include "DOMNodeImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMDocumentFragmentImpl: public DOMDocumentFragment {
protected:
DOMNodeImpl fNode;
DOMParentNode fParent;
protected:
DOMDocumentFragmentImpl(DOMDocument *);
DOMDocumentFragmentImpl(const DOMDocumentFragmentImpl &other, bool deep);
friend class DOMDocumentImpl;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMDocumentFragmentImpl & operator = (const DOMDocumentFragmentImpl &);
public:
virtual ~DOMDocumentFragmentImpl();
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,507 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMDocumentImpl.hpp 679340 2008-07-24 10:28:29Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/RefArrayOf.hpp>
#include <xercesc/util/RefStackOf.hpp>
#include <xercesc/util/RefHash2KeysTableOf.hpp>
#include <xercesc/util/StringPool.hpp>
#include <xercesc/util/KeyRefPair.hpp>
#include <xercesc/util/XMLChar.hpp>
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMUserDataHandler.hpp>
#include <xercesc/dom/DOMMemoryManager.hpp>
#include "DOMNodeImpl.hpp"
#include "DOMStringPool.hpp"
#include "DOMParentNode.hpp"
#include "DOMDeepNodeListPool.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class DOMAttrImpl;
class DOMCDATASectionImpl;
class DOMCommentImpl;
class DOMConfiguration;
class DOMDeepNodeListImpl;
class DOMDocumentFragmentImpl;
class DOMDocumentTypeImpl;
class DOMElementImpl;
class DOMEntityImpl;
class DOMEntityReferenceImpl;
class DOMNotationImpl;
class DOMProcessingInstructionImpl;
class DOMTextImpl;
class DOMNodeIteratorImpl;
class DOMNormalizer;
class DOMTreeWalkerImpl;
class DOMNodeFilter;
class DOMNodeFilterImpl;
class DOMImplementation;
class DOMNodeIDMap;
class DOMRangeImpl;
class DOMBuffer;
class MemoryManager;
class XPathNSResolver;
class XPathExpression;
typedef RefVectorOf<DOMRangeImpl> Ranges;
typedef RefVectorOf<DOMNodeIteratorImpl> NodeIterators;
typedef KeyRefPair<void, DOMUserDataHandler> DOMUserDataRecord;
typedef RefStackOf<DOMNode> DOMNodePtr;
class CDOM_EXPORT DOMDocumentImpl: public XMemory, public DOMMemoryManager, public DOMDocument {
public:
// -----------------------------------------------------------------------
// data
// -----------------------------------------------------------------------
DOMNodeImpl fNode; // Implements common node functionality.
DOMParentNode fParent; // Implements common parent node functionality
DOMNodeIDMap* fNodeIDMap; // for use by GetElementsById().
public:
DOMDocumentImpl(DOMImplementation* domImpl, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
DOMDocumentImpl(const XMLCh* namespaceURI, //DOM Level 2
const XMLCh* qualifiedName,
DOMDocumentType* doctype,
DOMImplementation* domImpl,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
virtual ~DOMDocumentImpl();
void setDocumentType(DOMDocumentType *doctype);
public:
// Add all functions that are pure virtual in DOMNODE
DOMNODE_FUNCTIONS;
public:
// Add all functions that are pure virtual in DOMDocument
virtual DOMAttr* createAttribute(const XMLCh *name);
virtual DOMCDATASection* createCDATASection(const XMLCh *data);
virtual DOMComment* createComment(const XMLCh *data);
virtual DOMDocumentFragment* createDocumentFragment();
virtual DOMDocumentType* createDocumentType(const XMLCh *name);
virtual DOMDocumentType* createDocumentType(const XMLCh *qName,
const XMLCh *publicId,
const XMLCh *systemId);
virtual DOMElement* createElement(const XMLCh * tagName);
virtual DOMElement* createElementNoCheck(const XMLCh *tagName);
virtual DOMEntity* createEntity(const XMLCh * name);
virtual DOMEntityReference* createEntityReference(const XMLCh * name);
virtual DOMNotation* createNotation(const XMLCh * name);
virtual DOMProcessingInstruction* createProcessingInstruction(const XMLCh * target, const XMLCh * data);
virtual DOMText* createTextNode(const XMLCh * data);
virtual DOMDocumentType* getDoctype() const;
virtual DOMElement* getDocumentElement() const;
virtual DOMNodeList* getElementsByTagName(const XMLCh * tagname) const;
virtual DOMImplementation* getImplementation() const;
bool isXMLName(const XMLCh * s);
virtual DOMNodeIterator* createNodeIterator(DOMNode *root,
DOMNodeFilter::ShowType whatToShow,
DOMNodeFilter* filter,
bool entityReferenceExpansion);
virtual DOMTreeWalker* createTreeWalker(DOMNode *root,
DOMNodeFilter::ShowType whatToShow,
DOMNodeFilter* filter,
bool entityReferenceExpansion);
virtual DOMRange* createRange();
virtual Ranges* getRanges() const; //non-standard api
virtual NodeIterators* getNodeIterators() const; //non-standard api
virtual void removeRange(DOMRangeImpl* range); //non-standard api
virtual void removeNodeIterator(DOMNodeIteratorImpl* nodeIterator); //non-standard api
virtual DOMXPathExpression* createExpression(const XMLCh *expression,
const DOMXPathNSResolver *resolver);
virtual DOMXPathNSResolver* createNSResolver(const DOMNode *nodeResolver);
virtual DOMXPathResult* evaluate(const XMLCh *expression,
const DOMNode *contextNode,
const DOMXPathNSResolver *resolver,
DOMXPathResult::ResultType type,
DOMXPathResult* result);
// Extension to be called by the Parser
DOMEntityReference* createEntityReferenceByParser(const XMLCh * name);
// Add all functions that are pure virtual in DOMMemoryManager
virtual XMLSize_t getMemoryAllocationBlockSize() const;
virtual void setMemoryAllocationBlockSize(XMLSize_t size);
virtual void* allocate(XMLSize_t amount);
virtual void* allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type);
virtual void release(DOMNode* object, DOMMemoryManager::NodeObjectType type);
virtual XMLCh* cloneString(const XMLCh *src);
//
// Functions to keep track of document mutations, so that node list chached
// information can be invalidated. One global changes counter per document.
//
virtual void changed();
virtual int changes() const;
/**
* Sets whether the DOM implementation performs error checking
* upon operations. Turning off error checking only affects
* the following DOM checks:
* <ul>
* <li>Checking strings to make sure that all characters are
* legal XML characters
* <li>Hierarchy checking such as allowed children, checks for
* cycles, etc.
* </ul>
* <p>
* Turning off error checking does <em>not</em> turn off the
* following checks:
* <ul>
* <li>Read only checks
* <li>Checks related to DOM events
* </ul>
*/
inline void setErrorChecking(bool check) {
errorChecking = check;
}
/**
* Returns true if the DOM implementation performs error checking.
*/
inline bool getErrorChecking() const {
return errorChecking;
}
//Introduced in DOM Level 2
virtual DOMNode* importNode(const DOMNode *source, bool deep);
virtual DOMElement* createElementNS(const XMLCh *namespaceURI,
const XMLCh *qualifiedName);
virtual DOMElement* createElementNS(const XMLCh *namespaceURI,
const XMLCh *qualifiedName,
const XMLFileLoc lineNo,
const XMLFileLoc columnNo);
virtual DOMAttr* createAttributeNS(const XMLCh *namespaceURI,
const XMLCh *qualifiedName);
virtual DOMNodeList* getElementsByTagNameNS(const XMLCh *namespaceURI,
const XMLCh *localName) const;
virtual DOMElement* getElementById(const XMLCh *elementId) const;
//Introduced in DOM Level 3
virtual const XMLCh* getInputEncoding() const;
virtual const XMLCh* getXmlEncoding() const;
virtual bool getXmlStandalone() const;
virtual void setXmlStandalone(bool standalone);
virtual const XMLCh* getXmlVersion() const;
virtual void setXmlVersion(const XMLCh* version);
virtual const XMLCh* getDocumentURI() const;
virtual void setDocumentURI(const XMLCh* documentURI);
virtual bool getStrictErrorChecking() const;
virtual void setStrictErrorChecking(bool strictErrorChecking);
virtual DOMNode* adoptNode(DOMNode* source);
virtual void normalizeDocument();
virtual DOMConfiguration* getDOMConfig() const;
void setInputEncoding(const XMLCh* actualEncoding);
void setXmlEncoding(const XMLCh* encoding);
// helper functions to prevent storing userdata pointers on every node.
void* setUserData(DOMNodeImpl* n,
const XMLCh* key,
void* data,
DOMUserDataHandler* handler);
void* getUserData(const DOMNodeImpl* n,
const XMLCh* key) const;
void callUserDataHandlers(const DOMNodeImpl* n,
DOMUserDataHandler::DOMOperationType operation,
const DOMNode* src,
DOMNode* dst) const;
void transferUserData(DOMNodeImpl* n1, DOMNodeImpl* n2);
DOMNode* renameNode(DOMNode* n,
const XMLCh* namespaceURI,
const XMLCh* name);
//Return the index > 0 of ':' in the given qualified name qName="prefix:localName".
//Return 0 if there is no ':', or -1 if qName is malformed such as ":abcd".
static int indexofQualifiedName(const XMLCh * qName);
static bool isKidOK(DOMNode *parent, DOMNode *child);
inline DOMNodeIDMap* getNodeIDMap() {return fNodeIDMap;};
//
// Memory Management Functions. All memory is allocated by and owned by
// a document, and is not recovered until the
// document itself is deleted.
//
const XMLCh* getPooledString(const XMLCh*);
const XMLCh* getPooledNString(const XMLCh*, XMLSize_t);
void deleteHeap();
void releaseDocNotifyUserData(DOMNode* object);
void releaseBuffer(DOMBuffer* buffer);
DOMBuffer* popBuffer(XMLSize_t nMinSize);
MemoryManager* getMemoryManager() const;
// Factory methods for getting/creating node lists.
// Because nothing is ever deleted, the implementation caches and recycles
// previously used instances of DOMDeepNodeList
//
DOMNodeList* getDeepNodeList(const DOMNode *rootNode, const XMLCh *tagName);
DOMNodeList* getDeepNodeList(const DOMNode *rootNode, //DOM Level 2
const XMLCh *namespaceURI,
const XMLCh *localName);
protected:
//Internal helper functions
virtual DOMNode* importNode(const DOMNode *source, bool deep, bool cloningNode);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMDocumentImpl(const DOMDocumentImpl &);
DOMDocumentImpl & operator = (const DOMDocumentImpl &);
protected:
// -----------------------------------------------------------------------
// data
// -----------------------------------------------------------------------
// New data introduced in DOM Level 3
const XMLCh* fInputEncoding;
const XMLCh* fXmlEncoding;
bool fXmlStandalone;
const XMLCh* fXmlVersion;
const XMLCh* fDocumentURI;
DOMConfiguration* fDOMConfiguration;
XMLStringPool fUserDataTableKeys;
RefHash2KeysTableOf<DOMUserDataRecord, PtrHasher>* fUserDataTable;
// Per-Document heap Variables.
// The heap consists of one or more biggish blocks which are
// sub-allocated for individual allocations of nodes, strings, etc.
// The big blocks form a linked list, allowing them to be located for deletion.
//
// There is no provision for deleting suballocated blocks, other than
// deleting the entire heap when the document is deleted.
//
// There is no header on individual sub-allocated blocks.
// The header on big blocks consists only of a single back pointer to
// the previously allocated big block (our linked list of big blocks)
//
//
// revisit - this heap should be encapsulated into its own
// class, rather than hanging naked on Document.
//
void* fCurrentBlock;
char* fFreePtr;
XMLSize_t fFreeBytesRemaining,
fHeapAllocSize;
// To recycle the DOMNode pointer
RefArrayOf<DOMNodePtr>* fRecycleNodePtr;
// To recycle DOMBuffer pointer
RefStackOf<DOMBuffer>* fRecycleBufferPtr;
// Pool of DOMNodeList for getElementsByTagName
DOMDeepNodeListPool<DOMDeepNodeListImpl>* fNodeListPool;
// Other data
DOMDocumentType* fDocType;
DOMElement* fDocElement;
DOMStringPoolEntry** fNameTable;
XMLSize_t fNameTableSize;
DOMNormalizer* fNormalizer;
Ranges* fRanges;
NodeIterators* fNodeIterators;
MemoryManager* fMemoryManager; // configurable memory manager
DOMImplementation* fDOMImplementation;
int fChanges;
bool errorChecking; // Bypass error checking.
};
inline MemoryManager* DOMDocumentImpl::getMemoryManager() const
{
return fMemoryManager;
}
inline const XMLCh* DOMDocumentImpl::getPooledString(const XMLCh *in)
{
if (in == 0)
return 0;
DOMStringPoolEntry **pspe;
DOMStringPoolEntry *spe;
XMLSize_t inHash = XMLString::hash(in, fNameTableSize);
pspe = &fNameTable[inHash];
while (*pspe != 0)
{
if (XMLString::equals((*pspe)->fString, in))
return (*pspe)->fString;
pspe = &((*pspe)->fNext);
}
// This string hasn't been seen before. Add it to the pool.
//
// Compute size to allocate. Note that there's 1 char of string
// declared in the struct, so we don't need to add one again to
// account for the trailing null.
//
XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + XMLString::stringLen(in)*sizeof(XMLCh);
*pspe = spe = (DOMStringPoolEntry *)allocate(sizeToAllocate);
spe->fNext = 0;
XMLString::copyString((XMLCh*)spe->fString, in);
return spe->fString;
}
inline const XMLCh* DOMDocumentImpl::
getPooledNString(const XMLCh *in, XMLSize_t n)
{
if (in == 0)
return 0;
DOMStringPoolEntry **pspe;
DOMStringPoolEntry *spe;
XMLSize_t inHash = XMLString::hashN(in, n, fNameTableSize);
pspe = &fNameTable[inHash];
while (*pspe != 0)
{
if (XMLString::equalsN((*pspe)->fString, in, n))
return (*pspe)->fString;
pspe = &((*pspe)->fNext);
}
// This string hasn't been seen before. Add it to the pool.
//
// Compute size to allocate. Note that there's 1 char of string
// declared in the struct, so we don't need to add one again to
// account for the trailing null.
//
XMLSize_t sizeToAllocate = sizeof(DOMStringPoolEntry) + n*sizeof(XMLCh);
*pspe = spe = (DOMStringPoolEntry *)allocate(sizeToAllocate);
spe->fNext = 0;
XMLString::copyNString((XMLCh*)spe->fString, in, n);
return spe->fString;
}
inline int DOMDocumentImpl::indexofQualifiedName(const XMLCh* name)
{
int i = 0;
int colon = -1;
int colon_count = 0;
for (; *name != 0; ++i, ++name)
{
if (*name == chColon)
{
++colon_count;
colon = i;
}
}
if (i == 0 || colon == 0 || colon == (i - 1) || colon_count > 1)
return -1;
return colon != -1 ? colon : 0;
}
XERCES_CPP_NAMESPACE_END
// ---------------------------------------------------------------------------
//
// Operator new. Global overloaded version, lets any object be allocated on
// the heap owned by a document.
//
// ---------------------------------------------------------------------------
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType type)
{
void *p = doc->allocate(amt, type);
return p;
}
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType type)
{
XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0);
void* p=0;
if(mgr)
p = mgr->allocate(amt, type);
return p;
}
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *doc)
{
void* p = doc->allocate(amt);
return p;
}
inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)
{
XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0);
void* p=0;
if(mgr)
p = mgr->allocate(amt);
return p;
}
// ---------------------------------------------------------------------------
// For DOM:
// Bypass compiler warning:
// no matching operator delete found; memory will not be freed if initialization throws an exception
// ---------------------------------------------------------------------------
#if !defined(XERCES_NO_MATCHING_DELETE_OPERATOR)
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType /*type*/)
{
return;
}
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType /*type*/)
{
return;
}
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl * /*doc*/)
{
return;
}
inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/)
{
return;
}
#endif
#endif

View File

@@ -0,0 +1,107 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMDocumentTypeImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPEIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMDOCUMENTTYPEIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMDocumentType.hpp>
#include "DOMNodeImpl.hpp"
#include "DOMChildNode.hpp"
#include "DOMParentNode.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class DOMNamedNodeMapImpl;
class CDOM_EXPORT DOMDocumentTypeImpl: public DOMDocumentType {
protected:
DOMNodeImpl fNode;
DOMParentNode fParent;
DOMChildNode fChild;
const XMLCh * fName;
DOMNamedNodeMapImpl* fEntities;
DOMNamedNodeMapImpl* fNotations;
DOMNamedNodeMapImpl* fElements;
const XMLCh * fPublicId;
const XMLCh * fSystemId;
const XMLCh * fInternalSubset;
bool fIntSubsetReading;
bool fIsCreatedFromHeap;
virtual void setPublicId(const XMLCh * value);
virtual void setSystemId(const XMLCh * value);
virtual void setInternalSubset(const XMLCh *value);
bool isIntSubsetReading() const;
friend class AbstractDOMParser;
friend class DOMDocumentImpl;
public:
DOMDocumentTypeImpl(DOMDocument *, const XMLCh *, bool);
DOMDocumentTypeImpl(DOMDocument *,
const XMLCh *qualifiedName, //DOM Level 2
const XMLCh *publicId, const XMLCh *systemId, bool);
DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool heap, bool deep=false);
virtual ~DOMDocumentTypeImpl();
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
public:
virtual void setOwnerDocument(DOMDocument *doc);
virtual DOMNamedNodeMap * getEntities() const;
virtual const XMLCh * getName() const;
virtual DOMNamedNodeMap * getNotations() const;
virtual DOMNamedNodeMap * getElements() const;
virtual void setReadOnly(bool readOnly, bool deep);
//Introduced in DOM Level 2
virtual const XMLCh * getPublicId() const;
virtual const XMLCh * getSystemId() const;
virtual const XMLCh * getInternalSubset() const;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMDocumentTypeImpl & operator = (const DOMDocumentTypeImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,143 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMElementImpl.hpp 792236 2009-07-08 17:22:35Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOMElement.hpp>
#include "DOMChildNode.hpp"
#include "DOMNodeImpl.hpp"
#include "DOMParentNode.hpp"
#include "DOMAttrMapImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class DOMTypeInfo;
class DOMNodeList;
class DOMAttrMapImpl;
class DOMDocument;
class CDOM_EXPORT DOMElementImpl: public DOMElement {
public:
DOMNodeImpl fNode;
DOMParentNode fParent;
DOMChildNode fChild;
DOMAttrMapImpl *fAttributes;
DOMAttrMapImpl *fDefaultAttributes;
const XMLCh *fName;
public:
DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *name);
DOMElementImpl(const DOMElementImpl &other, bool deep=false);
virtual ~DOMElementImpl();
public:
// Declare functions from DOMNode. They all must be implemented by this class
DOMNODE_FUNCTIONS;
public:
// Functions introduced on Element...
virtual const XMLCh* getAttribute(const XMLCh *name) const;
virtual DOMAttr* getAttributeNode(const XMLCh *name) const;
virtual DOMNodeList* getElementsByTagName(const XMLCh *tagname) const;
virtual const XMLCh* getTagName() const;
virtual void removeAttribute(const XMLCh *name);
virtual DOMAttr* removeAttributeNode(DOMAttr * oldAttr);
virtual void setAttribute(const XMLCh *name, const XMLCh *value);
virtual DOMAttr* setAttributeNode(DOMAttr *newAttr);
virtual void setReadOnly(bool readOnly, bool deep);
//Introduced in DOM Level 2
virtual const XMLCh* getAttributeNS(const XMLCh *namespaceURI,
const XMLCh *localName) const;
virtual void setAttributeNS(const XMLCh *namespaceURI,
const XMLCh *qualifiedName,
const XMLCh *value);
virtual void removeAttributeNS(const XMLCh *namespaceURI,
const XMLCh *localName);
virtual DOMAttr* getAttributeNodeNS(const XMLCh *namespaceURI,
const XMLCh *localName) const;
virtual DOMAttr* setAttributeNodeNS(DOMAttr *newAttr);
virtual DOMNodeList* getElementsByTagNameNS(const XMLCh *namespaceURI,
const XMLCh *localName) const;
virtual bool hasAttribute(const XMLCh *name) const;
virtual bool hasAttributeNS(const XMLCh *namespaceURI,
const XMLCh *localName) const;
//Introduced in DOM level 3
virtual void setIdAttribute(const XMLCh* name, bool isId);
virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId);
virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId);
virtual const DOMTypeInfo * getSchemaTypeInfo() const;
// for handling of default attribute
virtual DOMAttr* setDefaultAttributeNode(DOMAttr *newAttr);
virtual DOMAttr* setDefaultAttributeNodeNS(DOMAttr *newAttr);
virtual DOMAttrMapImpl* getDefaultAttributes() const;
// helper function for DOM Level 3 renameNode
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
// DOMElementTraversal
virtual DOMElement * getFirstElementChild() const;
virtual DOMElement * getLastElementChild() const;
virtual DOMElement * getPreviousElementSibling() const;
virtual DOMElement * getNextElementSibling() const;
virtual XMLSize_t getChildElementCount() const;
protected:
// default attribute helper functions
virtual void setupDefaultAttributes();
// helper function for DOMElementTraversal methods
DOMElement* getFirstElementChild(const DOMNode* n) const;
DOMElement* getLastElementChild(const DOMNode* n) const;
DOMNode* getNextLogicalSibling(const DOMNode* n) const;
DOMNode* getPreviousLogicalSibling(const DOMNode* n) const;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMElementImpl & operator = (const DOMElementImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,95 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMElementNSImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENTNSIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMELEMENTNSIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include "DOMElementImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class DOMTypeInfoImpl;
class CDOM_EXPORT DOMElementNSImpl: public DOMElementImpl {
protected:
//Introduced in DOM Level 2
const XMLCh * fNamespaceURI; //namespace URI of this node
const XMLCh * fLocalName; //local part of qualified name
const XMLCh * fPrefix;
const DOMTypeInfoImpl *fSchemaType;
public:
DOMElementNSImpl(DOMDocument *ownerDoc, const XMLCh *name);
DOMElementNSImpl(DOMDocument *ownerDoc, //DOM Level 2
const XMLCh *namespaceURI,
const XMLCh *qualifiedName);
DOMElementNSImpl(const DOMElementNSImpl &other, bool deep=false);
// Fast construction without any checks for name validity. Used in
// parsing.
//
DOMElementNSImpl(DOMDocument *ownerDoc,
const XMLCh *namespaceURI,
const XMLCh *prefix, // Null or empty - no prefix.
const XMLCh *localName,
const XMLCh *qualifiedName);
virtual DOMNode * cloneNode(bool deep) const;
virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const;
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const;
//Introduced in DOM Level 2
virtual const XMLCh *getNamespaceURI() const;
virtual const XMLCh *getPrefix() const;
virtual const XMLCh *getLocalName() const;
virtual void setPrefix(const XMLCh *prefix);
virtual void release();
//Introduced in DOM Level 3
virtual const DOMTypeInfo * getSchemaTypeInfo() const;
// helper function for DOM Level 3 renameNode
virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
void setName(const XMLCh* namespaceURI, const XMLCh* name);
//helper function for DOM Level 3 TypeInfo
virtual void setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMElementNSImpl & operator = (const DOMElementNSImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,107 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMEntityImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMENTITYIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include "DOMNodeImpl.hpp"
#include "DOMParentNode.hpp"
#include <xercesc/dom/DOMEntity.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMEntityReference;
class CDOM_EXPORT DOMEntityImpl: public DOMEntity {
protected:
DOMNodeImpl fNode;
DOMParentNode fParent;
const XMLCh * fName;
const XMLCh * fPublicId;
const XMLCh * fSystemId;
const XMLCh * fNotationName;
DOMEntityReference* fRefEntity;
// New data introduced in DOM Level 3
const XMLCh* fInputEncoding;
const XMLCh* fXmlEncoding;
const XMLCh* fXmlVersion;
const XMLCh* fBaseURI;
bool fEntityRefNodeCloned;
// helper function
void cloneEntityRefTree() const;
friend class XercesDOMParser;
public:
DOMEntityImpl(DOMDocument *doc, const XMLCh *eName);
DOMEntityImpl(const DOMEntityImpl &other, bool deep=false);
virtual ~DOMEntityImpl();
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
public:
virtual const XMLCh * getPublicId() const;
virtual const XMLCh * getSystemId() const;
virtual const XMLCh * getNotationName() const;
virtual void setNotationName(const XMLCh *arg);
virtual void setPublicId(const XMLCh *arg);
virtual void setSystemId(const XMLCh *arg);
//DOM Level 2 additions. Non standard functions
virtual void setEntityRef(DOMEntityReference *);
virtual DOMEntityReference* getEntityRef() const;
//Introduced in DOM Level 3
virtual const XMLCh* getInputEncoding() const;
virtual const XMLCh* getXmlEncoding() const;
virtual const XMLCh* getXmlVersion() const;
virtual void setBaseURI(const XMLCh *arg);
void setInputEncoding(const XMLCh* actualEncoding);
void setXmlEncoding(const XMLCh* encoding);
void setXmlVersion(const XMLCh* version);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMEntityImpl & operator = (const DOMEntityImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,79 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMEntityReferenceImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCEIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMENTITYREFERENCEIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMEntityReference.hpp>
#include "DOMParentNode.hpp"
#include "DOMChildNode.hpp"
#include "DOMNodeImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMEntityReferenceImpl: public DOMEntityReference
{
protected:
DOMNodeImpl fNode;
DOMParentNode fParent;
DOMChildNode fChild;
const XMLCh *fName;
const XMLCh *fBaseURI;
friend class XercesDOMParser;
public:
DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName);
DOMEntityReferenceImpl(DOMDocument *ownerDoc, const XMLCh *entityName, bool cloneChild);
DOMEntityReferenceImpl(const DOMEntityReferenceImpl &other, bool deep=false);
virtual ~DOMEntityReferenceImpl();
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
public:
virtual void setReadOnly(bool readOnly,bool deep);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMEntityReferenceImpl & operator = (const DOMEntityReferenceImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,188 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMErrorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP
#include <xercesc/dom/DOMError.hpp>
#include <xercesc/util/XMLString.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* Introduced in DOM Level 3
* Implementation of a DOMError interface.
*
* @see DOMError#DOMError
*/
class CDOM_EXPORT DOMErrorImpl : public DOMError
{
public:
/** @name Constructors and Destructor */
//@{
/** Constructors */
DOMErrorImpl(const ErrorSeverity severity);
DOMErrorImpl
(
const ErrorSeverity severity
, const XMLCh* const message
, DOMLocator* const location
);
DOMErrorImpl
(
const ErrorSeverity severity
, const XMLCh* type
, const XMLCh* message
, void* relatedData
);
/** Desctructor */
virtual ~DOMErrorImpl();
//@}
// DOMError interface
virtual ErrorSeverity getSeverity() const;
virtual const XMLCh* getMessage() const;
virtual DOMLocator* getLocation() const;
virtual void* getRelatedException() const;
virtual const XMLCh* getType() const;
virtual void* getRelatedData() const;
// Setters
void setSeverity(const ErrorSeverity severity);
void setMessage(const XMLCh* const message);
void setLocation(DOMLocator* const location);
void setAdoptLocation(const bool value);
void setRelatedException(void* exc) const;
void setType(const XMLCh* type);
void setRelatedData(void* relatedData);
private:
/* Unimplemented constructors and operators */
/* Copy constructor */
DOMErrorImpl(const DOMErrorImpl&);
/* Assignment operator */
DOMErrorImpl& operator=(const DOMErrorImpl&);
protected:
// -----------------------------------------------------------------------
// Private data members
//
// fAdoptLocation
// Indicates whether we own the DOMLocator object or not.
//
// fSeverity
// The type of the error.
//
// fMessage
// The error message.
//
// fLocation
// The location info of the error.
//
// fType
// The type of the error.
//
// fRelatedData
// The data related to this error.
//
// -----------------------------------------------------------------------
bool fAdoptLocation;
ErrorSeverity fSeverity;
const XMLCh* fMessage;
DOMLocator* fLocation;
const XMLCh* fType;
void* fRelatedData;
};
// ---------------------------------------------------------------------------
// DOMErrorImpl: Getter methods
// ---------------------------------------------------------------------------
inline DOMError::ErrorSeverity DOMErrorImpl::getSeverity() const
{
return fSeverity;
}
inline const XMLCh* DOMErrorImpl::getMessage() const
{
return fMessage;
}
inline DOMLocator* DOMErrorImpl::getLocation() const
{
return fLocation;
}
inline void* DOMErrorImpl::getRelatedException() const
{
return 0;
}
inline const XMLCh* DOMErrorImpl::getType() const
{
return fType;
}
inline void* DOMErrorImpl::getRelatedData() const
{
return fRelatedData;
}
// ---------------------------------------------------------------------------
// DOMErrorImpl: Setter methods
// ---------------------------------------------------------------------------
inline void DOMErrorImpl::setSeverity(const ErrorSeverity severity)
{
fSeverity = severity;
}
inline void DOMErrorImpl::setMessage(const XMLCh* const message)
{
fMessage = message;
}
inline void DOMErrorImpl::setAdoptLocation(const bool value)
{
fAdoptLocation = value;
}
inline void DOMErrorImpl::setType(const XMLCh* type)
{
fType = type;
}
inline void DOMErrorImpl::setRelatedData(void* relatedData)
{
fRelatedData = relatedData;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,102 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMImplementationImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationSource.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class XMLMsgLoader;
class DOMImplementationImpl: public XMemory,
public DOMImplementation,
public DOMImplementationSource
{
private:
DOMImplementationImpl(const DOMImplementationImpl &);
DOMImplementationImpl & operator = (const DOMImplementationImpl &);
friend class XMLInitializer;
protected:
DOMImplementationImpl() {};
public:
virtual ~DOMImplementationImpl() {};
static DOMImplementationImpl* getDOMImplementationImpl();
static XMLMsgLoader* getMsgLoader4DOM();
// ------------------------------------------------------------
// DOMImplementation Virtual interface
// ------------------------------------------------------------
virtual bool hasFeature(const XMLCh * feature, const XMLCh * version) const;
// Introduced in DOM Level 2
virtual DOMDocumentType* createDocumentType(const XMLCh *qualifiedName,
const XMLCh * publicId,
const XMLCh *systemId);
virtual DOMDocument* createDocument(const XMLCh *namespaceURI,
const XMLCh *qualifiedName,
DOMDocumentType *doctype,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
// DOM Level 3
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const;
// Non-standard extension
virtual DOMDocument* createDocument(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
// ------------------------------------------------------------
// DOMImplementationLS Virtual interface
// ------------------------------------------------------------
// Introduced in DOM Level 3
virtual DOMLSParser* createLSParser(const DOMImplementationLSMode mode,
const XMLCh* const schemaType,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager,
XMLGrammarPool* const gramPool = 0);
virtual DOMLSSerializer* createLSSerializer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
virtual DOMLSInput* createLSInput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
virtual DOMLSOutput* createLSOutput(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
// ------------------------------------------------------------
// DOMImplementationSource Virtual interface
// ------------------------------------------------------------
virtual DOMImplementation* getDOMImplementation(const XMLCh* features) const;
virtual DOMImplementationList* getDOMImplementationList(const XMLCh* features) const;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,56 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMImplementationListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLISTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMIMPLEMENTATIONLISTIMPL_HPP
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/util/RefVectorOf.hpp>
#include <xercesc/dom/DOMImplementationList.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMImplementation;
class CDOM_EXPORT DOMImplementationListImpl: public DOMImplementationList
{
protected:
RefVectorOf<DOMImplementation> *fList;
private:
// Unused, and unimplemented constructors, operators, etc.
DOMImplementationListImpl(const DOMImplementationListImpl & other);
DOMImplementationListImpl & operator = (const DOMImplementationListImpl & other);
public:
DOMImplementationListImpl();
void add(DOMImplementation* impl);
virtual ~DOMImplementationListImpl();
virtual DOMImplementation * item(XMLSize_t index) const;
virtual XMLSize_t getLength() const;
virtual void release();
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,134 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMLSInputImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSINPUTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMLSINPUTIMPL_HPP
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMLSInput.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMLSInputImpl : public XMemory, public DOMLSInput
{
public:
DOMLSInputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~DOMLSInputImpl();
virtual const XMLCh* getStringData() const;
virtual InputSource* getByteStream() const;
virtual const XMLCh* getEncoding() const;
virtual const XMLCh* getPublicId() const;
virtual const XMLCh* getSystemId() const;
virtual const XMLCh* getBaseURI() const;
virtual void setStringData(const XMLCh* data);
virtual void setByteStream(InputSource* stream);
virtual void setEncoding(const XMLCh* const encodingStr);
virtual void setPublicId(const XMLCh* const publicId);
virtual void setSystemId(const XMLCh* const systemId);
virtual void setBaseURI(const XMLCh* const baseURI);
virtual void setIssueFatalErrorIfNotFound(bool flag);
virtual bool getIssueFatalErrorIfNotFound() const;
virtual void release();
private:
/** unimplemented copy ctor and assignment operator */
DOMLSInputImpl(const DOMLSInputImpl&);
DOMLSInputImpl & operator = (const DOMLSInputImpl&);
protected:
// -----------------------------------------------------------------------
// Private data members
//
// fStringData
// We don't own it
//
// fByteStream
// We don't own it
//
// fEncoding
// We own it
//
// fPublicId
// We own it
//
// fSystemId
// We own it
//
// fBaseURI
// We own it
//
// -----------------------------------------------------------------------
const XMLCh *fStringData;
InputSource *fByteStream;
XMLCh *fEncoding;
XMLCh *fPublicId;
XMLCh *fSystemId;
XMLCh *fBaseURI;
bool fIssueFatalErrorIfNotFound;
MemoryManager* fMemoryManager;
};
inline const XMLCh* DOMLSInputImpl::getStringData() const
{
return fStringData;
}
inline InputSource* DOMLSInputImpl::getByteStream() const
{
return fByteStream;
}
inline const XMLCh* DOMLSInputImpl::getEncoding() const
{
return fEncoding;
}
inline const XMLCh* DOMLSInputImpl::getPublicId() const
{
return fPublicId;
}
inline const XMLCh* DOMLSInputImpl::getSystemId() const
{
return fSystemId;
}
inline const XMLCh* DOMLSInputImpl::getBaseURI() const
{
return fBaseURI;
}
inline bool DOMLSInputImpl::getIssueFatalErrorIfNotFound() const
{
return fIssueFatalErrorIfNotFound;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,92 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMLSOutputImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSOUTPUTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMLSOUTPUTIMPL_HPP
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMLSOutput.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMLSOutputImpl : public XMemory, public DOMLSOutput
{
public:
DOMLSOutputImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~DOMLSOutputImpl();
virtual XMLFormatTarget* getByteStream() const;
virtual const XMLCh* getEncoding() const;
virtual const XMLCh* getSystemId() const;
virtual void setByteStream(XMLFormatTarget* stream);
virtual void setEncoding(const XMLCh* const encodingStr);
virtual void setSystemId(const XMLCh* const systemId);
virtual void release();
private:
/** unimplemented copy ctor and assignment operator */
DOMLSOutputImpl(const DOMLSOutputImpl&);
DOMLSOutputImpl & operator = (const DOMLSOutputImpl&);
protected:
// -----------------------------------------------------------------------
// Private data members
//
// fByteStream
// We don't own it
//
// fEncoding
// We own it
//
// fSystemId
// We own it
//
// -----------------------------------------------------------------------
XMLFormatTarget *fByteStream;
XMLCh *fEncoding;
XMLCh *fSystemId;
MemoryManager* fMemoryManager;
};
inline XMLFormatTarget* DOMLSOutputImpl::getByteStream() const
{
return fByteStream;
}
inline const XMLCh* DOMLSOutputImpl::getEncoding() const
{
return fEncoding;
}
inline const XMLCh* DOMLSOutputImpl::getSystemId() const
{
return fSystemId;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,232 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMLSSerializerImpl.hpp 695856 2008-09-16 12:52:32Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMLSSERIALIZERMPL_HPP
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMLSSerializer.hpp>
#include <xercesc/util/XMLDOMMsg.hpp>
#include <xercesc/util/RefHashTableOf.hpp>
#include <xercesc/util/RefVectorOf.hpp>
#include <xercesc/framework/XMLFormatter.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMStringListImpl;
class CDOM_EXPORT DOMLSSerializerImpl : public XMemory,
public DOMLSSerializer,
public DOMConfiguration
{
public:
/** @name Constructor and Destructor */
//@{
/**
* Constructor.
*/
DOMLSSerializerImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
/**
* Destructor.
*/
~DOMLSSerializerImpl();
//@}
/** @name Implementation of DOMLSSerializer interface */
//@{
virtual DOMConfiguration* getDomConfig();
virtual void setNewLine(const XMLCh* const newLine);
virtual const XMLCh* getNewLine() const;
virtual void setFilter(DOMLSSerializerFilter *filter);
virtual DOMLSSerializerFilter* getFilter() const;
virtual bool write(const DOMNode* nodeToWrite,
DOMLSOutput* const destination);
virtual bool writeToURI(const DOMNode* nodeToWrite,
const XMLCh* uri);
/**
* The caller is responsible for the release of the returned string
*/
virtual XMLCh* writeToString(const DOMNode* nodeToWrite, MemoryManager* manager = NULL);
virtual void release();
//@}
/** @name Implementation of DOMConfiguration interface */
//@{
virtual void setParameter(const XMLCh* name, const void* value);
virtual void setParameter(const XMLCh* name, bool value);
virtual const void* getParameter(const XMLCh* name) const;
virtual bool canSetParameter(const XMLCh* name, const void* value) const;
virtual bool canSetParameter(const XMLCh* name, bool value) const;
virtual const DOMStringList* getParameterNames() const;
//@}
private:
/** unimplemented copy ctor and assignment operator */
DOMLSSerializerImpl(const DOMLSSerializerImpl&);
DOMLSSerializerImpl & operator = (const DOMLSSerializerImpl&);
protected:
/** helper **/
void processNode(const DOMNode* const);
void procCdataSection(const XMLCh* const nodeValue
, const DOMNode* const nodeToWrite);
void procUnrepCharInCdataSection(const XMLCh* const nodeValue
, const DOMNode* const nodeToWrite);
protected:
/**
* Overidden by derived classes to extend the abilities of the standard writer
* always returns false in the default implementation
* @return true if the method deals with nodeToWrite
*/
virtual bool customNodeSerialize(const DOMNode* const nodeToWrite, int level);
DOMNodeFilter::FilterAction checkFilter(const DOMNode* const) const;
bool checkFeature(const XMLCh* const featName
, bool state
, int& featureId) const;
bool reportError(const DOMNode* const errorNode
, DOMError::ErrorSeverity errorType
, const XMLCh* const errorMsg);
bool reportError(const DOMNode* const errorNode
, DOMError::ErrorSeverity errorType
, XMLDOMMsg::Codes toEmit);
bool canSetFeature(const int featureId
, bool val) const;
void setFeature(const int featureId
, bool val);
bool getFeature(const int featureId) const;
void printNewLine();
void setURCharRef();
bool isDefaultNamespacePrefixDeclared() const;
bool isNamespaceBindingActive(const XMLCh* prefix, const XMLCh* uri) const;
void printIndent(unsigned int level);
//does the actual work for processNode while keeping track of the level
void processNode(const DOMNode* const nodeToWrite, int level);
void processBOM();
// -----------------------------------------------------------------------
// Private data members
//
// fFeatures
//
// fNewLine
// own it
//
// fErrorHandler
// don't own it
//
// fFilter
// don't own it
//
// fDocumentVersion
// The XML Version of the document to be serialized.
//
// fSupportedParameters
// A list of the parameters that can be set, including the ones
// specific of Xerces
//
// fEncodingUsed (session var)
// the actual encoding used in write(),
// it does not own any data(memory).
//
// fNewLineUsed (session var)
// the actual "end of line" sequence used in write(),
// it does not own any data(memory).
//
// fFormatter (session var)
// the formatter used in write()
//
// fErrorCount
// the count of error encountered in the serialization,
// which neither the error handler, nor the serializer itself,
// treat as fatal. And the serializer will return true/false
// based on this value.
//
// fCurrentLine
// the current line. Used to track the line number the current
// node begins on
//
// -----------------------------------------------------------------------
int fFeatures;
XMLCh *fNewLine;
DOMErrorHandler *fErrorHandler;
DOMLSSerializerFilter *fFilter;
const XMLCh *fDocumentVersion;
DOMStringListImpl *fSupportedParameters;
//session vars
const XMLCh *fEncodingUsed;
const XMLCh *fNewLineUsed;
XMLFormatter *fFormatter;
int fErrorCount;
int fCurrentLine;
bool fLineFeedInTextNodePrinted;
unsigned int fLastWhiteSpaceInTextNode;
RefVectorOf< RefHashTableOf<XMLCh> >* fNamespaceStack;
MemoryManager* fMemoryManager;
};
inline DOMConfiguration* DOMLSSerializerImpl::getDomConfig()
{
return this;
}
inline void DOMLSSerializerImpl::setFeature(const int featureId
, bool val)
{
(val)? fFeatures |= (1<<featureId) : fFeatures &= ~(1<<featureId);
}
inline bool DOMLSSerializerImpl::getFeature(const int featureId) const
{
return ((fFeatures & ( 1<<featureId )) != 0) ? true : false;
}
inline void DOMLSSerializerImpl::setURCharRef()
{
fFormatter->setUnRepFlags(XMLFormatter::UnRep_CharRef);
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,187 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMLocatorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMLOCATORIMPL_HPP
#include <xercesc/dom/DOMLocator.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* Introduced in DOM Level 3
*
* Implementation of a DOMLocator interface.
*
* @see DOMLocator#DOMLocator
*/
class CDOM_EXPORT DOMLocatorImpl : public DOMLocator
{
public:
/** @name Constructors and Destructor */
//@{
/** Constructor */
DOMLocatorImpl();
DOMLocatorImpl
(
const XMLFileLoc lineNum
, const XMLFileLoc columnNum
, DOMNode* const errorNode
, const XMLCh* const uri
, const XMLFilePos offset = ~(XMLFilePos(0))
, const XMLFilePos utf16Offset = ~(XMLFilePos(0))
);
/** Desctructor */
virtual ~DOMLocatorImpl();
//@}
// DOMLocator interface
virtual XMLFileLoc getLineNumber() const;
virtual XMLFileLoc getColumnNumber() const;
virtual XMLFilePos getByteOffset() const;
virtual XMLFilePos getUtf16Offset() const;
virtual DOMNode* getRelatedNode() const;
virtual const XMLCh* getURI() const;
// Setter functions
void setLineNumber(const XMLFileLoc lineNumber);
void setColumnNumber(const XMLFileLoc columnNumber);
void setByteOffset(const XMLFilePos offset);
void setUtf16Offset(const XMLFilePos offset);
void setRelatedNode(DOMNode* const errorNode);
void setURI(const XMLCh* const uri);
private :
/* Unimplemented constructors and operators */
/* Copy constructor */
DOMLocatorImpl(const DOMLocatorImpl&);
/* Assignment operator */
DOMLocatorImpl& operator=(const DOMLocatorImpl&);
protected:
// -----------------------------------------------------------------------
// Private data members
//
// fLineNum
// fColumnNum
// Track line/column number of where the error occured
//
// fByteOffset
// Track byte offset in the input source where the error
// occured
//
// fUtf16Offset
// Track character offset in the input source where the error
// occured
//
// fRelatedNode
// Current node where the error occured
//
// fURI
// The uri where the error occured
// -----------------------------------------------------------------------
XMLFileLoc fLineNum;
XMLFileLoc fColumnNum;
XMLFilePos fByteOffset;
XMLFilePos fUtf16Offset;
DOMNode* fRelatedNode;
const XMLCh* fURI;
};
// ---------------------------------------------------------------------------
// DOMLocatorImpl: Getter methods
// ---------------------------------------------------------------------------
inline XMLFileLoc DOMLocatorImpl::getLineNumber() const
{
return fLineNum;
}
inline XMLFileLoc DOMLocatorImpl::getColumnNumber() const
{
return fColumnNum;
}
inline XMLFilePos DOMLocatorImpl::getByteOffset() const
{
return fByteOffset;
}
inline XMLFilePos DOMLocatorImpl::getUtf16Offset() const
{
return fUtf16Offset;
}
inline DOMNode* DOMLocatorImpl::getRelatedNode() const
{
return fRelatedNode;
}
inline const XMLCh* DOMLocatorImpl::getURI() const
{
return fURI;
}
// ---------------------------------------------------------------------------
// DOMLocatorImpl: Setter methods
// ---------------------------------------------------------------------------
inline void DOMLocatorImpl::setLineNumber(const XMLFileLoc lineNumber)
{
fLineNum = lineNumber;
}
inline void DOMLocatorImpl::setColumnNumber(const XMLFileLoc columnNumber)
{
fColumnNum = columnNumber;
}
inline void DOMLocatorImpl::setByteOffset(const XMLFilePos offset)
{
fByteOffset = offset;
}
inline void DOMLocatorImpl::setUtf16Offset(const XMLFilePos offset)
{
fUtf16Offset = offset;
}
inline void DOMLocatorImpl::setRelatedNode(DOMNode* const errorNode)
{
fRelatedNode = errorNode;
}
inline void DOMLocatorImpl::setURI(const XMLCh* const uri)
{
fURI = uri;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNamedNodeMapImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAPIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNAMEDNODEMAPIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMNamedNodeMap.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNodeVector;
class DOMNode;
#define MAP_SIZE 193
class CDOM_EXPORT DOMNamedNodeMapImpl: public DOMNamedNodeMap {
protected:
DOMNodeVector* fBuckets[MAP_SIZE];
DOMNode* fOwnerNode; // the node this map belongs to
//bool fReadOnly; // revisit - flag on owner node instead?
bool readOnly(); // revisit. Look at owner node read-only.
public:
DOMNamedNodeMapImpl(DOMNode *ownerNode);
virtual ~DOMNamedNodeMapImpl();
virtual DOMNamedNodeMapImpl *cloneMap(DOMNode *ownerNode);
virtual void setReadOnly(bool readOnly, bool deep);
virtual XMLSize_t getLength() const;
virtual DOMNode* item(XMLSize_t index) const;
virtual DOMNode* getNamedItem(const XMLCh *name) const;
virtual DOMNode* setNamedItem(DOMNode *arg);
virtual DOMNode* removeNamedItem(const XMLCh *name);
//Introduced in DOM Level 2
virtual DOMNode* getNamedItemNS(const XMLCh *namespaceURI,
const XMLCh *localName) const;
virtual DOMNode* setNamedItemNS(DOMNode *arg);
virtual DOMNode* removeNamedItemNS(const XMLCh *namespaceURI,
const XMLCh *localName);
private:
// unimplemented
DOMNamedNodeMapImpl(const DOMNamedNodeMapImpl &);
DOMNamedNodeMapImpl & operator = (const DOMNamedNodeMapImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,86 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNodeIDMap.hpp 676911 2008-07-15 13:27:32Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEIDMAP_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNODEIDMAP_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
XERCES_CPP_NAMESPACE_BEGIN
//
// Class DOMNodeIDMap is a hash table that is used in the implementation of
// of DOM_Document::getElementsByID().
//
// Why Yet Another HashTable implementation? Becuase it can be significantly
// smaller when tuned for this exact usage, and the generic RefHashTableOf
// from the xerces utils project is not a paricularly good fit.
//
class DOMAttr;
class DOMDocument;
class DOMNodeIDMap {
public:
DOMNodeIDMap(XMLSize_t initialSize, DOMDocument *doc); // Create a new hash table, sized to hold "initialSize"
// Entries. It will automatically grow if need be.
~DOMNodeIDMap();
private:
DOMNodeIDMap(const DOMNodeIDMap &other); // No copy, assignement, comparison.
DOMNodeIDMap &operator = (const DOMNodeIDMap &other);
bool operator == (const DOMNodeIDMap &other);
public:
void add(DOMAttr *attr); // Add the specified attribute to the table.
void remove(DOMAttr *other); // Remove the specified attribute.
// Does nothing if the node is not in the table.
DOMAttr *find(const XMLCh *ID); // Find the attribute node in the table with this ID
private:
void growTable();
private:
DOMAttr **fTable;
XMLSize_t fSizeIndex; // Index of the current table size in the
// array of possible table sizes.
XMLSize_t fSize; // The current size of the table array
// (number of slots, not bytes.)
XMLSize_t fNumEntries; // The number of entries used.
XMLSize_t fMaxEntries; // The max number of entries to use before
// growing the table.
DOMDocument *fDoc; // The owning document.
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,382 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNodeImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNODEIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
/**
* A DOMNodeImpl doesn't have any children, and can therefore only be directly
* inherited by classes of nodes that never have any, such as Text nodes. For
* other types, such as Element, classes must inherit from ParentNode.
* <P>
* All nodes in a single document must originate
* in that document. (Note that this is much tighter than "must be
* same implementation") Nodes are all aware of their ownerDocument,
* and attempts to mismatch will throw WRONG_DOCUMENT_ERR.
* <P>
* However, to save memory not all nodes always have a direct reference
* to their ownerDocument. When a node is owned by another node it relies
* on its owner to store its ownerDocument. Parent nodes always store it
* though, so there is never more than one level of indirection.
* And when a node doesn't have an owner, ownerNode refers to its
* ownerDocument.
**/
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMUserDataHandler.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNamedNodeMap;
class DOMNodeList;
class DOMNode;
class DOMDocument;
class DOMElement;
class CDOM_EXPORT DOMNodeImpl {
public:
// data
DOMNode *fOwnerNode; // typically the parent but not always!
unsigned short flags;
static const unsigned short READONLY;
static const unsigned short SYNCDATA;
static const unsigned short SYNCCHILDREN;
static const unsigned short OWNED;
static const unsigned short FIRSTCHILD;
static const unsigned short SPECIFIED;
static const unsigned short IGNORABLEWS;
static const unsigned short SETVALUE;
static const unsigned short ID_ATTR;
static const unsigned short USERDATA;
static const unsigned short LEAFNODETYPE;
static const unsigned short CHILDNODE;
static const unsigned short TOBERELEASED;
public:
DOMNodeImpl(DOMNode *ownerDocument);
DOMNodeImpl(const DOMNodeImpl &other);
~DOMNodeImpl();
DOMNode * appendChild(DOMNode *newChild);
DOMNamedNodeMap * getAttributes() const;
DOMNodeList * getChildNodes() const;
DOMNode * getFirstChild() const;
DOMNode * getLastChild() const;
const XMLCh * getLocalName() const;
const XMLCh * getNamespaceURI() const;
DOMNode * getNextSibling() const;
const XMLCh * getNodeValue() const;
DOMDocument * getOwnerDocument() const;
DOMNode * getParentNode() const;
const XMLCh * getPrefix() const;
DOMNode * getPreviousSibling() const;
bool hasChildNodes() const;
DOMNode * insertBefore(DOMNode *newChild, DOMNode *refChild);
void normalize();
DOMNode * removeChild(DOMNode *oldChild);
DOMNode * replaceChild(DOMNode *newChild, DOMNode *oldChild);
void setNodeValue(const XMLCh *value);
void setPrefix(const XMLCh *fPrefix);
void setReadOnly(bool readOnly, bool deep);
bool isSupported(const XMLCh *feature, const XMLCh *version) const;
bool hasAttributes() const;
// Introduced in DOM Level 3
void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler);
void* getUserData(const XMLCh* key) const;
bool isSameNode(const DOMNode* other) const;
bool isEqualNode(const DOMNode* arg) const;
const XMLCh* getBaseURI() const ;
short compareDocumentPosition(const DOMNode* other) const;
const XMLCh* getTextContent() const ;
const XMLCh* getTextContent(XMLCh* pzBuffer, XMLSize_t& rnBufferLength) const;
void setTextContent(const XMLCh* textContent) ;
const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ;
bool isDefaultNamespace(const XMLCh* namespaceURI) const ;
const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ;
void* getFeature(const XMLCh* feature, const XMLCh* version) const;
// Helper functions for DOM Level 3
void release();
void callUserDataHandlers(DOMUserDataHandler::DOMOperationType operation,
const DOMNode* src,
DOMNode* dst) const;
//reverses the bit pattern given by compareDocumentPosition
short reverseTreeOrderBitPattern(short pattern) const;
const DOMNode* getTreeParentNode(const DOMNode* node) const;
//Utility, not part of DOM Level 2 API
static bool isKidOK(DOMNode *parent, DOMNode *child);
static const XMLCh *mapPrefix(const XMLCh *prefix,
const XMLCh *namespaceURI, short nType);
static const XMLCh *getXmlnsString();
static const XMLCh *getXmlnsURIString();
static const XMLCh *getXmlString();
static const XMLCh *getXmlURIString();
public: // should really be protected - ALH
DOMNode* getElementAncestor (const DOMNode* currentNode) const;
const XMLCh* lookupPrefix(const XMLCh* const namespaceURI, DOMElement *el) const ;
void setOwnerDocument(DOMDocument *doc);
/*
* Flags setters and getters
*/
inline bool isReadOnly() const {
return (flags & READONLY) != 0;
}
inline void isReadOnly(bool value) {
flags = (value ? flags | READONLY : flags & ~READONLY);
}
inline bool needsSyncData() const {
return (flags & SYNCDATA) != 0;
}
inline void needsSyncData(bool value) {
flags = (value ? flags | SYNCDATA : flags & ~SYNCDATA);
}
inline bool needsSyncChildren() const {
return (flags & SYNCCHILDREN) != 0;
}
inline void needsSyncChildren(bool value) {
flags = (value ? flags | SYNCCHILDREN : flags & ~SYNCCHILDREN);
}
// For Attributes, true if the attr node is attached to an element.
// For all other node types, true if the node has a parent node.
inline bool isOwned() const {
return (flags & OWNED) != 0;
}
inline void isOwned(bool value) {
flags = (value ? flags | OWNED : flags & ~OWNED);
}
inline bool isFirstChild() const {
return (flags & FIRSTCHILD) != 0;
}
inline void isFirstChild(bool value) {
flags = (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD);
}
inline bool isSpecified() const {
return (flags & SPECIFIED) != 0;
}
inline void isSpecified(bool value) {
flags = (value ? flags | SPECIFIED : flags & ~SPECIFIED);
}
inline bool ignorableWhitespace() const {
return (flags & IGNORABLEWS) != 0;
}
inline void ignorableWhitespace(bool value) {
flags = (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS);
}
inline bool setValue() const {
return (flags & SETVALUE) != 0;
}
inline void setValue(bool value) {
flags = (value ? flags | SETVALUE : flags & ~SETVALUE);
}
inline bool isIdAttr() const {
return (flags & ID_ATTR) != 0;
}
inline void isIdAttr(bool value) {
flags = (value ? flags | ID_ATTR : flags & ~ID_ATTR);
}
inline bool hasUserData() const {
return (flags & USERDATA) != 0;
}
inline void hasUserData(bool value) {
flags = (value ? flags | USERDATA : flags & ~USERDATA);
}
//
// LeafNode is set true for node types that can not be ParentNodes (can't have children)
// This knowledge is used to allow casting from any unknown node type to the
// IDParentImpl or IDChildImpl parts of the node.
//
inline bool isLeafNode() const {
return (flags & LEAFNODETYPE) != 0;
}
inline void setIsLeafNode(bool value) {
flags = (value ? flags | LEAFNODETYPE : flags & ~LEAFNODETYPE);
}
//
// ChildNode is set true for node types that can be children of other nodes, and
// therefore include a DOMChildNode data member. Note that all of the leaf
// node types (above flag) are also ChildNodes, but not all ChildNodes are
// leaf nodes.
inline bool isChildNode() const {
return (flags & CHILDNODE) != 0;
}
inline void setIsChildNode(bool value) {
flags = (value ? flags | CHILDNODE : flags & ~CHILDNODE);
}
// True if this node has to be released regardless if it has a owner or not
// This is true if called from fParent->release()
inline bool isToBeReleased() const {
return (flags & TOBERELEASED) != 0;
}
inline void isToBeReleased(bool value) {
flags = (value ? flags | TOBERELEASED : flags & ~TOBERELEASED);
}
};
// This macro lists all of the pure virtual functions declared in DOMNode that must
// be implemented by all node types. Since there is no inheritance of implementation,
// using this macro in the class declaration of the node types make it easier to
// accurately get all of the functions declared.
//
#define DOMNODE_FUNCTIONS \
virtual DOMNode* appendChild(DOMNode *newChild) ;\
virtual DOMNode* cloneNode(bool deep) const ;\
virtual DOMNamedNodeMap* getAttributes() const ;\
virtual DOMNodeList* getChildNodes() const ;\
virtual DOMNode* getFirstChild() const ;\
virtual DOMNode* getLastChild() const ;\
virtual const XMLCh* getLocalName() const ;\
virtual const XMLCh* getNamespaceURI() const ;\
virtual DOMNode* getNextSibling() const ;\
virtual const XMLCh* getNodeName() const ;\
virtual NodeType getNodeType() const ;\
virtual const XMLCh* getNodeValue() const ;\
virtual DOMDocument* getOwnerDocument() const ;\
virtual const XMLCh* getPrefix() const ;\
virtual DOMNode* getParentNode() const ;\
virtual DOMNode* getPreviousSibling() const ;\
virtual bool hasChildNodes() const ;\
virtual DOMNode* insertBefore(DOMNode *newChild, DOMNode *refChild) ;\
virtual void normalize() ;\
virtual DOMNode* removeChild(DOMNode *oldChild) ;\
virtual DOMNode* replaceChild(DOMNode *newChild, DOMNode *oldChild) ;\
virtual void setNodeValue(const XMLCh *nodeValue) ;\
virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const ;\
virtual bool hasAttributes() const ;\
virtual void setPrefix(const XMLCh * prefix) ;\
virtual void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) ;\
virtual void* getUserData(const XMLCh* key) const ;\
virtual bool isSameNode(const DOMNode* other) const;\
virtual bool isEqualNode(const DOMNode* arg) const;\
virtual const XMLCh* getBaseURI() const ;\
virtual short compareDocumentPosition(const DOMNode* other) const ;\
virtual const XMLCh* getTextContent() const ;\
const XMLCh* getTextContent(XMLCh* pzBuffer, unsigned int& rnBufferLength) const;\
virtual void setTextContent(const XMLCh* textContent) ;\
virtual const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ;\
virtual bool isDefaultNamespace(const XMLCh* namespaceURI) const;\
virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ;\
virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const ;\
virtual void release()
/*
* Here are dummy stubs for most of the functions introduced by DOMNode.
* Each subclass of DOMNode will have something like this that delegates each
* function to the appropriate implementation.
* Functions that must be supplied by every node class are omitted.
*
DOMNode* xxx::appendChild(DOMNode *newChild) {return fParent.appendChild (newChild); };
DOMNamedNodeMap* xxx::getAttributes() const {return fNode.getAttributes (); };
DOMNodeList* xxx::getChildNodes() const {return fParent.getChildNodes (); };
DOMNode* xxx::getFirstChild() const {return fParent.getFirstChild (); };
DOMNode* xxx::getLastChild() const {return fParent.getLastChild (); };
const XMLCh* xxx::getLocalName() const {return fNode.getLocalName (); };
const XMLCh* xxx::getNamespaceURI() const {return fNode.getNamespaceURI (); };
DOMNode* xxx::getNextSibling() const {return fChild.getNextSibling (); };
const XMLCh* xxx::getNodeValue() const {return fNode.getNodeValue (); };
DOMDocument* xxx::getOwnerDocument() const {return fNode.getOwnerDocument (); };
const XMLCh* xxx::getPrefix() const {return fNode.getPrefix (); };
DOMNode* xxx::getParentNode() const {return fChild.getParentNode (this); };
DOMNode* xxx::getPreviousSibling() const {return fChild.getPreviousSibling (this); };
bool xxx::hasChildNodes() const {return fParent.hasChildNodes (); };
DOMNode* xxx::insertBefore(DOMNode *newChild, DOMNode *refChild)
{return fParent.insertBefore (newChild, refChild); };
void xxx::normalize() {fParent.normalize(); };
DOMNode* xxx::removeChild(DOMNode *oldChild) {return fParent.removeChild (oldChild); };
DOMNode* xxx::replaceChild(DOMNode *newChild, DOMNode *oldChild)
{return fParent.replaceChild (newChild, oldChild); };
bool xxx::isSupported(const XMLCh *feature, const XMLCh *version) const
{return fNode.isSupported (feature, version); };
void xxx::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); };
bool xxx::hasAttributes() const {return fNode.hasAttributes(); };
bool xxx::isSameNode(const DOMNode* other) const {return fNode.isSameNode(other); };
bool xxx::isEqualNode(const DOMNode* arg) const {return fNode.isEqualNode(arg); };
void* xxx::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler)
{return fNode.setUserData(key, data, handler); };
void* xxx::getUserData(const XMLCh* key) const {return fNode.getUserData(key); };
const XMLCh* xxx::getBaseURI() const {return fNode.getBaseURI(); };
short xxx::compareDocumentPosition(const DOMNode* other) const {return fNode.compareDocumentPosition(other); };
const XMLCh* xxx::getTextContent() const {return fNode.getTextContent(); };
void xxx::setTextContent(const XMLCh* textContent){fNode.setTextContent(textContent); };
const XMLCh* xxx::lookupPrefix(const XMLCh* namespaceURI) const {return fNode.lookupPrefix(namespaceURI); };
bool xxx::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); };
const XMLCh* xxx::lookupNamespaceURI(const XMLCh* prefix) const {return fNode.lookupNamespaceURI(prefix); };
void* xxx::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); };
*/
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,122 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNodeIteratorImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNODEITERATORIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
//////////////////////////////////////////////////////////////////////
// DOMNodeIteratorImpl.hpp: interface for the DOMNodeIteratorImpl class.
//
//////////////////////////////////////////////////////////////////////
#include <xercesc/dom/DOMNode.hpp>
#include <xercesc/dom/DOMNodeIterator.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMNodeIteratorImpl : public DOMNodeIterator {
protected:
//
// Data
//
// The root.
DOMNode* fRoot;
// The Document used to create this iterator
DOMDocument* fDocument;
// The whatToShow mask.
DOMNodeFilter::ShowType fWhatToShow;
// The NodeFilter reference.
DOMNodeFilter* fNodeFilter;
// The expandEntity reference flag.
bool fExpandEntityReferences;
bool fDetached;
//
// Iterator state - current node and direction.
//
// Note: The current node and direction are sufficient to implement
// the desired behaviour of the current pointer being _between_
// two nodes. The fCurrentNode is actually the last node returned,
// and the
// direction is whether the pointer is in front or behind this node.
// (usually akin to whether the node was returned via nextNode())
// (eg fForward = true) or previousNode() (eg fForward = false).
// The last Node returned.
DOMNode* fCurrentNode;
// The direction of the iterator on the fCurrentNode.
// <code>
// nextNode() == fForward = true;<br>
// previousNode() == fForward = false;<br>
// </code>
bool fForward;
public:
virtual ~DOMNodeIteratorImpl ();
DOMNodeIteratorImpl (
DOMDocument* fDocument,
DOMNode* root,
DOMNodeFilter::ShowType whatToShow,
DOMNodeFilter* nodeFilter,
bool expandEntityRef);
DOMNodeIteratorImpl ( const DOMNodeIteratorImpl& toCopy);
DOMNodeIteratorImpl& operator= (const DOMNodeIteratorImpl& other);
virtual DOMNode* getRoot ();
virtual DOMNodeFilter::ShowType getWhatToShow ();
virtual DOMNodeFilter* getFilter ();
// Get the expandEntity reference flag.
virtual bool getExpandEntityReferences();
virtual DOMNode* nextNode ();
virtual DOMNode* previousNode ();
virtual void detach ();
virtual void release();
void removeNode (DOMNode* node);
protected:
DOMNode* matchNodeOrParent (DOMNode* node);
DOMNode* nextNode (DOMNode* node, bool visitChildren);
DOMNode* previousNode (DOMNode* node);
bool acceptNode (DOMNode* node);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,73 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNodeListImpl.hpp 676911 2008-07-15 13:27:32Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODELISTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNODELISTIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
// NodeList implementation class -
// This is for NodeLists returned by GetChildNodes only, not for
// node lists returned by GetElementsByTagName
//
// Every node type capable of having children has (as an embedded member)
// an instance of this class. To hold down the size overhead on each node, a
// cache of extended data for active node lists is maintained
// separately.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMNodeList.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMParentNode;
class DOMNode;
class CDOM_EXPORT DOMNodeListImpl: public DOMNodeList
{
protected:
DOMParentNode *fNode;
private:
// Unused, and unimplemented constructors, operators, etc.
DOMNodeListImpl();
DOMNodeListImpl(const DOMNodeListImpl & other);
DOMNodeListImpl & operator = (const DOMNodeListImpl & other);
public:
DOMNodeListImpl(DOMParentNode *node);
virtual ~DOMNodeListImpl();
virtual DOMNode * item(XMLSize_t index) const;
virtual XMLSize_t getLength() const;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,88 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNodeVector.hpp 676796 2008-07-15 05:04:13Z dbertoni $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNODEVECTOR_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNODEVECTOR_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class DOMDocument;
class DOMNodeVector {
private:
DOMNode **data;
XMLSize_t allocatedSize;
XMLSize_t nextFreeSlot;
void init(DOMDocument *doc, XMLSize_t size);
void checkSpace();
// unimplemented
DOMNodeVector ( const DOMNodeVector& toCopy);
DOMNodeVector& operator= (const DOMNodeVector& other);
public:
DOMNodeVector(DOMDocument *doc);
DOMNodeVector(DOMDocument *doc, XMLSize_t size);
~DOMNodeVector();
XMLSize_t size();
DOMNode* elementAt(XMLSize_t index);
DOMNode* lastElement();
void addElement(DOMNode *);
void insertElementAt(DOMNode *, XMLSize_t index);
void setElementAt(DOMNode *val, XMLSize_t index);
void removeElementAt(XMLSize_t index);
void reset();
};
inline DOMNode *DOMNodeVector::elementAt(XMLSize_t index) {
if (index >= nextFreeSlot)
return 0;
return data[index];
}
inline DOMNode *DOMNodeVector::lastElement() {
if (nextFreeSlot == 0)
return 0;
return data[nextFreeSlot-1];
}
inline XMLSize_t DOMNodeVector::size() {
return nextFreeSlot;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,166 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNormalizer.hpp 676911 2008-07-15 13:27:32Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNORMALIZER_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNORMALIZER_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/util/RefHashTableOf.hpp>
#include <xercesc/util/RefVectorOf.hpp>
#include <xercesc/framework/XMLErrorCodes.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMConfigurationImpl;
class DOMErrorHandler;
class DOMDocumentImpl;
class DOMNode;
class DOMElementImpl;
class DOMAttr;
class DOMNamedNodeMap;
class DOMNormalizer : public XMemory {
//the following are the data structures maintain the stack of namespace information
class InScopeNamespaces : public XMemory {
class Scope : public XMemory {
public:
Scope(Scope *baseScopeWithBindings);
~Scope();
void addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
const XMLCh* getUri(const XMLCh *prefix) const;
const XMLCh* getPrefix(const XMLCh* uri) const;
Scope *fBaseScopeWithBindings;
private:
RefHashTableOf<XMLCh> *fPrefixHash;
RefHashTableOf<XMLCh> *fUriHash;
// unimplemented
Scope ( const Scope& toCopy);
Scope& operator= (const Scope& other);
};
public:
InScopeNamespaces(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~InScopeNamespaces();
void addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
void addScope(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
void removeScope();
bool isValidBinding(const XMLCh* prefix, const XMLCh* uri) const;
const XMLCh* getOrDeclarePrefix(const XMLCh* uri);
const XMLCh* getPrefix(const XMLCh* uri) const;
const XMLCh* getUri(const XMLCh* prefix) const;
XMLSize_t size();
private:
RefVectorOf<Scope> *fScopes;
Scope *lastScopeWithBindings;
// unimplemented
InScopeNamespaces ( const InScopeNamespaces& toCopy);
InScopeNamespaces& operator= (const InScopeNamespaces& other);
};
public:
DOMNormalizer(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~DOMNormalizer();
/**
* Main entry method to normalize a document
*/
void normalizeDocument(DOMDocumentImpl *doc);
private:
// unimplemented
DOMNormalizer ( const DOMNormalizer& toCopy);
DOMNormalizer& operator= (const DOMNormalizer& other);
protected:
/**
* Recursively normalizes a node
*/
DOMNode * normalizeNode(DOMNode *node) const;
/**
* Helper method that fixes up the namespace declarations according to the
* DOM Level 3 psydocode
*/
void namespaceFixUp(DOMElementImpl *ele) const;
/**
* Converts an integer to an XMLCh - max 15 digits long.
*/
const XMLCh * integerToXMLCh(unsigned int i) const;
/**
* Adds a namespace attribute or replaces the value of existing namespace
* attribute with the given prefix and value for URI.
* In case prefix is empty will add/update default namespace declaration.
*/
void addOrChangeNamespaceDecl(const XMLCh* prefix, const XMLCh* uri, DOMElementImpl *element) const;
/**
* Adds a custom namespace in the form "NSx" where x is an integer that
* has not yet used in the document
*/
const XMLCh* addCustomNamespaceDecl(const XMLCh* uri, DOMElementImpl *element) const;
/**
* Report an error
*/
void error(const XMLErrs::Codes code, const DOMNode *node) const;
//
// fDocument - the document we are operating on
//
// fDOMConfiguration - the configuration from the document
//
// fErrorHandler - the errorhandler to be used when reporting errors during normalization
//
// fNSScope - the data stucture that holds the prefix-uri information
//
// fNewNamespaceCount - the number of custom namespace declarations we have created
//
DOMDocumentImpl *fDocument;
DOMConfigurationImpl *fConfiguration;
DOMErrorHandler *fErrorHandler;
InScopeNamespaces *fNSScope;
unsigned int fNewNamespaceCount;
MemoryManager* fMemoryManager;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,93 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMNotationImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMNOTATIONIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMNOTATIONIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMNotation.hpp>
XERCES_CPP_NAMESPACE_BEGIN
#include "DOMNodeImpl.hpp"
class DOMDocument;
class CDOM_EXPORT DOMNotationImpl: public DOMNotation {
public:
DOMNodeImpl fNode;
const XMLCh * fName;
const XMLCh * fPublicId;
const XMLCh * fSystemId;
const XMLCh * fBaseURI;
public:
DOMNotationImpl(DOMDocument *ownerDoc, const XMLCh *);
DOMNotationImpl(const DOMNotationImpl &other, bool deep=false);
virtual ~DOMNotationImpl();
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
public:
//
// The Public Identifier for this Notation. If no public identifier
// was specified, this will be null.
virtual const XMLCh * getPublicId() const;
// The System Identifier for this Notation. If no system identifier
// was specified, this will be null.
virtual const XMLCh * getSystemId() const;
// NON-DOM: The Public Identifier for this Notation. If no public
// identifier was specified, this will be null.
virtual void setPublicId(const XMLCh *arg);
// NON-DOM: The System Identifier for this Notation. If no system
// identifier was specified, this will be null.
virtual void setSystemId(const XMLCh *arg);
// NON-DOM: set base uri
virtual void setBaseURI(const XMLCh *arg);
private:
// unimplemented
DOMNotationImpl& operator= (const DOMNotationImpl& other);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,114 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMParentNode.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP)
#define XERCESC_INCLUDE_GUARD_DOMPARENTNODE_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
/**
* ParentNode provides the capability of having child
* nodes. Not every node in the DOM can have children, so only nodes that can
* should include this class and pay the price for it.
* <P>
* While we have a direct reference to the first child, the last child is
* stored as the previous sibling of the first child. First child nodes are
* marked as being so, and getNextSibling hides this fact.
*
**/
#include <xercesc/util/XercesDefs.hpp>
#include "DOMNodeListImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class DOMChildNode;
class DOMDocument;
class DOMNode;
class DOMNodeList;
class CDOM_EXPORT DOMParentNode {
public:
DOMDocument *fOwnerDocument; // Document this node belongs to
DOMNode *fFirstChild;
DOMNodeListImpl fChildNodeList; // for GetChildNodes()
public:
DOMParentNode(DOMDocument *ownerDocument);
DOMParentNode(const DOMParentNode &other);
DOMDocument * getOwnerDocument() const;
void setOwnerDocument(DOMDocument* doc);
// Track changes to the node tree structure under this node. An optimization
// for NodeLists.
int changes() const;
void changed();
DOMNode* appendChild(DOMNode *newChild);
DOMNodeList* getChildNodes() const;
DOMNode* getFirstChild() const;
DOMNode* getLastChild() const;
bool hasChildNodes() const;
DOMNode* insertBefore(DOMNode *newChild, DOMNode *refChild);
DOMNode* item(unsigned int index) const;
DOMNode* removeChild(DOMNode *oldChild);
DOMNode* replaceChild(DOMNode *newChild, DOMNode *oldChild);
// Append certain types of nodes fast. Used to speed up XML to DOM
// parsing. See the function implementation for detail.
virtual DOMNode* appendChildFast(DOMNode *newChild);
//Introduced in DOM Level 2
void normalize();
//Introduced in DOM Level 3
bool isEqualNode(const DOMNode* arg) const;
// NON-DOM
// unlike getOwnerDocument this never returns null, even for Document nodes
DOMDocument * getDocument() const;
void release();
public:
void cloneChildren(const DOMNode *other);
DOMNode * lastChild() const;
void lastChild(DOMNode *);
private:
// unimplemented
DOMParentNode& operator= (const DOMParentNode& other);
};
#define GetDOMParentNodeMemoryManager GET_DIRECT_MM(fOwnerDocument)
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,92 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMProcessingInstructionImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTIONIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMPROCESSINGINSTRUCTIONIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMProcessingInstruction.hpp>
#include "DOMCharacterDataImpl.hpp"
#include "DOMNodeImpl.hpp"
#include "DOMChildNode.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class DocumentImpl;
class CDOM_EXPORT DOMProcessingInstructionImpl: public DOMProcessingInstruction {
protected:
DOMNodeImpl fNode;
DOMChildNode fChild;
// use fCharacterData to store its data so that those character utitlites can be used
DOMCharacterDataImpl fCharacterData;
XMLCh *fTarget;
const XMLCh *fBaseURI;
public:
DOMProcessingInstructionImpl(DOMDocument *ownerDoc,
const XMLCh * target,
const XMLCh *data);
DOMProcessingInstructionImpl(const DOMProcessingInstructionImpl &other,
bool deep=false);
virtual ~DOMProcessingInstructionImpl();
public:
// Declare all of the functions from DOMNode.
DOMNODE_FUNCTIONS;
public:
virtual const XMLCh *getData() const;
virtual const XMLCh *getTarget() const;
virtual void setData(const XMLCh *arg);
// NON-DOM: set base uri
virtual void setBaseURI(const XMLCh* baseURI);
// Non standard extension for the range to work
void deleteData(XMLSize_t offset, XMLSize_t count);
const XMLCh* substringData(XMLSize_t offset, XMLSize_t count) const;
DOMProcessingInstruction* splitText(XMLSize_t offset);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMProcessingInstructionImpl & operator = (const DOMProcessingInstructionImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,176 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMRangeImpl.hpp 641193 2008-03-26 08:06:57Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMRANGEIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMRANGEIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMRange.hpp>
#include <xercesc/util/PlatformUtils.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class DOMDocumentFragment;
class DOMDocument;
class DOMText;
class MemoryManager;
class CDOM_EXPORT DOMRangeImpl: public DOMRange {
protected:
enum TraversalType {
EXTRACT_CONTENTS = 1,
CLONE_CONTENTS = 2,
DELETE_CONTENTS = 3
};
enum TraversePoint {
BEFORE = -1,
START = 0,
AFTER = 1
};
//private data
DOMNode* fStartContainer;
XMLSize_t fStartOffset;
DOMNode* fEndContainer;
XMLSize_t fEndOffset;
bool fCollapsed;
DOMDocument* fDocument;
bool fDetached;
DOMNode* fRemoveChild;
MemoryManager* fMemoryManager;
public:
//c'tor
DOMRangeImpl(DOMDocument* doc, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
DOMRangeImpl(const DOMRangeImpl& other);
//d'tor
~DOMRangeImpl();
//getter functions
virtual DOMNode* getStartContainer() const;
virtual XMLSize_t getStartOffset() const;
virtual DOMNode* getEndContainer() const;
virtual XMLSize_t getEndOffset() const;
virtual bool getCollapsed() const;
virtual const DOMNode* getCommonAncestorContainer() const;
//setter functions
virtual void setStart(const DOMNode *parent, XMLSize_t offset);
virtual void setEnd(const DOMNode *parent, XMLSize_t offset);
virtual void setStartBefore(const DOMNode *refNode);
virtual void setStartAfter(const DOMNode *refNode);
virtual void setEndBefore(const DOMNode *refNode);
virtual void setEndAfter(const DOMNode *refNode);
//misc functions
virtual void collapse(bool toStart);
virtual void selectNode(const DOMNode *node);
virtual void selectNodeContents(const DOMNode *node);
//Functions related to comparing range Boundrary-Points
virtual short compareBoundaryPoints(CompareHow how, const DOMRange* range) const;
virtual void deleteContents();
virtual DOMDocumentFragment* extractContents();
virtual DOMDocumentFragment* cloneContents() const;
virtual void insertNode(DOMNode* node);
//Misc functions
virtual void surroundContents(DOMNode *node);
virtual DOMRange* cloneRange() const;
virtual const XMLCh* toString() const;
virtual void detach();
virtual void release();
//getter functions
DOMDocument* getDocument();
// functions to inform all existing valid ranges about a change
void updateSplitInfo(DOMNode* oldNode, DOMNode* startNode, XMLSize_t offset);
void updateRangeForInsertedNode(DOMNode* node);
void receiveReplacedText(DOMNode* node);
void updateRangeForDeletedText(DOMNode* node, XMLSize_t offset, XMLSize_t count);
void updateRangeForInsertedText(DOMNode* node, XMLSize_t offset, XMLSize_t count);
void updateRangeForDeletedNode(DOMNode* node);
protected:
//setter functions
void setStartContainer(const DOMNode* node);
void setStartOffset(XMLSize_t offset) ;
void setEndContainer(const DOMNode* node);
void setEndOffset(XMLSize_t offset) ;
//misc functions
void validateNode(const DOMNode* node) const;
bool isValidAncestorType(const DOMNode* node) const;
bool hasLegalRootContainer(const DOMNode* node) const;
bool isLegalContainedNode(const DOMNode* node ) const;
void checkIndex(const DOMNode* node, XMLSize_t offset) const;
static bool isAncestorOf(const DOMNode* a, const DOMNode* b);
XMLSize_t indexOf(const DOMNode* child, const DOMNode* parent) const;
const DOMNode* commonAncestorOf(const DOMNode* pointA, const DOMNode* pointB) const;
DOMNode* nextNode(const DOMNode* node, bool visitChildren) const;
DOMDocumentFragment* traverseContents(TraversalType type);
void checkReadOnly(DOMNode* start, DOMNode* end,
XMLSize_t starOffset, XMLSize_t endOffset);
void recurseTreeAndCheck(DOMNode* start, DOMNode* end);
DOMNode* removeChild(DOMNode* parent, DOMNode* child);
DOMDocumentFragment* traverseSameContainer( int how );
DOMDocumentFragment* traverseCommonStartContainer( DOMNode *endAncestor, int how );
DOMDocumentFragment* traverseCommonEndContainer( DOMNode *startAncestor, int how );
DOMDocumentFragment* traverseCommonAncestors( DOMNode *startAncestor, DOMNode *endAncestor, int how );
DOMNode* traverseRightBoundary( DOMNode *root, int how );
DOMNode* traverseLeftBoundary( DOMNode *root, int how );
DOMNode* traverseNode( DOMNode *n, bool isFullySelected, bool isLeft, int how );
DOMNode* traverseFullySelected( DOMNode *n, int how );
DOMNode* traversePartiallySelected( DOMNode *n, int how );
DOMNode* traverseTextNode( DOMNode *n, bool isLeft, int how );
DOMNode* getSelectedNode( DOMNode *container, int offset );
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMRangeImpl & operator = (const DOMRangeImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,56 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMStringListImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGLISTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMSTRINGLISTIMPL_HPP
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/util/RefVectorOf.hpp>
#include <xercesc/dom/DOMStringList.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMStringListImpl: public XMemory,
public DOMStringList
{
protected:
RefVectorOf<XMLCh> *fList;
private:
// Unused, and unimplemented constructors, operators, etc.
DOMStringListImpl(const DOMStringListImpl & other);
DOMStringListImpl & operator = (const DOMStringListImpl & other);
public:
DOMStringListImpl(int nInitialSize, MemoryManager* manager);
void add(const XMLCh* impl);
virtual ~DOMStringListImpl();
virtual const XMLCh* item(XMLSize_t index) const;
virtual XMLSize_t getLength() const;
virtual bool contains(const XMLCh* str) const;
virtual void release();
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,211 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMStringPool.hpp 678766 2008-07-22 14:00:16Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMSTRINGPOOL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMSTRINGPOOL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMDocumentImpl;
//
// DStringPoolEntry - one of these structs is allocated for each
// XMLCh String in the pool. Each slot in the
// hash table array itself is a pointer to the head
// of a singly-linked list of these structs.
//
// Although this struct is delcared with a string length of one,
// the factory method allocates enough storage to hold the full
// string length.
//
struct DOMStringPoolEntry
{
DOMStringPoolEntry *fNext;
XMLCh fString[1];
};
//
// DOMBuffer is a lightweight text buffer
// The buffer is not nul terminated until some asks to see the raw buffer
// contents. This also avoids overhead during append operations.
class DOMBuffer
{
public :
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
DOMBuffer(DOMDocumentImpl *doc, XMLSize_t capacity = 31);
~DOMBuffer()
{
}
// -----------------------------------------------------------------------
// Buffer Management
// -----------------------------------------------------------------------
void append (const XMLCh* const chars);
void append (const XMLCh* const chars, const XMLSize_t count);
void set (const XMLCh* const chars);
void set (const XMLCh* const chars, const XMLSize_t count);
const XMLCh* getRawBuffer() const
{
fBuffer[fIndex] = 0;
return fBuffer;
}
void reset()
{
fIndex = 0;
fBuffer[0] = 0;
}
void chop
(
const XMLSize_t count
)
{
fBuffer[count] = 0;
fIndex = count;
}
// -----------------------------------------------------------------------
// Getters
// -----------------------------------------------------------------------
XMLSize_t getLen() const
{
return fIndex;
}
XMLSize_t getCapacity() const
{
return fCapacity;
}
// -----------------------------------------------------------------------
// Private helpers
// -----------------------------------------------------------------------
void expandCapacity(const XMLSize_t extraNeeded);
private :
// -----------------------------------------------------------------------
// Private data members
//
// fBuffer
// The pointer to the buffer data. Its grown as needed. Its always
// one larger than fCapacity, to leave room for the null terminator.
//
// fIndex
// The current index into the buffer, as characters are appended
// to it. If its zero, then the buffer is empty.
//
// fCapacity
// The current capacity of the buffer. Its actually always one
// larger, to leave room for the null terminator.
//
// fDoc
// For allocating memory
// -----------------------------------------------------------------------
XMLCh* fBuffer;
XMLSize_t fIndex;
XMLSize_t fCapacity;
DOMDocumentImpl* fDoc;
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMBuffer(const DOMBuffer &);
DOMBuffer & operator = (const DOMBuffer &);
};
inline void DOMBuffer::
append (const XMLCh* const chars)
{
XMLSize_t count = XMLString::stringLen(chars);
if (fIndex + count >= fCapacity)
expandCapacity(count);
memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh));
fIndex += count;
// Keep it null terminated
fBuffer[fIndex] = 0;
}
inline void DOMBuffer::
append (const XMLCh* const chars, const XMLSize_t count)
{
if (fIndex + count >= fCapacity)
expandCapacity(count);
memcpy(&fBuffer[fIndex], chars, count * sizeof(XMLCh));
fIndex += count;
// Keep it null terminated
fBuffer[fIndex] = 0;
}
inline void DOMBuffer::
set (const XMLCh* const chars)
{
XMLSize_t count = XMLString::stringLen(chars);
fIndex = 0;
if (count >= fCapacity)
expandCapacity(count);
memcpy(fBuffer, chars, count * sizeof(XMLCh));
fIndex = count;
// Keep it null terminated
fBuffer[fIndex] = 0;
}
inline void DOMBuffer::
set (const XMLCh* const chars, const XMLSize_t count)
{
fIndex = 0;
if (count >= fCapacity)
expandCapacity(count);
memcpy(fBuffer, chars, count * sizeof(XMLCh));
fIndex = count;
// Keep it null terminated
fBuffer[fIndex] = 0;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,103 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMTextImpl.hpp 678709 2008-07-22 10:56:56Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMTEXTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMTEXTIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/dom/DOMText.hpp>
#include "DOMChildNode.hpp"
#include "DOMNodeImpl.hpp"
#include "DOMCharacterDataImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMTextImpl: public DOMText {
public:
DOMNodeImpl fNode;
DOMChildNode fChild;
DOMCharacterDataImpl fCharacterData;
public:
DOMTextImpl(DOMDocument* ownerDoc, const XMLCh* data);
DOMTextImpl(DOMDocument *ownerDoc, const XMLCh* data, XMLSize_t n);
DOMTextImpl(const DOMTextImpl& other, bool deep=false);
virtual ~DOMTextImpl();
virtual DOMText* splitText(XMLSize_t offset);
// DOM Level 3
virtual bool getIsElementContentWhitespace() const;
virtual const XMLCh* getWholeText() const;
virtual DOMText* replaceWholeText(const XMLCh* content);
// non-standard extension
virtual bool isIgnorableWhitespace() const;
public:
// Declare the functions coming from DOMNode.
DOMNODE_FUNCTIONS;
public:
// All of the functions coming from DOMCharacterData
virtual const XMLCh* getData() const;
virtual XMLSize_t getLength() const;
virtual const XMLCh* substringData(XMLSize_t offset,
XMLSize_t count) const;
virtual void appendData(const XMLCh *arg);
virtual void insertData(XMLSize_t offset, const XMLCh *arg);
virtual void deleteData(XMLSize_t offset,
XMLSize_t count);
virtual void replaceData(XMLSize_t offset,
XMLSize_t count,
const XMLCh *arg);
virtual void setData(const XMLCh *data);
// Non-standard extension.
//
virtual void appendData(const XMLCh *arg, XMLSize_t n);
protected:
virtual void setIgnorableWhitespace(bool ignorable);
friend class AbstractDOMParser;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMTextImpl & operator = (const DOMTextImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,168 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMTreeWalkerImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMTREEWALKERIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include <xercesc/dom/DOMTreeWalker.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMTreeWalkerImpl : public DOMTreeWalker {
protected:
// The whatToShow mask.
DOMNodeFilter::ShowType fWhatToShow;
// The NodeFilter reference.
DOMNodeFilter* fNodeFilter;
// The current Node.
DOMNode* fCurrentNode;
// The root Node.
DOMNode* fRoot;
// The expandEntity reference flag.
bool fExpandEntityReferences;
public:
// Implementation Note: No state is kept except the data above
// (fWhatToShow, fNodeFilter, fCurrentNode, fRoot) such that
// setters could be created for these data values and the
// implementation will still work.
/** Public constructor */
DOMTreeWalkerImpl (
DOMNode* root,
DOMNodeFilter::ShowType whatToShow,
DOMNodeFilter* nodeFilter,
bool expandEntityRef);
DOMTreeWalkerImpl (const DOMTreeWalkerImpl& twi);
DOMTreeWalkerImpl& operator= (const DOMTreeWalkerImpl& twi);
// Return the root node.
virtual DOMNode* getRoot ();
// Return the whatToShow value.
virtual DOMNodeFilter::ShowType getWhatToShow ();
// Return the NodeFilter.
virtual DOMNodeFilter* getFilter ();
// Return the current DOMNode.
virtual DOMNode* getCurrentNode ();
// Return the current Node.
virtual void setCurrentNode (DOMNode* node);
// Return the parent Node from the current node,
// after applying filter, whatToshow.
// If result is not null, set the current Node.
virtual DOMNode* parentNode ();
// Return the first child Node from the current node,
// after applying filter, whatToshow.
// If result is not null, set the current Node.
virtual DOMNode* firstChild ();
// Return the last child Node from the current node,
// after applying filter, whatToshow.
// If result is not null, set the current Node.
virtual DOMNode* lastChild ();
// Return the previous sibling Node from the current node,
// after applying filter, whatToshow.
// If result is not null, set the current Node.
virtual DOMNode* previousSibling ();
// Return the next sibling Node from the current node,
// after applying filter, whatToshow.
// If result is not null, set the current Node.
virtual DOMNode* nextSibling ();
// Return the previous Node from the current node,
// after applying filter, whatToshow.
// If result is not null, set the current Node.
virtual DOMNode* previousNode ();
// Return the next Node from the current node,
// after applying filter, whatToshow.
// If result is not null, set the current Node.
virtual DOMNode* nextNode ();
// Get the expandEntity reference flag.
virtual bool getExpandEntityReferences();
// release the resource
virtual void release();
protected:
// Internal function.
// Return the parent Node, from the input node
// after applying filter, whatToshow.
// The current node is not consulted or set.
DOMNode* getParentNode (DOMNode* node);
// Internal function.
// Return the nextSibling Node, from the input node
// after applying filter, whatToshow.
// The current node is not consulted or set.
DOMNode* getNextSibling (DOMNode* node);
// Internal function.
// Return the previous sibling Node, from the input node
// after applying filter, whatToshow.
// The current node is not consulted or set.
DOMNode* getPreviousSibling (DOMNode* node);
// Internal function.
// Return the first child Node, from the input node
// after applying filter, whatToshow.
// The current node is not consulted or set.
DOMNode* getFirstChild (DOMNode* node);
// Internal function.
// Return the last child Node, from the input node
// after applying filter, whatToshow.
// The current node is not consulted or set.
DOMNode* getLastChild (DOMNode* node);
// The node is accepted if it passes the whatToShow and the filter.
short acceptNode (DOMNode* node);
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,106 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// This file is part of the internal implementation of the C++ XML DOM.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#if !defined(XERCESC_INCLUDE_GUARD_DOMTYPEINFOIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMTYPEINFOIMPL_HPP
//------------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------------
#include <xercesc/dom/DOMTypeInfo.hpp>
#include <xercesc/dom/DOMPSVITypeInfo.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMDocumentImpl;
class CDOM_EXPORT DOMTypeInfoImpl : public DOMTypeInfo, public DOMPSVITypeInfo
{
public:
//-----------------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------------
DOMTypeInfoImpl(const XMLCh* namespaceUri=0, const XMLCh* name=0);
DOMTypeInfoImpl(DOMDocumentImpl* ownerDoc, const DOMPSVITypeInfo* sourcePSVI);
static DOMTypeInfoImpl g_DtdValidatedElement;
static DOMTypeInfoImpl g_DtdNotValidatedAttribute;
static DOMTypeInfoImpl g_DtdValidatedCDATAAttribute;
static DOMTypeInfoImpl g_DtdValidatedIDAttribute;
static DOMTypeInfoImpl g_DtdValidatedIDREFAttribute;
static DOMTypeInfoImpl g_DtdValidatedIDREFSAttribute;
static DOMTypeInfoImpl g_DtdValidatedENTITYAttribute;
static DOMTypeInfoImpl g_DtdValidatedENTITIESAttribute;
static DOMTypeInfoImpl g_DtdValidatedNMTOKENAttribute;
static DOMTypeInfoImpl g_DtdValidatedNMTOKENSAttribute;
static DOMTypeInfoImpl g_DtdValidatedNOTATIONAttribute;
static DOMTypeInfoImpl g_DtdValidatedENUMERATIONAttribute;
// -----------------------------------------------------------------------
// DOMTypeInfo interface
// -----------------------------------------------------------------------
virtual const XMLCh* getTypeName() const;
virtual const XMLCh* getTypeNamespace() const;
virtual bool isDerivedFrom(const XMLCh* typeNamespaceArg, const XMLCh* typeNameArg, DerivationMethods derivationMethod) const;
// -----------------------------------------------------------------------
// DOMPSVITypeInfo interface
// -----------------------------------------------------------------------
virtual const XMLCh* getStringProperty(PSVIProperty prop) const;
virtual int getNumericProperty(PSVIProperty prop) const;
// -----------------------------------------------------------------------
// Setter methods
// -----------------------------------------------------------------------
virtual void setStringProperty(PSVIProperty prop, const XMLCh* value);
virtual void setNumericProperty(PSVIProperty prop, int value);
protected:
int fBitFields;
const XMLCh* fTypeName;
const XMLCh* fTypeNamespace;
const XMLCh* fMemberTypeName;
const XMLCh* fMemberTypeNamespace;
const XMLCh* fDefaultValue;
const XMLCh* fNormalizedValue;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DOMTypeInfoImpl (const DOMTypeInfoImpl&);
DOMTypeInfoImpl & operator = (const DOMTypeInfoImpl &);
};
XERCES_CPP_NAMESPACE_END
#endif
/**
* End of file DOMTypeInfo.hpp
*/

View File

@@ -0,0 +1,69 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMXPathExpressionImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSIONIMPL_HPP
#include <xercesc/util/XMemory.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOMXPathExpression.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMElement;
class XercesXPath;
class XPathMatcher;
class DOMXPathResultImpl;
class DOMXPathNSResolver;
class XMLStringPool;
class CDOM_EXPORT DOMXPathExpressionImpl : public XMemory,
public DOMXPathExpression
{
public:
DOMXPathExpressionImpl(const XMLCh *expression,
const DOMXPathNSResolver *resolver,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
virtual ~DOMXPathExpressionImpl();
virtual DOMXPathResult* evaluate(const DOMNode *contextNode,
DOMXPathResult::ResultType type,
DOMXPathResult* result) const;
virtual void release();
protected:
bool testNode(XPathMatcher* matcher,
DOMXPathResultImpl* result,
DOMElement *node) const;
void cleanUp();
XMLStringPool* fStringPool;
XercesXPath* fParsedExpression;
XMLCh* fExpression;
bool fMoveToRoot;
MemoryManager* const fMemoryManager;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,58 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMXPathNSResolverImpl.hpp 657774 2008-05-19 09:59:33Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVERIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMXPATHNSRESOLVERIMPL_HPP
#include <xercesc/util/XercesDefs.hpp>
#include <xercesc/util/XMemory.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOMXPathNSResolver.hpp>
#include <xercesc/util/KVStringPair.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DOMNode;
class CDOM_EXPORT DOMXPathNSResolverImpl : public XMemory,
public DOMXPathNSResolver
{
public:
DOMXPathNSResolverImpl(const DOMNode* nodeResolver = 0, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~DOMXPathNSResolverImpl();
virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const;
virtual const XMLCh* lookupPrefix(const XMLCh* URI) const;
virtual void addNamespaceBinding(const XMLCh* prefix, const XMLCh* uri);
virtual void release();
protected:
RefHashTableOf<KVStringPair>* fNamespaceBindings;
const DOMNode* fResolverNode;
MemoryManager* fManager;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,66 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DOMXPathResultImpl.hpp 671894 2008-06-26 13:29:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_DOMXPATHRESULTIMPL_HPP
#include <xercesc/util/XMemory.hpp>
#include <xercesc/dom/DOMXPathResult.hpp>
#include <xercesc/util/RefVectorOf.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT DOMXPathResultImpl : public XMemory,
public DOMXPathResult
{
public:
DOMXPathResultImpl(ResultType type, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~DOMXPathResultImpl();
virtual ResultType getResultType() const;
virtual const DOMTypeInfo *getTypeInfo() const;
virtual bool isNode() const;
virtual bool getBooleanValue() const;
virtual int getIntegerValue() const;
virtual double getNumberValue() const;
virtual const XMLCh* getStringValue() const;
virtual DOMNode* getNodeValue() const;
virtual bool iterateNext();
virtual bool getInvalidIteratorState() const;
virtual bool snapshotItem(XMLSize_t);
virtual XMLSize_t getSnapshotLength() const;
virtual void release();
public:
void reset(ResultType type);
void addResult(DOMNode* node);
protected:
ResultType fType;
MemoryManager* const fMemoryManager;
RefVectorOf<DOMNode>* fSnapshot;
XMLSize_t fIndex;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,71 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSDElementNSImpl.hpp 672232 2008-06-27 10:16:38Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSDELEMENTNSIMPL_HPP)
#define XERCESC_INCLUDE_GUARD_XSDELEMENTNSIMPL_HPP
//
// This file is part of the internal implementation of the C++ XML DOM.
// It is used by TraverseSchema to store line/column information.
// It should NOT be included or used directly by application programs.
//
// Applications should include the file <xercesc/dom/DOM.hpp> for the entire
// DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
// name is substituded for the *.
//
#include "DOMElementNSImpl.hpp"
XERCES_CPP_NAMESPACE_BEGIN
class CDOM_EXPORT XSDElementNSImpl: public DOMElementNSImpl {
protected:
XMLFileLoc fLineNo; //Line number
XMLFileLoc fColumnNo; //Column number
public:
XSDElementNSImpl(DOMDocument *ownerDoc, const XMLCh *name);
XSDElementNSImpl(DOMDocument *ownerDoc, //DOM Level 2
const XMLCh *namespaceURI,
const XMLCh *qualifiedName,
const XMLFileLoc lineNo,
const XMLFileLoc columnNo);
XSDElementNSImpl(const XSDElementNSImpl &other, bool deep=false);
virtual DOMNode * cloneNode(bool deep) const;
XMLFileLoc getLineNo() const { return fLineNo; }
XMLFileLoc getColumnNo() const { return fColumnNo; }
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSDElementNSImpl& operator=(const XSDElementNSImpl&);
};
XERCES_CPP_NAMESPACE_END
#endif