| 681 | */ |
| 682 | |
| 683 | bool File::IsAbsolute(const String& filePath) |
| 684 | { |
| 685 | String path(filePath.Trimmed()); |
| 686 | if (path.IsEmpty()) |
| 687 | return false; |
| 688 | |
| 689 | path = NormalizeSeparators(path); |
| 690 | |
| 691 | #ifdef NAZARA_PLATFORM_WINDOWS |
| 692 | if (path.Match("?:*")) // Ex: C:\Hello |
| 693 | return true; |
| 694 | else if (path.Match("\\\\*")) // Ex: \\Laptop |
| 695 | return true; |
| 696 | else if (path.StartsWith('\\')) // Special : '\' referring to the root |
| 697 | return true; |
| 698 | else |
| 699 | return false; |
| 700 | #elif defined(NAZARA_PLATFORM_POSIX) |
| 701 | return path.StartsWith('/'); |
| 702 | #else |
| 703 | #error OS case not implemented |
| 704 | #endif |
| 705 | } |
| 706 | |
| 707 | /*! |
| 708 | * \brief Normalizes the file path |
nothing calls this directly
no test coverage detected