root / trunk / tbeta / OSX / libs / poco / include / Poco / DOM / AbstractContainerNode.h @ 5

View | Annotate | Download (2.7 KB)

1 5 ss
//
2 5 ss
// AbstractContainerNode.h
3 5 ss
//
4 5 ss
// $Id: //poco/1.3/XML/include/Poco/DOM/AbstractContainerNode.h#2 $
5 5 ss
//
6 5 ss
// Library: XML
7 5 ss
// Package: DOM
8 5 ss
// Module:  DOM
9 5 ss
//
10 5 ss
// Definition of the AbstractContainerNode class.
11 5 ss
//
12 5 ss
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
13 5 ss
// and Contributors.
14 5 ss
//
15 5 ss
// Permission is hereby granted, free of charge, to any person or organization
16 5 ss
// obtaining a copy of the software and accompanying documentation covered by
17 5 ss
// this license (the "Software") to use, reproduce, display, distribute,
18 5 ss
// execute, and transmit the Software, and to prepare derivative works of the
19 5 ss
// Software, and to permit third-parties to whom the Software is furnished to
20 5 ss
// do so, all subject to the following:
21 5 ss
//
22 5 ss
// The copyright notices in the Software and this entire statement, including
23 5 ss
// the above license grant, this restriction and the following disclaimer,
24 5 ss
// must be included in all copies of the Software, in whole or in part, and
25 5 ss
// all derivative works of the Software, unless such copies or derivative
26 5 ss
// works are solely in the form of machine-executable object code generated by
27 5 ss
// a source language processor.
28 5 ss
//
29 5 ss
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 5 ss
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 5 ss
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
32 5 ss
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
33 5 ss
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
34 5 ss
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
35 5 ss
// DEALINGS IN THE SOFTWARE.
36 5 ss
//
37 5 ss
38 5 ss
39 5 ss
#ifndef DOM_AbstractContainerNode_INCLUDED
40 5 ss
#define DOM_AbstractContainerNode_INCLUDED
41 5 ss
42 5 ss
43 5 ss
#include "Poco/XML/XML.h"
44 5 ss
#include "Poco/DOM/AbstractNode.h"
45 5 ss
46 5 ss
47 5 ss
namespace Poco {
48 5 ss
namespace XML {
49 5 ss
50 5 ss
51 5 ss
class XML_API AbstractContainerNode: public AbstractNode
52 5 ss
        /// AbstractContainerNode is an implementation of Node
53 5 ss
        /// that stores and manages child nodes.
54 5 ss
        ///
55 5 ss
        /// Child nodes are organized in a single linked list.
56 5 ss
{
57 5 ss
public:
58 5 ss
        // Node
59 5 ss
        Node* firstChild() const;
60 5 ss
        Node* lastChild() const;
61 5 ss
        Node* insertBefore(Node* newChild, Node* refChild);
62 5 ss
        Node* replaceChild(Node* newChild, Node* oldChild);
63 5 ss
        Node* removeChild(Node* oldChild);
64 5 ss
        Node* appendChild(Node* newChild);
65 5 ss
        bool hasChildNodes() const;
66 5 ss
        bool hasAttributes() const;
67 5 ss
68 5 ss
protected:
69 5 ss
        AbstractContainerNode(Document* pOwnerDocument);
70 5 ss
        AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node);
71 5 ss
        ~AbstractContainerNode();
72 5 ss
73 5 ss
        void dispatchNodeRemovedFromDocument();
74 5 ss
        void dispatchNodeInsertedIntoDocument();
75 5 ss
76 5 ss
private:
77 5 ss
        AbstractNode* _pFirstChild;
78 5 ss
79 5 ss
        friend class AbstractNode;
80 5 ss
        friend class NodeAppender;
81 5 ss
};
82 5 ss
83 5 ss
84 5 ss
} } // namespace Poco::XML
85 5 ss
86 5 ss
87 5 ss
#endif // DOM_AbstractContainerNode_INCLUDED