Ocean
Ocean::IO::FileResolver Class Reference

This class implements a file and url resolver. More...

Inheritance diagram for Ocean::IO::FileResolver:

Public Member Functions

 FileResolver ()
 Creates a new resolver object. More...
 
bool addReferencePath (const Directory &reference)
 Registers the reference path. More...
 
Files resolve (const File &file, const bool checkExistence=false) const
 Resolves the absolute paths of a file. More...
 
Files resolve (const Files &files, const bool checkExistence=false) const
 Resolves absolute paths of several files. More...
 
Files resolve (const File &file, const Path &reference, const bool checkExistence=false) const
 Resolves the absolute paths of a file by an additional reference path. More...
 
Files resolve (const Files &files, const Path &reference, const bool checkExistence=false) const
 Resolves the absolute paths of several file by an additional reference path. More...
 

Private Attributes

Directories referencePaths
 Registered reference paths. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Singleton< FileResolver >
static FileResolver & get ()
 Returns a reference to the unique object. More...
 
- Protected Member Functions inherited from Ocean::Singleton< FileResolver >
 Singleton ()=default
 Default constructor. More...
 

Detailed Description

This class implements a file and url resolver.


This resolver is implemented as singleton.
However, it can be used as local object anyway.

Constructor & Destructor Documentation

◆ FileResolver()

Ocean::IO::FileResolver::FileResolver ( )

Creates a new resolver object.

Beware: Do not use this constructor if the global resolver object is requestet.

Member Function Documentation

◆ addReferencePath()

bool Ocean::IO::FileResolver::addReferencePath ( const Directory reference)

Registers the reference path.

Parameters
referenceReference path to register
Returns
True, if the reference path is a valid absolute path

◆ resolve() [1/4]

Files Ocean::IO::FileResolver::resolve ( const File file,
const bool  checkExistence = false 
) const

Resolves the absolute paths of a file.

Parameters
fileFile to resolve
checkExistenceFalse, to return file paths even if they do not exist
Returns
Resolved absolute file paths

◆ resolve() [2/4]

Files Ocean::IO::FileResolver::resolve ( const File file,
const Path reference,
const bool  checkExistence = false 
) const

Resolves the absolute paths of a file by an additional reference path.

Parameters
fileFile to resolve
referenceAdditional reference path
checkExistenceFalse, to return file paths even if they do not existh
Returns
Resolved absolute file paths

◆ resolve() [3/4]

Files Ocean::IO::FileResolver::resolve ( const Files files,
const bool  checkExistence = false 
) const

Resolves absolute paths of several files.

Parameters
filesFiles to resolve
checkExistenceFalse, to return file paths even if they do not exist
Returns
Resolved absolute file paths

◆ resolve() [4/4]

Files Ocean::IO::FileResolver::resolve ( const Files files,
const Path reference,
const bool  checkExistence = false 
) const

Resolves the absolute paths of several file by an additional reference path.

Parameters
filesFiles to resolve
referenceAdditional reference path
checkExistenceFalse, to return file paths even if they do not exist
Returns
Resolved absolute file paths

Field Documentation

◆ referencePaths

Directories Ocean::IO::FileResolver::referencePaths
private

Registered reference paths.


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