| 217 | } |
| 218 | |
| 219 | std::string_view Path::getFileExtension() const { |
| 220 | auto lastComponent = getLastComponent(); |
| 221 | auto fileExtensionIndex = lastComponent.find_last_of('.'); |
| 222 | if (fileExtensionIndex == std::string_view::npos) { |
| 223 | return std::string_view(); |
| 224 | } |
| 225 | |
| 226 | return lastComponent.substr(fileExtensionIndex + 1); |
| 227 | } |
| 228 | |
| 229 | bool Path::empty() const { |
| 230 | return _components.empty(); |