FEditorFileUtils

For saving map files through the main editor frame.

Windows
MacOS
Linux

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Public/FileHelpers.h

Include

#include "FileHelpers.h"

Syntax

class FEditorFileUtils

Remarks

For saving map files through the main editor frame.

Functions

Name Description

Public function Static

bool

 

AttemptUnloadInactiveWorldPackage

(
    UPackage* PackageToUnload,
    FText& OutErrorMessage
)

Unloads the specified package potentially containing an inactive world.

Public function Static

bool

 

AutosaveContentPackages

(
    const FString& AbsoluteAutosaveDir,
    const int32 AutosaveIndex,
    const bool bForceIfNotInList,
    const TSet< TWeakObjectPtr< UPackag...
)

Saves all asset packages to the specified directory.

Public function Static

EAutosaveCon...

 

AutosaveContentPackagesEx

(
    const FString& AbsoluteAutosaveDir,
    const int32 AutosaveIndex,
    const bool bForceIfNotInList,
    const TSet< TWeakObjectPtr< UPackag...
)

Saves all asset packages to the specified directory.

Public function Static

bool

 

AutosaveMap

(
    const FString& AbsoluteAutosaveDir,
    const int32 AutosaveIndex,
    const bool bForceIfNotInList,
    const TSet< TWeakObjectPtr< UPackag...
)

Saves all levels to the specified directory.

Public function Static

EAutosaveCon...

 

AutosaveMapEx

(
    const FString& AbsoluteAutosaveDir,
    const int32 AutosaveIndex,
    const bool bForceIfNotInList,
    const TSet< TWeakObjectPtr< UPackag...
)

Saves all levels to the specified directory.

Public function Static

ECommandResu...

 

CheckoutPackages

(
    const TArray< FString >& PkgsToChe...,
    TArray< FString >* OutPackages...,
    const bool bErrorIfAlreadyCheckedOu...
)

Check out the specified packages from source control and report any errors while checking out

Public function Static

ECommandResu...

 

CheckoutPackages

(
    const TArray< UPackage* >& Pk...,
    TArray< UPackage* >* OutP...,
    const bool bErrorIfAlreadyCheckedOu...
)

Check out the specified packages from source control and report any errors while checking out

Public function Static

void

 

Export

(
    bool bExportSelectedActorsOnly
)

Public function Static

FString

 

ExtractPackageName

(
    const FString& ObjectPath
)

Helper function used to extract the package name from the object path

Public function Static

void

 

FindAllConfigFiles

(
    TArray< FString >& OutConfigFiles
)

Looks for config files for the current project.

Public function Static

void

 

FindAllPackageFiles

(
    TArray< FString >& OutPackages
)

Looks for package files in the known content paths on disk.

Public function Static

void

 

FindAllSubmittableConfigFiles

Looks for source control submittable config files for the current project.

Public function Static

void

 

FindAllSubmittablePackageFiles

(
    TMap< FString, FSourceControlStateP...,
    const bool bIncludeMaps
)

Looks for source control submittable files in the known content paths on disk.

Public function Static

void

 

GetDirtyContentPackages

(
    TArray< UPackage* >& OutDirty...
)

Appends array with all currently dirty content packages.

Public function Static

void

 

GetDirtyWorldPackages

(
    TArray< UPackage* >& OutDirty...
)

Appends array with all currently dirty world packages.

Public function Static

FString

 

GetFilename

(
    const FName& PackageName
)

Public function Static

FString

 

GetFilename

(
    UObject* LevelObject
)

Public function Static

FString

 

GetFilterString

(
    EFileInteraction Interaction
)

Returns a file filter string appropriate for a specific file interaction.

Public function Static

void

 

Import()

Presents the user with a file dialog for importing.

Public function Static

void

 

Import

(
    const FString& InFilename
)

Presents the user with a file dialog for importing.

Public function Static

bool

 

IsLoadingStartupMap()

Whether or not we're in the middle of loading the simple startup map

Public function Static

bool

 

IsMapPackageAsset

(
    const FString& ObjectPath,
    FString& MapFilePath
)

Helper function used to decide whether a package name is a map package or not.

Public function Static

bool

 

IsMapPackageAsset

(
    const FString& ObjectPath
)

Helper function used to decide whether a package name is a map package or not.

Public function Static

bool

 

IsValidMapFilename

(
    const FString& MapFilename,
    FText& OutErrorMessage
)

Returns true if the specified map filename is valid for loading or saving.

Public function Static

void

 

LoadDefaultMapAtStartup()

Loads a simple example map

Public function Static

bool

 

LoadMap()

Prompts the user to save the current map if necessary, the presents a load dialog and loads a new map if selected by the user.

Public function Static

bool

 

LoadMap

(
    const FString& Filename,
    bool LoadAsTemplate,
    const bool bShowProgress
)

Loads the specified map.

Public function Static

