yast2-core
|
An interface class between YaST2 and Ini Agent. More...
#include <IniAgent.h>
Public Member Functions | |
IniAgent () | |
virtual | ~IniAgent () |
virtual YCPValue | Read (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &optarg=YCPNull()) |
virtual YCPBoolean | Write (const YCPPath &path, const YCPValue &value, const YCPValue &arg=YCPNull()) |
virtual YCPList | Dir (const YCPPath &path) |
virtual YCPValue | otherCommand (const YCPTerm &term) |
virtual const char * | root () const |
![]() | |
SCRAgent () | |
virtual | ~SCRAgent () |
virtual YCPValue | Execute (const YCPPath &path, const YCPValue &=YCPNull(), const YCPValue &=YCPNull()) |
virtual YCPMap | Error (const YCPPath &) |
virtual YCPBoolean | RegisterAgent (const YCPPath &path, const YCPValue &) |
virtual YCPBoolean | UnregisterAgent (const YCPPath &path) |
virtual YCPBoolean | UnregisterAllAgents () |
virtual YCPBoolean | UnmountAgent (const YCPPath &) |
virtual YCPBoolean | RegisterNewAgents () |
void | setAsCurrentSCR () |
string | targetPath (const string &path) const |
Private Member Functions | |
YCPTerm | generateSysConfigTemplate (string fn) |
void | setLastRoot () |
Private Attributes | |
IniParser | parser |
char * | last_root |
Additional Inherited Members | |
![]() | |
static YCPValue | readconf (const char *filename) |
static SCRAgent * | instance () |
![]() | |
SCRAgent * | mainscragent |
An interface class between YaST2 and Ini Agent.
IniAgent::IniAgent | ( | ) |
Default constructor.
Constructor
|
virtual |
Destructor.
Destructor
References IniParser::isStarted(), last_root, parser, and IniParser::write().
Provides SCR Write ().
Dir
Implements SCRAgent.
References IniSection::Dir(), IniParser::inifile, IniParser::isStarted(), parser, setLastRoot(), IniParser::UpdateIfModif(), and y2warning.
|
private |
Agent private members
References YCPTerm::add(), YCPMap::add(), and YCPList::add().
Referenced by otherCommand().
Used for mounting the agent.
otherCommand
Reimplemented from SCRAgent.
References generateSysConfigTemplate(), IniParser::initFiles(), IniParser::initMachine(), YCPTerm::name(), IniParser::parse(), parser, setLastRoot(), YCPTerm::size(), YCPTerm::value(), and YCPError().
|
virtual |
Provides SCR Read ().
path | Path that should be read. |
arg | Additional parameter. |
Read
Implements SCRAgent.
References IniParser::HaveRewrites(), IniParser::inifile, IniParser::isStarted(), parser, IniSection::Read(), setLastRoot(), IniParser::UpdateIfModif(), and y2warning.
|
virtual |
|
private |
Helper to lazy load root when operation happen on agent. It must be placed everywhere where action with agent happen like Read, Write or OtherCommand. It must not be called on destructor as it depends on SCR root that can be already destructed.
References last_root, SCRAgent::mainscragent, and SCRAgent::root().
Referenced by Dir(), otherCommand(), Read(), and Write().
|
virtual |
Provides SCR Write ().
Write
Implements SCRAgent.
References IniSection::clean(), IniSection::Delete(), IniParser::deleted_sections, IniParser::getFileName(), IniSection::getSubSectionRewriteBy(), IniParser::HaveRewrites(), IniParser::inifile, IniParser::isStarted(), parser, IniParser::repeatNames(), IniBase::setDirty(), setLastRoot(), IniParser::write(), IniSection::Write(), y2warning, and ycp2error.
|
private |
remember root used in last operation. It is needed during destructor write, because original scr can be already destructed leading to segfault C string is owned by class and should be destructed with free as it is allocated with strdup
Referenced by root(), setLastRoot(), and ~IniAgent().
|
private |
Referenced by Dir(), otherCommand(), Read(), Write(), and ~IniAgent().