FPaths

Path helpers for retrieving game dir, engine dir, etc.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/Paths.h

Include

#include "Misc/Paths.h"

Syntax

class FPaths

Remarks

Path helpers for retrieving game dir, engine dir, etc.

Functions

Name Description

Public function Static

FString

 

AutomationDir()

Returns the directory for automation save files

Public function Static

FString

 

AutomationLogDir()

Returns the directory for automation log files

Public function Static

FString

 

AutomationTransientDir()

Returns the directory for automation save files that are meant to be deleted every run

Public function Static

FString

 

BugItDir()

Returns the directory the engine uses to output BugIt files.

Public function Static

FString

 

ChangeExtension

(
    const FString & InPath,
    const FString & InNewExtension
)

Changes the extension of the given filename (does nothing if the file has no extension)

Public function Static

FString

 

CloudDir()

Returns the directory for local files used in cloud emulation or support

Public function Static

bool

 

CollapseRelativeDirectories

(
    FString & InPath
)

Takes a fully pathed string and eliminates relative pathing (eg: annihilates ".." with the adjacent directory).

Public function Static

FString

 

Combine

(
    PathTypes&&... InPaths
)

Protected function Static

void

 

CombineInternal

(
    FString & OutPath,
    const TCHAR ** Paths,
    int32 NumPaths
)

Public function Static

FString

 

ConvertFromSandboxPath

(
    const FString & InPath,
    const TCHAR * InSandboxName
)

Converts a sandbox (in Saved/Sandboxes) path to a normal path.

Public function Static

FString

 

ConvertRelativePathToFull

(
    const FString & BasePath,
    const FString & InPath
)

Converts a relative path name to a fully qualified name relative to the specified BasePath.

Public function Static

FString

 

ConvertRelativePathToFull

(
    const FString & BasePath,
    FString && InPath
)

Converts a relative path name to a fully qualified name relative to the specified BasePath.

Public function Static

FString

 

ConvertRelativePathToFull

(
    FString && BasePath,
    const FString & InPath
)

Converts a relative path name to a fully qualified name relative to the specified BasePath.

Public function Static

FString

 

ConvertRelativePathToFull

(
    FString && BasePath,
    FString && InPath
)

Converts a relative path name to a fully qualified name relative to the specified BasePath.

Public function Static

FString

 

ConvertRelativePathToFull

(
    FString && InPath
)

Converts a relative path name to a fully qualified name relative to the process BaseDir().

Public function Static

FString

 

ConvertRelativePathToFull

(
    const FString & InPath
)

Converts a relative path name to a fully qualified name relative to the process BaseDir().

Public function Static

FString

 

ConvertToSandboxPath

(
    const FString & InPath,
    const TCHAR * InSandboxName
)

Converts a normal path to a sandbox path (in Saved/Sandboxes).

Public function Static

FString

 

CreateTempFilename

(
    const TCHAR * Path,
    const TCHAR * Prefix,
    const TCHAR * Extension
)

Creates a temporary filename with the specified prefix.

Public function Static

FString

 

DiffDir()

Returns the directory for temp files used for diffing

Public function Static

bool

 

DirectoryExists

(
    const FString & InPath
)

Returns true if this directory was found, false otherwise

Public function Static

FString

 

EngineConfigDir()

Returns the directory the root configuration files are located.

Public function Static

FString

 

EngineContentDir()

Returns the content directory of the "core" engine that can be shared across several games or across games & mods.

Public function Static

FString

 

EngineDefaultLayoutDir()

Returns the directory for default Editor UI Layout files of the engine

Public function Static

FString

 

EngineDir()

Returns the base directory of the "core" engine that can be shared across several games or across games & mods.

Public function Static

FString

 

EngineEditorSettingsDir()

Returns the Editor Settings directory of the engine

Public function Static

FString

 

EngineIntermediateDir()

Returns the intermediate directory of the engine

Public function Static

FString

 

EnginePlatformExtensionsDir()

Returns the directory where engine platform extensions reside

Public function Static

FString

 

EnginePluginsDir()

Returns the plugins directory of the engine

Public function Static

FString

 

EngineSavedDir()

Returns the saved directory of the engine

Public function Static

FString

 

EngineSourceDir()

Returns the directory where engine source code files are kept

Public function Static

FString

 

EngineUserDir()

Returns the root directory for user-specific engine files. Always writable.

Public function Static

FString

 

EngineUserLayoutDir()

Returns the directory for user-generated Editor UI Layout files of the engine

