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);
}
Exemplo n.º 2
0
STDMETHODIMP CProgressImp::SetTotal(UInt64 numFiles)
{
  if (_callback)
    return _callback->SetTotal(&numFiles, NULL);
  return S_OK;
}
Exemplo n.º 3
0
HRESULT CProgressImp::SetTotalCD(UInt64 numFiles)
{
  return _callback->SetTotal(&numFiles, NULL);
}