Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

SearchParser.H

Go to the documentation of this file.
00001 #ifndef SearchParser_h
00002 #define SearchParser_h
00003 
00004 #include <iostream>
00005 #include <string>
00006 #include <map>
00007 #include "BQStructs.H"
00008 #include "PathSearchAI.H"
00009 #include "../DBInterface/BQStructs.H"
00010 
00011 class DBInterface;
00012 
00013 using namespace std;
00014 
00016 class SearchParser{
00017         
00018         public:
00019 
00021             string xmlHeader;
00023             map<string, string> AbreviationMap ;
00024             
00026             typedef struct StreetAddress{
00027                 string strNum;
00028                 vector<string> streetName;
00029             }StreetAddress_t;
00030 
00031             //parses the address into street number and name
00033             StreetAddress_t parseAddress(string);
00034 
00036             string createMatchXML(vector<seg_t*>);
00038             string createStreetXML(seg_t);
00040             string createStreetCGI(seg_t);
00042             string createPathXML(path_t);
00043 
00045             string itostring(int);
00047             string itostring(long);
00049             string itostring(double);
00051             string longitostring(double);
00053             string num2base(double num);
00055             string toUpper(string);
00056             
00058             void loadMap();
00059 
00060 
00062         DBInterface *m_db;
00063 
00064         public:
00065 
00067             SearchParser( DBInterface* db );
00069             ~SearchParser();
00070 
00071             /* This will be called by RoutePhp-to-C++ end.
00072              * It will be passed an address (string form), and three ints for
00073              * the traffic weight, shoulder weight, and hazard weight.
00074              *
00075              * This will return a string of XML tags, storing any error
00076              * messages, the path found, and directions.
00077              *
00078              * The parser will call the findAtoBPath given from the
00079              * PathSearchAI, store this, and also call the TextRouteGen and
00080              * return the appropriate information in the XML
00081              * */
00082              
00083             //              addr,   city,   state,  zip 
00084 
00086             string getAddress(string, string, string, string, //start addr
00087                               string, string, string, string, bool); //end addr
00088 
00089             //              start id, end id, weights
00091             string getRoute(string, string, double, double);
00092             // A-> A route finding
00094             string getRoute(string, double, double, double);
00095                             
00096     };
00097 
00098 
00099 
00100 #endif

Generated on Mon May 16 11:08:36 2005 for BikeQuest by  doxygen 1.4.0