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)
16bool FileSysUtilsIsRegularFile(const std::string& path);
17
18// Determine if the path indicates a directory
19bool FileSysUtilsIsDirectory(const std::string& path);
20
21// Determine if the provided path exists on the filesystem
22bool FileSysUtilsPathExists(const std::string& path);
23
24// Get the current directory
25bool FileSysUtilsGetCurrentPath(std::string& path);
26
27// Get the parent path of a file
28bool FileSysUtilsGetParentPath(const std::string& file_path, std::string& parent_path);
29
30// Determine if the provided path is an absolute path
31bool FileSysUtilsIsAbsolutePath(const std::string& path);
32
33// Get the absolute path for a provided file
34bool FileSysUtilsGetAbsolutePath(const std::string& path, std::string& absolute);
35
36// Get the absolute path for a provided file
37bool FileSysUtilsGetCanonicalPath(const std::string& path, std::string& canonical);
38
39// Combine a parent and child directory
40bool FileSysUtilsCombinePaths(const std::string& parent, const std::string& child, std::string& combined);
41
42// Parse out individual paths in a path list
43bool FileSysUtilsParsePathList(std::string& path_list, std::vector<std::string>& paths);
44
45// Record all the filenames for files found in the provided path.
46bool FileSysUtilsFindFilesInPath(const std::string& path, std::vector<std::string>& files);
47