Returns true if pathname describes an absolute path.
| 7683 | |
| 7684 | // Returns true if pathname describes an absolute path. |
| 7685 | bool FilePath::IsAbsolutePath() const { |
| 7686 | const char* const name = pathname_.c_str(); |
| 7687 | #if GTEST_OS_WINDOWS |
| 7688 | return pathname_.length() >= 3 && |
| 7689 | ((name[0] >= 'a' && name[0] <= 'z') || |
| 7690 | (name[0] >= 'A' && name[0] <= 'Z')) && |
| 7691 | name[1] == ':' && |
| 7692 | IsPathSeparator(name[2]); |
| 7693 | #else |
| 7694 | return IsPathSeparator(name[0]); |
| 7695 | #endif |
| 7696 | } |
| 7697 | |
| 7698 | // Returns a pathname for a file that does not currently exist. The pathname |
| 7699 | // will be directory/base_name.extension or |
no test coverage detected