If this FilePath contains a drive letter specification, returns the position of the last character of the drive letter specification, otherwise returns npos. This can only be true on Windows, when a pathname begins with a letter followed by a colon. On other platforms, this always returns npos.
| 45 | // begins with a letter followed by a colon. On other platforms, this always |
| 46 | // returns npos. |
| 47 | StringType::size_type FindDriveLetter(const StringType& path) { |
| 48 | #if defined(FILE_PATH_USES_DRIVE_LETTERS) |
| 49 | // This is dependent on an ASCII-based character set, but that's a |
| 50 | // reasonable assumption. iswalpha can be too inclusive here. |
| 51 | if (path.length() >= 2 && path[1] == L':' && |
| 52 | ((path[0] >= L'A' && path[0] <= L'Z') || |
| 53 | (path[0] >= L'a' && path[0] <= L'z'))) { |
| 54 | return 1; |
| 55 | } |
| 56 | #endif // FILE_PATH_USES_DRIVE_LETTERS |
| 57 | return StringType::npos; |
| 58 | } |
| 59 | |
| 60 | #if defined(FILE_PATH_USES_DRIVE_LETTERS) |
| 61 | bool EqualDriveLetterCaseInsensitive(const StringType& a, |
no test coverage detected