File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,10 @@ class path {
225
225
return oss.str ();
226
226
}
227
227
228
+ std::string string () const {
229
+ return str ();
230
+ }
231
+
228
232
void set (const std::string &str, path_type type = native_path) {
229
233
m_type = type;
230
234
if (type == windows_path) {
@@ -431,4 +435,12 @@ inline bool create_directories(const path& p) {
431
435
#endif
432
436
}
433
437
438
+ inline bool exists (const path& p) {
439
+ return p.exists ();
440
+ }
441
+
442
+ inline bool is_directory (const path& p) {
443
+ return p.is_directory ();
444
+ }
445
+
434
446
NAMESPACE_END (filesystem)
Original file line number Diff line number Diff line change @@ -25,17 +25,20 @@ int main(int argc, char **argv) {
25
25
cout << " some/path.ext:operator==() (unequal) = " << (path (" some/path.ext" ) == path (" another/path.ext" )) << endl;
26
26
27
27
cout << " nonexistant:exists = " << path (" nonexistant" ).exists () << endl;
28
+ cout << " nonexistant:exists = " << exists (path (" nonexistant" )) << endl;
28
29
cout << " nonexistant:is_file = " << path (" nonexistant" ).is_file () << endl;
29
30
cout << " nonexistant:is_directory = " << path (" nonexistant" ).is_directory () << endl;
30
31
cout << " nonexistant:filename = " << path (" nonexistant" ).filename () << endl;
31
32
cout << " nonexistant:extension = " << path (" nonexistant" ).extension () << endl;
32
33
cout << " filesystem/path.h:exists = " << path (" filesystem/path.h" ).exists () << endl;
34
+ cout << " filesystem/path.h:exists = " << exists (path (" filesystem/path.h" )) << endl;
33
35
cout << " filesystem/path.h:is_file = " << path (" filesystem/path.h" ).is_file () << endl;
34
36
cout << " filesystem/path.h:is_directory = " << path (" filesystem/path.h" ).is_directory () << endl;
35
37
cout << " filesystem/path.h:filename = " << path (" filesystem/path.h" ).filename () << endl;
36
38
cout << " filesystem/path.h:extension = " << path (" filesystem/path.h" ).extension () << endl;
37
39
cout << " filesystem/path.h:make_absolute = " << path (" filesystem/path.h" ).make_absolute () << endl;
38
40
cout << " ../filesystem:exists = " << path (" ../filesystem" ).exists () << endl;
41
+ cout << " ../filesystem:exists = " << exists (path (" ../filesystem" )) << endl;
39
42
cout << " ../filesystem:is_file = " << path (" ../filesystem" ).is_file () << endl;
40
43
cout << " ../filesystem:is_directory = " << path (" ../filesystem" ).is_directory () << endl;
41
44
cout << " ../filesystem:extension = " << path (" ../filesystem" ).extension () << endl;
You can’t perform that action at this time.
0 commit comments