File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,17 @@ const std::string::value_type* path_separators = "\\/";
35
35
const std::string::value_type* path_separators = " /" ;
36
36
#endif
37
37
38
+ bool is_absolute_path (const std::string& path)
39
+ {
40
+ #ifdef LAF_WINDOWS
41
+ return (path.size () > 2 && path[1 ] == ' :' && path[2 ] == path_separator) ||
42
+ // Absolute network path
43
+ (path.size () > 1 && path[0 ] == path_separator && path[1 ] == path_separator);
44
+ #else
45
+ return !path.empty () && path[0 ] == path_separator;
46
+ #endif
47
+ }
48
+
38
49
void make_all_directories (const std::string& path)
39
50
{
40
51
std::vector<std::string> parts;
Original file line number Diff line number Diff line change 1
1
// LAF Base Library
2
- // Copyright (c) 2020-2024 Igara Studio S.A.
2
+ // Copyright (c) 2020-2025 Igara Studio S.A.
3
3
// Copyright (c) 2001-2018 David Capello
4
4
//
5
5
// This file is released under the terms of the MIT license.
@@ -28,6 +28,7 @@ extern const std::string::value_type* path_separators;
28
28
29
29
bool is_file (const std::string& path);
30
30
bool is_directory (const std::string& path);
31
+ bool is_absolute_path (const std::string& path);
31
32
32
33
size_t file_size (const std::string& path);
33
34
You can’t perform that action at this time.
0 commit comments