18 #include <Poco/Zip/Compress.h>
19 #include <Poco/Path.h>
20 #include <Poco/File.h>
24 #include "mitkIGTException.h"
25 #include "mitkIGTIOException.h"
46 if (myFile.exists()) myFile.remove(
true);
50 MITK_ERROR <<
"Can't remove temp directory " << m_tempDirectory <<
"!";
58 for(
int i=0; i<storage->GetToolCount();i++)
60 std::string tempFileName = m_tempDirectory + Poco::Path::separator() +
"NavigationTool" + convertIntToString(i) +
".tool";
61 if (!myToolWriter->DoWrite(tempFileName,storage->GetTool(i)))
67 std::ofstream file( filename.c_str(), std::ios::binary | std::ios::out);
71 for (
int i=0; i<storage->GetToolCount();i++)
73 std::string tempFileName = m_tempDirectory + Poco::Path::separator() +
"NavigationTool" + convertIntToString(i) +
".tool";
74 std::remove(tempFileName.c_str());
79 Poco::Zip::Compress zipper( file,
true );
80 for (
int i=0; i<storage->GetToolCount();i++)
82 std::string fileName = m_tempDirectory + Poco::Path::separator() +
"NavigationTool" + convertIntToString(i) +
".tool";
83 zipper.addFile(fileName,myToolWriter->GetFileWithoutPath(fileName));
84 std::remove(fileName.c_str());
95 std::stringstream out;
itk::SmartPointer< Self > Pointer
An object of this class represents an exception of the MITK-IGT module which are releated to the inpu...
static const std::string filename
static std::string CreateTemporaryDirectory(const std::string &templateName="XXXXXX", std::string path=std::string())
static std::string GetProgramPath()
#define mitkThrowException(classname)