Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_xml_style
|
||||
#define tools_xml_style
|
||||
|
||||
#include <tools/xml/styles>
|
||||
|
||||
#include "loader"
|
||||
|
||||
namespace tools {
|
||||
namespace xml {
|
||||
|
||||
inline bool load_style_file(std::ostream&,const std::string& a_file,tools::xml::styles& a_styles) {
|
||||
tools::xml::default_factory factory;
|
||||
tools::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;
|
||||
tools::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
|
||||
Reference in New Issue
Block a user