STDMETHODIMP CAltStreamsFolder::Rename(UInt32 index, const wchar_t *newName, IProgress *progress) { CMyComPtr<IFolderArchiveUpdateCallback> callback; if (progress) { RINOK(progress->QueryInterface(IID_IFolderArchiveUpdateCallback, (void **)&callback)); } FString destPath = _pathPrefix + us2fs(newName); const CAltStream &ss = Streams[index]; if (callback) { RINOK(callback->SetNumFiles(1)); RINOK(callback->SetTotal(ss.Size)); } NFsFolder::CCopyStateIO state; state.Progress = progress; state.TotalSize = 0; state.DeleteSrcFile = true; return UpdateFile(state, _pathPrefix + us2fs(ss.Name), destPath, callback); }
STDMETHODIMP CProgressImp::SetTotal(UInt64 numFiles) { if (_callback) return _callback->SetTotal(&numFiles, NULL); return S_OK; }
HRESULT CProgressImp::SetTotalCD(UInt64 numFiles) { return _callback->SetTotal(&numFiles, NULL); }