Skip to content

UOperatingSystemStatics

#include <OperatingSystemSimulator/Public/Global/OperatingSystemStatics.h>
class UOperatingSystemStatics

Defined in OperatingSystemStatics.h:33

Inherits: UBlueprintFunctionLibrary

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemStatics["UOperatingSystemStatics"]
  class UBlueprintFunctionLibrary["UBlueprintFunctionLibrary"]
  UBlueprintFunctionLibrary <|-- UOperatingSystemStatics
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemStatics {
    +IsUniqueIdValid(const FOperatingSystemUniqueId &TestID) bool
    +UniqueIdToString(const FOperatingSystemUniqueId &TestID) FString
    +IsOperatingSystemTagValid(const FGameplayTag &TestTag) bool
    +GetSize(const EOperatingSystemCommonSizes &Size) int32
    +CreateGenericError(const FText ErrorCode, const FText ErrorDes FGenericError()
    +CreateNotification(const FText Title, const FText Description, FOperatingSystemNotification()
    +ConvertMB_ToBytes(const float SizeInMB) double
    +ConvertGB_ToBytes(const float SizeInGB) double
    +ConvertGB_ToMB(const float SizeInGB) float
    +ConvertMB_ToGB(const float SizeInMB) float
    +ConvertBytes_ToGB(const double SizeInBytes) float
    +ConvertBytes_ToMB(const double SizeInBytes) float
    +FindHardwareByTag(const AOperatingSystemDeviceActor *TargetDe UOperatingSystemBaseHardware() *
    +GetCpuSocketName(const FGameplayTag SocketTag, FText &OutVal bool
    +ShutdownOperatingSystem(UOperatingSystem *TargetOS, FGenericError &
    +RestartOperatingSystem(UOperatingSystem *TargetOS, FGenericError &
    +AddNotification(UOperatingSystem *TargetOperatingSystem, co bool
    +AddNotificationFromError(UOperatingSystem *TargetOperatingSystem, co bool
    +OpenFile(UOperatingSystemFile *TargetFile, FGenericE UOperatingSystemFile() *
    +IsUserValid(const FOperatingSystemUser &TestUser) bool
    +IsRegisteredUserValid(const FOperatingSystemUser &TestUser) bool
    +UserHasCompleteProfile(const FOperatingSystemUser &TestUser) bool
    +UsersEqual(const FOperatingSystemUser &Lhs, const FOpe bool
    +UsersNotEqual(const FOperatingSystemUser &Lhs, const FOpe bool
    +IsNotificationValid(const FOperatingSystemNotification &TestNot bool
    +GetSpecialDirectoryName(const FGameplayTag DirectoryTag, FText &Out bool
    +GetCpuSpeedAsText(const float &CpuSpeedInGHz, const bool bUse FText
    +GetSizeAsText(const EOperatingSystemCommonSizes Size) FText
    +GenerateRandomErrorCode() FText
    +GetTimeAsText(const FDateTime &DateTime, const bool bShow FText
    +GetDateAsText(const FDateTime &DateTime, const EOperating FText
    +GetRelativeTime(const FDateTime &UtcTime, const bool bShowM FText
    +RegexExpression(const FString &TargetString, const FString  FString
    +DeterminePasswordStrength(const FString &Input) EOperatingSystemPasswordStrength()
    +FindDeviceActorByTag(const UObject *WorldContextObject, const FG AOperatingSystemDeviceActor() *
    +FindDeviceActorsByTag(const UObject *WorldContextObject, const FG
    +FindMessengerForDevice(const UObject *WorldContextObject, const FG UOperatingSystemDeviceMessenger() *
    +FindMessengerFromOperatingSystem(const UOperatingSystem *TargetOS) UOperatingSystemDeviceMessenger() *
    +GetUserManager(const UObject *WorldContextObject) UOperatingSystemUserManager() *
    +IsProgramClassCompatibleWithOS(const TSubclassOf< UOperatingSystemBaseProg bool
    +GetTimeDifferenceFromUTC() FTimespan
    +ConvertUtcTimeToLocalTime(const FDateTime &UtcTime) FDateTime
    +GetRangeTime(const FOperatingSystemRangeTime &TimeRange, float
    +RequestFundsFromBank(const UObject *WorldContextObject, FGeneric
    +CalculatePercentageForValue(const float Percentage, const float TargetV float
    +EvaluateMathExpression(const FString Expression, float &OutValue) bool
    +IsMailDataValid(const FOperatingSystemMailSetting &TestMail bool
    +DrawWidgetToTexture(const UObject *WorldContextObject, UTexture bool
    +GetMonthName(const FDateTime &DateTime, const bool bShor FText
    +CreateTextureFromPath(const FString &InImagePath) UTexture2D *
    +CreateNewBattery(const FText Name, const FText Brand, const  FOperatingSystemBattery()
    +GetBatteryHealth(const FOperatingSystemBattery &Battery, con float
    +GetBatteryHealthText(const FOperatingSystemBattery &Battery) FText
    +GetPathDelimiter(const UOperatingSystem *TargetOS) FString
  }

Caller impact — IsOperatingSystemTagValid

Section titled “Caller impact — IsOperatingSystemTagValid”

Documented call sites inside the plugin (9):

flowchart LR
  UOperatingSystemStatics__IsOperatingSystemTagValid["UOperatingSystemStatics::IsOperatingSystemTagValid"]
  UOperatingSystemWorldSubsystem__FindDeviceActorByTag["UOperatingSystemWorldSubsystem::FindDeviceActorByTag"]
  UOperatingSystemWorldSubsystem__FindDeviceActorByTag --> UOperatingSystemStatics__IsOperatingSystemTagValid
  UOperatingSystemWorldSubsystem__FindDeviceActorsByTag["UOperatingSystemWorldSubsystem::FindDeviceActorsByTag"]
  UOperatingSystemWorldSubsystem__FindDeviceActorsByTag --> UOperatingSystemStatics__IsOperatingSystemTagValid
  UOperatingSystemDirectory__FindDirectoryByTag["UOperatingSystemDirectory::FindDirectoryByTag"]
  UOperatingSystemDirectory__FindDirectoryByTag --> UOperatingSystemStatics__IsOperatingSystemTagValid
  UOperatingSystemPartition__FindDirectoryByTag["UOperatingSystemPartition::FindDirectoryByTag"]
  UOperatingSystemPartition__FindDirectoryByTag --> UOperatingSystemStatics__IsOperatingSystemTagValid
  UOperatingSystemStatics__GetCpuSocketName["UOperatingSystemStatics::GetCpuSocketName"]
  UOperatingSystemStatics__GetCpuSocketName --> UOperatingSystemStatics__IsOperatingSystemTagValid
  UOperatingSystemStatics__GetSpecialDirectoryName["UOperatingSystemStatics::GetSpecialDirectoryName"]
  UOperatingSystemStatics__GetSpecialDirectoryName --> UOperatingSystemStatics__IsOperatingSystemTagValid
  AOperatingSystemDeviceActor__Internal_OnValidate["AOperatingSystemDeviceActor::Internal_OnValidate"]
  AOperatingSystemDeviceActor__Internal_OnValidate --> UOperatingSystemStatics__IsOperatingSystemTagValid
  UOperatingSystemDirectory__Internal_Validate["UOperatingSystemDirectory::Internal_Validate"]
  UOperatingSystemDirectory__Internal_Validate --> UOperatingSystemStatics__IsOperatingSystemTagValid
  UOperatingSystemBaseHardware__Validate["UOperatingSystemBaseHardware::Validate"]
  UOperatingSystemBaseHardware__Validate --> UOperatingSystemStatics__IsOperatingSystemTagValid

Documented call sites inside the plugin (7):

flowchart LR
  UOperatingSystemStatics__GetPathDelimiter["UOperatingSystemStatics::GetPathDelimiter"]
  UOperatingSystemNonUnix__CreateDirectoryInPath["UOperatingSystemNonUnix::CreateDirectoryInPath"]
  UOperatingSystemNonUnix__CreateDirectoryInPath --> UOperatingSystemStatics__GetPathDelimiter
  UOperatingSystemUnix__CreateDirectoryInPath["UOperatingSystemUnix::CreateDirectoryInPath"]
  UOperatingSystemUnix__CreateDirectoryInPath --> UOperatingSystemStatics__GetPathDelimiter
  UOperatingSystemDirectory__GetFullPath["UOperatingSystemDirectory::GetFullPath"]
  UOperatingSystemDirectory__GetFullPath --> UOperatingSystemStatics__GetPathDelimiter
  UOperatingSystemPartition__GetInterfaceFromPath["UOperatingSystemPartition::GetInterfaceFromPath"]
  UOperatingSystemPartition__GetInterfaceFromPath --> UOperatingSystemStatics__GetPathDelimiter
  UOperatingSystemPartition__GetPartitionPath["UOperatingSystemPartition::GetPartitionPath"]
  UOperatingSystemPartition__GetPartitionPath --> UOperatingSystemStatics__GetPathDelimiter
  UOperatingSystemDirectory__Internal_GetDirectoryFromPathNonUnix["UOperatingSystemDirectory::Internal_GetDirectoryFromPathNonUnix"]
  UOperatingSystemDirectory__Internal_GetDirectoryFromPathNonUnix --> UOperatingSystemStatics__GetPathDelimiter
  UOperatingSystemUnix__StartOperatingSystemImpl["UOperatingSystemUnix::StartOperatingSystemImpl"]
  UOperatingSystemUnix__StartOperatingSystemImpl --> UOperatingSystemStatics__GetPathDelimiter

Documented call sites inside the plugin (5):

flowchart LR
  UOperatingSystemStatics__GetUserManager["UOperatingSystemStatics::GetUserManager"]
  UOperatingSystem__CreateNewUser["UOperatingSystem::CreateNewUser"]
  UOperatingSystem__CreateNewUser --> UOperatingSystemStatics__GetUserManager
  UOperatingSystem__GetAllUsers["UOperatingSystem::GetAllUsers"]
  UOperatingSystem__GetAllUsers --> UOperatingSystemStatics__GetUserManager
  UOperatingSystem__LoginUser["UOperatingSystem::LoginUser"]
  UOperatingSystem__LoginUser --> UOperatingSystemStatics__GetUserManager
  UOperatingSystem__StartOperatingSystem["UOperatingSystem::StartOperatingSystem"]
  UOperatingSystem__StartOperatingSystem --> UOperatingSystemStatics__GetUserManager
  UOperatingSystem__UpdateCurrentUserDetails["UOperatingSystem::UpdateCurrentUserDetails"]
  UOperatingSystem__UpdateCurrentUserDetails --> UOperatingSystemStatics__GetUserManager

A static library of functions related to the operating system.

This class provides various static functions for operating system related operations.

ReturnNameDescription
boolIsUniqueIdValid staticChecks whether a given unique id is valid or not.
FStringUniqueIdToString staticConverts a unique ID to its string representation.
boolIsOperatingSystemTagValid staticChecks if the given operating system tag is valid by verifying if it is not null and not equal to the invalid tag.
int32GetSize staticGet the size corresponding to the given operating system common size.
FGenericErrorCreateGenericError staticCreates a generic error object using the provided error code and error description. The error code and error description should be passed as parameters to this method.
FOperatingSystemNotificationCreateNotification staticCreates a new operating system notification.
doubleConvertMB_ToBytes staticConverts a size in Megabytes (MB) to bytes.
doubleConvertGB_ToBytes staticConverts size from gigabytes (GB) to bytes.
floatConvertGB_ToMB staticConverts the given size in gigabytes to megabytes.
floatConvertMB_ToGB staticConverts the given size in megabytes to gigabytes.
floatConvertBytes_ToGB staticConverts the given size in bytes to gigabytes.
floatConvertBytes_ToMB staticConverts a size in bytes to megabytes.
UOperatingSystemBaseHardware *FindHardwareByTag staticFinds a hardware object with a specific tag on a given device.
boolGetCpuSocketName staticRetrieves the name of a CPU socket based on a given socket tag.
voidShutdownOperatingSystem staticShuts down an operating system.
voidRestartOperatingSystem staticRestarts the operating system of a target device.
boolAddNotification staticAdds a notification to the specified operating system.
boolAddNotificationFromError staticAdds a notification from an error to the operating system.
UOperatingSystemFile *OpenFile staticOpens the given file and returns the file object.
boolIsUserValid staticChecks if a user is valid.
boolIsRegisteredUserValid staticCheck if the user is registered (in the sense that user has email and password set)
boolUserHasCompleteProfile staticChecks if the user has a complete profile.
boolUsersEqual staticCompares two FOperatingSystemUser objects for equality.
boolUsersNotEqual staticChecks if two FOperatingSystemUser objects are not equal.
boolIsNotificationValid staticChecks if a notification is valid.
boolGetSpecialDirectoryName staticRetrieves the special directory name based on the given directory tag.
FTextGetCpuSpeedAsText staticpublic static UOperatingSystemStatics::GetCpuSpeedAsText Returns the CPU speed as FText.
FTextGetSizeAsText staticGet the size as text for a given operating system size.
FTextGenerateRandomErrorCode staticGenerates a random error code.
FTextGetTimeAsText staticReturns the given DateTime as a text representation.
FTextGetDateAsText staticReturns the given date in text format.
FTextGetRelativeTime staticReturns the relative time difference between the given UtcTime and the current local time.
FStringRegexExpression staticPerforms regex expression matching on a target string. This method searches the target string for the first occurrence of the regex pattern and returns the matched substring.
EOperatingSystemPasswordStrengthDeterminePasswordStrength staticDetermines the strength of a password based on the given input string.
AOperatingSystemDeviceActor *FindDeviceActorByTag staticFinds a device actor by tag.
voidFindDeviceActorsByTag staticFinds device actors with a specific gameplay tag.
UOperatingSystemDeviceMessenger *FindMessengerForDevice staticFinds the messenger for a given device by its test tag.
UOperatingSystemDeviceMessenger *FindMessengerFromOperatingSystem staticFinds a messenger for the given operating system.
UOperatingSystemUserManager *GetUserManager staticRetrieve the user manager instance for the operating system.
boolIsProgramClassCompatibleWithOS staticCheck if a program class is compatible with the operating system.
FTimespanGetTimeDifferenceFromUTC staticReturns the time difference between UTC and computer local time.
FDateTimeConvertUtcTimeToLocalTime staticTakes a UTC time and converts it to the local time zone.
floatGetRangeTime staticRetrieves a random time from a given range represented by the structure FOperatingSystemRangeTime. If the range is empty or invalid, it will return the fallback time.
voidRequestFundsFromBank staticRequest funds from imaginary bank.
floatCalculatePercentageForValue staticCalculates the percentage of a given TargetValue based on the Percentage provided. If the Percentage is less than or equal to 0, the method returns 0.
boolEvaluateMathExpression staticEvaluates the numerical equation. Operators and precedence: 1:+- 2:/% 3:* 4:^ 5:&| Unary: - Types: Numbers (0-9.), Hex ($0-$f) Grouping: ( )
boolIsMailDataValid staticChecks if the provided mail data is valid.
boolDrawWidgetToTexture staticProjects the given widget to a texture target.
FTextGetMonthName staticReturns the month name from the given date time struct. If Short is selected, return name will be “Jan”, “Feb” instead of “January”, “February”.
UTexture2D *CreateTextureFromPath staticReturns a UTexture2D from the given path. Image path should be accessible and absolute (for example: C:\SomeDirectory\MyImage.png)
FOperatingSystemBatteryCreateNewBattery staticCreates a new battery from given parameters.
floatGetBatteryHealth static inlineReturns the battery health of the given battery.
FTextGetBatteryHealthText static inlineReturns the text description of the battery health state.
FStringGetPathDelimiter staticReturns the path delimiter used by the given operating system.

static

static bool IsUniqueIdValid(const FOperatingSystemUniqueId & TestID)

Defined in OperatingSystemStatics.h:88 Checks whether a given unique id is valid or not.

  • TestID The unique id to be checked.

True if the unique id is valid, false otherwise.


static

static FString UniqueIdToString(const FOperatingSystemUniqueId & TestID)

Defined in OperatingSystemStatics.h:97 Converts a unique ID to its string representation.

  • TestID The unique ID to convert.

The string representation of the unique ID.


static

static bool IsOperatingSystemTagValid(const FGameplayTag & TestTag)

Defined in OperatingSystemStatics.h:107 Checks if the given operating system tag is valid by verifying if it is not null and not equal to the invalid tag.

  • TestTag The operating system tag to check.

True if the operating system tag is valid, false otherwise.


static

static int32 GetSize(const EOperatingSystemCommonSizes & Size)

Defined in OperatingSystemStatics.h:120 Get the size corresponding to the given operating system common size.

This method takes an enumeration value representing a common size for an operating system. It returns the actual size in bytes corresponding to the given common size. If the input size is EOperatingSystemCommonSizes::None, the method returns 0.

  • Size The operating system common size enumeration value.

The actual size in bytes corresponding to the given operating system common size.

  • None

static

static FGenericError CreateGenericError(const FText ErrorCode, const FText ErrorDescription)

Defined in OperatingSystemStatics.h:132 Creates a generic error object using the provided error code and error description. The error code and error description should be passed as parameters to this method.

  • ErrorCode The error code for the generic error object.

  • ErrorDescription The error description for the generic error object.

FGenericError The created generic error object.


static

static FOperatingSystemNotification CreateNotification(const FText Title, const FText Description, const EOperatingSystemNotificationCategory NotificationCategory, const EOperatingSystemNotificationType Verbosity, const TSoftObjectPtr< UObject > Icon, const FText Code)

Defined in OperatingSystemStatics.h:146 Creates a new operating system notification.

  • Title The title of the notification.

  • Description The description of the notification.

  • NotificationCategory The category of the notification.

  • Verbosity The verbosity level of the notification.

  • Icon The icon associated with the notification.

  • Code The code associated with the notification.

The newly created operating system notification.


static

static double ConvertMB_ToBytes(const float SizeInMB)

Defined in OperatingSystemStatics.h:155 Converts a size in Megabytes (MB) to bytes.

  • SizeInMB The size in Megabytes to convert.

The corresponding size in bytes.


static

static double ConvertGB_ToBytes(const float SizeInGB)

Defined in OperatingSystemStatics.h:166 Converts size from gigabytes (GB) to bytes.

This method takes a size in gigabytes and converts it to bytes.

  • SizeInGB The size in gigabytes to convert.

The size in bytes after conversion.


static

static float ConvertGB_ToMB(const float SizeInGB)

Defined in OperatingSystemStatics.h:175 Converts the given size in gigabytes to megabytes.

  • SizeInGB The size in gigabytes to be converted.

The converted size in megabytes.


static

static float ConvertMB_ToGB(const float SizeInMB)

Defined in OperatingSystemStatics.h:184 Converts the given size in megabytes to gigabytes.

  • SizeInMB The size in megabytes to be converted.

The converted size in gigabytes.


static

static float ConvertBytes_ToGB(const double SizeInBytes)

Defined in OperatingSystemStatics.h:193 Converts the given size in bytes to gigabytes.

  • SizeInBytes The size in bytes to convert.

The size in gigabytes.


static

static float ConvertBytes_ToMB(const double SizeInBytes)

Defined in OperatingSystemStatics.h:205 Converts a size in bytes to megabytes.

This method assumes size in bytes as input and returns the equivalent size in megabytes.

  • SizeInBytes The size in bytes to be converted.

The size in megabytes after converting from bytes.


static

static UOperatingSystemBaseHardware * FindHardwareByTag(const AOperatingSystemDeviceActor * TargetDevice, const FGameplayTag HardwareTag)

Defined in OperatingSystemStatics.h:215 Finds a hardware object with a specific tag on a given device.

  • TargetDevice The device on which to search for the hardware.

  • HardwareTag The tag that the hardware should have.

A pointer to the found hardware object, or nullptr if no hardware with the given tag was found or the target device is not valid.


static

static bool GetCpuSocketName(const FGameplayTag SocketTag, FText & OutValue)

Defined in OperatingSystemStatics.h:232 Retrieves the name of a CPU socket based on a given socket tag.

  • SocketTag The socket tag used to identify the CPU socket.

  • OutValue The output parameter that will store the retrieved CPU socket name.

True if the CPU socket name was successfully retrieved, false otherwise.

This method retrieves the name of a CPU socket based on a given socket tag. The socket tag must be a valid operating system tag and must start with “OperatingSystem.Hardware.CPU.”. If the socket tag is valid and starts with the correct prefix, the method removes the prefix, replaces any ”.” characters with spaces, and sets the OutValue parameter with the resulting CPU socket name. The method then returns true.

If the socket tag is not a valid operating system tag or does not start with the correct prefix, the method returns false and does not modify the OutValue parameter.


static

static void ShutdownOperatingSystem(UOperatingSystem * TargetOS, FGenericError & OutError)

Defined in OperatingSystemStatics.h:245 Shuts down an operating system.

This function is responsible for shutting down the specified operating system. It terminates the device session associated with the operating system, indicating whether the session should end gracefully or not.

  • TargetOS The operating system to shut down.

  • OutError Any error that outputs.


static

static void RestartOperatingSystem(UOperatingSystem * TargetOS, FGenericError & OutError)

Defined in OperatingSystemStatics.h:259 Restarts the operating system of a target device.

This method is used to restart the operating system of the specified target device. It calls the DeviceSessionEnd method on the parent device of the target OS, passing true as the argument.

  • TargetOS The UOperatingSystem instance representing the target operating system.

  • OutError Any error that outputs.

See also: UOperatingSystem::GetParentDevice()

See also: UDevice::DeviceSessionEnd()


static

static bool AddNotification(UOperatingSystem * TargetOperatingSystem, const FOperatingSystemNotification & Notification)

Defined in OperatingSystemStatics.h:269 Adds a notification to the specified operating system.

  • TargetOperatingSystem The operating system to add the notification to.

  • Notification The notification to add.

True if the notification was successfully added, false otherwise.


static

static bool AddNotificationFromError(UOperatingSystem * TargetOperatingSystem, const FGenericError & Error, const EOperatingSystemNotificationCategory NotificationCategory, const EOperatingSystemNotificationType Verbosity = EOperatingSystemNotificationType::Error)

Defined in OperatingSystemStatics.h:282 Adds a notification from an error to the operating system.

  • TargetOperatingSystem The target operating system to add the notification to.

  • Error The error to generate the notification from.

  • NotificationCategory The category of the notification.

  • Verbosity The verbosity level of the notification. Defaults to EOperatingSystemNotificationType::Error.

True if the notification was successfully added, false otherwise.


static

static UOperatingSystemFile * OpenFile(UOperatingSystemFile * TargetFile, FGenericError & OutError)

Defined in OperatingSystemStatics.h:292 Opens the given file and returns the file object.

  • TargetFile The file to be opened.

  • OutError Reference to a FGenericError object which will be filled with any errors that occur during the file opening process.

A pointer to the proxy file object if the file was opened successfully, nullptr otherwise.


static

static bool IsUserValid(const FOperatingSystemUser & TestUser)

Defined in OperatingSystemStatics.h:301 Checks if a user is valid.

  • TestUser The user to be tested.

True if the user is valid, false otherwise.


static

static bool IsRegisteredUserValid(const FOperatingSystemUser & TestUser)

Defined in OperatingSystemStatics.h:310 Check if the user is registered (in the sense that user has email and password set)

  • TestUser The registered user to check for validity.

True if the registered user is valid, false otherwise.


static

static bool UserHasCompleteProfile(const FOperatingSystemUser & TestUser)

Defined in OperatingSystemStatics.h:319 Checks if the user has a complete profile.

  • TestUser The user to check.

True if the user has a complete profile, false otherwise.


static

static bool UsersEqual(const FOperatingSystemUser & Lhs, const FOperatingSystemUser & Rhs)

Defined in OperatingSystemStatics.h:332 Compares two FOperatingSystemUser objects for equality.

This method compares two FOperatingSystemUser objects, Lhs and Rhs, and returns true if they are equal, false otherwise. Equality is determined by comparing the individual properties of the FOperatingSystemUser objects.

true if the two FOperatingSystemUser objects are equal, false otherwise.


static

static bool UsersNotEqual(const FOperatingSystemUser & Lhs, const FOperatingSystemUser & Rhs)

Defined in OperatingSystemStatics.h:343 Checks if two FOperatingSystemUser objects are not equal.

This method compares two FOperatingSystemUser objects and returns true if they are not equal, and false otherwise.

True if the two FOperatingSystemUser objects are not equal, false otherwise.


static

static bool IsNotificationValid(const FOperatingSystemNotification & TestNotification)

Defined in OperatingSystemStatics.h:353 Checks if a notification is valid.

This function checks if a given notification object is valid.

  • TestNotification The notification object to check.

True if the notification is valid, false otherwise.


static

static bool GetSpecialDirectoryName(const FGameplayTag DirectoryTag, FText & OutDirectoryName)

Defined in OperatingSystemStatics.h:363 Retrieves the special directory name based on the given directory tag.

  • DirectoryTag The gameplay tag representing the directory.

  • OutDirectoryName The output text containing the directory name.

True if the directory name is successfully retrieved, false otherwise.


static

static FText GetCpuSpeedAsText(const float & CpuSpeedInGHz, const bool bUseGHZ = true)

Defined in OperatingSystemStatics.h:374 public static UOperatingSystemStatics::GetCpuSpeedAsText Returns the CPU speed as FText.

  • CpuSpeedInGHz [const float&] CPU Speed in GHz.

  • bUseGHZ [const bool] If true return value will use GHz. If false, it will be MHz.

[FText] CPU Speed as FText.


static

static FText GetSizeAsText(const EOperatingSystemCommonSizes Size)

Defined in OperatingSystemStatics.h:384 Get the size as text for a given operating system size.

This method uses the operating system size to calculate the size as text.

  • Size The operating system size.

The size as text.


static

static FText GenerateRandomErrorCode()

Defined in OperatingSystemStatics.h:392 Generates a random error code.

A randomly generated error code.


static

static FText GetTimeAsText(const FDateTime & DateTime, const bool bShowSeconds = false, const EOperatingSystemTimeSeparator Separator = EOperatingSystemTimeSeparator::Colon)

Defined in OperatingSystemStatics.h:403 Returns the given DateTime as a text representation.

  • DateTime The DateTime value to convert.

  • bShowSeconds Whether to include the seconds value.

  • Separator The separator character to use between the hour and minute values.

The text representation of the DateTime value.

  • Colon
  • INT_TO_STRING

static

static FText GetDateAsText(const FDateTime & DateTime, const EOperatingSystemDateSeparator Separator = EOperatingSystemDateSeparator::Dash)

Defined in OperatingSystemStatics.h:413 Returns the given date in text format.

  • DateTime The date and time to convert.

  • Separator The separator to use for the date components. Defaults to a dash (-).

The date as a text string.

  • Comma
  • INT_TO_STRING
  • Period
  • Slash

static

static FText GetRelativeTime(const FDateTime & UtcTime, const bool bShowMinutesDifference = true, const bool bShowHourDifference = true, const bool bShowDaysDifference = true, const EOperatingSystemDateSeparator DateSeparator = EOperatingSystemDateSeparator::Dash, const EOperatingSystemTimeSeparator TimeSeparator = EOperatingSystemTimeSeparator::Colon)

Defined in OperatingSystemStatics.h:428 Returns the relative time difference between the given UtcTime and the current local time.

  • UtcTime The UTC time to compare against the current local time.

  • bShowMinutesDifference If set to true, displays the time difference in minutes.

  • bShowHourDifference If set to true, displays the time difference in hours.

  • bShowDaysDifference If set to true, displays the time difference in days.

  • DateSeparator The separator to use for displaying the date.

  • TimeSeparator The separator to use for displaying the time.

The relative time difference as FText object.


static

static FString RegexExpression(const FString & TargetString, const FString RegexPattern)

Defined in OperatingSystemStatics.h:444 Performs regex expression matching on a target string. This method searches the target string for the first occurrence of the regex pattern and returns the matched substring.

  • TargetString The string to search within.

  • RegexPattern The regex pattern to match against the target string.

The matched substring if found, or an empty string if no match is found.


static

static EOperatingSystemPasswordStrength DeterminePasswordStrength(const FString & Input)

Defined in OperatingSystemStatics.h:453 Determines the strength of a password based on the given input string.

  • Input The input string representing the password.

The strength of the password, as an EOperatingSystemPasswordStrength enum value.

  • Moderate
  • Strong
  • Weak

static

static AOperatingSystemDeviceActor * FindDeviceActorByTag(const UObject * WorldContextObject, const FGameplayTag TestTag)

Defined in OperatingSystemStatics.h:463 Finds a device actor by tag.

  • WorldContextObject The world context object.

  • TestTag The tag used for finding the device actor.

A pointer to the found device actor, or nullptr if not found.


static

static void FindDeviceActorsByTag(const UObject * WorldContextObject, const FGameplayTag TestTag, TArray< AOperatingSystemDeviceActor * > & OutDeviceActors)

Defined in OperatingSystemStatics.h:475 Finds device actors with a specific gameplay tag.

This method allows you to find device actors in the world that have a specific gameplay tag. The device actors are returned through an output parameter.

  • WorldContextObject The world context object.

  • TestTag The gameplay tag used to filter the device actors.

  • OutDeviceActors An array of device actors that are found with the specified tag.


static

static UOperatingSystemDeviceMessenger * FindMessengerForDevice(const UObject * WorldContextObject, const FGameplayTag TestTag)

Defined in OperatingSystemStatics.h:485 Finds the messenger for a given device by its test tag.

  • WorldContextObject The world context object.

  • TestTag The test tag of the device.

The messenger for the device with the test tag, or nullptr if not found.


static

static UOperatingSystemDeviceMessenger * FindMessengerFromOperatingSystem(const UOperatingSystem * TargetOS)

Defined in OperatingSystemStatics.h:497 Finds a messenger for the given operating system.

This method searches for a messenger associated with the given operating system. If the operating system is valid and is associated with a parent device, the messenger of that parent device is returned.

  • TargetOS The operating system to find the messenger for.

The messenger associated with the operating system, or nullptr if no messenger is found or the operating system is invalid.


static

static UOperatingSystemUserManager * GetUserManager(const UObject * WorldContextObject)

Defined in OperatingSystemStatics.h:509 Retrieve the user manager instance for the operating system.

Returns a pointer to the UOperatingSystemUserManager object, which is responsible for managing users in the operating system.

  • WorldContextObject The world context object needed for retrieving the user manager instance.

A pointer to the UOperatingSystemUserManager object that represents the user manager instance.


static

static bool IsProgramClassCompatibleWithOS(const TSubclassOf< UOperatingSystemBaseProgram > ProgramClass, const UOperatingSystem * TargetOS, FGenericError & OutError)

Defined in OperatingSystemStatics.h:520 Check if a program class is compatible with the operating system.

  • ProgramClass The class of the program to check compatibility for.

  • TargetOS The target operating system to check compatibility with.

  • OutError [out] Any error encountered during the compatibility check.

True if the program class is compatible with the operating system, False otherwise.


static

static FTimespan GetTimeDifferenceFromUTC()

Defined in OperatingSystemStatics.h:527 Returns the time difference between UTC and computer local time.

Time difference between UTC and computer local time.


static

static FDateTime ConvertUtcTimeToLocalTime(const FDateTime & UtcTime)

Defined in OperatingSystemStatics.h:536 Takes a UTC time and converts it to the local time zone.

  • UtcTime The UTC time to convert.

The converted local time.


static

static float GetRangeTime(const FOperatingSystemRangeTime & TimeRange, const float FallbackTime = 0.2)

Defined in OperatingSystemStatics.h:547 Retrieves a random time from a given range represented by the structure FOperatingSystemRangeTime. If the range is empty or invalid, it will return the fallback time.

  • TimeRange The range of time to get the time from.

  • FallbackTime The fallback time to return if the given range is empty or invalid.

The time from the given range, or the fallback time if the range is empty or invalid.


static

static void RequestFundsFromBank(const UObject * WorldContextObject, FGenericError & OutErrorIfAny, const FOperatingSystemUser & TargetUser, const FOperatingSystemRequestFund FundDetails)

Defined in OperatingSystemStatics.h:557 Request funds from imaginary bank.

  • WorldContextObject World Context Object.

  • OutErrorIfAny Outputs any error message if there are any.

  • TargetUser User that is requesting for funds.

  • FundDetails Details of fund to request.


static

static float CalculatePercentageForValue(const float Percentage, const float TargetValue)

Defined in OperatingSystemStatics.h:568 Calculates the percentage of a given TargetValue based on the Percentage provided. If the Percentage is less than or equal to 0, the method returns 0.

  • Percentage The percentage value to calculate.

  • TargetValue The target value to calculate the percentage on.

The calculated percentage value.


static

static bool EvaluateMathExpression(const FString Expression, float & OutValue)

Defined in OperatingSystemStatics.h:581 Evaluates the numerical equation. Operators and precedence: 1:+- 2:/% 3:* 4:^ 5:&| Unary: - Types: Numbers (0-9.), Hex ($0-$f) Grouping: ( )

  • Expression Equation to evaluate.

  • OutValue Result of the equation if return value is true.

True if expression succeeded. False otherwise.


static

static bool IsMailDataValid(const FOperatingSystemMailSetting & TestMailSetting)

Defined in OperatingSystemStatics.h:590 Checks if the provided mail data is valid.

  • TestMailSetting The mail setting to be validated.

True if the provided mail data is valid, false otherwise.


static

static bool DrawWidgetToTexture(const UObject * WorldContextObject, UTextureRenderTarget2D * TargetTexture, UUserWidget * Widget, const bool bDeferUpdate = true, const float DeltaTime = 0.f)

Defined in OperatingSystemStatics.h:603 Projects the given widget to a texture target.

  • WorldContextObject World context object to retrieve subsystem.

  • TargetTexture Render target to draw the widget.

  • Widget Widget to project texture.

  • bDeferUpdate Whether or not the update is deferred until the end of the frame when it is potentially less expensive to update the render target.

  • DeltaTime Currently unused by Unreal Engine itself.

True if the projection to texture was successful.


static

static FText GetMonthName(const FDateTime & DateTime, const bool bShort = false)

Defined in OperatingSystemStatics.h:614 Returns the month name from the given date time struct. If Short is selected, return name will be “Jan”, “Feb” instead of “January”, “February”.

  • DateTime Date Time to get month name from.

  • bShort Returns short name such as “Jan”, “Feb” instead of “January”, “February”.

FText of month from given date time struct.


static

static UTexture2D * CreateTextureFromPath(const FString & InImagePath)

Defined in OperatingSystemStatics.h:624 Returns a UTexture2D from the given path. Image path should be accessible and absolute (for example: C:\SomeDirectory\MyImage.png)

  • InImagePath Absolute path to an image texture. (For example: C:\SomeDirectory\MyImage.png

A valid UTexture2D if an image exists in the given path.


static

static FOperatingSystemBattery CreateNewBattery(const FText Name, const FText Brand, const float Capacity, const float ChargeRate, const EOperatingSystemBatteryEfficiencyLoss EfficiencyLoss, FGenericError & OutError)

Defined in OperatingSystemStatics.h:639 Creates a new battery from given parameters.

  • Name Battery name.

  • Brand Battery brand name.

  • Capacity Battery capacity. Recommended value between 1000 - 5000.

  • ChargeRate Higher numbers charge battery faster and lower number charge slower. Expects a number greater than 1000.

  • EfficiencyLoss Determines health. Higher efficiency loss means poorer battery health.

  • OutError Outputs error (if any).

Returns newly constructed battery.

  • NewBattery

static inline

static inline float GetBatteryHealth(const FOperatingSystemBattery & Battery, const bool bNormalize = true)

Defined in OperatingSystemStatics.h:657 Returns the battery health of the given battery.

This method returns the battery health value as a float. The battery health value represents the percentage of energy loss while charging the battery. By default, the efficiency loss value is calculated using the formula ((static_cast<uint8>(EfficiencyLoss) + 1) * 100.f) / 10.f. If bNormalize is true, the efficiency loss value is normalized to a range of [0, 1] using the formula (static_cast<uint8>(EfficiencyLoss) + 1) / 10.f.

  • Battery The FOperatingSystemBattery struct representing the battery.

  • bNormalize (optional) Specifies whether to normalize the battery health. Defaults to true.

The battery health value.


static inline

static inline FText GetBatteryHealthText(const FOperatingSystemBattery & Battery)

Defined in OperatingSystemStatics.h:665 Returns the text description of the battery health state.

The text description of the battery health state.


static

static FString GetPathDelimiter(const UOperatingSystem * TargetOS)

Defined in OperatingSystemStatics.h:677 Returns the path delimiter used by the given operating system.

This method returns the path delimiter based on the given operating system. If the operating system is Unix-based, the delimiter will be ’/’. Otherwise, if the operating system is Windows-based, the delimiter will be ”.

  • TargetOS The target operating system instance.

The path delimiter used by the operating system.