FPackagePath

Internal class only; not used by blueprints.

Choose your operating system:

Windows

macOS

Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/Misc/PackagePath.h

Include

#include "Misc/PackagePath.h"

Syntax

class FPackagePath

Remarks

Internal class only; not used by blueprints. This class is only used in the CoreUObject linker layer and (optionally) as an argument to LoadPackage

Specifies a path to the contents of a UPackage that can be loaded from disk (or other persistent storage) through IPackageResourceManager Package contents are requested from the PackageResourceManager by FPackagePath and EPackageSegment FPackagePaths are stored internally in one of a few options necessary to maintain their construction arguments without losing data const FPackagePaths can still be mutated to be stored as another internal type const FPackagePaths can still be mutated to indicate which header extension was found for them on disk (It is illegal to have multiple packages on disk with the same PackagePath but different header extensions)

Constructors

Name Description

Public function

FPackagePath()

Construct an empty PackagePath

Public function

FPackagePath

(
    const FPackagePath& Other
)

Public function

FPackagePath

(
    FPackagePath&& Other
)

Functions

Name Description

Public function Const

void

 

AppendLocalBaseFilenameWithPath

(
    FStringBuilderBase& Builder
)

Append the Local (path,basename) of this PackagePath if known or available, or take no action if not

Public function Const

void

 

AppendLocalFullPath

(
    FStringBuilderBase& Builder,
    EPackageSegment PackageSegment
)

Version of AppendLocalFullPath that takes a PackageSegment, otherwise same behavior as parameterless version

Public function Const

void

 

AppendLocalFullPath

(
    FStringBuilderBase& Builder
)

Append the full relative LocalPath (path,basename,extension)

Public function Const

void

 

AppendPackageName

(
    FStringBuilderBase& Builder
)

Append the PackageName indicated by this PackagePath if known or available, or take no action if not

Public function

void

 

Empty()

Free this PackagePath's data and set it to an empty PackagePath

Public function Static

FPackagePath

 

FromLocalPath

(
    FStringView InFilename
)

Construct a PackagePath from a LocalPath string

Public function Static

FPackagePath

 

FromLocalPath

(
    FStringView InFilename,
    EPackageSegment& OutPackageSegment
)

Version of FromLocalPath that also returns the PackageSegment matching the Filename's extension

Public function Static

FPackagePath

 

FromMountedComponents

(
    FStringView PackageNameRoot,
    FStringView FilePathRoot,
    FStringView RelPath,
    EPackageExtension InExtension,
    FStringView InCustomExtension
)

Construct a PackagePath from the components of a MountedPath

Public function Static

FPackagePath

 

FromPackageNameChecked

(
    FStringView InPackageName
)

Construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*

Public function Static

FPackagePath

 

FromPackageNameChecked

(
    FName InPackageName
)

Construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*

Public function Static

FPackagePath

 

FromPackageNameChecked

(
    const TCHAR* InPackageName
)

Construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*

Public function Static

FPackagePath

 

FromPackageNameUnchecked

(
    FName InPackageName
)

Construct a PackagePath from a known valid LongPackageName FName

Public function Const

FStringView

 

GetCustomExtension()

Return the custom string if this PackagePath is using HeaderExtension=EPackageExtension::Custom, otherwise return an empty string

Public function Const

FString

 

GetDebugName

(
    EPackageSegment PackageSegment
)

Version of GetDebugName that takes a PackageSegment, otherwise same behavior as parameterless version For EPackageSegment::Header, HeaderExtension is not indicated.

Public function Const

FString

 

GetDebugName()

Returns a descriptor of this PackagePath, usable for an identifier in warning and log messages.

Public function Const

FText

 

GetDebugNameText()

Returns GetDebugName converted to FText

Public function Const

FText

 

GetDebugNameText

(
    EPackageSegment PackageSegment
)

Version of GetDebugNameText that takes a PackageSegment, otherwise same behavior as parameterless version

Public function Const

FString

 

GetDebugNameWithExtension()

Returns a descriptor of this PackagePath for the given segment, with extension.

Public function Const

FString

 

GetDebugNameWithExtension

(
    EPackageSegment PackageSegment
)

