UOperatingSystemUnix
#include <OperatingSystemSimulator/Public/Core/OperatingSystemUnix.h>class UOperatingSystemUnixDefined in OperatingSystemUnix.h:17
Inherits:
UOperatingSystemSubclassed by:UOperatingSystemUnixPhone
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemUnix["UOperatingSystemUnix"]
class UOperatingSystem["UOperatingSystem"]
UOperatingSystem <|-- UOperatingSystemUnix
class UOperatingSystemUnixPhone["UOperatingSystemUnixPhone"]
UOperatingSystemUnix <|-- UOperatingSystemUnixPhone
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemUnix["UOperatingSystemUnix"]
class FOperatingSystemUser["FOperatingSystemUser"]
UOperatingSystemUnix *-- FOperatingSystemUser
class UOperatingSystem["UOperatingSystem"]
UOperatingSystemUnix *-- UOperatingSystem
class UOperatingSystemProgramsCollection["UOperatingSystemProgramsCollection"]
UOperatingSystemUnix *-- UOperatingSystemProgramsCollection
class UOperatingSystemRootDirectory["UOperatingSystemRootDirectory"]
UOperatingSystemUnix *-- UOperatingSystemRootDirectory
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemUnix {
+UOperatingSystemUnix()
+CreateDirectoryInPath(const FString &TargetPath, const FString &D UOperatingSystemDirectory() *
+GetRepositoryClasses() const const()TSet()< TSoftObjectPtr()< UOperat
+RootUser : FOperatingSystemUser()
+RootCommand : FText()
+RepositoryClasses : TSet()< TSoftObjectPtr()< UOperatingSyst
+OnValidate(FGenericError &OutError) const override void()
+FinalizePreInstallation(FGenericError &OutError) override void()
+PrepareOperatingSystemInstallImpl(FGenericError &OutError) override void()
+StartOperatingSystemImpl(FGenericError &OutError) override bool()
+PostLoadOperatingSystemImpl(FGenericError &OutError) override void()
+GetRootCommand() const override final TOptional()< FText() >
+GetRootUser() const override final TOptional()< FOperatingSystemUser() >
+FindProgramFromPackage(const FName &ProgramIdentifier) override TSoftClassPtr()< UOperatingSystemBasePro
+CreateRootDirectory(const bool bIsFromSaveGame) bool()
+RootDirectory : TObjectPtr()< UOperatingSystemRootDirect
}
Class that represents a Unix-based operating system in the Operating System Simulator. This class is a child class of UOperatingSystem and provides additional functionality specific to Unix systems.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemUnix | ||
UOperatingSystemDirectory * | CreateDirectoryInPath virtual override | Creates a directory within a given path. |
constTSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > > & | GetRepositoryClasses const inline | Retrieves the repository classes in the Operating System Simulator. |
UOperatingSystemUnix
Section titled “UOperatingSystemUnix”UOperatingSystemUnix()Defined in OperatingSystemUnix.h:42
Section titled “Defined in OperatingSystemUnix.h:42”CreateDirectoryInPath
Section titled “CreateDirectoryInPath”virtual override
virtual UOperatingSystemDirectory * CreateDirectoryInPath(constFString & TargetPath, constFString & DirectoryName, TSoftClassPtr< UOperatingSystemDirectory > DirectoryClass, UOperatingSystemPartition * TargetPartition, constbool bIsFromSaveGame, FGenericError & OutError) overrideDefined in OperatingSystemUnix.h:63 Creates a directory within a given path.
This method creates a directory with the specified name within the given target path. If the target path is the special root directory name, it creates the root directory and returns it. Otherwise, it iterates through the path array in reverse order and checks if the new directory exists. If the new directory does not exist, it creates the directory and returns it. If the new directory exists and its name matches the specified directory name, it returns the new directory. Otherwise, it updates the current directory to the new directory and continues the iteration.
Parameters
Section titled “Parameters”-
TargetPathThe target path where the directory will be created. -
DirectoryNameThe name of the directory to be created. -
DirectoryClassThe class pointer of the directory to be created. -
TargetPartitionThe target partition where the directory will be added. -
bIsFromSaveGameIndicates whether the directory is from a save game. -
OutErrorThe reference to the error object that will hold the error message in case of failure.
Returns
Section titled “Returns”The created directory if successful, or nullptr if an error occurs.
References
Section titled “References”CreateDirectoryCreateRootDirectoryGetPathDelimiterGetSettingsGetSpecialDirectoryNameRootDirectory
Reimplements
Section titled “Reimplements”GetRepositoryClasses
Section titled “GetRepositoryClasses”const inline
inline constTSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > > & GetRepositoryClasses() constDefined in OperatingSystemUnix.h:188 Retrieves the repository classes in the Operating System Simulator.
This method returns the set of repository classes, represented by TSoftObjectPtr<UOperatingSystemProgramsCollection>.
Returns
Section titled “Returns”The set of repository classes in the Operating System Simulator.
Referenced by
Section titled “Referenced by”Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
FOperatingSystemUser | RootUser | Root user for this Operating System. |
FText | RootCommand | Root command name. Defaults to sudo. |
TSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > > | RepositoryClasses | Simulates the effect of sudo apt-get stuff. You can add as many classes you want and even let users add their own repository via terminal. |
RootUser
Section titled “RootUser”FOperatingSystemUser RootUserDefined in OperatingSystemUnix.h:25 Root user for this Operating System.
Referenced by
Section titled “Referenced by”RootCommand
Section titled “RootCommand”FText RootCommandDefined in OperatingSystemUnix.h:29 Root command name. Defaults to sudo.
Referenced by
Section titled “Referenced by”RepositoryClasses
Section titled “RepositoryClasses”TSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > > RepositoryClassesDefined in OperatingSystemUnix.h:33 Simulates the effect of sudo apt-get stuff. You can add as many classes you want and even let users add their own repository via terminal.
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | OnValidate virtual const override | Validates the Unix-based operating system. |
void | FinalizePreInstallation virtual override | Finalizes the pre-installation process for a Unix-based operating system. |
void | PrepareOperatingSystemInstallImpl virtual override | PrepareOperatingSystemInstallImpl function prepares the Unix-based operating system for installation. |
bool | StartOperatingSystemImpl virtual override | Starts the Unix-based operating system. |
void | PostLoadOperatingSystemImpl virtual override | Executes additional post-loading operations specific to Unix-based operating systems. |
TOptional< FText > | GetRootCommand virtual const override final | Gets the root command for the Unix-based operating system. |
TOptional< FOperatingSystemUser > | GetRootUser virtual const override final | Retrieves the root user of the Unix-based operating system. |
TSoftClassPtr< UOperatingSystemBaseProgram > | FindProgramFromPackage virtual override | Finds a program from a package based on its identifier. |
bool | CreateRootDirectory | Creates the root directory for the Unix-based operating system if it does not already exist. The root directory is determined by finding the Unix root directory among all the available directories. If the root directory exists, this method returns true. Otherwise, it attempts to create the root directory using the first directory with the tag “Root”. If the root directory is successfully created, this method returns true. Otherwise, it returns false. |
OnValidate
Section titled “OnValidate”virtual const override
virtual void OnValidate(FGenericError & OutError) const overrideDefined in OperatingSystemUnix.h:81 Validates the Unix-based operating system.
This method validates various properties of the Unix-based operating system. It checks if the root command is valid and not empty. If it is empty, an error message is generated. It also checks if at least one repository class is provided. If not, an error message is generated. It then checks if any of the repository classes are null. If all repository classes are null, an error message is generated. Finally, it checks if the root directory is set. If the root directory is not set, an error message is generated.
Parameters
Section titled “Parameters”OutErrorThe reference to the error object that will hold the error message in case of validation failure.
References
Section titled “References”Reimplements
Section titled “Reimplements”FinalizePreInstallation
Section titled “FinalizePreInstallation”virtual override
virtual void FinalizePreInstallation(FGenericError & OutError) overrideDefined in OperatingSystemUnix.h:92 Finalizes the pre-installation process for a Unix-based operating system.
This method is called to finalize the pre-installation process for a Unix-based operating system. It allocates a new partition on the target hard disk and begins the installation process on the new partition. After this, it clears the installation timer and finishes the installation.
Parameters
Section titled “Parameters”OutErrorThe reference to the error object that will hold the error message in case of failure.
References
Section titled “References”AllocatePartitionBeginInstallationBytesFinishInstallationGetSettingsParentDeviceTimerHandle_OperatingSystemInstallation
Reimplements
Section titled “Reimplements”PrepareOperatingSystemInstallImpl
Section titled “PrepareOperatingSystemInstallImpl”virtual override
virtual void PrepareOperatingSystemInstallImpl(FGenericError & OutError) overrideDefined in OperatingSystemUnix.h:102 PrepareOperatingSystemInstallImpl function prepares the Unix-based operating system for installation.
This method is called to prepare the Unix-based operating system for installation. It adds a notification to indicate the start of the installation, and calls the PrepareToInstall function of the OperatingSystemWidget.
Parameters
Section titled “Parameters”OutErrorThe reference to the error object that will hold the error message in case of failure.
References
Section titled “References”AddNotificationInfoNOTIFICATION_OSOperatingSystemWidget
Reimplements
Section titled “Reimplements”StartOperatingSystemImpl
Section titled “StartOperatingSystemImpl”virtual override
virtual bool StartOperatingSystemImpl(FGenericError & OutError) overrideDefined in OperatingSystemUnix.h:114 Starts the Unix-based operating system.
This method is responsible for starting the Unix-based operating system. It performs necessary initialization tasks such as creating the root directory and checking for the presence of the desktop directory. It also sets the disk letter for the disk partition associated with the operating system.
Parameters
Section titled “Parameters”OutErrorA reference to an FGenericError object that will be populated with error details if the operating system fails to start.
Returns
Section titled “Returns”True if the operating system starts successfully, false otherwise.
References
Section titled “References”Reimplements
Section titled “Reimplements”PostLoadOperatingSystemImpl
Section titled “PostLoadOperatingSystemImpl”virtual override
virtual void PostLoadOperatingSystemImpl(FGenericError & OutError) overrideDefined in OperatingSystemUnix.h:132 Executes additional post-loading operations specific to Unix-based operating systems.
This method is called after the operating system has finished loading. It performs additional operations that are specific to Unix-based operating systems.
If the operating system is starting for the first time or if the current user is not valid, the method will show the initial startup screen.
If the current user’s password is empty or if the device startup type is FullBoot, the method will switch to the desktop tab.
Otherwise, the method will show the logon screen.
Parameters
Section titled “Parameters”OutErrorThe error message in case of any failure during post-loading operations.
References
Section titled “References”FullBootGetSettingsOperatingSystemWidgetParentDevice
Reimplements
Section titled “Reimplements”GetRootCommand
Section titled “GetRootCommand”virtual const override final
virtual TOptional< FText > GetRootCommand() const override finalDefined in OperatingSystemUnix.h:142 Gets the root command for the Unix-based operating system.
This method returns the root command for the Unix-based operating system. If the root command is empty or consists of only white space, the method returns an empty optional.
Returns
Section titled “Returns”The root command for the Unix-based operating system, or an empty optional if the root command is empty or consists of only white space.
References
Section titled “References”Reimplements
Section titled “Reimplements”GetRootUser
Section titled “GetRootUser”virtual const override final
virtual TOptional< FOperatingSystemUser > GetRootUser() const override finalDefined in OperatingSystemUnix.h:153 Retrieves the root user of the Unix-based operating system.
This method returns an optional object containing the root user of the Unix-based operating system.
Returns
Section titled “Returns”An optional object containing the root user of the Unix-based operating system.
References
Section titled “References”Reimplements
Section titled “Reimplements”FindProgramFromPackage
Section titled “FindProgramFromPackage”virtual override
virtual TSoftClassPtr< UOperatingSystemBaseProgram > FindProgramFromPackage(constFName & ProgramIdentifier) overrideDefined in OperatingSystemUnix.h:164 Finds a program from a package based on its identifier.
This method searches for a program with the given identifier in the repository classes of the Unix-based operating system. If a program is found with the matching identifier, it returns a soft class pointer to the program’s class. Otherwise, it returns nullptr.
Parameters
Section titled “Parameters”ProgramIdentifierThe identifier of the program to search for.
Returns
Section titled “Returns”A soft class pointer to the program’s class if found, nullptr otherwise.
References
Section titled “References”GetSettingsOS_LOGRepositoryClasses
Reimplements
Section titled “Reimplements”CreateRootDirectory
Section titled “CreateRootDirectory”bool CreateRootDirectory(constbool bIsFromSaveGame)Defined in OperatingSystemUnix.h:177 Creates the root directory for the Unix-based operating system if it does not already exist. The root directory is determined by finding the Unix root directory among all the available directories. If the root directory exists, this method returns true. Otherwise, it attempts to create the root directory using the first directory with the tag “Root”. If the root directory is successfully created, this method returns true. Otherwise, it returns false.
Parameters
Section titled “Parameters”bIsFromSaveGameA boolean indicating whether the root directory is being created from a save game.
Returns
Section titled “Returns”A boolean indicating whether the root directory was successfully created or already exists. Returns true if the root directory exists or was created successfully, false otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
TObjectPtr< UOperatingSystemRootDirectory > | RootDirectory |
RootDirectory
Section titled “RootDirectory”TObjectPtr< UOperatingSystemRootDirectory > RootDirectoryDefined in OperatingSystemUnix.h:38