• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Extract函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Extract函数的典型用法代码示例。如果您正苦于以下问题:C++ Extract函数的具体用法?C++ Extract怎么用?C++ Extract使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: InitialPermutation

void InitialPermutation(EncryptBlk *sourceBlkPTr,EncryptBlk *resultBlkPTr )
{
	doubleLong 	dataToEncrypt;
	uint32_t 	resultLow = 0;
	uint32_t 	resultHi = 0;
	register uint32_t gTestVal = 0;

#if TARGET_RT_BIG_ENDIAN
	dataToEncrypt.bits49to64 = sourceBlkPTr->keyLo & klowWord;
	dataToEncrypt.bits33to48 = sourceBlkPTr->keyHi & klowWord;
	dataToEncrypt.bits17to32 = sourceBlkPTr->keyLo >> kwordSize;
	dataToEncrypt.bits1to16  = sourceBlkPTr->keyHi >> kwordSize;
#else
	dataToEncrypt.bits49to64 = CFSwapInt16(sourceBlkPTr->keyLo >> kwordSize);
	dataToEncrypt.bits33to48 = CFSwapInt16(sourceBlkPTr->keyHi >> kwordSize);
	dataToEncrypt.bits17to32 = CFSwapInt16(sourceBlkPTr->keyLo & klowWord);
	dataToEncrypt.bits1to16  = CFSwapInt16(sourceBlkPTr->keyHi & klowWord);
#endif
	
	Extract(&dataToEncrypt, &resultLow, &resultHi);

	RORightLong(resultLow)
	RORightLong(resultHi)

	Extract(&dataToEncrypt, &resultLow, &resultHi);
	
	resultBlkPTr->keyLo = resultLow;
	resultBlkPTr->keyHi = resultHi;
}
开发者ID:aosm,项目名称:DSPasswordServerPlugin,代码行数:29,代码来源:DES.c


示例2: HandleLookNewsgroup

