Go to the source code of this file.
|
| CONCRETE_CODE (url) |
|
url | as_url (url_tree t) |
|
bool | is_root (url u, string s) |
|
bool | is_root_web (url u) |
|
bool | is_root_blank (url u) |
|
bool | is_rooted (url u, string protocol) |
|
bool | is_rooted_web (url u) |
|
bool | is_rooted_blank (url u) |
|
url | url_none () |
|
url | url_here () |
|
url | url_parent () |
|
url | url_ancestor () |
|
url | url_root (string protocol) |
|
url | operator* (url u1, url u2) |
|
url | operator* (url u1, const char *name) |
|
url | operator* (url u1, string name) |
|
url | url_concat (url u1, url u2) |
|
url | url_parent (url u) |
|
url | operator| (url u1, url u2) |
|
url | url_or (url u1, url u2) |
|
url | url_wildcard () |
|
url | url_wildcard (string name) |
|
bool | is_here (url u) |
|
bool | is_parent (url u) |
|
bool | is_ancestor (url u) |
|
bool | is_none (url u) |
|
bool | is_root (url u) |
|
bool | is_concat (url u) |
|
bool | is_or (url u) |
|
bool | is_wildcard (url u) |
|
url | url_path (string s, int type=URL_SYSTEM) |
|
url | url_general (string name, int type) |
|
url | url_unix (string name) |
|
url | url_unix (string dir, string name) |
|
url | url_system (string name) |
|
url | url_system (string dir, string name) |
|
url | url_standard (string name) |
|
url | url_standard (string dir, string name) |
|
url | url_pwd () |
|
url | url_ramdisc (string contents) |
|
url | head (url u) |
|
url | tail (url u) |
|
string | suffix (url u) |
|
string | suffix (url u, bool use_locase) |
|
string | basename (url u, string suf) |
|
string | basename (url u) |
|
url | glue (url u, string s) |
|
url | unglue (url u, int nr) |
|
url | unblank (url u) |
|
url | relative (url base, url u) |
|
url | delta (url base, url u) |
|
string | get_root (url u) |
|
url | unroot (url u) |
|
url | reroot (url u, string s) |
|
url | expand (url u) |
|
url | sort (url u) |
|
url | factor (url u) |
|
bool | descends (url u, url base) |
|
bool | is_atomic (url u) |
|
bool | is_wildcard (url u, int n) |
|
bool | is_pseudo_atomic (url u) |
|
bool | is_rooted (url u) |
|
bool | is_name (url u) |
|
bool | is_rooted_name (url u) |
|
bool | is_ramdisc (url u) |
|
void | skip_ipv6 (string s, int &i) |
|
string | as_string (url u, int type=URL_SYSTEM) |
|
tm_ostream & | operator<< (tm_ostream &out, url u) |
|
string | as_system_string (url u) |
|
string | as_unix_string (url u) |
|
string | as_standard_string (url u) |
|
url | url_get_name (string s, int type=URL_STANDARD, int i=0) |
|
◆ URL_SYSTEM
◆ URL_UNIX
◆ URL_STANDARD
◆ URL_CLEAN_UNIX
◆ URL_TUPLE
◆ url_tree
◆ CONCRETE_CODE()
◆ as_url()
◆ is_root() [1/2]
Definition at line 668 of file url.cpp.
668 {
669 return is_root (
u) && (
u[1]->t->label == s);
670}
The list class represents a linked list.
bool is_root(url u, string s)
◆ is_root_web()
bool is_root_web |
( |
url | u | ) |
|
◆ is_root_blank()
bool is_root_blank |
( |
url | u | ) |
|
◆ is_rooted() [1/2]
◆ is_rooted_web()
bool is_rooted_web |
( |
url | u | ) |
|
Definition at line 700 of file url.cpp.
700 {
703}
bool is_rooted_web(url u)
◆ is_rooted_blank()
bool is_rooted_blank |
( |
url | u | ) |
|
Definition at line 27 of file blank_url.cpp.
27 {
30}
bool is_rooted_blank(url u)
bool is_root_blank(url u)
◆ url_none()
Definition at line 91 of file url.cpp.
91 {
93}
static url_tree url_tuple(string label)
◆ url_here()
◆ url_parent() [1/2]
◆ url_ancestor()
◆ url_root()
◆ operator*() [1/3]
Definition at line 596 of file url.cpp.
596 {
605 return u1[1] *
v *
u2[2];
606 }
609 }
612 }
614 }
623 }
628 }
631}
bool is_pseudo_atomic(url u)
url reroot(url u, string protocol)
static bool is_semi_root(url u)
◆ operator*() [2/3]
◆ operator*() [3/3]
◆ url_concat()
◆ url_parent() [2/2]
◆ operator|()
◆ url_or()
◆ url_wildcard() [1/2]
◆ url_wildcard() [2/2]
◆ is_here()
◆ is_parent()
◆ is_ancestor()
bool is_ancestor |
( |
url | u | ) |
|
|
inline |
Definition at line 162 of file url.hpp.
162 {
163 return u->t ==
"...";
164};
◆ is_none()
Definition at line 166 of file url.hpp.
166 {
167 return u.label () ==
"none";
168};
◆ is_root() [2/2]
Definition at line 170 of file url.hpp.
170 {
171 return u.label () ==
"root";
172};
◆ is_concat()
Definition at line 174 of file url.hpp.
174 {
175 return u.label () ==
"concat";
176};
◆ is_or()
Definition at line 178 of file url.hpp.
178 {
179 return u.label () ==
"or";
180};
◆ is_wildcard() [1/2]
bool is_wildcard |
( |
url | u | ) |
|
|
inline |
Definition at line 182 of file url.hpp.
182 {
183 return u.label () ==
"wildcard";
184};
◆ url_path()
Definition at line 247 of file url.cpp.
247 {
250}
static url url_get_path(string s, int type=URL_STANDARD, int i=0)
◆ url_general()
Definition at line 273 of file url.cpp.
273 {
276 string protocol=
tokens[0];
279 if (protocol ==
"file")
return file_url (path);
280 if (protocol ==
"http")
return http_url (path);
281 if (protocol ==
"https")
return https_url (path);
282 if (protocol ==
"ftp")
return ftp_url (path);
284 }
285 }
288 }
291 }
294 }
301 }
303}
bool starts(string s, const char *what)
bool is_alphanum(string s)
array< string > tokenize(string s, string sep)
int N(array< T > a)
Get the length of the array.
bool contains(T a, array< T > b)
Check if an array contains a specified element.
static bool heuristic_is_ftp(string name)
static bool heuristic_is_path(string name, int type)
static bool heuristic_is_default(string name, int type)
static url url_mingw_default(string name, int type)
url url_root(string protocol)
static url url_default(string name, int type=URL_SYSTEM)
url url_get_name(string s, int type, int i)
static bool heuristic_is_http(string name)
url url_path(string s, int type)
static bool heuristic_is_mingw_default(string name, int type)
◆ url_unix() [1/2]
Definition at line 31 of file file_url.cpp.
31 {
33}
url url_general(string name, int type=URL_SYSTEM)
◆ url_unix() [2/2]
Definition at line 36 of file file_url.cpp.
36 {
38}
url url_unix(string name)
◆ url_system() [1/2]
◆ url_system() [2/2]
Definition at line 311 of file url.cpp.
311 {
313}
url url_system(string name)
◆ url_standard() [1/2]
◆ url_standard() [2/2]
Definition at line 321 of file url.cpp.
321 {
323}
url url_standard(string name)
◆ url_pwd()
Definition at line 326 of file url.cpp.
326 {
330 }
331 else {
334 }
335}
#define TM_FAILED(msg)
Macro used to throw an exception with a specified error message.
◆ url_ramdisc()
◆ head()
◆ tail()
◆ suffix() [1/2]
Definition at line 401 of file url.cpp.
401 {
403}
string suffix(url u, bool use_locase)
◆ suffix() [2/2]
Definition at line 381 of file url.cpp.
381 {
386 for (i= n - 1; i >= 0; i--)
387 if (s[i] == '.') break;
388 if ((i > 0) && (i < n - 1)) {
389 string r= s (i + 1, n);
390 while ((
N (
r) > 0) && (
r[
N (
r) - 1] ==
'~' ||
r[
N (
r) - 1] ==
'#'))
396 }
397 return "";
398}
string locase_all(string s)
Converts all uppercase characters in a string to lowercase.
int index_of(string s, char c)
string as_string(url u, int type)
◆ basename() [1/2]
Definition at line 406 of file url.cpp.
406 {
411}
string remove_suffix(string s, string suffix)
Remove the suffix from s if matches.
◆ basename() [2/2]
Definition at line 414 of file url.cpp.
414 {
418}
string basename(url u, string suf)
◆ glue()
Definition at line 421 of file url.cpp.
421 {
428}
url glue(url u, string s)
◆ unglue()
Definition at line 431 of file url.cpp.
431 {
439}
SI max(SI i, SI j)
Returns the maximum of two signed integers.
url unglue(url u, int nr)
◆ unblank()
◆ relative()
◆ delta()
Definition at line 469 of file url.cpp.
469 {
474}
url delta_sub(url base, url u)
url delta(url base, url u)
◆ get_root()
Definition at line 477 of file url.cpp.
477 {
478 return u.protocol ();
479}
◆ unroot()
◆ reroot()
◆ expand()
Definition at line 512 of file url.cpp.
512 {
516}
static url expand(url u1, url u2)
◆ sort()
Definition at line 543 of file url.cpp.
543 {
546}
static url sort_sub(url add, url to)
◆ factor()
Definition at line 568 of file url.cpp.
568 {
570}
static url factor_sorted(url u)
static url factor_sub(url u)
◆ descends()
bool descends |
( |
url | u, |
|
|
url | base ) |
Definition at line 573 of file url.cpp.
573 {
574 if (
u ==
base)
return true;
582 continue;
583 }
584 else {
586 }
587 }
588 return false;
589 }
592 return false;
593}
bool descends(url u, url base)
◆ is_atomic()
◆ is_wildcard() [2/2]
bool is_wildcard |
( |
url | u, |
|
|
int | n ) |
Definition at line 677 of file url.cpp.
677 {
679}
static bool is_tuple(url_tree t, string s)
◆ is_pseudo_atomic()
bool is_pseudo_atomic |
( |
url | u | ) |
|
◆ is_rooted() [2/2]
◆ is_name()
◆ is_rooted_name()
bool is_rooted_name |
( |
url | u | ) |
|
◆ is_ramdisc()
◆ skip_ipv6()
Definition at line 114 of file url.cpp.
114 {
115 i++;
117 (s[i] == ':' || (s[i] >= '0' && s[i] <= '9') ||
118 (s[i] >= 'a' && s[i] <= 'f') || (s[i] >= 'A' && s[i] <= 'F')))
119 i++;
120 if (i <
N (s) && s[i] ==
']') i++;
121}
◆ as_string()
Definition at line 729 of file url.cpp.
729 {
730
731
739 }
753
755 }
756 else {
759 }
763 }
764 else {
768 }
769 }
771 }
780 }
781 else {
783 }
784 }
790 else return "/";
791 }
792 }
793 else {
794 if (
is_root (
u,
"default"))
return "/";
795 }
796 if (
is_root (
u,
"blank"))
return "/";
797 if (
is_root (
u,
"file"))
return u[1]->t->label *
"://";
798 if (
is_root (
u))
return u[1]->t->label *
":/";
802 return "";
803}
bool is_name_in_path(url u)
bool is_wildcard(url u, int n)
◆ operator<<()
◆ as_system_string()
Definition at line 245 of file url.hpp.
245 {
247}
string as_string(url u, int type=URL_SYSTEM)
◆ as_unix_string()
◆ as_standard_string()
◆ url_get_name()
Definition at line 190 of file url.cpp.
190 {
194 while (i < n) {
196 while ((i < n) && (s[i] !=
sep) && (s[i] !=
'/')) {
198 else i++;
199 }
203 }
204 else if (i ==
start) {
205 i++;
206 if (i == n) {
208 }
209 }
210 }
211
218
219 }
222 }
223 else {
225 }
227 }
229}
static url url_get_atom(string s, int type)
void skip_ipv6(string s, int &i)