{\r
return S_FALSE;\r
}\r
- * inStream = NULL;\r
+ * inStream = nullptr;\r
wxString szFileName = this->piInfo.fiInfo.fnFileName.GetPathWithSep() + szName;\r
if (! this->fiInfo.Find(szFileName.c_str()) || fiInfo.IsDir())\r
{\r
return S_FALSE;\r
}\r
\r
- CInFileStream * inFile = new CInFileStream;\r
+ auto inFile = new CInFileStream;\r
CMyComPtr<IInStream> inStreamTemp = inFile;\r
if (! inFile->Open(szFileName.c_str()))\r
{\r
this->piInfo.eMessage = TPI_MESSAGE_ASK;\r
this->piInfo.eStatus = TPI_PARAM_PASSWORD;\r
return\r
- (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE) ? ::StringToBstr(this->piInfo.szParam.c_str(), sz) :\r
+ (g_prProc != nullptr && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE) ? ::StringToBstr(this->piInfo.szParam.c_str(), sz) :\r
E_ABORT;\r
}\r
\r
{\r
this->piInfo.eStatus = TPI_STATUS_INPROCESS;\r
this->piInfo.nProcessedSize = * nProcessed - this->nCurrentPos;\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
+ if (g_prProc == nullptr || 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
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
+ if (g_prProc != nullptr && 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
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
+ if (g_prProc != nullptr && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
{\r
this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
return E_ABORT;\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
+ if (g_prProc != nullptr && 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
// 時刻を記録。\r
- if (_outFileStream != NULL)\r
+ if (_outFileStream != nullptr)\r
{\r
FILETIME ftAccess, ftCreate, ftModify;\r
NWindows::NTime::UnixTimeToFileTime(this->piInfo.fiInfo.tmAccess.GetTicks(), ftAccess);\r
this->piInfo.eStatus = TPI_PARAM_PASSWORD;\r
// 次のファイル名が取得できないので、とりあえず空にしておく。\r
this->piInfo.fiInfo.fnFileName.Clear();\r
- return (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE) ? ::StringToBstr(this->piInfo.szParam.c_str(), szPassword) : E_ABORT;\r
+ return (g_prProc != nullptr && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE) ? ::StringToBstr(this->piInfo.szParam.c_str(), szPassword) : E_ABORT;\r
}\r
else\r
{\r
{\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 == nullptr || this->piInfo.fiInfo.szStoredName.IsEmpty() || g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) == TPI_CALLBACK_CONTINUE)\r
{\r
return S_OK;\r
}\r
\r
STDMETHODIMP CArchiveUpdateCallback::GetUpdateItemInfo(unsigned int /* index */, int *newData, int *newProperties, unsigned int *indexInArchive)\r
{\r
- if (newData != NULL)\r
+ if (newData != nullptr)\r
{\r
* newData = 1;\r
}\r
- if (newProperties != NULL)\r
+ if (newProperties != nullptr)\r
{\r
* newProperties = 1;\r
}\r
- if (indexInArchive != NULL)\r
+ if (indexInArchive != nullptr)\r
{\r
* indexInArchive = (unsigned) -1;\r
}\r
if (this->nCurrentPos > 0)\r
{\r
this->piInfo.eStatus = TPI_STATUS_ENDPROCESS;\r
- if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
+ if (g_prProc != nullptr && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
{\r
this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
return E_ABORT;\r
this->piInfo.fnDestination = wxFileName(this->piInfo.fiInfo.szStoredName);\r
\r
// コールバック関数に送信。\r
- if (g_prProc != NULL && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
+ if (g_prProc != nullptr && g_prProc(TPI_NOTIFY_COMMON, & this->piInfo) != TPI_CALLBACK_CONTINUE)\r
{\r
this->nErrorCode = TPI_ERROR_D_SKIPPED;\r
return E_ABORT;\r
return S_OK;\r
}\r
\r
- CInFileStream * inStreamSpec = new CInFileStream;\r
+ auto inStreamSpec = new CInFileStream;\r
CMyComPtr<ISequentialInStream> inStreamLoc(inStreamSpec);\r
if (! inStreamSpec->Open(this->piInfo.fiInfo.fnFileName.GetFullPath().c_str()))\r
{\r
\r
STDMETHODIMP CArchiveUpdateCallback::GetVolumeStream(unsigned int nIndex, ISequentialOutStream ** volumeStream)\r
{\r
- COutFileStream * streamSpec = new COutFileStream;\r
+ auto streamSpec = new COutFileStream;\r
CMyComPtr<ISequentialOutStream> streamLoc(streamSpec);\r
if (! streamSpec->Create(this->piInfo.fiInfo.fnFileName.GetFullPath() + wxString::Format(wxT(".%03d"), nIndex + 1), false))\r
{\r
void * _pPtr\r
)\r
{\r
- if (_pPtr == NULL)\r
+ if (_pPtr == nullptr)\r
{\r
return TPI_ERROR_D_PARAMETER;\r
}\r
{\r
xmlLibrary = myGetNextLib(xmlLibrary);\r
}\r
- if (xmlLibrary == NULL)\r
+ if (xmlLibrary == nullptr)\r
{\r
// データの終端に達した場合。\r
return TPI_ERROR_S_ENDOFDATA;\r
// xml解析開始。\r
wxXmlDocument xmlDoc(myMakeXMLName(wxT("7zArc")));\r
wxXmlNode * xmlLibrary = myGetFirstLib(& xmlDoc, _nTypeId);\r
- if (xmlLibrary == NULL)\r
+ if (xmlLibrary == nullptr)\r
{\r
// xml文法エラー。\r
return TPI_ERROR_UNDEFINED;\r
}\r
\r
// コールバック関数を設定。\r
- if (_prProc != NULL)\r
+ if (_prProc != nullptr)\r
{\r
g_prProc = * _prProc;\r
}\r
\r
// 対応するライブラリを調査。\r
// 無限ループに陥らないよう上限を設定。\r
- for (g_LibInfo.nLibIndex = 0; g_LibInfo.nLibIndex < 300 && xmlLibrary != NULL; g_LibInfo.nLibIndex++)\r
+ for (g_LibInfo.nLibIndex = 0; g_LibInfo.nLibIndex < 300 && xmlLibrary != nullptr; g_LibInfo.nLibIndex++)\r
{\r
// ライブラリをロード。\r
const GUID guid = {0x23170F69, 0x40C1, 0x278A, {0x10, 0x00, 0x00, 0x01, 0x10, (unsigned char) myGetAttributeInt(xmlLibrary, wxT("name"), 0, 16), 0x00, 0x00}};\r
g_LibInfo.node = * xmlLibrary;\r
\r
// 書庫を開く。\r
- CInFileStream * fileSpec = new CInFileStream;\r
+ auto fileSpec = new CInFileStream;\r
CMyComPtr<IInStream> file = fileSpec;\r
if (! fileSpec->Open(_szArcName.c_str()))\r
{\r
MakeFormatInfo(xmlLibrary, wxT("7zArc"), & fiInfo, g_LibInfo.nLibIndex);\r
\r
// 書庫に対応しているかチェック。\r
- CArchiveOpenCallback * openCallbackSpec = new CArchiveOpenCallback;\r
+ auto openCallbackSpec = new CArchiveOpenCallback;\r
CMyComPtr<IArchiveOpenCallback> openCallback(openCallbackSpec);\r
// SFXを完全に検出するには全体をロードする必要がある。\r
wxULongLong_t nMax = fiInfo.fSFX ? 262114 : 1024;\r
*/\r
if (hArc->Open(file, & nMax, openCallback) == S_OK)\r
{\r
- if (_nFileCount != NULL)\r
+ if (_nFileCount != nullptr)\r
{\r
unsigned int n;\r
hArc->GetNumberOfItems(& n);\r
while (GetFileInformation(_hArchive, & fiInfo) == TPI_ERROR_SUCCESS);\r
}\r
\r
- CArchiveExtractCallback * extractCallbackSpec = new CArchiveExtractCallback((IInArchive *) _hArchive, _swInfo);\r
+ auto extractCallbackSpec = new CArchiveExtractCallback((IInArchive *) _hArchive, _swInfo);\r
extractCallbackSpec->fnArchive = fnArchive;\r
CMyComPtr<IArchiveExtractCallback> extractCallback(extractCallbackSpec);\r
((IInArchive *) _hArchive)->Extract(& nIndexes.Front(), nIndexes.Size(), _eCommand == TPI_COMMAND_TEST, extractCallback);\r
fiItems.Add(fi);\r
}\r
\r
- COutFileStream * outFileStreamSpec = new COutFileStream;\r
+ auto outFileStreamSpec = new COutFileStream;\r
CMyComPtr<IOutStream> outFileStream = outFileStreamSpec;\r
IOutArchive * hArc;\r
if (_eCommand == TPI_COMMAND_CREATE)\r
}\r
\r
// 更新処理を実行。\r
- CArchiveUpdateCallback * updateCallbackSpec = new CArchiveUpdateCallback(_swInfo, & fiItems);\r
+ auto updateCallbackSpec = new CArchiveUpdateCallback(_swInfo, & fiItems);\r
CMyComPtr<IArchiveUpdateCallback2> updateCallback(updateCallbackSpec);\r
hArc->UpdateItems(outFileStream, fiItems.Size(), updateCallback);\r
nErrorCode = updateCallbackSpec->nErrorCode;\r