engine
 
载入中...
搜索中...
未找到
静态 Public 成员函数 | 静态 Protected 属性 | 所有成员列表
FGenericPlatformMisc结构体 参考

Generic implementation for most platforms 更多...

#include <GenericPlatformMisc.h>

+ 类 FGenericPlatformMisc 继承关系图:

静态 Public 成员函数

static void AddAdditionalRootDirectory (const FString &RootDir)
 add an additional root directory
 
static bool AllowAudioThread ()
 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) 更多...
 
static bool AllowThreadHeartBeat ()
 Checks if platform wants to allow the thread heartbeat hang detection 更多...
 
static void BeginNamedEvent (const struct FColor &Color, const TCHAR *Text)
 Platform specific function for adding a named event that can be viewed in external tool
 
static FORCEINLINE void BeginNamedEventFrame ()
 Indicates the start of a frame for named events
 
static void BeginProfilerColor (const struct FColor &Color)
 Profiler color stack - this overrides the color for named events with undefined colors (e.g stat namedevents)
 
static void CacheLaunchDir ()
 Function to store the current working directory for use with LaunchDir()
 
static void ClipboardCopy (const TCHAR *Str)
 Copies text to the operating system clipboard.
 
static void ClipboardPaste (class FString &Dest)
 Pastes in text from the operating system clipboard.
 
static FString CloudDir ()
 Return the CloudDir. 更多...
 
static bool CommandLineCommands ()
 Handles Game Explorer, Firewall and FirstInstall commands, typically from the installer 更多...
 
static void CreateGuid (struct FGuid &Result)
 Create a new globally unique identifier.
 
static void CustomNamedStat (const TCHAR *Text, float Value, const TCHAR *Graph, const TCHAR *Unit)
 Platform specific function for adding a named custom stat that can be viewed in external tool
 
static FORCEINLINE void DebugBreak ()
 Break into the debugger, if IsDebuggerPresent returns true, otherwise do nothing

 
static bool DeleteStoredSection (const FString &InStoreId, const FString &InSectionName)
 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 更多...
 
static bool DeleteStoredValue (const FString &InStoreId, const FString &InSectionName, const FString &InKeyName)
 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 更多...
 
static void EndNamedEvent ()
 Platform specific function for closing a named event that can be viewed in external tool
 
static const TCHAR * EngineDir ()
 Get the engine directory
 
static bool Exec (class UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Out)
 Platform-specific Exec function 更多...
 
static const TCHAR * GamePersistentDownloadDir ()
 Return the GamePersistentDownloadDir. 更多...
 
static TArray< FString > GetAdditionalRootDirectories ()
 get additional directories which can be considered as root directories
 
static FORCEINLINE int GetBatteryLevel ()
 Gets the current battery level. 更多...
 
static EConvertibleLaptopMode GetConvertibleLaptopMode ()
 Gets the current mode of convertible laptops, i.e. 更多...
 
static FString GetCPUBrand ()
 Uses cpuid instruction to get the CPU brand string 更多...
 
static FString GetCPUChipset ()
 Returns the CPU chipset if known 更多...
 
static uint32 GetCPUInfo ()
 On x86(-64) platforms, uses cpuid instruction to get the CPU signature 更多...
 
static FString GetCPUVendor ()
 Uses cpuid instruction to get the vendor string 更多...
 
static const TCHAR * GetDefaultDeviceProfileName ()
 Gets the default profile name. 更多...
 
static FString GetDefaultLanguage ()
 Get the default language (for localization) used by this platform. 更多...
 
static FString GetDefaultLocale ()
 Get the default locale (for internationalization) used by this platform. 更多...
 
static const TCHAR * GetDefaultPathSeparator ()
 
static FString GetDeviceId ()
 Returns a unique string for device identification. 更多...
 
static FString GetDeviceMakeAndModel ()
 
static EDeviceScreenOrientation GetDeviceOrientation ()
 Returns the orientation of the device: e.g. 更多...
 
static float GetDeviceTemperatureLevel ()
 Returns the current device temperature level. 更多...
 
static int32 GetDeviceVolume ()
 Returns the device volume if the device is capable of returning that information. 更多...
 
static bool GetDiskTotalAndFreeSpace (const FString &InPath, uint64 &TotalNumberOfBytes, uint64 &NumberOfFreeBytes)
 Retrieves information about the total number of bytes and number of free bytes for the specified disk path.
 
static const TCHAR * GetEngineMode ()
 Get a string description of the mode the engine was running in.
 
static FString GetEnvironmentVariable (const TCHAR *VariableName)
 Retrieve a environment variable from the system 更多...
 
static void GetEnvironmentVariable (const TCHAR *VariableName, TCHAR *Result, int32 ResultLength)
 Retrieve a environment variable from the system 更多...
 
static FString GetEpicAccountId ()
 Get the Epic account ID for the user who last used the Launcher. 更多...
 
static FText GetFileManagerName ()
 
