| 224 | void AbstractFileReader::SetRanking(int ranking) { d->SetRanking(ranking); } |
| 225 | int AbstractFileReader::GetRanking() const { return d->GetRanking(); } |
| 226 | std::string AbstractFileReader::GetLocalFileName() const |
| 227 | { |
| 228 | std::string localFileName; |
| 229 | if (d->m_Stream) |
| 230 | { |
| 231 | if (d->m_TmpFile.empty()) |
| 232 | { |
| 233 | // write the stream contents to temporary file |
| 234 | std::string ext = Utf8Util::Utf8ToLocal8Bit(itksys::SystemTools::GetFilenameExtension(Utf8Util::Local8BitToUtf8(this->GetInputLocation()))); |
| 235 | std::ofstream tmpStream; |
| 236 | localFileName = mitk::IOUtil::CreateTemporaryFile( |
| 237 | tmpStream, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary, "XXXXXX" + ext); |
| 238 | tmpStream << d->m_Stream->rdbuf(); |
| 239 | d->m_TmpFile = localFileName; |
| 240 | } |
| 241 | else |
| 242 | { |
| 243 | localFileName = d->m_TmpFile; |
| 244 | } |
| 245 | } |
| 246 | else |
| 247 | { |
| 248 | localFileName = d->m_Location; |
| 249 | } |
| 250 | return localFileName; |
| 251 | } |
| 252 | |
| 253 | //////////////////////// Options /////////////////////// |
| 254 |
no test coverage detected