33 #ifndef DART_COMMON_URI_HPP_ 34 #define DART_COMMON_URI_HPP_ 44 using value_type = std::string;
45 using reference_type = value_type&;
46 using reference_const_type =
const value_type&;
47 using pointer_type = value_type*;
48 using pointer_const_type =
const value_type*;
53 operator bool()
const;
55 bool operator!()
const;
59 reference_type operator*();
60 reference_const_type operator*()
const;
62 pointer_type operator->();
63 pointer_const_type operator->()
const;
65 void assign(reference_const_type _value);
69 reference_const_type
get()
const;
71 reference_type get_value_or(reference_type _default);
72 reference_const_type get_value_or(reference_const_type _default)
const;
112 Uri(
const std::string& _input);
116 Uri(
const char* _input);
123 bool fromString(
const std::string& _input);
128 bool fromPath(
const std::string& _path);
133 bool fromStringOrPath(
const std::string& _input);
137 bool fromRelativeUri(
138 const std::string& _base,
139 const std::string& _relative,
140 bool _strict =
false);
144 bool fromRelativeUri(
145 const char* _base,
const char* _relative,
bool _strict =
false);
149 bool fromRelativeUri(
150 const Uri& _base,
const std::string& _relative,
bool _strict =
false);
154 bool fromRelativeUri(
155 const Uri& _base,
const char* _relative,
bool _strict =
false);
159 bool fromRelativeUri(
160 const Uri& _base,
const Uri& _relative,
bool _strict =
false);
163 std::string toString()
const;
166 static Uri createFromString(
const std::string& _input);
169 static Uri createFromPath(
const std::string& _path);
173 static Uri createFromStringOrPath(
const std::string& _input);
177 static Uri createFromRelativeUri(
178 const std::string& _base,
179 const std::string& _relative,
180 bool _strict =
false);
184 static Uri createFromRelativeUri(
185 const Uri& _base,
const std::string& _relative,
bool _strict =
false);
189 static Uri createFromRelativeUri(
190 const Uri& _base,
const Uri& _relative,
bool _strict =
false);
193 static std::string getUri(
const std::string& _input);
196 static std::string getRelativeUri(
197 const std::string& _base,
198 const std::string& _relative,
199 bool _strict =
false);
202 static std::string getRelativeUri(
203 const Uri& _base,
const std::string& _relative,
bool _strict =
false);
206 static std::string getRelativeUri(
207 const Uri& _base,
const Uri& _relative,
bool _strict =
false);
210 std::string getPath()
const;
216 std::string getFilesystemPath()
const;
220 static std::string mergePaths(
const Uri& _base,
const Uri& _relative);
223 static std::string removeDotSegments(
const std::string& _path);
229 #endif // ifndef DART_COMMON_URI_HPP_ UriComponent mFragment
Fragment, e.g. the part of the URI after the #.
Definition: Uri.hpp:101
UriComponent mPath
Path, e.g. '/index.html', '/foo/bar.txt'.
Definition: Uri.hpp:95
Definition: Aspect.cpp:40
UriComponent mQuery
Query string, i.e. the part of the URI after the ?
Definition: Uri.hpp:98
UriComponent mAuthority
Authority, e.g. 'google.com', 'en.wikipedia.org'.
Definition: Uri.hpp:92
UriComponent mScheme
Scheme, e.g. 'http', 'file', 'package'.
Definition: Uri.hpp:89
The Uri struct provides URI parsing and merging functionality based on RFC 3986.
Definition: Uri.hpp:86