📄 documenttype.h
字号:
//
// DocumentType.h
//
// $Id: //poco/Main/XML/include/DOM/DocumentType.h#5 $
//
// Definition of the DOM DocumentType class.
//
// Copyright (c) 2004, Guenter Obiltschnig/Applied Informatics.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Redistributions in any form must be accompanied by information on
// how to obtain complete source code for this software and any
// accompanying software that uses this software. The source code
// must either be included in the distribution or be available for no
// more than the cost of distribution plus a nominal fee, and must be
// freely redistributable under reasonable conditions. For an
// executable file, complete source code means the source code for all
// modules it contains. It does not include source code for modules or
// files that typically accompany the major components of the operating
// system on which the executable file runs.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
#ifndef DOM_DocumentType_INCLUDED
#define DOM_DocumentType_INCLUDED
#ifndef XML_XML_INCLUDED
#include "XML/XML.h"
#endif
#ifndef DOM_AbstractContainerNode_INCLUDED
#include "DOM/AbstractContainerNode.h"
#endif
XML_BEGIN
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;
}
XML_END
#endif // DOM_DocumentType_INCLUDED
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -