| 61 | // ---------------------------------------------------------------------------------------- |
| 62 | |
| 63 | void obtain_list_of_files ( |
| 64 | const cmd_line_parser<char>::check_1a_c& parser, |
| 65 | const std::string& filter, |
| 66 | const unsigned long search_depth, |
| 67 | std::vector<std::pair<string,string> >& files |
| 68 | ) |
| 69 | { |
| 70 | for (unsigned long i = 0; i < parser.option("i").count(); ++i) |
| 71 | { |
| 72 | const directory dir(parser.option("i").argument(0,i)); |
| 73 | |
| 74 | const std::vector<file>& temp = get_files_in_directory_tree(dir, file_filter(filter), search_depth); |
| 75 | |
| 76 | // figure out how many characters need to be removed from the path of each file |
| 77 | const string parent = dir.get_parent().full_name(); |
| 78 | unsigned long strip = parent.size(); |
| 79 | if (parent.size() > 0 && parent[parent.size()-1] != '\\' && parent[parent.size()-1] != '/') |
| 80 | strip += 1; |
| 81 | |
| 82 | for (unsigned long i = 0; i < temp.size(); ++i) |
| 83 | { |
| 84 | files.push_back(make_pair(temp[i].full_name().substr(strip), temp[i].full_name())); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | for (unsigned long i = 0; i < parser.number_of_arguments(); ++i) |
| 89 | { |
| 90 | files.push_back(make_pair(parser[i], parser[i])); |
| 91 | } |
| 92 | |
| 93 | std::sort(files.begin(), files.end()); |
| 94 | } |
| 95 | |
| 96 | // ---------------------------------------------------------------------------------------- |
| 97 |
no test coverage detected