Coverage Report

Created: 2026-04-29 06:47

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/poco/XML/include/Poco/DOM/ProcessingInstruction.h
Line
Count
Source
1
//
2
// ProcessingInstruction.h
3
//
4
// Library: XML
5
// Package: DOM
6
// Module:  DOM
7
//
8
// Definition of the DOM ProcessingInstruction class.
9
//
10
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11
// and Contributors.
12
//
13
// SPDX-License-Identifier: BSL-1.0
14
//
15
16
17
#ifndef DOM_ProcessingInstruction_INCLUDED
18
#define DOM_ProcessingInstruction_INCLUDED
19
20
21
#include "Poco/XML/XML.h"
22
#include "Poco/DOM/AbstractNode.h"
23
#include "Poco/XML/XMLString.h"
24
25
26
namespace Poco::XML {
27
28
29
class XML_API ProcessingInstruction: public AbstractNode
30
  /// The ProcessingInstruction interface represents a "processing instruction",
31
  /// used in XML as a way to keep processor-specific information in the text
32
  /// of the document.
33
{
34
public:
35
  const XMLString& target() const;
36
    /// Returns the target of this processing instruction.
37
    /// XML defines this as being the first token following
38
    /// the markup that begins the processing instruction.
39
40
  const XMLString& data() const;
41
    /// Returns the content of this processing instruction. This is from the first non
42
    /// white space character after the target to the character immediately preceding
43
    /// the ?>.
44
45
  const XMLString& getData() const;
46
    /// Returns the content of this processing instruction. This is from the first non
47
    /// white space character after the target to the character immediately preceding
48
    /// the ?>.
49
50
  void setData(const XMLString& data);
51
    /// Sets the content of this processing instruction.
52
53
  // Node
54
  const XMLString& nodeName() const;
55
  const XMLString& getNodeValue() const;
56
  void setNodeValue(const XMLString& data);
57
  unsigned short nodeType() const;
58
59
protected:
60
  ProcessingInstruction(Document* pOwnerDocument, const XMLString& target, const XMLString& data);
61
  ProcessingInstruction(Document* pOwnerDocument, const ProcessingInstruction& processingInstruction);
62
  ~ProcessingInstruction();
63
64
  Node* copyNode(bool deep, Document* pOwnerDocument) const;
65
66
private:
67
  XMLString _target;
68
  XMLString _data;
69
70
  friend class Document;
71
};
72
73
74
//
75
// inlines
76
//
77
inline const XMLString& ProcessingInstruction::target() const
78
0
{
79
0
  return _target;
80
0
}
81
82
83
inline const XMLString& ProcessingInstruction::data() const
84
0
{
85
0
  return _data;
86
0
}
87
88
89
inline const XMLString& ProcessingInstruction::getData() const
90
0
{
91
0
  return _data;
92
0
}
93
94
95
} // namespace Poco::XML
96
97
98
#endif // DOM_ProcessingInstruction_INCLUDED