Navigation
API > API/Runtime > API/Runtime/CoreUObject
| Name | FPackageName |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/Misc/PackageName.h |
| Include Path | #include "Misc/PackageName.h" |
Syntax
class FPackageName
Enums
Public
| Name | Remarks |
|---|---|
| EConvertFlags | |
| EErrorCode | |
| EFlexNameType | Indicates the format the input was in in functions that take flexible input that can be a LocalPath, PackageName, or ObjectPath |
| EPackageLocationFilter | |
| EPathFormatFlags | Flags for the output format of path functions. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FDoesPackageExistOverride | TBaseDelegate_OneParam< bool, FName > | Override whether a package exist or not. | Misc/PackageName.h |
| FGetExplanationForUnavailablePackageDelegate | TMulticastDelegate_TwoParams< void, const FName &, FStringBuilderBase & > | Delegate type for allowing higher levels systems to provide additional context for why a package is not available | Misc/PackageName.h |
| FOnContentPathDismountedEvent | TMulticastDelegate_TwoParams< void, const FString &, const FString & > | Event that is triggered when a new content path is removed | Misc/PackageName.h |
| FOnContentPathMountedEvent | TMulticastDelegate_TwoParams< void, const FString &, const FString & > | Event that is triggered when a new content path is mounted | Misc/PackageName.h |
| FPackageNameStatVisitor | TFunctionRef< bool(const TCHAR *, const FFileStatData &)> | Misc/PackageName.h | |
| FPackageNameVisitor | TFunctionRef< bool(const TCHAR *)> | This will recurse over a directory structure looking for packages. | Misc/PackageName.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DoesPackageExistOverrideDelegate | FDoesPackageExistOverride | Delegate used to check whether a package exist without using the filesystem. | Misc/PackageName.h |
| OnContentPathDismountedEvent | FOnContentPathDismountedEvent | Event that is triggered when a new content path is removed | Misc/PackageName.h |
| OnContentPathMountedEvent | FOnContentPathMountedEvent | Event that is triggered when a new content path is mounted | Misc/PackageName.h |
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FString ConvertToLongScriptPackageName
(
const TCHAR* InShortName |
Helper function for converting short to long script package name (InputCore -> /Script/InputCore) | Misc/PackageName.h | |
static bool DoesPackageExist
(
const FString& LongPackageName, |
Checks if the package exists on disk. | Misc/PackageName.h | |
static bool DoesPackageExist
(
const FPackagePath& PackagePath, |
Checks if the package exists on disk. PackagePath must be a mounted path, otherwise returns false | Misc/PackageName.h | |
static bool DoesPackageExist
(
const FString& LongPackageName, |
Checks if the package exists on disk. | Misc/PackageName.h | |
static bool DoesPackageExist
(
const FPackagePath& PackagePath, |
Checks if the package exists on disk. PackagePath must be a mounted path, otherwise returns false | Misc/PackageName.h | |
static EPackageLocationFilter DoesPackageExistEx
(
const FPackagePath& PackagePath, |
Checks if the package exists in IOStore containers, on disk outside of IOStore, both, or neither | Misc/PackageName.h | |
static FDoesPackageExistOverride & DoesPackageExistOverride() |
Misc/PackageName.h | ||
static bool DoesPackageNameContainInvalidCharacters
(
FStringView InLongPackageName, |
Misc/PackageName.h | ||
static bool DoesPackageNameContainInvalidCharacters
(
FStringView InLongPackageName, |
Checks if a package name contains characters that are invalid for package names. | Misc/PackageName.h | |
static FString ExportTextPathToObjectPath
(
const TCHAR* InExportTextPath |
Misc/PackageName.h | ||
static FString ExportTextPathToObjectPath
(
const FString& InExportTextPath |
Misc/PackageName.h | ||
static FWideStringView ExportTextPathToObjectPath
(
FWideStringView InExportTextPath |
Returns the path to the object referred to by the supplied export text path, excluding the class name. | Misc/PackageName.h | |
static FAnsiStringView ExportTextPathToObjectPath
(
FAnsiStringView InExportTextPath |
Misc/PackageName.h | ||
static FString FilenameToLongPackageName
(
const FString& InFilename |
Converts the supplied filename to long package name. | Misc/PackageName.h | |
static bool FindPackageFileWithoutExtension
(
const FString& InPackageFilename, |
Misc/PackageName.h | ||
static bool FindPackageFileWithoutExtension
(
const FString& InPackageFilename, |
Checks if a package can be found using known package extensions (header extensions only; files with the extensions of other segments are not returned). | Misc/PackageName.h | |
static bool FindPackagesInDirectories
(
TArray< FString >& OutPackages, |
This will recurse over the given list of directory structures looking for packages. | Misc/PackageName.h | |
| This will recurse over a directory structure looking for packages. | Misc/PackageName.h | ||
| Finds long script package name associated with a short package name. | Misc/PackageName.h | ||
static bool FixPackageNameCase
(
FString& LongPackageName, |
Converts a long package name to the case it exists as on disk. | Misc/PackageName.h | |
static FString FormatErrorAsString
(
FStringView InPath, |
Return a user-readable string for the error code returned from a FPackageName function | Misc/PackageName.h | |
static FText FormatErrorAsText
(
FStringView InPath, |
Return a user-readable string for the error code returned from a FPackageName function | Misc/PackageName.h | |
static const FString & GetAssetPackageExtension() |
Returns the file extension for packages containing assets. | Misc/PackageName.h | |
static FString GetContentPathForPackageRoot
(
FStringView InPackageRoot |
Get the path associated with the given package root | Misc/PackageName.h | |
static FString GetDelegateResolvedPackagePath
(
const FString& InSourcePackagePath |
Gets the resolved path of a long package as determined by the delegates registered with FCoreDelegates::PackageNameResolvers. | Misc/PackageName.h | |
static void GetExplanationForUnavailablePackage
(
const FName& UnavailablePackageName, |
Attempt to generate an explanation for why a particular package was not available for loading | Misc/PackageName.h | |
static FGetExplanationForUnavailablePackageDelegate & GetExplanationForUnavailablePackageDelegate() |
Accessor for installing callbacks for use with GetExplanationForUnavailablePackage | Misc/PackageName.h | |
static const TCHAR * GetGeneratedPackageSubPath() |
Return the text string used to mark the Generated directory of packages created by CookPackageSplitters. | Misc/PackageName.h | |
static FString GetLocalizedPackagePath
(
const FString& InSourcePackagePath, |
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. | Misc/PackageName.h | |
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. | Misc/PackageName.h | |
| Returns the clean asset name for the specified package, same as GetShortName | Misc/PackageName.h | ||
| Returns the path to the specified package, excluding the short package name e.g. given /Game/Maps/MyMap returns /Game/Maps | Misc/PackageName.h | ||
static const FString & GetMapPackageExtension() |
Returns the file extension for packages containing assets. | Misc/PackageName.h | |
static FString GetModuleScriptPackageName
(
FStringView ModuleName |
Misc/PackageName.h | ||
static FName GetModuleScriptPackageName
(
FName ModuleName |
Return the LongPackageName of module's native script package. | Misc/PackageName.h | |
| Gets normalized object path i.e. with long package format. | Misc/PackageName.h | ||
static FName GetPackageMountPoint
(
const TCHAR* InPackagePath, |
Misc/PackageName.h | ||
static FName GetPackageMountPoint
(
FStringView InPackagePath, |
Get the mount point for a given package path | Misc/PackageName.h | |
static FName GetPackageMountPoint
(
const FString& InPackagePath, |
Misc/PackageName.h | ||
static FName GetShortFName
(
FStringView LongName |
Converts package name to short name. | Misc/PackageName.h | |
static FName GetShortFName
(
const FName& LongName |
Misc/PackageName.h | ||
static FName GetShortFName
(
const TCHAR* LongName |
Misc/PackageName.h | ||
static FString GetShortName
(
const UPackage* Package |
Converts package name to short name. | Misc/PackageName.h | |
static FString GetShortName
(
FStringView LongName |
Converts package name to short name. | Misc/PackageName.h | |
static FString GetShortName
(
const FName& LongName |
Misc/PackageName.h | ||
static FString GetShortName
(
const TCHAR* LongName |
Misc/PackageName.h | ||
| Gets the source version of a localized long package path (it is also safe to pass non-localized paths into this function). | Misc/PackageName.h | ||
static const FString & GetTextAssetPackageExtension() |
Returns the file extension for packages containing text assets. | Misc/PackageName.h | |
static const FString & GetTextMapPackageExtension() |
Returns the file extension for packages containing text maps. | Misc/PackageName.h | |
static UE::Core::FVersePath GetVersePath
(
const FTopLevelAssetPath& AssetPath |
Gets the versepath of the top level object. | Misc/PackageName.h | |
static EPackageLocationFilter InternalDoesPackageExistEx
(
const FPackagePath& PackagePath, |
Misc/PackageName.h | ||
static EPackageLocationFilter InternalDoesPackageExistEx
(
const FString& LongPackageName, |
Misc/PackageName.h | ||
static void InternalFilenameToLongPackageName
(
FStringView InFilename, |
Internal function used to rename filename to long package name. | Misc/PackageName.h | |
static bool IsAssetPackageExtension
(
const TCHAR* Ext |
Returns whether the passed in extension is a valid binary asset package extension. | Misc/PackageName.h | |
static bool IsInEngineTransientPackages
(
FStringView InPackageName |
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. | Misc/PackageName.h | |
static bool IsLocalizedPackage
(
FStringView InPackageName |
Checks the root of the package's path to see if it is a localized package | Misc/PackageName.h | |
static bool IsMapPackageExtension
(
const TCHAR* Ext |
Returns whether the passed in extension is a valid binary map package extension. | Misc/PackageName.h | |
static bool IsMemoryPackage
(
FStringView 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 | Misc/PackageName.h | |
static bool IsPackageExtension
(
EPackageExtension Extension |
Returns whether the passed in extension is a valid binary package extension. | Misc/PackageName.h | |
static bool IsPackageExtension
(
const TCHAR* Ext |
Returns whether the passed in extension is a valid binary package extension. | Misc/PackageName.h | |
static bool IsPackageFilename
(
FStringView Filename |
Returns whether the passed in filename ends with any of the known package extensions. | Misc/PackageName.h | |
static bool IsScriptPackage
(
FStringView InPackageName |
Checks the root of the package's path to see if it is a script package | Misc/PackageName.h | |
static bool IsShortPackageName
(
FStringView PossiblyLongName |
Misc/PackageName.h | ||
static bool IsShortPackageName
(
const FString& PossiblyLongName |
Checks if the string is a ShortPackageName. | Misc/PackageName.h | |
static bool IsShortPackageName
(
const FName PossiblyLongName |
Misc/PackageName.h | ||
static bool IsTempPackage
(
FStringView 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. | Misc/PackageName.h | |
static bool IsTextAssetPackageExtension
(
const TCHAR* Ext |
Returns whether the passed in extension is a valid text asset package extension. | Misc/PackageName.h | |
static bool IsTextMapPackageExtension
(
const TCHAR* Ext |
Returns whether the passed in extension is a valid text map package extension. | Misc/PackageName.h | |
static bool IsTextPackageExtension
(
EPackageExtension Extension |
Returns whether the passed in extension is a text header extension | Misc/PackageName.h | |
static bool IsTextPackageExtension
(
const TCHAR* Ext |
Returns whether the passed in extension is a valid text package extension. | Misc/PackageName.h | |
static bool IsUnderGeneratedPackageSubPath
(
FStringView FileOrLongPackagePath |
Return whether a given packagename or file path is generated based on its name (we evaluate whether it is in a GetGeneratedPackageSubPath directory). | Misc/PackageName.h | |
static bool IsValidLongPackageName
(
FStringView InLongPackageName, |
Misc/PackageName.h | ||
static bool IsValidLongPackageName
(
FStringView InLongPackageName, |
Returns true if the path starts with a valid root (i.e. /Game/, /Engine/, etc) and contains no illegal characters. | Misc/PackageName.h | |
static bool IsValidObjectPath
(
FStringView InObjectPath, |
Returns true if the path starts with a valid root (i.e. /Game/, /Engine/, etc) and contains no illegal characters. | Misc/PackageName.h | |
static bool IsValidPath
(
FStringView InPath |
Returns true if the path starts with a valid root (i.e. /Game/, /Engine/, /Memory/, etc). | Misc/PackageName.h | |
static bool IsValidTextForLongPackageName
(
FStringView InLongPackageName, |
Misc/PackageName.h | ||
static bool IsValidTextForLongPackageName
(
FStringView InLongPackageName, |
Report whether a given name is the proper format for a PackageName, without checking whether it is in one of the registered mount points | Misc/PackageName.h | |
static bool IsVerseExtension
(
const TCHAR* Ext |
Returns whether the passed in extension is a valid verse extension. | Misc/PackageName.h | |
static bool IsVersePackage
(
FStringView InPackageName |
Checks the package's path to see if it's a Verse package | Misc/PackageName.h | |
static void IteratePackagesInDirectory
(
const FString& RootDir, |
Misc/PackageName.h | ||
static void IteratePackagesInDirectory
(
const FString& RootDir, |
Misc/PackageName.h | ||
static FString LongPackageNameToFilename
(
const FString& InLongPackageName, |
Converts a long package name to a file name with the supplied extension. | Misc/PackageName.h | |
static UE::Core::FVersePath LongPackagePathToVersePath
(
FStringView LongPackagePath |
Gets the Verse path of a long package path. Should not be used with a long package name. | Misc/PackageName.h | |
static bool MountPointExists
(
const FString& RootPath |
Misc/PackageName.h | ||
static bool MountPointExists
(
FStringView RootPath |
Returns whether the specific logical root path is a valid mount point. | Misc/PackageName.h | |
static bool MountPointExists
(
const TCHAR* RootPath |
Misc/PackageName.h | ||
static void ObjectPathAppend
(
FStringBuilderBase& ObjectPath, |
Combines an ObjectPath with an ObjectName. | Misc/PackageName.h | |
static FString ObjectPathCombine
(
FStringView ObjectPath, |
Combines an ObjectPath with an ObjectName, the same as ObjectPathAppend but returns the result rather than modifying the input argument. | Misc/PackageName.h | |
static void ObjectPathSplitFirstName
(
FWideStringView Text, |
Splits an ObjectPath string into the first component and the remainder. | Misc/PackageName.h | |
static void ObjectPathSplitFirstName
(
FAnsiStringView Text, |
Misc/PackageName.h | ||
static FAnsiStringView ObjectPathToObjectName
(
FAnsiStringView InObjectPath |
Misc/PackageName.h | ||
static FString ObjectPathToObjectName
(
const FString& InObjectPath |
Misc/PackageName.h | ||
static FWideStringView ObjectPathToObjectName
(
FWideStringView InObjectPath |
Returns the name of the leaf object referred to by the specified object path | Misc/PackageName.h | |
static FString ObjectPathToOuterPath
(
const FString& InObjectPath |
Misc/PackageName.h | ||
static FAnsiStringView ObjectPathToOuterPath
(
FAnsiStringView InObjectPath |
Misc/PackageName.h | ||
static FWideStringView ObjectPathToOuterPath
(
FWideStringView InObjectPath |
Returns the path name of the outer of the leaf object referred to by the specified object path | Misc/PackageName.h | |
static FString ObjectPathToPackageName
(
const FString& InObjectPath |
Misc/PackageName.h | ||
static FAnsiStringView ObjectPathToPackageName
(
FAnsiStringView InObjectPath |
Misc/PackageName.h | ||
static FWideStringView ObjectPathToPackageName
(
FWideStringView InObjectPath |
Returns the name of the package referred to by the specified object path | Misc/PackageName.h | |
static FString ObjectPathToPathWithinPackage
(
const FString& InObjectPath |
Misc/PackageName.h | ||
static FAnsiStringView ObjectPathToPathWithinPackage
(
FAnsiStringView InObjectPath |
Misc/PackageName.h | ||
static FWideStringView ObjectPathToPathWithinPackage
(
FWideStringView InObjectPath |
Returns any remaining object path after trimming the package name from the specified object path | Misc/PackageName.h | |
static FAnsiStringView ObjectPathToSubObjectPath
(
FAnsiStringView InObjectPath |
Misc/PackageName.h | ||
static FString ObjectPathToSubObjectPath
(
const FString& InObjectPath |
Misc/PackageName.h | ||
static FWideStringView ObjectPathToSubObjectPath
(
FWideStringView InObjectPath |
Returns the path from (and including) the subobject referred to by the specified object path | Misc/PackageName.h | |
static FOnContentPathDismountedEvent & OnContentPathDismounted() |
Misc/PackageName.h | ||
static FOnContentPathMountedEvent & OnContentPathMounted() |
Misc/PackageName.h | ||
static void OnCoreUObjectInitialized() |
If the FLongPackagePathsSingleton is not created yet, this function will create it and thus allow mount points to be added | Misc/PackageName.h | |
static bool ParseExportTextPath
(
const TCHAR* InExportTextPath, |
Misc/PackageName.h | ||
static bool ParseExportTextPath
(
const FString& InExportTextPath, |
Misc/PackageName.h | ||
static bool ParseExportTextPath
(
FAnsiStringView InExportTextPath, |
Misc/PackageName.h | ||
static bool ParseExportTextPath
(
FWideStringView InExportTextPath, |
Converts the supplied export text path to an object path and class name. | Misc/PackageName.h | |
| 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" | Misc/PackageName.h | ||
| Queries all of the root content paths, like "/Game/", "/Engine/", and any dynamically added paths | Misc/PackageName.h | ||
static void RegisterMountPoint
(
const FString& RootPath, |
This will insert a mount point at the head of the search chain (so it can overlap an existing mount point and win). | Misc/PackageName.h | |
static void RegisterShortPackageNamesForUObjectModules() |
Registers all short package names found in ini files. | Misc/PackageName.h | |
| Attempts to find a package given its short name on disk (very slow). | Misc/PackageName.h | ||
static void SplitFullObjectPath
(
FStringView InFullObjectPath, |
Misc/PackageName.h | ||
static void SplitFullObjectPath
(
FStringView InFullObjectPath, |
Misc/PackageName.h | ||
| Split a full object path (Class /Path/To/A/Package.Object:Subobject1.Subobject2) into its constituent pieces | Misc/PackageName.h | ||
| Split a full object path (Class /Path/To/A/Package.Object:Subobject1.Subobject2) into its constituent pieces. | Misc/PackageName.h | ||
static bool SplitLongPackageName
(
const FString& InLongPackageName, |
Test whether a given packagename is in a valid root, and convert it to root, path, and leafname components. | Misc/PackageName.h | |
static void SplitPackageName
(
FStringView InPackageName, |
Convert a long package name into root, path, and leafname components. | Misc/PackageName.h | |
static void SplitPackageName
(
const FString& InLongPackageName, |
Misc/PackageName.h | ||
static FStringView SplitPackageNameRoot
(
FStringView InPackageName, |
Returns the top level 'directory' in a package name. | Misc/PackageName.h | |
static FString SplitPackageNameRoot
(
FName InPackageName, |
Misc/PackageName.h | ||
static bool TryConvertFilenameToLongPackageName
(
const FString& InFilename, |
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. | Misc/PackageName.h | |
static bool TryConvertFilenameToLongPackageName
(
FStringView InFilename, |
Misc/PackageName.h | ||
static bool TryConvertGameRelativePackagePathToLocalPath
(
FStringView RelativePackagePath, |
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). | Misc/PackageName.h | |
static bool TryConvertLongPackageNameToFilename
(
FStringView InLongPackageName, |
Misc/PackageName.h | ||
static bool TryConvertLongPackageNameToFilename
(
const FString& InLongPackageName, |
Tries to convert a long package name to a file name with the supplied extension. | Misc/PackageName.h | |
static bool TryConvertScriptPackageNameToModuleName
(
FStringView PackageName, |
If PackageName is a script package (/Script/ |
Misc/PackageName.h | |
| Tries to convert object path with short package name to object path with long package name found on disk (very slow) | Misc/PackageName.h | ||
static bool TryConvertToMountedPackagePath
(
const FString& InPath, |
Internal helper to create a FPackagePath given LocalFilePath or PackageName, and if found, return the MountPoint, RelativePath, and PackageExtension | Misc/PackageName.h | |
static bool TryConvertToMountedPath
(
FStringView InPath, |
Find the MountPoint for a LocalPath, LongPackageName, or ObjectPath and return its elements. | Misc/PackageName.h | |
static bool TryConvertToMountedPathComponents
(
FStringView InPath, |
Internal helper to find a mount point that contains the given LocalFilePath or PackageName, and if found, return the MountPoint, RelativePath, and PackageExtension | Misc/PackageName.h | |
static bool TryGetMountPointForPath
(
FStringView InFilePathOrPackageName, |
Find a mount point that contains the given LocalFilePath or PackageName, and if found, return the MountPoint and RelativePath | Misc/PackageName.h | |
| This will remove a previously inserted mount point. | Misc/PackageName.h |