|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #define BOOST_BIND_GLOBAL_PLACEHOLDERS // Needed to silence Boost pragma message
8 #include <boost/property_tree/ptree.hpp>
9 #include <boost/property_tree/json_parser.hpp>
47 const std::string & pathToChild )
const
58 boost::property_tree::read_json(
file,
data);
60 catch (
const boost::property_tree::json_parser_error&
e) {
65 if( ! pathToChild.empty() ) {
68 boost::optional<ptree&> subtree =
data.get_child_optional(pathToChild);
84 const std::string & pathToChild )
const
91 data.setData(std::move(
pt));
103 TRG_MSG_ERROR(
"Could not save to file, as specified filename is empty");
106 boost::property_tree::write_json(
filename,
data.data());
116 std::string
ft =
"UNKNOWN";
120 ft =
data.getAttribute(
"filetype",
true,
ft);
129 std::string &
level )
const
138 if (
data.hasChild(
"chains")) {
140 }
else if (
data.hasChild(
"items")) {
char data[hepevt_bytes_allocation_ATLAS]
std::string findFile(const std::string &filename) const
bool loadFile(const std::string &filename, boost::property_tree::ptree &data, const std::string &pathToChild="") const
Load content of json file into a ptree.
JsonFileLoader()
Constructor.
bool checkTriggerLevel(const std::string &filename, std::string &level) const
Checks the trigger level of a given json file.
bool saveFile(const std::string &filename, const DataStructure &data) const
Save content of DataStructure (underlying ptree) to a file.
std::string getFileType(const std::string &filename) const
Checks the trigger level of a given json file.
#define TRG_MSG_WARNING(x)
boost::property_tree::ptree ptree
Base class for Trigger configuration data and wrapper around underlying representation.
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
def findFile(pathvar, fname)
Find a named file along a colon separated PATH type variable.
Loader class for Trigger configuration from Json.