XRPrimer (C++ API)  0.6.0
filesystem_utils.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017 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
16 // link)
17 bool FileSysUtilsIsRegularFile(const std::string &path);
18 
19 // Determine if the path indicates a directory
20 bool FileSysUtilsIsDirectory(const std::string &path);
21 
22 // Determine if the provided path exists on the filesystem
23 bool FileSysUtilsPathExists(const std::string &path);
24 
25 // Get the current directory
26 bool FileSysUtilsGetCurrentPath(std::string &path);
27 
28 // Get the parent path of a file
29 bool FileSysUtilsGetParentPath(const std::string &file_path,
30  std::string &parent_path);
31 
32 // Determine if the provided path is an absolute path
33 bool FileSysUtilsIsAbsolutePath(const std::string &path);
34 
35 // Get the absolute path for a provided file
36 bool FileSysUtilsGetAbsolutePath(const std::string &path,
37  std::string &absolute);
38 
39 // Get the absolute path for a provided file
40 bool FileSysUtilsGetCanonicalPath(const std::string &path,
41  std::string &canonical);
42 
43 // Combine a parent and child directory
44 bool FileSysUtilsCombinePaths(const std::string &parent,
45  const std::string &child, std::string &combined);
46 
47 // Parse out individual paths in a path list
48 bool FileSysUtilsParsePathList(const std::string &path_list,
49  std::vector<std::string> &paths);
50 
51 // Record all the filenames for files found in the provided path.
52 bool FileSysUtilsFindFilesInPath(const std::string &path,
53  std::vector<std::string> &files);
bool FileSysUtilsGetCanonicalPath(const std::string &path, std::string &canonical)
Definition: filesystem_utils.cpp:315
bool FileSysUtilsGetAbsolutePath(const std::string &path, std::string &absolute)
Definition: filesystem_utils.cpp:309
bool FileSysUtilsIsRegularFile(const std::string &path)
Definition: filesystem_utils.cpp:267
bool FileSysUtilsIsAbsolutePath(const std::string &path)
Definition: filesystem_utils.cpp:283
bool FileSysUtilsIsDirectory(const std::string &path)
Definition: filesystem_utils.cpp:273
bool FileSysUtilsGetCurrentPath(std::string &path)
Definition: filesystem_utils.cpp:287
bool FileSysUtilsGetParentPath(const std::string &file_path, std::string &parent_path)
Definition: filesystem_utils.cpp:296
bool FileSysUtilsCombinePaths(const std::string &parent, const std::string &child, std::string &combined)
Definition: filesystem_utils.cpp:325
bool FileSysUtilsPathExists(const std::string &path)
Definition: filesystem_utils.cpp:279
bool FileSysUtilsFindFilesInPath(const std::string &path, std::vector< std::string > &files)
Definition: filesystem_utils.cpp:353
bool FileSysUtilsParsePathList(const std::string &path_list, std::vector< std::string > &paths)
Definition: filesystem_utils.cpp:340