Medical Imaging Interaction Toolkit  2025.12.02
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 {
29  class MITKCORE_EXPORT StandardFileLocations : public itk::Object
30  {
31  public:
33  typedef itk::Command Superclass;
35 
43  void AddDirectoryForSearch(const char *dir, bool insertInFrontOfSearchList = true);
44 
50  void RemoveDirectoryForSearch(const char *dir);
51 
76  std::string FindFile(const char *filename, const char *pathInSourceDir = nullptr);
77 
89  std::string GetOptionDirectory();
90 
92 
93  protected:
94  itkFactorylessNewMacro(Self);
95  itkCloneMacro(Self);
96 
97  typedef std::vector<std::string> FileSearchVectorType;
99 
102 
103  std::string SearchDirectoriesForFile(const char *filename);
104 
105  private:
106  // Private Copy Constructor
108  };
109 
110 } // namespace
111 
112 #endif
#define MITKCORE_EXPORT
Provides a method to look for configuration and option files etc.
std::string FindFile(const char *filename, const char *pathInSourceDir=nullptr)
looks for a file in several standard locations
static StandardFileLocations * GetInstance()
std::string SearchDirectoriesForFile(const char *filename)
FileSearchVectorType m_SearchDirectories
void AddDirectoryForSearch(const char *dir, bool insertInFrontOfSearchList=true)
Adds a directory into the search queue: \ Use this function in combination with FindFile(),...
std::string GetOptionDirectory()
Return directory of/for option files.
itk::SmartPointer< Self > Pointer
std::vector< std::string > FileSearchVectorType
void RemoveDirectoryForSearch(const char *dir)
Remove a directory from the search queue: \ Use this function in combination with FindFile().
Find image slices visible on a given plane.