Public function Static

FString

 

EngineVersionAgnosticUserDir()

Returns the root directory for user-specific engine files which can be shared between versions.

Public function Static

FString

 

EnterpriseDir()

Returns the base directory enterprise directory.

Public function Static

FString

 

EnterpriseFeaturePackDir()

Returns the enterprise FeaturePack directory

Public function Static

FString

 

EnterprisePluginsDir()

Returns the enterprise plugins directory

Public function Static

FString

 

FeaturePackDir()

Returns the directory where feature packs are kept

Public function Static

bool

 

FileExists

(
    const FString & InPath
)

Returns true if this file was found, false otherwise

Public function Static

FString

 

GameAgnosticSavedDir()

Returns the saved directory that is not game specific.

Public function Static

FString

 

GameDevelopersDir()

Returns the directory that contains subfolders for developer-specific content

Public function Static

FString

 

GameSourceDir()

Returns the directory where game source code files are kept

Public function Static

FString

 

GameUserDeveloperDir()

Returns The directory that contains developer-specific content for the current user

Public function Static

FString

 

GameUserDeveloperFolderName()

Returns The folder name for the developer-specific directory for the current user

Public function Static

FString

 

GeneratedConfigDir()

Returns the directory the engine saves generated config files.

Public function Static

FString

 

GetBaseFilename

(
    FString && InPath,
    bool bRemovePath
)

Returns the same thing as GetCleanFilename, but without the extension.

Public function Static

FString

 

GetBaseFilename

(
    const FString & InPath,
    bool bRemovePath
)

Returns the same thing as GetCleanFilename, but without the extension.

Public function Static

FString

 

GetCleanFilename

(
    FString && InPath
)

Returns the filename (with extension), minus any path information.

Public function Static

FString

 

GetCleanFilename

(
    const FString & InPath
)

Returns the filename (with extension), minus any path information.

Public function Static

const TArray ...

 

GetEditorLocalizationPaths()

Returns a list of editor-specific localization paths

Public function Static

const TArray ...

 

GetEngineLocalizationPaths()

Returns a list of engine-specific localization paths

Public function Static

FString

 

GetExtension

(
    const FString & InPath,
    bool bIncludeDot
)

Gets the extension for this filename.

Public function Static

const TArray ...

 

GetGameLocalizationPaths()

Returns a list of game-specific localization paths

Public function Static

FString

 

GetInvalidFileSystemChars()

Returns a string containing all invalid characters as dictated by the operating system

Public function Static

FString

 

GetPath

(
    FString && InPath
)

Returns the path in front of the filename.

Public function Static

FString

 

GetPath

(
    const FString & InPath
)

Returns the path in front of the filename.

Public function Static

FString

 

GetPathLeaf

(
    FString && InPath
)

Returns the leaf in the path.

Public function Static

FString

 

GetPathLeaf

(
    const FString & InPath
)

Returns the leaf in the path.

Public function Static

FString

 

GetPlatformLocalizationFolderName()

Get the name of the platform-specific localization sub-folder

Public function Static

FString

 

GetProjectFilePath()

Gets the path to the project file.

Public function Static

const TArray ...

 

GetPropertyNameLocalizationPaths()

Returns a list of property name localization paths

Public function Static

const FStrin ...

 

GetRelativePathToRoot()

Gets the relative path to get from BaseDir to RootDirectory

Public function Static

const TArray ...

 

GetRestrictedFolderNames()

Returns a list of restricted/internal folder names (without any slashes) which may be tested against full paths to determine if a path is restricted or not.

Public function Static

const TArray ...

 

GetToolTipLocalizationPaths()

Returns a list of tool tip localization paths

Public function Static

bool

 

HasProjectPersistentDownloadDir()

Returns true if a writable directory for downloaded data that persists across play sessions is available

Public function Static

bool

 

IsDrive

(
    const FString & InPath
)

Returns true if this path represents a root drive or volume

Public function Static

bool

 

IsProjectFilePathSet()

Checks whether the path to the project file, if any, is set.

Public function Static

bool

 

IsRelative

(
    const FString & InPath
)

Returns true if this path is relative to another path

Public function Static

bool

 

IsRestrictedPath

(
    const FString & InPath
)

Determines if supplied path uses a restricted/internal subdirectory.

Public function Static

bool

 

IsSamePath

(
    const FString & PathA,
    const FString & PathB
)

Checks if two paths are the same.

Public function Static

bool

 

IsUnderDirectory

(
    const FString & InPath,
    const FString & InDirectory
)

Determines if a path is under a given directory

Public function Static

FString

 

LaunchDir()

Returns the directory the application was launched from (useful for commandline utilities)

Public function Static

bool

 

MakePathRelativeTo

(
    FString & InPath,
    const TCHAR * InRelativeTo
)

Assuming both paths (or filenames) are relative to the same base dir, modifies InPath to be relative to InRelativeTo

Public function Static

void

 

MakePlatformFilename

(
    FString & InPath
)

Takes an "Unreal" pathname and converts it to a platform filename.

Public function Static

void

 

MakeStandardFilename

(
    FString & InPath
)

Make fully standard "Unreal" pathname:

Public function Static

FString

 

MakeValidFileName

(
    const FString & InString,
    const TCHAR InReplacementChar
)

Returns a string that is safe to use as a filename because all items in GetInvalidFileSystemChars() are removed

Public function Static

void

 

NormalizeDirectoryName

(
    FString & InPath
)

Normalize all / and \ to TEXT("/") and remove any trailing TEXT("/") if the character before that is not a TEXT("/") or a colon

Public function Static

void

 

NormalizeFilename

(
    FString & InPath
)

Convert all / and \ to TEXT("/")

Public function Static

FString

 

ProfilingDir()

Returns the directory the engine uses to output profiling files.

Public function Static

FString

 

ProjectConfigDir()

Returns the directory the root configuration files are located.

Public function Static

FString

 

ProjectContentDir()

Returns the content directory of the current game by looking at FApp::GetProjectName() .

Public function Static

FString

 

ProjectDir()

Returns the base directory of the current project by looking at FApp::GetProjectName() .

Public function Static

FString

 

ProjectIntermediateDir()

Returns the intermediate directory of the current game by looking at FApp::GetProjectName() .

Public function Static

FString

 

ProjectLogDir()

Returns the directory the engine uses to output logs.

Public function Static

FString

 

ProjectModsDir()

Returns the mods directory of the current project by looking at FApp::GetProjectName() .

Public function Static

FString

 

ProjectPersistentDownloadDir()

Returns the writable directory for downloaded data that persists across play sessions.

Public function Static

FString

 

ProjectPlatformExtensionsDir()

Returns the directory where the project's platform extensions reside

Public function Static

FString

 

ProjectPluginsDir()

Returns the plugins directory of the current game by looking at FApp::GetProjectName() .

Public function Static

const FStrin ...

 

ProjectSavedDir()

Returns the saved directory of the current game by looking at FApp::GetProjectName() .

Public function Static

FString

 

ProjectUserDir()

Returns the root directory for user-specific game files.

Public function Static

void

 

RemoveDuplicateSlashes

(
    FString & InPath
)

Removes duplicate slashes in paths.

Public function Static

FString

 

RootDir()

Returns the root directory of the engine directory tree

Public function Static

FString

 

SandboxesDir()

Returns the directory the engine stores sandbox output

Public function Static

FString

 

ScreenShotDir()

Returns the directory the engine uses to output screenshot files.

Public function Static

FString

 

SetExtension

(
    const FString & InPath,
    const FString & InNewExtension
)

Sets the extension of the given filename (like ChangeExtension, but also applies the extension if the file doesn't have one)

Public function Static

void

 

SetProjectFilePath

(
    const FString & NewGameProjectFileP...
)

Sets the path to the project file.

Public function Static

FString

 

ShaderWorkingDir()

Public function Static

bool

 

ShouldSaveToUserDir()

Should the "saved" directory structures be rooted in the user dir or relative to the "engine/game"

Public function Static

FString

 

SourceConfigDir()

Returns the directory the engine uses to look for the source leaf ini files.

Public function Static

void

 

Split

(
    const FString & InPath,
    FString & PathPart,
    FString & FilenamePart,
    FString & ExtensionPart
)

Parses a fully qualified or relative filename into its components (filename, path, extension).

Public function Static

void

 

TearDown()

Frees any memory retained by FPaths .

Public function Static

bool

 

ValidatePath

(
    const FString & InPath,
    FText * OutReason
)

Validates that the parts that make up the path contain no invalid characters as dictated by the operating system Note that this is a different set of restrictions to those imposed by FPackageName

Public function Static

FString

 

VideoCaptureDir()

Returns the directory the engine uses to output user requested video capture files.

Classes

Name

Description

Public struct

FStaticData

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback