GameProjectUtils

Windows
MacOS
Linux

References

Module

GameProjectGeneration

Header

/Engine/Source/Editor/GameProjectGeneration/Public/GameProjectUtils.h

Include

#include "GameProjectUtils.h"

Syntax

class GameProjectUtils

Functions

Name Description

Public function Static

EAddCodeToPr...

 

AddCodeToProject

(
    const FString& NewClassName,
    const FString& NewClassPath,
    const FModuleContextInfo& ModuleIn...,
    const FNewClassInfo ParentClassInfo,
    const TSet< FString >& DisallowedH...,
    FString& OutHeaderFilePath,
    FString& OutCppFilePath,
    FText& OutFailReason
)

Adds new source code to the project.

Public function Static

bool

 

BuildCodeProject

(
    const FString& ProjectFilename
)

Compiles a project while showing a progress bar, and offers to open the IDE if it fails.

Public function Static

bool

 

CalculateSourcePaths

(
    const FString& InPath,
    const FModuleContextInfo& ModuleIn...,
    FString& OutHeaderPath,
    FString& OutSourcePath,
    FText*const OutFailReason
)

Given the path provided, work out where generated .h and .cpp files would be placed

Public function Static

void

 

CheckAndWarnProjectFilenameValid()

Warn the user if the project filename is invalid in case they renamed it outside the editor

Public function Static

void

 

CheckForOutOfDateGameProjectFile()

Prompts the user to update his project file, if necessary.

Public function Static

void

 

ClearSupportedTargetPlatforms()

Clear the list of supported target platforms

Public function Static

bool

 

CreateProject

(
    const FProjectInformation& InProje...,
    FText& OutFailReason,
    FText& OutFailLog,
    TArray< FString >* OutCreatedF...
)

Creates the specified project file and all required folders.

Public function Static

void

 

DeleteCreatedFiles

(
    const FString& RootFolder,
    const TArray< FString >& CreatedFi...
)

Deletes the specified list of files that were created during file creation

Public function Static

FString

 

DetermineModuleIncludePath

(
    const FModuleContextInfo& ModuleIn...,
    const FString& FileRelativeTo
)

Returns the path to the module's include header

Public function Static

EProjectDupl...

 

DuplicateProjectForUpgrade

(
    const FString& InProjectFile,
    FString& OutNewProjectFile
)

Creates a copy of a project directory in order to upgrade it.

Public function Static

bool

 

GenerateBasicSourceCode

(
    TArray< FString >& OutCreatedFiles,
    FText& OutFailReason
)

Creates the basic source code for a new project. On failure, OutFailReason will be populated.

Public function Static

bool

 

GenerateCodeProjectFiles

(
    const FString& ProjectFilename,
    FText& OutFailReason,
    FText& OutFailLog
)

Creates code project files for a new game project.

Public function Static

bool

 

GenerateGameModuleBuildFile

(
    const FString& NewBuildFileName,
    const FString& ModuleName,
    const TArray< FString >& PublicDep...,
    const TArray< FString >& PrivateDe...,
    FText& OutFailReason
)

Generates a Build.cs file for a game module

Public function Static

bool

 

GeneratePluginModuleBuildFile

(
    const FString& NewBuildFileName,
    const FString& ModuleName,
    const TArray< FString >& PublicDep...,
    const TArray< FString >& PrivateDe...,
    FText& OutFailReason,
    bool bUseExplicitOrSharedPCHs
)

Generates a Build.cs file for a plugin module.

Public function Static

bool

 

GeneratePluginModuleCPPFile

(
    const FString& CPPFileName,
    const FString& ModuleName,
    const FString& StartupSourceCode,
    FText& OutFailReason
)

Generates a module .cpp file, intended for plugin use

Public function Static

bool

 

GeneratePluginModuleHeaderFile

(
    const FString& HeaderFileName,
    const TArray< FString >& PublicHea...,
    FText& OutFailReason
)

Generates a module .h file, intended for plugin use

Public function Static

bool

 

GetClassLocation

(
    const FString& InPath,
    const FModuleContextInfo& ModuleIn...,
    EClassLocation& OutClassLocation,
    FText*const OutFailReason
)

Given the path provided, work out where it's located within the Source folder

Public function Static

const TArray...

 

GetCurrentProjectModules()

Get the information about any modules referenced in the .uproject file of the currently loaded project

Public function Static

TArray< FMod...

 

GetCurrentProjectPluginModules()

Get the information about any modules in any of the plugins in the currently loaded project (Ignores Engine Plugins)

Public function Static

const TCHAR ...

 

GetDefaultBuildSettingsVersion()

Gets the default build settings version for UBT

Public function Static

FString

 

GetDefaultProjectTemplateFilename()

Returns the uproject template filename for the default project template.

Public function Static

int32

 

GetProjectCodeFileCount()

Public function Static

void

 

GetProjectSourceDirectoryInfo

(
    int32& OutNumFiles,
    int64& OutDirectorySize
)

Retrieves file and size info about the project's source directory

Public function Static

bool

 

IsStarterContentAvailableForNewProjects()

