UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPackageName Class Reference

#include <PackageName.h>

Public Types

enum class  EFlexNameType { Invalid , PackageName , LocalPath , ObjectPath }
 
enum class  EErrorCode {
  PackageNameUnknown , PackageNameEmptyPath , PackageNamePathNotMounted , PackageNamePathIsMemoryOnly ,
  PackageNameSpacesNotAllowed , PackageNameContainsInvalidCharacters , LongPackageNames_PathTooShort , LongPackageNames_PathWithNoStartingSlash ,
  LongPackageNames_PathWithTrailingSlash , LongPackageNames_PathWithDoubleSlash
}
 
enum class  EConvertFlags { None = 0 , AllowDots = 0x1 }
 
enum class  EPackageLocationFilter : uint8 {
  None = 0 , IoDispatcher = 1 , FileSystem = 2 , MaxBit = FileSystem ,
  ValidMask = (1 << MaxBit) - 1 , Any = 0xFF
}
 
enum class  EPathFormatFlags : uint32 {
  None = 0x0 , MountPointLeadingSlash = 0x1 , MountPointTrailingSlash = 0x2 , MountPointSlashes = MountPointLeadingSlash | MountPointTrailingSlash ,
  MountPointNoSlashes = None
}
 
typedef TFunctionRef< bool(const TCHAR *)> FPackageNameVisitor
 
typedef TFunctionRef< bool(const TCHAR *, const FFileStatData &)> FPackageNameStatVisitor
 

Public Member Functions

 DECLARE_MULTICAST_DELEGATE_TwoParams (FOnContentPathMountedEvent, const FString &, const FString &)
 
 DECLARE_MULTICAST_DELEGATE_TwoParams (FOnContentPathDismountedEvent, const FString &, const FString &)
 
 DECLARE_DELEGATE_RetVal_OneParam (bool, FDoesPackageExistOverride, FName)
 
 DECLARE_MULTICAST_DELEGATE_TwoParams (FGetExplanationForUnavailablePackageDelegate, const FName &, FStringBuilderBase &)
 

Static Public Member Functions

static COREUOBJECT_API FString FormatErrorAsString (FStringView InPath, EErrorCode ErrorCode)
 
static COREUOBJECT_API FText FormatErrorAsText (FStringView InPath, EErrorCode ErrorCode)
 
static COREUOBJECT_API FString ConvertToLongScriptPackageName (const TCHAR *InShortName)
 
static COREUOBJECT_API FName GetModuleScriptPackageName (FName ModuleName)
 
static COREUOBJECT_API FString GetModuleScriptPackageName (FStringView ModuleName)
 
static COREUOBJECT_API bool TryConvertScriptPackageNameToModuleName (FStringView PackageName, FStringView &OutModuleName)
 
static COREUOBJECT_API void RegisterShortPackageNamesForUObjectModules ()
 
static COREUOBJECT_API FNameFindScriptPackageName (FName InShortName)
 
static COREUOBJECT_API bool TryConvertFilenameToLongPackageName (const FString &InFilename, FString &OutPackageName, FString *OutFailureReason=nullptr, const EConvertFlags Flags=EConvertFlags::None)
 
static COREUOBJECT_API bool TryConvertFilenameToLongPackageName (FStringView InFilename, FStringBuilderBase &OutPackageName, FStringBuilderBase *OutFailureReason=nullptr, const EConvertFlags Flags=EConvertFlags::None)
 
static COREUOBJECT_API FString FilenameToLongPackageName (const FString &InFilename)
 
static COREUOBJECT_API bool TryConvertLongPackageNameToFilename (const FString &InLongPackageName, FString &OutFilename, const FString &InExtension=TEXT(""))
 
static COREUOBJECT_API bool TryConvertLongPackageNameToFilename (FStringView InLongPackageName, FString &OutFilename, FStringView InExtension={})
 
static COREUOBJECT_API bool TryConvertToMountedPath (FStringView InPath, FString *OutLocalPathNoExtension, FString *OutPackageName, FString *OutObjectName, FString *OutSubObjectName, FString *OutExtension, EFlexNameType *OutFlexNameType=nullptr, EErrorCode *OutFailureReason=nullptr)
 
static COREUOBJECT_API FString LongPackageNameToFilename (const FString &InLongPackageName, const FString &InExtension=TEXT(""))
 
static COREUOBJECT_API FString GetLongPackagePath (const FString &InLongPackageName)
 
static COREUOBJECT_API FString GetLongPackageAssetName (const FString &InLongPackageName)
 
static COREUOBJECT_API void SplitFullObjectPath (const FString &InFullObjectPath, FString &OutClassName, FString &OutPackageName, FString &OutObjectName, FString &OutSubObjectName, bool bDetectClassName=true)
 
static COREUOBJECT_API void SplitFullObjectPath (FStringView InFullObjectPath, FStringView &OutClassName, FStringView &OutPackageName, FStringView &OutObjectName, FStringView &OutSubObjectName, bool bDetectClassName=true)
 
static COREUOBJECT_API void SplitFullObjectPath (const FString &InFullObjectPath, FString &OutClassName, FString &OutPackageName, FString &OutObjectName, TArray< FString > &OutSubobjectNames, bool bDetectClassName=true)
 
static COREUOBJECT_API void SplitFullObjectPath (FStringView InFullObjectPath, FStringView &OutClassName, FStringView &OutPackageName, FStringView &OutObjectName, TArray< FStringView > &OutSubobjectNames, bool bDetectClassName=true)
 
static COREUOBJECT_API bool IsValidLongPackageName (FStringView InLongPackageName, bool bIncludeReadOnlyRoots=false, EErrorCode *OutReason=nullptr)
 
static COREUOBJECT_API bool IsValidLongPackageName (FStringView InLongPackageName, bool bIncludeReadOnlyRoots, FText *OutReason)
 
static COREUOBJECT_API bool IsValidTextForLongPackageName (FStringView InLongPackageName, EErrorCode *OutReason=nullptr)
 
static COREUOBJECT_API bool IsValidTextForLongPackageName (FStringView InLongPackageName, FText *OutReason)
 
static COREUOBJECT_API bool IsValidObjectPath (FStringView InObjectPath, FText *OutReason=nullptr)
 
static COREUOBJECT_API bool IsValidPath (FStringView InPath)
 
static COREUOBJECT_API bool IsShortPackageName (const FString &PossiblyLongName)
 
static COREUOBJECT_API bool IsShortPackageName (const FName PossiblyLongName)
 
static COREUOBJECT_API bool IsShortPackageName (FStringView PossiblyLongName)
 
static COREUOBJECT_API FString GetShortName (const UPackage *Package)
 
static COREUOBJECT_API FString GetShortName (FStringView LongName)
 
static COREUOBJECT_API FString GetShortName (const FName &LongName)
 
static COREUOBJECT_API FString GetShortName (const TCHAR *LongName)
 
static COREUOBJECT_API FName GetShortFName (FStringView LongName)
 
static COREUOBJECT_API FName GetShortFName (const FName &LongName)
 
static COREUOBJECT_API FName GetShortFName (const TCHAR *LongName)
 
static COREUOBJECT_API bool TryConvertGameRelativePackagePathToLocalPath (FStringView RelativePackagePath, FString &OutLocalPath)
 
static COREUOBJECT_API void RegisterMountPoint (const FString &RootPath, const FString &ContentPath)
 
static COREUOBJECT_API void UnRegisterMountPoint (const FString &RootPath, const FString &ContentPath)
 
static COREUOBJECT_API bool MountPointExists (FStringView RootPath)
 
static COREUOBJECT_API bool MountPointExists (const FString &RootPath)
 
static COREUOBJECT_API bool MountPointExists (const TCHAR *RootPath)
 
static COREUOBJECT_API FName GetPackageMountPoint (FStringView InPackagePath, bool InWithoutSlashes=true)
 
static COREUOBJECT_API FName GetPackageMountPoint (const FString &InPackagePath, bool InWithoutSlashes=true)
 
static COREUOBJECT_API FName GetPackageMountPoint (const TCHAR *InPackagePath, bool InWithoutSlashes=true)
 
static COREUOBJECT_API FString GetContentPathForPackageRoot (FStringView InPackageRoot)
 
static bool DoesPackageExist (const FString &LongPackageName, const FGuid *Guid, FString *OutFilename, bool InAllowTextFormats=true)
 
static COREUOBJECT_API bool DoesPackageExist (const FString &LongPackageName, FString *OutFilename=nullptr, bool InAllowTextFormats=true)
 
static COREUOBJECT_API bool DoesPackageExist (const FPackagePath &PackagePath, bool bMatchCaseOnDisk=false, FPackagePath *OutPackagePath=nullptr)
 
static COREUOBJECT_API bool DoesPackageExist (const FPackagePath &PackagePath, FPackagePath *OutPackagePath)
 
static COREUOBJECT_API EPackageLocationFilter DoesPackageExistEx (const FPackagePath &PackagePath, EPackageLocationFilter Filter, bool bMatchCaseOnDisk=false, FPackagePath *OutPackagePath=nullptr)
 
static COREUOBJECT_API bool SearchForPackageOnDisk (const FString &PackageName, FString *OutLongPackageName=NULL, FString *OutFilename=NULL)
 
static COREUOBJECT_API bool TryConvertShortPackagePathToLongInObjectPath (const FString &ObjectPath, FString &ConvertedObjectPath)
 
static COREUOBJECT_API FString GetNormalizedObjectPath (const FString &ObjectPath)
 
static COREUOBJECT_API FString GetDelegateResolvedPackagePath (const FString &InSourcePackagePath)
 
static COREUOBJECT_API FString GetSourcePackagePath (const FString &InLocalizedPackagePath)
 
static COREUOBJECT_API FString GetLocalizedPackagePath (const FString &InSourcePackagePath)
 
static COREUOBJECT_API FString GetLocalizedPackagePath (const FString &InSourcePackagePath, const FString &InCultureName)
 
static UE_INTERNAL COREUOBJECT_API UE::Core::FVersePath GetVersePath (const FTopLevelAssetPath &AssetPath)
 
static UE_INTERNAL COREUOBJECT_API UE::Core::FVersePath LongPackagePathToVersePath (FStringView LongPackagePath)
 
static COREUOBJECT_API const FString & GetAssetPackageExtension ()
 
static COREUOBJECT_API const FString & GetMapPackageExtension ()
 
static COREUOBJECT_API const FString & GetTextAssetPackageExtension ()
 
static COREUOBJECT_API const FString & GetTextMapPackageExtension ()
 
static COREUOBJECT_API bool IsTextPackageExtension (const TCHAR *Ext)
 
static COREUOBJECT_API bool IsTextPackageExtension (EPackageExtension Extension)
 
static COREUOBJECT_API bool IsTextAssetPackageExtension (const TCHAR *Ext)
 
static COREUOBJECT_API bool IsTextMapPackageExtension (const TCHAR *Ext)
 
static COREUOBJECT_API bool IsPackageExtension (const TCHAR *Ext)
 
static COREUOBJECT_API bool IsPackageExtension (EPackageExtension Extension)
 
static COREUOBJECT_API bool IsAssetPackageExtension (const TCHAR *Ext)
 
static COREUOBJECT_API bool IsMapPackageExtension (const TCHAR *Ext)
 
static COREUOBJECT_API bool IsVerseExtension (const TCHAR *Ext)
 
static bool IsPackageFilename (FStringView Filename)
 
static COREUOBJECT_API const TCHARGetGeneratedPackageSubPath ()
 
static COREUOBJECT_API bool IsUnderGeneratedPackageSubPath (FStringView FileOrLongPackagePath)
 
static COREUOBJECT_API bool FindPackagesInDirectory (TArray< FString > &OutPackages, const FString &RootDir)
 
static COREUOBJECT_API bool FindPackagesInDirectories (TArray< FString > &OutPackages, const TArrayView< const FString > &RootDirs)
 
static COREUOBJECT_API void IteratePackagesInDirectory (const FString &RootDir, const FPackageNameVisitor &Visitor)
 
static COREUOBJECT_API void IteratePackagesInDirectory (const FString &RootDir, const FPackageNameStatVisitor &Visitor)
 
static FOnContentPathMountedEventOnContentPathMounted ()
 
static FOnContentPathDismountedEventOnContentPathDismounted ()
 
static COREUOBJECT_API void QueryRootContentPaths (TArray< FString > &OutRootContentPaths, bool bIncludeReadOnlyRoots=false, bool bWithoutLeadingSlashes=false, bool bWithoutTrailingSlashes=false)
 
static COREUOBJECT_API TArray< FString > QueryMountPointLocalAbsPaths ()
 
static COREUOBJECT_API void OnCoreUObjectInitialized ()
 
static COREUOBJECT_API bool ParseExportTextPath (FWideStringView InExportTextPath, FWideStringView *OutClassName, FWideStringView *OutObjectPath)
 
static COREUOBJECT_API bool ParseExportTextPath (FAnsiStringView InExportTextPath, FAnsiStringView *OutClassName, FAnsiStringView *OutObjectPath)
 
static COREUOBJECT_API bool ParseExportTextPath (const FString &InExportTextPath, FString *OutClassName, FString *OutObjectPath)
 
static COREUOBJECT_API bool ParseExportTextPath (const TCHAR *InExportTextPath, FStringView *OutClassName, FStringView *OutObjectPath)
 
static COREUOBJECT_API FWideStringView ExportTextPathToObjectPath (FWideStringView InExportTextPath)
 
static COREUOBJECT_API FAnsiStringView ExportTextPathToObjectPath (FAnsiStringView InExportTextPath)
 
static COREUOBJECT_API FString ExportTextPathToObjectPath (const FString &InExportTextPath)
 
static COREUOBJECT_API FString ExportTextPathToObjectPath (const TCHAR *InExportTextPath)
 
static COREUOBJECT_API void SplitPackageName (FStringView InPackageName, FStringView *OutPackageRoot, FStringView *OutPackagePath, FStringView *OutPackageLeafName, EPathFormatFlags Flags=EPathFormatFlags::MountPointSlashes)
 
static COREUOBJECT_API void SplitPackageName (const FString &InLongPackageName, FString *OutPackageRoot, FString *OutPackagePath, FString *OutPackageLeafName, EPathFormatFlags Flags=EPathFormatFlags::MountPointSlashes)
 
static COREUOBJECT_API bool SplitLongPackageName (const FString &InLongPackageName, FString &OutPackageRoot, FString &OutPackagePath, FString &OutPackageLeafName, const bool bStripRootLeadingSlash=false)
 
static COREUOBJECT_API FStringView SplitPackageNameRoot (FStringView InPackageName, FStringView *OutRelativePath, EPathFormatFlags Flags=EPathFormatFlags::MountPointNoSlashes)
 
static COREUOBJECT_API FString SplitPackageNameRoot (FName InPackageName, FString *OutRelativePath, EPathFormatFlags Flags=EPathFormatFlags::MountPointNoSlashes)
 
static COREUOBJECT_API FWideStringView ObjectPathToPackageName (FWideStringView InObjectPath)
 
static COREUOBJECT_API FAnsiStringView ObjectPathToPackageName (FAnsiStringView InObjectPath)
 
static COREUOBJECT_API FString ObjectPathToPackageName (const FString &InObjectPath)
 
static COREUOBJECT_API FWideStringView ObjectPathToPathWithinPackage (FWideStringView InObjectPath)
 
static COREUOBJECT_API FAnsiStringView ObjectPathToPathWithinPackage (FAnsiStringView InObjectPath)
 
static COREUOBJECT_API FString ObjectPathToPathWithinPackage (const FString &InObjectPath)
 
static COREUOBJECT_API FWideStringView ObjectPathToOuterPath (FWideStringView InObjectPath)
 
static COREUOBJECT_API FAnsiStringView ObjectPathToOuterPath (FAnsiStringView InObjectPath)
 
static COREUOBJECT_API FString ObjectPathToOuterPath (const FString &InObjectPath)
 
static COREUOBJECT_API FWideStringView ObjectPathToSubObjectPath (FWideStringView InObjectPath)
 
static COREUOBJECT_API FAnsiStringView ObjectPathToSubObjectPath (FAnsiStringView InObjectPath)
 
static COREUOBJECT_API FString ObjectPathToSubObjectPath (const FString &InObjectPath)
 
static COREUOBJECT_API FWideStringView ObjectPathToObjectName (FWideStringView InObjectPath)
 
static COREUOBJECT_API FAnsiStringView ObjectPathToObjectName (FAnsiStringView InObjectPath)
 
static COREUOBJECT_API FString ObjectPathToObjectName (const FString &InObjectPath)
 
static COREUOBJECT_API void ObjectPathSplitFirstName (FWideStringView Text, FWideStringView &OutFirst, FWideStringView &OutRemainder)
 
static COREUOBJECT_API void ObjectPathSplitFirstName (FAnsiStringView Text, FAnsiStringView &OutFirst, FAnsiStringView &OutRemainder)
 
static COREUOBJECT_API void ObjectPathAppend (FStringBuilderBase &ObjectPath, FStringView NextName)
 
static COREUOBJECT_API FString ObjectPathCombine (FStringView ObjectPath, FStringView NextName)
 
