gz/common/URI.hh
Go to the documentation of this file.
Definition: gz/common/URI.hh:64
bool operator==(const URIAuthority &_auth) const
Return true if the two authorities match.
URIAuthority(const std::string &_str)
Construct a URIAuthority object from a string.
void SetEmptyHostValid(bool _valid) const
Set whether an empty host is considered valid. This should only be set to true if the corresponding U...
URIAuthority & operator=(const URIAuthority &_auth)
Assignment operator.
URIAuthority(const URIAuthority &_path)
Copy constructor.
bool Parse(const std::string &_str, bool _emptyHostValid=false)
Parse a string as URIAuthority.
static bool Valid(const std::string &_str, bool _emptyHostValid=false)
Return true if the string is a valid path.
bool EmptyHostValid() const
True if an empty host is considered valid.
void SetUserInfo(const std::string &_userInfo) const
Set the user information.
URIFragment(const std::string &_str)
Construct a URIFragment object from a string.
URIFragment & operator=(const URIFragment &_fragment)
Assignment operator.
bool Parse(const std::string &_string)
Parse a string as URIFragment.
static bool Valid(const std::string &_str)
Check if a string is a valid URI fragment.
bool operator==(const URIFragment &_fragment) const
Return true if the two fragments contain the same values.
URIFragment & operator=(const std::string &_fragment)
Assignment operator.
URIFragment(const URIFragment &_fragment)
Copy constructor.
A URI path contains a sequence of segments separated by /. The path may be empty in a valid URI....
Definition: gz/common/URI.hh:169
std::string PopBack()
Remove the part that's in the back of this path and return it.
bool operator==(const URIPath &_path) const
Return true if the two paths match.
const URIPath & operator/=(const std::string &_part)
Compound assignment operator.
const URIPath operator/(const std::string &_part) const
Get the current path with the _part added to the end.
void PushFront(const std::string &_part)
Push a new part onto the front of this path.
void SetAbsolute(bool _absolute=true)
Set whether the path is to be treated absolute or not.
std::string Str(const std::string &_delim="/") const
Get the path as a string.
static bool Valid(const std::string &_str)
Return true if the string is a valid path.
URIPath(const std::string &_str)
Construct a URIPath object from a string.
std::string PopFront()
Remove the part that's in the front of this path and return it.
void PushBack(const std::string &_part)
Push a new part onto the back of this path.
bool IsAbsolute() const
Returns whether the path is absolute or not.
URIQuery(const std::string &_str)
Construct a URIQuery object from a string.
void Insert(const std::string &_key, const std::string &_value)
Get this query with a new _key=_value pair added.
URIQuery & operator=(const URIQuery &_query)
Assignment operator.
static bool Valid(const std::string &_str)
Check if a string is a valid URI query.
bool operator==(const URIQuery &_query) const
Return true if the two queries contain the same values.
std::string Str(const std::string &_delim="&") const
Get the query as a string.
A complete URI which has the following components:
Definition: gz/common/URI.hh:408
void SetAuthority(const URIAuthority &_authority)
Set the URI's authority.
const URIQuery & Query() const
Get a const reference of the query component.
bool operator==(const URI &_uri) const
Return true if the two URIs match.
URIFragment & Fragment()
Get a mutable version of the fragment component.
std::optional< URIAuthority > Authority() const
Get a copy of the URI's authority. If the authority has no value (as opposed to being empty),...
const URIFragment & Fragment() const
Get a const reference of the fragment component.
bool Parse(const std::string &_str)
Parse a string as URI. If there's no authority (i.e. Authority().has_value() == false),...
URI(const std::string &_str, bool _hasAuthority=false)
Default constructor.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: gz/common/SuppressWarning.hh:65
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: gz/common/SuppressWarning.hh:68
Forward declarations for the common classes.