Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(729)

Unified Diff: src/mobility-service-interface/model/sax-handler.h

Issue 265730044: Code review for the mobility-service-interface
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mobility-service-interface/model/point.cc ('k') | src/mobility-service-interface/model/sax-handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mobility-service-interface/model/sax-handler.h
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/mobility-service-interface/model/sax-handler.h
@@ -0,0 +1,64 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014 CISTER - Research Center in Real-Time & Embedded Computing Systems
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Tiago Cerqueira <1090678@isep.ipp.pt> <tiago.miguel43@gmail.com>
+ */
+#ifndef SAXHANDLER_H
+#define SAXHANDLER_H
+
+#include <xercesc/sax2/DefaultHandler.hpp>
+#include "leg.h"
+#include "step.h"
+
+XERCES_CPP_NAMESPACE_USE
+namespace ns3 {
+/**
+ * \ingroup mobility
+ *
+ * \brief The SAX-based parser for the Google Maps Directions API's XML response
+ */
+class SaxHandler : public xercesc::DefaultHandler
+{
+public:
+ SaxHandler ( LegList& legList);
+// SaxHandler(const SaxHandler& orig);
+ virtual ~SaxHandler ();
+
+ void startElement (
+ const XMLCh* const uri,
+ const XMLCh* const localname,
+ const XMLCh* const qname,
+ const xercesc::Attributes& attrs
+ );
+ void endElement (
+ const XMLCh* const uri,
+ const XMLCh* const localname,
+ const XMLCh* const qname
+ );
+
+ void characters (const XMLCh* const chars,const XMLSize_t length);
+ void fatalError (const xercesc::SAXParseException&);
+private:
+ std::list<Ptr<Step> > stepList_;
+ LegList& legList_;
+ int durationOfStep;
+ std::string polyline, status;
+ bool foundStep,foundLeg,foundPolyline, foundDurationValue, foundDuration, foundStatus;
+};
+}
+#endif /* SAXHANDLER_H */
+
« no previous file with comments | « src/mobility-service-interface/model/point.cc ('k') | src/mobility-service-interface/model/sax-handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b