Language:
Discover
By Skill Level
By Category

FPackageName

Choose your OS:

Syntax

class FPackageName

Functions

Name Description

Public function Static

bool

 

ConvertRootPathToContentPath

(
    const FString & RootPath,
    FString & OutContentPath
)

Public function Static

FString

 

ConvertToLongScriptPackageName

(
    const TCHAR * InShortName
)

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

Public function Static

bool

 

DoesPackageExist

(
    const FString & LongPackageName,
    const FGuid * Guid,
    FString * OutFilename,
    bool InAllowTextFormats
)

Checks if the package exists on disk.

Public function Static

bool

 

DoesPackageNameContainInvalidCharacters

(
    const FString & InLongPackageName,
    FText * OutReason
)

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

Public function Static

void

 

EnsureContentPathsAreRegistered()

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

Public function Static

FString

 

ExportTextPathToObjectPath

(
    const FString & InExportTextPath
)

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

Public function Static

FString

 

FilenameToLongPackageName

(
    const FString & InFilename
)

Converts the supplied filename to long package name.

Public function Static

bool

 

FindPackageFileWithoutExtension

(
    const FString & InPackageFilename,
    FString & OutFilename,
    bool InAllowTextFormats
)

Checks if a package can be found using known package extensions.

Public function Static

bool

 

FindPackagesInDirectory

(
    TArray < FString >& OutPackages,
    const FString & RootDir
)

This will recurse over a directory structure looking for packages.

Public function Static

FName *

 

FindScriptPackageName

(
    FName InShortName
)

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

Public function Static

bool

 

FixPackageNameCase

(
    FString & LongPackageName,
    const FString & Extension
)

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

Public function Static

const FStrin ...

 

GetAssetPackageExtension()

Returns the file extension for packages containing assets.

Public function Static

FString

 

GetDelegateResolvedPackagePath

(
    const FString & InSourcePackagePath
)

Gets the resolved path of a long package as determined by the delegates registered with FCoreDelegates::PackageNameResolvers.

Public function Static

FString

 

GetLocalizedPackagePath

(
    const FString & InSourcePackagePath,
    const FString & InCultureName
)

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.

Public function Static

FString

 

GetLocalizedPackagePath

(
    const FString & InSourcePackagePath
)

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.

Public function Static

FString

 

GetLongPackageAssetName

(
    const FString & InLongPackageName
)

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

Clean asset name.

Public function Static

FString

 

GetLongPackagePath

(
    const FString & InLongPackageName
)

Returns the path to the specified package, excluding the short package name

Public function Static

const FStrin ...

 

GetMapPackageExtension()

Returns the file extension for packages containing assets.

Public function Static

FString

 

GetNormalizedObjectPath

(
    const FString & ObjectPath
)

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

Public function Static

FName

 

GetPackageMountPoint

(
    const FString & InPackagePath
)

Get the mount point for a given package path

Public function Static

FName

 

GetShortFName

(
    const FString & LongName
)

Converts package name to short name.

Short package name.

Public function Static

FName

 

GetShortFName

(
    const FName & LongName
)

Public function Static

FName

 

GetShortFName

(
    const TCHAR * LongName
)

Public function Static

FString

 

GetShortName

(
    const UPackage * Package
)

Converts package name to short name.

Short package name.

Public function Static

FString

 

GetShortName

(
    const FString & LongName
)

Converts package name to short name.

Short package name.

Public function Static

FString

 

GetShortName

(
    const FName & LongName
)

Public function Static

FString

 

GetShortName

(
    const TCHAR * LongName
)

Public function Static

FString

 

GetSourcePackagePath

(
    const FString & InLocalizedPackageP...
)

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

Public function Static

const FStrin ...

 

GetTextAssetPackageExtension()

Returns the file extension for packages containing text assets.

Public function Static

const FStrin ...

 

GetTextMapPackageExtension()

Returns the file extension for packages containing text maps.

Public function Static

bool

 

IsLocalizedPackage

(
    const FString & InPackageName
)

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

Public function Static

bool

 

IsMemoryPackage

(
    const FString & InPackageName
)

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

Public function Static

bool

 

IsPackageExtension

(
    const TCHAR * Ext
)

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

