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_ProcessingInstruction.hpp,v 1.5 2004/09/08 13:55:43 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef DOM_ProcessingInstruction_HEADER_GUARD_
|
---|
22 | #define DOM_ProcessingInstruction_HEADER_GUARD_
|
---|
23 |
|
---|
24 | #include <xercesc/util/XercesDefs.hpp>
|
---|
25 | #include "DOM_Node.hpp"
|
---|
26 |
|
---|
27 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
28 |
|
---|
29 |
|
---|
30 | class ProcessingInstructionImpl;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The <code>ProcessingInstruction</code> interface represents a "processing
|
---|
34 | * instruction", used in XML as a way to keep processor-specific information
|
---|
35 | * in the text of the document.
|
---|
36 | */
|
---|
37 | class DEPRECATED_DOM_EXPORT DOM_ProcessingInstruction: public DOM_Node {
|
---|
38 | public:
|
---|
39 | /** @name Constructors and assignment operator */
|
---|
40 | //@{
|
---|
41 | /**
|
---|
42 | * Default constructor for DOM_ProcessingInstruction. The resulting object
|
---|
43 | * does not refer to an actual PI node; it will compare == to 0, and is similar
|
---|
44 | * to a null object reference variable in Java. It may subsequently be
|
---|
45 | * assigned to refer to an actual PI node.
|
---|
46 | * <p>
|
---|
47 | * New Processing Instruction nodes are created by DOM_Document::createProcessingInstruction().
|
---|
48 | *
|
---|
49 | *
|
---|
50 | */
|
---|
51 | DOM_ProcessingInstruction();
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Copy constructor. Creates a new <code>DOM_ProcessingInstruction</code> that refers to the
|
---|
55 | * same underlying node as the original. See also DOM_Node::clone(),
|
---|
56 | * which will copy the actual PI node, rather than just creating a new
|
---|
57 | * reference to the original node.
|
---|
58 | *
|
---|
59 | * @param other The object to be copied.
|
---|
60 | */
|
---|
61 | DOM_ProcessingInstruction(const DOM_ProcessingInstruction &other);
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * Assignment operator.
|
---|
65 | *
|
---|
66 | * @param other The object to be copied.
|
---|
67 | */
|
---|
68 | DOM_ProcessingInstruction & operator = (const DOM_ProcessingInstruction &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_ProcessingInstruction & operator = (const DOM_NullPtr *val);
|
---|
84 |
|
---|
85 | //@}
|
---|
86 | /** @name Destructor. */
|
---|
87 | //@{
|
---|
88 | /**
|
---|
89 | * Destructor for DOM_processingInstruction. The object being destroyed is the reference
|
---|
90 | * object, not the underlying PI node itself.
|
---|
91 | *
|
---|
92 | */
|
---|
93 | ~DOM_ProcessingInstruction();
|
---|
94 |
|
---|
95 | //@}
|
---|
96 | /** @name Get functions. */
|
---|
97 | //@{
|
---|
98 | /**
|
---|
99 | * The target of this processing instruction.
|
---|
100 | *
|
---|
101 | * XML defines this as being the
|
---|
102 | * first token following the markup that begins the processing instruction.
|
---|
103 | */
|
---|
104 | DOMString getTarget() const;
|
---|
105 |
|
---|
106 | /**
|
---|
107 | * The content of this processing instruction.
|
---|
108 | *
|
---|
109 | * This is from the first non
|
---|
110 | * white space character after the target to the character immediately
|
---|
111 | * preceding the <code>?></code>.
|
---|
112 | * @exception DOMException
|
---|
113 | * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
|
---|
114 | */
|
---|
115 | DOMString getData() const;
|
---|
116 |
|
---|
117 | //@}
|
---|
118 | /** @name Set functions. */
|
---|
119 | //@{
|
---|
120 | /**
|
---|
121 | * Sets the content of this processing instruction.
|
---|
122 | *
|
---|
123 | * This is from the first non
|
---|
124 | * white space character after the target to the character immediately
|
---|
125 | * preceding the <code>?></code>.
|
---|
126 | * @param data The string containing the processing instruction
|
---|
127 | */
|
---|
128 | void setData(const DOMString &data);
|
---|
129 | //@}
|
---|
130 |
|
---|
131 | protected:
|
---|
132 | DOM_ProcessingInstruction(ProcessingInstructionImpl *impl);
|
---|
133 |
|
---|
134 | friend class DOM_Document;
|
---|
135 |
|
---|
136 | };
|
---|
137 |
|
---|
138 | XERCES_CPP_NAMESPACE_END
|
---|
139 |
|
---|
140 | #endif
|
---|
141 |
|
---|