| 78 | #endif // defined(FILE_PATH_USES_DRIVE_LETTERS) |
| 79 | |
| 80 | bool IsPathAbsolute(const StringType& path) { |
| 81 | #if defined(FILE_PATH_USES_DRIVE_LETTERS) |
| 82 | StringType::size_type letter = FindDriveLetter(path); |
| 83 | if (letter != StringType::npos) { |
| 84 | // Look for a separator right after the drive specification. |
| 85 | return path.length() > letter + 1 && |
| 86 | FilePath::IsSeparator(path[letter + 1]); |
| 87 | } |
| 88 | // Look for a pair of leading separators. |
| 89 | return path.length() > 1 && |
| 90 | FilePath::IsSeparator(path[0]) && FilePath::IsSeparator(path[1]); |
| 91 | #else // FILE_PATH_USES_DRIVE_LETTERS |
| 92 | // Look for a separator in the first position. |
| 93 | return path.length() > 0 && FilePath::IsSeparator(path[0]); |
| 94 | #endif // FILE_PATH_USES_DRIVE_LETTERS |
| 95 | } |
| 96 | |
| 97 | bool AreAllSeparators(const StringType& input) { |
| 98 | for (StringType::const_iterator it = input.begin(); |
no test coverage detected