static FString GetHashedMacAddressString ()
 Retrieve the Mac address of the current adapter as a hashed string (privacy). 更多...
 
static FString GetLocalCurrencyCode ()
 Returns the currency code associated with the device's locale 更多...
 
static FString GetLocalCurrencySymbol ()
 Returns the currency symbol associated with the device's locale 更多...
 
static FString GetLoginId ()
 Returns a unique string associated with the login account of the current machine. 更多...
 
static TArray< uint8 > GetMacAddress ()
 Retrieve the Mac address of the current adapter. 更多...
 
static FString GetMacAddressString ()
 Retrieve the Mac address of the current adapter as a string. 更多...
 
static FGuid GetMachineId ()
 Get (or create) the unique ID used to identify this computer. 更多...
 
static FORCEINLINE int32 GetMaxPathLength ()
 Returns the maximum length of a path
 
static int32 GetMaxRefreshRate ()
 retrieves the maximum refresh rate supported by the platform
 
static ENetworkConnectionType GetNetworkConnectionType ()
 Returns whether WiFi connection is currently active
 
static FORCEINLINE void GetNetworkFileCustomData (TMap< FString, FString > &OutCustomPlatformData)
 Returns any platform-specific key-value data that needs to be sent to the network file server
 
static const TCHAR * GetNullRHIShaderFormat ()
 Determines the shader format for the platform 更多...
 
static FString GetOperatingSystemId ()
 Gets a globally unique ID the represents a particular operating system install. 更多...
 
static FString GetOSVersion ()
 Gets a string representing the numeric OS version (as opposed to a translated OS version that GetOSVersions returns). 更多...
 
static void GetOSVersions (FString &out_OSVersionLabel, FString &out_OSSubVersionLabel)
 Gets the OS Version and OS Subversion.
 
static const TCHAR * GetPathVarDelimiter ()
 return the delimiter between paths in the PATH environment variable.
 
static IPlatformChunkInstall * GetPlatformChunkInstall ()
 Returns the platform specific chunk based install interface 更多...
 
static IPlatformCompression * GetPlatformCompression ()
 Returns the platform specific compression interface 更多...
 
static const TCHAR * GetPlatformFeaturesModuleName ()
 Return the name of the platform features module. 更多...
 
static bool GetPlatformScreenWarnings (TArray< FText > &PlatformScreenWarnings)
 Returns any platform specific warning messages we want printed on screen
 
static struct FAsyncIOSystemBase * GetPlatformSpecificAsyncIOSystem ()
 Return the platform specific async IO system, or nullptr if the standard one should be used.
 
static TArray< FString > GetPreferredLanguages ()
 Returns an array of the user's preferred languages in order of preference 更多...
 
static FString GetPrimaryGPUBrand ()
 
static bool GetSHA256Signature (const void *Data, uint32 ByteSize, FSHA256Signature &OutSignature)
 Generates the SHA256 signature of the given data. 更多...
 
static bool GetStoredValue (const FString &InStoreId, const FString &InSectionName, const FString &InKeyName, FString &OutValue)
 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 更多...
 
static const TCHAR * GetSystemErrorMessage (TCHAR *OutBuffer, int32 BufferCount, int32 Error)
 Returns the last system error code in string form. 更多...
 
static TArray< uint8 > GetSystemFontBytes ()
 
static FString GetTimeZoneId ()
 Get the timezone identifier for this platform, or an empty string if the default timezone calculation will work. 更多...
 
static FString GetUniqueAdvertisingId ()
 Returns a unique string for advertising identification 更多...
 
static bool GetUseVirtualJoysticks ()
 Returns whether the platform wants to use a touch screen for virtual joysticks.
 
static 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)
 
static bool HasActiveWiFiConnection ()
 Returns whether WiFi connection is currently active
 
static bool HasMemoryWarningHandler ()
 Determines if a warning handler has been set
 
static bool HasNonoptionalCPUFeatures ()
 
static 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)
 
static bool HasProjectPersistentDownloadDir ()
 Return true if the PersistentDownloadDir is available. 更多...
 
