Import Geant4 11.1.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2022-07-01 10:44:02 +02:00
parent b3bf75a2a1
commit c07cea1fe0
2172 changed files with 183300 additions and 123938 deletions
+44
View File
@@ -0,0 +1,44 @@
// Copyright (C) 2010, Guy Barrand. All rights reserved.
// See the file tools.license for terms.
#ifndef toolx_xml_style
#define toolx_xml_style
#include <tools/xml/styles>
#include "loader"
namespace toolx {
namespace xml {
inline bool load_style_file(std::ostream&,const std::string& a_file,tools::xml::styles& a_styles) {
tools::xml::default_factory factory;
toolx::xml::loader ml(factory,a_styles.out(),false);
std::vector<std::string> tags;
tags.push_back("styles");
tags.push_back("style");
tags.push_back("plotter_style");
ml.set_tags(tags);
if(!ml.load_file(a_file,false)) return false;
tools::xml::tree* top = ml.top_item();
if(!top) return true; //File could be empty.
return scan_style_tree(a_styles,*top);
}
inline bool load_style_string(tools::xml::styles& a_styles,const std::string& a_string) {
tools::xml::default_factory factory;
toolx::xml::loader ml(factory,a_styles.out(),false);
std::vector<std::string> tags;
tags.push_back("styles");
tags.push_back("style");
tags.push_back("plotter_style");
ml.set_tags(tags);
if(!ml.load_string(a_string)) return false;
tools::xml::tree* top = ml.top_item();
if(!top) return true;
return scan_style_tree(a_styles,*top);
}
}}
#endif