bethyw.cpp
/*
  Parses the areas command line argument, which is optional. If it doesn't 
  exist or exists and contains "all" as value (any case), all areas should be
  imported, i.e., the filter should be an empty set.

  Unlike datasets we can't check the validity of the values as it depends
  on each individual file imported (which hasn't happened until runtime).
  Therefore, we simply fetch the list of areas and later pass it to the
  Areas::populate() function.

  The filtering of inputs should be case insensitive.

  @param args
    Parsed program arguments

  @return 
    An std::unordered_set of std::strings corresponding to specific areas
    to import, or an empty set if all areas should be imported.

  @throws
    std::invalid_argument if the argument contains an invalid areas value with
    message: Invalid input for area argument
*/
Parses the areas command line argument, which is optional. If it doesn't
exist or exists and contains "all" as value (any case), all areas should be
imported, i.e., the filter should be an empty set.

Unlike datasets we can't check the validity of the values as it depends
on each individual file imported (which hasn't happened until runtime).
Therefore, we simply fetch the list of areas and later pass it to the
Areas::populate() function.

The filtering of inputs should be case insensitive.
Parses the areas command line argument which is optional . If it doesn ' t exist or exists and contains " all " as value ( any case ) all areas should be imported i . e . the filter should be an empty set . Unlike datasets we can ' t check the validity of the values as it depends on each individual file imported ( which hasn ' t happened until runtime ) . Therefore we simply fetch the list of areas and later pass it to the Areas :: populate () function . The filtering of inputs should be case insensitive .
std::unordered_set<std::string> BethYw::parseAreasArg(
    cxxopts::ParseResult& args) {
  std::unordered_set<std::string> areas;
  if(args.count("areas") == 0)
      return areas;
  auto areaArgs = args["areas"].as<std::vector<std::string>>();
  for(unsigned int i = 0; i < areaArgs.size(); i++) {
      if(!BethYw::insensitiveEquals(areaArgs[i], "all")){
          areas.insert(areaArgs[i]);
      }else{
          areas.clear();
          return areas;
      }
  }
  return areas;
}
std :: unordered_set < std :: string > BethYw :: parseAreasArg ( cxxopts :: ParseResult & args ) { std :: unordered_set < std :: string > areas ; if ( args . count ( " " ) == 0 ) return areas ; auto areaArgs = args [ " " ] . as < std :: vector < std :: string > > ( ) ; for ( unsigned int i = 0 ; i < areaArgs . size ( ) ; i ++ ) { if ( ! BethYw :: insensitiveEquals ( areaArgs [ i ] , " " ) ) { areas . insert ( areaArgs [ i ] ) ; } else { areas . clear ( ) ; return areas ; } } return areas ; }
Parses the areas command line argument, which is optional.
Parses the areas command line argument which is optional .
// The unordered set you will return // Retrieve the areas argument like so: