Improved JSON config error reporting
Show incorrect lines in config.json together with line number and position.
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
|
||||
#include "base/kernel/interfaces/IJsonReader.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
@@ -50,7 +53,12 @@ public:
|
||||
static bool get(const char *fileName, rapidjson::Document &doc);
|
||||
static bool save(const char *fileName, const rapidjson::Document &doc);
|
||||
|
||||
static bool convertOffset(const char *fileName, size_t offset, size_t &line, size_t &pos, std::vector<std::string>& s);
|
||||
|
||||
static rapidjson::Value normalize(double value, bool zero);
|
||||
|
||||
private:
|
||||
static bool convertOffset(std::ifstream& ifs, size_t offset, size_t& line, size_t& pos, std::vector<std::string>& s);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user