当前位置: 首页>>代码示例>>C++>>正文


C++ CMyComPtr::Extract方法代码示例

本文整理汇总了C++中CMyComPtr::Extract方法的典型用法代码示例。如果您正苦于以下问题:C++ CMyComPtr::Extract方法的具体用法?C++ CMyComPtr::Extract怎么用?C++ CMyComPtr::Extract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMyComPtr的用法示例。


在下文中一共展示了CMyComPtr::Extract方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: extract

void BitMemExtractor::extract( const vector< byte_t >& in_buffer, const wstring& out_dir ) const {
    CMyComPtr< IInArchive > inArchive = openArchive( mLibrary, mFormat, in_buffer, *this );

    ExtractCallback* extractCallbackSpec = new ExtractCallback( *this, inArchive, out_dir );

    CMyComPtr< IArchiveExtractCallback > extractCallback( extractCallbackSpec );
    if ( inArchive->Extract( NULL, static_cast< UInt32 >( -1 ), false, extractCallback ) != S_OK ) {
        throw BitException( extractCallbackSpec->getErrorMessage() );
    }
}
开发者ID:cjtallman,项目名称:bit7z,代码行数:10,代码来源:bitmemextractor.cpp

示例2: ExtractFiles

HRESULT CPlugin::ExtractFiles(
    bool decompressAllItems,
    const UInt32 *indices,
    UInt32 numIndices,
    bool silent,
    NExtract::NPathMode::EEnum pathMode,
    NExtract::NOverwriteMode::EEnum overwriteMode,
    const UString &destPath,
    bool passwordIsDefined, const UString &password)
{
  CScreenRestorer screenRestorer;
  CProgressBox progressBox;
  CProgressBox *progressBoxPointer = NULL;
  if (!silent)
  {
    screenRestorer.Save();

    progressBoxPointer = &progressBox;
    progressBox.Init(
        // g_StartupInfo.GetMsgString(NMessageID::kWaitTitle),
        g_StartupInfo.GetMsgString(NMessageID::kExtracting));
  }


  CExtractCallbackImp *extractCallbackSpec = new CExtractCallbackImp;
  CMyComPtr<IFolderArchiveExtractCallback> extractCallback(extractCallbackSpec);
  
  extractCallbackSpec->Init(
      CP_OEMCP,
      progressBoxPointer,
      /*
      GetDefaultName(m_FileName, m_ArchiverInfo.Extension),
      m_FileInfo.MTime, m_FileInfo.Attributes,
      */
      passwordIsDefined, password);

  if (decompressAllItems)
    return m_ArchiveHandler->Extract(pathMode, overwriteMode,
        destPath, BoolToInt(false), extractCallback);
  else
  {
    CMyComPtr<IArchiveFolder> archiveFolder;
    _folder.QueryInterface(IID_IArchiveFolder, &archiveFolder);

    return archiveFolder->Extract(indices, numIndices,
        BoolToInt(true), // includeAltStreams
        BoolToInt(false), // replaceAltStreamChars
        pathMode, overwriteMode,
        destPath, BoolToInt(false), extractCallback);
  }
}
开发者ID:670232921,项目名称:pfm_archive,代码行数:51,代码来源:PluginRead.cpp

示例3: ProcessVirt

HRESULT CPanelCopyThread::ProcessVirt()
{
  /*
  CMyComPtr<IFolderSetReplaceAltStreamCharsMode> iReplace;
  FolderOperations.QueryInterface(IID_IFolderSetReplaceAltStreamCharsMode, &iReplace);
  if (iReplace)
  {
    RINOK(iReplace->SetReplaceAltStreamCharsMode(ReplaceAltStreamChars ? 1 : 0));
  }
  */

  if (options->testMode)
  {
    CMyComPtr<IArchiveFolder> archiveFolder;
    FolderOperations.QueryInterface(IID_IArchiveFolder, &archiveFolder);
    if (!archiveFolder)
      return E_NOTIMPL;
    CMyComPtr<IFolderArchiveExtractCallback> extractCallback2;
    RINOK(ExtractCallback.QueryInterface(IID_IFolderArchiveExtractCallback, &extractCallback2));
    NExtract::NPathMode::EEnum pathMode =
        NExtract::NPathMode::kCurPaths;
        // NExtract::NPathMode::kFullPathnames;
    Result = archiveFolder->Extract(&Indices.Front(), Indices.Size(),
        BoolToInt(options->includeAltStreams),
        BoolToInt(options->replaceAltStreamChars),
        pathMode, NExtract::NOverwriteMode::kAsk,
        options->folder, BoolToInt(true), extractCallback2);
  }
  else
    Result = FolderOperations->CopyTo(
      BoolToInt(options->moveMode),
      &Indices.Front(), Indices.Size(),
      BoolToInt(options->includeAltStreams),
      BoolToInt(options->replaceAltStreamChars),
      options->folder, ExtractCallback);

  if (Result == S_OK && !ExtractCallbackSpec->ThereAreMessageErrors &&
      (!options->hashMethods.IsEmpty() || options->testMode))
  {
    CProgressMessageBoxPair &pair = GetMessagePair(false); // GetMessagePair(ExtractCallbackSpec->Hash.NumErrors != 0);
    AddHashBundleRes(pair.Message, Hash, FirstFilePath);
  }

  return Result;
}
开发者ID:OwenTan,项目名称:AndroidP7zip,代码行数:45,代码来源:PanelCopy.cpp

示例4: aec

bool vms7zipArchive::Extract(LPCSTR pszArchive, LPCSTR pszOutFolder)
{
    CInFileStream *fileSpec = new CInFileStream;
    CMyComPtr <IInStream> spFile = fileSpec;

    m_errExtract = AEE_GENERIC_ERROR;

    if (false == fileSpec->Open(pszArchive))
        return false;

    CMyComPtr <IInArchive> spArc;

    vms7zipFormatDLL dll;
    if (false == Find7zipDLL (dll, pszArchive, true, spFile, spArc) &&
            false == Find7zipDLL (dll, pszArchive, false, spFile, spArc))
        return false;

    m_errExtract = AEE_NO_ERROR;

    char sz [MY_MAX_PATH];
    fsGetFileName (pszArchive, sz);

    vms7zipArchiveExtractCallback aec (spArc, pszOutFolder, m_pAC, sz);
    HRESULT hr;
    if (FAILED (hr=spArc->Extract (NULL, (UInt32)-1, 0, &aec))) {
        spArc = NULL;
        m_errExtract = aec.is_AbortedByUser () ? AEE_ABORTED_BY_USER : AEE_GENERIC_ERROR;
        return false;
    }

    spArc = NULL;

    if (*aec.get_FurtherExtractFile () != 0) {
        
        bool b = Extract (aec.get_FurtherExtractFile (), pszOutFolder);
        DeleteFile (aec.get_FurtherExtractFile ());
        return b;
    }

    return true;
}
开发者ID:pedia,项目名称:raidget,代码行数:41,代码来源:vms7ziparchive.cpp


注:本文中的CMyComPtr::Extract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。