23 using namespace hippodraw;
30 #if QT_VERSION < 0x040000
64 #if QT_VERSION < 0x040000
65 return string ( tagname.
latin1() );
67 return tagname.toStdString ();
74 if ( value == QString::null )
return 0;
77 int id = value.
toInt ( &ok );
78 if ( ok ==
false )
id = 0;
89 getNode (
const std::string & tagName )
const
92 QString tagname ( tagName.c_str () );
94 if ( node.isNull () )
return 0;
97 assert ( element.isNull () == false );
106 std::list < XmlElement * > & nodeList )
const
108 QString tag_name ( tagName.c_str() );
112 unsigned int size ( nodelist.count () );
113 for (
unsigned int i = 0; i <
size; i++ ) {
114 QDomNode node = nodelist.item ( i );
125 assert ( ! name.empty () );
134 assert ( ! name.empty () );
136 unsigned int value = yes ? 1 : 0;
144 assert ( ! name.empty () );
152 assert ( ! name.empty () );
162 assert ( ! name.empty () );
167 #if QT_VERSION < 0x040000
170 const QString qname ( name.c_str() );
171 const string text ( vtext.c_str() );
172 const QString qtext ( text.c_str() );
180 const std::string & value )
182 assert ( ! name.empty () );
188 attribute (
const std::string & name,
int & value )
const
191 if ( rstring == QString::null )
return false;
194 int val = rstring.
toInt ( & ok );
195 if ( ! ok )
return false;
204 attribute (
const std::string & name,
bool & value )
const
207 if ( rstring == QString::null )
return false;
210 int val = rstring.
toInt ( & ok );
211 if ( ! ok )
return false;
213 value = ( val = 1 ) ?
true :
false;
220 attribute (
const std::string & name,
unsigned int & value )
const
223 if ( rstring == QString::null )
return false;
226 int val = rstring.
toUInt ( & ok );
227 if ( ! ok )
return false;
236 attribute (
const std::string & name,
float & value )
const
239 if ( rstring == QString::null )
return false;
242 float val = rstring.
toFloat ( & ok );
243 if ( ! ok )
return false;
252 attribute (
const std::string & name,
double & value )
const
255 if ( rstring == QString::null )
return false;
258 float val = rstring.
toDouble ( & ok );
259 if ( ! ok )
return false;
268 attribute (
const std::string & name, std::string & value )
const
271 if ( val == QString::null )
return false;
273 #if QT_VERSION < 0x040000
276 value = val.toStdString ();
287 #if QT_VERSION < 0x040000
290 text = t.toStdString ();