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>
35 #include <Pt/String.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);
227 bool resolveDefaultEntity(
String& entity);
231 bool resolveCharacterEntity(
String& entity);
237 #endif // Pt_Xml_Entity_h
bool isUnparsed() const
Indicates if the entity is unparsed (NDATA).
Definition: Entity.h:106
const Pt::String & name() const
Returns the name of the entity this reference refers to.
Definition: Entity.h:157
void setName(const Pt::String &name)
Sets the name of the entity this reference refers to.
Definition: Entity.h:167
Entity(const Pt::String &name)
Constructs with entity name.
Definition: Entity.h:49
EntityReference & toEntityReference(Node &node)
Casts a generic node to an EntityReference node.
Definition: Entity.h:211
Protects derived classes from being copied.
Definition: NonCopyable.h:54
void setUnparsed(const Pt::String ¬ation)
Sets the notation of an unparsed entity (NDATA).
Definition: Entity.h:111
EntityReference * toEntityReference(Node *node)
Casts a generic node to an EntityReference node.
Definition: Entity.h:193
Pt::String & value()
Returns the value of the entity.
Definition: Entity.h:76
void setPublicId(const Pt::String &pubId)
Sets the public ID of the entity.
Definition: Entity.h:91
void clear()
Clears the string.
Definition: String.h:367
bool empty() const
Returns true if empty.
Definition: String.h:244
void setEntity(const Entity *entity)
Sets the entity this reference refers to.
Definition: Entity.h:177
const Pt::String & name() const
Returns the name of the entity.
Definition: Entity.h:56
const EntityReference * toEntityReference(const Node *node)
Casts a generic node to an EntityReference node.
Definition: Entity.h:202
const EntityReference & toEntityReference(const Node &node)
Casts a generic node to an EntityReference node.
Definition: Entity.h:220
An entity reference XML node.
Definition: Entity.h:136
const Pt::String & publicId() const
Returns the public ID of the entity.
Definition: Entity.h:86
EntityReference()
Creates an EntityReference object.
Definition: Entity.h:142
Pt::String & name()
Returns the name of the entity this reference refers to.
Definition: Entity.h:162
void setSystemId(const Pt::String &sysId)
Sets the system ID of the entity.
Definition: Entity.h:101
An entity declaration in a DTD.
Definition: Entity.h:44
Unicode capable basic_string.
Definition: String.h:42
const Pt::String & systemId() const
Returns the system ID of the entity.
Definition: Entity.h:96
void clear()
Clears all content.
Definition: Entity.h:149
const Pt::String & notationName() const
Returns the name of the notation.
Definition: Entity.h:119
XML document node.
Definition: Node.h:50
bool isExternal() const
Returns true if the entity in external.
Definition: Entity.h:61
bool isInternal() const
Returns true if the entity in internal.
Definition: Entity.h:66
const Pt::String & value() const
Returns the value of the entity.
Definition: Entity.h:71
void setValue(const Pt::String &val)
Sets the value of the entity.
Definition: Entity.h:81