bethyw.cpp
/*
  Parse the measures command line argument, which is optional. If it doesn't 
  exist or exists and contains "all" as value (any case), all measures should
  be imported.

  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 measures 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 measures
    to import, or an empty set if all measures should be imported.

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

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 measures and later pass it to the
Areas::populate() function.

The filtering of inputs should be case insensitive.
Parse the measures command line argument which is optional . If it doesn ' t exist or exists and contains " all " as value ( any case ) all measures should be imported . 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 measures and later pass it to the Areas :: populate () function . The filtering of inputs should be case insensitive .
std::unordered_set<std::string> BethYw::parseMeasuresArg(cxxopts::ParseResult& args){
    std::unordered_set<std::string> measures;
    if(args.count("measures") == 0)
        return measures;
    auto measuresArgs = args["measures"].as<std::vector<std::string>>();
    for(unsigned int i = 0; i < measuresArgs.size(); i++) {
        if(!BethYw::insensitiveEquals(measuresArgs[i], "all")){
            measures.insert(measuresArgs[i]);
        }else{
            measures.clear();
        }
    }
    return measures;
}
std :: unordered_set < std :: string > BethYw :: parseMeasuresArg ( cxxopts :: ParseResult & args ) { std :: unordered_set < std :: string > measures ; if ( args . count ( " " ) == 0 ) return measures ; auto measuresArgs = args [ " " ] . as < std :: vector < std :: string > > ( ) ; for ( unsigned int i = 0 ; i < measuresArgs . size ( ) ; i ++ ) { if ( ! BethYw :: insensitiveEquals ( measuresArgs [ i ] , " " ) ) { measures . insert ( measuresArgs [ i ] ) ; } else { measures . clear ( ) ; } } return measures ; }
Parse the measures command line argument, which is optional.
Parse the measures command line argument which is optional .
// Retrieve the areas argument like so: