QMCPACK
XMLNodeString Class Reference

convert xmlNode contents into a std::string More...

+ Inheritance diagram for XMLNodeString:
+ Collaboration diagram for XMLNodeString:

Public Member Functions

 XMLNodeString (const xmlNodePtr cur)
 construct a string from an xmlNode More...
 
 XMLNodeString (const std::string &in)
 expose base class constructors More...
 
 XMLNodeString (const char *in)
 
void setXMLNodeContent (xmlNodePtr cur) const
 write a string to an xmlNode More...
 

Detailed Description

convert xmlNode contents into a std::string

Todo:
this should just be a function that takes a cur and returns a std::string.

setXMLNodeContent is OOP without reason.

Definition at line 32 of file XMLParsingString.h.

Constructor & Destructor Documentation

◆ XMLNodeString() [1/3]

XMLNodeString ( const xmlNodePtr  cur)
inline

construct a string from an xmlNode

Definition at line 36 of file XMLParsingString.h.

References qmcplusplus::assign().

37  {
38  xmlChar* node_char = xmlNodeListGetString(cur->doc, cur->xmlChildrenNode, 1);
39  if (node_char)
40  {
41  assign((const char*)node_char);
42  xmlFree(node_char);
43  }
44  }
Matrix< T1, C1 > & assign(Matrix< T1, C1 > &lhs, const RHS &rhs)

◆ XMLNodeString() [2/3]

XMLNodeString ( const std::string &  in)
inline

expose base class constructors

Definition at line 47 of file XMLParsingString.h.

47 : std::string(in) {}

◆ XMLNodeString() [3/3]

XMLNodeString ( const char *  in)
inline

Definition at line 49 of file XMLParsingString.h.

49 : std::string(in) {}

Member Function Documentation

◆ setXMLNodeContent()

void setXMLNodeContent ( xmlNodePtr  cur) const
inline

write a string to an xmlNode

Definition at line 52 of file XMLParsingString.h.

Referenced by getContent(), and ProjectData::put().

52 { xmlNodeSetContent(cur, (const xmlChar*)(this->c_str())); }

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