Go to the source code of this file.
|
bool | is_local_and_single (url u) |
|
bool | is_directory (url u) |
|
bool | is_regular (url u) |
|
bool | is_symbolic_link (url u) |
|
bool | is_newer (url which, url than) |
|
bool | is_of_type (url name, string filter) |
|
int | file_size (url u) |
|
int | last_modified (url u) |
|
array< string > | read_directory (url u, bool &error_flag) |
|
url | subdirectories (url u) |
|
void | mkdir (url u) |
|
void | make_dir (url which) |
|
void | rmdir (url u) |
|
void | chdir (url u) |
|
url | url_temp_dir () |
|
url | url_temp (string suffix="") |
|
void | remove (url u) |
|
void | move (url u1, url u2) |
|
void | copy (url u1, url u2) |
|
bool | load_string (url file_name, string &s, bool fatal) |
|
string | string_load (url u) |
|
bool | save_string (url file_name, const string &s, bool fatal=false) |
|
void | string_save (const string &s, url u) |
|
bool | append_string (url u, const string &s, bool fatal) |
|
void | string_append_to_file (const string &s, url u) |
|
void | append_to (url what, url to) |
|
◆ is_local_and_single()
bool is_local_and_single |
( |
url | u | ) |
|
Definition at line 22 of file file.cpp.
22 {
23 string label =
u.label ();
24 string protocol=
u.protocol ();
25 return ((label == "") || (label == "concat") || (label == "root")) &&
26 (protocol == "default" || protocol == "file");
27}
The list class represents a linked list.
◆ is_directory()
bool is_directory |
( |
url | u | ) |
|
Definition at line 38 of file file.cpp.
38 {
40
46 return true;
47 default:
48 return false;
49 }
50 }
51 else {
52 return false;
53 }
54}
bool is_local_and_single(url u)
static string as_local_path(url u)
◆ is_regular()
Definition at line 57 of file file.cpp.
57 {
59
65 return true;
66 default:
67 return false;
68 }
69 }
70 else {
71 return false;
72 }
73}
◆ is_symbolic_link()
bool is_symbolic_link |
( |
url | u | ) |
|
Definition at line 76 of file file.cpp.
76 {
78
83 }
84 else {
85 return false;
86 }
87}
◆ is_newer()
bool is_newer |
( |
url | which, |
|
|
url | than ) |
Definition at line 90 of file file.cpp.
90 {
93
98 }
99 else {
100 return false;
101 }
102}
◆ is_of_type()
Definition at line 105 of file file.cpp.
105 {
107
109
110 if (
filter ==
"")
return true;
112
113
118 if ((
suf !=
"exe") && (
suf !=
"bat") && (
suf !=
"com")) {
121 }
122 }
123 }
127 return false;
128 }
129 for (i= 0; i < n; i++)
131
132 case 'f':
134 break;
135 case 'd':
137 break;
138 case 'l':
140 break;
141 case 'r':
143 break;
144 case 'w':
146 break;
147 case 'x':
149 break;
150 }
151 return true;
152}
int N(array< T > a)
Get the length of the array.
string suffix(url u, bool use_locase)
url glue(url u, string s)
◆ file_size()
Definition at line 155 of file file.cpp.
155 {
157
162 }
163 else {
164 return -1;
165 }
166}
◆ last_modified()
int last_modified |
( |
url | u | ) |
|
Definition at line 169 of file file.cpp.
169 {
171
176 }
177 else {
178 return -1;
179 }
180}
◆ read_directory()
Definition at line 194 of file file.cpp.
194 {
198 }
199
205 }
208}
static tb_long_t tb_directory_walk_func(tb_char_t const *path, tb_file_info_t const *info, tb_cpointer_t priv)
◆ subdirectories()
Definition at line 211 of file file.cpp.
211 {
217 for (
int i= 0; i <
N (
dir); i++)
221 }
223}
bool starts(string s, const char *what)
url subdirectories(url u)
array< string > read_directory(url u, bool &error_flag)
◆ mkdir()
Definition at line 226 of file file.cpp.
226 {
227 string label=
u.label ();
228 if (label == "none" || label == "root" || label == "wildcard") return;
232 }
236 }
237}
◆ make_dir()
Definition at line 240 of file file.cpp.
240 {
245 }
246}
list< T > head(list< T > l, int n=1)
Get the first n items of a list.
◆ rmdir()
Definition at line 249 of file file.cpp.
249 {
250 string label=
u.label ();
251 if (label == "none" || label == "root" || label == "wildcard") return;
255 }
259 }
260}
◆ chdir()
Definition at line 263 of file file.cpp.
263 {
268 }
269 }
271}
#define TM_FAILED(msg)
Macro used to throw an exception with a specified error message.
◆ url_temp_dir()
◆ url_temp()
Definition at line 274 of file file.cpp.
274 {
278 }
282 }
283 else {
285 }
286}
string replace(string s, string what, string by)
url url_temp(string suffix)
◆ remove()
Definition at line 326 of file file.cpp.
326 {
327 string label=
u.label ();
328 if (label == "none" || label == "root" || label == "wildcard") return;
332 }
336 }
337}
◆ move()
◆ copy()
◆ load_string()
bool load_string |
( |
url | file_name, |
|
|
string & | s, |
|
|
bool | fatal ) |
Definition at line 434 of file file.cpp.
434 {
437}
static bool cleanup_and_return_finally(const file_status &status, const url &u, bool fatal, const string &reason)
file_status load_string_try(url u, string &s)
◆ string_load()
Definition at line 440 of file file.cpp.
440 {
441 string s;
442
444 return s;
445}
bool load_string(url u, string &s, bool fatal)
◆ save_string()
Definition at line 490 of file file.cpp.
490 {
493}
file_status save_string_try(url u, const string &s)
◆ string_save()
Definition at line 496 of file file.cpp.
496 {
498}
bool save_string(url u, const string &s, bool fatal)
◆ append_string()
Definition at line 543 of file file.cpp.
543 {
546}
file_status append_string_try(url u, const string &s)
◆ string_append_to_file()
Definition at line 549 of file file.cpp.
549 {
551}
bool append_string(url u, const string &s, bool fatal)
◆ append_to()
Definition at line 554 of file file.cpp.
554 {
557 cerr <<
"Append failed for " <<
to <<
LF;
558}