1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:27:34 +00:00

FileSystemPath: Add a has_extension() helper.

This code:

    if (path.string().to_lowercase().ends_with(".foo"))

Can now be written as:

    if (path.has_extension(".foo"))
This commit is contained in:
Andreas Kling 2019-05-26 22:33:30 +02:00
parent 6ac8aab941
commit 5ba2dba392
2 changed files with 8 additions and 0 deletions

View file

@ -16,6 +16,8 @@ public:
const Vector<String>& parts() const { return m_parts; }
bool has_extension(StringView) const;
private:
bool canonicalize(bool resolve_symbolic_links = false);