PCL
|
Dynamic list of XML element attributes. More...
#include <XML.h>
Public Types | |
using | const_iterator = list_implementation::const_iterator |
using | iterator = list_implementation::iterator |
using | list_implementation = Array< XMLAttribute > |
Public Member Functions | |
XMLAttributeList ()=default | |
XMLAttributeList (const String &text) | |
XMLAttributeList (const XMLAttributeList &)=default | |
String | AttributeValue (const String &name) const |
const_iterator | Begin () const |
const_iterator | begin () const |
void | Clear () |
const_iterator | End () const |
const_iterator | end () const |
bool | HasAttribute (const String &name) const |
bool | IsEmpty () const |
int | Length () const |
XMLAttributeList & | operator<< (const XMLAttribute &attribute) |
XMLAttributeList & | operator<< (const XMLAttributeList &list) |
const XMLAttribute & | operator[] (int i) const |
void | Parse (const String &text) |
void | RemoveAttribute (const String &name) |
void | Serialize (IsoString &text) const |
void | SetAttribute (const String &name, const String &value) |
void | SetAttribute (const XMLAttribute &attribute) |
void | SetAttributes (const XMLAttributeList &list) |
void | Sort () |
XMLAttributeList represents a sequence of XML element attributes in a start-tag, as defined in the W3C recommendation:
https://www.w3.org/TR/xml11/#sec-starttags
XMLAttributeList is internally implemented as a dynamic array of XMLAttribute objects.
|
inline |
Constructs a new XMLAttributeList object by parsing the specified text string.
The specified text must be a sequence of zero or more Attribute XML definitions pertaining to a start-tag:
https://www.w3.org/TR/xml11/#NT-STag
See the Parse() member function for a more detailed description.
|
default |
Default constructor. Constructs an empty XML attribute list.
|
default |
Copy constructor.
|
inline |
|
inline |
STL-compatible iteration. Equivalent to Begin() const.
|
inline |
|
inline |
|
inline |
STL-compatible iteration. Equivalent to End() const.
|
inline |
|
inline |
|
inline |
|
inline |
Insertion operator. Returns a reference to this object.
This operator is equivalent to SetAttribute( const XMLAttribute& ).
|
inline |
Insertion operator. Returns a reference to this object.
This operator is equivalent to SetAttributes( const XMLAttributeList& ).
|
inline |
void pcl::XMLAttributeList::Parse | ( | const String & | text | ) |
Parses the specified text, encoded as UTF-16, to generate a new list of XML element attributes.
The specified text must be a sequence of zero or more Attribute XML definitions pertaining to a start-tag, as described in the W3C recommendation:
https://www.w3.org/TR/xml11/#NT-STag
Attribute value normalization is applied to each parsed attribute:
https://www.w3.org/TR/xml11/#AVNormalize
In attribute values, all entity and character references are decoded. See the XML::DecodedText() static function for more information on reference decoding. Normalization also implies space trimming and compression: all leading and trailing space characters are removed, and all sequences of one or more space characters are replaced by single white space characters (#x20).
|
inline |
void pcl::XMLAttributeList::Serialize | ( | IsoString & | text | ) | const |
Performs the XML serialization of this element attribute list and appends it to the specified text string, encoded in UTF-8.
The generated serialization is a sequence of zero or more Attribute XML definitions pertaining to a start-tag, as described in the W3C recommendation:
Causes this list to contain an XML element attribute with the specified qualified name and value.
If an attribute with the same qualified name already exists in this list, then its value will be changed. Otherwise, a new attribute will be appended to this list.
This member function ensures that no XML element can have two or more attributes with the same qualified name. This constraint is part of the XML specification:
https://www.w3.org/TR/xml11/#sec-starttags https://www.w3.org/TR/xml-names/#scoping-defaulting
Definition at line 1004 of file XML.h.
References pcl::GenericString< T, R, A >::IsEmpty().
|
inline |
Causes this list to contain the specified XML element attribute.
See SetAttribute( const String&, const String& ) for more information.
Definition at line 1021 of file XML.h.
References pcl::GenericString< T, R, A >::IsEmpty(), and pcl::XMLAttribute::Name().
|
inline |
Causes this list to contain the specified list of XML element attributes.
For each attribute in the specified list, if an attribute with the same qualified name already exists in this list, then its value will be changed. Otherwise, a new attribute will be appended to this list.
This member function ensures that no XML element can have two or more attributes with the same qualified name. This constraint is part of the XML specification:
https://www.w3.org/TR/xml11/#sec-starttags https://www.w3.org/TR/xml-names/#scoping-defaulting
|
inline |