39 #ifndef __UT_PathSearch__
40 #define __UT_PathSearch__
59 const char *carat_expand =
"",
66 static void pathMapLoad(
const char *dict);
67 static void pathMapAdd(
const char *
src,
const char *dest,
69 static bool pathMapRemove(
const char *src);
88 static void rehashAll();
97 static void getHomeHoudini(
UT_String &str);
105 void extendPath(
const char *defpath = 0,
107 const char *carat_expand = 0,
114 bool appendPath(
const char *path,
bool condensed =
false);
118 bool removePath(
const char *path);
121 void prependPath(
const char *path);
126 int findFile(
UT_WorkBuffer &result,
const char *search)
const;
127 int findDirectory(
UT_String &result,
const char *search)
const;
133 bool findDirectoryFromList(
UT_String &result,
139 int findAllFiles(
const char *search,
142 int findAllDirectories(
const char *search,
149 bool returnfullpaths,
152 bool skip_dup_paths=
false)
const;
159 bool returnfullpaths,
162 bool skip_dup_paths=
false)
const;
164 int matchAllFilesInSubdirectory(
const char *extension,
165 const char *subdirectory,
166 bool returnfullpaths,
169 bool skip_dup_paths=
false)
const;
171 const char *subdirectory,
172 bool returnfullpaths,
175 bool skip_dup_paths=
false)
const;
180 int houdiniFindFile(
const char *
find,
UT_String &result)
const;
181 int houdiniFindFile(
const char *find,
UT_WorkBuffer &result)
const;
183 int houdiniFindDirectory(
const char *find,
UT_String &result)
const;
184 int houdiniFindDirectory(
const char *find,
UT_WorkBuffer &
r)
const;
194 {
return myCondensedPaths(i); }
215 enum { NUM_PATHS = 7 };
217 int size()
const {
return NUM_PATHS; }
218 const char *
hip()
const {
return myPaths[2]; }
220 const char *myPaths[NUM_PATHS];
221 const char *myCondensedPaths[NUM_PATHS];
234 return condenseCommon(path, path, common);
244 return condenseCommon(path, path.
buffer(), common);
254 return condenseCommon(condensed, path, common);
264 return condenseCommon(condensed, path, common);
270 return condenseCommon(path, path, common);
276 return condenseCommon(path, path.
buffer(), common);
283 return condensePath(path, source_path, common.
myPaths,
291 return condensePath(path, source_path, common.
myPaths,
301 const char *source_path,
302 const char *
const paths[],
303 const char *
const condensed_paths[],
308 const char *source_path,
309 const char *
const paths[],
310 const char *
const condensed_paths[],
314 bool ok = condensePath(condensed, source_path,
315 paths, condensed_paths, npaths);
318 else if (path.
buffer() != source_path)
325 const char *
const paths[],
326 const char *
const condensed_paths[],
329 return condensePath(path, path, paths, condensed_paths, npaths);
346 static bool resolveAbsolutePath(
const char *
filename,
363 const char *insert_path);
378 bool returnfullpaths,
383 void appendPathPrivate(
const char *path);
400 houdiniFindFile(find, result))
409 houdiniFindFile(find, result))
411 return result.
length() != 0;
419 findAllFiles(find, result);
427 houdiniFindDirectory(find, result))
436 houdiniFindDirectory(find, result))
438 return result.
length() != 0;
446 findAllDirectories(find, result);
static const UT_PathSearch * getInstance(UT_KnownPath path_type)
const char * getCondensedComponent(int i) const
path_type
CLI enumeration of different file types.
int HoudiniFindFile(const char *find, UT_String &result)
GT_API const UT_StringHolder filename
SYS_FORCE_INLINE exint length() const
int getBaseEntries() const
static bool condensePath(UT_String &path, const char *const paths[], const char *const condensed_paths[], int npaths)
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
const char * getBaseComponent(int i) const
GLsizei const GLchar *const * path
const char * myPaths[NUM_PATHS]
SYS_FORCE_INLINE const char * buffer() const
void copyIntoString(UT_String &str) const
**But if you need a result
static bool condensePath(UT_String &path, const char *source_path, const char *const paths[], const char *const condensed_paths[], int npaths)
int HoudiniFindDir(const char *find, UT_String &result)
const char * buffer() const
const char * myCondensedPaths[NUM_PATHS]
static bool condenseCommon(UT_WorkBuffer &path, const char *source_path, const CommonPaths &common)
static bool condenseCommon(UT_WorkBuffer &path, const CommonPaths &common)
UT_ValArray< const char * > UT_StringList
static bool condenseCommon(UT_String &path, const char *source_path, const CommonPaths &common)
void harden()
Take shallow copy and make it deep.
#define SYS_NO_DISCARD_RESULT
GLuint const GLchar * name
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
static bool condenseCommon(UT_WorkBuffer &condensed, const char *path)
auto search(const T &set, const V &val) -> std::pair< bool, decltype(std::begin(detail::smart_deref(set)))>
A search function.
const char * getDefaultPath() const
exint entries() const
Alias of size(). size() is preferred.
const char * getPathComponent(int i) const
static bool condenseCommon(UT_WorkBuffer &path)
int HoudiniFindMulti(const char *find, UT_StringArray &result)
const char * getCaratExpand() const
static bool condenseCommon(UT_String &path, const CommonPaths &common)
static bool condenseCommon(UT_String &condensed, const char *path)
SYS_FORCE_INLINE void clear()
int HoudiniFindDirMulti(const char *find, UT_StringArray &result)
void clear()
Resets list to an empty list.
static bool condenseCommon(UT_String &path)
OIIO_UTIL_API std::string extension(string_view filepath, bool include_dot=true) noexcept
int getVariableId() const
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool