File indexing completed on 2025-01-18 09:13:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #define BOOST_BIND_GLOBAL_PLACEHOLDERS
0016 #include <JSON/Helper.h>
0017 #include <JSON/DocumentHandler.h>
0018
0019
0020 #include <boost/property_tree/json_parser.hpp>
0021 #include <memory>
0022 #include <stdexcept>
0023
0024 using namespace dd4hep::json;
0025
0026
0027 DocumentHandler::DocumentHandler() {
0028 }
0029
0030
0031 DocumentHandler::~DocumentHandler() {
0032 }
0033
0034
0035 Document DocumentHandler::load(const std::string& fname) const {
0036 std::string fn = fname;
0037 if ( fname.find("://") != std::string::npos ) fn = fname.substr(fname.find("://")+3);
0038
0039
0040
0041 std::unique_ptr<JsonElement> doc(new JsonElement(fn, ptree()));
0042 boost::property_tree::read_json(fn,doc->second);
0043 return doc.release();
0044 }
0045
0046
0047 Document DocumentHandler::parse(const char* doc_string, size_t length) const {
0048 if ( doc_string && length ) {}
0049 throw std::runtime_error("Bla");
0050 }