Returns true if pathname describes an absolute path.
| 9493 | |
| 9494 | // Returns true if pathname describes an absolute path. |
| 9495 | bool FilePath::IsAbsolutePath() const { |
| 9496 | const char* const name = pathname_.c_str(); |
| 9497 | #if GTEST_OS_WINDOWS |
| 9498 | return pathname_.length() >= 3 && |
| 9499 | ((name[0] >= 'a' && name[0] <= 'z') || |
| 9500 | (name[0] >= 'A' && name[0] <= 'Z')) && |
| 9501 | name[1] == ':' && |
| 9502 | IsPathSeparator(name[2]); |
| 9503 | #else |
| 9504 | return IsPathSeparator(name[0]); |
| 9505 | #endif |
| 9506 | } |
| 9507 | |
| 9508 | // Returns a pathname for a file that does not currently exist. The pathname |
| 9509 | // will be directory/base_name.extension or |
no test coverage detected