Fix helper naming a bit
This commit is contained in:
14
helpers.cpp
14
helpers.cpp
@@ -10,28 +10,28 @@ using std::istream;
|
||||
using std::ostream;
|
||||
using std::string;
|
||||
|
||||
bool read_config_json(json& cfg, const string& filename, ostream* log)
|
||||
bool read_file_json(json& j, const string& filename, ostream* log)
|
||||
{
|
||||
ifstream cfg_file(filename);
|
||||
ifstream file(filename);
|
||||
|
||||
if (!cfg_file.is_open())
|
||||
if (!file.is_open())
|
||||
{
|
||||
if (nullptr != log)
|
||||
{
|
||||
*log << "Could not open config file" << endl;
|
||||
*log << "Could not open file" << endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return read_config_json(cfg, cfg_file, log);
|
||||
return read_stream_json(j, file, log);
|
||||
}
|
||||
|
||||
bool read_config_json(json& cfg, istream& in, ostream* log)
|
||||
bool read_stream_json(json& j, istream& in, ostream* log)
|
||||
{
|
||||
// Parse with comments
|
||||
try
|
||||
{
|
||||
cfg = json::parse(in, nullptr, true, true);
|
||||
j = json::parse(in, nullptr, true, true);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user