Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Actions/MapOfActions.cpp

    r6f5dfe rbd2390  
    191191  BV.zz = boost::lexical_cast<double>(components.at(5));
    192192  v = boost::any(BoxValue(BV));
     193}
     194
     195void validate(boost::any& v, const std::vector<std::string>& values, boost::filesystem::path *, int)
     196{
     197  boost::filesystem::path filename;
     198  std::vector<std::string> components;
     199
     200  std::cout << "boost::filesystem::path validator used." << std::endl;
     201
     202  // split comma-separated values
     203  if (values.size() != 1) {
     204    cerr <<  "Not one file but " << components.size() << " given " << endl;
     205    throw boost::program_options::validation_error("Unequal to one file given");
     206  }
     207  filename = values.at(0);
     208  v = boost::any(boost::filesystem::path(filename));
    193209}
    194210
     
    447463  TypeEnumMap[&typeid(bool)] = Boolean;
    448464  TypeEnumMap[&typeid(int)] = Integer;
     465  TypeEnumMap[&typeid(boost::filesystem::path)] = File;
    449466  TypeEnumMap[&typeid(std::vector<int>)] = ListOfIntegers;
    450467  TypeEnumMap[&typeid(double)] = Double;
     
    10781095              ;
    10791096            break;
     1097          case File:
     1098            ListRunner->second->add_options()
     1099              (getKeyAndShortForm(*OptionRunner).c_str(),
     1100                  po::value< boost::filesystem::path >(),
     1101                  getDescription(*OptionRunner).c_str())
     1102              ;
     1103            break;
    10801104          case Integer:
    10811105            ListRunner->second->add_options()
Note: See TracChangeset for help on using the changeset viewer.