Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "mitkCoreObjectFactoryBase.h"
00019
00020 void mitk::CoreObjectFactoryBase::CreateFileExtensions(MultimapType fileExtensionsMap, std::string& fileExtensions)
00021 {
00022 std::map<std::string, std::string> aMap;
00023
00024
00025
00026 for (MultimapType::iterator it = fileExtensionsMap.begin(); it != fileExtensionsMap.end(); ++it)
00027 {
00028 std::string aValue = aMap[(*it).second];
00029 if (aValue.compare("") != 0)
00030 {
00031 aValue.append(" ");
00032 }
00033 aValue.append((*it).first);
00034 aMap[(*it).second] = aValue;
00035 }
00036
00037
00038
00039
00040 fileExtensions = "all (";
00041 std::string lastKey = "";
00042 for (MultimapType::iterator it = fileExtensionsMap.begin(); it != fileExtensionsMap.end(); ++it)
00043 {
00044 std::string aKey = (*it).first;
00045
00046 if (aKey.compare(lastKey) != 0)
00047 {
00048 if (lastKey.compare("") != 0)
00049 {
00050 fileExtensions.append(" ");
00051 }
00052 fileExtensions.append(aKey);
00053 }
00054 lastKey = aKey;
00055 }
00056 fileExtensions.append(");;");
00057
00058
00059
00060 for (std::map<std::string, std::string>::iterator it = aMap.begin(); it != aMap.end(); ++it)
00061 {
00062
00063 std::string aKey = (*it).first;
00064 if (aKey.compare("") != 0)
00065 {
00066 fileExtensions.append((*it).first);
00067 fileExtensions.append(" (");
00068 fileExtensions.append((*it).second);
00069 fileExtensions.append(");;");
00070 }
00071 }
00072 }
00073