yast2-core
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IniAgent Class Reference

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

#include <IniAgent.h>

Inheritance diagram for IniAgent:
SCRAgent

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
 
- Public Member Functions inherited from SCRAgent
 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 Public Member Functions inherited from SCRAgent
static YCPValue readconf (const char *filename)
 
static SCRAgentinstance ()
 
- Public Attributes inherited from SCRAgent
SCRAgentmainscragent
 

Detailed Description

An interface class between YaST2 and Ini Agent.

Constructor & Destructor Documentation

IniAgent::IniAgent ( )

Default constructor.

Constructor

IniAgent::~IniAgent ( )
virtual

Destructor.

Destructor

References IniParser::isStarted(), last_root, parser, and IniParser::write().

Member Function Documentation

YCPList IniAgent::Dir ( const YCPPath path)
virtual
YCPTerm IniAgent::generateSysConfigTemplate ( string  fn)
private

Agent private members

References YCPTerm::add(), YCPMap::add(), and YCPList::add().

Referenced by otherCommand().

YCPValue IniAgent::otherCommand ( const YCPTerm term)
virtual
YCPValue IniAgent::Read ( const YCPPath path,
const YCPValue arg = YCPNull(),
const YCPValue optarg = YCPNull() 
)
virtual

Provides SCR Read ().

Parameters
pathPath that should be read.
argAdditional parameter.

Read

Implements SCRAgent.

References IniParser::HaveRewrites(), IniParser::inifile, IniParser::isStarted(), parser, IniSection::Read(), setLastRoot(), IniParser::UpdateIfModif(), and y2warning.

const char * IniAgent::root ( ) const
virtual

Filesystem root on which to operate. It is useful for agents during installation to operate on different root (FATE#314695).

Returns
C string owned by instance.

Reimplemented from SCRAgent.

References last_root.

void IniAgent::setLastRoot ( )
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().

YCPBoolean IniAgent::Write ( const YCPPath path,
const YCPValue value,
const YCPValue arg = YCPNull() 
)
virtual

Member Data Documentation

char* IniAgent::last_root
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().

IniParser IniAgent::parser
private

Referenced by Dir(), otherCommand(), Read(), Write(), and ~IniAgent().


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

Generated on a sunny day for yast2-core by doxygen 1.8.6