|
yast2-snapper
|
An interface class between YaST2 and Snapper Agent. More...
#include <SnapperAgent.h>
Public Member Functions | |
| SnapperAgent () | |
| virtual | ~SnapperAgent () |
| virtual YCPValue | Read (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull()) |
| virtual YCPBoolean | Write (const YCPPath &path, const YCPValue &arg, const YCPValue &arg2=YCPNull()) |
| virtual YCPValue | Execute (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &arg2=YCPNull()) |
| virtual YCPList | Dir (const YCPPath &path) |
| virtual YCPValue | otherCommand (const YCPTerm &term) |
Private Member Functions | |
| string | getValue (const YCPMap &map, const YCPString &key, const string &deflt) |
| int | getIntValue (const YCPMap &map, const YCPString &key, const int deflt) |
| YCPList | getListValue (const YCPMap &map, const YCPString &key) |
Private Attributes | |
| snapper::Snapper * | sh |
| bool | snapper_initialized |
| string | snapper_error |
An interface class between YaST2 and Snapper Agent.
| SnapperAgent::SnapperAgent | ( | ) |
| SnapperAgent::~SnapperAgent | ( | ) | [virtual] |
| YCPValue SnapperAgent::Execute | ( | const YCPPath & | path, |
| const YCPValue & | arg = YCPNull(), |
||
| const YCPValue & | arg2 = YCPNull() |
||
| ) | [virtual] |
Provides SCR Execute ().
Execute
Execute (.snapper) call: Initialize snapper object
Rollback the list of given files from snapshot num1 to num2 (system by default)
Reimplemented from SCRAgent.
References getIntValue(), getListValue(), getValue(), YCPElement::isNull(), PC, sh, YCPList::size(), snapper_error, snapper_initialized, YCPList::value(), y2debug, y2error, and y2milestone.
| int SnapperAgent::getIntValue | ( | const YCPMap & | map, |
| const YCPString & | key, | ||
| const int | deflt | ||
| ) | [private] |
Search the map for value of given key
| map | YCP Map to look in |
| key | key we are looking for |
| deflt | the default value to be returned if key is not found |
References YCPElement::isNull(), and YCPMap::value().
Search the map for value of given key; key is string and value is YCPList
References YCPElement::isNull(), and YCPMap::value().
Referenced by Execute().
| string SnapperAgent::getValue | ( | const YCPMap & | map, |
| const YCPString & | key, | ||
| const string & | deflt | ||
| ) | [private] |
search the map for value of given key; both key and value have to be strings when key is not present, default value is returned
References YCPElement::isNull(), and YCPMap::value().
Referenced by Execute().
| YCPValue SnapperAgent::Read | ( | const YCPPath & | path, |
| const YCPValue & | arg = YCPNull(), |
||
| const YCPValue & | opt = YCPNull() |
||
| ) | [virtual] |
Provides SCR Read ().
| path | Path that should be read. |
| arg | Additional parameter. |
Read
Read (.snapper.error) -> returns last error message
Read (.snapper.path, $[ "num" : num]) -> returns the path to directory with given snapshot
Read(.snapper.snapshots) -> return list of snapshot description maps
Read(.snapper.diff_list) -> show difference between snapnots num1 and num2 as list.
Read(.snapper.diff_index) -> show difference between snapnots num1 and num2 as one-level map: (mapping each file to its changes)
Read(.snapper.diff_tree) -> show difference between snapnots num1 and num2 as tree.
Implements SCRAgent.
References YCPList::add(), YCPMap::add(), getIntValue(), YCPElement::isNull(), make_ycpmap(), PC, sh, snapper_error, snapper_initialized, Tree::trees, y2debug, and y2error.
| YCPBoolean SnapperAgent::Write | ( | const YCPPath & | path, |
| const YCPValue & | arg, | ||
| const YCPValue & | arg2 = YCPNull() |
||
| ) | [virtual] |
snapper::Snapper* SnapperAgent::sh [private] |
Agent private variables and methods
Referenced by Execute(), Read(), SnapperAgent(), and ~SnapperAgent().
string SnapperAgent::snapper_error [private] |
Referenced by Execute(), Read(), and SnapperAgent().
bool SnapperAgent::snapper_initialized [private] |
Referenced by Execute(), Read(), and SnapperAgent().
1.7.5.1