本文整理汇总了C++中FConfigFile::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ FConfigFile::GetString方法的具体用法?C++ FConfigFile::GetString怎么用?C++ FConfigFile::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FConfigFile
的用法示例。
在下文中一共展示了FConfigFile::GetString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanCookForPlatformInThisProcess
bool CanCookForPlatformInThisProcess( const FString& PlatformName )
{
////////////////////////////////////////
// hack remove this hack when we properly support changing the mobileHDR setting
// check if our mobile hdr setting in memory is different from the one which is saved in the config file
FConfigFile PlatformEngineIni;
GConfig->LoadLocalIniFile(PlatformEngineIni, TEXT("Engine"), true, *PlatformName );
FString IniValueString;
bool ConfigSetting = false;
if ( PlatformEngineIni.GetString( TEXT("/Script/Engine.RendererSettings"), TEXT("r.MobileHDR"), IniValueString ) == false )
{
// must always match the RSetting setting because we don't have a config setting
return true;
}
ConfigSetting = IniValueString.ToBool();
// this was stolen from void IsMobileHDR()
static auto* MobileHDRCvar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.MobileHDR"));
const bool CurrentRSetting = MobileHDRCvar->GetValueOnAnyThread() == 1;
if ( CurrentRSetting != ConfigSetting )
{
UE_LOG(LogUnrealEdEngine, Warning, TEXT("Unable to use cook in editor because r.MobileHDR from Engine ini doesn't match console value r.MobileHDR"));
return false;
}
////////////////////////////////////////
return true;
}
示例2: ReadEntry
void FTextureLODSettings::ReadEntry( int32 GroupId, const TCHAR* GroupName, const FConfigFile& IniFile, const TCHAR* IniSection )
{
// Look for string in filename/ section.
FString Entry;
if (IniFile.GetString(IniSection, GroupName, Entry))
{
// Trim whitespace at the beginning.
Entry = Entry.Trim();
// Remove brackets.
Entry = Entry.Replace( TEXT("("), TEXT("") );
Entry = Entry.Replace( TEXT(")"), TEXT("") );
// Parse minimum LOD mip count.
int32 MinLODSize = 0;
if( FParse::Value( *Entry, TEXT("MinLODSize="), MinLODSize ) )
{
TextureLODGroups[GroupId].MinLODMipCount = FMath::CeilLogTwo( MinLODSize );
}
// Parse maximum LOD mip count.
int32 MaxLODSize = 0;
if( FParse::Value( *Entry, TEXT("MaxLODSize="), MaxLODSize ) )
{
TextureLODGroups[GroupId].MaxLODMipCount = FMath::CeilLogTwo( MaxLODSize );
}
// Parse LOD bias.
int32 LODBias = 0;
if( FParse::Value( *Entry, TEXT("LODBias="), LODBias ) )
{
TextureLODGroups[GroupId].LODBias = LODBias;
}
// Parse min/map/mip filter names.
FName MinMagFilter = NAME_Aniso;
FParse::Value( *Entry, TEXT("MinMagFilter="), MinMagFilter );
FName MipFilter = NAME_Point;
FParse::Value( *Entry, TEXT("MipFilter="), MipFilter );
{
FString MipGenSettings;
FParse::Value( *Entry, TEXT("MipGenSettings="), MipGenSettings );
TextureLODGroups[GroupId].MipGenSettings = UTexture::GetMipGenSettingsFromString(*MipGenSettings, true);
}
// Convert into single filter enum. The code is layed out such that invalid input will
// map to the default state of highest quality filtering.
// Linear filtering
if( MinMagFilter == NAME_Linear )
{
if( MipFilter == NAME_Point )
{
TextureLODGroups[GroupId].Filter = SF_Bilinear;
}
else
{
TextureLODGroups[GroupId].Filter = SF_Trilinear;
}
}
// Point. Don't even care about mip filter.
else if( MinMagFilter == NAME_Point )
{
TextureLODGroups[GroupId].Filter = SF_Point;
}
// Aniso or unknown.
else
{
if( MipFilter == NAME_Point )
{
TextureLODGroups[GroupId].Filter = SF_AnisotropicPoint;
}
else
{
TextureLODGroups[GroupId].Filter = SF_AnisotropicLinear;
}
}
// Parse NumStreamedMips
int32 NumStreamedMips = -1;
if( FParse::Value( *Entry, TEXT("NumStreamedMips="), NumStreamedMips ) )
{
TextureLODGroups[GroupId].NumStreamedMips = NumStreamedMips;
}
}
}