static bool HasSeparateChannelForDebugOutput ()
 Whether the platform has a separate debug channel to stdout (eg. 更多...
 
static bool HasVariableHardware ()
 Returns whether the platform has variable hardware (configurable/upgradeable system).
 
static FORCEINLINE void InitTaggedStorage (uint32 NumTags)
 Platform specific function for initializing storage of tagged memory buffers
 
static FORCEINLINE bool Is64bitOperatingSystem ()
 Detects whether we're running in a 64-bit operating system. 更多...
 
static FORCEINLINE bool IsDebuggerPresent ()
 Return true if a debugger is present
 
static bool IsEnsureAllowed ()
 Allows disabling ensure()s without rebuilding the binary, by either a commandline switch or a hotfix. 更多...
 
static bool IsLocalPrintThreadSafe ()
 Whether LocalPrint can be called from any thread without overlapping
 
static bool IsPackagedForDistribution ()
 
static bool IsRegisteredForRemoteNotifications ()
 Returns whether or not the device has been registered to receive remote notifications.
 
static bool IsRemoteSession ()
 Check to see if the platform is being viewed remotely. 更多...
 
static bool IsRunningOnBattery ()
 Returns whether the platform is running on battery power or not.
 
static bool IsStandaloneStereoOnlyDevice ()
 Returns whether this is a 'stereo only' platform. 更多...
 
static bool IsValidAbsolutePathFormat (const FString &Path)
 Checks structure of the path against platform formatting requirements 更多...
 
static const TCHAR * LaunchDir ()
 Get the directory the application was launched from (useful for commandline utilities)
 
static FString LoadTextFileFromPlatformPackage (const FString &RelativePath)
 Loads a text file relative to the package root on platforms that distribute apps in package formats. 更多...
 
static void LocalPrint (const TCHAR *Str)
 Prints string to the default output
 
static void LowLevelOutputDebugString (const TCHAR *Message)
 Sends a message to a remote tool, and debugger consoles
 
static FORCENOINLINE void MemoryBarrier ()
 Enforces strict memory load/store ordering across the memory barrier call.
 
static EAppReturnType::Type MessageBoxExt (EAppMsgType::Type MsgType, const TCHAR *Text, const TCHAR *Caption)
 Show a message box if possible, otherwise print a message and return the default 更多...
 
static bool NeedsNonoptionalCPUFeaturesCheck ()
 
static void NormalizePath (FString &InPath)
 Platform-specific normalization of path E.g. 更多...
 
static int32 NumberOfCores ()
 return the number of hardware CPU cores
 
static int32 NumberOfCoresIncludingHyperthreads ()
 return the number of logical CPU cores
 
static int32 NumberOfIOWorkerThreadsToSpawn ()
 Return the number of worker threads we should spawn to service IO, NOT based on number of cores
 
static int32 NumberOfWorkerThreadsToSpawn ()
 Return the number of worker threads we should spawn, based on number of cores
 
static bool OsExecute (const TCHAR *CommandType, const TCHAR *Command, const TCHAR *CommandLine=NULL)
 Has the OS execute a command and path pair (such as launch a browser) 更多...
 
static void PlatformHandleSplashScreen (bool ShowSplashScreen=false)
 Called to dismiss splash screen
 
static void PlatformPreInit ()
 Called during appInit() after cmd line setup
 
static void PlatformTearDown ()
 Called during AppExit(). 更多...
 
static FORCEINLINE void Prefetch (void const *x, int32 offset=0)
 Platform-specific instruction prefetch
 
static 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
 
static const TCHAR * ProjectDir ()
 Return the project directory
 
static void PumpEssentialAppMessages ()
 Pumps app messages only if there are essential keep-alive messages pending. 更多...
 
static void RegisterForRemoteNotifications ()
 Requests permission to send remote notifications to the user's device.
 
static void ReleaseMobileHaptics ()
 For mobile devices, this will shutdown the haptics, allowing system to put it to reset as needed
 
static void RequestExit (bool Force)
 Requests application exit. 更多...
 
static void RequestExitWithStatus (bool Force, uint8 ReturnCode)
 Requests application exit with a specified return code. 更多...
 
static bool RestartApplication ()
 Requests application to restart
 
static const TCHAR * RootDir ()
 Get the application root directory.
 
static void SetCrashHandler (void(*CrashHandler)(const FGenericCrashContext &Context))
 Installs handler for the unexpected (due to error) termination of the program, including, but not limited to, crashes.
 
static void SetEnvironmentVar (const TCHAR *VariableName, const TCHAR *Value)
 Sets an environment variable to the local process's environment 更多...
 
static bool SetEpicAccountId (const FString &AccountId)
 Set the Epic account ID for the user who last used the Launcher 更多...
 
static void SetGracefulTerminationHandler ()
 Set/restore the Console Interrupt (Control-C, Control-Break, Close) handler.
 
static void SetMemoryWarningHandler (void(*Handler)(const FGenericMemoryWarningContext &Context))
 Set a handler to be called when there is a memory warning from the OS 更多...
 
static 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)
 
static bool SetStoredValue (const FString &InStoreId, const FString &InSectionName, const FString &InKeyName, const FString &InValue)
 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 更多...
 
static bool SetStoredValues (const FString &InStoreId, const FString &InSectionName, const TMap< FString, FString > &InKeyValues)
 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 更多...
 
static void SetUTF8Output ()
 Sets the default output to UTF8
 
static void ShareURL (const FString &URL, const FText &Description, int32 LocationHintX, int32 LocationHintY)
 Perform a mobile-style sharing of a URL. 更多...
 
static bool ShouldDisablePluginAtRuntime (const FString &PluginName)
 Allows platform at runtime to disable unsupported plugins 更多...
 
