00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _SnapperAgent_h
00011 #define _SnapperAgent_h
00012
00013 #include <Y2.h>
00014 #include <scr/SCRAgent.h>
00015
00016 #include <snapper/Snapper.h>
00017 #include <snapper/Snapshot.h>
00018 #include <snapper/Comparison.h>
00019 #include <snapper/File.h>
00020
00024 class SnapperAgent : public SCRAgent
00025 {
00026 private:
00031 snapper::Snapper* sh;
00032 bool snapper_initialized;
00033 string snapper_error;
00034
00039 string getValue (const YCPMap &map, const YCPString &key, const string &deflt);
00040
00047 int getIntValue ( const YCPMap &map, const YCPString &key, const int deflt);
00048
00053 YCPList getListValue (const YCPMap &map, const YCPString &key);
00054
00059 YCPMap getMapValue (const YCPMap &map, const YCPString &key);
00060
00061 public:
00065 SnapperAgent();
00066
00070 virtual ~SnapperAgent();
00071
00077 virtual YCPValue Read ( const YCPPath &path,
00078 const YCPValue& arg = YCPNull(),
00079 const YCPValue& opt = YCPNull());
00080
00084 virtual YCPBoolean Write(const YCPPath &path,
00085 const YCPValue& arg,
00086 const YCPValue& arg2 = YCPNull());
00087
00091 virtual YCPValue Execute(const YCPPath &path,
00092 const YCPValue& arg = YCPNull(),
00093 const YCPValue& arg2 = YCPNull());
00094
00098 virtual YCPList Dir(const YCPPath& path);
00099
00103 virtual YCPValue otherCommand(const YCPTerm& term);
00104 };
00105
00106 #endif