Ejemplo n.º 1
0
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();
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
void QUrl::setProtocol( const QString& protocol )
{
    d->protocol = protocol;
    if ( hasHost() )
	d->isValid = TRUE;
}