static FORCEINLINE void ShutdownTaggedStorage ()
 Platform specific function for freeing storage of tagged memory buffers
 
static void SubmitErrorReport (const TCHAR *InErrorHist, EErrorReportMode::Type InMode)
 Submits a crash report to a central server (release builds only)
 
static bool SupportsFullCrashDumps ()
 Platform can generate a full-memory crashdump during crash handling.
 
static bool SupportsMultithreadedFileHandles ()
 
static FORCEINLINE void TagBuffer (const char *Label, uint32 Category, const void *Buffer, size_t BufferSize)
 Platform specific function for tagging a memory buffer with a label. 更多...
 
static void TearDown ()
 Frees any memory retained by FGenericPlatformMisc.
 
static void TickHotfixables ()
 Ticks values that can be hotfixable in the config.
 
static void TriggerMobileHaptics ()
 For mobile devices, this will kick the haptic type that was set in PrepareMobileHaptics. 更多...
 
static void UnregisterForRemoteNotifications ()
 Requests unregistering from receiving remote notifications on the user's device.
 
static void UpdateHotfixableEnsureSettings ()
 Updates hotfixable ensure settings from config and commandline (config takes priority).
 
static bool UseRenderThread ()
 Checks if platform wants to use a rendering thread on current device 更多...
 

静态 Protected 属性

static bool bPromptForRemoteDebugOnEnsure
 Whether the user should be prompted to allow for a remote debugger to be attached on an ensure
 
static bool bShouldPromptForRemoteDebugging
 Whether the user should be prompted to allow for a remote debugger to be attached
 

详细描述

Generic implementation for most platforms

成员函数说明

◆ AllowAudioThread()

static bool FGenericPlatformMisc::AllowAudioThread ( )
inlinestatic

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)

返回
true if allowed, false if shouldn't use a separate audio thread

◆ AllowThreadHeartBeat()

static bool FGenericPlatformMisc::AllowThreadHeartBeat ( )
static

Checks if platform wants to allow the thread heartbeat hang detection

返回
true if allows, false if shouldn't allow thread heartbeat hang detection

◆ CloudDir()

static FString FGenericPlatformMisc::CloudDir ( )
static

Return the CloudDir.

CloudDir can be per-user.

◆ CommandLineCommands()

static bool FGenericPlatformMisc::CommandLineCommands ( )
inlinestatic

Handles Game Explorer, Firewall and FirstInstall commands, typically from the installer

返回
false if the game cannot continue.

◆ DeleteStoredSection()

static bool FGenericPlatformMisc::DeleteStoredSection ( const FString &  InStoreId,
const FString &  InSectionName 
)
static

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

参数
InStoreIdThe name used to identify the store you want to use (eg, MyGame)
InSectionNameThe section to delete.
返回
bool true if the section was deleted, false if not found or couldn't delete

◆ DeleteStoredValue()

static bool FGenericPlatformMisc::DeleteStoredValue ( const FString &  InStoreId,
const FString &  InSectionName,
const FString &  InKeyName 
)
static

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

参数
InStoreIdThe name used to identify the store you want to use (eg, MyGame)
InSectionNameThe section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo)
InKeyNameThe name of the key to set the value for
返回
bool true if the value was deleted correctly, false if not found or couldn't delete

◆ Exec()

static bool FGenericPlatformMisc::Exec ( class UWorld *  InWorld,
const TCHAR *  Cmd,
FOutputDevice &  Out 
)
inlinestatic

Platform-specific Exec function

参数
InWorldWorld context
CmdThe command to execute
OutThe output device to utilize
返回
bool true if command was processed, false if not

◆ GamePersistentDownloadDir()

static const TCHAR * FGenericPlatformMisc::GamePersistentDownloadDir ( )
static

Return the GamePersistentDownloadDir.

On some platforms, returns the writable directory for downloaded data that persists across play sessions. This dir is always per-game.

◆ GetBatteryLevel()

static FORCEINLINE int FGenericPlatformMisc::GetBatteryLevel ( )
inlinestatic

Gets the current battery level.

返回
the battery level between 0 and 100.

◆ GetConvertibleLaptopMode()

static EConvertibleLaptopMode FGenericPlatformMisc::GetConvertibleLaptopMode ( )
static

Gets the current mode of convertible laptops, i.e.

Laptop or Tablet.

返回
The laptop mode, or Unknown if not known, or NotSupported if not a convertible laptop.

◆ GetCPUBrand()

static FString FGenericPlatformMisc::GetCPUBrand ( )
static

Uses cpuid instruction to get the CPU brand string

返回
CPU brand string

◆ GetCPUChipset()

static FString FGenericPlatformMisc::GetCPUChipset ( )
static

Returns the CPU chipset if known

返回
CPU chipset string (or "Unknown")

◆ GetCPUInfo()

static uint32 FGenericPlatformMisc::GetCPUInfo ( )
static

On x86(-64) platforms, uses cpuid instruction to get the CPU signature

