1
0
Fork 0

Update for path-aware easyXML API

This commit is contained in:
James Turner 2016-07-03 23:43:39 +01:00
parent 0a3756ea01
commit 7f3fe584e3
7 changed files with 10 additions and 10 deletions

View file

@ -54,7 +54,7 @@ void XMLLoader::load(FGGroundNetwork* net)
t.stamp();
try {
FGGroundNetXMLLoader visitor(net);
readXML(path.local8BitStr(), visitor);
readXML(path, visitor);
} catch (sg_exception& e) {
SG_LOG(SG_NAVAID, SG_INFO, "parsing groundnet XML failed:" << e.getFormattedMessage());
}
@ -106,7 +106,7 @@ bool XMLLoader::loadAirportXMLDataIntoVisitor(const string& aICAO,
}
SG_LOG(SG_GENERAL, SG_DEBUG, "loadAirportXMLDataIntoVisitor: loading from " << path);
readXML(path.local8BitStr(), aVisitor);
readXML(path, aVisitor);
return true;
}

View file

@ -170,7 +170,7 @@ void YASim::init()
f.append(fgGetString("/sim/aero"));
f.concat(".xml");
try {
readXML(f.local8BitStr(), *_fdm);
readXML(f, *_fdm);
} catch (const sg_exception &e) {
SG_LOG(SG_FLIGHT, SG_ALERT,
"Error reading YASim FDM: '" << f << "'" << std::endl

View file

@ -52,7 +52,7 @@ int main(int argc, char** argv)
// Read
try {
readXML(argv[1], fdm);
readXML(SGPath::fromLocal8Bit(argv[1]), fdm);
} catch (const sg_exception &e) {
printf("XML parse error: %s (%s)\n",
e.getFormattedMessage().c_str(), e.getOrigin());

View file

@ -83,7 +83,7 @@ int main(int argc, char** argv)
// Read
try {
string file = argv[1];
readXML(file, *fdm);
readXML(SGPath(file), *fdm);
} catch (const sg_exception &e) {
printf("XML parse error: %s (%s)\n",
e.getFormattedMessage().c_str(), e.getOrigin());

View file

@ -727,7 +727,7 @@ bool FlightPlan::loadGpxFormat(const SGPath& path)
GpxXmlVisitor gpxVistor(this);
try
{
readXML(path.local8BitStr(), gpxVistor);
readXML(path, gpxVistor);
} catch (sg_exception& e)
{
// XML parsing fails => not a GPX XML file

View file

@ -379,7 +379,7 @@ void RouteBase::loadAirportProcedures(const SGPath& aPath, FGAirport* aApt)
assert(aApt);
try {
NavdataVisitor visitor(aApt, aPath);
readXML(aPath.local8BitStr(), visitor);
readXML(aPath, visitor);
} catch (sg_io_exception& ex) {
SG_LOG(SG_NAVAID, SG_WARN, "failure parsing procedures: " << aPath <<
"\n\t" << ex.getMessage() << "\n\tat:" << ex.getLocation().asString());

View file

@ -167,7 +167,7 @@ public:
SGPath path = globals->get_fg_root();
path.append("/Traffic/");
path.append(attval);
readXML(path.local8BitStr(), *this);
readXML(path, *this);
}
elementValueStack.push_back("");
// cout << " " << atts.getName(i) << '=' << atts.getValue(i) << endl;
@ -385,7 +385,7 @@ private:
SG_LOG(SG_AI, SG_INFO, "parsing traffic in:" << p);
simgear::PathList trafficFiles = d2.children(simgear::Dir::TYPE_FILE, ".xml");
BOOST_FOREACH(SGPath xml, trafficFiles) {
readXML(xml.local8BitStr(), *this);
readXML(xml, *this);
if (_cancelThread) {
return;
}
@ -564,7 +564,7 @@ void FGTrafficManager::init()
// use a SchedulerParser to parse, but run it in this thread,
// i.e don't start it
ScheduleParseThread parser(this);
readXML(path.local8BitStr(), parser);
readXML(path, parser);
}
} else if (path.extension() == "conf") {
if (path.exists()) {