Returns true if there are starter content files available for instancing into new projects.

Public function Static

bool

 

IsStarterContentAvailableForProject

(
    const FProjectInformation& Project...
)

Public function Static

bool

 

IsValidBaseClassForCreation

(
    const UClass* InClass,
    const TArray< FModuleContextInfo > ...
)

Returns true if the specified class is a valid base class for any of the given modules

Public function Static

bool

 

IsValidBaseClassForCreation

(
    const UClass* InClass,
    const FModuleContextInfo& InModule...
)

Returns true if the specified class is a valid base class for the given module

Public function Static

bool

 

IsValidClassNameForCreation

(
    const FString& NewClassName,
    const FModuleContextInfo& ModuleIn...,
    const TSet< FString >& DisallowedH...,
    FText& OutFailReason
)

Returns true if the specified class name is properly formed and does not conflict with another class, including source/header files

Public function Static

bool

 

IsValidClassNameForCreation

(
    const FString& NewClassName,
    FText& OutFailReason
)

Returns true if the specified class name is properly formed and does not conflict with another class

Public function Static

bool

 

IsValidProjectFileForCreation

(
    const FString& ProjectFile,
    FText& OutFailReason
)

Returns true if the project filename is properly formed and does not conflict with another project

Public function Static

bool

 

IsValidSourcePath

(
    const FString& InPath,
    const FModuleContextInfo& ModuleIn...,
    FText*const OutFailReason
)

Check to see if the given path is a valid place to put source code for this project (exists within the source root path)

Public function Static

UTemplateCat...

 

LoadTemplateCategories

(
    const FString& RootDir
)

Loads a list of template categories defined in the TemplateCategories.ini file in the specified folder

Public function Static

UTemplatePro...

 

LoadTemplateDefs

(
    const FString& ProjectDirectory
)

Loads a template project definitions object from the TemplateDefs.ini file in the specified project

Public function Static

FString

 

MakeCommaDelimitedList

(
    const TArray< FString >& InList,
    bool bPlaceQuotesAroundEveryElement
)

Returns a comma delimited string comprised of all the elements in InList.

Public function Static

FString

 

MakeIncludeList

(
    const TArray< FString >& InList
)

Returns a list of #include lines formed from InList

Public function Static

bool

 

NameContainsOnlyLegalCharacters

(
    const FString& TestName,
    FString& OutIllegalCharacters
)

Checks the name for illegal characters

Public function Static

void

 

OpenAddToProjectDialog

(
    const FAddToProjectConfig& Config,
    EClassDomain InDomain
)

Opens a dialog to add code files or blueprints to the current project.

Public function Static

bool

 

OpenCodeIDE

(
    const FString& ProjectFile,
    FText& OutFailReason
)

Opens the code editing IDE for the specified project, if it exists.

Public function Static

bool

 

OpenProject

(
    const FString& ProjectFile,
    FText& OutFailReason
)

Opens the specified project, if it exists.

Public function Static

bool

 

ProjectHasCodeFiles()

Returns true if the currently loaded project has code files

Public function Static

bool

 

ReadTemplateFile

(
    const FString& TemplateFileName,
    FString& OutFileContents,
    FText& OutFailReason
)

Returns the contents of the specified template file

Public function Static

void

 

ResetCurrentProjectModulesCache()

Reset the cached result of information about any modules referenced in the .uproject file of the currently loaded project

Public function Static

void

 

TryMakeProjectFileWriteable

(
    const FString& ProjectFile
)

Checks out the current project file (or prompts to make writable)

Public function Static

bool

 

UpdateAdditionalPluginDirectory

(
    const FString& InDir,
    const bool bAddOrRemove
)

Update the list of plugin directories to scan This will take care of checking out and saving the updated .uproject file automatically

Public function Static

bool

 

UpdateGameProject

(
    const FString& ProjectFile,
    const FString& EngineIdentifier,
    FText& OutFailReason
)

Updates the given project file to an engine identifier.

Public function Static

void

 

UpdateSupportedTargetPlatforms

(
    const FName& InPlatformName,
    const bool bIsSupported
)

Update the list of supported target platforms based upon the parameters provided This will take care of checking out and saving the updated .uproject file automatically

Public function Static

bool

 

WriteOutputFile

(
    const FString& OutputFilename,
    const FString& OutputFileContents,
    FText& OutFailReason
)

Writes an output file. OutputFilename includes a path

Enums

Name

Description

Public enum

EAddCodeToProjectResult

Used as a function return result when adding new code to the project

Public enum

EClassLocation

Where is this class located within the Source folder?

Public enum

EProjectDuplicateResult

Used as a function return result when a project is duplicated when upgrading project's version in Convert project dialog - Open a copy

Typedefs

Name

Description

FDoesClassNeedAPIExportCallback

Internal handler for IsValidBaseClassForCreation

Constants

Name

Description

bUseAudioMixerForAllPlatforms

Whether we should use AudioMixer for all platforms:

IncludePathFormatString

UpdateGameProjectNotification

WarningProjectNameNotification

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss