| 142 | enum PathPartKind : unsigned char { PK_None, PK_RootSep, PK_Filename, PK_Dot, PK_DotDot, PK_TrailingSep }; |
| 143 | |
| 144 | static PathPartKind ClassifyPathPart(string_view_t Part) { |
| 145 | if (Part.empty()) |
| 146 | return PK_TrailingSep; |
| 147 | if (Part == PATHSTR(".")) |
| 148 | return PK_Dot; |
| 149 | if (Part == PATHSTR("..")) |
| 150 | return PK_DotDot; |
| 151 | if (Part == PATHSTR("/")) |
| 152 | return PK_RootSep; |
| 153 | #if defined(_LIBCPP_WIN32API) |
| 154 | if (Part == PATHSTR("\\")) |
| 155 | return PK_RootSep; |
| 156 | #endif |
| 157 | return PK_Filename; |
| 158 | } |
| 159 | |
| 160 | path path::lexically_normal() const { |
| 161 | if (__pn_.empty()) |