Path: blob/master/thirdparty/openxr/src/common/filesystem_utils.hpp
9903 views
// Copyright (c) 2017-2025 The Khronos Group Inc.1// Copyright (c) 2017 Valve Corporation2// Copyright (c) 2017 LunarG, Inc.3//4// SPDX-License-Identifier: Apache-2.0 OR MIT5//6// Initial Author: Mark Young <[email protected]>7//89#pragma once1011#include <string>12#include <vector>1314// Determine if the path indicates a regular file (not a directory or symbolic link)15bool FileSysUtilsIsRegularFile(const std::string& path);1617// Determine if the path indicates a directory18bool FileSysUtilsIsDirectory(const std::string& path);1920// Determine if the provided path exists on the filesystem21bool FileSysUtilsPathExists(const std::string& path);2223// Get the current directory24bool FileSysUtilsGetCurrentPath(std::string& path);2526// Get the parent path of a file27bool FileSysUtilsGetParentPath(const std::string& file_path, std::string& parent_path);2829// Determine if the provided path is an absolute path30bool FileSysUtilsIsAbsolutePath(const std::string& path);3132// Get the absolute path for a provided file33bool FileSysUtilsGetAbsolutePath(const std::string& path, std::string& absolute);3435// Get the absolute path for a provided file36bool FileSysUtilsGetCanonicalPath(const std::string& path, std::string& canonical);3738// Combine a parent and child directory39bool FileSysUtilsCombinePaths(const std::string& parent, const std::string& child, std::string& combined);4041// Parse out individual paths in a path list42bool FileSysUtilsParsePathList(std::string& path_list, std::vector<std::string>& paths);4344// Record all the filenames for files found in the provided path.45bool FileSysUtilsFindFilesInPath(const std::string& path, std::vector<std::string>& files);464748