Kigs Framework  Doc version 0.8
Open source multi purpose Rapid Application Development framework
Public Member Functions | List of all members
XMLNodeTemplate Class Reference

#include <XMLNode.h>

Public Member Functions

 XMLNodeTemplate ()
 constructor
 
 XMLNodeTemplate (XMLNodeType type)
 constructor for the given type
 
 XMLNodeTemplate (XMLNodeType type, const StringType &name)
 constructor for the given type and name
 
virtual ~XMLNodeTemplate ()
 destructor ( no need for virtual as XMLNodeTemplate will not have inheritance )
 
void setName (const StringType &name)
 set node name
 
void setString (const StringType &value)
 set node value with given string
 
void setInt (const int value)
 set node value with given int
 
void setFloat (const kfloat value)
 set node value with given kfloat
 
const StringType & getName () const
 return node name
 
const StringType & getString ()
 return node value as a string
 
int getInt ()
 return node value as an int
 
kfloat getFloat ()
 return node value as a kfloat
 
int getChildCount ()
 return node's children count
 
XMLNodeTemplategetChildElement (unsigned int index=0)
 return child node by index
 
XMLNodeTemplategetChildElement (const std::string &name)
 return child node by name
 
XMLNodeTemplateaddChildElement (const StringType &childName)
 create a new child with given name and return the corresponding node
 
XMLNodeTemplateaddChildElementText (const StringType &childName, const StringType &textValue, bool textValueNoCheck=false)
 create a new child with given name and text value and return the corresponding node
 
XMLNodeTemplateaddChildElementInteger (const StringType &childName, int integerValue)
 create a new child with given name and int value and return the corresponding node
 
int getAttributeCount ()
 return attribute count for this node
 
XMLAttributeTemplate< StringType > * getAttribute (int index)
 return one attribute by index
 
XMLAttributeTemplate< StringType > * getAttribute (const std::string_view &name)
 return one attribute by name
 
XMLAttributeTemplate< StringType > * getAndRemoveAttribute (const std::string_view &name)
 return one attribute by name and remove it from list (useful when parsing xml struct and you are sure you will access attribute only once)
 
void addAttribute (XMLAttributeTemplate< StringType > *attribute)
 add the given attribute to the node
 
void removeAttribute (XMLAttributeTemplate< StringType > *attribute)
 remove the given attribute from the node More...
 
virtual void addChild (XMLNodeBase *child) override
 add the given child to the node
 
void removeChild (XMLNodeTemplate *child)
 remove the given child to the node
 

Detailed Description

Manage XML node structure using string or string_view.

Member Function Documentation

◆ removeAttribute()

void XMLNodeTemplate::removeAttribute ( XMLAttributeTemplate< StringType > *  attribute)
inline

remove the given attribute from the node

remove the given attribute from the node (not delete)


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