Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkStandardFileLocations.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkStandardFileLocations_h
14 #define mitkStandardFileLocations_h
15 
16 #include <string>
17 
18 #include <MitkCoreExports.h>
19 #include <itkObject.h>
20 #include <itkObjectFactory.h>
21 
22 namespace mitk
23 {
30  class MITKCORE_EXPORT StandardFileLocations : public itk::Object
31  {
32  public:
34  typedef itk::Command Superclass;
36 
46  void AddDirectoryForSearch(const char *dir, bool insertInFrontOfSearchList = true);
47 
55  void RemoveDirectoryForSearch(const char *dir);
56 
82  std::string FindFile(const char *filename, const char *pathInSourceDir = nullptr);
83 
96  std::string GetOptionDirectory();
97 
103 
104  protected:
105  itkFactorylessNewMacro(Self);
106  itkCloneMacro(Self);
107 
108  typedef std::vector<std::string> FileSearchVectorType;
110 
113 
120  std::string SearchDirectoriesForFile(const char *filename);
121 
122  private:
123  // Private Copy Constructor
125  };
126 
127 } // namespace
128 
129 #endif
#define MITKCORE_EXPORT
Provides methods to look for configuration and option files in standard locations.
std::string FindFile(const char *filename, const char *pathInSourceDir=nullptr)
Look for a file in several standard locations.
static StandardFileLocations * GetInstance()
Get the singleton instance of StandardFileLocations.
std::string SearchDirectoriesForFile(const char *filename)
Search all directories in the search queue for the given file.
void AddDirectoryForSearch(const char *dir, bool insertInFrontOfSearchList=true)
Add a directory to the search queue.
std::string GetOptionDirectory()
Return the directory for option files.
itk::SmartPointer< Self > Pointer
std::vector< std::string > FileSearchVectorType
void RemoveDirectoryForSearch(const char *dir)
Remove a directory from the search queue.
Find image slices visible on a given plane.