]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- added function to read value from config
authorArvin Schnell <aschnell@suse.de>
Tue, 5 Apr 2016 15:15:52 +0000 (17:15 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 5 Apr 2016 15:15:52 +0000 (17:15 +0200)
client/types.h

index 6f8ae5b8a2082cfa8b138538da939291ac39e69d..c2ec91b9a5f6fc4bfdad81990e59a3ff5546744f 100644 (file)
@@ -33,6 +33,7 @@ using std::map;
 #include "dbus/DBusConnection.h"
 #include "snapper/Snapshot.h"
 #include "snapper/File.h"
+#include "snapper/SnapperTmpl.h"
 
 using namespace snapper;
 
@@ -43,6 +44,14 @@ struct XConfigInfo
     string subvolume;
 
     map<string, string> raw;
+
+    template<typename Type>
+    void read(const char* name, Type& value)
+    {
+       map<string, string>::const_iterator pos = raw.find(name);
+       if (pos != raw.end())
+           pos->second >> value;
+    }
 };