----------------------------------------------------------------------------- Purpose: helper to find a subdirectory upstream from a given path -----------------------------------------------------------------------------
| 531 | // Purpose: helper to find a subdirectory upstream from a given path |
| 532 | //----------------------------------------------------------------------------- |
| 533 | std::string Path_FindParentSubDirectoryRecursively( const std::string &strStartDirectory, const std::string &strDirectoryName ) |
| 534 | { |
| 535 | std::string strFoundPath = ""; |
| 536 | std::string strCurrentPath = Path_FixSlashes( strStartDirectory ); |
| 537 | if ( strCurrentPath.length() == 0 ) |
| 538 | return ""; |
| 539 | |
| 540 | bool bExists = Path_Exists( strCurrentPath ); |
| 541 | while( bExists && strCurrentPath.length() != 0 ) |
| 542 | { |
| 543 | strCurrentPath = Path_StripFilename( strCurrentPath ); |
| 544 | bExists = Path_Exists( strCurrentPath ); |
| 545 | |
| 546 | if( Path_Exists( Path_Join( strCurrentPath, strDirectoryName ) ) ) |
| 547 | { |
| 548 | strFoundPath = Path_Join( strCurrentPath, strDirectoryName ); |
| 549 | break; |
| 550 | } |
| 551 | } |
| 552 | return strFoundPath; |
| 553 | } |
| 554 | |
| 555 | |
| 556 | //----------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected