mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Few fixes in RsUrl
This commit is contained in:
parent
518df99243
commit
8542abd4f0
@ -154,16 +154,21 @@ RsUrl& RsUrl::setHost(const std::string& host)
|
||||
}
|
||||
|
||||
bool RsUrl::hasPort() const { return mHasPort; }
|
||||
|
||||
uint16_t RsUrl::port(uint16_t def) const
|
||||
{
|
||||
if(mHasPort) return mPort;
|
||||
return def;
|
||||
}
|
||||
|
||||
RsUrl& RsUrl::setPort(uint16_t port)
|
||||
{
|
||||
mPort = port;
|
||||
mHasPort = true;
|
||||
return *this;
|
||||
}
|
||||
RsUrl& RsUrl::unsetPort()
|
||||
{
|
||||
mPort = 0;
|
||||
mHasPort = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ struct RsUrl
|
||||
bool hasPort() const;
|
||||
uint16_t port(uint16_t def = 0) const;
|
||||
RsUrl& setPort(uint16_t port);
|
||||
RsUrl& unsetPort();
|
||||
|
||||
const std::string& path() const;
|
||||
RsUrl& setPath(const std::string& path);
|
||||
|
Loading…
Reference in New Issue
Block a user