UOperatingSystemFile
#include <OperatingSystemSimulator/Public/Files/OperatingSystemFile.h>class UOperatingSystemFileDefined in OperatingSystemFile.h:20
Inherits:
UObjectSubclassed by:UOperatingSystemAudioFile,UOperatingSystemVideoFile
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemFile["UOperatingSystemFile"]
class UObject["UObject"]
UObject <|-- UOperatingSystemFile
class UOperatingSystemAudioFile["UOperatingSystemAudioFile"]
UOperatingSystemFile <|-- UOperatingSystemAudioFile
class UOperatingSystemVideoFile["UOperatingSystemVideoFile"]
UOperatingSystemFile <|-- UOperatingSystemVideoFile
Collaboration diagram
Section titled “Collaboration diagram”---
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
Class detail
Section titled “Class detail”---
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)
}
Caller impact — GetFileName
Section titled “Caller impact — GetFileName”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
Caller impact — GetExplorerInterface
Section titled “Caller impact — GetExplorerInterface”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.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemFile | ||
void | OpenFile | Opens the file in its associated program. |
void | CloseFile | Closes the file and cleans up any associated resources. |
FText | GetFileName const | Gets the file name. |
FText | GetExtension const inline | Retrieves the extension of the file. |
bool | IsSameFile const | Checks if the given file is the same as this file. |
TSoftObjectPtr< UObject > | GetIconObject const inline | GetIconObject is a method that returns the icon object associated with the operating system file. |
TScriptInterface< IOperatingSystemExplorerInterface > | GetExplorerInterface const inline | This method returns the TScriptInterface of the IOperatingSystemExplorer. |
UOperatingSystemFile
Section titled “UOperatingSystemFile”UOperatingSystemFile()Defined in OperatingSystemFile.h:78
References
Section titled “References”CHECK_IN_BPIMPLEMENTED_IN_BP_LAMBDA
OpenFile
Section titled “OpenFile”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.
Parameters
Section titled “Parameters”OutErrorA reference to a FGenericError object that will contain any error messages.
See also: FGenericError
References
Section titled “References”ApplicationbHasBlueprintOnOpenCreateFileWidgetFileWidgetGetFileNameIsValidK2_OnOpenMAKE_ERROROperatingSystemParentExplorerInterfaceParentProgramTargetProgramClassWidgetClass
CloseFile
Section titled “CloseFile”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
References
Section titled “References”GetFileName
Section titled “GetFileName”const
FText GetFileName(const bool bWithExtension = true) constDefined 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.
Parameters
Section titled “Parameters”bWithExtensionWhether to include the file extension in the returned file name. Default value is true.
Returns
Section titled “Returns”The file name as a FText object.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetExtension
Section titled “GetExtension”const inline
inline FText GetExtension() constDefined 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.
Returns
Section titled “Returns”The extension of the file as a text string.
IsSameFile
Section titled “IsSameFile”const
bool IsSameFile(const UOperatingSystemFile * OtherFile) constDefined in OperatingSystemFile.h:208 Checks if the given file is the same as this file.
Parameters
Section titled “Parameters”OtherFileThe file to compare with this file.
Returns
Section titled “Returns”True if the given file is the same as this file, false otherwise.
References
Section titled “References”GetIconObject
Section titled “GetIconObject”const inline
inline TSoftObjectPtr< UObject > GetIconObject() constDefined in OperatingSystemFile.h:229 GetIconObject is a method that returns the icon object associated with the operating system file.
Returns
Section titled “Returns”A TSoftObjectPtr<UObject> object representing the icon object associated with the operating system file.
GetExplorerInterface
Section titled “GetExplorerInterface”const inline
inline TScriptInterface< IOperatingSystemExplorerInterface > GetExplorerInterface() constDefined in OperatingSystemFile.h:233 This method returns the TScriptInterface of the IOperatingSystemExplorer.
Referenced by
Section titled “Referenced by”Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemFile * | CreateFile static | Creates a new file in the operating system. |
UOperatingSystemFile * | CreateRuntimeFile static | Creates a runtime file based on the given parent file. |
CreateFile
Section titled “CreateFile”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.
Parameters
Section titled “Parameters”-
ExplorerInterfaceThe interface to the operating system explorer used to create the file. -
FileSoftClassThe 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.
Returns
Section titled “Returns”A pointer to the newly created file if the creation was successful, nullptr otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”ErrorExceptionDescriptionIsValidMAKE_ERRORNEW_SOFT_OBJOS_LOG_ERROROS_LOG_VERY_VERBOSEOS_LOG_WARNReset
CreateRuntimeFile
Section titled “CreateRuntimeFile”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.
Parameters
Section titled “Parameters”ParentFileThe parent file from which the runtime file will be created. Must have RF_Transient flag.
Returns
Section titled “Returns”The newly created runtime file. This file is managed by the caller and is expected to be deleted when no longer needed.
Referenced by
Section titled “Referenced by”References
Section titled “References”GetExplorerInterfaceNEW_OBJ
Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
FText | Name | Name of this file without extension. |
FText | Extension | Extension represents the file extension of an operating system file. |
TSoftObjectPtr< UObject > | IconObject | Obvious right? C’mon its just an Icon. What you need a tooltip for ¯(ツ)/¯ |
float | SpaceRequiredInMB | How much space does this file require on hard disk. |
uint8 | bIsDeletable | Is this file deletable? |
uint8 | bIsMovable | Is this file movable? |
TSoftClassPtr< UOperatingSystemBaseProgram > | TargetProgramClass | Target class for the program that can open this file. |
TSoftClassPtr< UOperatingSystemFileIconWidget > | IconWidgetClass | Target icon class for this file. |
TSoftClassPtr< UOperatingSystemFileWidget > | WidgetClass | Target widget class for this file. |
TWeakObjectPtr< UOperatingSystemBaseProgram > | ParentProgram | Program instance that owns this file. |
TObjectPtr< UOperatingSystemFileWidget > | FileWidget | Widget spawned by this file. |
TScriptInterface< IOperatingSystemExplorerInterface > | ParentExplorerInterface | |
bool | bHasBlueprintOnOpen |
FText NameDefined in OperatingSystemFile.h:28 Name of this file without extension.
Referenced by
Section titled “Referenced by”Extension
Section titled “Extension”FText ExtensionDefined in OperatingSystemFile.h:32 Extension represents the file extension of an operating system file.
Referenced by
Section titled “Referenced by”IconObject
Section titled “IconObject”TSoftObjectPtr< UObject > IconObjectDefined in OperatingSystemFile.h:36 Obvious right? C’mon its just an Icon. What you need a tooltip for ¯(ツ)/¯
Referenced by
Section titled “Referenced by”SpaceRequiredInMB
Section titled “SpaceRequiredInMB”float SpaceRequiredInMBDefined in OperatingSystemFile.h:40 How much space does this file require on hard disk.
Referenced by
Section titled “Referenced by”bIsDeletable
Section titled “bIsDeletable”uint8 bIsDeletableDefined in OperatingSystemFile.h:44 Is this file deletable?
bIsMovable
Section titled “bIsMovable”uint8 bIsMovableDefined in OperatingSystemFile.h:48 Is this file movable?
TargetProgramClass
Section titled “TargetProgramClass”TSoftClassPtr< UOperatingSystemBaseProgram > TargetProgramClassDefined in OperatingSystemFile.h:52 Target class for the program that can open this file.
Referenced by
Section titled “Referenced by”IconWidgetClass
Section titled “IconWidgetClass”TSoftClassPtr< UOperatingSystemFileIconWidget > IconWidgetClassDefined in OperatingSystemFile.h:56 Target icon class for this file.
Referenced by
Section titled “Referenced by”WidgetClass
Section titled “WidgetClass”TSoftClassPtr< UOperatingSystemFileWidget > WidgetClassDefined in OperatingSystemFile.h:60 Target widget class for this file.
Referenced by
Section titled “Referenced by”ParentProgram
Section titled “ParentProgram”TWeakObjectPtr< UOperatingSystemBaseProgram > ParentProgramDefined in OperatingSystemFile.h:64 Program instance that owns this file.
Referenced by
Section titled “Referenced by”FileWidget
Section titled “FileWidget”TObjectPtr< UOperatingSystemFileWidget > FileWidgetDefined in OperatingSystemFile.h:68 Widget spawned by this file.
Referenced by
Section titled “Referenced by”ParentExplorerInterface
Section titled “ParentExplorerInterface”TScriptInterface< IOperatingSystemExplorerInterface > ParentExplorerInterfaceDefined in OperatingSystemFile.h:71
Referenced by
Section titled “Referenced by”bHasBlueprintOnOpen
Section titled “bHasBlueprintOnOpen”bool bHasBlueprintOnOpenDefined in OperatingSystemFile.h:74
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | OnValidate virtual inline | Execute custom validation logic for the operating system file. |
UOperatingSystemFileIconWidget * | CreateIconWidget | Creates an operating system file icon widget. |
void | K2_OnOpen | K2_OnOpen is an event method that is called when the operating system file is opened. |
OnValidate
Section titled “OnValidate”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.
Parameters
Section titled “Parameters”OutError[in,out] The error object to store the validation failures, if any.
See also: FGenericError
Referenced by
Section titled “Referenced by”Reimplemented by
Section titled “Reimplemented by”CreateIconWidget
Section titled “CreateIconWidget”UOperatingSystemFileIconWidget * CreateIconWidget()Defined in OperatingSystemFile.h:149 Creates an operating system file icon widget.
Returns
Section titled “Returns”A pointer to the created operating system file icon widget. Returns nullptr if the icon widget class is null.
References
Section titled “References”CreateIconWidgetIconWidgetClassNameOS_LOG_ERROR
K2_OnOpen
Section titled “K2_OnOpen”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.
Referenced by
Section titled “Referenced by”Private Methods
Section titled “Private Methods”| Return | Name | Description |
|---|---|---|
void | Internal_Validate | Validates the internal state of the operating system file. |
Internal_Validate
Section titled “Internal_Validate”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.
Parameters
Section titled “Parameters”OutErrorA reference to a FGenericError object that will contain the error message if any validation errors occur.