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


C++ FName::ToString方法代码示例

本文整理汇总了C++中FName::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ FName::ToString方法的具体用法?C++ FName::ToString怎么用?C++ FName::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FName的用法示例。


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

示例1: IsAssetTypeActionsInUse

bool SVisualLoggerFilters::IsAssetTypeActionsInUse(FName InGraphName, FName InDataName) const
{
	if (GraphFilters.Contains(InGraphName))
	{
		for (const FString& Filter : GraphFilters[InGraphName])
		{
			if (Filter == InDataName.ToString())
			{
				const FString GraphFilterName = InGraphName.ToString() + TEXT("$") + Filter;
				return FCategoryFiltersManager::Get().GetCategory(GraphFilterName).Enabled;
			}
		}
	}

	return false;
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:16,代码来源:SVisualLoggerFilters.cpp

示例2: NewPath

TArray<FPropertySoftPath> DiffUtils::GetVisiblePropertiesInOrderDeclared(const UObject* ForObj, const TArray<FName>& Scope /*= TArray<FName>()*/)
{
	TArray<FPropertySoftPath> Ret;
	if (ForObj)
	{
		const UClass* Class = ForObj->GetClass();
		TSet<FString> HiddenCategories = FEditorCategoryUtils::GetHiddenCategories(Class);
		for (TFieldIterator<UProperty> PropertyIt(Class); PropertyIt; ++PropertyIt)
		{
			FName CategoryName = FObjectEditorUtils::GetCategoryFName(*PropertyIt);
			if (!HiddenCategories.Contains(CategoryName.ToString()))
			{
				if (PropertyIt->PropertyFlags&CPF_Edit)
				{
					TArray<FName> NewPath(Scope);
					NewPath.Push(PropertyIt->GetFName());
					if (const UObjectProperty* ObjectProperty = Cast<UObjectProperty>(*PropertyIt))
					{
						const UObject* const* BaseObject = reinterpret_cast<const UObject* const*>( ObjectProperty->ContainerPtrToValuePtr<void>(ForObj) );
						if (BaseObject && *BaseObject)
						{
							Ret.Append( GetVisiblePropertiesInOrderDeclared(*BaseObject, NewPath) );
						}
					}
					else
					{
						Ret.Push(NewPath);
					}
				}
			}
		}
	}
	return Ret;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:34,代码来源:DiffUtils.cpp

示例3: GetDefaultFolderName

FName FActorFolders::GetDefaultFolderName(UWorld& InWorld, FName ParentPath)
{
	// This is potentially very slow but necessary to find a unique name
	const auto& ExistingFolders = GetFolderPropertiesForWorld(InWorld);

	// Create a valid base name for this folder
	uint32 Suffix = 1;
	FText LeafName = FText::Format(LOCTEXT("DefaultFolderNamePattern", "NewFolder{0}"), FText::AsNumber(Suffix++));

	FString ParentFolderPath = ParentPath.IsNone() ? TEXT("") : ParentPath.ToString();
	if (!ParentFolderPath.IsEmpty())
	{
		ParentFolderPath += "/";
	}

	FName FolderName(*(ParentFolderPath + LeafName.ToString()));
	while (ExistingFolders.Contains(FolderName))
	{
		LeafName = FText::Format(LOCTEXT("DefaultFolderNamePattern", "NewFolder{0}"), FText::AsNumber(Suffix++));
		FolderName = FName(*(ParentFolderPath + LeafName.ToString()));
		if (Suffix == 0)
		{
			// We've wrapped around a 32bit unsigned int - something must be seriously wrong!
			return FName();
		}
	}

	return FolderName;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:29,代码来源:EditorActorFolders.cpp

示例4: GetTrackPropertyName

FName UTimelineTemplate::GetTrackPropertyName(const FName TrackName) const
{
	const FString TimelineName = TimelineTemplateNameToVariableName(GetFName());
	FString PropertyName = FString::Printf(TEXT("%s_%s_%s"), *TimelineName, *TrackName.ToString(), *TimelineGuid.ToString());
	SanitizePropertyName(PropertyName);
	return FName(*PropertyName);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:7,代码来源:TimelineTemplate.cpp

示例5: SetStreamingClassForLevel

ULevelStreaming* SetStreamingClassForLevel(ULevelStreaming* InLevel, UClass* LevelStreamingClass)
{
    check(InLevel);

    const FScopedBusyCursor BusyCursor;

    // Cache off the package name, as it will be lost when unloading the level
    const FName CachedPackageName = InLevel->PackageName;

    // First hide and remove the level if it exists
    ULevel* Level = InLevel->GetLoadedLevel();
    check(Level);
    SetLevelVisibility( Level, false, false );
    check(Level->OwningWorld);
    UWorld* World = Level->OwningWorld;

    World->StreamingLevels.Remove(InLevel);

    // re-add the level with the desired streaming class
    AddLevelToWorld(World, *(CachedPackageName.ToString()), LevelStreamingClass);

    // Set original level transform
    ULevelStreaming* NewStreamingLevel = FLevelUtils::FindStreamingLevel( Level );
    if ( NewStreamingLevel )
    {
        NewStreamingLevel->LevelTransform = InLevel->LevelTransform;
    }

    return NewStreamingLevel;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:30,代码来源:EditorLevelUtils.cpp

示例6: if

FArchive& operator<<(FArchive& Ar,FShaderType*& Ref)
{
	if(Ar.IsSaving())
	{
		FName ShaderTypeName = Ref ? FName(Ref->Name) : NAME_None;
		Ar << ShaderTypeName;
	}
	else if(Ar.IsLoading())
	{
		FName ShaderTypeName = NAME_None;
		Ar << ShaderTypeName;
		
		Ref = NULL;

		if(ShaderTypeName != NAME_None)
		{
			// look for the shader type in the global name to type map
			FShaderType** ShaderType = FShaderType::GetNameToTypeMap().Find(ShaderTypeName);
			if (ShaderType)
			{
				// if we found it, use it
				Ref = *ShaderType;
			}
			else
			{
				UE_LOG(LogShaders, Warning, TEXT("ShaderType '%s' was not found!"), *ShaderTypeName.ToString());
			}
		}
	}
	return Ar;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:31,代码来源:Shader.cpp

示例7: FName

const TSharedPtr< FSlateDynamicImageBrush > FSlateStyleSet::GetDynamicImageBrush(const FName BrushTemplate, UTexture2D* TextureResource, const FName TextureName)
{
	//create a resource name
	FName ResourceName;
	ResourceName = TextureName == NAME_None ? BrushTemplate : FName(*( BrushTemplate.ToString() + TextureName.ToString() ));

	//see if we already have that brush
	TWeakPtr< FSlateDynamicImageBrush > WeakImageBrush = DynamicBrushes.FindRef(ResourceName);

	//if we don't have the image brush, then make it
	TSharedPtr< FSlateDynamicImageBrush > ReturnBrush = WeakImageBrush.Pin();

	if ( !ReturnBrush.IsValid() )
	{
		const FSlateBrush* Result = BrushResources.FindRef(Join(BrushTemplate, nullptr));

		if ( Result == nullptr )
		{
			Result = GetDefaultBrush();
		}

		//create the new brush
		ReturnBrush = MakeShareable(new FSlateDynamicImageBrush(TextureResource, Result->ImageSize, ResourceName));

		//add it to the dynamic brush list
		DynamicBrushes.Add(ResourceName, ReturnBrush);
	}

	return ReturnBrush;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:30,代码来源:SlateStyleSet.cpp

示例8: GetStreamedAudioDerivedDataKeySuffix

/**
 * Computes the derived data key suffix for a SoundWave's Streamed Audio.
 * @param SoundWave - The SoundWave for which to compute the derived data key.
 * @param AudioFormatName - The audio format we're creating the key for
 * @param OutKeySuffix - The derived data key suffix.
 */
static void GetStreamedAudioDerivedDataKeySuffix(
    const USoundWave& SoundWave,
    FName AudioFormatName,
    FString& OutKeySuffix
)
{
    uint16 Version = 0;

    // get the version for this soundwave's platform format
    ITargetPlatformManagerModule* TPM = GetTargetPlatformManager();
    if (TPM)
    {
        const IAudioFormat* AudioFormat = TPM->FindAudioFormat(AudioFormatName);
        if (AudioFormat)
        {
            Version = AudioFormat->GetVersion(AudioFormatName);
        }
    }

    // build the key
    OutKeySuffix = FString::Printf(TEXT("%s_%d_%s"),
                                   *AudioFormatName.ToString(),
                                   Version,
                                   *SoundWave.CompressedDataGuid.ToString()
                                  );
}
开发者ID:mymei,项目名称:UE4,代码行数:32,代码来源:AudioDerivedData.cpp

示例9: DumpSessionSettings

void DumpSessionSettings(const FOnlineSessionSettings* SessionSettings)
{
	if (SessionSettings != NULL)
	{
		UE_LOG(LogOnline, Verbose, TEXT("dumping SessionSettings: "));
		UE_LOG(LogOnline, Verbose, TEXT("\tNumPublicConnections: %d"), SessionSettings->NumPublicConnections);
		UE_LOG(LogOnline, Verbose, TEXT("\tNumPrivateConnections: %d"), SessionSettings->NumPrivateConnections);
		UE_LOG(LogOnline, Verbose, TEXT("\tbIsLanMatch: %s"), SessionSettings->bIsLANMatch ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbIsDedicated: %s"), SessionSettings->bIsDedicated ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbUsesStats: %s"), SessionSettings->bUsesStats ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbShouldAdvertise: %s"), SessionSettings->bShouldAdvertise ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbAllowJoinInProgress: %s"), SessionSettings->bAllowJoinInProgress ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbAllowInvites: %s"), SessionSettings->bAllowInvites ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbUsesPresence: %s"), SessionSettings->bUsesPresence ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbAllowJoinViaPresence: %s"), SessionSettings->bAllowJoinViaPresence ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tbAllowJoinViaPresenceFriendsOnly: %s"), SessionSettings->bAllowJoinViaPresenceFriendsOnly ? TEXT("true") : TEXT("false"));
		UE_LOG(LogOnline, Verbose, TEXT("\tBuildUniqueId: 0x%08x"), SessionSettings->BuildUniqueId);
		UE_LOG(LogOnline, Verbose, TEXT("\tSettings:"));
		for (FSessionSettings::TConstIterator It(SessionSettings->Settings); It; ++It)
		{
			FName Key = It.Key();
			const FOnlineSessionSetting& Setting = It.Value();
			UE_LOG(LogOnline, Verbose, TEXT("\t\t%s=%s"), *Key.ToString(), *Setting.ToString());
		}
	}
}
开发者ID:aovi,项目名称:UnrealEngine4,代码行数:26,代码来源:OnlineSessionSettings.cpp

示例10: RequireIdentifier

//
// Require an identifier.
//
void FBaseParser::RequireIdentifier( FName Match, const TCHAR* Tag )
{
	if (!MatchIdentifier(Match))
	{
		FError::Throwf(TEXT("Missing '%s' in %s"), *Match.ToString(), Tag );
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:10,代码来源:BaseParser.cpp

示例11: LogText

void UVisualLoggerKismetLibrary::LogText(UObject* WorldContextObject, FString Text, FName CategoryName)
{
#if ENABLE_VISUAL_LOG
	const ELogVerbosity::Type DefaultVerbosity = ELogVerbosity::Log;
	FVisualLogger::CategorizedLogf(WorldContextObject, FLogCategoryBase(*CategoryName.ToString(), DefaultVerbosity, DefaultVerbosity), DefaultVerbosity, INDEX_NONE, *Text);
#endif
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:7,代码来源:VisualLoggerKismetLibrary.cpp

示例12: GetOnlineSubsystem

/** 
 * Main entry point for accessing an online subsystem by name
 * Will load the appropriate module if the subsystem isn't currently loaded
 * It's possible that the subsystem doesn't exist and therefore can return NULL
 *
 * @param SubsystemName - name of subsystem as referenced by consumers
 * @return Requested online subsystem, or NULL if that subsystem was unable to load or doesn't exist
 */
IOnlineSubsystem* FOnlineSubsystemModule::GetOnlineSubsystem(const FName InSubsystemName)
{
	FName SubsystemName = InSubsystemName;
	if (SubsystemName == NAME_None)
	{
		SubsystemName = DefaultPlatformService;
	}

	IOnlineSubsystem** OSSFactory = NULL;
	if (SubsystemName != NAME_None)
	{
		OSSFactory = PlatformServices.Find(SubsystemName);
		if (OSSFactory == NULL)
		{
			// Attempt to load the requested factory
			TSharedPtr<IModuleInterface> NewModule = LoadSubsystemModule(SubsystemName.ToString());
			if( NewModule.IsValid() )
			{
				// If the module loaded successfully this should be non-NULL;
				OSSFactory = PlatformServices.Find(SubsystemName);
			}
			if (OSSFactory == NULL)
			{
				UE_LOG(LogOnline, Warning, TEXT("Unable to load OnlineSubsystem module %s"), *InSubsystemName.ToString());
			}
		}
	}

	return (OSSFactory == NULL) ? NULL : *OSSFactory;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:38,代码来源:OnlineSubsystem.cpp

示例13: AddVariable

bool FStructureEditorUtils::AddVariable(UBlueprint* Blueprint, FName StructName, const FEdGraphPinType& VarType)
{
	if (NULL != Blueprint)
	{
		const FScopedTransaction Transaction( LOCTEXT("AddVariable", "Add Variable") );
		Blueprint->Modify();

		FBPStructureDescription* StructureDesc = Blueprint->UserDefinedStructures.FindByPredicate(FFindByNameHelper(StructName));
		if (StructureDesc)
		{
			FString ErrorMessage;
			if (!CanHaveAMemberVariableOfType(StructureDesc->CompiledStruct, VarType, &ErrorMessage))
			{
				UE_LOG(LogBlueprint, Warning, TEXT("%s"), *ErrorMessage);
				return false;
			}

			const FName VarName = FMemberVariableNameHelper::Generate(StructureDesc->CompiledStruct, FString());
			check(NULL == StructureDesc->Fields.FindByPredicate(FFindByNameHelper(VarName)));
			const FString DisplayName = VarName.ToString();
			check(IsUniqueVariableDisplayName(Blueprint, StructName, DisplayName));

			FBPVariableDescription NewVar;
			NewVar.VarName = VarName;
			NewVar.FriendlyName = DisplayName;
			NewVar.VarType = VarType;
			NewVar.VarGuid = FGuid::NewGuid();
			StructureDesc->Fields.Add(NewVar);

			OnStructureChanged(*StructureDesc, Blueprint);
			return true;
		}
	}
	return false;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:35,代码来源:StructureEditorUtils.cpp

示例14: WriteTable

bool FDataTableExporterJSON::WriteTable()
{
	if (!DataTable->RowStruct)
	{
		return false;
	}

	JsonWriter->WriteArrayStart();

	// Iterate over rows
	for (auto RowIt = DataTable->RowMap.CreateConstIterator(); RowIt; ++RowIt)
	{
		JsonWriter->WriteObjectStart();
		{
			// RowName
			const FName RowName = RowIt.Key();
			JsonWriter->WriteValue(TEXT("Name"), RowName.ToString());

			// Now the values
			uint8* RowData = RowIt.Value();
			WriteRow(RowData);
		}
		JsonWriter->WriteObjectEnd();
	}

	JsonWriter->WriteArrayEnd();

	return true;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:29,代码来源:DataTableJSON.cpp

示例15: CreateTextures

void FSlateRHIResourceManager::CreateTextures( const TArray< const FSlateBrush* >& Resources )
{
	DECLARE_SCOPE_CYCLE_COUNTER(TEXT("Loading Slate Textures"), STAT_Slate, STATGROUP_LoadTime);

	TMap<FName,FNewTextureInfo> TextureInfoMap;

	const uint32 Stride = GPixelFormats[PF_R8G8B8A8].BlockBytes;
	for( int32 ResourceIndex = 0; ResourceIndex < Resources.Num(); ++ResourceIndex )
	{
		const FSlateBrush& Brush = *Resources[ResourceIndex];
		const FName TextureName = Brush.GetResourceName();
		if( TextureName != NAME_None && !Brush.HasUObject() && !Brush.IsDynamicallyLoaded() && !ResourceMap.Contains(TextureName) )
		{
			// Find the texture or add it if it doesnt exist (only load the texture once)
			FNewTextureInfo& Info = TextureInfoMap.FindOrAdd( TextureName );
	
			Info.bSrgb = (Brush.ImageType != ESlateBrushImageType::Linear);

			// Only atlas the texture if none of the brushes that use it tile it and the image is srgb
		
			Info.bShouldAtlas &= ( Brush.Tiling == ESlateBrushTileType::NoTile && Info.bSrgb && AtlasSize > 0 );

			// Texture has been loaded if the texture data is valid
			if( !Info.TextureData.IsValid() )
			{
				uint32 Width = 0;
				uint32 Height = 0;
				TArray<uint8> RawData;
				bool bSucceeded = LoadTexture( Brush, Width, Height, RawData );

				Info.TextureData = MakeShareable( new FSlateTextureData( Width, Height, Stride, RawData ) );

				const bool bTooLargeForAtlas = (Width >= 256 || Height >= 256 || Width >= AtlasSize || Height >= AtlasSize );

				Info.bShouldAtlas &= !bTooLargeForAtlas;

				if( !bSucceeded || !ensureMsgf( Info.TextureData->GetRawBytes().Num() > 0, TEXT("Slate resource: (%s) contains no data"), *TextureName.ToString() ) )
				{
					TextureInfoMap.Remove( TextureName );
				}
			}
		}
	}

	// Sort textures by size.  The largest textures are atlased first which creates a more compact atlas
	TextureInfoMap.ValueSort( FCompareFNewTextureInfoByTextureSize() );

	for( TMap<FName,FNewTextureInfo>::TConstIterator It(TextureInfoMap); It; ++It )
	{
		const FNewTextureInfo& Info = It.Value();
		FName TextureName = It.Key();
		FString NameStr = TextureName.ToString();

		checkSlow( TextureName != NAME_None );

		FSlateShaderResourceProxy* NewTexture = GenerateTextureResource( Info );

		ResourceMap.Add( TextureName, NewTexture );
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:60,代码来源:SlateRHIResourceManager.cpp


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