Skip to content

Commit

Permalink
Extract vector<string> of CAMP filenames from JSON.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwfncar committed Sep 19, 2023
1 parent 0a61b26 commit 3df9bf7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/micm/configure/solver_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,16 @@ namespace micm
if (std::filesystem::exists(camp_config))
{
std::cout << "Reading CAMP config " << camp_config << std::endl;
json camp_config = json::parse(std::ifstream(camp_config));
if (!camp_config.contains(CAMP_FILES))
json camp_data = json::parse(std::ifstream(camp_config));
if (!camp_data.contains(CAMP_FILES))
return ConfigParseStatus::CAMPFilesSectionNotFound;

std::vector<std::string> camp_files;
for (const auto& element : camp_data[CAMP_FILES])
{
std::cout << element.get<std::string>() << std::endl;
camp_files.push_back(element.get<std::string>());
}
}

// Current reaction configs should be either mechanism_config or reactions config
Expand Down

0 comments on commit 3df9bf7

Please sign in to comment.