返回
CPU info bitfield
    Bits 0-3    Stepping ID
    Bits 4-7    Model
    Bits 8-11   Family
    Bits 12-13  Processor type (Intel) / Reserved (AMD)
    Bits 14-15  Reserved
    Bits 16-19  Extended model
    Bits 20-27  Extended family
    Bits 28-31  Reserved

◆ GetCPUVendor()

static FString FGenericPlatformMisc::GetCPUVendor ( )
static

Uses cpuid instruction to get the vendor string

返回
CPU vendor name

◆ GetDefaultDeviceProfileName()

static const TCHAR * FGenericPlatformMisc::GetDefaultDeviceProfileName ( )
static

Gets the default profile name.

Used if there is no device profile specified

返回
the default profile name.

◆ GetDefaultLanguage()

static FString FGenericPlatformMisc::GetDefaultLanguage ( )
static

Get the default language (for localization) used by this platform.

注解
This is typically the same as GetDefaultLocale unless the platform distinguishes between the two.
This should be returned in IETF language tag form:
  • A two-letter ISO 639-1 language code (eg, "zh").
  • An optional four-letter ISO 15924 script code (eg, "Hans").
  • An optional two-letter ISO 3166-1 country code (eg, "CN").

◆ GetDefaultLocale()

static FString FGenericPlatformMisc::GetDefaultLocale ( )
static

Get the default locale (for internationalization) used by this platform.

注解
This should be returned in IETF language tag form:
  • A two-letter ISO 639-1 language code (eg, "zh").
  • An optional four-letter ISO 15924 script code (eg, "Hans").
  • An optional two-letter ISO 3166-1 country code (eg, "CN").

◆ GetDefaultPathSeparator()

static const TCHAR * FGenericPlatformMisc::GetDefaultPathSeparator ( )
static
返回
platform specific path separator.

◆ GetDeviceId()

static FString FGenericPlatformMisc::GetDeviceId ( )
static

Returns a unique string for device identification.

Differs from the deprecated GetUniqueDeviceId in that there is no default implementation (which used unreliable Mac address determiniation). This code is expected to use platform-specific methods to identify the device.

WARNING: Use of this method in your app may imply technical certification requirments for your platform! For instance, consoles often require cert waivers to be in place before calling APIs that can track a device, so be very careful that you are following your platform's protocols for accessing device IDs. See the platform- specific implementations of this method for details on what APIs are used.

If you do not have permission to call this on one or more of your platforms, set GET_DEVICE_ID_UNAVAILABLE=1 in your build step to ensure that any calls that may be made to this API will simply return an empty string.

返回
the unique string generated by this platform for this device, or an empty string if one is not available.

◆ GetDeviceMakeAndModel()

static FString FGenericPlatformMisc::GetDeviceMakeAndModel ( )
static
返回
"DeviceMake|DeviceModel" if possible, and "CPUVendor|CPUBrand" otherwise, optionally returns "DeviceMake|DeviceModel|CPUChipset" if known

◆ GetDeviceOrientation()

static EDeviceScreenOrientation FGenericPlatformMisc::GetDeviceOrientation ( )
static

Returns the orientation of the device: e.g.

Portrait, LandscapeRight.

参见
EScreenOrientation

◆ GetDeviceTemperatureLevel()

static float FGenericPlatformMisc::GetDeviceTemperatureLevel ( )
static

Returns the current device temperature level.

Level is a relative value that is platform dependent. Lower is cooler, higher is warmer. Level of -1 means Unimplemented.

◆ GetDeviceVolume()

static int32 FGenericPlatformMisc::GetDeviceVolume ( )
static

Returns the device volume if the device is capable of returning that information.

-1 : Unknown 0 : Muted 100 : Full Volume

◆ GetEnvironmentVariable() [1/2]

static FString FGenericPlatformMisc::GetEnvironmentVariable ( const TCHAR *  VariableName)
static

Retrieve a environment variable from the system

参数
VariableNameThe name of the variable (ie "Path")
返回
Value of the variable, or an empty string if not set.

◆ GetEnvironmentVariable() [2/2]

static void FGenericPlatformMisc::GetEnvironmentVariable ( const TCHAR *  VariableName,
TCHAR *  Result,
int32  ResultLength 
)
inlinestatic

Retrieve a environment variable from the system

参数
VariableNameThe name of the variable (ie "Path")
ResultThe string to copy the value of the variable into
ResultLengthThe size of the Result string

◆ GetEpicAccountId()

static FString FGenericPlatformMisc::GetEpicAccountId ( )
static

Get the Epic account ID for the user who last used the Launcher.

返回
an empty string if the account ID was not present or it failed to read it for any reason.

◆ GetFileManagerName()

static FText FGenericPlatformMisc::GetFileManagerName ( )
static
返回
Get the name of the platform specific file manager (eg, Explorer on Windows, Finder on OS X)

◆ GetHashedMacAddressString()

static FString FGenericPlatformMisc::GetHashedMacAddressString ( )
static

Retrieve the Mac address of the current adapter as a hashed string (privacy).

This generally relies on GetMacAddress() being implemented for the platform, if possible.

返回
String representing the hashed Mac address, or empty string.

◆ GetLocalCurrencyCode()

static FString FGenericPlatformMisc::GetLocalCurrencyCode ( )
static

Returns the currency code associated with the device's locale

返回
the currency code associated with the device's locale

◆ GetLocalCurrencySymbol()

static FString FGenericPlatformMisc::GetLocalCurrencySymbol ( )
static

Returns the currency symbol associated with the device's locale

返回
the currency symbol associated with the device's locale

◆ GetLoginId()

static FString FGenericPlatformMisc::GetLoginId ( )
static

Returns a unique string associated with the login account of the current machine.

Implemented using persistent storage like the registry on window (using HKCU), so is susceptible to anything that could reset or revert that storage if the ID is created, which is generally during install or first run of the app.

Note: This is NOT a user or machine fingerprint, as multiple logins on the same machine will not share the same ID, and it is not based on the hardware of the user. It is completely random and non-identifiable.

返回
a string containing the LoginID, or empty if not available.

◆ GetMacAddress()

static TArray< uint8 > FGenericPlatformMisc::GetMacAddress ( )
static

Retrieve the Mac address of the current adapter.

This is generally platform-dependent code that other platforms must implement.

返回
array of bytes representing the Mac address, or empty array if unable to determine.

◆ GetMacAddressString()

static FString FGenericPlatformMisc::GetMacAddressString ( )
static

Retrieve the Mac address of the current adapter as a string.

This generally relies on GetMacAddress() being implemented for the platform, if possible.

返回
String representing the Mac address, or empty string.

◆ GetMachineId()

static FGuid FGenericPlatformMisc::GetMachineId ( )
static

Get (or create) the unique ID used to identify this computer.

This is sort of a misnomer, as there will actually be one per user account on the operating system. This is NOT based on a machine fingerprint.

◆ GetNullRHIShaderFormat()

static const TCHAR * FGenericPlatformMisc::GetNullRHIShaderFormat ( )
static

Determines the shader format for the platform

返回
Returns the shader format to be used by that platform

◆ GetOperatingSystemId()

static FString FGenericPlatformMisc::GetOperatingSystemId ( )
static

Gets a globally unique ID the represents a particular operating system install.

返回
an opaque string representing the ID, or an empty string if the platform doesn't support one.

◆ GetOSVersion()

static FString FGenericPlatformMisc::GetOSVersion ( )
static

Gets a string representing the numeric OS version (as opposed to a translated OS version that GetOSVersions returns).

The returned string should try to be brief and avoid newlines and symbols, but there's technically no restriction on the string it can return. If the implementation does not support this, it should return an empty string.

◆ GetPlatformChunkInstall()

static IPlatformChunkInstall * FGenericPlatformMisc::GetPlatformChunkInstall ( )
static

Returns the platform specific chunk based install interface

返回
Returns the platform specific chunk based install implementation

◆ GetPlatformCompression()

static IPlatformCompression * FGenericPlatformMisc::GetPlatformCompression ( )
static

Returns the platform specific compression interface

返回
Returns the platform specific compression interface

◆ GetPlatformFeaturesModuleName()

static const TCHAR * FGenericPlatformMisc::GetPlatformFeaturesModuleName ( )
inlinestatic

Return the name of the platform features module.

Can be nullptr if there are no extra features for this platform

◆ GetPreferredLanguages()

static TArray< FString > FGenericPlatformMisc::GetPreferredLanguages ( )
static

Returns an array of the user's preferred languages in order of preference

返回
An array of language IDs ordered from most preferred to least

◆ GetPrimaryGPUBrand()

static FString FGenericPlatformMisc::GetPrimaryGPUBrand ( )
static
返回
primary GPU brand string

◆ GetSHA256Signature()

static bool FGenericPlatformMisc::GetSHA256Signature ( const void *  Data,
uint32  ByteSize,
FSHA256Signature &  OutSignature 
)
static

Generates the SHA256 signature of the given data.

参数
DataPointer to the beginning of the data to hash
BytesizeSize of the data to has, in bytes.
OutSignatureOutput Structure to hold the computed signature.
返回
whether the hash was computed successfully

◆ GetStoredValue()

static bool FGenericPlatformMisc::GetStoredValue ( const FString &  InStoreId,
const FString &  InSectionName,
const FString &  InKeyName,
FString &  OutValue 
)
static

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

参数
InStoreIdThe name used to identify the store you want to use (eg, MyGame)
InSectionNameThe section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo)
InKeyNameThe name of the key to get the value for
OutValueThe value found
返回
bool true if the entry was found (and OutValue contains the result), false if not

◆ GetSystemErrorMessage()

