diff options
Diffstat (limited to 'src/StateFile.hxx')
-rw-r--r-- | src/StateFile.hxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/StateFile.hxx b/src/StateFile.hxx index 4ec2c4be7..15ba13b97 100644 --- a/src/StateFile.hxx +++ b/src/StateFile.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -27,10 +27,14 @@ #include <string> struct Partition; +class OutputStream; +class BufferedOutputStream; class StateFile final : private TimeoutMonitor { - AllocatedPath path; - std::string path_utf8; + const AllocatedPath path; + const std::string path_utf8; + + const unsigned interval; Partition &partition; @@ -42,7 +46,10 @@ class StateFile final : private TimeoutMonitor { prev_playlist_version; public: - StateFile(AllocatedPath &&path, Partition &partition, EventLoop &loop); + static constexpr unsigned DEFAULT_INTERVAL = 2 * 60; + + StateFile(AllocatedPath &&path, unsigned interval, + Partition &partition, EventLoop &loop); void Read(); void Write(); @@ -53,6 +60,9 @@ public: void CheckModified(); private: + bool Write(OutputStream &os, Error &error); + void Write(BufferedOutputStream &os); + /** * Save the current state versions for use with IsModified(). */ |