00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef MITK_STANDARD_FILE_LOCATIONS_H_INCLUDED_SWDG 00019 #define MITK_STANDARD_FILE_LOCATIONS_H_INCLUDED_SWDG 00020 00021 #include <string> 00022 00023 #include <itkObject.h> 00024 #include <itkObjectFactory.h> 00025 #include "mitkCommon.h" 00026 00027 namespace mitk 00028 { 00034 class MITK_CORE_EXPORT StandardFileLocations : public itk::Object 00035 { 00036 public: 00037 typedef StandardFileLocations Self; 00038 typedef itk::Command Superclass; 00039 typedef itk::SmartPointer<Self> Pointer; 00040 00048 void AddDirectoryForSearch(const char * dir, bool insertInFrontOfSearchList = true); 00049 00056 void RemoveDirectoryForSearch(const char * dir); 00057 00078 std::string FindFile(const char* filename, const char* pathInSourceDir = NULL ); 00079 00091 std::string GetOptionDirectory(); 00092 00093 static StandardFileLocations* GetInstance(); 00094 00095 protected: 00096 00097 itkNewMacro( Self ); 00098 00099 typedef std::vector<std::string> FileSearchVectorType; 00100 FileSearchVectorType m_SearchDirectories; 00101 00102 StandardFileLocations(); 00103 virtual ~StandardFileLocations(); 00104 00105 std::string SearchDirectoriesForFile(const char * filename); 00106 00107 private: 00108 00109 // Private Copy Constructor 00110 StandardFileLocations( const StandardFileLocations& ); 00111 }; 00112 00113 } // namespace 00114 00115 #endif 00116 00117