UOperatingSystemStatics
#include <OperatingSystemSimulator/Public/Global/OperatingSystemStatics.h>class UOperatingSystemStaticsDefined in OperatingSystemStatics.h:33
Inherits:
UBlueprintFunctionLibrary
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemStatics["UOperatingSystemStatics"]
class UBlueprintFunctionLibrary["UBlueprintFunctionLibrary"]
UBlueprintFunctionLibrary <|-- UOperatingSystemStatics
Class detail
Section titled “Class detail”---
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
Caller impact — GetPathDelimiter
Section titled “Caller impact — GetPathDelimiter”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
Caller impact — GetUserManager
Section titled “Caller impact — GetUserManager”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.
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
bool | IsUniqueIdValid static | Checks whether a given unique id is valid or not. |
FString | UniqueIdToString static | Converts a unique ID to its string representation. |
bool | IsOperatingSystemTagValid static | Checks if the given operating system tag is valid by verifying if it is not null and not equal to the invalid tag. |
int32 | GetSize static | Get the size corresponding to the given operating system common size. |
FGenericError | CreateGenericError static | 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. |
FOperatingSystemNotification | CreateNotification static | Creates a new operating system notification. |
double | ConvertMB_ToBytes static | Converts a size in Megabytes (MB) to bytes. |
double | ConvertGB_ToBytes static | Converts size from gigabytes (GB) to bytes. |
float | ConvertGB_ToMB static | Converts the given size in gigabytes to megabytes. |
float | ConvertMB_ToGB static | Converts the given size in megabytes to gigabytes. |
float | ConvertBytes_ToGB static | Converts the given size in bytes to gigabytes. |
float | ConvertBytes_ToMB static | Converts a size in bytes to megabytes. |
UOperatingSystemBaseHardware * | FindHardwareByTag static | Finds a hardware object with a specific tag on a given device. |
bool | GetCpuSocketName static | Retrieves the name of a CPU socket based on a given socket tag. |
void | ShutdownOperatingSystem static | Shuts down an operating system. |
void | RestartOperatingSystem static | Restarts the operating system of a target device. |
bool | AddNotification static | Adds a notification to the specified operating system. |
bool | AddNotificationFromError static | Adds a notification from an error to the operating system. |
UOperatingSystemFile * | OpenFile static | Opens the given file and returns the file object. |
bool | IsUserValid static | Checks if a user is valid. |
bool | IsRegisteredUserValid static | Check if the user is registered (in the sense that user has email and password set) |
bool | UserHasCompleteProfile static | Checks if the user has a complete profile. |
bool | UsersEqual static | Compares two FOperatingSystemUser objects for equality. |
bool | UsersNotEqual static | Checks if two FOperatingSystemUser objects are not equal. |
bool | IsNotificationValid static | Checks if a notification is valid. |
bool | GetSpecialDirectoryName static | Retrieves the special directory name based on the given directory tag. |
FText | GetCpuSpeedAsText static | public static UOperatingSystemStatics::GetCpuSpeedAsText Returns the CPU speed as FText. |
FText | GetSizeAsText static | Get the size as text for a given operating system size. |
FText | GenerateRandomErrorCode static | Generates a random error code. |
FText | GetTimeAsText static | Returns the given DateTime as a text representation. |
FText | GetDateAsText static | Returns the given date in text format. |
FText | GetRelativeTime static | Returns the relative time difference between the given UtcTime and the current local time. |
FString | RegexExpression static | 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. |
EOperatingSystemPasswordStrength | DeterminePasswordStrength static | Determines the strength of a password based on the given input string. |
AOperatingSystemDeviceActor * | FindDeviceActorByTag static | Finds a device actor by tag. |
void | FindDeviceActorsByTag static | Finds device actors with a specific gameplay tag. |
UOperatingSystemDeviceMessenger * | FindMessengerForDevice static | Finds the messenger for a given device by its test tag. |
UOperatingSystemDeviceMessenger * | FindMessengerFromOperatingSystem static | Finds a messenger for the given operating system. |
UOperatingSystemUserManager * | GetUserManager static | Retrieve the user manager instance for the operating system. |
bool | IsProgramClassCompatibleWithOS static | Check if a program class is compatible with the operating system. |
FTimespan | GetTimeDifferenceFromUTC static | Returns the time difference between UTC and computer local time. |
FDateTime | ConvertUtcTimeToLocalTime static | Takes a UTC time and converts it to the local time zone. |
float | GetRangeTime static | 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. |
void | RequestFundsFromBank static | Request funds from imaginary bank. |
float | CalculatePercentageForValue static | 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. |
bool | EvaluateMathExpression static | Evaluates the numerical equation. Operators and precedence: 1:+- 2:/% 3:* 4:^ 5:&| Unary: - Types: Numbers (0-9.), Hex ($0-$f) Grouping: ( ) |
bool | IsMailDataValid static | Checks if the provided mail data is valid. |
bool | DrawWidgetToTexture static | Projects the given widget to a texture target. |
FText | GetMonthName static | Returns 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 static | Returns a UTexture2D from the given path. Image path should be accessible and absolute (for example: C:\SomeDirectory\MyImage.png) |
FOperatingSystemBattery | CreateNewBattery static | Creates a new battery from given parameters. |
float | GetBatteryHealth static inline | Returns the battery health of the given battery. |
FText | GetBatteryHealthText static inline | Returns the text description of the battery health state. |
FString | GetPathDelimiter static | Returns the path delimiter used by the given operating system. |
IsUniqueIdValid
Section titled “IsUniqueIdValid”static
static bool IsUniqueIdValid(const FOperatingSystemUniqueId & TestID)Defined in OperatingSystemStatics.h:88 Checks whether a given unique id is valid or not.
Parameters
Section titled “Parameters”TestIDThe unique id to be checked.
Returns
Section titled “Returns”True if the unique id is valid, false otherwise.
References
Section titled “References”UniqueIdToString
Section titled “UniqueIdToString”static
static FString UniqueIdToString(const FOperatingSystemUniqueId & TestID)Defined in OperatingSystemStatics.h:97 Converts a unique ID to its string representation.
Parameters
Section titled “Parameters”TestIDThe unique ID to convert.
Returns
Section titled “Returns”The string representation of the unique ID.
References
Section titled “References”IsOperatingSystemTagValid
Section titled “IsOperatingSystemTagValid”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.
Parameters
Section titled “Parameters”TestTagThe operating system tag to check.
Returns
Section titled “Returns”True if the operating system tag is valid, false otherwise.
Referenced by
Section titled “Referenced by”FindDeviceActorByTagFindDeviceActorsByTagFindDirectoryByTagFindDirectoryByTagGetCpuSocketNameGetSpecialDirectoryNameInternal_OnValidateInternal_ValidateValidate
GetSize
Section titled “GetSize”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.
Parameters
Section titled “Parameters”SizeThe operating system common size enumeration value.
Returns
Section titled “Returns”The actual size in bytes corresponding to the given operating system common size.
References
Section titled “References”None
CreateGenericError
Section titled “CreateGenericError”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.
Parameters
Section titled “Parameters”-
ErrorCodeThe error code for the generic error object. -
ErrorDescriptionThe error description for the generic error object.
Returns
Section titled “Returns”FGenericError The created generic error object.
CreateNotification
Section titled “CreateNotification”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.
Parameters
Section titled “Parameters”-
TitleThe title of the notification. -
DescriptionThe description of the notification. -
NotificationCategoryThe category of the notification. -
VerbosityThe verbosity level of the notification. -
IconThe icon associated with the notification. -
CodeThe code associated with the notification.
Returns
Section titled “Returns”The newly created operating system notification.
References
Section titled “References”ConvertMB_ToBytes
Section titled “ConvertMB_ToBytes”static
static double ConvertMB_ToBytes(const float SizeInMB)Defined in OperatingSystemStatics.h:155 Converts a size in Megabytes (MB) to bytes.
Parameters
Section titled “Parameters”SizeInMBThe size in Megabytes to convert.
Returns
Section titled “Returns”The corresponding size in bytes.
Referenced by
Section titled “Referenced by”References
Section titled “References”ConvertGB_ToBytes
Section titled “ConvertGB_ToBytes”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.
Parameters
Section titled “Parameters”SizeInGBThe size in gigabytes to convert.
Returns
Section titled “Returns”The size in bytes after conversion.
References
Section titled “References”ConvertGB_ToMB
Section titled “ConvertGB_ToMB”static
static float ConvertGB_ToMB(const float SizeInGB)Defined in OperatingSystemStatics.h:175 Converts the given size in gigabytes to megabytes.
Parameters
Section titled “Parameters”SizeInGBThe size in gigabytes to be converted.
Returns
Section titled “Returns”The converted size in megabytes.
Referenced by
Section titled “Referenced by”ConvertMB_ToGB
Section titled “ConvertMB_ToGB”static
static float ConvertMB_ToGB(const float SizeInMB)Defined in OperatingSystemStatics.h:184 Converts the given size in megabytes to gigabytes.
Parameters
Section titled “Parameters”SizeInMBThe size in megabytes to be converted.
Returns
Section titled “Returns”The converted size in gigabytes.
ConvertBytes_ToGB
Section titled “ConvertBytes_ToGB”static
static float ConvertBytes_ToGB(const double SizeInBytes)Defined in OperatingSystemStatics.h:193 Converts the given size in bytes to gigabytes.
Parameters
Section titled “Parameters”SizeInBytesThe size in bytes to convert.
Returns
Section titled “Returns”The size in gigabytes.
ConvertBytes_ToMB
Section titled “ConvertBytes_ToMB”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.
Parameters
Section titled “Parameters”SizeInBytesThe size in bytes to be converted.
Returns
Section titled “Returns”The size in megabytes after converting from bytes.
FindHardwareByTag
Section titled “FindHardwareByTag”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.
Parameters
Section titled “Parameters”-
TargetDeviceThe device on which to search for the hardware. -
HardwareTagThe tag that the hardware should have.
Returns
Section titled “Returns”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.
References
Section titled “References”GetCpuSocketName
Section titled “GetCpuSocketName”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.
Parameters
Section titled “Parameters”-
SocketTagThe socket tag used to identify the CPU socket. -
OutValueThe output parameter that will store the retrieved CPU socket name.
Returns
Section titled “Returns”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.
References
Section titled “References”ShutdownOperatingSystem
Section titled “ShutdownOperatingSystem”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.
Parameters
Section titled “Parameters”-
TargetOSThe operating system to shut down. -
OutErrorAny error that outputs.
References
Section titled “References”MAKE_ERRORReset
RestartOperatingSystem
Section titled “RestartOperatingSystem”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.
Parameters
Section titled “Parameters”-
TargetOSThe UOperatingSystem instance representing the target operating system. -
OutErrorAny error that outputs.
See also: UOperatingSystem::GetParentDevice()
See also: UDevice::DeviceSessionEnd()
References
Section titled “References”MAKE_ERRORReset
AddNotification
Section titled “AddNotification”static
static bool AddNotification(UOperatingSystem * TargetOperatingSystem, const FOperatingSystemNotification & Notification)Defined in OperatingSystemStatics.h:269 Adds a notification to the specified operating system.
Parameters
Section titled “Parameters”-
TargetOperatingSystemThe operating system to add the notification to. -
NotificationThe notification to add.
Returns
Section titled “Returns”True if the notification was successfully added, false otherwise.
References
Section titled “References”AddNotificationFromError
Section titled “AddNotificationFromError”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.
Parameters
Section titled “Parameters”-
TargetOperatingSystemThe target operating system to add the notification to. -
ErrorThe error to generate the notification from. -
NotificationCategoryThe category of the notification. -
VerbosityThe verbosity level of the notification. Defaults to EOperatingSystemNotificationType::Error.
Returns
Section titled “Returns”True if the notification was successfully added, false otherwise.
References
Section titled “References”AddNotificationError
OpenFile
Section titled “OpenFile”static
static UOperatingSystemFile * OpenFile(UOperatingSystemFile * TargetFile, FGenericError & OutError)Defined in OperatingSystemStatics.h:292 Opens the given file and returns the file object.
Parameters
Section titled “Parameters”-
TargetFileThe file to be opened. -
OutErrorReference to a FGenericError object which will be filled with any errors that occur during the file opening process.
Returns
Section titled “Returns”A pointer to the proxy file object if the file was opened successfully, nullptr otherwise.
References
Section titled “References”CreateRuntimeFileIsValidMAKE_ERROR
IsUserValid
Section titled “IsUserValid”static
static bool IsUserValid(const FOperatingSystemUser & TestUser)Defined in OperatingSystemStatics.h:301 Checks if a user is valid.
Parameters
Section titled “Parameters”TestUserThe user to be tested.
Returns
Section titled “Returns”True if the user is valid, false otherwise.
References
Section titled “References”IsRegisteredUserValid
Section titled “IsRegisteredUserValid”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)
Parameters
Section titled “Parameters”TestUserThe registered user to check for validity.
Returns
Section titled “Returns”True if the registered user is valid, false otherwise.
References
Section titled “References”UserHasCompleteProfile
Section titled “UserHasCompleteProfile”static
static bool UserHasCompleteProfile(const FOperatingSystemUser & TestUser)Defined in OperatingSystemStatics.h:319 Checks if the user has a complete profile.
Parameters
Section titled “Parameters”TestUserThe user to check.
Returns
Section titled “Returns”True if the user has a complete profile, false otherwise.
References
Section titled “References”UsersEqual
Section titled “UsersEqual”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.
Parameters
Section titled “Parameters”-
LhsThe first FOperatingSystemUser object to compare. -
RhsThe second FOperatingSystemUser object to compare.
Returns
Section titled “Returns”true if the two FOperatingSystemUser objects are equal, false otherwise.
UsersNotEqual
Section titled “UsersNotEqual”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.
Parameters
Section titled “Parameters”-
LhsThe first FOperatingSystemUser object to compare. -
RhsThe second FOperatingSystemUser object to compare.
Returns
Section titled “Returns”True if the two FOperatingSystemUser objects are not equal, false otherwise.
IsNotificationValid
Section titled “IsNotificationValid”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.
Parameters
Section titled “Parameters”TestNotificationThe notification object to check.
Returns
Section titled “Returns”True if the notification is valid, false otherwise.
References
Section titled “References”GetSpecialDirectoryName
Section titled “GetSpecialDirectoryName”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.
Parameters
Section titled “Parameters”-
DirectoryTagThe gameplay tag representing the directory. -
OutDirectoryNameThe output text containing the directory name.
Returns
Section titled “Returns”True if the directory name is successfully retrieved, false otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”IsOperatingSystemTagValidTAG_CHK
GetCpuSpeedAsText
Section titled “GetCpuSpeedAsText”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.
Parameters
Section titled “Parameters”-
CpuSpeedInGHz[const float&] CPU Speed in GHz. -
bUseGHZ[const bool] If true return value will use GHz. If false, it will be MHz.
Returns
Section titled “Returns”[FText] CPU Speed as FText.
GetSizeAsText
Section titled “GetSizeAsText”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.
Parameters
Section titled “Parameters”SizeThe operating system size.
Returns
Section titled “Returns”The size as text.
GenerateRandomErrorCode
Section titled “GenerateRandomErrorCode”static
static FText GenerateRandomErrorCode()Defined in OperatingSystemStatics.h:392 Generates a random error code.
Returns
Section titled “Returns”A randomly generated error code.
GetTimeAsText
Section titled “GetTimeAsText”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.
Parameters
Section titled “Parameters”-
DateTimeThe DateTime value to convert. -
bShowSecondsWhether to include the seconds value. -
SeparatorThe separator character to use between the hour and minute values.
Returns
Section titled “Returns”The text representation of the DateTime value.
Referenced by
Section titled “Referenced by”References
Section titled “References”ColonINT_TO_STRING
GetDateAsText
Section titled “GetDateAsText”static
static FText GetDateAsText(const FDateTime & DateTime, const EOperatingSystemDateSeparator Separator = EOperatingSystemDateSeparator::Dash)Defined in OperatingSystemStatics.h:413 Returns the given date in text format.
Parameters
Section titled “Parameters”-
DateTimeThe date and time to convert. -
SeparatorThe separator to use for the date components. Defaults to a dash (-).
Returns
Section titled “Returns”The date as a text string.
Referenced by
Section titled “Referenced by”References
Section titled “References”CommaINT_TO_STRINGPeriodSlash
GetRelativeTime
Section titled “GetRelativeTime”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.
Parameters
Section titled “Parameters”-
UtcTimeThe UTC time to compare against the current local time. -
bShowMinutesDifferenceIf set to true, displays the time difference in minutes. -
bShowHourDifferenceIf set to true, displays the time difference in hours. -
bShowDaysDifferenceIf set to true, displays the time difference in days. -
DateSeparatorThe separator to use for displaying the date. -
TimeSeparatorThe separator to use for displaying the time.
Returns
Section titled “Returns”The relative time difference as FText object.
References
Section titled “References”RegexExpression
Section titled “RegexExpression”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.
Parameters
Section titled “Parameters”-
TargetStringThe string to search within. -
RegexPatternThe regex pattern to match against the target string.
Returns
Section titled “Returns”The matched substring if found, or an empty string if no match is found.
Referenced by
Section titled “Referenced by”DeterminePasswordStrength
Section titled “DeterminePasswordStrength”static
static EOperatingSystemPasswordStrength DeterminePasswordStrength(const FString & Input)Defined in OperatingSystemStatics.h:453 Determines the strength of a password based on the given input string.
Parameters
Section titled “Parameters”InputThe input string representing the password.
Returns
Section titled “Returns”The strength of the password, as an EOperatingSystemPasswordStrength enum value.
References
Section titled “References”ModerateStrongWeak
FindDeviceActorByTag
Section titled “FindDeviceActorByTag”static
static AOperatingSystemDeviceActor * FindDeviceActorByTag(const UObject * WorldContextObject, const FGameplayTag TestTag)Defined in OperatingSystemStatics.h:463 Finds a device actor by tag.
Parameters
Section titled “Parameters”-
WorldContextObjectThe world context object. -
TestTagThe tag used for finding the device actor.
Returns
Section titled “Returns”A pointer to the found device actor, or nullptr if not found.
References
Section titled “References”FindDeviceActorsByTag
Section titled “FindDeviceActorsByTag”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.
Parameters
Section titled “Parameters”-
WorldContextObjectThe world context object. -
TestTagThe gameplay tag used to filter the device actors. -
OutDeviceActorsAn array of device actors that are found with the specified tag.
References
Section titled “References”FindMessengerForDevice
Section titled “FindMessengerForDevice”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.
Parameters
Section titled “Parameters”-
WorldContextObjectThe world context object. -
TestTagThe test tag of the device.
Returns
Section titled “Returns”The messenger for the device with the test tag, or nullptr if not found.
References
Section titled “References”DeviceFindDeviceActorByTagGet
FindMessengerFromOperatingSystem
Section titled “FindMessengerFromOperatingSystem”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.
Parameters
Section titled “Parameters”TargetOSThe operating system to find the messenger for.
Returns
Section titled “Returns”The messenger associated with the operating system, or nullptr if no messenger is found or the operating system is invalid.
Referenced by
Section titled “Referenced by”GetUserManager
Section titled “GetUserManager”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.
Parameters
Section titled “Parameters”WorldContextObjectThe world context object needed for retrieving the user manager instance.
Returns
Section titled “Returns”A pointer to the UOperatingSystemUserManager object that represents the user manager instance.
Referenced by
Section titled “Referenced by”References
Section titled “References”IsProgramClassCompatibleWithOS
Section titled “IsProgramClassCompatibleWithOS”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.
Parameters
Section titled “Parameters”-
ProgramClassThe class of the program to check compatibility for. -
TargetOSThe target operating system to check compatibility with. -
OutError[out] Any error encountered during the compatibility check.
Returns
Section titled “Returns”True if the program class is compatible with the operating system, False otherwise.
References
Section titled “References”GetTimeDifferenceFromUTC
Section titled “GetTimeDifferenceFromUTC”static
static FTimespan GetTimeDifferenceFromUTC()Defined in OperatingSystemStatics.h:527 Returns the time difference between UTC and computer local time.
Returns
Section titled “Returns”Time difference between UTC and computer local time.
ConvertUtcTimeToLocalTime
Section titled “ConvertUtcTimeToLocalTime”static
static FDateTime ConvertUtcTimeToLocalTime(const FDateTime & UtcTime)Defined in OperatingSystemStatics.h:536 Takes a UTC time and converts it to the local time zone.
Parameters
Section titled “Parameters”UtcTimeThe UTC time to convert.
Returns
Section titled “Returns”The converted local time.
Referenced by
Section titled “Referenced by”GetRangeTime
Section titled “GetRangeTime”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.
Parameters
Section titled “Parameters”-
TimeRangeThe range of time to get the time from. -
FallbackTimeThe fallback time to return if the given range is empty or invalid.
Returns
Section titled “Returns”The time from the given range, or the fallback time if the range is empty or invalid.
References
Section titled “References”RequestFundsFromBank
Section titled “RequestFundsFromBank”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.
Parameters
Section titled “Parameters”-
WorldContextObjectWorld Context Object. -
OutErrorIfAnyOutputs any error message if there are any. -
TargetUserUser that is requesting for funds. -
FundDetailsDetails of fund to request.
References
Section titled “References”CalculatePercentageForValue
Section titled “CalculatePercentageForValue”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.
Parameters
Section titled “Parameters”-
PercentageThe percentage value to calculate. -
TargetValueThe target value to calculate the percentage on.
Returns
Section titled “Returns”The calculated percentage value.
Referenced by
Section titled “Referenced by”EvaluateMathExpression
Section titled “EvaluateMathExpression”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: ( )
Parameters
Section titled “Parameters”-
ExpressionEquation to evaluate. -
OutValueResult of the equation if return value is true.
Returns
Section titled “Returns”True if expression succeeded. False otherwise.
IsMailDataValid
Section titled “IsMailDataValid”static
static bool IsMailDataValid(const FOperatingSystemMailSetting & TestMailSetting)Defined in OperatingSystemStatics.h:590 Checks if the provided mail data is valid.
Parameters
Section titled “Parameters”TestMailSettingThe mail setting to be validated.
Returns
Section titled “Returns”True if the provided mail data is valid, false otherwise.
References
Section titled “References”DrawWidgetToTexture
Section titled “DrawWidgetToTexture”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.
Parameters
Section titled “Parameters”-
WorldContextObjectWorld context object to retrieve subsystem. -
TargetTextureRender target to draw the widget. -
WidgetWidget to project texture. -
bDeferUpdateWhether or not the update is deferred until the end of the frame when it is potentially less expensive to update the render target. -
DeltaTimeCurrently unused by Unreal Engine itself.
Returns
Section titled “Returns”True if the projection to texture was successful.
References
Section titled “References”GetMonthName
Section titled “GetMonthName”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”.
Parameters
Section titled “Parameters”-
DateTimeDate Time to get month name from. -
bShortReturns short name such as “Jan”, “Feb” instead of “January”, “February”.
Returns
Section titled “Returns”FText of month from given date time struct.
CreateTextureFromPath
Section titled “CreateTextureFromPath”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)
Parameters
Section titled “Parameters”InImagePathAbsolute path to an image texture. (For example: C:\SomeDirectory\MyImage.png
Returns
Section titled “Returns”A valid UTexture2D if an image exists in the given path.
Referenced by
Section titled “Referenced by”References
Section titled “References”CreateUserDataOS_LOG_ERROROS_LOG_VERBOSE
CreateNewBattery
Section titled “CreateNewBattery”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.
Parameters
Section titled “Parameters”-
NameBattery name. -
BrandBattery brand name. -
CapacityBattery capacity. Recommended value between 1000 - 5000. -
ChargeRateHigher numbers charge battery faster and lower number charge slower. Expects a number greater than 1000. -
EfficiencyLossDetermines health. Higher efficiency loss means poorer battery health. -
OutErrorOutputs error (if any).
Returns
Section titled “Returns”Returns newly constructed battery.
References
Section titled “References”NewBattery
GetBatteryHealth
Section titled “GetBatteryHealth”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.
Parameters
Section titled “Parameters”-
BatteryThe FOperatingSystemBattery struct representing the battery. -
bNormalize(optional) Specifies whether to normalize the battery health. Defaults to true.
Returns
Section titled “Returns”The battery health value.
GetBatteryHealthText
Section titled “GetBatteryHealthText”static inline
static inline FText GetBatteryHealthText(const FOperatingSystemBattery & Battery)Defined in OperatingSystemStatics.h:665 Returns the text description of the battery health state.
Returns
Section titled “Returns”The text description of the battery health state.
GetPathDelimiter
Section titled “GetPathDelimiter”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 ”.
Parameters
Section titled “Parameters”TargetOSThe target operating system instance.
Returns
Section titled “Returns”The path delimiter used by the operating system.
Referenced by
Section titled “Referenced by”CreateDirectoryInPathCreateDirectoryInPathGetFullPathGetInterfaceFromPathGetPartitionPathInternal_GetDirectoryFromPathNonUnixStartOperatingSystemImpl