Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/GenericPlatform
Inheritance Hierarchy
- FGenericPlatformMisc
- FUnixPlatformMisc
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMisc.h |
| Include | #include "GenericPlatform/GenericPlatformMisc.h" |
Syntax
struct FGenericPlatformMisc
Remarks
Generic implementation for most platforms
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddAdditionalRootDirectory
(
const FString& RootDir |
Add an additional root directory | |
| FDelegateHandle | AddNetworkListener
(
FOnNetworkConnectionChangedDelegate&& InNewDelegate |
||
| bool | Checks if platform wants to allow an audio thread on current device (note: does not imply it will, only if okay given other criteria met) | ||
| bool | |||
| bool | Checks if platform wants to allow the thread heartbeat hang detection | ||
| void | BeginEnterBackgroundEvent
(
const TCHAR* Text |
Profiler enter background events. | |
| void | BeginNamedEvent
(
const FColor& Color, |
Platform specific function for adding a named event that can be viewed in external tool | |
| void | BeginNamedEvent
(
const FColor& Color, |
Platform specific function for adding a named event that can be viewed in external tool | |
| void | Indicates the start of a frame for named events | ||
| void | BeginProfilerColor
(
const FColor& Color |
Profiler color stack - this overrides the color for named events with undefined colors (e.g stat namedevents) | |
| void | Function to store the current working directory for use with LaunchDir() | ||
| bool | CheckPersistentDownloadStorageSpaceAvailable
(
uint64 BytesRequired, |
Ensure that there enough space in the persistent download dir. | |
| void | ChooseHDRDeviceAndColorGamut
(
uint32 DeviceId, |
||
| FString | CloudDir () |
Return the CloudDir. CloudDir can be per-user. | |
| bool | Handles Game Explorer, Firewall and FirstInstall commands, typically from the installer | ||
| void | CreateGuid
(
FGuid& Result |
Create a new globally unique identifier. | |
| void | CustomNamedStat
(
const TCHAR* Text, |
Platform specific function for adding a named custom stat that can be viewed in external tool | |
| void | CustomNamedStat
(
const ANSICHAR* Text, |
||
| bool | DeleteStoredSection
(
const FString& InStoreId, |
Deletes the given section and its contained values in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user | |
| bool | DeleteStoredValue
(
const FString& InStoreId, |
Deletes value for the given section and key in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user | |
| bool | |||
| void | |||
| void | |||
| void | |||
| void | Platform specific function for closing a named event that can be viewed in external tool | ||
| void | |||
| const TCHAR * | EngineDir () |
Get the engine directory | |
| bool | Exec
(
UWorld* InWorld, |
Platform-specific Exec function | |
| bool | |||
| bool | FileExistsInPlatformPackage
(
const FString& RelativePath |
||
| bool | |||
| const TCHAR * | Return the GamePersistentDownloadDir. | ||
| const TCHAR * | Return the temporary directory | ||
| const TCHAR * | |||
| TArray< FString > | Get additional directories which can be considered as root directories | ||
| EDeviceScreenOrientation | Returns the allowed orientation of the device. | ||
| int | Gets the current battery level. | ||
| bool | GetBlockingIOStats
(
FProcessIOStats& OutStats, |
Gets Blocking Input/Output stats covering the lifetime of the process | |
| float | |||
| int32 | GetChunkIDFromPakchunkIndex
(
int32 PakchunkIndex |
||
| void | GetConfiguredCoreLimits
(
int32 PlatformNumPhysicalCores, |
Parse CoreLimit from CommandLine or from the SetCoreLimit value. | |
| bool | GetContextSwitchStats
(
FContextSwitchStats& OutStats, |
Gets Context Switch stats covering the lifetime of the process | |
| EConvertibleLaptopMode | Gets the current mode of convertible laptops, i.e. Laptop or Tablet. | ||
| FString | GetCPUBrand () |
Uses cpuid instruction to get the CPU brand string | |
| FString | Returns the CPU chipset if known | ||
| uint32 | GetCPUInfo () |
On x86(-64) platforms, uses cpuid instruction to get the CPU signature | |
| FString | GetCPUVendor () |
Uses cpuid instruction to get the vendor string | |
| ECrashHandlingType | Gets the current crash handling type. | ||
| const TCHAR * | Gets the default profile name. Used if there is no device profile specified | ||
| FString | Get the default language (for localization) used by this platform. | ||
| FString | Get the default locale (for internationalization) used by this platform. | ||
| const TCHAR * | |||
| FString | GetDeviceId () |
Returns a unique string for device identification. | |
| FString | |||
| EDeviceScreenOrientation | Returns the current orientation of the device: will be either Portrait, LandscapeLeft, PortraitUpsideDown or LandscapeRight. | ||
| float | Returns the current device temperature level. | ||
| int32 | Returns the device volume if the device is capable of returning that information. | ||
| bool | GetDiskTotalAndFreeSpace
(
const FString& InPath, |
Retrieves information about the total number of bytes and number of free bytes for the specified disk path. | |
| bool | GetEngineAndProjectAbsoluteDirsFromExecutable
(
FString& OutProjectDir, |
Return the engine and project directory based from the executable. | |
| const TCHAR * | Get a string description of the mode the engine was running in. | ||
| FString | GetEnvironmentVariable
(
const TCHAR* VariableName |
Retrieve a environment variable from the system | |
| FString | Get the Epic account ID for the user who last used the Launcher. | ||
| FText | |||
| FGPUDriverInfo | GetGPUDriverInfo
(
const FString& DeviceDescription |
||
| uint32 | GetLastError () |
||
| FString | Returns the currency code associated with the device's locale | ||
| FString | Returns the currency symbol associated with the device's locale | ||
| FString | GetLoginId () |
Returns a unique string associated with the login account of the current machine. | |
| int32 | Returns the maximum length of a path | ||
| int32 | Retrieves the current maximum refresh rate supported by the platform | ||
| int32 | Retrieves the maximum refresh rate supported by the platform | ||
| int32 | Returns the platform's maximum allowed value for rhi.SyncInterval | ||
| int | For mobile devices, this function will return true if we wish to propagate the alpha to the backbuffer | ||
| ENetworkConnectionStatus | Returns the current status for the network connection | ||
| ENetworkConnectionType | Returns whether WiFi connection is currently active | ||
| void | GetNetworkFileCustomData
(
TMap< FString, FString >& OutCustomPlatformData |
Returns any platform-specific key-value data that needs to be sent to the network file server | |
| const TCHAR * | Determines the shader format for the platform | ||
| FString | Gets a globally unique ID the represents a particular operating system install. | ||
| FString | GetOSVersion () |
Gets a string representing the numeric OS version (as opposed to a translated OS version that GetOSVersions returns). | |
| void | GetOSVersions
(
FString& out_OSVersionLabel, |
Gets the OS Version and OS Subversion. | |
| bool | GetPageFaultStats
(
FPageFaultStats& OutStats, |
Gets Page Fault stats covering the lifetime of the process | |
| int32 | GetPakchunkIndexFromPakFile
(
const FString& InFilename |
||
| const TCHAR * | Return the delimiter between paths in the PATH environment variable. | ||
| IPlatformChunkInstall * | Returns the platform specific chunk based install interface | ||
| IPlatformCompression * | Returns the platform specific compression interface | ||
| const TCHAR * | Return the name of the platform features module. | ||
| IPlatformHostCommunication & | Returns the platform specific interface for communication with processes running on the host pc. | ||
| bool | GetPlatformScreenWarnings
(
TArray< FText >& PlatformScreenWarnings |
Returns any platform specific warning messages we want printed on screen | |
| FAsyncIOSystemBase * | Return the platform specific async IO system, or nullptr if the standard one should be used. | ||
| FPlatformUserId | GetPlatformUserForUserIndex
(
int32 LocalUserIndex |
Converts from a local user index to a FPlatformUserId | |
| TArray< FString > | Returns an array of the user's preferred languages in order of preference | ||
| FString | |||
| EProcessDiagnosticFlags | Returns non-zero if a performance-sensitive diagnostic, like a memory sanitizer, is detected for this process | ||
| const FProcessorGroupDesc & | |||
| bool | GetSHA256Signature
(
const void* Data, |
Generates the SHA256 signature of the given data. | |
| bool | GetStoredValue
(
const FString& InStoreId, |
Get the value for the given section and key from the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user | |
| const TCHAR * | GetSystemErrorMessage
(
TCHAR* OutBuffer, |
Returns the last system error code in string form. | |
| TArray< uint8 > | |||
| FString | Get the timezone identifier for this platform, or an empty string if the default timezone calculation will work. | ||
| const TCHAR * | |||
| const TCHAR * | GetUBTTarget () |
||
| const TCHAR * | |||
| FString | Returns a unique string for advertising identification | ||
| int32 | GetUserIndexForPlatformUser
(
FPlatformUserId PlatformUser |
Converts from a FPlatformUserId to local user index | |
| bool | Returns whether the platform wants to use a touch screen for virtual joysticks. | ||
| void | GetValidTargetPlatforms
(
TArray< FString >& TargetPlatformNames |
Return an ordered list of target platforms this runtime can support (ie Android_DXT, Android would mean that it prefers Android_DXT, but can use Android as well) | |
| bool | Returns whether the volume buttons are handled by the system | ||
| bool | Returns whether WiFi connection is currently active | ||
| bool | Determines if a warning handler has been set | ||
| bool | |||
| bool | HasPlatformFeature
(
const TCHAR* FeatureName |
Returns whether the given platform feature is currently available (for instance, Metal is only available in IOS8 and with A7 devices) | |
| bool | Return true if the PersistentDownloadDir is available. | ||
| bool | Whether the platform has a separate debug channel to stdout (eg. OutputDebugString on Windows). | ||
| bool | Returns whether the platform has variable hardware (configurable/upgradeable system). | ||
| void | |||
| void | InitTaggedStorage
(
uint32 NumTags |
Platform specific function for initializing storage of tagged memory buffers | |
| bool | Detects whether we're running in a 64-bit operating system. | ||
| bool | For platforms that support cache storage functionality, setting a directory for it when it's not available can result in errors. | ||
| bool | Return true if a debugger is present | ||
| bool | Allows disabling ensure()s without rebuilding the binary, by either a commandline switch or a hotfix. | ||
| bool | |||
| bool | Whether LocalPrint can be called from any thread without overlapping | ||
| bool | Whether LowLevelOutputDebugString[f] can receive structured output as lines of JSON. | ||
| bool | |||
| bool | IsPGIActive () |
Returns true if PGI (profile-guided instrumentation, needed for PGO) is currently ongoing. | |
| bool | Returns true if this binary has been instrumented for collection of data needed for profile-guided optimization (PGO) This value is not expected to change during the run-time | ||
| bool | IsPGOEnabled () |
Returns true if PGO is currently enabled | |
| bool | Returns whether or not the device has been registered to receive remote notifications. | ||
| bool | Check to see if the platform is being viewed remotely. | ||
| bool | Return if the game is running on cloud server | ||
| bool | Returns whether the platform is running on battery power or not. | ||
| bool | IsValidAbsolutePathFormat
(
const FString& Path |
Checks structure of the path against platform formatting requirements | |
| const TCHAR * | LaunchDir () |
Get the directory the application was launched from (useful for commandline utilities) | |
| FString | LoadTextFileFromPlatformPackage
(
const FString& RelativePath |
Loads a text file relative to the package root on platforms that distribute apps in package formats. | |
| void | LocalPrint
(
const TCHAR* Str |
Prints string to the default output | |
| void | |||
| void | LowLevelOutputDebugString
(
const TCHAR* Message |
Sends a message to a remote tool, and debugger consoles | |
| void | LowLevelOutputDebugStringf
(
const TCHAR* Format, |
Sends a message to a remote tool, and debugger consoles | |
| void | Enforces strict memory load/store ordering across the memory barrier call. | ||
| EAppReturnType::Type | MessageBoxExt
(
EAppMsgType::Type MsgType, |
Show a message box if possible, otherwise print a message and return the default | |
| bool | |||
| void | NormalizePath
(
FString& InPath |
Platform-specific normalization of path E.g. | |
| void | NormalizePath
(
FStringBuilderBase& InPath |
Platform-specific normalization of path E.g. | |
| int32 | Return the number of hardware CPU cores | ||
| int32 | Return the number of logical CPU cores | ||
| int32 | Return the number of worker threads we should spawn to service IO, NOT based on number of cores | ||
| int32 | Return the number of worker threads we should spawn, based on number of cores | ||
| bool | OsExecute
(
const TCHAR* CommandType, |
Has the OS execute a command and path pair (such as launch a browser) | |
| void | ParseChunkIdPakchunkIndexMapping
(
TArray< FString > ChunkIndexRedirects, |
||
| void | PlatformHandleSplashScreen
(
bool ShowSplashScreen |
Called to dismiss splash screen | |
| void | PlatformInit () |
||
| void | Called during appInit() after cmd line setup | ||
| void | Called during AppExit(). Log, Config still exist at this point, but not much else does. | ||
| void | Prefetch
(
const void* Ptr, |
||
| void | Prefetch
(
const void* Ptr |
||
| void | PrefetchBlock
(
const void* Ptr, |
||
| void | PrepareMobileHaptics
(
EMobileHapticsType Type |
For mobile devices, this will crank up a haptic engine for the specified type to be played later with TriggerMobileHaptics If this is called again before Release, it will switch to this type | |
| const TCHAR * | ProjectDir () |
Return the project directory | |
| void | PromptForRemoteDebugging
(
bool bIsEnsure |
||
| void | Pumps app messages only if there are essential keep-alive messages pending. | ||
| void | |||
| void | |||
| void | RaiseException
(
uint32 ExceptionCode |
||
| void | Requests permission to send remote notifications to the user's device. | ||
| void | For mobile devices, this will shutdown the haptics, allowing system to put it to reset as needed | ||
| bool | RemoveNetworkListener
(
FDelegateHandle Handle |
||
| bool | |||
| void | RequestExit
(
bool Force, |
Requests application exit. | |
| void | RequestExitWithStatus
(
bool Force, |
Requests application exit with a specified return code. | |
| bool | Requests application to restart | ||
| bool | RestartApplicationWithCmdLine
(
const char* CmdLine |
Requests application to restart appending the passed in CmdLine to the restart | |
| const TCHAR * | RootDir () |
Get the application root directory. | |
| void | SetAllowedDeviceOrientation
(
EDeviceScreenOrientation NewAllowedDeviceOrientation |
Change the allowed orientation of the device. | |
| void | SetBrightness
(
float bBright |
||
| void | SetCrashHandler
(
void(*)(const FGenericCrashContext&Context) CrashHandler |
Installs handler for the unexpected (due to error) termination of the program, including, but not limited to, crashes. | |
| ECrashHandlingType | SetCrashHandlingType
(
ECrashHandlingType Type |
Sets the type of crash handling done by the engine. | |
| void | SetEnvironmentVar
(
const TCHAR* VariableName, |
Sets an environment variable to the local process's environment | |
| void | Set/restore the Console Interrupt (Control-C, Control-Break, Close) handler. | ||
| void | SetLastError
(
uint32 ErrorCode |
||
| void | SetMemoryWarningHandler
(
void(*)(const FGenericMemoryWarningContext&Context) Handler |
Set a handler to be called when there is a memory warning from the OS | |
| void | SetNetworkConnectionStatus
(
ENetworkConnectionStatus NewNetworkConnectionStatus |
Updates the current status for the network connection | |
| void | SetOverrideProjectDir
(
const FString& InOverrideDir |
Allows a game/program/etc to control the game directory in a special place (for instance, monolithic programs that don't have .uprojects) | |
| void | SetShouldPromptForRemoteDebugging
(
bool bInShouldPrompt |
||
| void | SetShouldPromptForRemoteDebugOnEnsure
(
bool bInShouldPrompt |
||
| bool | SetStoredValue
(
const FString& InStoreId, |
Set the value for the given section and key in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user | |
| bool | Set the value for the given section and key in the platform specific key->value store Note: The key->value store is user-specific, but may be used to share data between different applications for the same user | ||
| void | SetUBTTargetName
(
const TCHAR* InTargetName |
||
| bool | Unix only function, but put a stub so we can call this for higher level code when we want to setup the Syscall Filters | ||
| void | Sets the default output to UTF8 | ||
| void | SetVolumeButtonsHandledBySystem
(
bool enabled |
Set whether the volume buttons are handled by the system | |
| void | Perform a mobile-style sharing of a URL. Will use native UI to display sharing target | ||
| bool | ShouldDisablePluginAtRuntime
(
const FString& PluginName |
Allows platform at runtime to disable unsupported plugins | |
| bool | |||
| void | |||
| void | Platform specific function for freeing storage of tagged memory buffers | ||
| bool | StartNewPGOCollection
(
const FString& AbsoluteFileName |
On platforms that support run-time PGI on/off, starts a new collection with a given file name. | |
| void | StatNamedEvent
(
const CharType* Text |
Stats logging for named event | |
| bool | On platforms that support run-time PGI on/off, stops the current collection and writes out the file (or completes its write). | ||
| void | SubmitErrorReport
(
const TCHAR* InErrorHist, |
#CrashReport: 2015-02-24 Remove | |
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| bool | Platform can generate a full-memory crashdump during crash handling. | ||
| bool | |||
| bool | |||
| bool | |||
| bool | |||
| void | TagBuffer
(
const char* Label, |
Platform specific function for tagging a memory buffer with a label. | |
| void | TearDown () |
Frees any memory retained by FGenericPlatformMisc. | |
| void | Ticks values that can be hotfixable in the config. | ||
| void | Stats logging for named event | ||
| void | For mobile devices, this will kick the haptic type that was set in PrepareMobileHaptics. | ||
| void | Requests unregistering from receiving remote notifications on the user's device. | ||
| void | Updates hotfixable ensure settings from config and commandline (config takes priority). | ||
| bool | |||
| bool | Checks if platform wants to use a rendering thread on current device |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FStaticData |
Constants
| Name | Description |
|---|---|
| AllowedDeviceOrientation | |
| bPromptForRemoteDebugOnEnsure | Whether the user should be prompted to allow for a remote debugger to be attached on an ensure |
| bShouldPromptForRemoteDebugging | Whether the user should be prompted to allow for a remote debugger to be attached |
| CurrentNetworkConnectionStatus |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| void | ClipboardCopy
(
const TCHAR* Str |
FPlatformMisc::ClipboardCopy() has been superseded by FPlatformApplicationMisc::ClipboardCopy() | |
| void | ClipboardPaste
(
FString& Dest |
FPlatformMisc::ClipboardPaste() has been superseded by FPlatformApplicationMisc::ClipboardPaste() | |
| void | DebugBreak () |
FPlatformMisc::DebugBreak is deprecated. Use the UE_DEBUG_BREAK() macro instead. | |
| TArray< FCustomChunk > | Use IPlatformChunkInstall::GetNamedChunksByType instead | ||
| TArray< FCustomChunk > | Use IPlatformChunkInstall::GetNamedChunksByType instead | ||
| TArray< FCustomChunk > | GetCustomChunksByType
(
ECustomChunkType DesiredChunkType |
Use IPlatformChunkInstall::GetNamedChunksByType instead | |
| FString | GetHasedMacAddressString is deprecated. It is not reliable on all platforms | ||
| TArray< uint8 > | GetMacAddress is deprecated. It is not reliable on all platforms | ||
| FString | GetMacAddressString is deprecated. It is not reliable on all platforms | ||
| FGuid | GetMachineId () |
GetMachineId is deprecated. Use GetLoginId instead. | |
| TArray< FCustomChunk > | GetOnDemandChunksForPakchunkIndices
(
const TArray< int32 >& PakchunkIndices |
Use named chunks instead | |
| void | PrefetchBlock
(
const void* Ptr |
Must supply size when prefetching a block of data | |
| void | SetDeviceOrientation
(
EDeviceScreenOrientation NewDeviceOrientation |
SetDeviceOrientation is deprecated. Use SetAllowedDeviceOrientation instead. | |
| void | SetOverrideGameDir
(
const FString& InOverrideDir |
FPaths::SetOverrideGameDir() has been superseded by FPaths::SetOverrideProjectDir(). |