mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
RsUrl add method to test presence and get fields from query
This commit is contained in:
parent
b1aa1fc26f
commit
d113f60ca1
@ -201,6 +201,13 @@ RsUrl& RsUrl::delQueryK(const std::string& key)
|
||||
mQuery.erase(key);
|
||||
return *this;
|
||||
}
|
||||
bool RsUrl::hasQueryK(const std::string& key)
|
||||
{ return (mQuery.find(key) != mQuery.end()); }
|
||||
const std::string* RsUrl::getQueryV(const std::string& key)
|
||||
{
|
||||
if(hasQueryK(key)) return &(mQuery.find(key)->second);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const std::string& RsUrl::fragment() const { return mFragment; }
|
||||
RsUrl& RsUrl::setFragment(const std::string& fragment)
|
||||
|
@ -59,6 +59,8 @@ struct RsUrl : RsSerializable
|
||||
RsUrl& setQuery(const std::map<std::string, std::string>& query);
|
||||
RsUrl& setQueryKV(const std::string& key, const std::string& value);
|
||||
RsUrl& delQueryK(const std::string& key);
|
||||
bool hasQueryK(const std::string& key);
|
||||
const std::string* getQueryV(const std::string& key);
|
||||
|
||||
const std::string& fragment() const;
|
||||
RsUrl& setFragment(const std::string& fragment);
|
||||
|
Loading…
Reference in New Issue
Block a user