Lolly 1.4.27
Loading...
Searching...
No Matches
file_url.cpp
Go to the documentation of this file.
1
2/******************************************************************************
3 * MODULE : file_url.cpp
4 * DESCRIPTION: url rooted with file://
5 * COPYRIGHT : (C) 1999 Joris van der Hoeven
6 * 2023 Darcy Shen
7 *******************************************************************************
8 * This software falls under the GNU general public license version 3 or later.
9 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
10 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ******************************************************************************/
12
13#include "url.hpp"
14
17
19 : url (url_root ("file") * url_get_name (string (name), URL_SYSTEM)) {}
20
21string
23 url c= reroot (*this, "default");
24 if (!is_none (c)) return as_string (c);
25 if (is_wildcard (*this, 1)) return (*this)->t[1]->label;
26 TM_FAILED ("failed to concretize file_url");
27 return string ();
28}
29
30url
31url_unix (string name) {
32 return url_general (name, URL_UNIX);
33}
34
35url
36url_unix (string dir, string name) {
37 return url_unix (dir) * url_unix (name);
38}
#define TM_FAILED(msg)
Macro used to throw an exception with a specified error message.
Definition basic.hpp:93
string concretize()
Definition file_url.cpp:22
file_url(const char *name)
Definition file_url.cpp:18
The list class represents a linked list.
Definition list.hpp:48
Definition url.hpp:37
url url_unix(string name)
Definition file_url.cpp:31
url url_root(string protocol)
Definition url.cpp:96
url url_get_name(string s, int type, int i)
Definition url.cpp:190
url url_general(string name, int type=URL_SYSTEM)
Definition url.cpp:273
url reroot(url u, string s)
Definition url.cpp:490
string as_string(url u, int type=URL_SYSTEM)
Definition url.cpp:729
#define URL_SYSTEM
Definition url.hpp:15
bool is_none(url u)
Definition url.hpp:166
bool is_wildcard(url u)
Definition url.hpp:182
#define URL_UNIX
Definition url.hpp:16