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

C++ GetProfile函数代码示例

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

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



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

示例1: AFTER_LoadScript

static void AFTER_LoadScript(KonohaContext *kctx, const char *filename)
{
	int stdlog_count = 0;
	if(stdlog2 != NULL) {
		stdlog_count = 1;
		fprintf(stdlog2, "Q.E.D.\n");   // Q.E.D.
		fclose(stdlog2);
	}
	//if(PLATAPI exitStatus != 0) return;
	if(stdlog_count != 0) {
		//filename = (filename == NULL) ? "shell" : filename;
		char proof_file[256];
		char result_file[256];
		PLATAPI snprintf_i(proof_file, sizeof(proof_file), "%s.%s_proof",  filename, GetProfile());
		PLATAPI snprintf_i(result_file, sizeof(result_file),  "%s.%s_tested", filename, GetProfile());
		FILE *fp = fopen(proof_file, "r");
		if(fp == NULL) {
			fprintf(stdout, "no proof file: %s\n", proof_file);
			((KonohaFactory *)kctx->platApi)->exitStatus = 1;
			return;
		}
		FILE *fp2 = fopen(result_file, "r");
		DBG_ASSERT(fp2 != NULL);
		int ret = check_result2(fp, fp2);
		if(ret != 0) {
			fprintf(stdout, "proof file mismatched: %s\n", proof_file);
			((KonohaFactory *)kctx->platApi)->exitStatus = 78;
		}
		else {
			((KonohaFactory *)kctx->platApi)->exitStatus = 0;
		}
		fclose(fp);
		fclose(fp2);
	}
}
开发者ID:myoan,项目名称:minikonoha,代码行数:35,代码来源:OutputTest.c


示例2: dir

void CCSBot::Panic(CBasePlayer *pEnemy)
{
	if (IsSurprised())
		return;

	Vector2D dir(BotCOS(pev->v_angle.y), BotSIN(pev->v_angle.y));
	Vector2D perp(-dir.y, dir.x);
	Vector spot;

	if (GetProfile()->GetSkill() >= 0.5f)
	{
		Vector2D toEnemy = (pEnemy->pev->origin - pev->origin).Make2D();
		toEnemy.NormalizeInPlace();

		float along = DotProduct(toEnemy, dir);

		float c45 = 0.7071f;
		float size = 100.0f;

		real_t shift = RANDOM_FLOAT(-75.0, 75.0);

		if (along > c45)
		{
			spot.x = pev->origin.x + dir.x * size + perp.x * shift;
			spot.y = pev->origin.y + dir.y * size + perp.y * shift;
		}
		else if (along < -c45)
		{
			spot.x = pev->origin.x - dir.x * size + perp.x * shift;
			spot.y = pev->origin.y - dir.y * size + perp.y * shift;
		}
		else if (DotProduct(toEnemy, perp) > 0.0)
		{
			spot.x = pev->origin.x + perp.x * size + dir.x * shift;
			spot.y = pev->origin.y + perp.y * size + dir.y * shift;
		}
		else
		{
			spot.x = pev->origin.x - perp.x * size + dir.x * shift;
			spot.y = pev->origin.y - perp.y * size + dir.y * shift;
		}
	}
	else
	{
		const float offset = 200.0f;
		real_t side = RANDOM_FLOAT(-offset, offset) * 2.0f;

		spot.x = pev->origin.x - dir.x * offset + perp.x * side;
		spot.y = pev->origin.y - dir.y * offset + perp.y * side;
	}

	spot.z = pev->origin.z + RANDOM_FLOAT(-50.0, 50.0);

	// we are stunned for a moment
	m_surpriseDelay = RANDOM_FLOAT(0.1, 0.2);
	m_surpriseTimestamp = gpGlobals->time;

	SetLookAt("Panic", &spot, PRIORITY_HIGH, 0, 0, 5.0);
	PrintIfWatched("Aaaah!\n");
}
开发者ID:s1lentq,项目名称:ReGameDLL_CS,代码行数:60,代码来源:cs_bot.cpp


示例3: SaveSettingsAsync

