All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pathUtils.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_TF_PATH_UTILS_H
8#define PXR_BASE_TF_PATH_UTILS_H
9
10#include "pxr/pxr.h"
11#include "pxr/base/tf/api.h"
13#include <string>
14#include <vector>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
24
40TF_API
41std::string TfRealPath(std::string const& path,
42 bool allowInaccessibleSuffix = false,
43 std::string* error = 0);
44
54TF_API
55std::string TfNormPath(std::string const& path,
56 bool stripDriveSpecifier = false);
57
76TF_API
77std::string::size_type
78TfFindLongestAccessiblePrefix(std::string const &path, std::string* error = 0);
79
87TF_API
88std::string TfAbsPath(std::string const& path);
89
104TF_API
105std::string TfGetExtension(std::string const& path);
106
109TF_API
110std::string TfReadLink(std::string const& path);
111
113TF_API
114bool TfIsRelativePath(std::string const& path);
115
123TF_API
124std::vector<std::string> TfGlob(std::vector<std::string> const& paths,
125 unsigned int flags=ARCH_GLOB_DEFAULT);
126
133TF_API
134std::vector<std::string> TfGlob(std::string const& path,
135 unsigned int flags=ARCH_GLOB_DEFAULT);
136
137PXR_NAMESPACE_CLOSE_SCOPE
138
139#endif /* PXR_BASE_TF_PATH_UTILS_H */
Architecture dependent file system access.
TF_API std::string TfAbsPath(std::string const &path)
Returns the canonical absolute path of the specified filename.
TF_API std::string::size_type TfFindLongestAccessiblePrefix(std::string const &path, std::string *error=0)
Return the index delimiting the longest accessible prefix of path.
TF_API std::string TfReadLink(std::string const &path)
Returns the value of a symbolic link.
TF_API std::string TfNormPath(std::string const &path, bool stripDriveSpecifier=false)
Normalizes the specified path, eliminating double slashes, etc.
TF_API bool TfIsRelativePath(std::string const &path)
Return true if and only if a path is relative (not absolute).
TF_API std::vector< std::string > TfGlob(std::vector< std::string > const &paths, unsigned int flags=ARCH_GLOB_DEFAULT)
Expands one or more shell glob patterns.
TF_API std::string TfGetExtension(std::string const &path)
Returns the extension for a file path.
TF_API std::string TfRealPath(std::string const &path, bool allowInaccessibleSuffix=false, std::string *error=0)
Returns the canonical path of the specified filename, eliminating any symbolic links encountered in t...