static const TCHAR * FGenericPlatformMisc::GetSystemErrorMessage ( TCHAR *  OutBuffer,
int32  BufferCount,
int32  Error 
)
static

Returns the last system error code in string form.

NOTE: Only one return value is valid at a time!

参数
OutBufferthe buffer to be filled with the error message
BufferLengththe size of the buffer in character count
Errorthe error code to convert to string form

◆ GetSystemFontBytes()

static TArray< uint8 > FGenericPlatformMisc::GetSystemFontBytes ( )
static
返回
Memory representing a true type or open type font provided by the platform as a default font for unreal to consume; empty array if the default font failed to load.

◆ GetTimeZoneId()

static FString FGenericPlatformMisc::GetTimeZoneId ( )
static

Get the timezone identifier for this platform, or an empty string if the default timezone calculation will work.

注解
This should return either an Olson timezone (eg, "America/Los_Angeles") or an offset from GMT/UTC (eg, "GMT-8:00").

◆ GetUniqueAdvertisingId()

static FString FGenericPlatformMisc::GetUniqueAdvertisingId ( )
static

Returns a unique string for advertising identification

返回
the unique string generated by this platform for this device

◆ HasNonoptionalCPUFeatures()

static bool FGenericPlatformMisc::HasNonoptionalCPUFeatures ( )
static
返回
whether this cpu supports certain required instructions or not

◆ HasProjectPersistentDownloadDir()

static bool FGenericPlatformMisc::HasProjectPersistentDownloadDir ( )
inlinestatic

Return true if the PersistentDownloadDir is available.

On some platforms, a writable directory might not be available by default. Using this function allows handling that case early.

◆ HasSeparateChannelForDebugOutput()

static bool FGenericPlatformMisc::HasSeparateChannelForDebugOutput ( )
static

Whether the platform has a separate debug channel to stdout (eg.

OutputDebugString on Windows). Used to suppress messages being output twice if both go to the same place.

◆ Is64bitOperatingSystem()

static FORCEINLINE bool FGenericPlatformMisc::Is64bitOperatingSystem ( )
inlinestatic

Detects whether we're running in a 64-bit operating system.

返回
true if we're running in a 64-bit operating system

◆ IsEnsureAllowed()

static bool FGenericPlatformMisc::IsEnsureAllowed ( )
inlinestatic

Allows disabling ensure()s without rebuilding the binary, by either a commandline switch or a hotfix.

返回
ensure is allowed

◆ IsPackagedForDistribution()

static bool FGenericPlatformMisc::IsPackagedForDistribution ( )
inlinestatic
返回
true if this build is meant for release to retail

◆ IsRemoteSession()

static bool FGenericPlatformMisc::IsRemoteSession ( )
inlinestatic

Check to see if the platform is being viewed remotely.

In such a mode we should aim to minimize screen refresh to get the best performance on the remote viewer

◆ IsStandaloneStereoOnlyDevice()

static bool FGenericPlatformMisc::IsStandaloneStereoOnlyDevice ( )
inlinestatic

Returns whether this is a 'stereo only' platform.

In general, stereo only platforms will not support on-screen touch input nor require virtual joysticks (though you should use those query functions to verify). The screen is always used for stereo output, and isn't a mode that is enabled/disabled.

◆ IsValidAbsolutePathFormat()

static bool FGenericPlatformMisc::IsValidAbsolutePathFormat ( const FString &  Path)
inlinestatic

Checks structure of the path against platform formatting requirements

return true if path is formatted validly

◆ LoadTextFileFromPlatformPackage()

static FString FGenericPlatformMisc::LoadTextFileFromPlatformPackage ( const FString &  RelativePath)
static

Loads a text file relative to the package root on platforms that distribute apps in package formats.

For other platforms, the path is relative to the root directory.

◆ MessageBoxExt()

static EAppReturnType::Type FGenericPlatformMisc::MessageBoxExt ( EAppMsgType::Type  MsgType,
const TCHAR *  Text,
const TCHAR *  Caption 
)
static

Show a message box if possible, otherwise print a message and return the default

参数
MsgTypeWhat sort of options are provided
TextSpecific message
CaptionString indicating the title of the message box
返回
Very strange convention...not really EAppReturnType, see implementation

◆ NeedsNonoptionalCPUFeaturesCheck()

static bool FGenericPlatformMisc::NeedsNonoptionalCPUFeaturesCheck ( )
static
返回
whether to check for specific CPU compatibility or not

◆ NormalizePath()

static void FGenericPlatformMisc::NormalizePath ( FString &  InPath)
inlinestatic

Platform-specific normalization of path E.g.

on Linux/Unix platforms, replaces ~ with user home directory, so ~/.config becomes /home/joe/.config (or /Users/Joe/.config)

◆ OsExecute()

static bool FGenericPlatformMisc::OsExecute ( const TCHAR *  CommandType,
const TCHAR *  Command,
const TCHAR *  CommandLine = NULL 
)
inlinestatic

