aboutsummaryrefslogtreecommitdiffhomepage
path: root/history.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-05 20:54:41 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-05 20:54:41 -0800
commit9ab54030b94fab715e8f62f09cd207f5f411d366 (patch)
treeed846df43c72913fd805d5a829eaa6cc83f6fc27 /history.h
parent5ad6849d4e6aa76a72b671b50b143ef80d381a75 (diff)
Moved LRU to its own file
Diffstat (limited to 'history.h')
-rw-r--r--history.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/history.h b/history.h
index 48cd951e..466c2b78 100644
--- a/history.h
+++ b/history.h
@@ -23,12 +23,15 @@ class history_item_t {
wcstring contents;
/** Original creation time for the entry */
- time_t timestamp;
+ time_t creation_timestamp;
public:
const wcstring &str() const { return contents; }
bool empty() const { return contents.empty(); }
bool matches_search(const wcstring &val) const { return contents.find(val) != wcstring::npos; }
+ time_t timestamp() const { return creation_timestamp; }
+
+ bool write_to_file(FILE *f) const;
};
class history_t {
@@ -76,6 +79,9 @@ private:
/** Loads old if necessary */
void load_old_if_needed(void);
+ /** Saves history */
+ void save_internal();
+
public:
/** Returns history with the given name, creating it if necessary */
static history_t & history_with_name(const wcstring &name);
@@ -123,16 +129,14 @@ public:
history(&hist),
term(str),
idx()
- {
- }
+ {}
/* Default constructor */
history_search_t() :
history(),
term(),
idx()
- {
- }
+ {}
};