Version of GetDebugNameWithExtension that takes a PackageSegment, otherwise same behavior as parameterless version

Public function Const

EPackageExte...

 

GetExtension

(
    EPackageSegment PackageSegment,
    FStringView& OutCustomExtension
)

Report the extension this PackagePath uses for the given segment

Public function Const

FStringView

 

GetExtensionString

(
    EPackageSegment PackageSegment
)

Report the extension string this PackagePath uses for the given segment.

Public function Static

const TCHAR ...

 

GetExternalActorsFolderName()

Get the folder name from which all external actors paths are created

Public function Static

const TCHAR ...

 

GetExternalObjectsFolderName()

Get the folder name from which all external objects paths are created

Public function Const

EPackageExte...

 

GetHeaderExtension()

Return the HeaderExtension

Public function Const

FString

 

GetLocalBaseFilenameWithPath()

Return the Local (path,basename) of this PackagePath if known or available, or empty string if not

Public function Const

FString

 

GetLocalFullPath()

Return the full LocalPath (path,basename,extension)

Public function Const

FString

 

GetLocalFullPath

(
    EPackageSegment PackageSegment
)

Version of GetLocalFullPath that takes a PackageSegment, otherwise same behavior as parameterless version

Public function Static

const TCHAR ...

 

GetOptionalSegmentExtensionModifier()

Get the string identifying optional segments

Public function Const

FName

 

GetPackageFName()

Return as an FName the PackageName indicated by this PackagePath if known or available, or NAME_None if not

Public function Const

FString

 

GetPackageName()

Return the PackageName indicated by this PackagePath if known or available, or empty string if not

Public function Const

FString

 

GetPackageNameOrFallback()

Returns the PackageName if available, otherwise the LocalPath

Public function Const

TConstArrayV...

 

GetPossibleExtensions

(
    EPackageSegment PackageSegment
)

Report the EPackageExtensions this PackagePath should look for on disk

Public function Const

bool

 

HasLocalPath()

Return true if and only if GetLocalBaseFilenameWithPath returns non-empty

Public function Const

bool

 

HasPackageName()

Return true if and only if GetPackageName returns non-empty

Public function Const

bool

 

IsEmpty()

Return whether this is a PackagePath with no path information and can never identify a package on disk

Public function Const

bool

 

IsMountedPath()

Return whether a mount point has been found for this PackagePath

Public function Static

EPackageExte...

 

ParseExtension

(
    FStringView Filename,
    int32* OutExtensionStart
)

Parse the extension from a filepath and convert it to an EPackageExtension.

Public function Const

void

 

SetHeaderExtension

(
    EPackageExtension Extension,
    FStringView CustomExtension
)

Set the HeaderExtension to use, including a custom string if Extension is EPackageExtension::Custom

Public function Static

bool

 

TryFromMountedName

(
    FStringView InPackageNameOrHeaderFi...,
    FPackagePath& OutPackagePath
)

Construct a PackagePath from a LocalPath or PackageName string, assuming the given LocalPath or PackageName is in a directory that is mounted (aka registered with FPackageName::MountPointExists)

Public function Static

bool

 

TryFromPackageName

(
    FName InPackageName,
    FPackagePath& OutPackagePath
)

Attempt to construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*

Public function Static

bool

 

TryFromPackageName

(
    FStringView InPackageName,
    FPackagePath& OutPackagePath
)

Attempt to construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*

Public function Static

bool

 

TryFromPackageName

(
    const TCHAR* InPackageName,
    FPackagePath& OutPackagePath
)

Attempt to construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*

Public function Static

bool

 

TryMatchCase

(
    const FPackagePath& SourcePackageP...,
    FStringView FilePathToMatch,
    FPackagePath& OutPackagePath
)

Set the capitalization of a PackagePath to match the given string

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FPackagePath& Other
)

Public function

FPackagePath...

 

operator=

(
    const FPackagePath& Other
)

Public function

FPackagePath...

 

operator=

(
    FPackagePath&& Other
)

Public function Const

bool

 

operator==

(
    const FPackagePath& Other
)

Comparsion operators.

Enums

Name

Description

Private enum

EPackageIdType