Bool HandleLookNewsgroup(char *ptr, long len)
{
   ID resource_id;
   WORD newsgroup;
   BYTE permission;
   char message[MAXMESSAGE + 1];
   char* msg = message;
   int temp_len;
   object_node obj;

   temp_len = SIZE_NEWSGROUP_ID + 1 + SIZE_ID * 4 + SIZE_ANIMATE;
   if (len < temp_len)
      return False;

   Extract(&ptr, &newsgroup, SIZE_NEWSGROUP_ID);
   Extract(&ptr, &permission, 1);

   ExtractObject(&ptr, &obj);
   Extract(&ptr, &resource_id, SIZE_ID);

   /* Remove format string id # & other ids from length */
   if (!CheckServerMessage(&msg, &ptr, len - temp_len, resource_id))
      return False;

   UserReadNews(&obj, msg, newsgroup, permission);

   return True;
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:28,代码来源:mailnews.c


示例3: HandleLookupNames

Bool HandleLookupNames(char *ptr, long len)
{
   WORD num_objects;
   int i;
   ID objs[MAX_RECIPIENTS];
   char *start = ptr;

   Extract(&ptr, &num_objects, 2);

   if (num_objects > MAX_RECIPIENTS)
   {
      debug(("Too many recipients %d\n", (int) num_objects));
      return False;
   }
   
   for (i=0; i < num_objects; i++)
      Extract(&ptr, &objs[i], SIZE_ID);
   
   len -= (ptr - start);
   if (len != 0)
   {
      SafeFree(objs);
      return False;
   }

   MailRecipientsReceived(num_objects, objs);
   
   return True;
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:29,代码来源:mailnews.c


示例4: pasv

void pasv(srv_config *sCon, srv_config *spCon){
    printf("pasv\n");
    char pasv_data[512];
    char *buff = "PASV\r\n";
    if (send(sCon->sock, buff, strlen(buff), 0) == INVALID_SOCKET) return 0;
    char *recv_datas = recv_data(sCon->sock);
    printf(recv_datas);
    char *ip_tmp = strstr(recv_datas, "(");
    char ip[512];
    int port;
    char port_buffer[512];
    int pos = Extract(ip_tmp, ip, 1, ',');
    int i;
    for (i=0; i!=3; i++)
        if ((pos = Extract(ip_tmp, ip, pos, ',')) ==-1) exit(-1);
    ip[strlen(ip)-1] = '\0';
    CharReplace(ip, ',', '.');
    if ((pos = Extract(ip_tmp, port_buffer, pos, ',')) ==-1) exit(-1);
    port_buffer[strlen(port_buffer)-1] = '\0';
    port = atoi(port_buffer)*256;
    memset(port_buffer, '\0', strlen(port_buffer));
    if ((pos = Extract(ip_tmp, port_buffer, pos, ')')) ==-1) exit(-1);
    port_buffer[strlen(port_buffer)-1] = '\0';
    port = port+atoi(port_buffer);
    spCon->ip = ip;
    spCon->port = port;
    gen_baseinfo(spCon);
    printf("IP: %s Port: %d\n", spCon->ip, spCon->port);
}
开发者ID:NataliaSlabkiy,项目名称:smallFTP,代码行数:29,代码来源:SrvConfig.c


示例5: HandleMail

Bool HandleMail(char *ptr, long len)
{
   long index;
   WORD num_recipients, i;
   char message[MAXMESSAGE + MAX_SUBJECT + 200];
   char* msg = message;
   char sender[MAXUSERNAME + 1];
   char recipients[MAX_RECIPIENTS][MAXUSERNAME + 1];
   ID resource_id;
   long msg_time;
   char *start = ptr;

   Extract(&ptr, &index, 4);
   len -= 4;
   len = ExtractString(&ptr, len, sender, MAXUSERNAME);
   if (len == -1)
      return False;
   Extract(&ptr, &msg_time, SIZE_TIME);
   Extract(&ptr, &num_recipients, SIZE_NUM_RECIPIENTS);
   len -= SIZE_TIME + SIZE_NUM_RECIPIENTS;

   // If somehow mail message is screwed up, delete it
   if (num_recipients > MAX_RECIPIENTS)
   {
      RequestDeleteMail(index);
      return False;
   }

   /* If no recipients, then there is no more mail */
   if (num_recipients == 0)
   {
      MailNewMessage(0, sender, 0, NULL, NULL, 0);
      return True;
   }

   for (i=0; i < num_recipients; i++)
   {
      len = ExtractString(&ptr, len, recipients[i], MAXUSERNAME);
      if (len == -1)
         return False;
   }
   
   Extract(&ptr, &resource_id, SIZE_ID);
   len -= SIZE_ID;
   
   /* Remove format string id # & other ids from length */
   if (!CheckServerMessage(&msg, &ptr, len, resource_id))
      return False;

   MailNewMessage(index, sender, num_recipients, recipients, msg, msg_time);

   return True;
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:53,代码来源:mailnews.c


示例6: GetTempPath

void Controller::OpenInMiniBrowser( UINT i)
{
	if( pArchiveFile->GetStatus() != ArchiveFile::Status::UNCOMPRESSED)
	{
		return ;
	}

	File* pFile = pArchiveFile->GetChildFile( i) ;
	if( !pFile)
	{
		return ;
	}

	// ファイル名取得
	string str = "zipmp3tmp" ;
	char pszTmpPath[ MAX_PATH + 1] ;
	GetTempPath( MAX_PATH, pszTmpPath) ;
	char pszPath[ MAX_PATH + 1] ;
	GetTempFileName( pszTmpPath, str.c_str(), 0, pszPath) ;

	// 解凍
	if(Extract( i, pszPath))
	{
		if( GetFileAttributes( strPrevTmpPath.c_str()) != -1)
		{
			DeleteFile( strPrevTmpPath.c_str()) ;
		}
		strPrevTmpPath = pszPath ;

		// 開く
		SendMessage( pMainWnd->GetWinampWindow(), WM_WA_IPC, (WPARAM)pszPath, IPC_MBOPENREAL) ;
		SendMessage( pMainWnd->GetWinampWindow(), WM_WA_IPC, (WPARAM)NULL, IPC_MBOPENREAL) ;
	}
}
开发者ID:nitoyon,项目名称:winamp-zipmp3plugin,代码行数:34,代码来源:Controller.cpp


示例7: error

    void GenericBsa::Extract(const std::string& assetPath,
                             const boost::filesystem::path& destRootPath,
                             const bool overwrite) const {
        fs::path outFilePath = destRootPath / assetPath;

        if (!overwrite && fs::exists(outFilePath))
            throw error(LIBBSA_ERROR_FILESYSTEM_ERROR, "The file \"" + outFilePath.string() + "\" already exists.");

        try {
            //Create parent directories.
            fs::create_directories(outFilePath.parent_path());  //This creates any directories in the path that don't already exist.

            const uint8_t * data;
            size_t dataSize;
            Extract(assetPath, &data, &dataSize);

            //Write new file.
            boost::filesystem::ofstream out(outFilePath, ios::binary | ios::trunc);
            out.exceptions(ios::failbit | ios::badbit | ios::eofbit);  //Causes ifstream::failure to be thrown if problem is encountered.

            out.write((char*)data, dataSize);

            out.close();
        }
        catch (ios_base::failure& e) {
            throw error(LIBBSA_ERROR_FILESYSTEM_ERROR, e.what());
        }
    }
开发者ID:WrinklyNinja,项目名称:libbsa,代码行数:28,代码来源:genericbsa.cpp


示例8: Extract

 void GenericBsa::Extract(const vector<BsaAsset>& assetsToExtract,
                          const boost::filesystem::path& destRootPath,
                          const bool overwrite) const {
     for (const auto& asset : assetsToExtract) {
         Extract(asset.path, destRootPath, overwrite);
     }
 }
开发者ID:WrinklyNinja,项目名称:libbsa,代码行数:7,代码来源:genericbsa.cpp


示例9: farPrepareFileName

int ArchivePanel::pGetFiles(
		const PluginPanelItem *PanelItem,
		int ItemsNumber,
		int Move,
		const TCHAR* DestPath,
		int OpMode
		)
{
	int bResult = false; ///!!! error!!!

	bool bExtractWithoutPath = true;

#ifdef UNICODE
	DestPath = *(TCHAR**)DestPath;
#endif

	if ( OpMode & (OPM_VIEW | OPM_EDIT | OPM_FIND | OPM_QUICKVIEW) ) //hmm...
		m_strLastDestPath = DestPath;

	if ( ((OpMode & OPM_SILENT) == OPM_SILENT) || dlgUnpackFiles(DestPath, Move, m_strLastDestPath, bExtractWithoutPath) )
	{
		farPrepareFileName(m_strLastDestPath);

		ArchiveItemArray items; //100??

		GetArchiveItemsToProcess(PanelItem, ItemsNumber, items);

		bResult = Extract(items, m_strLastDestPath, bExtractWithoutPath);

		if ( Move && bResult )
			bResult = Delete(items);
	}

	return bResult;
}
开发者ID:CyberShadow,项目名称:FAR,代码行数:35,代码来源:newarc.Panel.cpp


示例10: HandleUserCommand

Bool HandleUserCommand(char *ptr, long len)
{
   BYTE type;
   int index;
   Bool success;

   Extract(&ptr, &type, SIZE_TYPE);

   // Dispatch on user command code
   index = 0;
   while (user_handler_table[index].msg_type != 0)
   {
      if (user_handler_table[index].msg_type == type)
      {
	 if (user_handler_table[index].handler != NULL)
	 {                           
	    /* Don't count type byte in length for handler */
	    success = (*user_handler_table[index].handler)(ptr, len - SIZE_TYPE);
	    if (!success)
	    {
	       debug(("Error in user command message of type %d from server\n", type));
	       return False;
	    }
	    return True;
	 }
	 break;
      }
      index++;
   }
   return False;
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:31,代码来源:chess.c


示例11: EvaluateBishops

Score EvaluateBishops(uint64_t bb, Phase phase, uint64_t safeDestinations, uint64_t occupancy)
{
	Score ret = 0;

	if (PopCount(bb) >= 2)
	{
		ret += ScalePhase(BISHOP_PAIR_BONUS[0], BISHOP_PAIR_BONUS[1], phase);
	}

	while (bb)
	{
		uint32_t idx = Extract(bb);

		uint32_t mobility = PopCount(Bmagic(idx, occupancy) & safeDestinations);

		ret += ScalePhase(BISHOP_MOBILITY[0][mobility] * MOBILITY_MULTIPLIERS[0],
						  BISHOP_MOBILITY[1][mobility] * MOBILITY_MULTIPLIERS[1], phase);

		if (COLOR == BLACK)
		{
			idx = FLIP[idx];
		}

		ret += ScalePhase(BISHOP_PCSQ[0][idx], BISHOP_PCSQ[1][idx], phase);
	}

	return ret;
}
开发者ID:enlighter,项目名称:giraffe,代码行数:28,代码来源:eval.cpp


示例12: EvaluatePawns

Score EvaluatePawns(uint64_t bb, Phase phase, uint64_t &pawnAttacksOut)
{
	Score ret = 0;

	while (bb)
	{
		uint32_t idx = Extract(bb);

		if (COLOR == WHITE)
		{
			pawnAttacksOut |= PAWN_ATK[idx][0];
		}
		else
		{
			pawnAttacksOut |= PAWN_ATK[idx][1];
		}

		if (COLOR == BLACK)
		{
			idx = FLIP[idx];
		}

		ret += ScalePhase(PAWN_PCSQ[idx] * PAWN_PCSQ_MULTIPLIERS[0], PAWN_PCSQ[idx] * PAWN_PCSQ_MULTIPLIERS[1], phase);
	}

	return ret;
}
开发者ID:enlighter,项目名称:giraffe,代码行数:27,代码来源:eval.cpp


示例13: LoadLeapSecondKernel

 /** 
  * Constructs a iTime object and initializes it to the time from the argument.
  * 
  * @param time An ephemeris time (ET).
  */
  iTime::iTime (const double time) {
    LoadLeapSecondKernel ();
    p_et = time;
    Extract ();
    p_original = EtString();
    UnloadLeapSecondKernel ();
  }
开发者ID:assutech,项目名称:isis3,代码行数:12,代码来源:iTime.cpp


示例14: feature

	CDoubleFeature CSkinFeatureExtractor::Extract(const IRgbImage &img, const int id) const
	{
		// entrance
		CDoubleFeature feature(id, FEATURE_DIM, 0);
		Extract(feature, img);
		return feature;
	}
开发者ID:VideoKit,项目名称:VideoCollage,代码行数:7,代码来源:SkinFeatureExtractor.cpp


示例15: ATLASSERT

	void CWaveletTextureFeatureExtractor::Extract(CDoubleFeature& feature, const IRgbImage& img) const
	{
		ATLASSERT(feature.Size() == FEATURE_DIM);
		CFloatFeature _float_feature(UNDEFINED_FEATURE_ID, FEATURE_DIM);
		Extract(_float_feature, img);	
		VxCore::CopyFeatureData(feature, _float_feature);
	}
开发者ID:VideoKit,项目名称:VideoCollage,代码行数:7,代码来源:TextureFeatureExtractor.cpp


示例16: BeginPrivate

void FileFormatImplementation::BeginKeywordExtraction()
{
   BeginPrivate();
   m_data->keywords.Clear();
   Extract( m_data->keywords );
   m_data->keywordIterator = m_data->keywords.Begin();
}
开发者ID:SunGong1993,项目名称:PCL,代码行数:7,代码来源:FileFormatImplementation.cpp


示例17: Release

HRESULT CSBuffer::Load(CSound *pDS, LONG lSize, FILE *fptr, int Num)
{
    HRESULT rval;
    CHAR* lpCache;
    int length, save;

	// Release all allocated Memory, befor continue
//	m_nBuffers = Num;
	Release( );

    length = lSize;

    // If lSize equals zero get the size of the file.
    if(length == 0)
    {
        // Save the pointer location
        save = ftell(fptr);
        if(ferror(fptr))
            return NULL;

        // Seek to end of file
        fseek(fptr, 0, SEEK_END);
        if(ferror(fptr))
            return NULL;

        // Get the size of the file
        length = ftell(fptr);
        if(ferror(fptr))
            return NULL;

        // Seek back to save position
        fseek(fptr, save, SEEK_SET);
        if(ferror(fptr))
            return NULL;

    }

    // Cache the whole file in memory
    // Allocate memory to hold the data
    lpCache = new CHAR[length];
    if(lpCache == NULL)
        return NULL;

    // Read in the data
    fread(lpCache, 1, length, fptr);
    if(ferror(fptr))
    {
        delete [] lpCache;
        return NULL;
    }

    // Load it from memory.
    rval = Extract(pDS, length, lpCache, Num);

    // Delete the cache
    delete [] lpCache;

	return rval;
}
开发者ID:KaSt,项目名称:mir2ei,代码行数:59,代码来源:SBuffer.cpp


示例18: IndexOf

//---------------------------------------------------------------------------
void __fastcall TTerminalManager::FreeTerminal(TTerminal * Terminal)
{
  try
  {
    // we want the Login dialog to open on auto-workspace name,
    // as set in TCustomScpExplorerForm::FormClose
    if (!FDestroying || !WinConfiguration->AutoSaveWorkspace)
    {
      if (StoredSessions->FindSame(Terminal->SessionData) != NULL)
      {
        WinConfiguration->LastStoredSession = Terminal->SessionData->Name;
      }
    }

    if (ScpExplorer != NULL)
    {
      ScpExplorer->TerminalRemoved(Terminal);
    }

    if (Terminal->Active)
    {
      Terminal->Close();
    }
  }
  __finally
  {
    int Index = IndexOf(Terminal);
    FTerminalList->Clear();
    Extract(Terminal);

    TTerminalQueue * Queue;
    Queue = reinterpret_cast<TTerminalQueue *>(FQueues->Items[Index]);
    FQueues->Delete(Index);
    FTerminationMessages->Delete(Index);

    if (ActiveTerminal && (Terminal == ActiveTerminal))
    {
      if ((Count > 0) && !FDestroying)
      {
        ActiveTerminal = Terminals[Index < Count ? Index : Index - 1];
      }
      else
      {
        ActiveTerminal = NULL;
      }
    }
    else
    {
      SaveTerminal(Terminal);
    }

    // only now all references to/from queue (particularly events to explorer)
    // are cleared
    delete Queue;
    delete Terminal;

    DoTerminalListChanged();
  }
}
开发者ID:elazzi,项目名称:winscp,代码行数:60,代码来源:TerminalManager.cpp


示例19: Extract

HRESULT CSBuffer::Load(CSound* pDS, LONG lSize, CHAR* lpCache, int Num)
{
    HRESULT rval;
    
    rval = Extract(pDS, lSize, lpCache, Num);

    return rval;
}
开发者ID:KaSt,项目名称:mir2ei,代码行数:8,代码来源:SBuffer.cpp


示例20: glGetFloatv

void Frustum::ExtractFromOGLState() {
  Matrix44f modelview;
  Matrix44f projection;

  glGetFloatv(GL_MODELVIEW_MATRIX, modelview.get_ptr());
  glGetFloatv(GL_PROJECTION_MATRIX, projection.get_ptr());

  Extract(projection * modelview);
}
开发者ID:otaviog,项目名称:UdToolkit,代码行数:9,代码来源:frustum.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ExtractArgs函数代码示例发布时间:2022-05-30
下一篇:
C++ ExtTextOut函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap