2012-04-29 20:52:25 +02:00
|
|
|
//
|
|
|
|
// AbstractContainerNode.h
|
|
|
|
//
|
|
|
|
// Library: XML
|
|
|
|
// Package: DOM
|
|
|
|
// Module: DOM
|
|
|
|
//
|
|
|
|
// Definition of the AbstractContainerNode class.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
|
|
|
// and Contributors.
|
|
|
|
//
|
2014-05-04 21:02:42 +02:00
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
2012-04-29 20:52:25 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef DOM_AbstractContainerNode_INCLUDED
|
|
|
|
#define DOM_AbstractContainerNode_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
#include "Poco/XML/XML.h"
|
|
|
|
#include "Poco/DOM/AbstractNode.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Poco {
|
|
|
|
namespace XML {
|
|
|
|
|
|
|
|
|
|
|
|
class XML_API AbstractContainerNode: public AbstractNode
|
|
|
|
/// AbstractContainerNode is an implementation of Node
|
|
|
|
/// that stores and manages child nodes.
|
|
|
|
///
|
|
|
|
/// Child nodes are organized in a single linked list.
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Node
|
|
|
|
Node* firstChild() const;
|
|
|
|
Node* lastChild() const;
|
|
|
|
Node* insertBefore(Node* newChild, Node* refChild);
|
2023-11-26 19:49:50 +01:00
|
|
|
Node* insertAfterNP(Node* newChild, Node* refChild);
|
2012-04-29 20:52:25 +02:00
|
|
|
Node* replaceChild(Node* newChild, Node* oldChild);
|
|
|
|
Node* removeChild(Node* oldChild);
|
|
|
|
Node* appendChild(Node* newChild);
|
|
|
|
bool hasChildNodes() const;
|
|
|
|
bool hasAttributes() const;
|
|
|
|
Node* getNodeByPath(const XMLString& path) const;
|
|
|
|
Node* getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
AbstractContainerNode(Document* pOwnerDocument);
|
|
|
|
AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node);
|
|
|
|
~AbstractContainerNode();
|
|
|
|
|
|
|
|
void dispatchNodeRemovedFromDocument();
|
|
|
|
void dispatchNodeInsertedIntoDocument();
|
2021-06-15 08:52:58 +02:00
|
|
|
|
|
|
|
static const Node* findNode(XMLString::const_iterator& it, const XMLString::const_iterator& end, const Node* pNode, const NSMap* pNSMap, bool& indexBound);
|
2012-04-29 20:52:25 +02:00
|
|
|
static const Node* findElement(const XMLString& name, const Node* pNode, const NSMap* pNSMap);
|
|
|
|
static const Node* findElement(int index, const Node* pNode, const NSMap* pNSMap);
|
|
|
|
static const Node* findElement(const XMLString& attr, const XMLString& value, const Node* pNode, const NSMap* pNSMap);
|
|
|
|
static const Attr* findAttribute(const XMLString& name, const Node* pNode, const NSMap* pNSMap);
|
|
|
|
bool hasAttributeValue(const XMLString& name, const XMLString& value, const NSMap* pNSMap) const;
|
|
|
|
static bool namesAreEqual(const Node* pNode1, const Node* pNode2, const NSMap* pNSMap);
|
|
|
|
static bool namesAreEqual(const Node* pNode, const XMLString& name, const NSMap* pNSMap);
|
|
|
|
|
2017-08-11 19:13:02 +02:00
|
|
|
static const XMLString WILDCARD;
|
2017-08-11 19:26:12 +02:00
|
|
|
|
2012-04-29 20:52:25 +02:00
|
|
|
private:
|
|
|
|
AbstractNode* _pFirstChild;
|
|
|
|
|
|
|
|
friend class AbstractNode;
|
|
|
|
friend class NodeAppender;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} } // namespace Poco::XML
|
|
|
|
|
|
|
|
|
|
|
|
#endif // DOM_AbstractContainerNode_INCLUDED
|