FTopLevelAssetPath

A struct that can reference a top level asset such as '/Path/To/Package.AssetName' Stores two FNames internally to avoid a) storing a concatenated [FName](API\Runtime\Core\UObject\FName) that bloats global [FName](API\Runtime\Core\UObject\FName) storage b) storing an empty [FString](API\Runtime\Core\Containers\FString) for a subobject path as [FSoftObjectPath](API\Runtime\CoreUObject\UObject\FSoftObjectPath) allows Can also be used to reference the package itself in which case the second name is NAME_None and the object resolves to the string `/Path/To/Package_ This struct is mirrored and exposed to the UE reflection system in NoExportTypes.h

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/TopLevelAssetPath.h

Include

#include "UObject/TopLevelAssetPath.h"

Syntax

struct FTopLevelAssetPath

Remarks

A struct that can reference a top level asset such as '/Path/To/Package.AssetName' Stores two FNames internally to avoid a) storing a concatenated FName that bloats global FName storage b) storing an empty FString for a subobject path as FSoftObjectPath allows Can also be used to reference the package itself in which case the second name is NAME_None and the object resolves to the string `/Path/To/Package_ This struct is mirrored and exposed to the UE reflection system in NoExportTypes.h

Constructors

Name Description

Public function

FTopLevelAssetPath()

Public function

FTopLevelAssetPath

(
    TYPE_OF_NULLPTR
)

Public function

FTopLevelAssetPath

(
    FName InPath
)

FNames containing full asset paths have been replaced by FTopLevelAssetPath/FSoftLevelObjectPath.

Public function

FTopLevelAssetPath

(
    const FString& Path
)

Construct from string / string view / raw string of a supported character type.

Public function

FTopLevelAssetPath

(
    TStringView< CharType > Path
)

Public function

FTopLevelAssetPath

(
    const CharType* Path
)

Public function

FTopLevelAssetPath

(
    const UObject* InObject
)

Construct from an existing object.

Public function

FTopLevelAssetPath

(
    FName InPackageName,
    FName InAssetName
)

Construct directly from components

Functions

Name Description

Public function Const

void

 

AppendString

(
    FString& OutString
)

Append the full asset path (e.g. '/Path/To/Package.AssetName') to the string.

Public function Const

void

 

AppendString

(
    FStringBuilderBase& Builder
)

Append the full asset path (e.g. '/Path/To/Package.AssetName') to the string builder.

Public function Const

int32

 

Compare

(
    const FTopLevelAssetPath& Other
)

Lexically compares two paths.

Public function Const

int32

 

CompareFast

(
    const FTopLevelAssetPath& Other
)

Compares two paths in a fast non-lexical order that is only valid for process lifetime.

Public function Const

bool

 

ExportTextItem

(
    FString& ValueStr,
    FTopLevelAssetPath const& DefaultV...,
    UObject* Parent,
    int32 PortFlags,
    UObject* ExportRootScope
)

Public function Const

FName

 

GetAssetName()

Return the asset name part e.g. AssetName as an FName.

Public function Const

FName

 

GetPackageName()

Return the package name part e.g. /Path/To/Package as an FName.

Public function

bool

 

ImportTextItem

(
    const TCHAR*& Buffer,
    int32 PortFlags,
    UObject* Parent,
    FOutputDevice* ErrorText,
    FArchive* InSerializingArchive
)

Public function Const

bool

 

IsNull()

Checks to see if this is initialized to null

Public function Const

bool

 

IsValid()

Check if this could possibly refer to a real object

Public function

void

 

Reset()

Resets reference to point to null

Public function

bool

 

SerializeFromMismatchedTag

(
    const FPropertyTag& Tag,
    FStructuredArchive::FSlot Slot
)

Public function Const

FString

 

ToString()

Return the full asset path (e.g. '/Path/To/Package.AssetName') as a string.

Public function Const

void

 

ToString

(
    FString& OutString
)

Copy the full asset path (e.g. '/Path/To/Package.AssetName') into the provided string.

Public function

bool

 

TrySetPath

(
    const FString& Path
)

Public function

bool

 

TrySetPath

(
    const UObject* InObject
)

Sets asset path to path of existing object.

Public function

bool

 

TrySetPath

(
    FWideStringView Path
)

Sets asset path of this reference based on a string path.

Public function

bool

 

TrySetPath

(
    FUtf8StringView Path
)

Sets asset path of this reference based on components.

Public function

bool

 

TrySetPath

(
    FAnsiStringView Path
)

Sets asset path of this reference based on components.

Public function

bool

 

TrySetPath

(
    const CharType* Path
)

Public function

bool

 

TrySetPath

(
    FName InPackageName,
    FName InAssetName
)

Sets asset path of this reference based on components.

Operators

Name Description

Public function Const

bool

 

operator!=

(
    FTopLevelAssetPath const& Other
)

Compares two paths for non-case-sensitive inequality.

Public function

FTopLevelAss...

 

operator=

(
    TStringView< CharType > Path
)

Public function

FTopLevelAss...

 

operator=

(
    TYPE_OF_NULLPTR
)

Public function

FTopLevelAss...

 

operator=

(
    const FString& Path
)

Assign from the same types we can construct from

Public function

FTopLevelAss...

 

operator=

(
    const CharType* Path
)

Public function Const

bool

 

operator==

(
    FTopLevelAssetPath const& Other
)

Compares two paths for non-case-sensitive equality.

Deprecated Functions

Name Description

Public function

This functio...

 

FTopLevelAssetPath

(
    FName InPath
)

FNames containing full asset paths have been replaced by FTopLevelAssetPath/FSoftLevelObjectPath.

Public function Const

This functio...

 

ToFName()

FNames containing full asset paths have been replaced by FTopLevelAssetPath/FSoftLevelObjectPath.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel