// easyxml.cxx - implementation of EasyXML interfaces.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <simgear/compiler.h>
+
+#include <string.h> // strcmp()
+
#include "easyxml.hxx"
#include "xmlparse.h"
XMLAttributes::findAttribute (const char * name) const
{
int s = size();
- for (int i = 0; i < s; i++)
+ for (int i = 0; i < s; i++) {
if (strcmp(name, getName(i)) == 0)
return i;
+ }
return -1;
}
if (pos >= 0)
return getValue(pos);
else
- return getValue(0);
+ return 0;
}
\f
public:
ExpatAtts (const char ** atts) : _atts(atts) {}
- int size () const;
- const char * getName (int i) const;
- const char * getValue (int i) const;
+ virtual int size () const;
+ virtual const char * getName (int i) const;
+ virtual const char * getValue (int i) const;
private:
const char ** _atts;
static void
start_element (void * userData, const char * name, const char ** atts)
{
- ExpatAtts attributes(atts);
- VISITOR.startElement(name, attributes);
+ VISITOR.startElement(name, ExpatAtts(atts));
}
static void