| 4 | { |
| 5 | |
| 6 | std::filesystem::path findPathWithExtension( const std::filesystem::path & pathWithoutExtension ) |
| 7 | { |
| 8 | std::error_code ec; |
| 9 | const auto fn = pathWithoutExtension.filename(); |
| 10 | for ( auto dirEntry : Directory{ pathWithoutExtension.parent_path(), ec } ) |
| 11 | { |
| 12 | if ( !dirEntry.is_regular_file( ec ) ) |
| 13 | continue; |
| 14 | auto path = dirEntry.path(); |
| 15 | if ( path.stem() == fn ) |
| 16 | return path; |
| 17 | } |
| 18 | return {}; //not found |
| 19 | } |
| 20 | |
| 21 | } // namespace MR |
no outgoing calls
no test coverage detected