22 snprintf(buf,
sizeof(buf),
"%d", value);
60 fprintf(stderr,
"MVOdb: %s\n", error->
fErrorString.c_str());
65 fprintf(stderr,
"MVOdb: Error: MIDAS %s() at ODB path \"%s\" returned status %d\n", midas_func_name, path.c_str(), status);
70 void SetError(
MVOdbError* error,
bool print,
const std::string& path,
const std::string& message)
82 fprintf(stderr,
"MVOdb::SetError: %s\n", error->
fErrorString.c_str());
86 fprintf(stderr,
"MVOdb::SetError: Error: %s at ODB path \"%s\"\n", message.c_str(), path.c_str());
97 snprintf(str,
sizeof(str),
"MakeFileDumpOdb: old ODB dump format is not supported, sorry");
98 SetError(error,
false,
"buffer", str);
100 }
else if (buf[0] ==
'<') {
103 }
else if (buf[0] ==
'{') {
109 snprintf(str,
sizeof(str),
"MakeFileDumpOdb: unknown ODB dump format, first char is \'%c\' (%d), dump size %d",
110 buf[0], buf[0], bufsize);
111 SetError(error,
false,
"buffer", str);
MVOdb * MakeXmlBufferOdb(const char *buf, int bufsize, MVOdbError *error=NULL)
MVOdb * MakeJsonBufferOdb(const char *buf, int bufsize, MVOdbError *error=NULL)
void SetMidasStatus(MVOdbError *error, bool print, const std::string &path, const char *midas_func_name, int status)
void SetError(MVOdbError *error, bool print, const std::string &path, const std::string &message)
MVOdb * MakeFileDumpOdb(const char *buf, int bufsize, MVOdbError *error)
Access ODB from a midas file dump. FOrmat could be .xml, .json or .odb.
void SetOk(MVOdbError *error)
static std::string toString(int value)