void

 

OpenLevelPickingDialog

(
    const FOnLevelsChosen& OnLevelsCho...,
    const FOnLevelPickingCancelled& On...,
    bool bAllowMultipleSelection
)

Opens a non-modal dialog to allow the user to choose a level

Public function Static

EPromptRetur...

 

PromptForCheckoutAndSave

(
    const TArray< UPackage* >& Pa...,
    bool bCheckDirty,
    bool bPromptToSave,
    TArray< UPackage* >* OutF...,
    bool bAlreadyCheckedOut,
    bool bCanBeDeclined
)

Optionally prompts the user for which of the provided packages should be saved, and then additionally prompts the user to check-out any of the provided packages which are under source control.

Public function Static

bool

 

PromptToCheckoutLevels

(
    bool bCheckDirty,
    const TArray< ULevel* >& Spec...,
    TArray< UPackage* >* OutP...
)

Prompt the user with a check-box dialog allowing him/her to check out relevant level packages from source control

Public function Static

bool

 

PromptToCheckoutLevels

(
    bool bCheckDirty,
    ULevel* SpecificLevelToCheckOu...
)

Overloaded version of PromptToCheckOutLevels which prompts the user with a check-box dialog allowing him/her to check out the relevant level package if necessary

Public function Static

bool

 

PromptToCheckoutPackages

(
    bool bCheckDirty,
    const TArray< UPackage* >& Pa...,
    TArray< UPackage* >* OutP...,
    TArray< UPackage* >* OutP...,
    const bool bPromptingAfterModify
)

Prompt the user with a check-box dialog allowing him/her to check out the provided packages from source control, if desired

Public function Static

void

 

RegisterLevelFilename

(
    UObject* Object,
    const FString& NewLevelFilename
)

Sets the active level filename so that "Save" operates on this file and "SaveAs" must be used on others

Public function Static

void

 

ResetLevelFilenames()

Clears current level filename so that the user must SaveAs on next Save.

Public function Static

void

 

SaveAssetsAs

(
    const TArray< UObject* >& Ass...,
    TArray< UObject* >& OutSavedA...
)

Does a SaveAs for the specified assets.

Public function Static

bool

 

SaveCurrentLevel()

Saves the active level, prompting the use for checkout if necessary.

Public function Static

bool

 

SaveDirtyContentPackages

(
    TArray< UClass* >& SaveConten...,
    const bool bPromptUserToSave,
    const bool bFastSave,
    const bool bNotifyNoPackagesSaved,
    const bool bCanBeDeclined
)

Looks at all currently loaded packages and saves them if their "bDirty" flag is set and they include specified clasees, optionally prompting the user to select which packages to save)

Public function Static

bool

 

SaveDirtyPackages

(
    const bool bPromptUserToSave,
    const bool bSaveMapPackages,
    const bool bSaveContentPackages,
    const bool bFastSave,
    const bool bNotifyNoPackagesSaved,
    const bool bCanBeDeclined,
    bool* bOutPackagesNeededSaving
)

Looks at all currently loaded packages and saves them if their "bDirty" flag is set, optionally prompting the user to select which packages to save)

Public function Static

bool

 

SaveLevel

(
    ULevel* Level,
    const FString& DefaultFilename,
    FString* OutSavedFilename
)

Saves the specified level.

Public function Static

bool

 

SaveLevelAs

(
    ULevel* Level,
    FString* OutSavedFilename
)

Does a saveAs for the specified level.

Does a saveAs for the specified level.

Public function Static

bool

 

SaveMap

(
    UWorld* World,
    const FString& Filename
)

Saves the specified map package, returning true on success.

Public function Static

void

 

SaveMapDataPackages

(
    UWorld* World,
    bool bCheckDirty
)

Saves packages which contain map data but are not map packages themselves.

Public function Static

bool

 

SaveWorlds

(
    UWorld* InWorld,
    const FString& RootPath,
    const TCHAR* Prefix,
    TArray< FString >& OutFilenames
)

Save all packages corresponding to the specified world, with the option to override their path and also apply a prefix.

Enums

Name

Description

Public enum

EGarbageCollectionOption

Used to decide how to handle garbage collection.

Public enum

EPromptReturnCode

Enum used for prompt returns

Typedefs

Constants

Name

Description

bIsLoadingDefaultStartupMap

bIsPromptingForCheckoutAndSave

Flag used to determine if the checkout and save prompt is already open to prevent re-entrance

PackagesNotSavedDuringSaveAll

Set of packages to ignore for save/checkout when using SaveAll.

PackagesNotToPromptAnyMore

Set of packages which should no longer prompt for checkouts / to be made writable.

Deprecated Functions

Name Description

Public function Static

bool

 

IsFilenameValidForSaving

(
    const FString& Filename,
    FText& OutError
)

Call FFileHelper::IsFilenameValidForSaving instead

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