1 | // Copyright (c) 2017-2023, The Khronos Group Inc. |
---|---|
2 | // Copyright (c) 2017 Valve Corporation |
3 | // Copyright (c) 2017 LunarG, Inc. |
4 | // |
5 | // SPDX-License-Identifier: Apache-2.0 OR MIT |
6 | // |
7 | // Initial Author: Mark Young <marky@lunarg.com> |
8 | // |
9 | |
10 | #pragma once |
11 | |
12 | #include <string> |
13 | #include <vector> |
14 | |
15 | // Determine if the path indicates a regular file (not a directory or symbolic link) |
16 | bool FileSysUtilsIsRegularFile(const std::string& path); |
17 | |
18 | // Determine if the path indicates a directory |
19 | bool FileSysUtilsIsDirectory(const std::string& path); |
20 | |
21 | // Determine if the provided path exists on the filesystem |
22 | bool FileSysUtilsPathExists(const std::string& path); |
23 | |
24 | // Get the current directory |
25 | bool FileSysUtilsGetCurrentPath(std::string& path); |
26 | |
27 | // Get the parent path of a file |
28 | bool FileSysUtilsGetParentPath(const std::string& file_path, std::string& parent_path); |
29 | |
30 | // Determine if the provided path is an absolute path |
31 | bool FileSysUtilsIsAbsolutePath(const std::string& path); |
32 | |
33 | // Get the absolute path for a provided file |
34 | bool FileSysUtilsGetAbsolutePath(const std::string& path, std::string& absolute); |
35 | |
36 | // Get the absolute path for a provided file |
37 | bool FileSysUtilsGetCanonicalPath(const std::string& path, std::string& canonical); |
38 | |
39 | // Combine a parent and child directory |
40 | bool FileSysUtilsCombinePaths(const std::string& parent, const std::string& child, std::string& combined); |
41 | |
42 | // Parse out individual paths in a path list |
43 | bool FileSysUtilsParsePathList(std::string& path_list, std::vector<std::string>& paths); |
44 | |
45 | // Record all the filenames for files found in the provided path. |
46 | bool FileSysUtilsFindFilesInPath(const std::string& path, std::vector<std::string>& files); |
47 |