soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SXmlNode Class Reference

Class representing an XML node. More...

#include <SXml.h>

Inheritance diagram for SXmlNode:
IXmlNode

Public Member Functions

 SXmlNode (pugi::xml_node node)
 Constructor for SXmlNode.
 
 SXmlNode (const IXmlNode *src)
 Constructor for SXmlNode from an IXmlNode pointer.
 
 SXmlNode (const SXmlNode &src)
 Copy constructor for SXmlNode.
 
 SXmlNode (LPVOID pData=NULL)
 Constructor for SXmlNode with an optional private data pointer.
 
void ToString (IStringW *out) SCONST OVERRIDE
 Converts the node to a string representation.
 
LPVOID GetPrivPtr () SCONST OVERRIDE
 Gets the private data pointer.
 
BOOL Empty () SCONST OVERRIDE
 Checks if the node is empty.
 
const wchar_t * Name () SCONST OVERRIDE
 Gets the node name.
 
const wchar_t * Value () SCONST OVERRIDE
 Gets the node value.
 
const wchar_t * Text () SCONST OVERRIDE
 Gets the node text.
 
BOOL set_userdata (int data) OVERRIDE
 Sets user data for the node.
 
int get_userdata () SCONST OVERRIDE
 Gets user data for the node.
 
IXmlAttrAttribute (const wchar_t *name, BOOL bCaseSensitive) SCONST OVERRIDE
 Gets an attribute by name.
 
IXmlAttrFirstAttribute () SCONST OVERRIDE
 Gets the first attribute in the attribute list.
 
IXmlAttrLastAttribute () SCONST OVERRIDE
 Gets the last attribute in the attribute list.
 
IXmlNodeChild (const wchar_t *name, BOOL bCaseSensitive) SCONST OVERRIDE
 Gets a child node by name.
 
IXmlNodeFirstChild () SCONST OVERRIDE
 Gets the first child node.
 
IXmlNodeLastChild () SCONST OVERRIDE
 Gets the last child node.
 
IXmlNodeNextSibling () SCONST OVERRIDE
 Gets the next sibling node.
 
IXmlNodePrevSibling () SCONST OVERRIDE
 Gets the previous sibling node.
 
IXmlNodeNextSibling2 (const wchar_t *name, BOOL bCaseSensitive) SCONST OVERRIDE
 Gets the next sibling node by name.
 
IXmlNodePrevSibling2 (const wchar_t *name, BOOL bCaseSensitive) SCONST OVERRIDE
 Gets the previous sibling node by name.
 
IXmlNodeAppendChild (const wchar_t *name) OVERRIDE
 Appends a child node with the specified name.
 
IXmlNodePrependChild (const wchar_t *name) OVERRIDE
 Prepends a child node with the specified name.
 
IXmlNodeAppendCopyNode (const IXmlNode *proto) OVERRIDE
 Appends a copy of the specified node as a child.
 
IXmlNodePrependCopyNode (const IXmlNode *proto) OVERRIDE
 Prepends a copy of the specified node as a child.
 
IXmlAttrAppendAttribute (const wchar_t *name) OVERRIDE
 Appends an attribute with the specified name.
 
IXmlAttrPrependAttribute (const wchar_t *name) OVERRIDE
 Prepends an attribute with the specified name.
 
IXmlAttrAppendCopyAttribute (const IXmlAttr *proto) OVERRIDE
 Appends a copy of the specified attribute to the node.
 
IXmlAttrPrependCopyAttribute (const IXmlAttr *proto) OVERRIDE
 Prepends a copy of the specified attribute to the node.
 
BOOL RemoveAttribute (const wchar_t *name) OVERRIDE
 Removes an attribute by name.
 
BOOL RemoveChild (const wchar_t *name) OVERRIDE
 Removes the child node with the specified name.
 
BOOL RemoveAllChilden () OVERRIDE
 Removes all child nodes from the node.
 
bool operator== (const SXmlNode &src) const
 Checks if two SXmlNode objects are equal.
 
bool operator!= (const SXmlNode &src) const
 Checks if two SXmlNode objects are not equal.
 
 operator bool () const
 Checks if the node is empty.
 
bool empty () const
 Checks if the node is empty.
 
XmlNodeType type () const
 Gets the type of the node.
 
const wchar_t * name () const
 Gets the name of the node.
 
const wchar_t * value () const
 Gets the value of the node.
 
SXmlAttr first_attribute () const
 Gets the first attribute of the node.
 
SXmlAttr last_attribute () const
 Gets the last attribute of the node.
 
SXmlNode first_child () const
 Gets the first child node of the node.
 
SXmlNode last_child () const
 Gets the last child node of the node.
 
SXmlNode next_sibling () const
 Gets the next sibling node in the children list of the parent node.
 
SXmlNode previous_sibling () const
 Gets the previous sibling node in the children list of the parent node.
 
SXmlNode parent () const
 Gets the parent node of the node.
 
SXmlNode root () const
 Gets the root node of the DOM tree this node belongs to.
 
SXmlNode child (const wchar_t *name, bool bCaseSensitive=false) const
 Gets the child node, attribute, or next/previous sibling with the specified name.
 
SXmlAttr attribute (const wchar_t *name, bool bCaseSensitive=false) const
 Gets the attribute with the specified name.
 
SXmlNode next_sibling (const wchar_t *name, bool bCaseSensitive=false) const
 Gets the next sibling node with the specified name.
 
SXmlNode previous_sibling (const wchar_t *name, bool bCaseSensitive=false) const
 Gets the previous sibling node with the specified name.
 
SXmlAttr attribute (const wchar_t *name, SXmlAttr &hint, bool bCaseSensitive=false) const
 Gets the attribute with the specified name, starting the search from a hint.
 
const wchar_t * child_value () const
 Gets the child value of the current node.
 
const wchar_t * child_value (const wchar_t *name, bool bCaseSensitive=false) const
 Gets the child value of the child node with the specified name.
 
bool set_name (const wchar_t *rhs)
 Sets the name of the node.
 
bool set_value (const wchar_t *rhs)
 Sets the value of the node.
 
SXmlAttr append_attribute (const wchar_t *name)
 Adds an attribute with the specified name.
 
SXmlAttr prepend_attribute (const wchar_t *name)
 Prepends an attribute with the specified name.
 
SXmlAttr insert_attribute_after (const wchar_t *name, const SXmlAttr &attr)
 Inserts an attribute with the specified name after the specified attribute.
 
SXmlAttr insert_attribute_before (const wchar_t *name, const SXmlAttr &attr)
 Inserts an attribute with the specified name before the specified attribute.
 
SXmlAttr append_copy (const SXmlAttr &proto)
 Adds a copy of the specified attribute.
 
SXmlAttr prepend_copy (const SXmlAttr &proto)
 Prepends a copy of the specified attribute.
 
SXmlAttr insert_copy_after (const SXmlAttr &proto, const SXmlAttr &attr)
 Inserts a copy of the specified attribute after the specified attribute.
 
SXmlAttr insert_copy_before (const SXmlAttr &proto, const SXmlAttr &attr)
 Inserts a copy of the specified attribute before the specified attribute.
 
SXmlNode append_child (XmlNodeType type=node_element)
 Adds a child node with the specified type.
 
SXmlNode prepend_child (XmlNodeType type=node_element)
 Prepends a child node with the specified type.
 
SXmlNode insert_child_after (XmlNodeType type, const SXmlNode &node)
 Inserts a child node with the specified type after the specified node.
 
SXmlNode insert_child_before (XmlNodeType type, const SXmlNode &node)
 Inserts a child node with the specified type before the specified node.
 
SXmlNode append_child (const wchar_t *name)
 Adds a child element with the specified name.
 
SXmlNode prepend_child (const wchar_t *name)
 Prepends a child element with the specified name.
 
SXmlNode insert_child_after (const wchar_t *name, const SXmlNode &node)
 Inserts a child element with the specified name after the specified node.
 
SXmlNode insert_child_before (const wchar_t *name, const SXmlNode &node)
 Inserts a child element with the specified name before the specified node.
 
SXmlNode append_copy (const SXmlNode &proto)
 Adds a copy of the specified node as a child.
 
SXmlNode prepend_copy (const SXmlNode &proto)
 Prepends a copy of the specified node as a child.
 
SXmlNode insert_copy_after (const SXmlNode &proto, const SXmlNode &node)
 Inserts a copy of the specified node as a child after the specified node.
 
SXmlNode insert_copy_before (const SXmlNode &proto, const SXmlNode &node)
 Inserts a copy of the specified node as a child before the specified node.
 
SXmlNode append_move (const SXmlNode &moved)
 Moves the specified node to become a child of this node.
 
SXmlNode prepend_move (const SXmlNode &moved)
 Prepends the specified node to become a child of this node.
 
SXmlNode insert_move_after (const SXmlNode &moved, const SXmlNode &node)
 Inserts the specified node to become a child of this node after the specified node.
 
SXmlNode insert_move_before (const SXmlNode &moved, const SXmlNode &node)
 Inserts the specified node to become a child of this node before the specified node.
 
bool remove_attribute (const SXmlAttr &a)
 Removes the specified attribute.
 
bool remove_attribute (const wchar_t *name)
 Removes the attribute with the specified name.
 
bool remove_attributes ()
 Removes all attributes from the node.
 
bool remove_child (const SXmlNode &n)
 Removes the specified child node.
 
bool remove_child (const wchar_t *name)
 Removes the child node with the specified name.
 
bool remove_children ()
 Removes all child nodes from the node.
 

Friends

class SXmlDoc
 

Detailed Description

Class representing an XML node.

This class provides methods to manipulate and access XML nodes.

Definition at line 351 of file SXml.h.

Constructor & Destructor Documentation

◆ SXmlNode() [1/4]

SXmlNode::SXmlNode ( pugi::xml_node node)

Constructor for SXmlNode.

Parameters
nodeThe pugi::xml_node to initialize with.

Definition at line 227 of file SXml.cpp.

◆ SXmlNode() [2/4]

SXmlNode::SXmlNode ( const IXmlNode * src)

Constructor for SXmlNode from an IXmlNode pointer.

Parameters
srcThe IXmlNode pointer to initialize with.

Definition at line 222 of file SXml.cpp.

◆ SXmlNode() [3/4]

SXmlNode::SXmlNode ( const SXmlNode & src)

Copy constructor for SXmlNode.

Parameters
srcThe SXmlNode to copy.

Definition at line 232 of file SXml.cpp.

◆ SXmlNode() [4/4]

SXmlNode::SXmlNode ( LPVOID pData = NULL)
explicit

Constructor for SXmlNode with an optional private data pointer.

Parameters
pDataPointer to private data.

Definition at line 217 of file SXml.cpp.

Member Function Documentation

◆ append_attribute()

SXmlAttr SXmlNode::append_attribute ( const wchar_t * name)

Adds an attribute with the specified name.

Parameters
nameThe name of the attribute to be added.
Returns
The added attribute, or an empty attribute on errors.

Definition at line 458 of file SXml.cpp.

◆ append_child() [1/2]

SXmlNode SXmlNode::append_child ( const wchar_t * name)

Adds a child element with the specified name.

Parameters
nameThe name of the child element to be added.
Returns
The added node, or an empty node on errors.

Definition at line 523 of file SXml.cpp.

◆ append_child() [2/2]

SXmlNode SXmlNode::append_child ( XmlNodeType type = node_element)

Adds a child node with the specified type.

Parameters
typeThe type of the child node to be added.
Returns
The added node, or an empty node on errors.

Definition at line 518 of file SXml.cpp.

◆ append_copy() [1/2]

SXmlAttr SXmlNode::append_copy ( const SXmlAttr & proto)

Adds a copy of the specified attribute.

Parameters
protoThe attribute to be copied.
Returns
The added attribute, or an empty attribute on errors.

Definition at line 478 of file SXml.cpp.

◆ append_copy() [2/2]

SXmlNode SXmlNode::append_copy ( const SXmlNode & proto)

Adds a copy of the specified node as a child.

Parameters
protoThe node to be copied.
Returns
The added node, or an empty node on errors.

Definition at line 483 of file SXml.cpp.

◆ append_move()

SXmlNode SXmlNode::append_move ( const SXmlNode & moved)

Moves the specified node to become a child of this node.

Parameters
movedThe node to be moved.
Returns
The moved node, or an empty node on errors.

Definition at line 558 of file SXml.cpp.

◆ AppendAttribute()

IXmlAttr * SXmlNode::AppendAttribute ( const wchar_t * name)
inline

Appends an attribute with the specified name.

Parameters
nameAttribute name.
Returns
Pointer to the appended attribute.

Implements IXmlNode.

Definition at line 578 of file SXml.h.

◆ AppendChild()

IXmlNode * SXmlNode::AppendChild ( const wchar_t * name)
inline

Appends a child node with the specified name.

Parameters
nameChild node name.
Returns
Pointer to the appended child node.

Implements IXmlNode.

Definition at line 538 of file SXml.h.

◆ AppendCopyAttribute()

IXmlAttr * SXmlNode::AppendCopyAttribute ( const IXmlAttr * proto)
inline

Appends a copy of the specified attribute to the node.

Parameters
protoThe attribute to be copied.
Returns
A pointer to the newly added attribute, or an empty attribute on errors.

Implements IXmlNode.

Definition at line 595 of file SXml.h.

◆ AppendCopyNode()

IXmlNode * SXmlNode::AppendCopyNode ( const IXmlNode * proto)
inline

Appends a copy of the specified node as a child.

Parameters
protoNode to copy.
Returns
Pointer to the appended child node.

Implements IXmlNode.

Definition at line 558 of file SXml.h.

◆ Attribute()

IXmlAttr * SXmlNode::Attribute ( const wchar_t * name,
BOOL bCaseSensitive )

Gets an attribute by name.

Parameters
nameAttribute name.
bCaseSensitiveFlag indicating case sensitivity.
Returns
Pointer to the attribute.

Implements IXmlNode.

Definition at line 280 of file SXml.cpp.

◆ attribute() [1/2]

SXmlAttr SXmlNode::attribute ( const wchar_t * name,
bool bCaseSensitive = false ) const

Gets the attribute with the specified name.

Parameters
nameThe name of the attribute.
bCaseSensitiveWhether the search should be case-sensitive.
Returns
The requested attribute.

Definition at line 428 of file SXml.cpp.

◆ attribute() [2/2]

SXmlAttr SXmlNode::attribute ( const wchar_t * name,
SXmlAttr & hint,
bool bCaseSensitive = false ) const

Gets the attribute with the specified name, starting the search from a hint.

Parameters
nameThe name of the attribute.
hintThe hint attribute to start the search from.
bCaseSensitiveWhether the search should be case-sensitive.
Returns
The requested attribute.

Definition at line 433 of file SXml.cpp.

◆ Child()

IXmlNode * SXmlNode::Child ( const wchar_t * name,
BOOL bCaseSensitive )

Gets a child node by name.

Parameters
nameChild node name.
bCaseSensitiveFlag indicating case sensitivity.
Returns
Pointer to the child node.

Implements IXmlNode.

Definition at line 298 of file SXml.cpp.

◆ child()

SXmlNode SXmlNode::child ( const wchar_t * name,
bool bCaseSensitive = false ) const

Gets the child node, attribute, or next/previous sibling with the specified name.

Parameters
nameThe name of the child node, attribute, or sibling.
bCaseSensitiveWhether the search should be case-sensitive.
Returns
The requested node or attribute.

Definition at line 423 of file SXml.cpp.

◆ child_value() [1/2]

const wchar_t * SXmlNode::child_value ( ) const

Gets the child value of the current node.

Returns
The value of the first child node of type PCDATA/CDATA.

Definition at line 438 of file SXml.cpp.

◆ child_value() [2/2]

const wchar_t * SXmlNode::child_value ( const wchar_t * name,
bool bCaseSensitive = false ) const

Gets the child value of the child node with the specified name.

Parameters
nameThe name of the child node.
bCaseSensitiveWhether the search should be case-sensitive.
Returns
The value of the child node.

Definition at line 443 of file SXml.cpp.

◆ Empty()

BOOL SXmlNode::Empty ( )

Checks if the node is empty.

Returns
TRUE if the node is empty, FALSE otherwise.

Implements IXmlNode.

Definition at line 250 of file SXml.cpp.

◆ empty()

bool SXmlNode::empty ( ) const

Checks if the node is empty.

Returns
TRUE if the node is empty, FALSE otherwise.

Definition at line 353 of file SXml.cpp.

◆ first_attribute()

SXmlAttr SXmlNode::first_attribute ( ) const

Gets the first attribute of the node.

Returns
The first attribute of the node.

Definition at line 373 of file SXml.cpp.

◆ first_child()

SXmlNode SXmlNode::first_child ( ) const

Gets the first child node of the node.

Returns
The first child node of the node.

Definition at line 383 of file SXml.cpp.

◆ FirstAttribute()

IXmlAttr * SXmlNode::FirstAttribute ( )

Gets the first attribute in the attribute list.

Returns
Pointer to the first attribute.

Implements IXmlNode.

Definition at line 286 of file SXml.cpp.

◆ FirstChild()

IXmlNode * SXmlNode::FirstChild ( )

Gets the first child node.

Returns
Pointer to the first child node.

Implements IXmlNode.

Definition at line 304 of file SXml.cpp.

◆ get_userdata()

int SXmlNode::get_userdata ( )

Gets user data for the node.

Returns
User data.

Implements IXmlNode.

Definition at line 275 of file SXml.cpp.

