Returns the current working directory, or "" if unsuccessful.
| 7933 | |
| 7934 | // Returns the current working directory, or "" if unsuccessful. |
| 7935 | FilePath FilePath::GetCurrentDir() { |
| 7936 | #if GTEST_OS_WINDOWS_MOBILE |
| 7937 | // Windows CE doesn't have a current directory, so we just return |
| 7938 | // something reasonable. |
| 7939 | return FilePath(kCurrentDirectoryString); |
| 7940 | #elif GTEST_OS_WINDOWS |
| 7941 | char cwd[GTEST_PATH_MAX_ + 1] = { '\0' }; |
| 7942 | return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd); |
| 7943 | #else |
| 7944 | char cwd[GTEST_PATH_MAX_ + 1] = { '\0' }; |
| 7945 | return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd); |
| 7946 | #endif // GTEST_OS_WINDOWS_MOBILE |
| 7947 | } |
| 7948 | |
| 7949 | // Returns a copy of the FilePath with the case-insensitive extension removed. |
| 7950 | // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns |
nothing calls this directly
no test coverage detected