PCL
pcl::XML Class Reference

Utility functions and data for XML document parsing and generation. More...

#include <XML.h>

Public Member Functions

 XML ()=delete
 
 XML (const XML &)=delete
 
 ~XML ()=delete
 
XMLoperator= (const XML &)=delete
 

Static Public Member Functions

static String CollapsedSpaces (String::const_iterator i, String::const_iterator j)
 
static String CollapsedSpaces (const String &text)
 
static String DecodedText (String::const_iterator i, String::const_iterator j)
 
static String DecodedText (const String &text)
 
static String EncodedText (String::const_iterator i, String::const_iterator j, bool apos=true)
 
static String EncodedText (const String &text, bool apos=true)
 
template<typename T >
static bool IsLineBreakChar (T c)
 
template<typename T >
static bool IsNameChar (T c)
 
template<typename T >
static bool IsNameStartChar (T c)
 
template<typename T >
static bool IsRestrictedChar (T c)
 
template<typename T >
static bool IsSpaceChar (T c)
 
static bool IsValidName (const String &name)
 
template<typename T >
static bool IsWhiteSpaceChar (T c)
 
static String ReferenceValue (String::const_iterator i, String::const_iterator j)
 
static String ReferenceValue (const String &reference)
 
static String TrimmedSpaces (String::const_iterator i, String::const_iterator j)
 
static String TrimmedSpaces (const String &text)
 

Detailed Description

Definition at line 84 of file XML.h.

Constructor & Destructor Documentation

◆ XML() [1/2]

pcl::XML::XML ( )
delete

Default constructor. This constructor is disabled because XML is not an instantiable class.

◆ XML() [2/2]

pcl::XML::XML ( const XML )
delete

Copy constructor. This constructor is disabled because XML is not an instantiable class.

◆ ~XML()

pcl::XML::~XML ( )
delete

Destructor. This destructor is disabled because XML is not an instantiable class.

Member Function Documentation

◆ CollapsedSpaces() [1/2]

static String pcl::XML::CollapsedSpaces ( String::const_iterator  i,
String::const_iterator  j 
)
static

Returns a copy of the text fragment defined by the range [i,j) of string iterators with all sequences of one or more space characters replaced with single white space characters (#x20).

Referenced by pcl::XMLText::SpaceTransformedText().

◆ CollapsedSpaces() [2/2]

static String pcl::XML::CollapsedSpaces ( const String text)
static

Returns a copy of the specified text with all sequences of one or more space characters replaced with single white space characters (#x20).

◆ DecodedText() [1/2]

static String pcl::XML::DecodedText ( String::const_iterator  i,
String::const_iterator  j 
)
static

Returns a copy of the text fragment defined by the range [i,j) of string iterators with all XML references replaced by their corresponding UTF-16 characters.

Both entity and character references are decoded by this function. For entity references, the entire set of XML reference names is supported:

http://www.w3.org/TR/xml-entity-names/

Character references are interpreted as defined in the XML specification:

https://www.w3.org/TR/xml11/#NT-CharRef

◆ DecodedText() [2/2]

static String pcl::XML::DecodedText ( const String text)
static

Returns a copy of the specified text with all XML references replaced by their corresponding UTF-16 characters.

See DecodedText( String::const_iterator, String::const_iterator ) for a detailed description.

◆ EncodedText() [1/2]

static String pcl::XML::EncodedText ( String::const_iterator  i,
String::const_iterator  j,
bool  apos = true 
)
inlinestatic

Returns a copy of the text fragment defined by the range [i,j) of string iterators with all occurences of '&', '<', '>' and '"' replaced with the entity references "amp", "lt", "gt" and "quot", respectively. If apos is true, single quotes will also be replaced with "apos" entities.

Definition at line 278 of file XML.h.

Referenced by pcl::XMLText::EncodedText(), and pcl::XMLAttribute::EncodedValue().

◆ EncodedText() [2/2]

static String pcl::XML::EncodedText ( const String text,
bool  apos = true 
)
static

Returns a copy of the specified text with all occurences of '&', '<', '>' and '"' replaced with the entity references "amp", "lt", "gt" and "quot", respectively. If apos is true, single quotes will also be replaced with "apos" entities.

◆ IsLineBreakChar()

template<typename T >
static bool pcl::XML::IsLineBreakChar ( c)
inlinestatic

Returns true iff the specified character c is either a line feed (#x0A) or a carriage return (#0D) control character.

Definition at line 127 of file XML.h.

◆ IsNameChar()

template<typename T >
static bool pcl::XML::IsNameChar ( c)
inlinestatic

Returns true iff the specified character c is an XML NameChar:

https://www.w3.org/TR/xml11/#NT-NameChar

Definition at line 175 of file XML.h.

◆ IsNameStartChar()

template<typename T >
static bool pcl::XML::IsNameStartChar ( c)
inlinestatic

Returns true iff the specified character c is an XML NameStartChar:

https://www.w3.org/TR/xml11/#NT-NameStartChar

Definition at line 149 of file XML.h.

◆ IsRestrictedChar()

template<typename T >
static bool pcl::XML::IsRestrictedChar ( c)
inlinestatic

Returns true iff the specified character c is an XML RestrictedChar:

https://www.w3.org/TR/xml11/#NT-RestrictedChar

Definition at line 192 of file XML.h.

◆ IsSpaceChar()

template<typename T >
static bool pcl::XML::IsSpaceChar ( c)
inlinestatic

Returns true iff the specified character c is an XML space character:

https://www.w3.org/TR/xml11/#NT-S

Definition at line 138 of file XML.h.

◆ IsValidName()

static bool pcl::XML::IsValidName ( const String name)
inlinestatic

Returns true iff the specified name is a valid XML qualified element or attribute name:

https://www.w3.org/TR/xml-names/#ns-qualnames

Definition at line 207 of file XML.h.

References pcl::GenericString< T, R, A >::Begin(), pcl::GenericString< T, R, A >::End(), and pcl::GenericString< T, R, A >::IsEmpty().

◆ IsWhiteSpaceChar()

template<typename T >
static bool pcl::XML::IsWhiteSpaceChar ( c)
inlinestatic

Returns true iff the specified character c is either a white space (#x20) or a tabulator (#9) character.

Definition at line 117 of file XML.h.

◆ operator=()

XML& pcl::XML::operator= ( const XML )
delete

Copy assignment. This operator is disabled because XML is not an instantiable class.

◆ ReferenceValue() [1/2]

static String pcl::XML::ReferenceValue ( String::const_iterator  i,
String::const_iterator  j 
)
static

Returns the Unicode value (encoded as UTF-16) corresponding to an XML reference defined by the range [i,j) of string iterators:

https://www.w3.org/TR/xml11/#NT-Reference

Both entity and character references are decoded by this function. For entity references, the entire set of XML reference names is supported:

http://www.w3.org/TR/xml-entity-names/

Character references are interpreted as defined in the XML specification:

https://www.w3.org/TR/xml11/#NT-CharRef

◆ ReferenceValue() [2/2]

static String pcl::XML::ReferenceValue ( const String reference)
inlinestatic

Returns the Unicode value (encoded as UTF-16) corresponding to the specified XML reference.

See ReferenceValue( String::const_iterator, String::const_iterator ) for a detailed description.

Definition at line 316 of file XML.h.

References pcl::GenericString< T, R, A >::Begin(), and pcl::GenericString< T, R, A >::End().

◆ TrimmedSpaces() [1/2]

static String pcl::XML::TrimmedSpaces ( String::const_iterator  i,
String::const_iterator  j 
)
static

Returns a copy of the text fragment defined by the range [i,j) of string iterators with all leading and trailing space characters removed.

Referenced by pcl::XMLText::SpaceTransformedText().

◆ TrimmedSpaces() [2/2]

static String pcl::XML::TrimmedSpaces ( const String text)
static

Returns a copy of the specified text with all leading and trailing space characters removed.


The documentation for this class was generated from the following file: