1 #include "httpclient_p.h"
3 #include <QXmlStreamReader>
6 HttpClientPrivate::HttpClientPrivate( QObject *parent )
10 HttpClientPrivate::~HttpClientPrivate()
14 RouteData HttpClientPrivate::parseReply( const QByteArray &reply )
18 QXmlStreamReader xml( reply );
22 while ( !xml.atEnd() ) {
24 if ( xml.isStartElement() && xml.name() == "LINE" ) {
25 QString lineCode( xml.attributes().value("code").toString() );
27 retVal.lineCode = lineCode;
31 if ( inLine && xml.name() == "STOP" ) {
34 if ( inLine && inStop && xml.name() == "ARRIVAL" ) {
35 QString arrivalTime( xml.attributes().value("time").toString() );
37 retVal.arrivalTime = arrivalTime;
41 if ( xml.isEndElement() && xml.name() == "STOP" ) {
44 if ( xml.isEndElement() && xml.name() == "LINE" ) {
49 if ( xml.hasError() ) {
50 qDebug() << "xml error";