aboutsummaryrefslogtreecommitdiffhomepage
path: root/history.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-01 14:56:34 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-01 14:56:34 -0800
commitfd4df6f9bb918d62ae31881230f2d5f8b09e129e (patch)
treebf1e86c4dae93eaec67d6f64d6587c30cdb672f3 /history.h
parent5d18d60e3b9f9f4d6e12f14e8c68b147429b9fb3 (diff)
Changed iterators from iter++ to ++iter
Large set of changes to history to ensure that histories from other sessions don't "bleed" into the current session
Diffstat (limited to 'history.h')
-rw-r--r--history.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/history.h b/history.h
index 227bcaca..c25c8892 100644
--- a/history.h
+++ b/history.h
@@ -34,10 +34,13 @@ class history_item_t {
private:
explicit history_item_t(const wcstring &);
explicit history_item_t(const wcstring &, time_t, const path_list_t &paths = path_list_t());
+
+ /** Attempts to merge two compatible history items together */
+ bool merge(const history_item_t &item);
/** The actual contents of the entry */
wcstring contents;
-
+
/** Original creation time for the entry */
time_t creation_timestamp;
@@ -101,9 +104,10 @@ private:
/** The size of the mmaped region */
size_t mmap_length;
- /**
- Timestamp of last save
- */
+ /** Timestamp of when this history was created */
+ const time_t birth_timestamp;
+
+ /** Timestamp of last save */
time_t save_timestamp;
static history_item_t decode_item(const char *ptr, size_t len);
@@ -119,6 +123,9 @@ private:
/** Loads old if necessary */
void load_old_if_needed(void);
+ /** Deletes duplicates in new_items. */
+ void compact_new_items();
+
/** Saves history */
void save_internal();