Improved JSON config error reporting
Show incorrect lines in config.json together with line number and position.
This commit is contained in:
parent
b38046db46
commit
05d3f17f15
5 changed files with 99 additions and 1 deletions
|
@ -62,3 +62,14 @@ bool xmrig::Json::save(const char *fileName, const rapidjson::Document &doc)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Json::convertOffset(const char* fileName, size_t offset, size_t& line, size_t& pos, std::vector<std::string>& s)
|
||||
{
|
||||
std::ifstream ifs(fileName, std::ios_base::in | std::ios_base::binary);
|
||||
if (!ifs.is_open()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return convertOffset(ifs, offset, line, pos, s);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue