#include #include #include "JLang/JEquationParameters.hh" #include "JLang/JRedirectString.hh" #include "JLang/JNullStream.hh" #include "JLang/JLangToolkit.hh" #include "JROOT/JRootDictionary.hh" #include "JROOT/JRootStreamer.hh" #include "JDB/JDB.hh" #include "JDB/JDBToolkit.hh" #include "JDB/JRunQuality.hh" namespace JDATABASE { /** * Put value at given key. * * \param key key * \param value value */ void JRunQuality::put(const std::string& key, const std::string& value) { using namespace std; using namespace JPP; const JEquationParameters parameters(":", "\n", "", ""); JRootReader reader(null, parameters, JRootDictionary::getInstance()); JRootReadableClass cls(*this); const string buffer = replace(key, "-", "_"); for (string::size_type il = 0, ir = 0; ir != string::npos && cls.is_valid(); il = ir + 1) { ir = buffer.substr(il).find(parameters.getDefaultDivision()); cls = cls.find(buffer.substr(il, ir - il).c_str()); } if (cls.is_valid()) { JRedirectString redirect(reader, value); reader.getObject(cls); } } }