{\r
this->piInfo.eStatus = TPI_STATUS_INPROCESS;\r
this->piInfo.nProcessedSize = * nProcessed - this->nCurrentPos;\r
- if (g_prProc == NULL || this->piInfo.fiInfo.szStoredName.IsEmpty() || g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE)\r
+ if (g_prProc == NULL || this->piInfo.fiInfo.szStoredName.IsEmpty() || ! this->piInfo.fnDestination.IsOk() || g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE)\r
{\r
return S_OK;\r
}\r
\r
// 前のファイルの処理の終了を通知。\r
this->nCurrentPos += this->piInfo.fiInfo.nUnpackedSize;\r
- this->piInfo.eMessage = TPI_MESSAGE_STATUS;\r
if (this->nCurrentPos != 0)\r
{\r
- this->piInfo.eStatus = TPI_STATUS_ENDPROCESS;\r
+ this->piInfo.eMessage = TPI_MESSAGE_STATUS;\r
+ this->piInfo.eStatus = TPI_STATUS_ENDPROCESS;\r
if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
{\r
this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
}\r
}\r
\r
- // ファイルの基本情報を取得。\r
- this->piInfo.eStatus = TPI_STATUS_BEGINPROCESS;\r
+ // ファイルを処理するか確認。\r
+ this->piInfo.eMessage = TPI_MESSAGE_ASK;\r
+ this->piInfo.eStatus = TPI_PARAM_DEST;\r
GetFileInformation2(this->hArc, & this->piInfo.fiInfo, nIndex);\r
this->piInfo.fnDestination = wxFileName(swInfo->fnDestinationDirectory.GetFullPath() + wxFileName::GetPathSeparator() + (swInfo->fStoreDirectoryPathes ? this->piInfo.fiInfo.fnFileName.GetPath() : (wxString) wxEmptyString), this->piInfo.fiInfo.fnFileName.GetFullName());\r
if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
return E_ABORT;\r
}\r
+ if (! piInfo.fnDestination.IsOk())\r
+ {\r
+ return S_OK;\r
+ }\r
+\r
+ // ファイルの基本情報を取得。\r
+ this->piInfo.eMessage = TPI_MESSAGE_STATUS;\r
+ this->piInfo.eStatus = TPI_STATUS_BEGINPROCESS;\r
+ if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
+ {\r
+ this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
+ return E_ABORT;\r
+ }\r
\r
if (nExtractMode != NArchive::NExtract::NAskMode::kExtract)\r
{\r
return S_OK;\r
}\r
\r
- if (::wxFileExists(this->piInfo.fnDestination.GetFullPath()))\r
- {\r
- // 既にファイルが存在する場合。\r
- if (! ::wxRemoveFile(this->piInfo.fnDestination.GetFullPath()))\r
- {\r
- this->nErrorCode = TPI_ERROR_IO_FILE_DELETE;\r
- return E_ABORT;\r
- }\r
- }\r
-\r
+ // ファイルを作成。\r
_outFileStreamSpec = new COutFileStream;\r
CMyComPtr<ISequentialOutStream> outStreamLoc(_outFileStreamSpec);\r
- if (! _outFileStreamSpec->Open(this->piInfo.fnDestination.GetFullPath(), CREATE_ALWAYS))\r
+ if (! _outFileStreamSpec->Open(this->piInfo.fnDestination.GetFullPath(), CREATE_NEW))\r
{\r
this->nErrorCode = TPI_ERROR_IO_FILE_OPEN;\r
return E_ABORT;\r
return TPI_ERROR_SUCCESS;\r
}\r
\r
-int __stdcall CheckArchive\r
-(\r
- const wxString &,\r
- wxULongLong_t *\r
-)\r
-{\r
- return TPI_ERROR_SUCCESS;\r
-}\r
-\r
int __stdcall OpenArchive\r
(\r
const wxString & _szArcName,\r
- void * * _hArchive\r
+ void * * _hArchive,\r
+ wxULongLong_t * _nFileCount\r
)\r
{\r
// ***.tar.xxxは不便なので弾く。\r
}\r
if (hArc->Open(file, & nMax, openCallback) == S_OK)\r
{\r
+ if (_nFileCount != NULL)\r
+ {\r
+ unsigned int n;\r
+ hArc->GetNumberOfItems(& n);\r
+ * _nFileCount = n;\r
+ }\r
* _hArchive = hArc;\r
return TPI_ERROR_SUCCESS;\r
}\r
nIndexes.Add(fiInfo.nFileId);\r
}\r
}\r
- while (GetFileInformation(hArc, & fiInfo, false) == TPI_ERROR_SUCCESS);\r
+ while (GetFileInformation(hArc, & fiInfo) == TPI_ERROR_SUCCESS);\r
}\r
\r
CArchiveExtractCallback * extractCallbackSpec = new CArchiveExtractCallback(hArc,_swInfo);\r