![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <PackagePath.h>
Friends | |
| COREUOBJECT_API FArchive & | operator<< (FArchive &Ar, FPackagePath &PackagePath) |
Internal class only; not used by blueprints. This class is only used in the CoreUObject linker layer and (optionally) as an argument to LoadPackage
Specifies a path to the contents of a UPackage that can be loaded from disk (or other persistent storage) through IPackageResourceManager Package contents are requested from the PackageResourceManager by FPackagePath and EPackageSegment FPackagePaths are stored internally in one of a few options necessary to maintain their construction arguments without losing data const FPackagePaths can still be mutated to be stored as another internal type const FPackagePaths can still be mutated to indicate which header extension was found for them on disk (It is illegal to have multiple packages on disk with the same PackagePath but different header extensions)
|
constexprdefault |
Construct an empty PackagePath
| FPackagePath::FPackagePath | ( | const FPackagePath & | Other | ) |
|
default |
| COREUOBJECT_API void FPackagePath::AppendLocalBaseFilenameWithPath | ( | FStringBuilderBase & | Builder | ) | const |
Append the Local (path,basename) of this PackagePath if known or available, or take no action if not
Appending is possible only for MountedPath and LocalOnly internal types. Will attempt to mount before returning with no action
| COREUOBJECT_API void FPackagePath::AppendLocalFullPath | ( | FStringBuilderBase & | Builder | ) | const |
Append the full relative LocalPath (path,basename,extension)
The path is in the standard UnrealEngine form - it is as a relative path from the process binary directory Extension is set based on the given segment If the LocalPath for this PackagePath is unknown, nothing is written to the Builder Appending is possible only for MountedPath and LocalOnly internal types. Will attempt to mount before returning with no action
| COREUOBJECT_API void FPackagePath::AppendLocalFullPath | ( | FStringBuilderBase & | Builder, |
| EPackageSegment | PackageSegment | ||
| ) | const |
Version of AppendLocalFullPath that takes a PackageSegment, otherwise same behavior as parameterless version
| void FPackagePath::AppendPackageName | ( | FStringBuilderBase & | Builder | ) | const |
Append the PackageName indicated by this PackagePath if known or available, or take no action if not
Appending is possible only for MountedPath and PackageOnly internal types. Will attempt to mount before returning with no action
| void FPackagePath::Empty | ( | ) |
Free this PackagePath's data and set it to an empty PackagePath
|
static |
Construct a PackagePath from a LocalPath string
Does not handle InFilenames that are actually PackageNames; use TryFromMountedName if you need to handle either PackageName or LocalPath Will be converted to a MountedPath when the PackageName is required; if the package is not mounted at that point the PackageName will be empty. Always succeeds; all strings are valid filenames
| InFilename | The full LocalPath, D:\Folder\File.Ext, may be relative or absolute, extension is not required |
|
static |
Version of FromLocalPath that also returns the PackageSegment matching the Filename's extension
|
static |
Construct a PackagePath from the components of a MountedPath
This function is less expensive than TryFromMountedName It is invalid to call this function with arguments that do not match an existing directory that is mounted (aka registered with FPackageName::MountPointExists)
| PackageNameRoot | The PackageName of the MountPoint |
| FilePathRoot | The FilePath of the MountPoint |
| RelPath | The relative path of the PackagePath from the PackageNameRoot/FilePathRoot (relative path from MountPoint is the same in PackageNames and LocalPaths) |
| InExtension | The header extension to give the PackagePath. Extensions that are not header extensions are ignored |
| InCustomExtension | The custom string to use if InExtension is EPackageExtension::Custom |
|
static |
|
static |
|
static |
Construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*
Does not handle InPackageNames that are actually LocalPaths; use TryFromMountedName if you need to handle either PackageName or LocalPath Gives an error and returns an empty PackagePath if InPackageName is not a valid LongPackageName (/Root/Folder/File) Will be converted to a MountedPath when the LocalPath is required; if the package is not mounted at that point the LocalPath will be empty
| InPackageName | A valid LongPackageName, does not have to be mounted or existing |
|
static |
Construct a PackagePath from a known valid LongPackageName FName
Will be converted to a MountedPath when the LocalPath is required; if the package is not mounted at that point the LocalPath will be empty
| InPackageName | A valid LongPackageName, does not have to be mounted or existing |
| FStringView FPackagePath::GetCustomExtension | ( | ) | const |
Return the custom string if this PackagePath is using HeaderExtension=EPackageExtension::Custom, otherwise return an empty string
| FString FPackagePath::GetDebugName | ( | ) | const |
Returns a descriptor of this PackagePath, usable for an identifier in warning and log messages. Extension is not indicated.
| FString FPackagePath::GetDebugName | ( | EPackageSegment | PackageSegment | ) | const |
Version of GetDebugName that takes a PackageSegment, otherwise same behavior as parameterless version For EPackageSegment::Header, HeaderExtension is not indicated. For all other segments, segment is identified by extension
| FText FPackagePath::GetDebugNameText | ( | EPackageSegment | PackageSegment | ) | const |
Version of GetDebugNameText that takes a PackageSegment, otherwise same behavior as parameterless version
| FString FPackagePath::GetDebugNameWithExtension | ( | ) | const |
Returns a descriptor of this PackagePath for the given segment, with extension.
| FString FPackagePath::GetDebugNameWithExtension | ( | EPackageSegment | PackageSegment | ) | const |
Version of GetDebugNameWithExtension that takes a PackageSegment, otherwise same behavior as parameterless version
| EPackageExtension FPackagePath::GetExtension | ( | EPackageSegment | PackageSegment, |
| FStringView & | OutCustomExtension | ||
| ) | const |
Report the extension this PackagePath uses for the given segment
| PackageSegment | The segment of the extension to look up |
| OutCustomExtension | If the segment is EPackageSegment::Header and this PackagePath has a custom header extension, filled with the Custom string, otherwise set to empty. CustomExtension can become invalid the next time a function (even a const function) or the destructor is called on this FPackagePath |
| FStringView FPackagePath::GetExtensionString | ( | EPackageSegment | PackageSegment | ) | const |
Report the extension string this PackagePath uses for the given segment.
| PackageSegment | The segment of the extension to look up |
|
static |
Get the folder name from which all external actors paths are created
|
static |
Get the folder name from which all external objects paths are created
| EPackageExtension FPackagePath::GetHeaderExtension | ( | ) | const |
Return the HeaderExtension
The header extension is the extension the header segment of this PackagePath has on disk. It is illegal to have multiple files on disk with the same BaseNameWithPath but different header extensions, so the header extension is optional. If unspecified, all header extensions will be searched. If specified, it is assumed correct and searches will return false if they have a different header extension. The header extension is a performance hint and matching header extensions is not required for equality. The header extension will be mutated even on const FPackagePaths when it is not already set and functions are called that need to calculate it
| FString FPackagePath::GetLocalBaseFilenameWithPath | ( | ) | const |
Return the Local (path,basename) of this PackagePath if known or available, or empty string if not
Returning non-empty is possible only for MountedPath and LocalOnly internal types. Will attempt to mount before returning empty
| FString FPackagePath::GetLocalFullPath | ( | ) | const |
Return the full LocalPath (path,basename,extension)
The path is in the standard UnrealEngine form - it is as a relative path from the process binary directory Extension is set based on the given segment If the LocalPath for this PackagePath is unknown, returns the empty string Returning non-empty is possible only for MountedPath and LocalOnly internal types. Will attempt to mount before returning empty
| FString FPackagePath::GetLocalFullPath | ( | EPackageSegment | PackageSegment | ) | const |
Version of GetLocalFullPath that takes a PackageSegment, otherwise same behavior as parameterless version
|
static |
Get the string identifying optional segments
| FName FPackagePath::GetPackageFName | ( | ) | const |
Return as an FName the PackageName indicated by this PackagePath if known or available, or NAME_None if not
Returning a valid name is possible only for MountedPath and PackageOnly internal types. Will attempt to mount before returning NAME_None
| FString FPackagePath::GetPackageName | ( | ) | const |
Return the PackageName indicated by this PackagePath if known or available, or empty string if not
Returning non-empty is possible only for MountedPath and PackageOnly internal types. Will attempt to mount before returning empty
| FString FPackagePath::GetPackageNameOrFallback | ( | ) | const |
Returns the PackageName if available, otherwise the LocalPath
Do not use this function as a PackageName; use it only for uniquely identifying PackagePaths in e.g. a TMap
| TConstArrayView< EPackageExtension > FPackagePath::GetPossibleExtensions | ( | EPackageSegment | PackageSegment | ) | const |
Report the EPackageExtensions this PackagePath should look for on disk
The reported array will be length 1 for every case except EPackageSegment::Header and HeaderExtension == EPackageExtension::Unspecified, in that case it will be the list of all enumerated header extensions
| PackageSegment | The segment of the extension to look up |
| COREUOBJECT_API bool FPackagePath::HasLocalPath | ( | ) | const |
Return true if and only if GetLocalBaseFilenameWithPath returns non-empty
Returning true is possible for MountedPath and LocalOnly internal types. Will attempt to mount before returning false
| COREUOBJECT_API bool FPackagePath::HasPackageName | ( | ) | const |
Return true if and only if GetPackageName returns non-empty
Returning true is possible only for MountedPath and PackageOnly internal types. Will attempt to mount before returning false
| bool FPackagePath::IsEmpty | ( | ) | const |
Return whether this is a PackagePath with no path information and can never identify a package on disk
Note that IsEmpty == false does not imply that the package exists on disk, only that the PackagePath is valid
| bool FPackagePath::IsMountedPath | ( | ) | const |
Return whether a mount point has been found for this PackagePath
Will attempt to mount before returning false
| bool FPackagePath::operator!= | ( | const FPackagePath & | Other | ) | const |
| FPackagePath & FPackagePath::operator= | ( | const FPackagePath & | Other | ) |
|
default |
| bool FPackagePath::operator== | ( | const FPackagePath & | Other | ) | const |
|
static |
Parse the extension from a filepath and convert it to an EPackageExtension.
Note this is not the same as FPaths::GetExtension because some EPackageExtensions have multiple '.'s (e.g. .m.ubulk)
| Filename | The path to parse the extension from |
| OutExtensionStart | If non-null, will be filled with the index of the '.' at the start of the extension, or with Filename.Len() if no extension is found |
| void FPackagePath::SetHeaderExtension | ( | EPackageExtension | Extension, |
| FStringView | CustomExtension = FStringView() |
||
| ) | const |
Set the HeaderExtension to use, including a custom string if Extension is EPackageExtension::Custom
|
static |
Construct a PackagePath from a LocalPath or PackageName string, assuming the given LocalPath or PackageName is in a directory that is mounted (aka registered with FPackageName::MountPointExists)
| InPackageNameOrHeaderFilePath | A string that describes either the PackageName or LocalPath of a PackagePath |
| OutPackagePath | If the function succeeds, the created PackagePath is assigned to this variable. Otherwise this variable is not written |
|
static |
|
static |
|
static |
Attempt to construct a PackagePath from a LongPackageName StringView, FName, or TCHAR*
Does not handle InPackageNames that are actually LocalPaths; use TryFromMountedName if you need to handle either PackageName or LocalPath Fails and returns false if and only if InPackageName is not a valid LongPackageName (/Root/Folder/File) Will be converted to a MountedPath when the LocalPath is required; if the package is not mounted at that point the LocalPath will be empty
| InPackageName | The LongPackageName to test, does not have to be mounted or existing |
| OutPackagePath | If InPackageName is valid, the constructed PackagePath is copied into this variable, otherwise the variable is not written |
|
static |
Set the capitalization of a PackagePath to match the given string
If the given FilePathToMatch is case-insensitively equal to the LocalPath of the source PackagePath, set the output PackagePath equal to a copy of the source but with capitalization set equal to the capitalization in FilePathToMatch
| SourcePackagePath | The PackagePath to compare against FilePathToMatch |
| FilePathToMatch | The LocalPath to compare against SourcePackagePath's LocalPath |
| OutPackagePath | Set to the matching-capitalization copy of SourcePackagePath if FilePathToMatch matched SourcePackagePath case-insensitively |
|
friend |
Serialization operator. It is invalid to serialize a PackagePath to persistent data; package path serialization is dependent upon transient data and may change between process invocations