From: Arvin Schnell Date: Tue, 5 Apr 2016 15:15:52 +0000 (+0200) Subject: - added function to read value from config X-Git-Tag: v0.3.3~12^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d7ee00ee1e90062343c85d551224572305373af;p=thirdparty%2Fsnapper.git - added function to read value from config --- diff --git a/client/types.h b/client/types.h index 6f8ae5b8..c2ec91b9 100644 --- a/client/types.h +++ b/client/types.h @@ -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 raw; + + template + void read(const char* name, Type& value) + { + map::const_iterator pos = raw.find(name); + if (pos != raw.end()) + pos->second >> value; + } };