summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-10-04 10:20:00 (GMT)
committerTobias Markmann <tm@ayena.de>2016-10-04 10:20:00 (GMT)
commitd29c0ee50a606bf1f4510ea427aef257870c17c0 (patch)
treeba00325da80f53ed34b4e3b6cc9cd900b1657911 /Swift/Controllers/StatusCache.h
parent627e5feaab79101c58507dfaba492eb63d32cfa5 (diff)
downloadswift-d29c0ee50a606bf1f4510ea427aef257870c17c0.zip
swift-d29c0ee50a606bf1f4510ea427aef257870c17c0.tar.bz2
Handle boost::bad_lexical_cast exception in StatusCache
Modernised code to C++11 lambdas and range-based for loops, and cleaned up includes in the process. Test-Information: All unit tests pass with ASAN-enabled built on macOS 10.12. Verified recent status list is still loaded in Swift UI. Change-Id: I44fe09a079cfae15ed9fb2860e7352badedf6c1c
Diffstat (limited to 'Swift/Controllers/StatusCache.h')
-rw-r--r--Swift/Controllers/StatusCache.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/Controllers/StatusCache.h b/Swift/Controllers/StatusCache.h
index 033cde0..83fd17a 100644
--- a/Swift/Controllers/StatusCache.h
+++ b/Swift/Controllers/StatusCache.h
@@ -6,11 +6,9 @@
#pragma once
-#include <iostream>
#include <list>
#include <string>
#include <utility>
-#include <vector>
#include <boost/filesystem/path.hpp>
@@ -18,6 +16,7 @@
namespace Swift {
class ApplicationPathProvider;
+
class StatusCache {
public:
typedef std::pair<std::string, StatusShow::Type> PreviousStatus;
@@ -27,9 +26,11 @@ namespace Swift {
std::vector<PreviousStatus> getMatches(const std::string& substring, size_t maxCount) const;
void addRecent(const std::string& text, StatusShow::Type type);
+
private:
void saveRecents();
void loadRecents();
+
private:
boost::filesystem::path path_;
std::list<PreviousStatus> previousStatuses_;