Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::FileResolver Class Reference

File resolution helper. More...

#include <mitsuba/core/fresolver.h>

+ Inheritance diagram for mitsuba::FileResolver:

Public Member Functions

 FileResolver ()
 Create a new file resolver with the default settings. More...
 
fs::path resolve (const fs::path &path) const
 Resolve a file using the stored list of search paths. More...
 
std::vector< fs::path > resolveAll (const fs::path &path) const
 Resolve a file using the stored list of search paths. More...
 
fs::path resolveAbsolute (const fs::path &path) const
 Does the same as resolve(), but returns an absolute path. More...
 
FileResolverclone () const
 Create a clone of the file resolver. More...
 
void appendPath (const fs::path &path)
 Append a search path to the resolver. More...
 
void prependPath (const fs::path &path)
 Prepend a search path to the resolver. More...
 
void clear ()
 Clear all stored search paths. More...
 
size_t getPathCount () const
 Return the number of stored paths. More...
 
const fs::path & getPath (size_t index) const
 Return one of the stored paths. More...
 
std::string toString () const
 Return a human-readable string representation. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

virtual ~FileResolver ()
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 

Detailed Description

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).

Constructor & Destructor Documentation

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

Member Function Documentation

void mitsuba::FileResolver::appendPath ( const fs::path &  path)

Append a search path to the resolver.

void mitsuba::FileResolver::clear ( )

Clear all stored search paths.

FileResolver* mitsuba::FileResolver::clone ( ) const

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.

Member Data Documentation

Class* mitsuba::FileResolver::m_theClass
static

The documentation for this class was generated from the following file: