void URI::setScheme(const std::string& scheme) { _scheme = scheme; toLowerInPlace(_scheme); if (_port == 0) _port = getWellKnownPort(); }
unsigned short URI::getPort() const { if (_port == 0) return getWellKnownPort(); else return _port; }
URI::URI(const std::string& scheme, const std::string& pathEtc): _scheme(scheme), _port(0) { toLowerInPlace(_scheme); _port = getWellKnownPort(); std::string::const_iterator beg = pathEtc.begin(); std::string::const_iterator end = pathEtc.end(); parsePathEtc(beg, end); }
bool URI::isWellKnownPort() const { return _port == getWellKnownPort(); }