18#ifndef GAZEBO_COMMON_URI_HH_
19#define GAZEBO_COMMON_URI_HH_
31 class URIQueryPrivate;
46 public:
explicit URIPath(
const std::string &_str);
61 public:
void PushBack(
const std::string &_part);
82 public: std::string
Str(
const std::string &_delim =
"/")
const;
92 public:
static bool Valid(
const std::string &_str);
101 public:
bool Parse(
const std::string &_str);
111 private: std::unique_ptr<URIPathPrivate> dataPtr;
122 public:
explicit URIQuery(
const std::string &_str);
137 public:
void Insert(
const std::string &_key,
138 const std::string &_value);
154 public: std::string
Str(
const std::string &_delim =
"&")
const;
159 public:
static bool Valid(
const std::string &_str);
168 public:
bool Parse(
const std::string &_string);
172 private: std::unique_ptr<URIQueryPrivate> dataPtr;
176 class GZ_COMMON_VISIBLE
URI
184 public:
URI(
const std::string &_str);
198 public: std::string
Str()
const;
244 public:
static bool Valid(
const std::string &_str);
249 public:
bool Parse(
const std::string &_str);
253 private: std::unique_ptr<URIPrivate> dataPtr;
common
Definition FuelModelDatabase.hh:37
The path component of a URI.
Definition URI.hh:36
bool operator==(const URIPath &_path) const
Return true if the two paths match.
virtual ~URIPath()
Destructor.
URIPath(const URIPath &_path)
Copy constructor.
URIPath & operator=(const URIPath &_path)
Equal operator.
const URIPath operator/(const std::string &_part) const
Get the current path with the _part added to the end.
const URIPath & operator/=(const std::string &_part)
Compound assignment operator.
bool Valid() const
Return true if this is a valid path.
bool Contains(const URIPath &_other) const
Returns true if _other is a subset of this, counting from the beginning.
void PushFront(const std::string &_part)
Push a new part onto the front of this path.
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.
void Clear()
Remove all parts of the path.
URIPath(const std::string &_str)
Construct a URIPath object from a string.
void PushBack(const std::string &_part)
Push a new part onto the back of this path.
bool Parse(const std::string &_str)
Parse a string as URIPath.
The query component of a URI.
Definition URI.hh:116
URIQuery & operator=(const URIQuery &_query)
Equal operator.
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.
bool Valid() const
Check if this is a valid URI query.
bool Parse(const std::string &_string)
Parse a string as URIQuery.
static bool Valid(const std::string &_str)
Check if a string is a valid URI query.
void Clear()
Remove all values of the 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.
URIQuery(const URIQuery &_query)
Copy constructor.
virtual ~URIQuery()
Destructor.
A complete URI.
Definition URI.hh:177
void SetScheme(const std::string &_scheme)
Set the URI's scheme.
bool Valid() const
Validate this URI.
URIQuery & Query()
Get a mutable version of the query component.
URI & operator=(const URI &_uri)
Equal operator.
URI(const std::string &_str)
Construct a URI object from a string.
URIPath & Path()
Get a mutable version of the path component.
URI(const URI &_uri)
Copy constructor.
URI()
Default constructor.
bool operator==(const URI &_uri) const
Return true if the two URIs match.
static bool Valid(const std::string &_str)
Validate a string as URI.
void Clear()
Remove all components of the URI.
std::string Str() const
Get the URI as a string, which has the form:
const URIQuery & Query() const
Get a const reference of the query component.
std::string Scheme() const
Get the URI's scheme.
const URIPath & Path() const
Get a const reference of the path component.
bool Parse(const std::string &_str)
Parse a string as URI.
Forward declarations for the common classes.
Definition Animation.hh:27