10 #ifndef GUARD_STGS_H_INCLUDE
11 #define GUARD_STGS_H_INCLUDE
14 #define PERST_STRING QString
16 #include <stgs/stgs-config.h>
17 #include <perst/perst_interface.h>
28 class STGS_EXPORT
Stgs :
public PerstInterface {
57 const PERST_STRING & name);
62 const PERST_STRING & name =
"");
67 const PERST_STRING & name,
68 int predicted_count = -1);
73 const PERST_STRING & name);
78 const PERST_STRING & name =
"");
100 const PERST_STRING & name);
105 const PERST_SLIST & name);
111 const PERST_STRING & name);
116 const PERST_STRING & name);
121 const PERST_STRING & name);
126 const PERST_STRING & name);
131 const PERST_STRING & name);
137 const PERST_STRING & name,
138 const PERST_STRING & default_val) {
139 if (hasKey (name))
return valueS (name);
140 else return default_val;
146 const PERST_STRING & name,
147 const PERST_SLIST & default_val) {
148 if (hasKey (name))
return valueSList (name);
149 else return default_val;
155 const PERST_STRING & name,
156 int64_t default_val) {
157 if (hasKey (name))
return valueInt (name);
158 else return default_val;
164 const PERST_STRING & name,
165 uint64_t default_val) {
166 if (hasKey (name))
return valueUInt (name);
167 else return default_val;
173 const PERST_STRING & name,
174 double default_val) {
175 if (hasKey (name))
return valueDbl (name);
176 else return default_val;
183 const PERST_STRING & name,
184 const PERST_STRING & value);
189 const PERST_STRING & name,
190 const PERST_SLIST & value);
195 const PERST_STRING & name,
201 const PERST_STRING & name,
207 const PERST_STRING & name,
209 return setValue (name, (int64_t)value);
215 const PERST_STRING & name,
228 const PERST_STRING & name,
229 const QByteArray & default_val) {
230 if (hasKey (name))
return valueBA (name);
231 else return default_val;
236 const PERST_STRING & name);
241 const PERST_STRING & name,
242 const QByteArray & value);
248 const PERST_STRING & name,
250 if (hasKey (name))
return valueB (name);
251 else return default_val;
256 const PERST_STRING & name);
261 const PERST_STRING & name,
269 const PERST_STRING & name,
270 const QDate & default_val) {
271 if (hasKey (name))
return valueDate (name);
272 else return default_val;
278 const PERST_STRING & name) {
279 return QDate::fromString (valueS (name), Qt::ISODate);
284 const PERST_STRING & name,
285 const QDate & value) {
293 const PERST_STRING & name,
294 const QTime & default_val) {
295 if (hasKey (name))
return valueTime (name);
296 else return default_val;
302 const PERST_STRING & name) {
303 return QTime::fromString (valueS (name), Qt::ISODate);
308 const PERST_STRING & name,
309 const QTime & value) {
317 const PERST_STRING & name,
318 const QDateTime & default_val) {
319 if (hasKey (name))
return valueDateTime (name);
320 else return default_val;
326 const PERST_STRING & name) {
327 return QDateTime::fromString (valueS (name), Qt::ISODate);
332 const PERST_STRING & name,
333 const QDateTime & value) {
343 #endif // GUARD_STGS_H_INCLUDE
QDateTime valueDateTime(const PERST_STRING &name)
Get the string list for a key; the value type MUST be an array of strings.
Definition: stgs.h:325
bool valueB(const PERST_STRING &name, bool default_val)
Get the real value for a key; the value type MUST be real.
Definition: stgs.h:247
QByteArray valueBA(const PERST_STRING &name, const QByteArray &default_val)
Get the real value for a key; the value type MUST be real.
Definition: stgs.h:227
QDate valueDate(const PERST_STRING &name)
Get the string list for a key; the value type MUST be an array of strings.
Definition: stgs.h:277
int version() const
Tell current version.
Definition: stgs.h:49
virtual bool setValue(const PERST_STRING &name, const QDateTime &value)
Set the real value for a key.
Definition: stgs.h:331
virtual bool setValue(const PERST_STRING &name, const PERST_STRING &value)
Set the string value for a key.
Definition: stgs.cc:213
uint64_t valueUInt(const PERST_STRING &name, uint64_t default_val)
Get the integer value for a key; the value type MUST be integer.
Definition: stgs.h:163
virtual bool setValue(const PERST_STRING &name, int value)
Set the integer value for a key.
Definition: stgs.h:206
QDateTime valueDateTime(const PERST_STRING &name, const QDateTime &default_val)
Get the string list for a key; the value type MUST be an array of strings.
Definition: stgs.h:316
int64_t valueInt(const PERST_STRING &name, int64_t default_val)
Get the integer value for a key; the value type MUST be integer.
Definition: stgs.h:154
brief description
Definition: stgs.h:28
QDate valueDate(const PERST_STRING &name, const QDate &default_val)
Get the string list for a key; the value type MUST be an array of strings.
Definition: stgs.h:268
QTime valueTime(const PERST_STRING &name)
Get the string list for a key; the value type MUST be an array of strings.
Definition: stgs.h:301
PERST_SLIST valueSList(const PERST_STRING &name, const PERST_SLIST &default_val)
Get the string list for a key; the value type MUST be an array of strings.
Definition: stgs.h:145
PERST_STRING valueS(const PERST_STRING &name, const PERST_STRING &default_val)
Get the string value for a key; the value type MUST be string.
Definition: stgs.h:136
double valueDbl(const PERST_STRING &name, double default_val)
Get the real value for a key; the value type MUST be real.
Definition: stgs.h:172
QTime valueTime(const PERST_STRING &name, const QTime &default_val)
Get the string list for a key; the value type MUST be an array of strings.
Definition: stgs.h:292
virtual bool setValue(const PERST_STRING &name, const QDate &value)
Set the real value for a key.
Definition: stgs.h:283
virtual bool setValue(const PERST_STRING &name, const QTime &value)
Set the real value for a key.
Definition: stgs.h:307