File resolution helper.
More...
#include <mitsuba/core/fresolver.h>
File resolution helper.
FileResolver is a convenience class that allows searching for files within a set of specifiable search paths in a cross-platform compatible manner (similar to the $PATH variable on various operating systems).
mitsuba::FileResolver::FileResolver |
( |
| ) |
|
Create a new file resolver with the default settings.
Create a new file resolver containing the current working directory as the initial search path.
virtual mitsuba::FileResolver::~FileResolver |
( |
| ) |
|
|
inlineprotectedvirtual |
void mitsuba::FileResolver::appendPath |
( |
const fs::path & |
path | ) |
|
Append a search path to the resolver.
void mitsuba::FileResolver::clear |
( |
| ) |
|
Clear all stored search paths.
Create a clone of the file resolver.
virtual const Class* mitsuba::FileResolver::getClass |
( |
| ) |
const |
|
virtual |
Retrieve this object's class.
Reimplemented from Object.
const fs::path& mitsuba::FileResolver::getPath |
( |
size_t |
index | ) |
const |
|
inline |
Return one of the stored paths.
size_t mitsuba::FileResolver::getPathCount |
( |
| ) |
const |
|
inline |
Return the number of stored paths.
void mitsuba::FileResolver::prependPath |
( |
const fs::path & |
path | ) |
|
Prepend a search path to the resolver.
fs::path mitsuba::FileResolver::resolve |
( |
const fs::path & |
path | ) |
const |
Resolve a file using the stored list of search paths.
Go through the list of search paths and try to resolve the supplied path with respect to each one. If everything fails, the path is returned as-is.
fs::path mitsuba::FileResolver::resolveAbsolute |
( |
const fs::path & |
path | ) |
const |
Does the same as resolve(), but returns an absolute path.
std::vector<fs::path> mitsuba::FileResolver::resolveAll |
( |
const fs::path & |
path | ) |
const |
Resolve a file using the stored list of search paths.
In comparison to resolve(), this funtion returns all matches instead of only the first one.
std::string mitsuba::FileResolver::toString |
( |
| ) |
const |
|
virtual |
Return a human-readable string representation.
Reimplemented from Object.
Class* mitsuba::FileResolver::m_theClass |
|
static |
The documentation for this class was generated from the following file: