yast2-snapper
Public Member Functions | Private Member Functions | Private Attributes
SnapperAgent Class Reference

An interface class between YaST2 and Snapper Agent. More...

#include <SnapperAgent.h>

Inheritance diagram for SnapperAgent:
SCRAgent

List of all members.

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

Detailed Description

An interface class between YaST2 and Snapper Agent.


Constructor & Destructor Documentation

SnapperAgent::SnapperAgent ( )

Default constructor.

Constructor

References sh, snapper_error, and snapper_initialized.

SnapperAgent::~SnapperAgent ( ) [virtual]

Destructor.

Destructor

References sh.


Member Function Documentation

YCPList SnapperAgent::Dir ( const YCPPath path) [virtual]

Provides SCR Dir ().

Dir

Implements SCRAgent.

References y2error.

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

Parameters:
mapYCP Map to look in
keykey we are looking for
defltthe default value to be returned if key is not found

References YCPElement::isNull(), and YCPMap::value().

Referenced by Execute(), and Read().

YCPList SnapperAgent::getListValue ( const YCPMap map,
const YCPString key 
) [private]

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::otherCommand ( const YCPTerm term) [virtual]

Used for mounting the agent.

otherCommand

Reimplemented from SCRAgent.

References YCPTerm::name().

YCPValue SnapperAgent::Read ( const YCPPath path,
const YCPValue arg = YCPNull(),
const YCPValue opt = YCPNull() 
) [virtual]

Provides SCR Read ().

Parameters:
pathPath that should be read.
argAdditional 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]

Provides SCR Write ().

Write

Implements SCRAgent.

References y2debug.


Member Data Documentation

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().

Referenced by Execute(), Read(), and SnapperAgent().


The documentation for this class was generated from the following files:

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