◆ GetPrivPtr()

LPVOID SXmlNode::GetPrivPtr ( )

Gets the private data pointer.

Returns
Pointer to the private data.

Implements IXmlNode.

Definition at line 245 of file SXml.cpp.

◆ insert_attribute_after()

SXmlAttr SXmlNode::insert_attribute_after ( const wchar_t * name,
const SXmlAttr & attr )

Inserts an attribute with the specified name after the specified attribute.

Parameters
nameThe name of the attribute to be inserted.
attrThe attribute after which the new attribute should be inserted.
Returns
The inserted attribute, or an empty attribute on errors.

Definition at line 468 of file SXml.cpp.

◆ insert_attribute_before()

SXmlAttr SXmlNode::insert_attribute_before ( const wchar_t * name,
const SXmlAttr & attr )

Inserts an attribute with the specified name before the specified attribute.

Parameters
nameThe name of the attribute to be inserted.
attrThe attribute before which the new attribute should be inserted.
Returns
The inserted attribute, or an empty attribute on errors.

Definition at line 473 of file SXml.cpp.

◆ insert_child_after() [1/2]

SXmlNode SXmlNode::insert_child_after ( const wchar_t * name,
const SXmlNode & node )

Inserts a child element with the specified name after the specified node.

Parameters
nameThe name of the child element to be inserted.
nodeThe node after which the new child element should be inserted.
Returns
The inserted node, or an empty node on errors.

Definition at line 543 of file SXml.cpp.

◆ insert_child_after() [2/2]

SXmlNode SXmlNode::insert_child_after ( XmlNodeType type,
const SXmlNode & node )

Inserts a child node with the specified type after the specified node.

Parameters
typeThe type of the child node to be inserted.
nodeThe node after which the new child node should be inserted.
Returns
The inserted node, or an empty node on errors.

Definition at line 538 of file SXml.cpp.

◆ insert_child_before() [1/2]

SXmlNode SXmlNode::insert_child_before ( const wchar_t * name,
const SXmlNode & node )

Inserts a child element with the specified name before the specified node.

Parameters
nameThe name of the child element to be inserted.
nodeThe node before which the new child element should be inserted.
Returns
The inserted node, or an empty node on errors.

Definition at line 553 of file SXml.cpp.

◆ insert_child_before() [2/2]

SXmlNode SXmlNode::insert_child_before ( XmlNodeType type,
const SXmlNode & node )

Inserts a child node with the specified type before the specified node.

Parameters
typeThe type of the child node to be inserted.
nodeThe node before which the new child node should be inserted.
Returns
The inserted node, or an empty node on errors.

Definition at line 548 of file SXml.cpp.

◆ insert_copy_after() [1/2]

SXmlAttr SXmlNode::insert_copy_after ( const SXmlAttr & proto,
const SXmlAttr & attr )

Inserts a copy of the specified attribute after the specified attribute.

Parameters
protoThe attribute to be copied.
attrThe attribute after which the new attribute should be inserted.
Returns
The inserted attribute, or an empty attribute on errors.

Definition at line 498 of file SXml.cpp.

◆ insert_copy_after() [2/2]

SXmlNode SXmlNode::insert_copy_after ( const SXmlNode & proto,
const SXmlNode & node )

Inserts a copy of the specified node as a child after the specified node.

Parameters
protoThe node to be copied.
nodeThe node after which the new child node should be inserted.
Returns
The inserted node, or an empty node on errors.

Definition at line 503 of file SXml.cpp.

◆ insert_copy_before() [1/2]

SXmlAttr SXmlNode::insert_copy_before ( const SXmlAttr & proto,
const SXmlAttr & attr )

Inserts a copy of the specified attribute before the specified attribute.

Parameters
protoThe attribute to be copied.
attrThe attribute before which the new attribute should be inserted.
Returns
The inserted attribute, or an empty attribute on errors.

Definition at line 508 of file SXml.cpp.

◆ insert_copy_before() [2/2]

SXmlNode SXmlNode::insert_copy_before ( const SXmlNode & proto,
const SXmlNode & node )

Inserts a copy of the specified node as a child before the specified node.

Parameters
protoThe node to be copied.
nodeThe node before which the new child node should be inserted.
Returns
The inserted node, or an empty node on errors.

Definition at line 513 of file SXml.cpp.

◆ insert_move_after()

SXmlNode SXmlNode::insert_move_after ( const SXmlNode & moved,
const SXmlNode & node )

Inserts the specified node to become a child of this node after the specified node.

Parameters
movedThe node to be moved.
nodeThe node after which the new child node should be inserted.
Returns
The moved node, or an empty node on errors.

Definition at line 568 of file SXml.cpp.

◆ insert_move_before()

SXmlNode SXmlNode::insert_move_before ( const SXmlNode & moved,
const SXmlNode & node )

Inserts the specified node to become a child of this node before the specified node.

Parameters
movedThe node to be moved.
nodeThe node before which the new child node should be inserted.
Returns
The moved node, or an empty node on errors.

Definition at line 573 of file SXml.cpp.

◆ last_attribute()

SXmlAttr SXmlNode::last_attribute ( ) const

Gets the last attribute of the node.

Returns
The last attribute of the node.

Definition at line 378 of file SXml.cpp.

◆ last_child()

SXmlNode SXmlNode::last_child ( ) const

Gets the last child node of the node.

Returns
The last child node of the node.

Definition at line 388 of file SXml.cpp.

◆ LastAttribute()

IXmlAttr * SXmlNode::LastAttribute ( )

Gets the last attribute in the attribute list.

Returns
Pointer to the last attribute.

Implements IXmlNode.

Definition at line 292 of file SXml.cpp.

◆ LastChild()

IXmlNode * SXmlNode::LastChild ( )

Gets the last child node.

Returns
Pointer to the last child node.

Implements IXmlNode.

Definition at line 310 of file SXml.cpp.

◆ Name()

const wchar_t * SXmlNode::Name ( )

Gets the node name.

Returns
Node name, or "" if the node is empty.

Implements IXmlNode.

Definition at line 255 of file SXml.cpp.

◆ name()

const wchar_t * SXmlNode::name ( ) const

Gets the name of the node.

Returns
The name of the node, or an empty string if the node is empty or has no name.

Definition at line 363 of file SXml.cpp.

◆ next_sibling() [1/2]

SXmlNode SXmlNode::next_sibling ( ) const

Gets the next sibling node in the children list of the parent node.

Returns
The next sibling node.

Definition at line 393 of file SXml.cpp.

◆ next_sibling() [2/2]

SXmlNode SXmlNode::next_sibling ( const wchar_t * name,
bool bCaseSensitive = false ) const

Gets the next sibling node with the specified name.

Parameters
nameThe name of the sibling node.
bCaseSensitiveWhether the search should be case-sensitive.
Returns
The next sibling node.

Definition at line 398 of file SXml.cpp.

◆ NextSibling()

IXmlNode * SXmlNode::NextSibling ( )

Gets the next sibling node.

Returns
Pointer to the next sibling node.

Implements IXmlNode.

Definition at line 316 of file SXml.cpp.

◆ NextSibling2()

IXmlNode * SXmlNode::NextSibling2 ( const wchar_t * name,
BOOL bCaseSensitive )

Gets the next sibling node by name.

Parameters
nameSibling node name.
bCaseSensitiveFlag indicating case sensitivity.
Returns
Pointer to the next sibling node.

Implements IXmlNode.

Definition at line 328 of file SXml.cpp.

◆ operator bool()

SXmlNode::operator bool ( ) const

Checks if the node is empty.

Returns
TRUE if the node is empty, FALSE otherwise.

Definition at line 348 of file SXml.cpp.

◆ operator!=()

bool SXmlNode::operator!= ( const SXmlNode & src) const
inline

Checks if two SXmlNode objects are not equal.

Parameters
srcThe SXmlNode object to compare with.
Returns
TRUE if the nodes are not equal, FALSE otherwise.

Definition at line 639 of file SXml.h.

◆ operator==()

bool SXmlNode::operator== ( const SXmlNode & src) const
inline

Checks if two SXmlNode objects are equal.

Parameters
srcThe SXmlNode object to compare with.
Returns
TRUE if the nodes are equal, FALSE otherwise.

Definition at line 632 of file SXml.h.

◆ parent()

SXmlNode SXmlNode::parent ( ) const

Gets the parent node of the node.

Returns
The parent node.

Definition at line 413 of file SXml.cpp.

◆ prepend_attribute()

SXmlAttr SXmlNode::prepend_attribute ( const wchar_t * name)

Prepends an attribute with the specified name.

Parameters
nameThe name of the attribute to be prepended.
Returns
The prepended attribute, or an empty attribute on errors.

Definition at line 463 of file SXml.cpp.

◆ prepend_child() [1/2]

SXmlNode SXmlNode::prepend_child ( const wchar_t * name)

Prepends a child element with the specified name.

Parameters
nameThe name of the child element to be prepended.
Returns
The prepended node, or an empty node on errors.

Definition at line 533 of file SXml.cpp.

◆ prepend_child() [2/2]

SXmlNode SXmlNode::prepend_child ( XmlNodeType type = node_element)

Prepends a child node with the specified type.

Parameters
typeThe type of the child node to be prepended.
Returns
The prepended node, or an empty node on errors.

Definition at line 528 of file SXml.cpp.

◆ prepend_copy() [1/2]

SXmlAttr SXmlNode::prepend_copy ( const SXmlAttr & proto)

Prepends a copy of the specified attribute.

Parameters
protoThe attribute to be copied.
Returns
The prepended attribute, or an empty attribute on errors.

Definition at line 488 of file SXml.cpp.

◆ prepend_copy() [2/2]

SXmlNode SXmlNode::prepend_copy ( const SXmlNode & proto)

Prepends a copy of the specified node as a child.

Parameters
protoThe node to be copied.
Returns
The prepended node, or an empty node on errors.

Definition at line 493 of file SXml.cpp.

◆ prepend_move()

SXmlNode SXmlNode::prepend_move ( const SXmlNode & moved)

Prepends the specified node to become a child of this node.

Parameters
movedThe node to be moved.
Returns
The moved node, or an empty node on errors.

Definition at line 563 of file SXml.cpp.

◆ PrependAttribute()

IXmlAttr * SXmlNode::PrependAttribute ( const wchar_t * name)
inline

Prepends an attribute with the specified name.

Parameters
nameAttribute name.
Returns
Pointer to the prepended attribute.

Implements IXmlNode.

Definition at line 588 of file SXml.h.

◆ PrependChild()

IXmlNode * SXmlNode::PrependChild ( const wchar_t * name)
inline

Prepends a child node with the specified name.

Parameters
nameChild node name.
Returns
Pointer to the prepended child node.

Implements IXmlNode.

Definition at line 548 of file SXml.h.

◆ PrependCopyAttribute()

IXmlAttr * SXmlNode::PrependCopyAttribute ( const IXmlAttr * proto)
inline

Prepends a copy of the specified attribute to the node.

Parameters
protoThe attribute to be copied.
Returns
A pointer to the newly added attribute, or an empty attribute on errors.

Implements IXmlNode.

Definition at line 603 of file SXml.h.

◆ PrependCopyNode()

IXmlNode * SXmlNode::PrependCopyNode ( const IXmlNode * proto)
inline

Prepends a copy of the specified node as a child.

Parameters
protoNode to copy.
Returns
Pointer to the prepended child node.

Implements IXmlNode.

Definition at line 568 of file SXml.h.

◆ previous_sibling() [1/2]

SXmlNode SXmlNode::previous_sibling ( ) const

Gets the previous sibling node in the children list of the parent node.

Returns
The previous sibling node.

Definition at line 403 of file SXml.cpp.

◆ previous_sibling() [2/2]

SXmlNode SXmlNode::previous_sibling ( const wchar_t * name,
bool bCaseSensitive = false ) const

Gets the previous sibling node with the specified name.

Parameters
nameThe name of the sibling node.
bCaseSensitiveWhether the search should be case-sensitive.
Returns
The previous sibling node.

Definition at line 408 of file SXml.cpp.

◆ PrevSibling()

IXmlNode * SXmlNode::PrevSibling ( )

Gets the previous sibling node.

Returns
Pointer to the previous sibling node.

Implements IXmlNode.

Definition at line 322 of file SXml.cpp.

◆ PrevSibling2()

IXmlNode * SXmlNode::PrevSibling2 ( const wchar_t * name,
BOOL bCaseSensitive )

Gets the previous sibling node by name.

Parameters
nameSibling node name.
bCaseSensitiveFlag indicating case sensitivity.
Returns
Pointer to the previous sibling node.

Implements IXmlNode.

Definition at line 334 of file SXml.cpp.

◆ remove_attribute() [1/2]

bool SXmlNode::remove_attribute ( const SXmlAttr & a)

Removes the specified attribute.

Parameters
aThe attribute to be removed.
Returns
TRUE if the attribute was successfully removed, FALSE otherwise.

Definition at line 578 of file SXml.cpp.

◆ remove_attribute() [2/2]

bool SXmlNode::remove_attribute ( const wchar_t * name)

Removes the attribute with the specified name.

Parameters
nameThe name of the attribute to be removed.
Returns
TRUE if the attribute was successfully removed, FALSE otherwise.

Definition at line 583 of file SXml.cpp.

◆ remove_attributes()

bool SXmlNode::remove_attributes ( )

Removes all attributes from the node.

Returns
TRUE if all attributes were successfully removed, FALSE otherwise.

Definition at line 588 of file SXml.cpp.

◆ remove_child() [1/2]

bool SXmlNode::remove_child ( const SXmlNode & n)

Removes the specified child node.

Parameters
nThe child node to be removed.
Returns
TRUE if the child node was successfully removed, FALSE otherwise.

Definition at line 593 of file SXml.cpp.

◆ remove_child() [2/2]

bool SXmlNode::remove_child ( const wchar_t * name)

Removes the child node with the specified name.

Parameters
nameThe name of the child node to be removed.
Returns
TRUE if the child node was successfully removed, FALSE otherwise.

Definition at line 598 of file SXml.cpp.

◆ remove_children()

bool SXmlNode::remove_children ( )

Removes all child nodes from the node.

Returns
TRUE if all child nodes were successfully removed, FALSE otherwise.

Definition at line 603 of file SXml.cpp.

◆ RemoveAllChilden()

BOOL SXmlNode::RemoveAllChilden ( )
inline

Removes all child nodes from the node.

Returns
TRUE if all child nodes were successfully removed, FALSE otherwise.

Implements IXmlNode.

Definition at line 624 of file SXml.h.

◆ RemoveAttribute()

BOOL SXmlNode::RemoveAttribute ( const wchar_t * name)
inline

Removes an attribute by name.

Parameters
nameName of the attribute to remove.
Returns
TRUE if the attribute was removed, FALSE otherwise.

Removes the attribute with the specified name.

Parameters
nameThe name of the attribute to be removed.
Returns
TRUE if the attribute was successfully removed, FALSE otherwise.

Implements IXmlNode.

Definition at line 608 of file SXml.h.

◆ RemoveChild()

BOOL SXmlNode::RemoveChild ( const wchar_t * name)
inline

Removes the child node with the specified name.

Parameters
nameThe name of the child node to be removed.
Returns
TRUE if the child node was successfully removed, FALSE otherwise.

Implements IXmlNode.

Definition at line 618 of file SXml.h.

◆ root()

SXmlNode SXmlNode::root ( ) const

Gets the root node of the DOM tree this node belongs to.

Returns
The root node.

Definition at line 418 of file SXml.cpp.

◆ set_name()

bool SXmlNode::set_name ( const wchar_t * rhs)

Sets the name of the node.

Parameters
rhsThe new name for the node.
Returns
TRUE if the name was successfully set, FALSE otherwise.

Definition at line 448 of file SXml.cpp.

◆ set_userdata()

BOOL SXmlNode::set_userdata ( int data)

Sets user data for the node.

Parameters
dataUser data to set.
Returns
TRUE if successful, FALSE otherwise.

Implements IXmlNode.

Definition at line 270 of file SXml.cpp.

◆ set_value()

bool SXmlNode::set_value ( const wchar_t * rhs)

Sets the value of the node.

Parameters
rhsThe new value for the node.
Returns
TRUE if the value was successfully set, FALSE otherwise.

Definition at line 453 of file SXml.cpp.

◆ Text()

const wchar_t * SXmlNode::Text ( )

Gets the node text.

Returns
Node text, or "" if the node is empty.

Implements IXmlNode.

Definition at line 265 of file SXml.cpp.

◆ ToString()

void SXmlNode::ToString ( IStringW * out)

Converts the node to a string representation.

Parameters
outPointer to the output string.

Implements IXmlNode.

Definition at line 238 of file SXml.cpp.

◆ type()

XmlNodeType SXmlNode::type ( ) const

Gets the type of the node.

Returns
The type of the node.

Definition at line 358 of file SXml.cpp.

◆ Value()

const wchar_t * SXmlNode::Value ( )

Gets the node value.

Returns
Node value, or "" if the node is empty.

Implements IXmlNode.

Definition at line 260 of file SXml.cpp.

◆ value()

const wchar_t * SXmlNode::value ( ) const

Gets the value of the node.

Returns
The value of the node, or an empty string if the node is empty or has no value.
Note
For <node>text</node>, node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes.

Definition at line 368 of file SXml.cpp.

Friends And Related Symbol Documentation

◆ SXmlDoc

friend class SXmlDoc
friend

Definition at line 353 of file SXml.h.


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