yast2-core
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
agent-any
src
AnyAgent.h
Go to the documentation of this file.
1
10
// -*- c++ -*-
11
12
#ifndef AnyAgent_h
13
#define AnyAgent_h
14
15
16
#include <stdio.h>
17
#include <sys/types.h>
18
#include <stack>
19
#include <
scr/SCRAgent.h
>
20
21
using
std::stack;
22
23
27
class
AnyAgent
:
public
SCRAgent
28
{
34
bool
description_read
;
35
42
time_t
mtime
;
43
YCPValue
cache
;
44
bool
cchanged
;
45
YCPList
alldata
;
46
bool
achanged
;
47
51
bool
mReadOnly
;
52
56
enum
{
MTYPE_NONE
,
MTYPE_FILE
,
MTYPE_PROG
,
MTYPE_LOCAL
}
mType
;
57
61
YCPValue
mName
;
62
66
string
mComment
;
67
bool
isFillup
;
68
72
YCPValue
mSyntax
;
73
77
YCPValue
mHeader
;
78
82
int
line_number
;
83
87
stack <string>
tupleName
;
88
stack <YCPValue>
tupleValue
;
89
bool
tupleContinue
;
90
91
public
:
92
96
AnyAgent
();
97
101
~AnyAgent
();
102
108
YCPValue
Read
(
const
YCPPath
& path,
const
YCPValue
& arg =
YCPNull
(),
const
YCPValue
& opt =
YCPNull
());
109
113
YCPBoolean
Write
(
const
YCPPath
& path,
const
YCPValue
& value,
114
const
YCPValue
& arg =
YCPNull
());
115
119
YCPList
Dir
(
const
YCPPath
& path);
120
124
YCPValue
otherCommand
(
const
YCPTerm
& term);
125
126
private
:
127
128
YCPValue
readValueByPath
(
const
YCPValue
& value,
const
YCPPath
& path);
129
YCPValue
writeValueByPath
(
const
YCPValue
& current,
const
YCPPath
& path,
130
const
YCPValue
& value);
131
132
YCPValue
findSyntax
(
const
YCPValue
& syntax,
const
YCPPath
& path);
133
134
const
char
*
get_line
(FILE * fp);
135
136
//
137
// Basic types (AnyAgentBasic)
138
//
139
140
YCPValue
parseIp4Number
(
char
const
*&lptr,
bool
optional);
141
const
string
unparseIp4Number
(
const
YCPValue
& value);
142
143
YCPValue
parseBoolean
(
char
const
*&lptr,
bool
optional);
144
const
string
unparseBoolean
(
const
YCPValue
& value);
145
146
YCPValue
parseNumber
(
char
const
*&lptr,
bool
optional);
147
const
string
unparseNumber
(
const
YCPValue
& value);
148
149
YCPValue
parseHexval
(
char
const
*&lptr,
bool
optional);
150
const
string
unparseHexval
(
const
YCPValue
& value);
151
152
YCPValue
parseString
(
char
const
*&lptr,
const
char
*
set
,
const
char
*stripped,
153
bool
optional);
154
const
string
unparseString
(
const
YCPValue
& syntax,
const
YCPValue
& stripped,
155
const
YCPValue
& value);
156
157
YCPValue
parseFloat
(
char
const
*&lptr,
bool
optional);
158
const
string
unparseFloat
(
const
YCPValue
& value);
159
160
YCPValue
parseHostname
(
char
const
*&lptr,
bool
optional);
161
const
string
unparseHostname
(
const
YCPValue
& value);
162
163
YCPValue
parseUsername
(
char
const
*&lptr,
bool
optional);
164
const
string
unparseUsername
(
const
YCPValue
& value);
165
166
YCPValue
parseVerbose
(
char
const
*&lptr,
const
char
*match,
bool
optional);
167
const
string
unparseVerbose
(
const
YCPValue
& value);
168
169
YCPValue
parseSeparator
(
char
const
*&lptr,
const
char
*match,
bool
optional);
170
const
string
unparseSeparator
(
const
YCPValue
& match);
171
172
const
char
*
getLine
(
void
);
173
const
string
putLine
(
const
string
s);
174
175
//
176
// Complex types (AnyAgentComplex)
177
//
178
179
YCPValue
parseChoice
(
char
const
*&line,
const
YCPList
& syntax,
bool
optional);
180
const
string
unparseChoice
(
const
YCPList
& syntax,
const
YCPValue
& value);
181
182
YCPValue
parseSequence
(
char
const
*&line,
const
YCPList
& syntax,
bool
optional);
183
const
string
unparseSequence
(
const
YCPList
& syntax,
const
YCPValue
& value);
184
185
YCPValue
parseList
(
char
const
*&line,
const
YCPList
& syntax,
bool
optional);
186
const
string
unparseList
(
const
YCPList
& syntax,
const
YCPValue
& value);
187
188
YCPValue
parseTuple
(
char
const
*&line,
const
YCPList
& syntax,
bool
optional);
189
const
string
unparseTuple
(
const
YCPList
& syntax,
const
YCPValue
& value);
190
191
YCPValue
parseData
(
char
const
*&line,
const
YCPValue
& syntax,
bool
optional);
192
const
string
unparseData
(
const
YCPValue
& syntax,
const
YCPValue
& value);
193
194
YCPValue
validateCache
(
const
YCPList
& data,
const
YCPValue
& arg =
YCPNull
());
195
YCPValue
readFile
(
const
YCPValue
& arg);
196
const
string
writeFile
(
const
YCPValue
& arg);
197
198
string
evalArg
(
const
YCPValue
& arg);
199
200
int
lineNumber
()
const
;
201
202
};
203
204
205
#endif // AnyAgent_h
Generated on a sunny day for yast2-core by
1.8.2