#include <XMLDocType.h>
XML document type.
Represents tag <DOCTYPE ...> in XML document. It can return a map of all entities(). Provides the name(), public_id() and system_id() functions.
◆ XMLDocType() [1/2]
sptk::xdoc::XMLDocType::XMLDocType |
( |
| ) |
|
|
default |
◆ XMLDocType() [2/2]
sptk::xdoc::XMLDocType::XMLDocType |
( |
const char * |
name, |
|
|
const char * |
public_id = nullptr , |
|
|
const char * |
system_id = nullptr |
|
) |
| |
|
explicit |
◆ decodeEntities()
void sptk::xdoc::XMLDocType::decodeEntities |
( |
const char * |
str, |
|
|
size_t |
sz, |
|
|
Buffer & |
ret |
|
) |
| |
Decodes entities in string to their actual values.
Converts "<test>" to "<test>"
- Parameters
-
str | Text to convert |
sz | Text length |
ret | Converted text is stored here |
◆ encodeEntities()
bool sptk::xdoc::XMLDocType::encodeEntities |
( |
const char * |
str, |
|
|
Buffer & |
ret |
|
) |
| |
Encodes string to XML representation.
Converts "<test>" to "<test>"
- Returns
- true, any entities replaced.
- Parameters
-
str | String to convert |
ret | Converted text is stored here |
◆ entities() [1/2]
Entities & sptk::xdoc::XMLDocType::entities |
( |
| ) |
|
|
inline |
Returns a map of all entities described in the DTD
NOTE: Map doesn't hold default entities.
◆ entities() [2/2]
const Entities & sptk::xdoc::XMLDocType::entities |
( |
| ) |
const |
|
inline |
Returns a map of all entities described in the DTD
NOTE: Map doesn't hold default entities.
◆ getReplacement()
const char * sptk::xdoc::XMLDocType::getReplacement |
( |
const char * |
name, |
|
|
uint32_t & |
replacementLength |
|
) |
| |
Returnes replacement value for named entity.
If entity is not found, empty string is returned.
- Parameters
-
name | Entity name |
replacementLength | Length of the replacement |
◆ name()
const String & sptk::xdoc::XMLDocType::name |
( |
| ) |
const |
|
inline |
Returns the name of the document type as specified in the <!DOCTYPE name> tag
◆ publicID()
const String & sptk::xdoc::XMLDocType::publicID |
( |
| ) |
const |
|
inline |
Returns the public identifier of the external DTD subset
Returns empty string if there is no public identifier
◆ removeEntity()
void sptk::xdoc::XMLDocType::removeEntity |
( |
const char * |
name | ) |
|
|
inline |
Removes named entity from entity map
- Parameters
-
◆ setEntity()
void sptk::xdoc::XMLDocType::setEntity |
( |
const String & |
name, |
|
|
const String & |
replacement |
|
) |
| |
|
inline |
Adds an entity to the map
If entity named 'name' exists already in map, its value is replaced with 'replacement'
- Parameters
-
name | Entity to add/change |
replacement | Value that represents entity |
◆ systemID()
const String & sptk::xdoc::XMLDocType::systemID |
( |
| ) |
const |
|
inline |
Returns the system identifier of the external DTD subset.
Returns empty string if there is no system identifier
The documentation for this class was generated from the following file: