Skip to content

Commit

Permalink
deactivate file validation as it is externally handled
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Mar 18, 2014
1 parent 4028c0b commit 823e8d2
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Util/BoostFileSystemFix.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ namespace filesystem {
// exists. The validate() function must be defined in the same namespace
// as the target type, (boost::filesystem::path in this case), otherwise
// it is not called
inline void validate(
boost::any & v,
const std::vector<std::string> & values,
boost::filesystem::path *,
int
) {
boost::program_options::validators::check_first_occurrence(v);
const std::string & input_string =
boost::program_options::validators::get_single_string(values);
// SimpleLogger().Write() << "validator called for " << input_string;
// SimpleLogger().Write() << "validator called for " << input_string;
if(boost::filesystem::is_regular_file(input_string)) {
v = boost::any(boost::filesystem::path(input_string));
} else {
throw OSRMException(input_string + " not found");
}
}
// inline void validate(
// boost::any & v,
// const std::vector<std::string> & values,
// boost::filesystem::path *,
// int
// ) {
// boost::program_options::validators::check_first_occurrence(v);
// const std::string & input_string =
// boost::program_options::validators::get_single_string(values);
// // SimpleLogger().Write() << "validator called for " << input_string;
// // SimpleLogger().Write() << "validator called for " << input_string;
// if(boost::filesystem::is_regular_file(input_string)) {
// v = boost::any(boost::filesystem::path(input_string));
// } else {
// throw OSRMException(input_string + " not found");
// }
// }

// adapted from: http://stackoverflow.com/questions/1746136/how-do-i-normalize-a-pathname-using-boostfilesystem
inline boost::filesystem::path portable_canonical(
Expand Down

1 comment on commit 823e8d2

@emiltin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come validaton of file paths are not done through boost::program_options anymore?

Please sign in to comment.