root / Community Core Vision / Linux / libs / poco / include / Poco / DOM / NodeAppender.h @ 9

View | Annotate | Download (3.2 KB)

1 9 amit
//
2 9 amit
// NodeAppender.h
3 9 amit
//
4 9 amit
// $Id: //poco/1.3/XML/include/Poco/DOM/NodeAppender.h#1 $
5 9 amit
//
6 9 amit
// Library: XML
7 9 amit
// Package: DOM
8 9 amit
// Module:  NodeAppender
9 9 amit
//
10 9 amit
// Definition of the NodeAppender class.
11 9 amit
//
12 9 amit
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
13 9 amit
// and Contributors.
14 9 amit
//
15 9 amit
// Permission is hereby granted, free of charge, to any person or organization
16 9 amit
// obtaining a copy of the software and accompanying documentation covered by
17 9 amit
// this license (the "Software") to use, reproduce, display, distribute,
18 9 amit
// execute, and transmit the Software, and to prepare derivative works of the
19 9 amit
// Software, and to permit third-parties to whom the Software is furnished to
20 9 amit
// do so, all subject to the following:
21 9 amit
//
22 9 amit
// The copyright notices in the Software and this entire statement, including
23 9 amit
// the above license grant, this restriction and the following disclaimer,
24 9 amit
// must be included in all copies of the Software, in whole or in part, and
25 9 amit
// all derivative works of the Software, unless such copies or derivative
26 9 amit
// works are solely in the form of machine-executable object code generated by
27 9 amit
// a source language processor.
28 9 amit
//
29 9 amit
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 9 amit
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 9 amit
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
32 9 amit
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
33 9 amit
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
34 9 amit
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
35 9 amit
// DEALINGS IN THE SOFTWARE.
36 9 amit
//
37 9 amit
38 9 amit
39 9 amit
#ifndef DOM_NodeAppender_INCLUDED
40 9 amit
#define DOM_NodeAppender_INCLUDED
41 9 amit
42 9 amit
43 9 amit
#include "Poco/XML/XML.h"
44 9 amit
#include "Poco/DOM/Node.h"
45 9 amit
46 9 amit
47 9 amit
namespace Poco {
48 9 amit
namespace XML {
49 9 amit
50 9 amit
51 9 amit
class AbstractNode;
52 9 amit
class Element;
53 9 amit
54 9 amit
55 9 amit
class XML_API NodeAppender
56 9 amit
        /// The NodeAppender class provides a very fast way to
57 9 amit
        /// build larger DOM documents.
58 9 amit
        ///
59 9 amit
        /// In the DOM, child nodes are usually appended to a parent
60 9 amit
        /// node using the appendChild() method. For nodes containing
61 9 amit
        /// more than a few children, this method can be quite slow,
62 9 amit
        /// due to the way it's implemented, and because of the
63 9 amit
        /// requirements of the DOM specification.
64 9 amit
        ///
65 9 amit
        /// While the NodeAppender is being used on an Element, no
66 9 amit
        /// children-modifying methods of that Element must be used.
67 9 amit
        ///
68 9 amit
        /// This class is not part of the DOM specification.
69 9 amit
{
70 9 amit
public:
71 9 amit
        NodeAppender(Element* parent);
72 9 amit
                /// Creates the NodeAppender for the given parent node,
73 9 amit
                /// which must be an Element.
74 9 amit
75 9 amit
        ~NodeAppender();
76 9 amit
                /// Destroys the NodeAppender.
77 9 amit
78 9 amit
        void appendChild(Node* newChild);
79 9 amit
                /// Appends the node newChild to the end of the list of children of
80 9 amit
                /// the parent node specified in the constructor.
81 9 amit
                /// If the newChild is already in the tree, it is first removed.
82 9 amit
                ///
83 9 amit
                /// NewChild can be a DocumentFragment. In this case, all children
84 9 amit
                /// of the fragment become children of the parent element.
85 9 amit
                ///
86 9 amit
                /// In order to speed up the function, no DOM events
87 9 amit
                /// are fired.
88 9 amit
89 9 amit
private:
90 9 amit
        NodeAppender();
91 9 amit
        NodeAppender(const NodeAppender&);
92 9 amit
        NodeAppender& operator = (const NodeAppender&);
93 9 amit
94 9 amit
        Element*      _pParent;
95 9 amit
        AbstractNode* _pLast;
96 9 amit
};
97 9 amit
98 9 amit
99 9 amit
} } // namespace Poco::XML
100 9 amit
101 9 amit
102 9 amit
#endif // #include "Poco/XML/XML.h"