diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-15 11:33:41 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-15 11:33:41 -0800 |
commit | a92d9d442b5b4f8b3de0c2eef3a9d7a498a36aa8 (patch) | |
tree | e9043ac159a86c6c2da3e77149a309195fef43ff /history.h | |
parent | e2ff77b4ecd4a5555043c163df21906693a3b9cf (diff) |
Initial work towards making autosuggestion smarter by recognizing paths
Diffstat (limited to 'history.h')
-rw-r--r-- | history.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -11,10 +11,13 @@ #include <vector> #include <deque> #include <utility> +#include <list> #include <tr1/memory> #include <set> using std::tr1::shared_ptr; +typedef std::list<wcstring> path_list_t; + enum history_search_type_t { /** The history searches for strings containing the given string */ HISTORY_SEARCH_TYPE_CONTAINS, @@ -28,7 +31,7 @@ class history_item_t { private: history_item_t(const wcstring &); - history_item_t(const wcstring &, time_t); + history_item_t(const wcstring &, time_t, const path_list_t &paths = path_list_t()); /** The actual contents of the entry */ wcstring contents; @@ -36,6 +39,9 @@ class history_item_t { /** Original creation time for the entry */ time_t creation_timestamp; + /** Paths that we require to be valid for this item to be autosuggested */ + path_list_t required_paths; + public: const wcstring &str() const { return contents; } bool empty() const { return contents.empty(); } @@ -101,7 +107,10 @@ public: static history_t & history_with_name(const wcstring &name); /** Add a new history item to the end */ - void add(const wcstring &str); + void add(const wcstring &str, const path_list_t &valid_paths = path_list_t()); + + /** Add a new history item to the end */ + void add_with_file_detection(const wcstring &str); /** Saves history */ void save(); |