std::string URL::host() const { if (hasHost()) return _buf.substr(_parser.field_data[UF_HOST].off, _parser.field_data[UF_HOST].len); return std::string(); }
void URL::updateHost(const std::string& host) { if (!hasHost()) throw std::runtime_error("Cannot update invalid URL"); std::string tmp(str()); util::replaceInPlace(tmp, this->host(), host); parse(tmp); }
void QUrl::setProtocol( const QString& protocol ) { d->protocol = protocol; if ( hasHost() ) d->isValid = TRUE; }