summaryrefslogtreecommitdiff
path: root/src/StateFile.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-07-17 23:27:50 +0200
committerMax Kellermann <max@musicpd.org>2018-07-17 23:27:50 +0200
commitbcc1e51097b0bfac30f2ffb0d81c5b8a7cfd874f (patch)
tree98293eb961d8ac2dc8c844e59e4176a0a874915c /src/StateFile.hxx
parente8a7c6cee33bd591730313fea6909c565d56a0fc (diff)
StateFile: add struct StateFileConfig
Diffstat (limited to 'src/StateFile.hxx')
-rw-r--r--src/StateFile.hxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/StateFile.hxx b/src/StateFile.hxx
index ed0f9fcef..de5b994d0 100644
--- a/src/StateFile.hxx
+++ b/src/StateFile.hxx
@@ -20,6 +20,7 @@
#ifndef MPD_STATE_FILE_HXX
#define MPD_STATE_FILE_HXX
+#include "StateFileConfig.hxx"
#include "event/TimerEvent.hxx"
#include "fs/AllocatedPath.hxx"
#include "Compiler.h"
@@ -32,10 +33,10 @@ class OutputStream;
class BufferedOutputStream;
class StateFile final {
- const AllocatedPath path;
+ const StateFileConfig config;
+
const std::string path_utf8;
- const std::chrono::steady_clock::duration interval;
TimerEvent timer_event;
Partition &partition;
@@ -52,9 +53,7 @@ class StateFile final {
#endif
public:
- static constexpr std::chrono::steady_clock::duration DEFAULT_INTERVAL = std::chrono::minutes(2);
-
- StateFile(AllocatedPath &&path, std::chrono::steady_clock::duration interval,
+ StateFile(StateFileConfig &&_config,
Partition &partition, EventLoop &loop);
void Read();