Returns true if pathname describes an absolute path.
| 8533 | |
| 8534 | // Returns true if pathname describes an absolute path. |
| 8535 | bool FilePath::IsAbsolutePath() const { |
| 8536 | const char* const name = pathname_.c_str(); |
| 8537 | #if GTEST_OS_WINDOWS |
| 8538 | return pathname_.length() >= 3 && |
| 8539 | ((name[0] >= 'a' && name[0] <= 'z') || |
| 8540 | (name[0] >= 'A' && name[0] <= 'Z')) && |
| 8541 | name[1] == ':' && |
| 8542 | IsPathSeparator(name[2]); |
| 8543 | #else |
| 8544 | return IsPathSeparator(name[0]); |
| 8545 | #endif |
| 8546 | } |
| 8547 | |
| 8548 | // Returns a pathname for a file that does not currently exist. The pathname |
| 8549 | // will be directory/base_name.extension or |
no test coverage detected