Skip to content

UOperatingSystemFile

#include <OperatingSystemSimulator/Public/Files/OperatingSystemFile.h>
class UOperatingSystemFile

Defined in OperatingSystemFile.h:20

Inherits: UObject Subclassed by: UOperatingSystemAudioFile, UOperatingSystemVideoFile

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemFile["UOperatingSystemFile"]
  class UObject["UObject"]
  UObject <|-- UOperatingSystemFile
  class UOperatingSystemAudioFile["UOperatingSystemAudioFile"]
  UOperatingSystemFile <|-- UOperatingSystemAudioFile
  class UOperatingSystemVideoFile["UOperatingSystemVideoFile"]
  UOperatingSystemFile <|-- UOperatingSystemVideoFile
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemFile["UOperatingSystemFile"]
  class UOperatingSystemBaseProgram["UOperatingSystemBaseProgram"]
  UOperatingSystemFile *-- UOperatingSystemBaseProgram
  class UOperatingSystemFileIconWidget["UOperatingSystemFileIconWidget"]
  UOperatingSystemFile *-- UOperatingSystemFileIconWidget
  class UOperatingSystemFileWidget["UOperatingSystemFileWidget"]
  UOperatingSystemFile *-- UOperatingSystemFileWidget
  class IOperatingSystemExplorerInterface["IOperatingSystemExplorerInterface"]
  UOperatingSystemFile *-- IOperatingSystemExplorerInterface
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemFile {
    +UOperatingSystemFile()
    +OpenFile(FGenericError &OutError)
    +CloseFile()
    +GetFileName(const bool bWithExtension=true) const FText
    +GetExtension() const FText
    +IsSameFile(const UOperatingSystemFile *OtherFile) cons bool
    +GetIconObject() const TSoftObjectPtr< UObject >
    +GetExplorerInterface() const TScriptInterface< IOperatingSystemExplor
    +CreateFile(TScriptInterface< IOperatingSystemExplorerI UOperatingSystemFile() *
    +CreateRuntimeFile(UOperatingSystemFile *ParentFile) UOperatingSystemFile() *
    +Name : FText
    +Extension : FText
    +IconObject : TSoftObjectPtr< UObject >
    +SpaceRequiredInMB : float
    +bIsDeletable : uint8
    +bIsMovable : uint8
    +TargetProgramClass : TSoftClassPtr< UOperatingSystemBaseProgr
    +IconWidgetClass : TSoftClassPtr< UOperatingSystemFileIconW
    +WidgetClass : TSoftClassPtr< UOperatingSystemFileWidge
    +ParentProgram : TWeakObjectPtr< UOperatingSystemBaseProg
    +FileWidget : TObjectPtr< UOperatingSystemFileWidget()
    +ParentExplorerInterface : TScriptInterface< IOperatingSystemExplor
    +bHasBlueprintOnOpen : bool
    +OnValidate(FGenericError &OutError)
    +CreateIconWidget() UOperatingSystemFileIconWidget() *
    +K2_OnOpen()
    +Internal_Validate(FGenericError &OutError)
  }

Documented call sites inside the plugin (4):

flowchart LR
  UOperatingSystemFile__GetFileName["UOperatingSystemFile::GetFileName"]
  UOperatingSystemFile__IsSameFile["UOperatingSystemFile::IsSameFile"]
  UOperatingSystemFile__IsSameFile --> UOperatingSystemFile__GetFileName
  UOperatingSystemAudioFile__OnValidate["UOperatingSystemAudioFile::OnValidate"]
  UOperatingSystemAudioFile__OnValidate --> UOperatingSystemFile__GetFileName
  UOperatingSystemVideoFile__OnValidate["UOperatingSystemVideoFile::OnValidate"]
  UOperatingSystemVideoFile__OnValidate --> UOperatingSystemFile__GetFileName
  UOperatingSystemFile__OpenFile["UOperatingSystemFile::OpenFile"]
  UOperatingSystemFile__OpenFile --> UOperatingSystemFile__GetFileName

Documented call sites inside the plugin (3):

flowchart LR
  UOperatingSystemFile__GetExplorerInterface["UOperatingSystemFile::GetExplorerInterface"]
  UOperatingSystemFileWidget__CreateFileWidget["UOperatingSystemFileWidget::CreateFileWidget"]
  UOperatingSystemFileWidget__CreateFileWidget --> UOperatingSystemFile__GetExplorerInterface
  UOperatingSystemFileIconWidget__CreateIconWidget["UOperatingSystemFileIconWidget::CreateIconWidget"]
  UOperatingSystemFileIconWidget__CreateIconWidget --> UOperatingSystemFile__GetExplorerInterface
  UOperatingSystemFile__CreateRuntimeFile["UOperatingSystemFile::CreateRuntimeFile"]
  UOperatingSystemFile__CreateRuntimeFile --> UOperatingSystemFile__GetExplorerInterface

UOperatingSystemFile is a class that represents a file in an operating system.

It provides properties and methods to manage file data and behavior, such as name, extension, icon, space required, and more.

ReturnNameDescription
UOperatingSystemFile
voidOpenFileOpens the file in its associated program.
voidCloseFileCloses the file and cleans up any associated resources.
FTextGetFileName constGets the file name.
FTextGetExtension const inlineRetrieves the extension of the file.
boolIsSameFile constChecks if the given file is the same as this file.
TSoftObjectPtr< UObject >GetIconObject const inlineGetIconObject is a method that returns the icon object associated with the operating system file.
TScriptInterface< IOperatingSystemExplorerInterface >GetExplorerInterface const inlineThis method returns the TScriptInterface of the IOperatingSystemExplorer.

UOperatingSystemFile()

Defined in OperatingSystemFile.h:78

  • CHECK_IN_BP
  • IMPLEMENTED_IN_BP_LAMBDA

void OpenFile(FGenericError & OutError)

Defined in OperatingSystemFile.h:164 Opens the file in its associated program.

This method is used to open the file using the associated program. If the associated program is not set or no compatible program is installed, an error message is generated and added to the operating system’s notification list.

  • OutError A reference to a FGenericError object that will contain any error messages.

See also: FGenericError


void CloseFile()

Defined in OperatingSystemFile.h:177 Closes the file and cleans up any associated resources.

This method is used to close the file and perform any necessary cleanup operations. It resets the parent program and removes the file widget from the parent if it is valid.

See also: UOperatingSystemFile::ParentProgram

See also: UOperatingSystemFile::FileWidget


const

FText GetFileName(const bool bWithExtension = true) const

Defined in OperatingSystemFile.h:189 Gets the file name.

This method returns the file name of the operating system file. It can optionally include the file extension as well.

  • bWithExtension Whether to include the file extension in the returned file name. Default value is true.

The file name as a FText object.


const inline

inline FText GetExtension() const

Defined in OperatingSystemFile.h:199 Retrieves the extension of the file.

This method returns the extension of the file as a text string. The extension represents the part of the file name after the last period (.) character.

The extension of the file as a text string.


const

bool IsSameFile(const UOperatingSystemFile * OtherFile) const

Defined in OperatingSystemFile.h:208 Checks if the given file is the same as this file.

  • OtherFile The file to compare with this file.

True if the given file is the same as this file, false otherwise.


const inline

inline TSoftObjectPtr< UObject > GetIconObject() const

Defined in OperatingSystemFile.h:229 GetIconObject is a method that returns the icon object associated with the operating system file.

A TSoftObjectPtr<UObject> object representing the icon object associated with the operating system file.


const inline

inline TScriptInterface< IOperatingSystemExplorerInterface > GetExplorerInterface() const

Defined in OperatingSystemFile.h:233 This method returns the TScriptInterface of the IOperatingSystemExplorer.

ReturnNameDescription
UOperatingSystemFile *CreateFile staticCreates a new file in the operating system.
UOperatingSystemFile *CreateRuntimeFile staticCreates a runtime file based on the given parent file.

static

static UOperatingSystemFile * CreateFile(TScriptInterface< IOperatingSystemExplorerInterface > ExplorerInterface, const TSoftClassPtr< UOperatingSystemFile > & FileSoftClass, FGenericError & OutError)

Defined in OperatingSystemFile.h:98 Creates a new file in the operating system.

This method creates a new file in the operating system using the specified explorer interface and file class.

  • ExplorerInterface The interface to the operating system explorer used to create the file.

  • FileSoftClass The soft class pointer to the file class that will be used to create the file.

  • OutError (output) The error object that will be populated if an error occurs during file creation. If the file creation is successful, this error object will be cleared.

A pointer to the newly created file if the creation was successful, nullptr otherwise.


static

static UOperatingSystemFile * CreateRuntimeFile(UOperatingSystemFile * ParentFile)

Defined in OperatingSystemFile.h:111 Creates a runtime file based on the given parent file.

This method creates a new runtime file by copying the properties of the parent file and setting the necessary flags.

  • ParentFile The parent file from which the runtime file will be created. Must have RF_Transient flag.

The newly created runtime file. This file is managed by the caller and is expected to be deleted when no longer needed.

ReturnNameDescription
FTextNameName of this file without extension.
FTextExtensionExtension represents the file extension of an operating system file.
TSoftObjectPtr< UObject >IconObjectObvious right? C’mon its just an Icon. What you need a tooltip for ¯(ツ)
floatSpaceRequiredInMBHow much space does this file require on hard disk.
uint8bIsDeletableIs this file deletable?
uint8bIsMovableIs this file movable?
TSoftClassPtr< UOperatingSystemBaseProgram >TargetProgramClassTarget class for the program that can open this file.
TSoftClassPtr< UOperatingSystemFileIconWidget >IconWidgetClassTarget icon class for this file.
TSoftClassPtr< UOperatingSystemFileWidget >WidgetClassTarget widget class for this file.
TWeakObjectPtr< UOperatingSystemBaseProgram >ParentProgramProgram instance that owns this file.
TObjectPtr< UOperatingSystemFileWidget >FileWidgetWidget spawned by this file.
TScriptInterface< IOperatingSystemExplorerInterface >ParentExplorerInterface
boolbHasBlueprintOnOpen

FText Name

Defined in OperatingSystemFile.h:28 Name of this file without extension.


FText Extension

Defined in OperatingSystemFile.h:32 Extension represents the file extension of an operating system file.


TSoftObjectPtr< UObject > IconObject

Defined in OperatingSystemFile.h:36 Obvious right? C’mon its just an Icon. What you need a tooltip for ¯(ツ)


float SpaceRequiredInMB

Defined in OperatingSystemFile.h:40 How much space does this file require on hard disk.


uint8 bIsDeletable

Defined in OperatingSystemFile.h:44 Is this file deletable?


uint8 bIsMovable

Defined in OperatingSystemFile.h:48 Is this file movable?


TSoftClassPtr< UOperatingSystemBaseProgram > TargetProgramClass

Defined in OperatingSystemFile.h:52 Target class for the program that can open this file.


TSoftClassPtr< UOperatingSystemFileIconWidget > IconWidgetClass

Defined in OperatingSystemFile.h:56 Target icon class for this file.


TSoftClassPtr< UOperatingSystemFileWidget > WidgetClass

Defined in OperatingSystemFile.h:60 Target widget class for this file.


TWeakObjectPtr< UOperatingSystemBaseProgram > ParentProgram

Defined in OperatingSystemFile.h:64 Program instance that owns this file.


TObjectPtr< UOperatingSystemFileWidget > FileWidget

Defined in OperatingSystemFile.h:68 Widget spawned by this file.


TScriptInterface< IOperatingSystemExplorerInterface > ParentExplorerInterface

Defined in OperatingSystemFile.h:71


bool bHasBlueprintOnOpen

Defined in OperatingSystemFile.h:74

ReturnNameDescription
voidOnValidate virtual inlineExecute custom validation logic for the operating system file.
UOperatingSystemFileIconWidget *CreateIconWidgetCreates an operating system file icon widget.
voidK2_OnOpenK2_OnOpen is an event method that is called when the operating system file is opened.

virtual inline

virtual inline void OnValidate(FGenericError & OutError)

Defined in OperatingSystemFile.h:141 Execute custom validation logic for the operating system file.

This virtual method can be overridden in derived classes to provide custom validation logic for the operating system file. The derived class should implement the desired validation logic and modify the OutError object if there are any validation failures.

  • OutError [in,out] The error object to store the validation failures, if any.

See also: FGenericError


UOperatingSystemFileIconWidget * CreateIconWidget()

Defined in OperatingSystemFile.h:149 Creates an operating system file icon widget.

A pointer to the created operating system file icon widget. Returns nullptr if the icon widget class is null.


void K2_OnOpen()

Defined in OperatingSystemFile.h:218 K2_OnOpen is an event method that is called when the operating system file is opened.

This method is blueprint implementable, allowing subclasses to override and provide custom functionality when the file is opened.

ReturnNameDescription
voidInternal_ValidateValidates the internal state of the operating system file.

void Internal_Validate(FGenericError & OutError)

Defined in OperatingSystemFile.h:123 Validates the internal state of the operating system file.

This method checks if the name, icon, space required setting, icon widget class, and widget class are valid. If any of these properties are invalid, it generates an error message using the class name and returns it through the OutError parameter.

  • OutError A reference to a FGenericError object that will contain the error message if any validation errors occur.