Returns true if pathname describes an absolute path.
| 263 | |
| 264 | // Returns true if pathname describes an absolute path. |
| 265 | bool FilePath::IsAbsolutePath() const { |
| 266 | const char* const name = pathname_.c_str(); |
| 267 | #if GTEST_OS_WINDOWS |
| 268 | return pathname_.length() >= 3 && |
| 269 | ((name[0] >= 'a' && name[0] <= 'z') || |
| 270 | (name[0] >= 'A' && name[0] <= 'Z')) && |
| 271 | name[1] == ':' && |
| 272 | IsPathSeparator(name[2]); |
| 273 | #else |
| 274 | return IsPathSeparator(name[0]); |
| 275 | #endif |
| 276 | } |
| 277 | |
| 278 | // Returns a pathname for a file that does not currently exist. The pathname |
| 279 | // will be directory/base_name.extension or |
no test coverage detected