Has the OS execute a command and path pair (such as launch a browser)

参数
ComandTypeOS hint as to the type of command
Commandthe command to execute
CommandLinethe commands to pass to the executable
返回
whether the command was successful or not

◆ PlatformTearDown()

static void FGenericPlatformMisc::PlatformTearDown ( )
inlinestatic

Called during AppExit().

Log, Config still exist at this point, but not much else does.

◆ PumpEssentialAppMessages()

static void FGenericPlatformMisc::PumpEssentialAppMessages ( )
inlinestatic

Pumps app messages only if there are essential keep-alive messages pending.

This function called from time-sensitive parts of the code and should take minimal time if there are no essential messages waiting

◆ RequestExit()

static void FGenericPlatformMisc::RequestExit ( bool  Force)
static

Requests application exit.

参数
ForceIf true, perform immediate exit (dangerous because config code isn't flushed, etc). If false, request clean main-loop exit from the platform specific code.

◆ RequestExitWithStatus()

static void FGenericPlatformMisc::RequestExitWithStatus ( bool  Force,
uint8  ReturnCode 
)
static

Requests application exit with a specified return code.

Name is different from RequestExit() so overloads of just one of functions are possible.

参数
ForceIf true, perform immediate exit (dangerous because config code isn't flushed, etc). If false, request clean main-loop exit from the platform specific code.
ReturnCodeThis value will be returned from the program (on the platforms where it's possible). Limited to 0-255 to conform with POSIX.

◆ SetEnvironmentVar()

static void FGenericPlatformMisc::SetEnvironmentVar ( const TCHAR *  VariableName,
const TCHAR *  Value 
)
static

Sets an environment variable to the local process's environment

参数
VariableNameThe name of the variable (ie "Path")
ValueThe string to set the variable to.

◆ SetEpicAccountId()

static bool FGenericPlatformMisc::SetEpicAccountId ( const FString &  AccountId)
static

Set the Epic account ID for the user who last used the Launcher

返回
true if the account ID was set successfully, false if something failed and it was not set.

◆ SetMemoryWarningHandler()

static void FGenericPlatformMisc::SetMemoryWarningHandler ( void(*)(const FGenericMemoryWarningContext &Context)  Handler)
inlinestatic

Set a handler to be called when there is a memory warning from the OS

参数
HandlerThe handler to call

◆ SetStoredValue()

static bool FGenericPlatformMisc::SetStoredValue ( const FString &  InStoreId,
const FString &  InSectionName,
const FString &  InKeyName,
const FString &  InValue 
)
static

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

参数
InStoreIdThe name used to identify the store you want to use (eg, MyGame)
InSectionNameThe section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo)
InKeyNameThe name of the key to set the value for
InValueThe value to set
返回
bool true if the value was set correctly, false if not

◆ SetStoredValues()

static bool FGenericPlatformMisc::SetStoredValues ( const FString &  InStoreId,
const FString &  InSectionName,
const TMap< FString, FString > &  InKeyValues 
)
static

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

参数
InStoreIdThe name used to identify the store you want to use (eg, MyGame)
InSectionNameThe section that this key->value pair is placed within (can contain / separators, eg UserDetails/AccountInfo)
InKeyValuesThe mapping of key->value pairs to set
返回
bool true if the value was set correctly, false if not

◆ ShareURL()

static void FGenericPlatformMisc::ShareURL ( const FString &  URL,
const FText &  Description,
int32  LocationHintX,
int32  LocationHintY 
)
inlinestatic

Perform a mobile-style sharing of a URL.

Will use native UI to display sharing target

◆ ShouldDisablePluginAtRuntime()

static bool FGenericPlatformMisc::ShouldDisablePluginAtRuntime ( const FString &  PluginName)
inlinestatic

Allows platform at runtime to disable unsupported plugins

参数
PluginNameName of enabled plugin to consider
返回
bool true if plugin should be disabled

◆ SupportsMultithreadedFileHandles()

static bool FGenericPlatformMisc::SupportsMultithreadedFileHandles ( )
inlinestatic
返回
Whether filehandles can be opened on one thread and read/written on another thread

◆ TagBuffer()

static FORCEINLINE void FGenericPlatformMisc::TagBuffer ( const char *  Label,
uint32  Category,
const void *  Buffer,
size_t  BufferSize 
)
inlinestatic

Platform specific function for tagging a memory buffer with a label.

Helps see memory access in profilers

◆ TriggerMobileHaptics()

static void FGenericPlatformMisc::TriggerMobileHaptics ( )
inlinestatic

For mobile devices, this will kick the haptic type that was set in PrepareMobileHaptics.

It can be called multiple times with only a single call to Prepare

◆ UseRenderThread()

static bool FGenericPlatformMisc::UseRenderThread ( )
static

Checks if platform wants to use a rendering thread on current device

返回
true if allowed, false if shouldn't use a separate rendering thread

该结构体的文档由以下文件生成: