123456789101112
CXMLString CWaypoint::toXML() { CXMLString cxml_name(this->m_name,"Name"); CXMLString cxml_lat(this->m_latitude,"Latitude"); CXMLString cxml_lon(this->m_longitude,"Longitude"); string structure; structure = "\n\t" + cxml_name + "\n\t" + cxml_lat + "\n\t" + cxml_lon + "\n"; CXMLString ret(structure,"Waypoint"); cout << "!!!" << ret << endl; return ret; }
1234567891011121314151617181920212223242526272829303132333435
#define DEGREE 1 #define MMSS 2 //#define SHOWADDRESS #define PI 3.14159 //forward declaration class CXMLString; class CWaypoint { private: double m_latitude, m_longitude; string m_name; void transformLongitude2degmmss(int&, int&, double&); void transformLatitude2degmmss(int&, int&, double&); public: void set(string, double, double); CWaypoint(string = "", double lat=0, double lon=0); void print(int); string getName(); double getLongitude(); double getLatitude(); void getAllDataByPointer(string*, double*, double*); void getAllDataByReference(string&, double&, double&); //function is of const so that a const object pass can call it (*less method*) double calculateDistance (CWaypoint const&) const; CWaypoint add (CWaypoint const&); bool less (CWaypoint const&); CXMLString toXML(); }; #endif
class CXMLString;