Belle II Software development

DB object which stores whole xml. More...

#include <XmlFile.h>

Inheritance diagram for XmlFile:

Public Member Functions

 XmlFile ()
 Constructor.
 
virtual ~XmlFile ()
 Destructor.
 
void readXml (std::string xmlFileName)
 Read content from xml file.
 
std::string getData ()
 Get content as string.
 
void fillPropertyTree (boost::property_tree::ptree &tree)
 Populate boost PropertyTree with stored data.
 

Private Attributes

std::string m_data {""}
 The xml data as string.
 

Detailed Description

DB object which stores whole xml.

Definition at line 21 of file XmlFile.h.

Constructor & Destructor Documentation

◆ XmlFile()

XmlFile ( )
inline

Constructor.

Definition at line 25 of file XmlFile.h.

25{};

◆ ~XmlFile()

virtual ~XmlFile ( )
inlinevirtual

Destructor.

Definition at line 28 of file XmlFile.h.

29 {
30 }

Member Function Documentation

◆ fillPropertyTree()

void fillPropertyTree ( boost::property_tree::ptree &  tree)
inline

Populate boost PropertyTree with stored data.

Definition at line 48 of file XmlFile.h.

49 {
50 std::stringstream ss; ss << m_data;
51 using boost::property_tree::ptree;
52 read_xml(ss, tree);
53 }
std::string m_data
The xml data as string.
Definition: XmlFile.h:57

◆ getData()

std::string getData ( )
inline

Get content as string.

Definition at line 42 of file XmlFile.h.

43 {
44 return m_data;
45 }

◆ readXml()

void readXml ( std::string  xmlFileName)
inline

Read content from xml file.

Definition at line 33 of file XmlFile.h.

34 {
35 std::ifstream t(xmlFileName);
36 std::stringstream buffer;
37 buffer << t.rdbuf();
38 m_data = buffer.str();
39 }

Member Data Documentation

◆ m_data

std::string m_data {""}
private

The xml data as string.

Definition at line 57 of file XmlFile.h.


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