diff options
author | Dennis van der Schagt <dennisschagt@gmail.com> | 2024-10-20 20:32:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-20 20:32:52 +0200 |
commit | 75cfb25644569f7aa7d6ad3654b2923b005874b3 (patch) | |
tree | 71aee430db37ded21e35c69f68484032587759aa /include/filepath.h | |
parent | d0306662f210bc38ebc8ecf1d701dad291a4bc06 (diff) | |
parent | 44853874d76e42e3a8a11d501a6c610870023c5e (diff) |
Merge pull request #2884 from newsboat/feature/2326-remove-implicit-conversions-from-file-dir-browserfeature/2326-filepath
Remove implicit conversions from {File,Dir}BrowserFormAction
Diffstat (limited to 'include/filepath.h')
-rw-r--r-- | include/filepath.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/filepath.h b/include/filepath.h index 6308f2ae..795a6dfb 100644 --- a/include/filepath.h +++ b/include/filepath.h @@ -64,6 +64,10 @@ public: bool operator==(const Filepath&) const; bool operator!=(const Filepath&) const; + bool operator<(const Filepath&) const; + bool operator<=(const Filepath&) const; + bool operator>(const Filepath&) const; + bool operator>=(const Filepath&) const; /// Returns the filepath as a string in locale encoding. /// @@ -95,8 +99,9 @@ public: // Return `true` if Filepath start with `base`, `false` otherwise. // - // \note `ext` is interpreted as bytes in locale encoding. - bool starts_with(const std::string& base) const; + // Only considers whole path components to match, i.e. "/foo" is **not** + // a prefix of "/foobar/baz". + bool starts_with(const Filepath& base) const; /// Returns the final component of the path, if there is one. nonstd::optional<Filepath> file_name() const; |