29#ifndef Pt_Xml_Entity_h
30#define Pt_Xml_Entity_h
32#include <Pt/Xml/Api.h>
33#include <Pt/Xml/Node.h>
34#include <Pt/NonCopyable.h>
62 {
return ! _publicId.empty() || ! _systemId.empty(); }
67 {
return _publicId.empty() && _systemId.empty(); }
92 { _publicId = pubId; }
102 { _systemId = sysId; }
178 { _entity = entity; }
181 inline static Node::Type nodeId()
182 {
return Node::EntityReference; }
186 const Entity* _entity;
195 return nodeCast<EntityReference>(node);
204 return nodeCast<EntityReference>(node);
213 return nodeCast<EntityReference>(node);
222 return nodeCast<EntityReference>(node);
227bool resolveDefaultEntity(
String& entity);
231bool resolveCharacterEntity(
String& entity);
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Unicode capable basic_string.
Definition Api-String.h:67
const EntityReference * toEntityReference(const Node *node)
Casts a generic node to an EntityReference node.
Definition Entity.h:202
EntityReference & toEntityReference(Node &node)
Casts a generic node to an EntityReference node.
Definition Entity.h:211
void setEntity(const Entity *entity)
Sets the entity this reference refers to.
Definition Entity.h:177
void setName(const Pt::String &name)
Sets the name of the entity this reference refers to.
Definition Entity.h:167
EntityReference()
Creates an EntityReference object.
Definition Entity.h:142
const EntityReference & toEntityReference(const Node &node)
Casts a generic node to an EntityReference node.
Definition Entity.h:220
const Pt::String & name() const
Returns the name of the entity this reference refers to.
Definition Entity.h:157
Pt::String & name()
Returns the name of the entity this reference refers to.
Definition Entity.h:162
EntityReference * toEntityReference(Node *node)
Casts a generic node to an EntityReference node.
Definition Entity.h:193
void clear()
Clears all content.
Definition Entity.h:149
const Entity * get() const
Returns the entity this reference refers to or a nullptr.
Definition Entity.h:172
An entity declaration in a DTD.
Definition Entity.h:45
const Pt::String & systemId() const
Returns the system ID of the entity.
Definition Entity.h:96
bool isExternal() const
Returns true if the entity in external.
Definition Entity.h:61
void setUnparsed(const Pt::String ¬ation)
Sets the notation of an unparsed entity (NDATA).
Definition Entity.h:111
const Pt::String & value() const
Returns the value of the entity.
Definition Entity.h:71
void setSystemId(const Pt::String &sysId)
Sets the system ID of the entity.
Definition Entity.h:101
Entity(const Pt::String &name)
Constructs with entity name.
Definition Entity.h:49
bool isUnparsed() const
Indicates if the entity is unparsed (NDATA).
Definition Entity.h:106
const Pt::String & notationName() const
Returns the name of the notation.
Definition Entity.h:119
void setValue(const Pt::String &val)
Sets the value of the entity.
Definition Entity.h:81
const Pt::String & publicId() const
Returns the public ID of the entity.
Definition Entity.h:86
const Pt::String & name() const
Returns the name of the entity.
Definition Entity.h:56
void setPublicId(const Pt::String &pubId)
Sets the public ID of the entity.
Definition Entity.h:91
Pt::String & value()
Returns the value of the entity.
Definition Entity.h:76
bool isInternal() const
Returns true if the entity in internal.
Definition Entity.h:66
Node(Type type)
Constructs a new Node object with the specified node type.
Definition Node.h:80
Read and write XML ducuments.
Core module.
Definition Allocator.h:33