Returns true if pathname describes a root directory. (Windows has one root directory per disk drive.)
| 246 | // Returns true if pathname describes a root directory. (Windows has one |
| 247 | // root directory per disk drive.) |
| 248 | bool FilePath::IsRootDirectory() const { |
| 249 | #if GTEST_OS_WINDOWS |
| 250 | // TODO(wan@google.com): on Windows a network share like |
| 251 | // \\server\share can be a root directory, although it cannot be the |
| 252 | // current directory. Handle this properly. |
| 253 | return pathname_.length() == 3 && IsAbsolutePath(); |
| 254 | #else |
| 255 | return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]); |
| 256 | #endif |
| 257 | } |
| 258 | |
| 259 | // Returns true if pathname describes an absolute path. |
| 260 | bool FilePath::IsAbsolutePath() const { |
no test coverage detected