PixelLightAPI  .
Public Member Functions
PLCore::XmlAttribute Class Reference

XML element attribute. More...

#include <XmlAttribute.h>

Inheritance diagram for PLCore::XmlAttribute:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLCORE_API XmlAttribute ()
 Default constructor.
virtual PLCORE_API ~XmlAttribute ()
 Destructor.
String GetName () const
 Return the name of this attribute.
void SetName (const String &sName)
 Set the name of this attribute.
String GetValue () const
 Return the value of this attribute.
int GetIntValue () const
 Return the value of this attribute, converted to an integer.
double GetDoubleValue () const
 Return the value of this attribute, converted to a double.
PLCORE_API EQueryResult QueryIntValue (int &nValue) const
 Examines the value string.
PLCORE_API EQueryResult QueryDoubleValue (double &dValue) const
 Examines the value string.
void SetValue (const String &sValue)
 Set the value.
void SetIntValue (int nValue)
 Set the value from an integer.
void SetDoubleValue (double dValue)
 Set the value from a double.
XmlAttributeGetNext ()
 Get the next sibling attribute in the DOM.
const XmlAttributeGetNext () const
XmlAttributeGetPrevious ()
 Get the previous sibling attribute in the DOM.
const XmlAttributeGetPrevious () const
bool operator== (const XmlAttribute &cOther) const
 Compare functions.
bool operator< (const XmlAttribute &cOther) const
bool operator> (const XmlAttribute &cOther) const
virtual PLCORE_API bool Save (File &cFile, uint32 nDepth=0) override
 Save function.
virtual PLCORE_API String ToString (uint32 nDepth=0) const override
 Output as string function.
virtual PLCORE_API const char * Parse (const char *pszData, XmlParsingData *pData=nullptr, EEncoding nEncoding=EncodingUnknown) override
 Parse the given null terminated block of XML data.

Detailed Description

XML element attribute.

Remarks:
An attribute is a name-value pair. Elements have an arbitrary number of attributes, each with a unique name.

Constructor & Destructor Documentation

Default constructor.

virtual PLCORE_API PLCore::XmlAttribute::~XmlAttribute ( ) [virtual]

Destructor.


Member Function Documentation

Return the name of this attribute.

Returns:
Name of this attribute
void PLCore::XmlAttribute::SetName ( const String sName) [inline]

Set the name of this attribute.

Parameters:
[in]sNameName of this attribute to set

Return the value of this attribute.

Returns:
Value of this attribute
int PLCore::XmlAttribute::GetIntValue ( ) const [inline]

Return the value of this attribute, converted to an integer.

Returns:
Value of this attribute, converted to an integer
double PLCore::XmlAttribute::GetDoubleValue ( ) const [inline]

Return the value of this attribute, converted to a double.

Returns:
Value of this attribute, converted to a double
PLCORE_API EQueryResult PLCore::XmlAttribute::QueryIntValue ( int &  nValue) const

Examines the value string.

Parameters:
[out]nValueWill receive the integer value if all went fine, if not, this variable is not touched
Returns:
If the attribute value is not an integer, it returns 'WrongType'. Returns 'Success' on success.
Remarks:
It is an alternative to the 'GetIntValue()'-function with richer error checking. If the value is an integer, it is stored in 'value' and the call returns 'Success'. If it is not an integer, it returns 'WrongType'. A specialized but useful call. Note that for success it returns 'Success', which is the opposite of almost all other parser calls.
PLCORE_API EQueryResult PLCore::XmlAttribute::QueryDoubleValue ( double &  dValue) const

Examines the value string.

Parameters:
[out]dValueWill receive the double value if all went fine, if not, this variable is not touched
Returns:
If the attribute value is not an integer, it returns 'WrongType'. Returns 'Success' on success.
See also:
void PLCore::XmlAttribute::SetValue ( const String sValue) [inline]

Set the value.

Parameters:
[in]sValueAttribute value to set
void PLCore::XmlAttribute::SetIntValue ( int  nValue) [inline]

Set the value from an integer.

Parameters:
[in]nValueAttribute integer value to set
void PLCore::XmlAttribute::SetDoubleValue ( double  dValue) [inline]

Set the value from a double.

Parameters:
[in]dValueAttribute double value to set

Get the next sibling attribute in the DOM.

Returns:
The next sibling attribute in the DOM, a null pointer at end
const XmlAttribute * PLCore::XmlAttribute::GetNext ( ) const [inline]

Get the previous sibling attribute in the DOM.

Returns:
The previous sibling attribute in the DOM, a null pointer at beginning
const XmlAttribute * PLCore::XmlAttribute::GetPrevious ( ) const [inline]
bool PLCore::XmlAttribute::operator== ( const XmlAttribute cOther) const [inline]

Compare functions.

Parameters:
[in]cOtherOther attribute to compare with
Returns:
'true' if the condition is fulfilled, else 'false'
bool PLCore::XmlAttribute::operator< ( const XmlAttribute cOther) const [inline]
bool PLCore::XmlAttribute::operator> ( const XmlAttribute cOther) const [inline]
virtual PLCORE_API bool PLCore::XmlAttribute::Save ( File cFile,
uint32  nDepth = 0 
) [override, virtual]

Save function.

Parameters:
[out]cFileFile to write in, must be opened and writable
[in]nDepthCurrent depth
Returns:
'true' if all went fine, else 'false'

Implements PLCore::XmlBase.

virtual PLCORE_API String PLCore::XmlAttribute::ToString ( uint32  nDepth = 0) const [override, virtual]

Output as string function.

Parameters:
[in]nDepthCurrent depth
Returns:
String containing the XML

Implements PLCore::XmlBase.

virtual PLCORE_API const char* PLCore::XmlAttribute::Parse ( const char *  pszData,
XmlParsingData pData = nullptr,
EEncoding  nEncoding = EncodingUnknown 
) [override, virtual]

Parse the given null terminated block of XML data.

Parameters:
[in]pszDataParsing data, if a null pointer, an error will be returned
[in]pDataParsing data, can be a null pointer
[in]nEncodingEncoding
Returns:
The pointer to the parameter 'pszData' if all went fine, else a null pointer
Remarks:
Passing in an encoding to this method (either 'EncodingLegacy' or 'EncodingUTF8' will force the parser to use that encoding, regardless of what the parser might otherwise try to detect.

Implements PLCore::XmlBase.


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:17
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported