File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -431,4 +431,9 @@ inline bool create_directories(const path& p) {
431
431
#endif
432
432
}
433
433
434
+ inline bool exists (const path& p) {
435
+ return p.exists ();
436
+ }
437
+
438
+
434
439
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