PCL
|
Abstract base class of all XML document node classes. More...
#include <XML.h>
Public Types | |
using | node_type = XMLNodeType::mask_type |
Public Member Functions | |
XMLNode (const XMLNode &x) | |
XMLNode (node_type type) | |
~XMLNode () override | |
bool | IsChildNode () const |
bool | IsComment () const |
bool | IsElement () const |
bool | IsText () const |
const XMLNodeLocation & | Location () const |
virtual bool | NLAfter (const XMLNode &previous) const |
node_type | NodeType () const |
virtual void | Serialize (IsoString &text, bool autoFormat, char indentChar, unsigned indentSize, unsigned level) const =0 |
virtual void | SerializeAsHTML (IsoString &text, bool autoFormat, char indentChar, unsigned indentSize, unsigned level) const |
Public Member Functions inherited from pcl::XMLComponent | |
XMLComponent ()=default | |
XMLComponent (const XMLComponent &)=default | |
virtual | ~XMLComponent () |
bool | IsTopLevel () const |
XMLElement * | ParentElement () const |
XML document nodes can be elements, text, CDATA sections, processing instructions, comments, and unknown special elements. This class extends the XMLComponent root base class to implement XML document node classification and serialization.
using pcl::XMLNode::node_type = XMLNodeType::mask_type |
Represents the type of an XML document node. Supported/valid node types are defined in the XMLNodeType namespace.
|
inline |
|
inline |
|
inlineoverride |
|
inline |
|
inline |
Returns true iff this node represents an XML comment. If this member function returns true, this node can be statically casted to XMLComment.
|
inline |
Returns true iff this node is an XML element. If this member function returns true, this node can be statically casted to XMLElement.
Definition at line 566 of file XML.h.
Referenced by pcl::XMLDocument::RemoveElementsByFilter(), and pcl::XMLDocument::RemoveElementsByName().
|
inline |
|
inline |
|
virtual |
Returns true iff a new line character (#x0A) can be inserted before serializing this node after the specified previous node.
Reimplemented in pcl::XMLText.
|
inline |
Returns the type of this XML document node.
Definition at line 557 of file XML.h.
Referenced by pcl::XMLElement::AddChildNode().
|
pure virtual |
Serializes this document node as an XML fragment encoded in UTF-8.
text | Reference to an 8-bit string to which the UTF-8 encoded serialization of this node must be appended. |
autoFormat | True if line break characters (#x0A) and indentation strings must be used to improve readability of the generated XML code. False if no superfluous white space should be generated. |
indentChar | A character used for indentation of generated text lines, when autoFormat is true. This parameter should be either a white space (' ' or #x20) or a tabulator ('\t' or #x09) character. |
indentSize | Number of indentChar characters used for each indentation level, when autoFormat is true. |
level | Recursion level. A value greater than zero denotes that this function is being called from a parent XML element. The recursion level determines the number of indentChar characters prepended to each text line for indentation, when autoFormat is true. |
Implemented in pcl::XMLUnknownElement, pcl::XMLComment, pcl::XMLProcessingInstructions, pcl::XMLCDATA, pcl::XMLText, and pcl::XMLElement.
|
inlinevirtual |
Serializes this document node as an XML fragment encoded in UTF-8, following a set of rules and restrictions pertaining to HTML.
In particular, HTML restricts self-closing tags to a reduced subset of void elements. See section 13.1.2 of the HTML Living Standard for details:
https://html.spec.whatwg.org/multipage/syntax.html#void-elements
See Serialize() for complete information on function parameters.
Reimplemented in pcl::XMLElement.