#ifndef ENDPOINT_H #define ENDPOINT_H #include #include ///////////////////////////////////////////////////////////////////////// // Manage addresses in the form 127.0.0.1:8000 class EndPoint { public: EndPoint(const std::string& address, long port); EndPoint(const std::string& eps); std::string address(); long port(); std::string& ToString(); private: std::string ep; }; ///////////////////////////////////////////////////////////// // converters to and from string template std::string ToString(T t) { std::ostringstream temp; temp << t; return temp.str(); } template T FromString(const std::string& s) { T t; std::istringstream temp(s); temp >> t; return t; } #endif