static COREUOBJECT_API bool IsVersePackage (FStringView InPackageName)
 
static COREUOBJECT_API bool IsScriptPackage (FStringView InPackageName)
 
static COREUOBJECT_API bool IsMemoryPackage (FStringView InPackageName)
 
static COREUOBJECT_API bool IsTempPackage (FStringView InPackageName)
 
static COREUOBJECT_API bool IsInEngineTransientPackages (FStringView InPackageName)
 
static COREUOBJECT_API bool IsLocalizedPackage (FStringView InPackageName)
 
static COREUOBJECT_API bool DoesPackageNameContainInvalidCharacters (FStringView InLongPackageName, FText *OutReason)
 
static COREUOBJECT_API bool DoesPackageNameContainInvalidCharacters (FStringView InLongPackageName, EErrorCode *OutReason=nullptr)
 
static COREUOBJECT_API bool FindPackageFileWithoutExtension (const FString &InPackageFilename, FString &OutFilename)
 
static COREUOBJECT_API bool FindPackageFileWithoutExtension (const FString &InPackageFilename, FString &OutFilename, bool InAllowTextFormats)
 
static COREUOBJECT_API bool FixPackageNameCase (FString &LongPackageName, FStringView Extension)
 
static FDoesPackageExistOverrideDoesPackageExistOverride ()
 
static COREUOBJECT_API bool TryGetMountPointForPath (FStringView InFilePathOrPackageName, FStringBuilderBase &OutMountPointPackageName, FStringBuilderBase &OutMountPointFilePath, FStringBuilderBase &OutRelPath, EFlexNameType *OutFlexNameType=nullptr, EErrorCode *OutFailureReason=nullptr)
 
static COREUOBJECT_API FGetExplanationForUnavailablePackageDelegateGetExplanationForUnavailablePackageDelegate ()
 
static COREUOBJECT_API void GetExplanationForUnavailablePackage (const FName &UnavailablePackageName, FStringBuilderBase &InOutExplanation)
 

Friends

class FPackagePath
 
class FAssetRegistryConsoleCommands
 
class UAssetRegistryImpl
 
struct ::UE::AssetRegistry::Impl::FScanPathContext
 

Member Typedef Documentation

◆ FPackageNameStatVisitor

◆ FPackageNameVisitor

This will recurse over a directory structure looking for packages.

Parameters
RootDirectoryThe root of the directory structure to recurse through
VisitorVisitor to call for each package file found (takes the package filename, and optionally the stat data for the file - returns true to continue iterating)

Member Enumeration Documentation

◆ EConvertFlags

Enumerator
None 
AllowDots 

When set, this will allow filenames following the wildcard pattern of *.*.*, rather than *.*.

◆ EErrorCode

Enumerator
PackageNameUnknown 
PackageNameEmptyPath 
PackageNamePathNotMounted 
PackageNamePathIsMemoryOnly 
PackageNameSpacesNotAllowed 
PackageNameContainsInvalidCharacters 
LongPackageNames_PathTooShort 
LongPackageNames_PathWithNoStartingSlash 
LongPackageNames_PathWithTrailingSlash 
LongPackageNames_PathWithDoubleSlash 

◆ EFlexNameType

Indicates the format the input was in in functions that take flexible input that can be a LocalPath, PackageName, or ObjectPath

Enumerator
Invalid 
PackageName 
LocalPath 
ObjectPath 

◆ EPackageLocationFilter

Enumerator
None 
IoDispatcher 
FileSystem 
MaxBit 
ValidMask 
Any 

◆ EPathFormatFlags

Flags for the output format of path functions.

Enumerator
None 
MountPointLeadingSlash 
MountPointTrailingSlash 
MountPointSlashes 
MountPointNoSlashes 

Member Function Documentation

◆ ConvertToLongScriptPackageName()

FString FPackageName::ConvertToLongScriptPackageName ( const TCHAR InShortName)
static

Helper function for converting short to long script package name (InputCore -> /Script/InputCore)

Parameters
InShortNameShort package name.
Returns
Long package name.

◆ DECLARE_DELEGATE_RetVal_OneParam()

FPackageName::DECLARE_DELEGATE_RetVal_OneParam ( bool  ,
FDoesPackageExistOverride  ,
FName   
)

Override whether a package exist or not.

◆ DECLARE_MULTICAST_DELEGATE_TwoParams() [1/3]

FPackageName::DECLARE_MULTICAST_DELEGATE_TwoParams ( FGetExplanationForUnavailablePackageDelegate  ,
const FName ,
FStringBuilderBase  
)

Delegate type for allowing higher levels systems to provide additional context for why a package is not available

◆ DECLARE_MULTICAST_DELEGATE_TwoParams() [2/3]

FPackageName::DECLARE_MULTICAST_DELEGATE_TwoParams ( FOnContentPathDismountedEvent  ,
const FString &  ,
const FString &   
)

Event that is triggered when a new content path is removed

◆ DECLARE_MULTICAST_DELEGATE_TwoParams() [3/3]

FPackageName::DECLARE_MULTICAST_DELEGATE_TwoParams ( FOnContentPathMountedEvent  ,
const FString &  ,
const FString &   
)

Event that is triggered when a new content path is mounted

◆ DoesPackageExist() [1/4]

bool FPackageName::DoesPackageExist ( const FPackagePath PackagePath,
bool  bMatchCaseOnDisk = false,
FPackagePath OutPackagePath = nullptr 
)
static

Checks if the package exists on disk. PackagePath must be a mounted path, otherwise returns false

Parameters
PackagePathPackage package.
GuidIf nonnull, and the package is found on disk but does not have this PackageGuid in its FPackageFileSummary::Guid, false is returned
bMatchCaseOnDiskIf true, the OutPackagePath is modified to match the capitalization of the discovered file
OutPackagePathIf nonnull and the package exists, set to a copy of PackagePath with the HeaderExtension set to the extension that exists on disk (and if bMatchCaseOnDisk is true, capitalization changed to match). If not found, this variable is not written
Returns
true if the specified package name points to an existing package, false otherwise.

◆ DoesPackageExist() [2/4]

bool FPackageName::DoesPackageExist ( const FPackagePath PackagePath,
FPackagePath OutPackagePath 
)
static

Checks if the package exists on disk. PackagePath must be a mounted path, otherwise returns false

Parameters
PackagePathPackage package.
OutPackagePathIf nonnull and the package exists, set to a copy of PackagePath with the HeaderExtension set to the extension that exists on disk. If not found, this variable is not written
Returns
true if the specified package name points to an existing package, false otherwise.

◆ DoesPackageExist() [3/4]

static bool FPackageName::DoesPackageExist ( const FString &  LongPackageName,
const FGuid Guid,
FString *  OutFilename,
bool  InAllowTextFormats = true 
)
inlinestatic

Checks if the package exists on disk.

Parameters
LongPackageNamePackage name.
GuidIf nonnull, and the package is found on disk but does not have this PackageGuid in its FPackageFileSummary::Guid, false is returned
OutFilenamePackage filename on disk.
InAllowTextFormatsDetect text format packages as well as binary (priority to text)
Returns
true if the specified package name points to an existing package, false otherwise.

◆ DoesPackageExist() [4/4]

bool FPackageName::DoesPackageExist ( const FString &  LongPackageName,
FString *  OutFilename = nullptr,
bool  InAllowTextFormats = true 
)
static

Checks if the package exists on disk.

Parameters
LongPackageNamePackage name.
OutFilenamePackage filename on disk.
InAllowTextFormatsDetect text format packages as well as binary (priority to text)
Returns
true if the specified package name points to an existing package, false otherwise.

◆ DoesPackageExistEx()

FPackageName::EPackageLocationFilter FPackageName::DoesPackageExistEx ( const FPackagePath PackagePath,
EPackageLocationFilter  Filter,
bool  bMatchCaseOnDisk = false,
FPackagePath OutPackagePath = nullptr 
)
static

Checks if the package exists in IOStore containers, on disk outside of IOStore, both, or neither

Parameters
PackagePathPackage package.
FilterIndication of where it should look for
GuidIf non-null, and the package is found on disk but does not have this PackageGuid in its FPackageFileSummary::Guid, false is returned
bMatchCaseOnDiskIf true, the OutPackagePath is modified to match the capitalization of the discovered file
OutPackagePathIf non-null and the package exists, set to a copy of PackagePath with the HeaderExtension set to the extension that exists on disk (and if bMatchCaseOnDisk is true, capitalization changed to match). If not found, this variable is not written
Returns
the set of locations where the package exists (IoDispatcher or FileSystem, both or neither)

◆ DoesPackageExistOverride()

