41 tinyxml2::XMLDocument doc;
42 tinyxml2::XMLElement* root =
nullptr;
43 tinyxml2::XMLElement* elem =
nullptr;
45 if(tinyxml2::XML_SUCCESS == doc.LoadFile(_FileName.c_str()))
47 root = doc.FirstChildElement(
"data");
50 elem = root->FirstChildElement(
"EndoDebug" );
53 root->DeleteChild(elem);
61 doc.InsertEndChild( doc.NewDeclaration() );
63 root = doc.NewElement(
"data" );
64 doc.InsertEndChild( root );
68 elem = doc.NewElement(
"EndoDebug" );
70 elem->SetAttribute(
"DebugEnabled",
72 elem->SetAttribute(
"ShowImagesInDebug",
74 elem->SetAttribute(
"ShowImagesTimeOut",
76 elem->SetAttribute(
"DebugImagesOutputDirectory",
80 std::string _FilesToDebugString;
81 auto it = _FilesToDebug.begin();
82 while( it != _FilesToDebug.end() )
84 if( it != _FilesToDebug.begin() )
85 _FilesToDebugString.append(
";" );
86 _FilesToDebugString.append( *it );
89 elem->SetAttribute(
"FilesToDebug", _FilesToDebugString.c_str() );
92 std::string _SymbolsToDebugString;
93 it = _SymbolsToDebug.begin();
94 while( it != _SymbolsToDebug.end() )
96 if( it != _SymbolsToDebug.begin() )
97 _SymbolsToDebugString.append(
";" );
98 _SymbolsToDebugString.append( *it );
101 elem->SetAttribute(
"SymbolsToDebug", _SymbolsToDebugString.c_str() );
103 endodebug(
"adding the EndoDebug as child element of the data node")
104 root->InsertEndChild(elem);
107 if( tinyxml2::XML_SUCCESS != doc.SaveFile( _FileName.c_str() ) )
109 endodebug(
"File " << _FileName <<
" could not be written. Please check permissions.");