1 | /*
|
---|
2 | * Copyright 1999-2002,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Id: DOM_Comment.hpp,v 1.5 2004/09/08 13:55:42 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef DOM_Comment_HEADER_GUARD_
|
---|
22 | #define DOM_Comment_HEADER_GUARD_
|
---|
23 |
|
---|
24 | #include <xercesc/util/XercesDefs.hpp>
|
---|
25 | #include "DOM_CharacterData.hpp"
|
---|
26 |
|
---|
27 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
28 |
|
---|
29 |
|
---|
30 | class CommentImpl;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Class to refer to XML comment nodes in the DOM.
|
---|
34 | *
|
---|
35 | * <P>The string value contains all of the characters between
|
---|
36 | * the starting '<code><!--</code>' and ending '<code>--></code>'.
|
---|
37 | */
|
---|
38 | class DEPRECATED_DOM_EXPORT DOM_Comment: public DOM_CharacterData {
|
---|
39 |
|
---|
40 | public:
|
---|
41 | /** @name Constructors and assignment operators */
|
---|
42 | //@{
|
---|
43 | /**
|
---|
44 | * Default constructor for DOM_Comment. The resulting object does not
|
---|
45 | * refer to an actual Comment node; it will compare == to 0, and is similar
|
---|
46 | * to a null object reference variable in Java. It may subsequently be
|
---|
47 | * assigned to refer to an actual comment node.
|
---|
48 | * <p>
|
---|
49 | * New comment nodes are created by DOM_Document::createComment().
|
---|
50 | *
|
---|
51 | */
|
---|
52 | DOM_Comment();
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * Copy constructor. Creates a new <code>DOM_Comment</code> that refers to the
|
---|
56 | * same underlying node as the original. See also DOM_Node::clone(),
|
---|
57 | * which will copy the actual Comment node, rather than just creating a new
|
---|
58 | * reference to the original node.
|
---|
59 | *
|
---|
60 | * @param other The object to be copied.
|
---|
61 | */
|
---|
62 | DOM_Comment(const DOM_Comment &other);
|
---|
63 | /**
|
---|
64 | * Assignment operator.
|
---|
65 | *
|
---|
66 | * @param other The object to be copied.
|
---|
67 | */
|
---|
68 | DOM_Comment & operator = (const DOM_Comment &other);
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * Assignment operator. This overloaded variant is provided for
|
---|
72 | * the sole purpose of setting a DOM_Node reference variable to
|
---|
73 | * zero. Nulling out a reference variable in this way will decrement
|
---|
74 | * the reference count on the underlying Node object that the variable
|
---|
75 | * formerly referenced. This effect is normally obtained when reference
|
---|
76 | * variable goes out of scope, but zeroing them can be useful for
|
---|
77 | * global instances, or for local instances that will remain in scope
|
---|
78 | * for an extended time, when the storage belonging to the underlying
|
---|
79 | * node needs to be reclaimed.
|
---|
80 | *
|
---|
81 | * @param val Only a value of 0, or null, is allowed.
|
---|
82 | */
|
---|
83 | DOM_Comment & operator = (const DOM_NullPtr *val);
|
---|
84 |
|
---|
85 |
|
---|
86 |
|
---|
87 | //@}
|
---|
88 | /** @name Destructor. */
|
---|
89 | //@{
|
---|
90 | /**
|
---|
91 | * Destructor for DOM_Comment. The object being destroyed is the reference
|
---|
92 | * object, not the underlying Comment node itself.
|
---|
93 | *
|
---|
94 | */
|
---|
95 | ~DOM_Comment();
|
---|
96 | //@}
|
---|
97 |
|
---|
98 | protected:
|
---|
99 | DOM_Comment(CommentImpl *comment);
|
---|
100 |
|
---|
101 | friend class DOM_Document;
|
---|
102 |
|
---|
103 |
|
---|
104 |
|
---|
105 | };
|
---|
106 |
|
---|
107 | XERCES_CPP_NAMESPACE_END
|
---|
108 |
|
---|
109 | #endif
|
---|
110 |
|
---|