Returns true if pathname describes an absolute path.
| 8092 | |
| 8093 | // Returns true if pathname describes an absolute path. |
| 8094 | bool FilePath::IsAbsolutePath() const { |
| 8095 | const char* const name = pathname_.c_str(); |
| 8096 | #if GTEST_OS_WINDOWS |
| 8097 | return pathname_.length() >= 3 && |
| 8098 | ((name[0] >= 'a' && name[0] <= 'z') || |
| 8099 | (name[0] >= 'A' && name[0] <= 'Z')) && |
| 8100 | name[1] == ':' && |
| 8101 | IsPathSeparator(name[2]); |
| 8102 | #else |
| 8103 | return IsPathSeparator(name[0]); |
| 8104 | #endif |
| 8105 | } |
| 8106 | |
| 8107 | // Returns a pathname for a file that does not currently exist. The pathname |
| 8108 | // will be directory/base_name.extension or |
no test coverage detected