CASM  1.1.0
A Clusters Approach to Statistical Mechanics
json_io.cc
Go to the documentation of this file.
1 #include "casm/app/io/json_io.hh"
2 
4 
5 namespace CASM {
6 
9  std::map<std::string, std::string> const &source_to_combined_keys,
10  jsonParser const &json_source, jsonParser &json_combined) {
11  for (auto const &pair : source_to_combined_keys) {
12  auto it = json_source.find(pair.first);
13  if (it != json_source.end()) {
14  json_combined[pair.second] = *it;
15  }
16  }
17  return json_combined;
18 }
19 } // namespace CASM
iterator end()
Returns iterator to end of JSON object or JSON array.
Definition: jsonParser.cc:520
iterator find(const std::string &name)
Return iterator to JSON object value with 'name'.
Definition: jsonParser.cc:543
Main CASM namespace.
Definition: APICommand.hh:8
jsonParser & combine_json_options(std::map< std::string, std::string > const &source_to_combined_keys, jsonParser const &json_source, jsonParser &json_combined)
Copy from json_source to json_combined
Definition: json_io.cc:8