#include <AnyAgent.h>
Inheritance diagram for AnyAgent:

Public Member Functions | |
| AnyAgent () | |
| ~AnyAgent () | |
| YCPValue | Read (const YCPPath &path, const YCPValue &arg=YCPNull(), const YCPValue &opt=YCPNull()) |
| YCPBoolean | Write (const YCPPath &path, const YCPValue &value, const YCPValue &arg=YCPNull()) |
| YCPList | Dir (const YCPPath &path) |
| YCPValue | otherCommand (const YCPTerm &term) |
Private Types | |
| enum | { MTYPE_NONE, MTYPE_FILE, MTYPE_PROG, MTYPE_LOCAL } |
Private Member Functions | |
| YCPValue | readValueByPath (const YCPValue &value, const YCPPath &path) |
| YCPValue | writeValueByPath (const YCPValue ¤t, const YCPPath &path, const YCPValue &value) |
| YCPValue | findSyntax (const YCPValue &syntax, const YCPPath &path) |
| const char * | get_line (FILE *fp) |
| YCPValue | parseIp4Number (char const *&lptr, bool optional) |
| const string | unparseIp4Number (const YCPValue &value) |
| YCPValue | parseBoolean (char const *&lptr, bool optional) |
| const string | unparseBoolean (const YCPValue &value) |
| YCPValue | parseNumber (char const *&lptr, bool optional) |
| const string | unparseNumber (const YCPValue &value) |
| YCPValue | parseHexval (char const *&lptr, bool optional) |
| const string | unparseHexval (const YCPValue &value) |
| YCPValue | parseString (char const *&lptr, const char *set, const char *stripped, bool optional) |
| const string | unparseString (const YCPValue &syntax, const YCPValue &stripped, const YCPValue &value) |
| YCPValue | parseFloat (char const *&lptr, bool optional) |
| const string | unparseFloat (const YCPValue &value) |
| YCPValue | parseHostname (char const *&lptr, bool optional) |
| const string | unparseHostname (const YCPValue &value) |
| YCPValue | parseUsername (char const *&lptr, bool optional) |
| const string | unparseUsername (const YCPValue &value) |
| YCPValue | parseVerbose (char const *&lptr, const char *match, bool optional) |
| const string | unparseVerbose (const YCPValue &value) |
| YCPValue | parseSeparator (char const *&lptr, const char *match, bool optional) |
| const string | unparseSeparator (const YCPValue &match) |
| const char * | getLine (void) |
| const string | putLine (const string s) |
| YCPValue | parseChoice (char const *&line, const YCPList &syntax, bool optional) |
| const string | unparseChoice (const YCPList &syntax, const YCPValue &value) |
| YCPValue | parseSequence (char const *&line, const YCPList &syntax, bool optional) |
| const string | unparseSequence (const YCPList &syntax, const YCPValue &value) |
| YCPValue | parseList (char const *&line, const YCPList &syntax, bool optional) |
| const string | unparseList (const YCPList &syntax, const YCPValue &value) |
| YCPValue | parseTuple (char const *&line, const YCPList &syntax, bool optional) |
| const string | unparseTuple (const YCPList &syntax, const YCPValue &value) |
| YCPValue | parseData (char const *&line, const YCPValue &syntax, bool optional) |
| const string | unparseData (const YCPValue &syntax, const YCPValue &value) |
| YCPValue | validateCache (const YCPList &data, const YCPValue &arg=YCPNull()) |
| YCPValue | readFile (const YCPValue &arg) |
| const string | writeFile (const YCPValue &arg) |
| string | evalArg (const YCPValue &arg) |
| int | lineNumber () const |
Private Attributes | |
| bool | description_read |
| time_t | mtime |
| YCPValue | cache |
| bool | cchanged |
| YCPList | alldata |
| bool | achanged |
| bool | mReadOnly |
| enum AnyAgent:: { ... } | mType |
| YCPValue | mName |
| string | mComment |
| bool | isFillup |
| YCPValue | mSyntax |
| YCPValue | mHeader |
| int | line_number |
| stack< string > | tupleName |
| stack< YCPValue > | tupleValue |
| bool | tupleContinue |
| AnyAgent::AnyAgent | ( | ) |
Creates a new AnyAgent.
| AnyAgent::~AnyAgent | ( | ) |
Cleans up
| YCPValue AnyAgent::Read | ( | const YCPPath & | path, | |
| const YCPValue & | arg = YCPNull(), |
|||
| const YCPValue & | opt = YCPNull() | |||
| ) | [virtual] |
Reads data. Destroy the result after use.
| path | Specifies what part of the subtree should be read. The path is specified _relatively_ to Root()! |
Implements SCRAgent.
| YCPBoolean AnyAgent::Write | ( | const YCPPath & | path, | |
| const YCPValue & | value, | |||
| const YCPValue & | arg = YCPNull() | |||
| ) | [virtual] |
Writes data. Destroy the result after use.
Implements SCRAgent.
Get a list of all subtrees.
Implements SCRAgent.
Evaluates the Description () command
Reimplemented from SCRAgent.
readValueByPath
read sub-value denoted by path
if path == .<num> && value->isList() return element <num> of list
if path == .<name> && value->isMap() return element <name> of list
| YCPValue AnyAgent::writeValueByPath | ( | const YCPValue & | current, | |
| const YCPPath & | path, | |||
| const YCPValue & | value | |||
| ) | [private] |
writeValueByPath
write sub-value denoted by path to current
return new current
if path == .<num> && value->isList() return element <num> of list
if path == .<name> && value->isMap() return element <name> of list
findSyntax
find syntax for path
| const char * AnyAgent::get_line | ( | FILE * | fp | ) | [private] |
| YCPValue AnyAgent::parseIp4Number | ( | char const *& | lptr, | |
| bool | optional | |||
| ) | [private] |
Purpose: basic type handling for AnyAgent
Creator: kkaempf@suse.de Maintainer: kkaempf@suse.de
| const string AnyAgent::unparseIp4Number | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseBoolean | ( | char const *& | lptr, | |
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseBoolean | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseNumber | ( | char const *& | lptr, | |
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseNumber | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseHexval | ( | char const *& | lptr, | |
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseHexval | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseString | ( | char const *& | lptr, | |
| const char * | set, | |||
| const char * | stripped, | |||
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseString | ( | const YCPValue & | syntax, | |
| const YCPValue & | stripped, | |||
| const YCPValue & | value | |||
| ) | [private] |
| YCPValue AnyAgent::parseFloat | ( | char const *& | lptr, | |
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseFloat | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseHostname | ( | char const *& | lptr, | |
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseHostname | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseUsername | ( | char const *& | lptr, | |
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseUsername | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseVerbose | ( | char const *& | lptr, | |
| const char * | match, | |||
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseVerbose | ( | const YCPValue & | value | ) | [private] |
| YCPValue AnyAgent::parseSeparator | ( | char const *& | lptr, | |
| const char * | match, | |||
| bool | optional | |||
| ) | [private] |
| const string AnyAgent::unparseSeparator | ( | const YCPValue & | match | ) | [private] |
| char const * AnyAgent::getLine | ( | void | ) | [private] |
| const string AnyAgent::putLine | ( | const string | s | ) | [private] |
| YCPValue AnyAgent::parseChoice | ( | char const *& | line, | |
| const YCPList & | syntax, | |||
| bool | optional | |||
| ) | [private] |
| YCPValue AnyAgent::parseSequence | ( | char const *& | line, | |
| const YCPList & | syntax, | |||
| bool | optional | |||
| ) | [private] |
| YCPValue AnyAgent::parseList | ( | char const *& | line, | |
| const YCPList & | syntax, | |||
| bool | optional | |||
| ) | [private] |
| YCPValue AnyAgent::parseTuple | ( | char const *& | line, | |
| const YCPList & | syntax, | |||
| bool | optional | |||
| ) | [private] |
| YCPValue AnyAgent::parseData | ( | char const *& | line, | |
| const YCPValue & | syntax, | |||
| bool | optional | |||
| ) | [private] |
| YCPValue AnyAgent::validateCache | ( | const YCPList & | data, | |
| const YCPValue & | arg = YCPNull () | |||
| ) | [private] |
validateCache
parse file according to mSyntax and construct YCPValueRep
readFile
read complete file to alldata
| const string AnyAgent::writeFile | ( | const YCPValue & | arg | ) | [private] |
writeFile
| string AnyAgent::evalArg | ( | const YCPValue & | arg | ) | [private] |
| int AnyAgent::lineNumber | ( | ) | const [private] |
bool AnyAgent::description_read [private] |
Starts with false and is set to true as soon as the Description is read. Any Read/Write/Dir command prior to the reading of the description is invalid.
time_t AnyAgent::mtime [private] |
file cache mtime = file's mtime when alldata was filled cache = parsed file alldata = list of YCPStringRep with all data from file
YCPValue AnyAgent::cache [private] |
bool AnyAgent::cchanged [private] |
YCPList AnyAgent::alldata [private] |
bool AnyAgent::achanged [private] |
bool AnyAgent::mReadOnly [private] |
true if file is read-only
enum { ... } AnyAgent::mType [private] |
type of mName
YCPValue AnyAgent::mName [private] |
name of system file or program
string AnyAgent::mComment [private] |
comment characters
bool AnyAgent::isFillup [private] |
YCPValue AnyAgent::mSyntax [private] |
syntax description of system file
YCPValue AnyAgent::mHeader [private] |
syntax description of header lines
int AnyAgent::line_number [private] |
Used for line counting while parsing the target file.
stack<string> AnyAgent::tupleName [private] |
tuple parsing
stack<YCPValue> AnyAgent::tupleValue [private] |
bool AnyAgent::tupleContinue [private] |
1.5.0