yast2-snapper
SnapperAgent.h
Go to the documentation of this file.
1 /* SnapperAgent.h
2  *
3  * Snapper agent implementation
4  *
5  * Authors: Jiri Suchomel <jsuchome@suse.cz>
6  *
7  * $Id: SnapperAgent.h 63174 2011-01-13 10:50:42Z jsuchome $
8  */
9 
10 #ifndef _SnapperAgent_h
11 #define _SnapperAgent_h
12 
13 #include <Y2.h>
14 #include <scr/SCRAgent.h>
15 
16 #include <snapper/Snapper.h>
17 #include <snapper/Snapshot.h>
18 #include <snapper/Comparison.h>
19 #include <snapper/File.h>
20 #include <snapper/Logger.h>
21 
22 #include <ctype.h>
23 #include <fcntl.h>
24 #include <sys/ioctl.h>
25 
26 #include <boost/algorithm/string.hpp>
27 
28 #include <btrfs/ioctl.h>
29 
33 class SnapperAgent : public SCRAgent
34 {
35 private:
40  snapper::Snapper* sh;
42  string snapper_error;
43 
48  string getValue (const YCPMap &map, const YCPString &key, const string &deflt);
49 
56  int getIntValue ( const YCPMap &map, const YCPString &key, const int deflt);
57 
62  YCPList getListValue (const YCPMap &map, const YCPString &key);
63 
68  YCPMap getMapValue (const YCPMap &map, const YCPString &key);
69 
70 public:
74  SnapperAgent();
75 
79  virtual ~SnapperAgent();
80 
86  virtual YCPValue Read ( const YCPPath &path,
87  const YCPValue& arg = YCPNull(),
88  const YCPValue& opt = YCPNull());
89 
93  virtual YCPBoolean Write(const YCPPath &path,
94  const YCPValue& arg,
95  const YCPValue& arg2 = YCPNull());
96 
100  virtual YCPValue Execute(const YCPPath &path,
101  const YCPValue& arg = YCPNull(),
102  const YCPValue& arg2 = YCPNull());
103 
107  virtual YCPList Dir(const YCPPath& path);
108 
112  virtual YCPValue otherCommand(const YCPTerm& term);
113 };
114 
115 #endif /* _SnapperAgent_h */
virtual YCPBoolean Write(const YCPPath &path, const YCPValue &arg, const YCPValue &arg2=YCPNull())
Definition: SnapperAgent.cc:414
virtual YCPValue Execute(const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &arg2=YCPNull())
Definition: SnapperAgent.cc:426
bool snapper_initialized
Definition: SnapperAgent.h:41
SnapperAgent()
Definition: SnapperAgent.cc:149
snapper::Snapper * sh
Definition: SnapperAgent.h:40
YCPMap getMapValue(const YCPMap &map, const YCPString &key)
Definition: SnapperAgent.cc:64
virtual ~SnapperAgent()
Definition: SnapperAgent.cc:162
YCPList getListValue(const YCPMap &map, const YCPString &key)
Definition: SnapperAgent.cc:51
string getValue(const YCPMap &map, const YCPString &key, const string &deflt)
Definition: SnapperAgent.cc:19
virtual YCPValue Read(const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull())
Definition: SnapperAgent.cc:199
An interface class between YaST2 and Snapper Agent.
Definition: SnapperAgent.h:33
virtual YCPList Dir(const YCPPath &path)
Definition: SnapperAgent.cc:175
string snapper_error
Definition: SnapperAgent.h:42
int getIntValue(const YCPMap &map, const YCPString &key, const int deflt)
Definition: SnapperAgent.cc:34
virtual YCPValue otherCommand(const YCPTerm &term)
Definition: SnapperAgent.cc:684

Generated on a sunny day for yast2-snapper by doxygen 1.8.5