File: DocumentType.h

package info (click to toggle)
poco 1.14.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 56,460 kB
  • sloc: cpp: 340,542; ansic: 245,601; makefile: 1,742; yacc: 1,005; sh: 698; sql: 312; lex: 282; xml: 128; perl: 29; python: 24
file content (125 lines) | stat: -rw-r--r-- 3,153 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//
// DocumentType.h
//
// Library: XML
// Package: DOM
// Module:  DOM
//
// Definition of the DOM DocumentType class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier:	BSL-1.0
//


#ifndef DOM_DocumentType_INCLUDED
#define DOM_DocumentType_INCLUDED


#include "Poco/XML/XML.h"
#include "Poco/DOM/AbstractContainerNode.h"


namespace Poco {
namespace XML {


class NamedNodeMap;


class XML_API DocumentType: public AbstractContainerNode
	/// Each Document has a doctype attribute whose value is either null or a DocumentType
	/// object. The DocumentType interface in the DOM Level 1 Core provides an
	/// interface to the list of entities that are defined for the document, and
	/// little else because the effect of namespaces and the various XML scheme
	/// efforts on DTD representation are not clearly understood as of this writing.
	///
	/// The DOM Level 1 doesn't support editing DocumentType nodes.
{
public:
	const XMLString& name() const;
		/// The name of the DTD; i.e., the name immediately following the
		/// DOCTYPE keyword.

	NamedNodeMap* entities() const;
		/// A NamedNodeMap containing the general entities,
		/// both external and internal, declared in the DTD.
		/// Duplicates are discarded.
		///
		/// Note: In this implementation, only the
		/// external entities are reported.
		/// Every node in this map also implements the
		/// Entity interface.
		///
		/// The returned NamedNodeMap must be released with a call
		/// to release() when no longer needed.

	NamedNodeMap* notations() const;
		/// A NamedNodeMap containing the notations declared in the DTD. Duplicates
		/// are discarded. Every node in this map also implements the Notation interface.
		/// The DOM Level 1 does not support editing notations, therefore notations
		/// cannot be altered in any way.
		///
		/// The returned NamedNodeMap must be released with a call
		/// to release() when no longer needed.

	// DOM Level 2
	const XMLString& publicId() const;
		/// Returns the public identifier of the external DTD subset.

	const XMLString& systemId() const;
		/// Returns the system identifier of the external DTD subset.

	const XMLString& internalSubset() const;
		/// Returns the internal DTD subset. This implementation
		/// returns an empty string.

	// Node
	const XMLString& nodeName() const;
	unsigned short nodeType() const;

protected:
	DocumentType(Document* pOwner, const XMLString& name, const XMLString& publicId, const XMLString& systemId);
	DocumentType(Document* pOwner, const DocumentType& dt);
	~DocumentType();

	Node* copyNode(bool deep, Document* pOwnerDocument) const;

private:
	XMLString _name;
	XMLString _publicId;
	XMLString _systemId;

	friend class DOMImplementation;
	friend class Document;
	friend class DOMBuilder;
};


//
// inlines
//
inline const XMLString& DocumentType::name() const
{
	return _name;
}


inline const XMLString& DocumentType::publicId() const
{
	return _publicId;
}


inline const XMLString& DocumentType::systemId() const
{
	return _systemId;
}


} } // namespace Poco::XML


#endif // DOM_DocumentType_INCLUDED