本文整理汇总了C++中COption::IsWriteToConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ COption::IsWriteToConfig方法的具体用法?C++ COption::IsWriteToConfig怎么用?C++ COption::IsWriteToConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COption
的用法示例。
在下文中一共展示了COption::IsWriteToConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetToDefault
void CProfileOptions::ResetToDefault()
{
ClearPendingOptionValues(); // Just to be safe
std::vector<COption*>::iterator it = m_allOptions.begin();
std::vector<COption*>::const_iterator end = m_allOptions.end();
for(; it!=end; ++it)
{
COption* pOption = (*it);
if (!pOption->IsWriteToConfig())
{
pOption->ResetDefault();
}
}
}
示例2:
void CProfileOptions::CCVarSink::OnElementFound(ICVar *pCVar)
{
if (pCVar == 0)
return;
const char* name = pCVar->GetName();
const char* val = pCVar->GetString();
COption* pOption = m_pOptions->GetOptionByCVar(name);
if(!pOption)
return;
if(!pOption->IsWriteToConfig())
return;
const char* optionName = pOption->GetName().c_str();
const char* writeValue = pOption->Get().c_str();
const std::vector<SPendingOption>& pendingOptions = m_pOptions->GetPendingOptions();
std::vector<SPendingOption>::const_iterator it = pendingOptions.begin();
std::vector<SPendingOption>::const_iterator end = pendingOptions.end();
for(; it!=end; ++it)
{
const SPendingOption& option = (*it);
if(!option.writeToConfig)
continue;
if(option.command.compareNoCase(optionName))
continue;
writeValue = option.param.c_str();
break;
}
CryFixedStringT<128> format;
pOption->GetWriteToConfigString(format, pCVar, writeValue);
fputs(format.c_str(), m_pFile);
}
示例3: AddOrReplacePendingOption
void CProfileOptions::AddOrReplacePendingOption(const char* command, const char* param)
{
std::vector<SPendingOption>::iterator it = m_pendingOptions.begin();
std::vector<SPendingOption>::const_iterator end = m_pendingOptions.end();
for(; it!=end; ++it)
{
SPendingOption& option = (*it);
if(option.command.compare(command))
continue;
if(option.preview)
{
SetOptionValue(command, param);
}
if(option.original.compare(param))
{
option.param = param;
}
else
{
m_pendingOptions.erase(it);
}
return;
}
COption* pOption = GetOption(command);
if(pOption != NULL)
{
if(pOption->IsPreview())
{
m_pendingOptions.push_back(SPendingOption(command, param, GetOptionValue(command), true, pOption->IsConfirmation(), pOption->IsRequiresRestart(), pOption->IsWriteToConfig()));
SetOptionValue(command, param);
}
else
{
m_pendingOptions.push_back(SPendingOption(command, param, GetOptionValue(command), false, pOption->IsConfirmation(), pOption->IsRequiresRestart(), pOption->IsWriteToConfig()));
}
}
}