summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dirbrowserformaction.h2
-rw-r--r--include/filebrowserformaction.h2
-rw-r--r--include/filepath.h9
3 files changed, 9 insertions, 4 deletions
diff --git a/include/dirbrowserformaction.h b/include/dirbrowserformaction.h
index 0bdaa503..e0b8fdb3 100644
--- a/include/dirbrowserformaction.h
+++ b/include/dirbrowserformaction.h
@@ -43,7 +43,7 @@ private:
std::vector<file_system::FileSystemEntry> id_at_position;
std::vector<StflRichText> lines;
- Filepath get_formatted_dirname(const Filepath& dirname, mode_t mode);
+ std::string get_formatted_dirname(const Filepath& dirname, mode_t mode);
LineView file_prompt_line;
diff --git a/include/filebrowserformaction.h b/include/filebrowserformaction.h
index 534e7edd..941133d6 100644
--- a/include/filebrowserformaction.h
+++ b/include/filebrowserformaction.h
@@ -48,7 +48,7 @@ private:
std::vector<file_system::FileSystemEntry> id_at_position;
std::vector<StflRichText> lines;
- Filepath get_formatted_filename(const Filepath& filename, mode_t mode);
+ std::string get_formatted_filename(const Filepath& filename, mode_t mode);
LineView file_prompt_line;
Filepath default_filename;
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;