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