Commit 6705045d authored by Sergey Konovalov's avatar Sergey Konovalov

add param m_sTempDir

parent 533bc2c2
...@@ -2550,9 +2550,18 @@ namespace NExtractTools ...@@ -2550,9 +2550,18 @@ namespace NExtractTools
if(NULL != oInputParams.m_oMailMergeSend) if(NULL != oInputParams.m_oMailMergeSend)
oMailMerge = oInputParams.m_oMailMergeSend; oMailMerge = oInputParams.m_oMailMergeSend;
std::wstring sTempDir = NSDirectory::GetFolderPath(sFileFrom) + FILE_SEPARATOR_STR + _T("Temp"); bool bExternalTempDir = false;
NSDirectory::CreateDirectory(sTempDir); std::wstring sTempDir;
if (NULL != oInputParams.m_sTempDir)
{
bExternalTempDir = true;
sTempDir = *oInputParams.m_sTempDir;
}
else
{
sTempDir = NSDirectory::GetFolderPath(sFileFrom) + FILE_SEPARATOR_STR + _T("Temp");
NSDirectory::CreateDirectory(sTempDir);
}
if (sTempDir.empty()) if (sTempDir.empty())
{ {
std::cerr << "Couldn't create temp folder" << std::endl; std::cerr << "Couldn't create temp folder" << std::endl;
...@@ -2795,7 +2804,10 @@ namespace NExtractTools ...@@ -2795,7 +2804,10 @@ namespace NExtractTools
} }
// delete temp dir // delete temp dir
NSDirectory::DeleteDirectory(sTempDir); if (!bExternalTempDir)
{
NSDirectory::DeleteDirectory(sTempDir);
}
//clean up v8 //clean up v8
NSDoctRenderer::CDocBuilder::Dispose(); NSDoctRenderer::CDocBuilder::Dispose();
......
...@@ -345,6 +345,7 @@ namespace NExtractTools ...@@ -345,6 +345,7 @@ namespace NExtractTools
int* m_nDoctParams; int* m_nDoctParams;
std::wstring* m_sHtmlFileInternalPath; std::wstring* m_sHtmlFileInternalPath;
std::wstring* m_sPassword; std::wstring* m_sPassword;
std::wstring* m_sTempDir;
//output params //output params
mutable bool m_bOutputConvertCorrupted; mutable bool m_bOutputConvertCorrupted;
public: public:
...@@ -369,6 +370,7 @@ namespace NExtractTools ...@@ -369,6 +370,7 @@ namespace NExtractTools
m_nDoctParams = NULL; m_nDoctParams = NULL;
m_sHtmlFileInternalPath = NULL; m_sHtmlFileInternalPath = NULL;
m_sPassword = NULL; m_sPassword = NULL;
m_sTempDir = NULL;
m_bOutputConvertCorrupted = false; m_bOutputConvertCorrupted = false;
} }
...@@ -393,6 +395,7 @@ namespace NExtractTools ...@@ -393,6 +395,7 @@ namespace NExtractTools
RELEASEOBJECT(m_nDoctParams); RELEASEOBJECT(m_nDoctParams);
RELEASEOBJECT(m_sHtmlFileInternalPath); RELEASEOBJECT(m_sHtmlFileInternalPath);
RELEASEOBJECT(m_sPassword); RELEASEOBJECT(m_sPassword);
RELEASEOBJECT(m_sTempDir);
} }
bool FromXmlFile(const std::wstring& sFilename) bool FromXmlFile(const std::wstring& sFilename)
...@@ -479,6 +482,8 @@ namespace NExtractTools ...@@ -479,6 +482,8 @@ namespace NExtractTools
m_sHtmlFileInternalPath = new std::wstring(sValue); m_sHtmlFileInternalPath = new std::wstring(sValue);
else if(_T("m_sPassword") == sName) else if(_T("m_sPassword") == sName)
m_sPassword = new std::wstring(sValue); m_sPassword = new std::wstring(sValue);
else if(_T("m_sTempDir") == sName)
m_sTempDir = new std::wstring(sValue);
} }
else if(_T("m_nCsvDelimiterChar") == sName) else if(_T("m_nCsvDelimiterChar") == sName)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment