| 492 | |
| 493 | |
| 494 | bool isSupportedFileInSubfolders( const std::filesystem::path& folder ) |
| 495 | { |
| 496 | const auto allFilters = getAllFilters(); |
| 497 | |
| 498 | std::vector<std::filesystem::path> filesList; |
| 499 | filesList.push_back( folder ); |
| 500 | |
| 501 | while ( !filesList.empty() ) |
| 502 | { |
| 503 | auto path = filesList[0]; |
| 504 | filesList.erase( filesList.begin() ); |
| 505 | |
| 506 | std::error_code ec; |
| 507 | for ( auto entry : Directory{ path, ec } ) |
| 508 | { |
| 509 | auto subpath = entry.path(); |
| 510 | if ( entry.is_directory( ec ) ) |
| 511 | { |
| 512 | filesList.push_back( path = subpath ); |
| 513 | } |
| 514 | else if ( entry.is_regular_file( ec ) ) |
| 515 | { |
| 516 | auto ext = utf8string( subpath.extension() ); |
| 517 | for ( auto& c : ext ) |
| 518 | c = ( char )tolower( c ); |
| 519 | |
| 520 | if ( ext.empty() ) |
| 521 | continue; |
| 522 | |
| 523 | if ( findFilter( allFilters, ext ) ) |
| 524 | return true; |
| 525 | } |
| 526 | } |
| 527 | } |
| 528 | return false; |
| 529 | } |
| 530 | |
| 531 | Expected<LoadedObject> loadSceneFromAnySupportedFormat( const std::filesystem::path& path, const ProgressCallback& callback ) |
| 532 | { |
no test coverage detected