Skip to content

UOperatingSystemUnix

#include <OperatingSystemSimulator/Public/Core/OperatingSystemUnix.h>
class UOperatingSystemUnix

Defined in OperatingSystemUnix.h:17

Inherits: UOperatingSystem Subclassed by: UOperatingSystemUnixPhone

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemUnix["UOperatingSystemUnix"]
  class UOperatingSystem["UOperatingSystem"]
  UOperatingSystem <|-- UOperatingSystemUnix
  class UOperatingSystemUnixPhone["UOperatingSystemUnixPhone"]
  UOperatingSystemUnix <|-- UOperatingSystemUnixPhone
---
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
---
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.

ReturnNameDescription
UOperatingSystemUnix
UOperatingSystemDirectory *CreateDirectoryInPath virtual overrideCreates a directory within a given path.
constTSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > > &GetRepositoryClasses const inlineRetrieves the repository classes in the Operating System Simulator.

UOperatingSystemUnix()

virtual override

virtual UOperatingSystemDirectory * CreateDirectoryInPath(constFString & TargetPath, constFString & DirectoryName, TSoftClassPtr< UOperatingSystemDirectory > DirectoryClass, UOperatingSystemPartition * TargetPartition, constbool bIsFromSaveGame, FGenericError & OutError) override

Defined 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.

  • TargetPath The target path where the directory will be created.

  • DirectoryName The name of the directory to be created.

  • DirectoryClass The class pointer of the directory to be created.

  • TargetPartition The target partition where the directory will be added.

  • bIsFromSaveGame Indicates whether the directory is from a save game.

  • OutError The reference to the error object that will hold the error message in case of failure.

The created directory if successful, or nullptr if an error occurs.


const inline

inline constTSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > > & GetRepositoryClasses() const

Defined 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>.

The set of repository classes in the Operating System Simulator.

ReturnNameDescription
FOperatingSystemUserRootUserRoot user for this Operating System.
FTextRootCommandRoot command name. Defaults to sudo.
TSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > >RepositoryClassesSimulates 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.

FOperatingSystemUser RootUser

Defined in OperatingSystemUnix.h:25 Root user for this Operating System.


FText RootCommand

Defined in OperatingSystemUnix.h:29 Root command name. Defaults to sudo.


TSet< TSoftObjectPtr< UOperatingSystemProgramsCollection > > RepositoryClasses

Defined 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.

ReturnNameDescription
voidOnValidate virtual const overrideValidates the Unix-based operating system.
voidFinalizePreInstallation virtual overrideFinalizes the pre-installation process for a Unix-based operating system.
voidPrepareOperatingSystemInstallImpl virtual overridePrepareOperatingSystemInstallImpl function prepares the Unix-based operating system for installation.
boolStartOperatingSystemImpl virtual overrideStarts the Unix-based operating system.
voidPostLoadOperatingSystemImpl virtual overrideExecutes additional post-loading operations specific to Unix-based operating systems.
TOptional< FText >GetRootCommand virtual const override finalGets the root command for the Unix-based operating system.
TOptional< FOperatingSystemUser >GetRootUser virtual const override finalRetrieves the root user of the Unix-based operating system.
TSoftClassPtr< UOperatingSystemBaseProgram >FindProgramFromPackage virtual overrideFinds a program from a package based on its identifier.
boolCreateRootDirectoryCreates 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.

virtual const override

virtual void OnValidate(FGenericError & OutError) const override

Defined 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.

  • OutError The reference to the error object that will hold the error message in case of validation failure.

virtual override

virtual void FinalizePreInstallation(FGenericError & OutError) override

Defined 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.

  • OutError The reference to the error object that will hold the error message in case of failure.

virtual override

virtual void PrepareOperatingSystemInstallImpl(FGenericError & OutError) override

Defined 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.

  • OutError The reference to the error object that will hold the error message in case of failure.

virtual override

virtual bool StartOperatingSystemImpl(FGenericError & OutError) override

Defined 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.

  • OutError A reference to an FGenericError object that will be populated with error details if the operating system fails to start.

True if the operating system starts successfully, false otherwise.


virtual override

virtual void PostLoadOperatingSystemImpl(FGenericError & OutError) override

Defined 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.

  • OutError The error message in case of any failure during post-loading operations.

virtual const override final

virtual TOptional< FText > GetRootCommand() const override final

Defined 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.

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.


virtual const override final

virtual TOptional< FOperatingSystemUser > GetRootUser() const override final

Defined 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.

An optional object containing the root user of the Unix-based operating system.


virtual override

virtual TSoftClassPtr< UOperatingSystemBaseProgram > FindProgramFromPackage(constFName & ProgramIdentifier) override

Defined 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.

  • ProgramIdentifier The identifier of the program to search for.

A soft class pointer to the program’s class if found, nullptr otherwise.


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.

  • bIsFromSaveGame A boolean indicating whether the root directory is being created from a save game.

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.

ReturnNameDescription
TObjectPtr< UOperatingSystemRootDirectory >RootDirectory

TObjectPtr< UOperatingSystemRootDirectory > RootDirectory

Defined in OperatingSystemUnix.h:38