Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes

Detailed Description

Helper class to create XML files using "printf", "fprintf", "cout",...

functions. The ToXMLStringTool class helps you creating XML files using "printf", "fprintf", "cout",... functions. The "ToXMLStringTool" class is processing strings so that all the characters &,",',<,> are replaced by their XML equivalent:

&amp;, &quot;, &apos;, &lt;, &gt; 

Using the "ToXMLStringTool class" and the "fprintf function" is THE most efficient way to produce VERY large XML documents VERY fast.

Note
If you are creating from scratch an XML file using the provided XMLNode class you must not use the "ToXMLStringTool" class (because the "XMLNode" class does the processing job for you during rendering).

Definition at line 1011 of file xmlParser.h.

#include <utils/xmlparser/xmlParser.h>

Public Member Functions

 ToXMLStringTool ()
 
 ~ToXMLStringTool ()
 
void freeBuffer ()
 call this function when you have finished using this More...
 
XMLSTR toXML (XMLCSTR source)
 object to release memory used by the internal buffer. More...
 

Static Public Member Functions

static XMLSTR toXMLUnSafe (XMLSTR dest, XMLCSTR source)
 that contains a XML-encoded string based on the "source" parameter. More...
 
static int lengthXMLString (XMLCSTR source)
 deprecated: use "toXML" instead More...
 

Private Attributes

XMLSTR buf
 
int buflen
 

Constructor & Destructor Documentation

◆ ToXMLStringTool()

ToXMLStringTool::ToXMLStringTool ( )
inline

Definition at line 1014 of file xmlParser.h.

◆ ~ToXMLStringTool()

ToXMLStringTool::~ToXMLStringTool ( )

Definition at line 951 of file xmlParser.cpp.

References freeBuffer().

Here is the call graph for this function:

Member Function Documentation

◆ freeBuffer()

void ToXMLStringTool::freeBuffer ( )

call this function when you have finished using this

Definition at line 952 of file xmlParser.cpp.

References buf, and buflen.

Referenced by ~ToXMLStringTool().

Here is the caller graph for this function:

◆ lengthXMLString()

int ToXMLStringTool::lengthXMLString ( XMLCSTR  source)
static

deprecated: use "toXML" instead

Definition at line 920 of file xmlParser.cpp.

References XMLCharacterEntity::c, XMLCharacterEntity::l, XMLCharacterEntity::s, XML_ByteTable, XMLCHAR, and XMLEntities.

Referenced by XMLNode::CreateXMLStringR(), and toXML().

Here is the caller graph for this function:

◆ toXML()

XMLSTR ToXMLStringTool::toXML ( XMLCSTR  source)

object to release memory used by the internal buffer.

returns a pointer to an internal buffer

Definition at line 958 of file xmlParser.cpp.

References buf, buflen, lengthXMLString(), toXMLUnSafe(), XMLCHAR, and XMLSTR.

Here is the call graph for this function:

◆ toXMLUnSafe()

XMLSTR ToXMLStringTool::toXMLUnSafe ( XMLSTR  dest,
XMLCSTR  source 
)
static

that contains a XML-encoded string based on the "source" parameter.

The "toXMLUnSafe" function is deprecated because there is a possibility of "destination-buffer-overflow". It converts the string "source" to the string "dest". deprecated: use "toXML" instead

Definition at line 875 of file xmlParser.cpp.

References XMLCharacterEntity::c, XMLCharacterEntity::l, XMLCharacterEntity::s, XML_ByteTable, XMLCHAR, XMLEntities, XMLSTR, and xstrcpy().

Referenced by XMLNode::CreateXMLStringR(), and toXML().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ buf

XMLSTR ToXMLStringTool::buf
private

Definition at line 1033 of file xmlParser.h.

Referenced by freeBuffer(), and toXML().

◆ buflen

int ToXMLStringTool::buflen
private

Definition at line 1034 of file xmlParser.h.

Referenced by freeBuffer(), and toXML().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019