Returns true if pathname describes a root directory. (Windows has one root directory per disk drive.)
| 8521 | // Returns true if pathname describes a root directory. (Windows has one |
| 8522 | // root directory per disk drive.) |
| 8523 | bool FilePath::IsRootDirectory() const { |
| 8524 | #if GTEST_OS_WINDOWS |
| 8525 | // TODO(wan@google.com): on Windows a network share like |
| 8526 | // \\server\share can be a root directory, although it cannot be the |
| 8527 | // current directory. Handle this properly. |
| 8528 | return pathname_.length() == 3 && IsAbsolutePath(); |
| 8529 | #else |
| 8530 | return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]); |
| 8531 | #endif |
| 8532 | } |
| 8533 | |
| 8534 | // Returns true if pathname describes an absolute path. |
| 8535 | bool FilePath::IsAbsolutePath() const { |
nothing calls this directly
no test coverage detected