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 #include "mitkFileWriter.h" 00019 00020 bool mitk::FileWriter::CanWriteDataType( DataNode* ) 00021 { 00022 //TODO #345 check for writing permission 00023 return false; 00024 } 00025 00026 std::string mitk::FileWriter::GetWritenMIMEType() 00027 { 00028 return ""; 00029 } 00030 00031 void mitk::FileWriter::SetInput( DataNode* ) 00032 { 00033 } 00034 00035 00036 std::string mitk::FileWriter::GetFileExtension() 00037 { 00038 return ""; 00039 } 00040 00041 std::string mitk::FileWriter::GetPossibleFileExtensionsAsString() 00042 { 00043 std::vector<std::string> possibleFileExtensions = this->GetPossibleFileExtensions(); 00044 std::stringstream stream; 00045 for (unsigned int i=0; i<possibleFileExtensions.size()-1; i++) 00046 { 00047 stream<<"*"<<possibleFileExtensions.at(i)<<" "; 00048 } 00049 stream<<"*"<<possibleFileExtensions.at(possibleFileExtensions.size()-1); 00050 return stream.str(); 00051 } 00052 00053 bool mitk::FileWriter::IsExtensionValid(std::string extension) 00054 { 00055 std::vector<std::string> possibleFileExtensions = this->GetPossibleFileExtensions(); 00056 for (unsigned int i=0; i<possibleFileExtensions.size(); i++) 00057 { 00058 if (strcmp(extension.c_str(),possibleFileExtensions.at(i).c_str())==0) 00059 return true; 00060 } 00061 return false; 00062 } 00063 00064 00065 mitk::FileWriter::FileWriter() 00066 { 00067 } 00068 00069 mitk::FileWriter::~FileWriter() 00070 { 00071 } 00072