static FDoesPackageExistOverride & FPackageName::DoesPackageExistOverride ( )
inlinestatic

◆ DoesPackageNameContainInvalidCharacters() [1/2]

bool FPackageName::DoesPackageNameContainInvalidCharacters ( FStringView  InLongPackageName,
EErrorCode OutReason = nullptr 
)
static

◆ DoesPackageNameContainInvalidCharacters() [2/2]

bool FPackageName::DoesPackageNameContainInvalidCharacters ( FStringView  InLongPackageName,
FText OutReason 
)
static

Checks if a package name contains characters that are invalid for package names.

◆ ExportTextPathToObjectPath() [1/4]

FString FPackageName::ExportTextPathToObjectPath ( const FString &  InExportTextPath)
static

◆ ExportTextPathToObjectPath() [2/4]

FString FPackageName::ExportTextPathToObjectPath ( const TCHAR InExportTextPath)
static

◆ ExportTextPathToObjectPath() [3/4]

FAnsiStringView FPackageName::ExportTextPathToObjectPath ( FAnsiStringView  InExportTextPath)
static

◆ ExportTextPathToObjectPath() [4/4]

FWideStringView FPackageName::ExportTextPathToObjectPath ( FWideStringView  InExportTextPath)
static

Returns the path to the object referred to by the supplied export text path, excluding the class name.

Parameters
InExportTextPathThe export text path for an object. Takes on the form: ClassName'ObjectPath'
Returns
The path to the object referred to by the supplied export path.

◆ FilenameToLongPackageName()

FString FPackageName::FilenameToLongPackageName ( const FString &  InFilename)
static

Converts the supplied filename to long package name. Throws a fatal error if the conversion is not successful.

Parameters
InFilenameFilename to convert.
Returns
Long package name.

◆ FindPackageFileWithoutExtension() [1/2]

bool FPackageName::FindPackageFileWithoutExtension ( const FString &  InPackageFilename,
FString &  OutFilename 
)
static

Checks if a package can be found using known package extensions (header extensions only; files with the extensions of other segments are not returned).

Parameters
InPackageFilenamePackage filename without the extension.
OutFilenameIf the package could be found, filename with the extension.
InAllowTextFormatsDetect text format packages as well as binary (priority to text)
Returns
true if the package could be found on disk.

◆ FindPackageFileWithoutExtension() [2/2]

bool FPackageName::FindPackageFileWithoutExtension ( const FString &  InPackageFilename,
FString &  OutFilename,
bool  InAllowTextFormats 
)
static

◆ FindPackagesInDirectories()

bool FPackageName::FindPackagesInDirectories ( TArray< FString > &  OutPackages,
const TArrayView< const FString > &  RootDirs 
)
static

This will recurse over the given list of directory structures looking for packages.

Parameters
OutPackagesThe output array that is filled out with the discovered file paths
RootDirssThe roots of the directory structures to recurse through
Returns
Returns true if any packages have been found, otherwise false

◆ FindPackagesInDirectory()

bool FPackageName::FindPackagesInDirectory ( TArray< FString > &  OutPackages,
const FString &  RootDir 
)
static

This will recurse over a directory structure looking for packages.

Parameters
OutPackagesThe output array that is filled out with the discovered file paths
RootDirThe root of the directory structure to recurse through
Returns
Returns true if any packages have been found, otherwise false

◆ FindScriptPackageName()

FName * FPackageName::FindScriptPackageName ( FName  InShortName)
static

Finds long script package name associated with a short package name.

Parameters
InShortNameShort script package name.
Returns
Long script package name (/Script/Package) associated with short name or NULL.

◆ FixPackageNameCase()

bool FPackageName::FixPackageNameCase ( FString &  LongPackageName,
FStringView  Extension 
)
static

Converts a long package name to the case it exists as on disk.

Parameters
LongPackageNameThe long package name
ExtensionThe extension for this package
Returns
True if the long package name was fixed up, false otherwise

◆ FormatErrorAsString()

FString FPackageName::FormatErrorAsString ( FStringView  InPath,
EErrorCode  ErrorCode 
)
static

Return a user-readable string for the error code returned from a FPackageName function

Parameters
InPaththe path that was passed to the convert function
ErrorCodeThe error code returned from the convert function

◆ FormatErrorAsText()

FText FPackageName::FormatErrorAsText ( FStringView  InPath,
EErrorCode  ErrorCode 
)
static

Return a user-readable string for the error code returned from a FPackageName function

Parameters
InPaththe path that was passed to the convert function
ErrorCodeThe error code returned from the convert function

◆ GetAssetPackageExtension()

const FString & FPackageName::GetAssetPackageExtension ( )
static

Returns the file extension for packages containing assets.

Returns
file extension for asset packages ( dot included )

◆ GetContentPathForPackageRoot()

FString FPackageName::GetContentPathForPackageRoot ( FStringView  InPackageRoot)
static

Get the path associated with the given package root

Parameters
InPackageRootPackage root to return the path for, e.g. /Game/, /Engine/, /PluginName/
Returns
Filesystem path associated with the provided package root

◆ GetDelegateResolvedPackagePath()

FString FPackageName::GetDelegateResolvedPackagePath ( const FString &  InSourcePackagePath)
static

Gets the resolved path of a long package as determined by the delegates registered with FCoreDelegates::PackageNameResolvers. This allows systems such as localization to redirect requests for a package to a more appropriate alternative, or to nix the request altogether.

Parameters
InSourcePackagePathPath to the source package.
Returns
Resolved package path, or the source package path if there is no resolution occurs.

◆ GetExplanationForUnavailablePackage()

void FPackageName::GetExplanationForUnavailablePackage ( const FName UnavailablePackageName,
FStringBuilderBase InOutExplanation 
)
static

Attempt to generate an explanation for why a particular package was not available for loading

Parameters
UnavailablePackageNameThe package that was requested but could not be loaded
InOutExplanationA string builder that will be populated with any available information about why the package was not available. The string builder will not be reset and will be appended to.

◆ GetExplanationForUnavailablePackageDelegate()

FPackageName::FGetExplanationForUnavailablePackageDelegate & FPackageName::GetExplanationForUnavailablePackageDelegate ( )
static

Accessor for installing callbacks for use with GetExplanationForUnavailablePackage

◆ GetGeneratedPackageSubPath()

const TCHAR * FPackageName::GetGeneratedPackageSubPath ( )
static

Return the text string used to mark the Generated directory of packages created by CookPackageSplitters.

◆ GetLocalizedPackagePath() [1/2]

FString FPackageName::GetLocalizedPackagePath ( const FString &  InSourcePackagePath)
static

Gets the localized version of a long package path for the current culture, or returns the source package if there is no suitable localized package.

Parameters
InSourcePackagePathPath to the source package.
Returns
Localized package path, or the source package path if there is no suitable localized package.

◆ GetLocalizedPackagePath() [2/2]

FString FPackageName::GetLocalizedPackagePath ( const FString &  InSourcePackagePath,
const FString &  InCultureName 
)
static

Gets the localized version of a long package path for the given culture, or returns the source package if there is no suitable localized package.

Parameters
InSourcePackagePathPath to the source package.
InCultureNameCulture name to get the localized package for.
Returns
Localized package path, or the source package path if there is no suitable localized package.

◆ GetLongPackageAssetName()

FString FPackageName::GetLongPackageAssetName ( const FString &  InLongPackageName)
static

Returns the clean asset name for the specified package, same as GetShortName

Parameters
InLongPackageNameLong Package Name
Returns
Clean asset name.

◆ GetLongPackagePath()

FString FPackageName::GetLongPackagePath ( const FString &  InLongPackageName)
static

Returns the path to the specified package, excluding the short package name e.g. given /Game/Maps/MyMap returns /Game/Maps

Parameters
InLongPackageNameLong Package Name.
Returns
The path containing the specified package.

◆ GetMapPackageExtension()

const FString & FPackageName::GetMapPackageExtension ( )
static

Returns the file extension for packages containing assets.

Returns
file extension for asset packages ( dot included )

◆ GetModuleScriptPackageName() [1/2]

FName FPackageName::GetModuleScriptPackageName ( FName  ModuleName)
static

Return the LongPackageName of module's native script package. Does not check whether module is native.

◆ GetModuleScriptPackageName() [2/2]

FString FPackageName::GetModuleScriptPackageName ( FStringView  ModuleName)
static

◆ GetNormalizedObjectPath()

FString FPackageName::GetNormalizedObjectPath ( const FString &  ObjectPath)
static

Gets normalized object path i.e. with long package format.

