MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / getCurrentWorkingDirectory

Function getCurrentWorkingDirectory

Libraries/Testing/Testing.cpp:459–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459static 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
478static StringSpan getApplicationRootDirectory(StringPath& applicationRootDirectory)
479{

Callers 8

FileSystemTestMethod · 0.85
saneMainFunction · 0.85
runAwaitManifestPreviewFunction · 0.85
runAwaitConfigReloadFunction · 0.85
runAwaitFilePatchFunction · 0.85
runAwaitTaskGroupFilesFunction · 0.85
runAwaitFileCourierFunction · 0.85
resolveLibraryRootFunction · 0.85

Calls 4

writableSpanMethod · 0.80
resizeMethod · 0.45
viewMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected