20 #ifndef __VARMAP_INC__
21 #define __VARMAP_INC__
30 #include <QStringList>
69 typedef QMap<QString, VarData*>
vmap;
72 typedef QMap<QString, VarData*>::iterator
iterator;
113 int count (
void )
const
114 {
return vars_.count(); }
117 int count (
const QString & s_name )
const;
123 void clear (
const QString & s_name );
126 bool delVar (
const QString & s_name );
129 QStringList names (
void )
const
130 {
return vars_.keys(); }
133 iterator begin (
void )
134 {
return vars_.begin(); }
137 iterator end (
void )
138 {
return vars_.end(); }
149 void setValue (
const QString & s_name,
const QStringList & sl );
152 void setValue (
const QString & s_name, QString s,
int index = 0 );
155 void setValue (
const QString & s_name, qint64 i,
int index = 0 );
158 void setValue (
const QString & s_name,
bool b,
int index = 0 );
161 void setValue (
const QString & s_name,
double d,
int index = 0 );
164 void appendValue (
const QString & s_name, QString s );
167 void appendValue (
const QString & s_name, qint64 i );
170 void appendValue (
const QString & s_name,
bool b );
173 void appendValue (
const QString & s_name,
double d );
176 void append (
const QString & s_name,
const QStringList & sl );
189 bool contains (
const QString & s_name )
const
190 {
return vars_.contains( s_name ); }
193 VarData * value (
const QString & s_name )
const
194 {
return vars_.
value( s_name ); }
197 VarData * sureValue (
const QString & s_name );
200 QString valueS (
const QString & s_name,
int i = 0 )
const
203 if ( ( vd == NULL ) || ( vd->
count() == 0 ) ) {
206 return vd->
value( i );
211 QStringList valueSL (
const QString & s_name )
const
215 return QStringList();
217 const QStringList & sl = vd->
valueSL();
233 bool isInteger (
const QString & s_name,
int i = 0 )
const;
236 bool isDouble (
const QString & s_name,
int i = 0 )
const;
239 bool isBool (
const QString & s_name,
int i = 0 )
const;
242 qint64 toInteger (
const QString & s_name,
bool * b_ok = NULL,
int i = 0 )
const;
245 double toDouble (
const QString & s_name,
bool * b_ok = NULL,
int i = 0 )
const;
248 bool toBool (
const QString & s_name,
bool * b_ok = NULL,
int i = 0 )
const;
256 void unite (
const VarMap & other, UniteType ut = FavorOther );
259 void extendToFit (
const QString & s_name,
int i );
267 static QStringList toNamespaceList (
const QString & s );
286 #endif // __VARMAP_INC__