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);
124 bool prependPath(
const char *path,
bool condensed =
false);
128 int findFile(
UT_WorkBuffer &result,
const char *search)
const;
129 int findDirectory(
UT_String &result,
const char *search)
const;
135 bool findDirectoryFromList(
UT_String &result,
141 int findAllFiles(
const char *search,
144 int findAllDirectories(
const char *search,
151 bool returnfullpaths,
154 bool skip_dup_paths=
false)
const;
161 bool returnfullpaths,
164 bool skip_dup_paths=
false)
const;
166 int matchAllFilesInSubdirectory(
const char *extension,
167 const char *subdirectory,
168 bool returnfullpaths,
171 bool skip_dup_paths=
false)
const;
173 const char *subdirectory,
174 bool returnfullpaths,
177 bool skip_dup_paths=
false)
const;
182 int houdiniFindFile(
const char *
find,
UT_String &result)
const;
183 int houdiniFindFile(
const char *find,
UT_WorkBuffer &result)
const;
185 int houdiniFindDirectory(
const char *find,
UT_String &result)
const;
186 int houdiniFindDirectory(
const char *find,
UT_WorkBuffer &
r)
const;
196 {
return myCondensedPaths(i); }
217 enum { NUM_PATHS = 7 };
219 int size()
const {
return NUM_PATHS; }
220 const char *
hip()
const {
return myPaths[2]; }
222 const char *myPaths[NUM_PATHS];
223 const char *myCondensedPaths[NUM_PATHS];
236 return condenseCommon(path, path, common);
246 return condenseCommon(path, path.
buffer(), common);
256 return condenseCommon(condensed, path, common);
266 return condenseCommon(condensed, path, common);
272 return condenseCommon(path, path, common);
278 return condenseCommon(path, path.
buffer(), common);
285 return condensePath(path, source_path, common.
myPaths,
293 return condensePath(path, source_path, common.
myPaths,
303 const char *source_path,
304 const char *
const paths[],
305 const char *
const condensed_paths[],
310 const char *source_path,
311 const char *
const paths[],
312 const char *
const condensed_paths[],
316 bool ok = condensePath(condensed, source_path,
317 paths, condensed_paths, npaths);
320 else if (path.
buffer() != source_path)
327 const char *
const paths[],
328 const char *
const condensed_paths[],
331 return condensePath(path, path, paths, condensed_paths, npaths);
348 static bool resolveAbsolutePath(
const char *
filename,
365 const char *insert_path);
380 bool returnfullpaths,
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
LeafData & operator=(const LeafData &)=delete
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