39 #ifndef __UT_PathSearch__
40 #define __UT_PathSearch__
132 const char *carat_expand =
"",
139 static void pathMapLoad(
const char *dict);
140 static void pathMapAdd(
const char *
src,
const char *dest,
141 bool case_sensitive);
142 static bool pathMapRemove(
const char *src);
161 static void rehashAll();
169 static void getHomeHoudini(
UT_String &str);
174 void extendPath(
const char *defpath = 0,
176 const char *carat_expand = 0,
183 bool appendPath(
const char *path,
bool condensed =
false);
187 bool removePath(
const char *path);
190 void prependPath(
const char *path);
194 int findFile(
UT_String &result,
const char *search)
const;
195 int findFile(
UT_WorkBuffer &result,
const char *search)
const;
196 int findDirectory(
UT_String &result,
const char *search)
const;
202 bool findDirectoryFromList(
UT_String &result,
208 int findAllFiles(
const char *search,
211 int findAllDirectories(
const char *search,
218 bool returnfullpaths,
221 bool skip_dup_paths=
false)
const;
228 bool returnfullpaths,
231 bool skip_dup_paths=
false)
const;
233 int matchAllFilesInSubdirectory(
const char *extension,
234 const char *subdirectory,
235 bool returnfullpaths,
238 bool skip_dup_paths=
false)
const;
240 const char *subdirectory,
241 bool returnfullpaths,
244 bool skip_dup_paths=
false)
const;
249 int houdiniFindFile(
const char *
find,
UT_String &result)
const;
250 int houdiniFindFile(
const char *find,
UT_WorkBuffer &result)
const;
252 int houdiniFindDirectory(
const char *find,
UT_String &result)
const;
253 int houdiniFindDirectory(
const char *find,
UT_WorkBuffer &
r)
const;
263 {
return myCondensedPaths(i); }
284 enum { NUM_PATHS = 7 };
286 int size()
const {
return NUM_PATHS; }
287 const char *
hip()
const {
return myPaths[2]; }
289 const char *myPaths[NUM_PATHS];
290 const char *myCondensedPaths[NUM_PATHS];
303 return condenseCommon(path, path, common);
313 return condenseCommon(path, path.
buffer(), common);
323 return condenseCommon(condensed, path, common);
333 return condenseCommon(condensed, path, common);
339 return condenseCommon(path, path, common);
345 return condenseCommon(path, path.
buffer(), common);
352 return condensePath(path, source_path, common.
myPaths,
360 return condensePath(path, source_path, common.
myPaths,
370 const char *source_path,
371 const char *
const paths[],
372 const char *
const condensed_paths[],
377 const char *source_path,
378 const char *
const paths[],
379 const char *
const condensed_paths[],
383 bool ok = condensePath(condensed, source_path,
384 paths, condensed_paths, npaths);
387 else if (path.
buffer() != source_path)
394 const char *
const paths[],
395 const char *
const condensed_paths[],
398 return condensePath(path, path, paths, condensed_paths, npaths);
415 static bool resolveAbsolutePath(
const char *
filename,
432 const char *insert_path);
447 bool returnfullpaths,
452 void appendPathPrivate(
const char *path);
469 houdiniFindFile(find, result))
478 houdiniFindFile(find, result))
480 return result.
length() != 0;
488 findAllFiles(find, result);
496 houdiniFindDirectory(find, result))
505 houdiniFindDirectory(find, result))
507 return result.
length() != 0;
515 findAllDirectories(find, result);
static const UT_PathSearch * getInstance(UT_KnownPath path_type)
const char * getCondensedComponent(int i) const
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)
const char * getBaseComponent(int i) const
GLsizei const GLchar *const * path
const char * myPaths[NUM_PATHS]
OIIO_API std::string extension(const std::string &filepath, bool include_dot=true) noexcept
SYS_FORCE_INLINE const char * buffer() const
void copyIntoString(UT_String &str) const
GLuint const GLchar * name
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)
FMT_CONSTEXPR bool find(Ptr first, Ptr last, T value, Ptr &out)
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.
OPENVDB_API void initialize()
Global registration of basic types.
static bool condenseCommon(UT_WorkBuffer &condensed, const char *path)
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)
OIIO_API bool copy(string_view from, string_view to, std::string &err)
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)
int getVariableId() const
GLenum const void * paths