Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
Provides a method to look for configuration and option files etc. More...
#include <mitkStandardFileLocations.h>
Public Types | |
typedef StandardFileLocations | Self |
typedef itk::Command | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
Public Member Functions | |
void | AddDirectoryForSearch (const char *dir, bool insertInFrontOfSearchList=true) |
Adds a directory into the search queue: \ Use this function in combination with FindFile(), after adding some \ directories, they will also be searched for the requested file. More... | |
void | RemoveDirectoryForSearch (const char *dir) |
Remove a directory from the search queue: \ Use this function in combination with FindFile(). More... | |
std::string | FindFile (const char *filename, const char *pathInSourceDir=nullptr) |
looks for a file in several standard locations More... | |
std::string | GetOptionDirectory () |
Return directory of/for option files. More... | |
Static Public Member Functions | |
static StandardFileLocations * | GetInstance () |
Protected Types | |
typedef std::vector< std::string > | FileSearchVectorType |
Protected Member Functions | |
Pointer | Clone () const |
StandardFileLocations () | |
virtual | ~StandardFileLocations () |
std::string | SearchDirectoriesForFile (const char *filename) |
Static Protected Member Functions | |
static Pointer | New () |
Protected Attributes | |
FileSearchVectorType | m_SearchDirectories |
Provides a method to look for configuration and option files etc.
Call mitk::StandardFileLocations::FindFile(filename) to look for configuration files. Call mitk::StandardFileLocations::GetOptionDirectory() to look for/save option files.
Definition at line 33 of file mitkStandardFileLocations.h.
|
protected |
Definition at line 100 of file mitkStandardFileLocations.h.
Definition at line 38 of file mitkStandardFileLocations.h.
Definition at line 36 of file mitkStandardFileLocations.h.
typedef itk::Command mitk::StandardFileLocations::Superclass |
Definition at line 37 of file mitkStandardFileLocations.h.
|
protected |
Definition at line 26 of file mitkStandardFileLocations.cpp.
|
protectedvirtual |
Definition at line 30 of file mitkStandardFileLocations.cpp.
void mitk::StandardFileLocations::AddDirectoryForSearch | ( | const char * | dir, |
bool | insertInFrontOfSearchList = true |
||
) |
Adds a directory into the search queue: \ Use this function in combination with FindFile(), after adding some \ directories, they will also be searched for the requested file.
dir | directory you want to be searched in |
insertInFrontOfSearchList | wheather this search request shall be processed first |
Definition at line 43 of file mitkStandardFileLocations.cpp.
|
protected |
std::string mitk::StandardFileLocations::FindFile | ( | const char * | filename, |
const char * | pathInSourceDir = nullptr |
||
) |
looks for a file in several standard locations
filename | The file you want to fine, without any path |
pathInSourceDir | Where in the source tree hierarchy would that file be? |
This method appends several standard locations to the end of the searchqueue (if they not already exist) and then searches for the file within all directories contained in the search queue:
Already added directories in the searchqueue by using AddDirectoryForSearch before calling FindFile are still searched first, because above mentioned standard locations are always appended at the end of the list.
Definition at line 114 of file mitkStandardFileLocations.cpp.
References MITK_ROOT.
|
static |
Definition at line 34 of file mitkStandardFileLocations.cpp.
References New().
Referenced by mitk::SceneIO::CreateEmptyTempDirectory(), and TestThreadSaveLog().
std::string mitk::StandardFileLocations::GetOptionDirectory | ( | ) |
Return directory of/for option files.
This method looks for the directory of/for option files in two ways. The logic is as follows
The directory will be created if it does not exist.
Definition at line 168 of file mitkStandardFileLocations.cpp.
Referenced by mitk::SceneIO::CreateEmptyTempDirectory(), and TestThreadSaveLog().
|
staticprotected |
Referenced by GetInstance().
void mitk::StandardFileLocations::RemoveDirectoryForSearch | ( | const char * | dir | ) |
Remove a directory from the search queue: \ Use this function in combination with FindFile().
dir | directory you want to be searched in |
Definition at line 63 of file mitkStandardFileLocations.cpp.
|
protected |
Definition at line 78 of file mitkStandardFileLocations.cpp.
References filename.
|
protected |
Definition at line 101 of file mitkStandardFileLocations.h.