33 #ifndef DART_COMMON_URI_HPP_
34 #define DART_COMMON_URI_HPP_
53 operator bool()
const;
112 Uri(
const std::string& _input);
116 Uri(
const char* _input);
128 bool fromPath(
const std::string& _path);
138 const std::string& _base,
139 const std::string& _relative,
140 bool _strict =
false);
145 const char* _base,
const char* _relative,
bool _strict =
false);
150 const Uri& _base,
const std::string& _relative,
bool _strict =
false);
155 const Uri& _base,
const char* _relative,
bool _strict =
false);
160 const Uri& _base,
const Uri& _relative,
bool _strict =
false);
178 const std::string& _base,
179 const std::string& _relative,
180 bool _strict =
false);
185 const Uri& _base,
const std::string& _relative,
bool _strict =
false);
190 const Uri& _base,
const Uri& _relative,
bool _strict =
false);
193 static std::string
getUri(
const std::string& _input);
197 const std::string& _base,
198 const std::string& _relative,
199 bool _strict =
false);
203 const Uri& _base,
const std::string& _relative,
bool _strict =
false);
207 const Uri& _base,
const Uri& _relative,
bool _strict =
false);
reference_type get()
Definition: Uri.cpp:122
void reset()
Definition: Uri.cpp:116
value_type & reference_type
Definition: Uri.hpp:45
std::string mValue
Definition: Uri.hpp:76
const value_type & reference_const_type
Definition: Uri.hpp:46
reference_type get_value_or(reference_type _default)
Definition: Uri.cpp:136
value_type * pointer_type
Definition: Uri.hpp:47
pointer_type operator->()
Definition: Uri.cpp:97
bool mExists
Definition: Uri.hpp:75
UriComponent()
Definition: Uri.cpp:54
reference_type operator*()
Definition: Uri.cpp:85
bool operator!() const
Definition: Uri.cpp:72
const value_type * pointer_const_type
Definition: Uri.hpp:48
std::string value_type
Definition: Uri.hpp:44
UriComponent & operator=(reference_const_type _value)
Definition: Uri.cpp:78
void assign(reference_const_type _value)
Definition: Uri.cpp:109
Definition: BulletCollisionDetector.cpp:65
The Uri struct provides URI parsing and merging functionality based on RFC 3986.
Definition: Uri.hpp:87
static Uri createFromRelativeUri(const std::string &_base, const std::string &_relative, bool _strict=false)
Create URI resolving a relative path reference; return an empty URI on failure.
Definition: Uri.cpp:458
std::string getPath() const
Get the path component of the URI as a string.
Definition: Uri.cpp:553
UriComponent mFragment
Fragment, e.g. the part of the URI after the #.
Definition: Uri.hpp:101
static Uri createFromString(const std::string &_input)
Create URI from a string; return an empty URI on failure.
Definition: Uri.cpp:410
std::string toString() const
Combine the parts of the URI into a string.
Definition: Uri.cpp:387
bool fromStringOrPath(const std::string &_input)
Parse a URI or local path (i.e.
Definition: Uri.cpp:254
UriComponent mAuthority
Authority, e.g. 'google.com', 'en.wikipedia.org'.
Definition: Uri.hpp:92
void clear()
Clear the URI by reset()ing all components.
Definition: Uri.cpp:179
static std::string getUri(const std::string &_input)
Parse a URI from a string; return an empty string on failure.
Definition: Uri.cpp:510
bool fromRelativeUri(const std::string &_base, const std::string &_relative, bool _strict=false)
Resolve a relative path reference; return success.
Definition: Uri.cpp:285
bool fromString(const std::string &_input)
Parse a URI from a string; return success.
Definition: Uri.cpp:189
static Uri createFromStringOrPath(const std::string &_input)
Create general URI or file URI from a string; return an empty URI on failure.
Definition: Uri.cpp:442
bool fromPath(const std::string &_path)
Parse a local path (i.e.
Definition: Uri.cpp:236
static std::string removeDotSegments(const std::string &_path)
Implement section 5.2.4 of RFC 3986.
Definition: Uri.cpp:594
UriComponent mPath
Path, e.g. '/index.html', '/foo/bar.txt'.
Definition: Uri.hpp:95
static std::string getRelativeUri(const std::string &_base, const std::string &_relative, bool _strict=false)
Resolve a relative path reference; return an empty string on failure.
Definition: Uri.cpp:520
Uri()=default
Constructor.
UriComponent mQuery
Query string, i.e. the part of the URI after the ?
Definition: Uri.hpp:98
static std::string mergePaths(const Uri &_base, const Uri &_relative)
Implement section 5.2.3 of RFC 3986.
Definition: Uri.cpp:575
std::string getFilesystemPath() const
Get the path in the local filesystem as a string.
Definition: Uri.cpp:559
UriComponent mScheme
Scheme, e.g. 'http', 'file', 'package'.
Definition: Uri.hpp:89
static Uri createFromPath(const std::string &_path)
Create file URI from a string; return an empty URI on failure.
Definition: Uri.cpp:426