Returns true if pathname describes a root directory. (Windows has one root directory per disk drive.)
| 7671 | // Returns true if pathname describes a root directory. (Windows has one |
| 7672 | // root directory per disk drive.) |
| 7673 | bool FilePath::IsRootDirectory() const { |
| 7674 | #if GTEST_OS_WINDOWS |
| 7675 | // TODO(wan@google.com): on Windows a network share like |
| 7676 | // \\server\share can be a root directory, although it cannot be the |
| 7677 | // current directory. Handle this properly. |
| 7678 | return pathname_.length() == 3 && IsAbsolutePath(); |
| 7679 | #else |
| 7680 | return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]); |
| 7681 | #endif |
| 7682 | } |
| 7683 | |
| 7684 | // Returns true if pathname describes an absolute path. |
| 7685 | bool FilePath::IsAbsolutePath() const { |
nothing calls this directly
no test coverage detected