/*
========================
idProfileMgr::SaveSettingsAsync
========================
*/
void idProfileMgr::SaveSettingsAsync()
{
	if( !saveGame_enable.GetBool() )
	{
		idLib::Warning( "Skipping profile save because saveGame_enable = 0" );
	}
	
	if( GetProfile() != NULL )
	{
		// Issue the async save...
		if( profileSaveProcessor->InitSaveProfile( profile, "" ) )
		{
		
		
			profileSaveProcessor->AddCompletedCallback( MakeCallback( this, &idProfileMgr::OnSaveSettingsCompleted, &profileSaveProcessor->GetParmsNonConst() ) );
			handle = session->GetSaveGameManager().ExecuteProcessor( profileSaveProcessor.get() );
			profile->SetState( idPlayerProfile::SAVING );
			
		}
	}
	else
	{
		idLib::Warning( "Not saving profile, profile is NULL." );
	}
}
开发者ID:Yetta1,项目名称:OpenTechBFG,代码行数:30,代码来源:sys_profile.cpp


示例4: UBTAuditLog

void UBTAuditLog(const char *pzText, bool bNewLine)
{
	if (g_pchLogFile == LOGGING_UNASSIGNED)
	{
		try
		{
			g_pchLogFile = (char *)GetProfile().GetString("Debug", "DebugTraceXML",false);
			if (g_pchLogFile && g_pchLogFile[0])
			{
				// g_pchLogFile is valid and logging is turned ON
			}
			else
			{
				// Turn off logging and don't check the environment variable anymore (it's slow)
				g_pchLogFile = (char *)LOGGING_OFF;
			}
		}
		catch (GException &)
		{
			// If this fails once, don't try in the future
			g_pchLogFile = (char *)LOGGING_OFF;
		}
	}
	if (g_pchLogFile != LOGGING_OFF)
	{
		if (pzText && pzText[0])
		{
			GString str(pzText);
			if (bNewLine)
				str << "\n";
			str.ToFileAppend(g_pchLogFile,0);
		}
	}
}
开发者ID:BrianAberle,项目名称:XMLFoundation,代码行数:34,代码来源:FrameworkAuditLog.cpp


示例5: LOGTEXT

TInt CGprsQoSDGprsTsy::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
							  const TDataPackage& aPackage)
/**
 * ExtFunc is called by the server when it has an "extended", i.e. non-core ETel request 
 * for the TSY to process.
 * A request handle, request type and request data are passed to the TSY.
 */
	{
	LOGTEXT(_L8("CGprsQoSDGprsTsy: ExtFunc() method"));

	switch (aIpc)
		{
		case EPacketQoSSetProfileParams:
			return SetProfile(aTsyReqHandle, aPackage.Des1n());
		case EPacketQoSSetProfileParamsCancel:
			return SetProfileCancel(aTsyReqHandle);
		case EPacketQoSGetProfileParams:
			return GetProfile(aTsyReqHandle, aPackage.Des1n());
		case EPacketQoSGetProfileParamsCancel:
			return GetProfileCancel(aTsyReqHandle);
		case EPacketQoSNotifyProfileChanged:
			return NotifyProfileChanged(aTsyReqHandle, aPackage.Des1n());
		case EPacketQoSNotifyProfileChangedCancel:
			return NotifyProfileChangedCancel(aTsyReqHandle);
		case EPacketQoSGetProfileCaps:
			return GetProfileCaps(aTsyReqHandle, aPackage.Des1n());
		case EPacketQoSGetProfileCapsCancel:
			return GetProfileCapsCancel(aTsyReqHandle);
		default:
			return KErrNotSupported;
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:32,代码来源:pcktqostsy.cpp


示例6: fd

void ProfileDlg::OnExportProfile() 
{
	CString name;
	int sel = m_profiles.GetCurSel();
	if(sel<0) return;
	
	CString tmp;
	tmp.LoadString(IDS_PROFILE_FILEDIALOG);
	CFileDialog fd( FALSE, _T("xpas"), name, OFN_ENABLESIZING, tmp + " (*.xpas)|*.xpas||", this);
	tmp.LoadString(IDS_PROFILE_SAVE);
	fd.m_ofn.lpstrTitle = tmp;
	if(fd.DoModal() == IDOK)
	{
		CFile file(fd.GetPathName(), CFile::modeCreate|CFile::modeWrite);
		m_profiles.GetLBText(sel, name);
		SettingVec vec = GetProfile(name);
		
		CArchive* ar=new CArchive(&file,CArchive::store);
		for(int i=0; i<vec.size(); ++i)
		{
			
			*ar<<vec[i].settingID<<vec[i].checked;
		}
		ar->Close();
		if(ar) delete ar;
		file.Close();
	}
	
}
开发者ID:christau,项目名称:xp-AntiSpy,代码行数:29,代码来源:ProfileDlg.cpp


示例7: GString

GProfile &GetErrorProfile()
{
	if (g_strErrorFile.IsEmpty())
	{
		if (g_pzStaticErrMap)
		{
			g_strErrorFile = "Static Load";
			g_pstrErrorFileContents = new GString(g_pzStaticErrMap,strlen(g_pzStaticErrMap));
		}
		else
		{
			const char *pzErrFile = GetProfile().GetString("System", "Errors", 0);
			if (pzErrFile && pzErrFile[0])
			{
				g_pstrErrorFileContents = new GString();
				if (!g_pstrErrorFileContents->FromFile(pzErrFile,0))
				{
					pzErrFile = 0;
				}
				g_strErrorFile = pzErrFile;
			}
			// if the error file could not be found, default to a minimal error file
			if (!pzErrFile)
			{
				g_pstrErrorFileContents = new GString();
				(*g_pstrErrorFileContents) = "[Exception]\nSubSystem=0\n[Profile]\nSubSystem=1\n0=[%s.%s]Error Description File Not loaded.\n1=[%s]Error Description File Not loaded.  Call SetErrorDescriptions().\n";
				g_strErrorFile = "Static";
			}
		}
	}
	static GProfile ErrorProfile(g_pstrErrorFileContents->StrVal(), (int)g_pstrErrorFileContents->Length(), 0);
	return ErrorProfile;
}
开发者ID:ambilight-4-mediaportal,项目名称:AtmoWin,代码行数:33,代码来源:GException.cpp


示例8: CopyProfileSettings

void __stdcall CopyProfileSettings()
{
	ProfileTag* p = GetProfile(g_ProfileSettings.m_Group, g_ProfileSettings.m_Profile);
	ProfileTarget* t = GetProfileTarget(g_ProfileSettings.m_Group, g_ProfileSettings.m_Profile, g_ProfileSettings.m_Target);

	StringCchCopy(g_enc_opt.m_Format, 64, p->m_Format);
	StringCchCopy(g_enc_opt.m_Target, 64, t->m_Name);
	
	g_enc_opt.m_VideoDisable = g_ProfileSettings.m_VCodec == -1;
	g_enc_opt.m_AudioDisable = g_ProfileSettings.m_ACodec == -1;

	if (g_enc_opt.m_VideoDisable == 0)
	{
		StringCchCopy(g_enc_opt.m_VideoCodec, 64, t->m_Video.m_Codec[g_ProfileSettings.m_VCodec].m_Codec);
		g_enc_opt.m_VideoBitrate = t->m_Video.m_BitRate[g_ProfileSettings.m_VBitRate];
		g_enc_opt.m_FrameNum = t->m_Video.m_FrameRate[g_ProfileSettings.m_FrameRate].m_Num;
		g_enc_opt.m_FrameDen = t->m_Video.m_FrameRate[g_ProfileSettings.m_FrameRate].m_Den;
		g_enc_opt.m_VideoWidth = g_ProfileSettings.m_ResCustom.m_Width;
		g_enc_opt.m_VideoHeight = g_ProfileSettings.m_ResCustom.m_Height;
	}
	
	if (g_enc_opt.m_AudioDisable == 0)
	{
		StringCchCopy(g_enc_opt.m_AudioCodec, 64, t->m_Audio.m_Codec[g_ProfileSettings.m_ACodec].m_Codec);
		g_enc_opt.m_AudioBitrate = t->m_Audio.m_BitRate[g_ProfileSettings.m_ABitRate];
		g_enc_opt.m_AudioSampleRate = t->m_Audio.m_SampleRate[g_ProfileSettings.m_SampleRate];
		g_enc_opt.m_AudioChannels = t->m_Audio.m_Channel[g_ProfileSettings.m_Channel];
	}

}
开发者ID:amikey,项目名称:vmeisoft-video-convertor-and-editor,代码行数:30,代码来源:VideoConverterInt.cpp


示例9: SelectPeers

	bool TunnelPool::SelectPeers (std::vector<std::shared_ptr<const i2p::data::IdentityEx> >& peers, bool isInbound)
	{
		if (m_ExplicitPeers) return SelectExplicitPeers (peers, isInbound);
		auto prevHop = i2p::context.GetSharedRouterInfo ();	
		int numHops = isInbound ? m_NumInboundHops : m_NumOutboundHops;
		if (i2p::transport::transports.GetNumPeers () > 25)
		{
			auto r = i2p::transport::transports.GetRandomPeer ();
			if (r && !r->GetProfile ()->IsBad ())
			{
				prevHop = r;
				peers.push_back (r->GetRouterIdentity ());
				numHops--;
			}
		}
		
		for (int i = 0; i < numHops; i++)
		{
			auto hop = SelectNextHop (prevHop);
			if (!hop)
			{
				LogPrint (eLogError, "Tunnels: Can't select next hop for ", prevHop->GetIdentHashBase64 ());
				return false;
			}	
			prevHop = hop;
			peers.push_back (hop->GetRouterIdentity ());
		}		
		return true;
	}	
开发者ID:h0bbyte,项目名称:i2pd,代码行数:29,代码来源:TunnelPool.cpp


示例10: r3d_assert

int CClientUserProfile::ApiChangeBackpack(__int64 InventoryID)
{
	r3d_assert(SelectedCharID >= 0 && SelectedCharID < wiUserProfile::MAX_LOADOUT_SLOTS);
	wiCharDataFull& w = ProfileData.ArmorySlots[SelectedCharID];
	r3d_assert(w.LoadoutID > 0);

	// no need to validate InventoryID - server will do that
	char strInventoryID[128];
	sprintf(strInventoryID, "%I64d", InventoryID);

	CWOBackendReq req(this, "api_CharBackpack.aspx");
	req.AddParam("CharID", w.LoadoutID);
	req.AddParam("op",     16);		// inventory operation code
	req.AddParam("v1",     strInventoryID);	// value 1
	req.AddParam("v2",     0);
	req.AddParam("v3",     0);
	if(!req.Issue())
	{
		r3dOutToLog("ApiChangeBackpack failed: %d", req.resultCode_);
		return req.resultCode_;
	}

	// reread profile, as inventory/backpack is changed
	GetProfile();
	
	return 0;
}
开发者ID:Mateuus,项目名称:srcundead,代码行数:27,代码来源:UserProfile.cpp


示例11: UBTAuditLogIsEnabled

bool UBTAuditLogIsEnabled()
{
	if (g_pchLogFile == LOGGING_OFF)
		return false;
	if (g_pchLogFile == LOGGING_UNASSIGNED)
	{
		try
		{
			g_pchLogFile = (char *)GetProfile().GetString("Debug", "DebugTraceXML",false);
			if (g_pchLogFile && g_pchLogFile[0])
			{
				// g_pchLogFile is valid and logging is turned ON
			}
			else
			{
				// Turn off logging and don't check the environment variable anymore (it's slow)
				g_pchLogFile = (char *)LOGGING_OFF;
			}
		}
		catch (GException &)
		{
		}
	}
	if (g_pchLogFile == (char *)LOGGING_OFF)
		return false;
	return true;
}
开发者ID:BrianAberle,项目名称:XMLFoundation,代码行数:27,代码来源:FrameworkAuditLog.cpp


示例12: while

void EffectNoiseRemoval::ProcessSamples(sampleCount len, float *buffer)
{
   int i;

   while(len && mOutSampleCount < mInSampleCount) {
      int avail = wxMin(len, mWindowSize - mInputPos);
      for(i = 0; i < avail; i++)
         mInWaveBuffer[mInputPos + i] = buffer[i];
      buffer += avail;
      len -= avail;
      mInputPos += avail;

      if (mInputPos == mWindowSize) {
         FillFirstHistoryWindow();
         if (mDoProfile)
            GetProfile();
         else
            RemoveNoise();
         RotateHistoryWindows();

         // Rotate halfway for overlap-add
         for(i = 0; i < mWindowSize / 2; i++) {
            mInWaveBuffer[i] = mInWaveBuffer[i + mWindowSize / 2];
         }
         mInputPos = mWindowSize / 2;
      }
   }
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:28,代码来源:NoiseRemoval.cpp


示例13: RandomFloat

/**
 * Prepare bot for action
 */
bool CCFBot::Initialize( const BotProfile *profile, int team )
{
	// extend
	BaseClass::Initialize( profile, team );

	// CF bot initialization
	m_diedLastRound = false;
	m_morale = POSITIVE;			// starting a new round makes everyone a little happy

	m_combatRange = RandomFloat( 325.0f, 425.0f );

	// set initial safe time guess for this map
	m_safeTime = 15.0f + 5.0f * GetProfile()->GetAggression();

	m_name[0] = '\000';

	ResetValues();

	m_desiredTeam = team;

	if (GetTeamNumber() <= LAST_SHARED_TEAM)
	{
		ChangeTeam(m_desiredTeam);
	}

	Buy();

	return true;
}
开发者ID:BSVino,项目名称:Arcon,代码行数:32,代码来源:cf_bot_init.cpp


示例14: GetProfile

/*
========================
idLocalUser::SetStatFloat
========================
*/
void idLocalUser::SetStatFloat( int s, float v )
{
	idPlayerProfile* profile = GetProfile();
	if( profile != NULL )
	{
		return profile->StatSetFloat( s, v );
	}
}
开发者ID:Yetta1,项目名称:OpenTechBFG,代码行数:13,代码来源:sys_localuser.cpp


示例15: SetSourceCode

void FragmentShaderCg::RestoreDeviceData(uint8 **ppBackup)
{
	// Restore data
	if (*ppBackup) {
		// The string class takes over the control of the string memory and also deletes it
		SetSourceCode(String(reinterpret_cast<char*>(*ppBackup), false), GetProfile(), m_sArguments, m_sEntry);
	}
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:8,代码来源:FragmentShaderCg.cpp


示例16: GetProfile

/*
========================
idLocalUser::GetStatInt
========================
*/
int	idLocalUser::GetStatInt( int s ) { 
	const idPlayerProfile * profile = GetProfile();

	if ( profile != NULL && s >= 0 ) {
		return profile->StatGetInt( s );
	}

	return 0; 
}
开发者ID:Deepfreeze32,项目名称:taken,代码行数:14,代码来源:sys_localuser.cpp


示例17: defined

static FILE *GetLogFile(void)
{
    if(stdlog2 == NULL) {
        char result_file[256];
        if(filename2 == NULL) return stdout;
#if defined(_MSC_VER)
        _snprintf(result_file, sizeof(result_file), "%s.%s_tested", filename2, GetProfile());
#else
        snprintf(result_file, sizeof(result_file), "%s.%s_tested", filename2, GetProfile());
#endif
        stdlog2 = fopen(result_file, "w");
        if(stdlog2 == NULL) {
            fprintf(stdout, "cannot open logfile: %s (%s)\n", result_file, strerror(errno));
            exit(1);
        }
    }
    return stdlog2;
}
开发者ID:nikuuchi,项目名称:konoha3,代码行数:18,代码来源:OutputTest.c


示例18: shared_from_this

	std::shared_ptr<const i2p::data::RouterInfo> TunnelPool::SelectNextHop (std::shared_ptr<const i2p::data::RouterInfo> prevHop) const
	{
		bool isExploratory = (i2p::tunnel::tunnels.GetExploratoryPool () == shared_from_this ());
		auto hop = isExploratory ? i2p::data::netdb.GetRandomRouter (prevHop): 
			i2p::data::netdb.GetHighBandwidthRandomRouter (prevHop);

		if (!hop || hop->GetProfile ()->IsBad ())
			hop = i2p::data::netdb.GetRandomRouter ();
		return hop;	
	}	
开发者ID:h0bbyte,项目名称:i2pd,代码行数:10,代码来源:TunnelPool.cpp


示例19:

std::shared_ptr<const i2p::data::RouterInfo> TunnelPool::SelectNextHop(
    std::shared_ptr<const i2p::data::RouterInfo> prevHop) const {
  // TODO(unassigned): implement it better
  bool isExploratory = (m_LocalDestination == &i2p::context);
  auto hop = isExploratory ?
    i2p::data::netdb.GetRandomRouter(prevHop) :
    i2p::data::netdb.GetHighBandwidthRandomRouter(prevHop);
  if (!hop || hop->GetProfile ()->IsBad())
    hop = i2p::data::netdb.GetRandomRouter();
  return hop;
}
开发者ID:fluffypony,项目名称:kovri,代码行数:11,代码来源:TunnelPool.cpp


示例20: GetDefaultUser

//-----------------------------------------------------------------------------
Profile* ProfileManager::GetDefaultUserProfile(const ProfileDeviceKey& deviceKey)
{
	const char* userName = GetDefaultUser(deviceKey);

    Profile* profile = GetProfile(deviceKey, userName);

    if (!profile)
    {
        profile = GetDefaultProfile(deviceKey.HmdType);
    }

    return profile;
}
开发者ID:ReallyRad,项目名称:ofxOculusDK2,代码行数:14,代码来源:OVR_Profile.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetProfileString函数代码示例发布时间:2022-05-30
下一篇:
C++ GetProcessTimes函数代码示例发布时间: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