Public function Static

bool

 

IsPackageFilename

(
    const FString & Filename
)

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

Public function Static

bool

 

IsScriptPackage

(
    const FString & InPackageName
)

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

Public function Static

bool

 

IsShortPackageName

(
    const FString & PossiblyLongName
)

Checks if the given string is a long package name or not.

Public function Static

bool

 

IsShortPackageName

(
    const FName PossiblyLongName
)

Public function Static

bool

 

IsTempPackage

(
    const FString & InPackageName
)

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.

Public function Static

bool

 

IsValidLongPackageName

(
    const FString & InLongPackageName,
    bool bIncludeReadOnlyRoots,
    FText * OutReason
)

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

Public function Static

bool

 

IsValidObjectPath

(
    const FString & InObjectPath,
    FText * OutReason
)

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

Public function Static

void

 

IteratePackagesInDirectory

(
    const FString & RootDir,
    const FPackageNameStatVisitor & Vis...
)

Public function Static

void

 

IteratePackagesInDirectory

(
    const FString & RootDir,
    const FPackageNameVisitor & Visitor
)

Public function Static

FString

 

LongPackageNameToFilename

(
    const FString & InLongPackageName,
    const FString & InExtension
)

Converts a long package name to a file name with the supplied extension.

Public function Static

FString

 

ObjectPathToObjectName

(
    const FString & InObjectPath
)

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

Public function Static

FString

 

ObjectPathToPackageName

(
    const FString & InObjectPath
)

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

Public function Static

FOnContentPa ...

 

OnContentPathDismounted()

Public function Static

FOnContentPa ...

 

OnContentPathMounted()

Public function Static

FString

 

PackageFromPath

(
    const TCHAR * InPathName
)

Public function Static

bool

 

ParseExportTextPath

(
    const FString & InExportTextPath,
    FString * OutClassName,
    FString * OutObjectPath
)

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

Public function Static

void

 

QueryRootContentPaths

(
    TArray < FString >& OutRootContentP...
)

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

Public function Static

void

 

RegisterMountPoint

(
    const FString & RootPath,
    const FString & ContentPath
)

This will insert a mount point at the head of the search chain (so it can overlap an existing mount point and win).

Public function Static

void

 

RegisterShortPackageNamesForUObjectModules()

Registers all short package names found in ini files.

Public function Static

bool

 

SearchForPackageOnDisk

(
    const FString & PackageName,
    FString * OutLongPackageName,
    FString * OutFilename
)

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

Public function Static

bool

 

SplitLongPackageName

(
    const FString & InLongPackageName,
    FString & OutPackageRoot,
    FString & OutPackagePath,
    FString & OutPackageName,
    const bool bStripRootLeadingSlash
)

Convert a long package name into root, path, and name components

Public function Static

bool

 

TryConvertFilenameToLongPackageName

(
    const FString & InFilename,
    FString & OutPackageName,
    FString * OutFailureReason
)

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.

Public function Static

bool

 

TryConvertLongPackageNameToFilename

(
    const FString & InLongPackageName,
    FString & OutFilename,
    const FString & InExtension
)

Tries to convert a long package name to a file name with the supplied extension.

Public function Static

bool

 

TryConvertShortPackagePathToLongInObjectPath

(
    const FString & ObjectPath,
    FString & ConvertedObjectPath
)

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

Public function Static

void

 

UnRegisterMountPoint

(
    const FString & RootPath,
    const FString & ContentPath
)

This will remove a previously inserted mount point.

Typedefs

Name

Description

FOnContentPathDismountedEvent

Event that is triggered when a new content path is removed

FOnContentPathMountedEvent

Event that is triggered when a new content path is mounted

FPackageNameStatVisitor

FPackageNameVisitor

This will recurse over a directory structure looking for packages.

Constants

Name

Description

AssetPackageExtension

MapPackageExtension

OnContentPathDismountedEvent

Event that is triggered when a new content path is removed

OnContentPathMountedEvent

Event that is triggered when a new content path is mounted

TextAssetPackageExtension

TextMapPackageExtension

References

Module

CoreUObject

Header

Runtime/CoreUObject/Public/Misc/PackageName.h