| 13 | namespace implementation_details |
| 14 | { |
| 15 | void get_all_sub_dirs ( |
| 16 | const directory& top_of_tree, |
| 17 | unsigned long max_depth, |
| 18 | std::vector<directory>& result, |
| 19 | std::vector<directory>& temp |
| 20 | ) |
| 21 | { |
| 22 | if (max_depth > 0) |
| 23 | { |
| 24 | top_of_tree.get_dirs(temp); |
| 25 | const unsigned long start = result.size(); |
| 26 | result.insert(result.end(), temp.begin(), temp.end()); |
| 27 | const unsigned long end = start + temp.size(); |
| 28 | |
| 29 | for (unsigned long i = start; i < end; ++i) |
| 30 | { |
| 31 | get_all_sub_dirs(result[i], max_depth-1, result, temp); |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // ---------------------------------------------------------------------------------------- |