Parameters
ObjectPathPath to the object.
Returns
Normalized path (or empty path, if short object path was given and it wasn't found on the disk).

◆ GetPackageMountPoint() [1/3]

FName FPackageName::GetPackageMountPoint ( const FString &  InPackagePath,
bool  InWithoutSlashes = true 
)
static

◆ GetPackageMountPoint() [2/3]

FName FPackageName::GetPackageMountPoint ( const TCHAR InPackagePath,
bool  InWithoutSlashes = true 
)
static

◆ GetPackageMountPoint() [3/3]

FName FPackageName::GetPackageMountPoint ( FStringView  InPackagePath,
bool  InWithoutSlashes = true 
)
static

Get the mount point for a given package path

Parameters
InPackagePathThe package path to get the mount point for
InWithoutSlashesOptional parameters that keeps the slashes around the mount point if false
Returns
FName corresponding to the mount point, or Empty if invalid

◆ GetShortFName() [1/3]

FName FPackageName::GetShortFName ( const FName LongName)
static

◆ GetShortFName() [2/3]

FName FPackageName::GetShortFName ( const TCHAR LongName)
static

◆ GetShortFName() [3/3]

FName FPackageName::GetShortFName ( FStringView  LongName)
static

Converts package name to short name.

Parameters
LongNamePackage name to convert.
Returns
Short package name.

◆ GetShortName() [1/4]

FString FPackageName::GetShortName ( const FName LongName)
static

◆ GetShortName() [2/4]

FString FPackageName::GetShortName ( const TCHAR LongName)
static

◆ GetShortName() [3/4]

FString FPackageName::GetShortName ( const UPackage Package)
static

Converts package name to short name.

Parameters
PackagePackage with name to convert.
Returns
Short package name.

◆ GetShortName() [4/4]

FString FPackageName::GetShortName ( FStringView  LongName)
static

Converts package name to short name.

Parameters
LongNamePackage name to convert.
Returns
Short package name.

◆ GetSourcePackagePath()

FString FPackageName::GetSourcePackagePath ( const FString &  InLocalizedPackagePath)
static

Gets the source version of a localized long package path (it is also safe to pass non-localized paths into this function).

Parameters
InLocalizedPackagePathPath to the localized package.
Returns
Source package path.

◆ GetTextAssetPackageExtension()

const FString & FPackageName::GetTextAssetPackageExtension ( )
static

Returns the file extension for packages containing text assets.

Returns
file extension for text asset packages ( dot included )

◆ GetTextMapPackageExtension()

const FString & FPackageName::GetTextMapPackageExtension ( )
static

Returns the file extension for packages containing text maps.

Returns
file extension for text map packages ( dot included )

◆ GetVersePath()

UE::Core::FVersePath FPackageName::GetVersePath ( const FTopLevelAssetPath AssetPath)
static

Gets the versepath of the top level object.

Returns
The VersePath of the top level object

◆ IsAssetPackageExtension()

bool FPackageName::IsAssetPackageExtension ( const TCHAR Ext)
static

Returns whether the passed in extension is a valid binary asset package extension. Extensions with and without trailing dots are supported.

Parameters
Extensionto test.
Returns
True if Ext is a binary asset extension, otherwise false

◆ IsInEngineTransientPackages()

bool FPackageName::IsInEngineTransientPackages ( FStringView  InPackageName)
static

Checks the root of the package's path to see if it is the EngineTransient package in specific, OR one of the packages in the directory of EngineTransient packages.

◆ IsLocalizedPackage()

bool FPackageName::IsLocalizedPackage ( FStringView  InPackageName)
static

Checks the root of the package's path to see if it is a localized package

Returns
true if the root of the path matches any localized root path

◆ IsMapPackageExtension()

bool FPackageName::IsMapPackageExtension ( const TCHAR Ext)
static

Returns whether the passed in extension is a valid binary map package extension. Extensions with and without trailing dots are supported.

Parameters
Extensionto test.
Returns
True if Ext is a binary asset extension, otherwise false

◆ IsMemoryPackage()

bool FPackageName::IsMemoryPackage ( FStringView  InPackageName)
static

Checks the root of the package's path to see if it's a memory package This should be set for packages that reside in memory and not on disk, we treat them similar to a script package

Returns
true if the root of the patch matches the memory path

◆ IsPackageExtension() [1/2]

bool FPackageName::IsPackageExtension ( const TCHAR Ext)
static

Returns whether the passed in extension is a valid binary package extension. Extensions with and without trailing dots are supported.

Parameters
Extensionto test.
Returns
True if Ext is either a binary asset or map extension, otherwise false

◆ IsPackageExtension() [2/2]

bool FPackageName::IsPackageExtension ( EPackageExtension  Extension)
static

Returns whether the passed in extension is a valid binary package extension.

Parameters
Extensionto test.
Returns
True if Ext is either a binary asset or a binary map extension, otherwise false

◆ IsPackageFilename()

static bool FPackageName::IsPackageFilename ( FStringView  Filename)
inlinestatic

Returns whether the passed in filename ends with any of the known package extensions.

Parameters
Filenameto test.
Returns
True if the filename ends with a package extension.

◆ IsScriptPackage()

bool FPackageName::IsScriptPackage ( FStringView  InPackageName)
static

Checks the root of the package's path to see if it is a script package

Returns
true if the root of the path matches the script path

◆ IsShortPackageName() [1/3]

bool FPackageName::IsShortPackageName ( const FName  PossiblyLongName)
static

◆ IsShortPackageName() [2/3]

bool FPackageName::IsShortPackageName ( const FString &  PossiblyLongName)
static

Checks if the string is a ShortPackageName. A ShortPackageName is the leaf name after the last slash in a LongPackageName. Handling ShortPackageNames is useful for console commands and other UI. A ShortPackageName requires a search to convert to a LongPackageName.

Parameters
PossiblyLongNamePackage name.
Returns
true if the given name is a short package name (contains no slashes), false otherwise.

◆ IsShortPackageName() [3/3]

bool FPackageName::IsShortPackageName ( FStringView  PossiblyLongName)
static

◆ IsTempPackage()

bool FPackageName::IsTempPackage ( FStringView  InPackageName)
static

Checks the root of the package's path to see if it is a temp package Temp packages are sometimes saved to disk, and sometimes only exist in memory. They are never in source control

Returns
true if the root of the patch matches the temp path

◆ IsTextAssetPackageExtension()

bool FPackageName::IsTextAssetPackageExtension ( const TCHAR Ext)
static

Returns whether the passed in extension is a valid text asset package extension. Extensions with and without trailing dots are supported.

Parameters
Extensionto test.
Returns
True if Ext is a text asset extension, otherwise false

◆ IsTextMapPackageExtension()

bool FPackageName::IsTextMapPackageExtension ( const TCHAR Ext)
static

Returns whether the passed in extension is a valid text map package extension. Extensions with and without trailing dots are supported.

Parameters
Extensionto test.
Returns
True if Ext is a text map extension, otherwise false

◆ IsTextPackageExtension() [1/2]

bool FPackageName::IsTextPackageExtension ( const TCHAR Ext)
static

Returns whether the passed in extension is a valid text package extension. Extensions with and without trailing dots are supported.

Parameters
Extensionto test.
Returns
True if Ext is either an text asset or a text map extension, otherwise false

◆ IsTextPackageExtension() [2/2]

bool FPackageName::IsTextPackageExtension ( EPackageExtension  Extension)
static

Returns whether the passed in extension is a text header extension

Parameters
Extensionto test.
Returns
True if Ext is either an text asset or a text map extension, otherwise false

◆ IsUnderGeneratedPackageSubPath()

bool FPackageName::IsUnderGeneratedPackageSubPath ( FStringView  FileOrLongPackagePath)
static

Return whether a given packagename or file path is generated based on its name (we evaluate whether it is in a GetGeneratedPackageSubPath directory).

◆ IsValidLongPackageName() [1/2]

bool FPackageName::IsValidLongPackageName ( FStringView  InLongPackageName,
bool  bIncludeReadOnlyRoots,
FText OutReason 
)
static

◆ IsValidLongPackageName() [2/2]

bool FPackageName::IsValidLongPackageName ( FStringView  InLongPackageName,
bool  bIncludeReadOnlyRoots = false,
EErrorCode OutReason = nullptr 
)
static

Returns true if the path starts with a valid root (i.e. /Game/, /Engine/, etc) and contains no illegal characters.

Parameters
InLongPackageNameThe package name to test
bIncludeReadOnlyRootsIf true, will include roots that you should not save to. (/Temp/, /Script/)
OutReasonWhen returning false, this will provide a description of what was wrong with the name.
Returns
true if a valid long package name

◆ IsValidObjectPath()

bool FPackageName::IsValidObjectPath ( FStringView  InObjectPath,
FText OutReason = nullptr 
)
static

Returns true if the path starts with a valid root (i.e. /Game/, /Engine/, etc) and contains no illegal characters. This validates that the packagename is valid, and also makes sure the object after package name is also correct. This will return false if passed a path starting with Classname'

Parameters
InObjectPathThe object path to test
OutReasonWhen returning false, this will provide a description of what was wrong with the name.
Returns
true if a valid object path

◆ IsValidPath()

bool FPackageName::IsValidPath ( FStringView  InPath)
static

Returns true if the path starts with a valid root (i.e. /Game/, /Engine/, /Memory/, etc).

Parameters
InObjectPathThe object path to test
Returns
true if a valid object path

◆ IsValidTextForLongPackageName() [1/2]

bool FPackageName::IsValidTextForLongPackageName ( FStringView  InLongPackageName,
EErrorCode OutReason = nullptr 
)
static

Report whether a given name is the proper format for a PackageName, without checking whether it is in one of the registered mount points

Parameters
InLongPackageNameThe package name to test
OutReasonWhen returning false, this will provide a description of what was wrong with the name.
Returns
true if valid text for a long package name

◆ IsValidTextForLongPackageName() [2/2]

bool FPackageName::IsValidTextForLongPackageName ( FStringView  InLongPackageName,
FText OutReason 
)
static

◆ IsVerseExtension()

bool FPackageName::IsVerseExtension ( const TCHAR Ext)
static

Returns whether the passed in extension is a valid verse extension. Extensions with and without trailing dots are supported.

Parameters
Extensionto test.
Returns
True if Ext is a verse extension, otherwise false

◆ IsVersePackage()

bool FPackageName::IsVersePackage ( FStringView  InPackageName)
static

Checks the package's path to see if it's a Verse package

◆ IteratePackagesInDirectory() [1/2]

void FPackageName::IteratePackagesInDirectory ( const FString &  RootDir,
const FPackageNameStatVisitor Visitor 
)
static

◆ IteratePackagesInDirectory() [2/2]

void FPackageName::IteratePackagesInDirectory ( const FString &  RootDir,
const FPackageNameVisitor Visitor 
)
static

◆ LongPackageNameToFilename()

FString FPackageName::LongPackageNameToFilename ( const FString &  InLongPackageName,
const FString &  InExtension = TEXT("") 
)
static

Converts a long package name to a file name with the supplied extension. Throws a fatal error if the conversion is not successful.

Parameters
InLongPackageNameLong Package Name
InExtensionPackage extension.
Returns
Package filename.

◆ LongPackagePathToVersePath()

UE::Core::FVersePath FPackageName::LongPackagePathToVersePath ( FStringView  LongPackagePath)
static

Gets the Verse path of a long package path. Should not be used with a long package name.

Returns
The Verse path of the long package path

◆ MountPointExists() [1/3]

bool FPackageName::MountPointExists ( const FString &  RootPath)
static

◆ MountPointExists() [2/3]

bool FPackageName::MountPointExists ( const TCHAR RootPath)
static

◆ MountPointExists() [3/3]

bool FPackageName::MountPointExists ( FStringView  RootPath)
static

Returns whether the specific logical root path is a valid mount point.

◆ ObjectPathAppend()

void FPackageName::ObjectPathAppend ( FStringBuilderBase ObjectPath,
FStringView  NextName 
)
static

Combines an ObjectPath with an ObjectName. { "/Package", "Object" } -> "/Package.Object" { "/Package.Object", "SubObject" } -> "/Package.Object:SubObject" { "/Package.Object:SubObject", "NextSubObject" } -> "/Package.Object:SubObject.NextSubObject" { "/Package", "Object.SubObject" } -> "/Package.Object:SubObject" { "/Package", "/OtherPackage.Object:SubObject" } -> "/OtherPackage.Object:SubObject"

◆ ObjectPathCombine()

FString FPackageName::ObjectPathCombine ( FStringView  ObjectPath,
FStringView  NextName 
)
static

Combines an ObjectPath with an ObjectName, the same as ObjectPathAppend but returns the result rather than modifying the input argument.

◆ ObjectPathSplitFirstName() [1/2]

void FPackageName::ObjectPathSplitFirstName ( FAnsiStringView  Text,
FAnsiStringView OutFirst,
FAnsiStringView OutRemainder 
)
static

◆ ObjectPathSplitFirstName() [2/2]

void FPackageName::ObjectPathSplitFirstName ( FWideStringView  Text,
FWideStringView OutFirst,
FWideStringView OutRemainder 
)
static

Splits an ObjectPath string into the first component and the remainder.

"/Path/To/A/Package.Object:SubObject" -> { "/Path/To/A/Package", "Object:SubObject" } "Object:SubObject" -> { "Object", "SubObject" } "Object.SubObject" -> { "Object", "SubObject" }

◆ ObjectPathToObjectName() [1/3]

FString FPackageName::ObjectPathToObjectName ( const FString &  InObjectPath)
static

◆ ObjectPathToObjectName() [2/3]

FAnsiStringView FPackageName::ObjectPathToObjectName ( FAnsiStringView  InObjectPath)
static

◆ ObjectPathToObjectName() [3/3]

FWideStringView FPackageName::ObjectPathToObjectName ( FWideStringView  InObjectPath)
static

Returns the name of the leaf object referred to by the specified object path

Examples: "/Game/MyAsset.MyAsset:SubObject.AnotherObject" -> "AnotherObject" "/Game/MyAsset.MyAsset:SubObject" -> "SubObject" "/Game/MyAsset.MyAsset" -> "MyAsset" "/Game/MyAsset" -> "/Game/MyAsset"

◆ ObjectPathToOuterPath() [1/3]

FString FPackageName::ObjectPathToOuterPath ( const FString &  InObjectPath)
static

◆ ObjectPathToOuterPath() [2/3]

FAnsiStringView FPackageName::ObjectPathToOuterPath ( FAnsiStringView  InObjectPath)
static

◆ ObjectPathToOuterPath() [3/3]

FWideStringView FPackageName::ObjectPathToOuterPath ( FWideStringView  InObjectPath)
static

Returns the path name of the outer of the leaf object referred to by the specified object path

Examples: "/Game/MyAsset.MyAsset:SubObject.AnotherObject" -> "/Game/MyAsset.MyAsset:SubObject" "/Game/MyAsset.MyAsset:SubObject" -> "/Game/MyAsset.MyAsset" "/Game/MyAsset.MyAsset" -> "/Game/MyAsset" "/Game/MyAsset" -> ""

◆ ObjectPathToPackageName() [1/3]

FString FPackageName::ObjectPathToPackageName ( const FString &  InObjectPath)
static

◆ ObjectPathToPackageName() [2/3]

FAnsiStringView FPackageName::ObjectPathToPackageName ( FAnsiStringView  InObjectPath)
static

◆ ObjectPathToPackageName() [3/3]

FWideStringView FPackageName::ObjectPathToPackageName ( FWideStringView  InObjectPath)
static

Returns the name of the package referred to by the specified object path

Examples: "/Game/MyAsset.MyAsset:SubObject.AnotherObject" -> "/Game/MyAsset" "/Game/MyAsset.MyAsset:SubObject" -> "/Game/MyAsset" "/Game/MyAsset.MyAsset" -> "/Game/MyAsset" "/Game/MyAsset" -> "/Game/MyAsset"

◆ ObjectPathToPathWithinPackage() [1/3]

FString FPackageName::ObjectPathToPathWithinPackage ( const FString &  InObjectPath)
static

◆ ObjectPathToPathWithinPackage() [2/3]

FAnsiStringView FPackageName::ObjectPathToPathWithinPackage ( FAnsiStringView  InObjectPath)
static

◆ ObjectPathToPathWithinPackage() [3/3]

FWideStringView FPackageName::ObjectPathToPathWithinPackage ( FWideStringView  InObjectPath)
static

Returns any remaining object path after trimming the package name from the specified object path

Examples: "/Game/MyAsset.MyAsset:SubObject.AnotherObject" -> "MyAsset:SubObject.AnotherObject" "/Game/MyAsset.MyAsset:SubObject" -> "MyAsset:SubObject" "/Game/MyAsset.MyAsset" -> "MyAsset" "/Game/MyAsset" -> ""

◆ ObjectPathToSubObjectPath() [1/3]

FString FPackageName::ObjectPathToSubObjectPath ( const FString &  InObjectPath)
static

◆ ObjectPathToSubObjectPath() [2/3]

FAnsiStringView FPackageName::ObjectPathToSubObjectPath ( FAnsiStringView  InObjectPath)
static

◆ ObjectPathToSubObjectPath() [3/3]

FWideStringView FPackageName::ObjectPathToSubObjectPath ( FWideStringView  InObjectPath)
static

Returns the path from (and including) the subobject referred to by the specified object path

Examples: "/Game/MyAsset.MyAsset:SubObject.AnotherObject" -> "SubObject.AnotherObject" "/Game/MyAsset.MyAsset:SubObject" -> "SubObject" "/Game/MyAsset.MyAsset" -> "MyAsset" "/Game/MyAsset" -> "/Game/MyAsset"

◆ OnContentPathDismounted()

static FOnContentPathDismountedEvent & FPackageName::OnContentPathDismounted ( )
inlinestatic

◆ OnContentPathMounted()

static FOnContentPathMountedEvent & FPackageName::OnContentPathMounted ( )
inlinestatic

◆ OnCoreUObjectInitialized()

void FPackageName::OnCoreUObjectInitialized ( )
static

If the FLongPackagePathsSingleton is not created yet, this function will create it and thus allow mount points to be added

◆ ParseExportTextPath() [1/4]

bool FPackageName::ParseExportTextPath ( const FString &  InExportTextPath,
FString *  OutClassName,
FString *  OutObjectPath 
)
static

◆ ParseExportTextPath() [2/4]

bool FPackageName::ParseExportTextPath ( const TCHAR InExportTextPath,
FStringView OutClassName,
FStringView OutObjectPath 
)
static

◆ ParseExportTextPath() [3/4]

bool FPackageName::ParseExportTextPath ( FAnsiStringView  InExportTextPath,
FAnsiStringView OutClassName,
FAnsiStringView OutObjectPath 
)
static

◆ ParseExportTextPath() [4/4]

bool FPackageName::ParseExportTextPath ( FWideStringView  InExportTextPath,
FWideStringView OutClassName,
FWideStringView OutObjectPath 
)
static

Converts the supplied export text path to an object path and class name.

Parameters
InExportTextPathThe export text path for an object. Takes on the form: ClassName'ObjectPath'
OutClassNameThe name of the class at the start of the path.
OutObjectPathThe path to the object.
Returns
True if the supplied export text path could be parsed

◆ QueryMountPointLocalAbsPaths()

TArray< FString > FPackageName::QueryMountPointLocalAbsPaths ( )
static

Returns all of the local paths on disk of the root content paths, like "c:\MyProjects\ProjectA\Content", "d:\Unreal\Engine\Content", "c:\MyProjects\ProjectA\Plugins\MyPlugin\Content"

◆ QueryRootContentPaths()

void FPackageName::QueryRootContentPaths ( TArray< FString > &  OutRootContentPaths,
bool  bIncludeReadOnlyRoots = false,
bool  bWithoutLeadingSlashes = false,
bool  bWithoutTrailingSlashes = false 
)
static

Queries all of the root content paths, like "/Game/", "/Engine/", and any dynamically added paths

Parameters
OutRootContentPaths[Out] List of content paths
bIncludeReadOnlyRootsInclude read only root content paths such as "/Temp/"
bWithoutLeadingSlashesStrip slash at start of each path to end up with "Game/"
bWithoutTrailingSlashesStrip trailing slash at end of each path to end up with "/Game"

◆ RegisterMountPoint()

void FPackageName::RegisterMountPoint ( const FString &  RootPath,
const FString &  ContentPath 
)
static

This will insert a mount point at the head of the search chain (so it can overlap an existing mount point and win). If you register a mount point (even if you do so only in certain circumstances) consider also adding a handler for GetExplanationForUnavailablePackage to help debug cases where a package can't be found

Parameters
RootPathLogical Root Path.
ContentPathContent Path on disk.

◆ RegisterShortPackageNamesForUObjectModules()

void FPackageName::RegisterShortPackageNamesForUObjectModules ( )
static

Registers all short package names found in ini files.

◆ SearchForPackageOnDisk()

bool FPackageName::SearchForPackageOnDisk ( const FString &  PackageName,
FString *  OutLongPackageName = NULL,
FString *  OutFilename = NULL 
)
static

Attempts to find a package given its short name on disk (very slow).

Parameters
PackageNamePackage to find.
OutLongPackageNameLong package name corresponding to the found file (if any).
Returns
true if the specified package name points to an existing package, false otherwise.

◆ SplitFullObjectPath() [1/4]

void FPackageName::SplitFullObjectPath ( const FString &  InFullObjectPath,
FString &  OutClassName,
FString &  OutPackageName,
FString &  OutObjectName,
FString &  OutSubObjectName,
bool  bDetectClassName = true 
)
static

Split a full object path (Class /Path/To/A/Package.Object:Subobject1.Subobject2) into its constituent pieces

Parameters
InFullObjectPathFull object path we want to split
OutClassNameThe extracted class name (Class)
OutPackageNameThe extracted package name (/Path/To/A/Package)
OutObjectNameThe extracted object name (Object)
OutSubObjectNameThe extracted subobject name (Subobject1.Subobject2) - Note: nested subobjects are not split
bDetectClassNameIf true, the optional Class will be detected and separated based on a space. If false, and there is a space, the space and text before it will be included in the other names. Spaces in those names is invalid, but some code ignores the invalidity in ObjectName if it only cares about packageName.

◆ SplitFullObjectPath() [2/4]

void FPackageName::SplitFullObjectPath ( const FString &  InFullObjectPath,
FString &  OutClassName,
FString &  OutPackageName,
FString &  OutObjectName,
TArray< FString > &  OutSubobjectNames,
bool  bDetectClassName = true 
)
static

Split a full object path (Class /Path/To/A/Package.Object:Subobject1.Subobject2) into its constituent pieces. All subobjects are split individually and stored in an array.

Parameters
InFullObjectPathFull object path we want to split
OutClassNameThe extracted class name (Class)
OutPackageNameThe extracted package name (/Path/To/A/Package)
OutSubobjectNamesThe extracted object name (Object)
OutSubObjectNameThe extracted subobject names (Subobject1 and Subobject2)
bDetectClassNameIf true, the optional Class will be detected and separated based on a space. If false, and there is a space, the space and text before it will be included in the other names. Spaces in those names is invalid, but some code ignores the invalidity in ObjectName if it only cares about packageName.

◆ SplitFullObjectPath() [3/4]

void FPackageName::SplitFullObjectPath ( FStringView  InFullObjectPath,
FStringView OutClassName,
FStringView OutPackageName,
FStringView OutObjectName,
FStringView OutSubObjectName,
bool  bDetectClassName = true 
)
static

◆ SplitFullObjectPath() [4/4]

void FPackageName::SplitFullObjectPath ( FStringView  InFullObjectPath,
FStringView OutClassName,
FStringView OutPackageName,
FStringView OutObjectName,
TArray< FStringView > &  OutSubobjectNames,
bool  bDetectClassName = true 
)
static

◆ SplitLongPackageName()

bool FPackageName::SplitLongPackageName ( const FString &  InLongPackageName,
FString &  OutPackageRoot,
FString &  OutPackagePath,
FString &  OutPackageLeafName,
const bool  bStripRootLeadingSlash = false 
)
static

Test whether a given packagename is in a valid root, and convert it to root, path, and leafname components. If not in a valid root, all output arguments are reset to empty.

Parameters
InLongPackageNamePackage Name, e.g. "/Game/Maps/TestMaps/MyMap". Also supports packagenames with extension (which are not valid package names), e.g. /Game/Maps/TestMaps/MyMap.umap.
OutPackageRootThe package root path, eg "/Game/"
OutPackagePathThe path from the mount point to the package, eg "Maps/TestMaps/ @param OutPackageLeafName The leaf name, including extension if present, eg "MyMap" or "MyMap.umap". @param bStripRootLeadingSlash: If false, OutpackageRoot="/<RootName>/", otherwise "<RootName>/".
Returns
Whether the path is in a valid root.

◆ SplitPackageName() [1/2]

void FPackageName::SplitPackageName ( const FString &  InLongPackageName,
FString *  OutPackageRoot,
FString *  OutPackagePath,
FString *  OutPackageLeafName,
EPathFormatFlags  Flags = EPathFormatFlags::MountPointSlashes 
)
static

◆ SplitPackageName() [2/2]

void FPackageName::SplitPackageName ( FStringView  InPackageName,
FStringView OutPackageRoot,
FStringView OutPackagePath,
FStringView OutPackageLeafName,
EPathFormatFlags  Flags = EPathFormatFlags::MountPointSlashes 
)
static

Convert a long package name into root, path, and leafname components. For the FStringView version, the returned FStringViews are views into the input FStringView.

Parameters
InLongPackageNamePackage Name, e.g. "/Game/Maps/TestMaps/MyMap". Also supports packagenames with extension (which are not valid package names), e.g. /Game/Maps/TestMaps/MyMap.umap.
OutPackageRootThe package root path, eg "/Game/"
OutPackagePathThe path from the mount point to the package, eg "Maps/TestMaps/ @param OutPackageLeafName The leaf name, including extension if present, eg "MyMap" or "MyMap.umap". @param Flags Flags specifying which characters are included in OutputPackageRoot, @see EPathFormatFlags. Edge cases examples: "" -> "","","" "/" -> "", "", "" "/root" -> "", "", "" "/root/" -> "/root/", "", "" "/root/leaf" -> "/root/", "", "leaf" "/root/path/" -> "/root/", "path/", "" "/root/path/leaf" -> "/root/", "path/", "leaf"

◆ SplitPackageNameRoot() [1/2]

FString FPackageName::SplitPackageNameRoot ( FName  InPackageName,
FString *  OutRelativePath,
EPathFormatFlags  Flags = EPathFormatFlags::MountPointNoSlashes 
)
static

◆ SplitPackageNameRoot() [2/2]

FStringView FPackageName::SplitPackageNameRoot ( FStringView  InPackageName,
FStringView OutRelativePath,
EPathFormatFlags  Flags = EPathFormatFlags::MountPointNoSlashes 
)
static

Returns the top level 'directory' in a package name. If the package is part of a plugin, the root will be the name of the associated plugin, otherwise it will be 'Engine' or 'Game'.

Note the slashes are removed by default (EPathFormatFlags::MountPointNoSlashes),

See also
EPathFormatFlags.

Default: "/PackageRoot/Path/Leaf" -> (return "PackageRoot"; OutRelativePath = "Path/Leaf") With EPathFormatFlags::MountPointSlashes: "/PackageRoot/Path/Leaf" -> (return "/PackageRoot/"; OutRelativePath = "Path/Leaf")

◆ TryConvertFilenameToLongPackageName() [1/2]

bool FPackageName::TryConvertFilenameToLongPackageName ( const FString &  InFilename,
FString &  OutPackageName,
FString *  OutFailureReason = nullptr,
const EConvertFlags  Flags = EConvertFlags::None 
)
static

Tries to convert the supplied relative or absolute filename to a long package name/path starting with a root like /game This works on both package names and directories, and it does not validate that it actually exists on disk.

Parameters
InFilenameFilename to convert.
OutPackageNameThe resulting long package name if the conversion was successful.
OutFailureReasonDescription of an error if the conversion failed.
FlagsModifies the behaviour of how filename conversions are applied.
Returns
Returns true if the supplied filename properly maps to one of the long package roots.

◆ TryConvertFilenameToLongPackageName() [2/2]

bool FPackageName::TryConvertFilenameToLongPackageName ( FStringView  InFilename,
FStringBuilderBase OutPackageName,
FStringBuilderBase OutFailureReason = nullptr,
const EConvertFlags  Flags = EConvertFlags::None 
)
static

◆ TryConvertGameRelativePackagePathToLocalPath()

bool FPackageName::TryConvertGameRelativePackagePathToLocalPath ( FStringView  RelativePackagePath,
FString &  OutLocalPath 
)
static

Tries to convert a file or directory in game-relative package name format to the corresponding local path Game-relative package names can be a full package path (/Game/Folder/File, /Engine/Folder/File, /PluginName/Folder/File) or a relative path (Folder/File). Full package paths must be in a mounted directory to be successfully converted.

Parameters
RelativePackagePathThe path in game-relative package format (allowed to have or not have an extension).
OutLocalPathThe corresponding local-path file (with the extension or lack of extension from the input).
Returns
Whether the conversion was successful.

◆ TryConvertLongPackageNameToFilename() [1/2]

bool FPackageName::TryConvertLongPackageNameToFilename ( const FString &  InLongPackageName,
FString &  OutFilename,
const FString &  InExtension = TEXT("") 
)
static

Tries to convert a long package name to a file name with the supplied extension. This can be called on package paths as well, provide no extension in that case

Parameters
InLongPackageNameLong Package Name
InExtensionPackage extension.
Returns
Package filename.

◆ TryConvertLongPackageNameToFilename() [2/2]

bool FPackageName::TryConvertLongPackageNameToFilename ( FStringView  InLongPackageName,
FString &  OutFilename,
FStringView  InExtension = {} 
)
static

◆ TryConvertScriptPackageNameToModuleName()

bool FPackageName::TryConvertScriptPackageNameToModuleName ( FStringView  PackageName,
FStringView OutModuleName 
)
static

If PackageName is a script package (/Script/<ModuleName>), return true and set OutModuleName=<ModuleName>

◆ TryConvertShortPackagePathToLongInObjectPath()

bool FPackageName::TryConvertShortPackagePathToLongInObjectPath ( const FString &  ObjectPath,
FString &  ConvertedObjectPath 
)
static

Tries to convert object path with short package name to object path with long package name found on disk (very slow)

Parameters
ObjectPathPath to the object.
OutLongPackageNameConverted object path.
Returns
True if succeeded. False otherwise.

◆ TryConvertToMountedPath()

bool FPackageName::TryConvertToMountedPath ( FStringView  InPath,
FString *  OutLocalPathNoExtension,
FString *  OutPackageName,
FString *  OutObjectName,
FString *  OutSubObjectName,
FString *  OutExtension,
EFlexNameType OutFlexNameType = nullptr,
EErrorCode OutFailureReason = nullptr 
)
static

Find the MountPoint for a LocalPath, LongPackageName, or ObjectPath and return its elements. Use this function instead of TryConvertFilenameToLongPackageName or TryConvertLongPackageNameToFilename if you need to handle InPaths that might be ObjectPaths.

Parameters
InPathThe LocalPath (with path,name,extension), PackageName, or ObjectPath we want to
OutLocalPathNoExtensionIf non-null, will be set to the LocalPath with path and basename but not extension, or empty string if input was not mounted
OutPackageNameIf non-null, will be set to the LongPackageName, or empty string if input was not mounted
OutObjectNameIf non-null, will be set to the ObjectName, or empty string if the input was a LocalPath or PackageName or was not mounted
OutSubObjectNameIf non-null, will be set to the SubObjectName, or empty string if the input was a LocalPath or PackageName or was not mounted
OutExtensionIf non-null, will be set to the LocalPath's extension, or empty string if the input was not a LocalPath or was not mounted
OutFlexNameTypeIf non-null, will be set to the FlexNameType of InPath.
OutFailureReasonIf non-null, will be set to the reason InPath could not be converted, or to EErrorCode::Unknown if the function was successful.

◆ TryGetMountPointForPath()

bool FPackageName::TryGetMountPointForPath ( FStringView  InFilePathOrPackageName,
FStringBuilderBase OutMountPointPackageName,
FStringBuilderBase OutMountPointFilePath,
FStringBuilderBase OutRelPath,
EFlexNameType OutFlexNameType = nullptr,
EErrorCode OutFailureReason = nullptr 
)
static

Find a mount point that contains the given LocalFilePath or PackageName, and if found, return the MountPoint and RelativePath

Parameters
InFilePathOrPackageNameThe path to test, either a LocalFilePath or a PackageName or an ObjectPath
OutMountPointPackageNameIf the MountPoint is found, the PackageName of the MountPoint is copied into this variable, otherwise it is set to empty string
OutMountPointFilePathIf the MountPoint is found, the LocalFilePath of the MountPoint is copied into this variable, otherwise it is set to empty string
OutRelPathIf the MountPoint is found, the RelativePath from the MountPoint to InFilePathOrPackageName is copied into this variable, otherwise it is set to empty string If InFilePathOrPackageName was a filepath, the extension is removed before copying it into OutRelpath The OutRelPath is the same for both the LocalFilePath and the PackageName
OutFlexNameTypeIf non-null, will be set to whether InFilePathOrPackageName was a PackageName or Filename if the MountPoint is found, otherwise it is set to EFlexNameType::Invalid
OutFailureReasonIf non-null, will be set to the reason InPath could not be converted, or to EErrorCode::Unknown if the function was successful.
Returns
True if the MountPoint was found, else false

◆ UnRegisterMountPoint()

void FPackageName::UnRegisterMountPoint ( const FString &  RootPath,
const FString &  ContentPath 
)
static

This will remove a previously inserted mount point.

Parameters
RootPathLogical Root Path.
ContentPathContent Path on disk.

Friends And Related Symbol Documentation

◆ ::UE::AssetRegistry::Impl::FScanPathContext

◆ FAssetRegistryConsoleCommands

◆ FPackagePath

friend class FPackagePath
friend

◆ UAssetRegistryImpl

friend class UAssetRegistryImpl
friend

The documentation for this class was generated from the following files: