Changes in src/Actions/MapOfActions.cpp [6f5dfe:bd2390]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MapOfActions.cpp
r6f5dfe rbd2390 191 191 BV.zz = boost::lexical_cast<double>(components.at(5)); 192 192 v = boost::any(BoxValue(BV)); 193 } 194 195 void 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)); 193 209 } 194 210 … … 447 463 TypeEnumMap[&typeid(bool)] = Boolean; 448 464 TypeEnumMap[&typeid(int)] = Integer; 465 TypeEnumMap[&typeid(boost::filesystem::path)] = File; 449 466 TypeEnumMap[&typeid(std::vector<int>)] = ListOfIntegers; 450 467 TypeEnumMap[&typeid(double)] = Double; … … 1078 1095 ; 1079 1096 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; 1080 1104 case Integer: 1081 1105 ListRunner->second->add_options()
Note:
See TracChangeset
for help on using the changeset viewer.