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


C++ Extract函数代码示例

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


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


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