DRDE/AusRegCliever/include/mdJSON.hpp

59 lines
1.1 KiB
C++
Raw Normal View History

2014-01-28 18:16:48 +00:00
/*
* mdJSON.hpp
*
* Created on: Jan 28, 2014
* Author: jdaugherty
*/
#ifndef MDJSON_HPP_
#define MDJSON_HPP_
2014-01-29 18:10:26 +00:00
typedef void (*caseBody)(void);
typedef struct {
2014-02-04 19:58:44 +00:00
string *desc;
2014-01-29 18:10:26 +00:00
const char *caseName;
caseBody fBody;
2014-02-04 19:58:44 +00:00
int parms; // Index of JSON Value in testSuiteAC
2014-01-29 18:10:26 +00:00
} testCase;
2014-02-04 19:58:44 +00:00
typedef struct {
string case_name;
string case_desc;
} testDesc;
2014-01-30 23:27:18 +00:00
namespace ACPRODINOTE {
2014-02-04 19:58:44 +00:00
typedef std::map<int,testDesc> testDescs;
typedef std::map<int,testCase> testCases;
typedef std::map<string,caseBody> testFuncs;
2014-01-29 18:10:26 +00:00
2014-01-30 23:27:18 +00:00
}
2014-01-29 18:10:26 +00:00
#ifdef MD_JSON
static Json::Value root;
#else
extern Json::Value root;
#endif
2014-01-28 18:16:48 +00:00
class mdJSON {
private:
2014-01-29 00:02:24 +00:00
std::string path;
2014-01-28 18:16:48 +00:00
public:
2014-01-29 00:02:24 +00:00
bool fatal;
2014-01-29 18:10:26 +00:00
mdJSON() : fatal(false) {}
2014-01-29 00:02:24 +00:00
bool parse();
bool didDie() {return fatal;}
void die(){ fatal = true;}
2014-01-29 18:10:26 +00:00
void setPath(char *filePath);
bool run();
2014-01-28 19:23:02 +00:00
2014-01-28 18:16:48 +00:00
};
#endif /* MDJSON_HPP_ */