| 457 | } |
| 458 | |
| 459 | static StringSpan getCurrentWorkingDirectory(StringPath& currentWorkingDirectory) |
| 460 | { |
| 461 | #if SC_PLATFORM_WINDOWS |
| 462 | if (not TestingWindowsDetail::WindowsPath::getCurrentDirectory(currentWorkingDirectory)) |
| 463 | { |
| 464 | (void)currentWorkingDirectory.resize(0); |
| 465 | return {}; |
| 466 | } |
| 467 | return currentWorkingDirectory.view(); |
| 468 | #else |
| 469 | if (::getcwd(currentWorkingDirectory.writableSpan().data(), StringPath::MaxPath) != nullptr) |
| 470 | { |
| 471 | (void)currentWorkingDirectory.resize(::strlen(currentWorkingDirectory.view().bytesIncludingTerminator())); |
| 472 | return currentWorkingDirectory.view(); |
| 473 | } |
| 474 | return {}; |
| 475 | #endif |
| 476 | } |
| 477 | |
| 478 | static StringSpan getApplicationRootDirectory(StringPath& applicationRootDirectory) |
| 479 | { |
no test coverage detected