Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
#include "OperatingSystemFile.h"
Public Member Functions | |
UOperatingSystemFile () | |
void | OpenFile (FGenericError &OutError) |
void | CloseFile () |
Closes the file and cleans up any associated resources. | |
FText | GetFileName (const bool bWithExtension=true) const |
FText | GetExtension () const |
bool | IsSameFile (const UOperatingSystemFile *OtherFile) const |
FORCEINLINE TSoftObjectPtr< UObject > | GetIconObject () const |
FORCEINLINE TScriptInterface< IOperatingSystemExplorerInterface > | GetExplorerInterface () const |
This method returns the TScriptInterface of the IOperatingSystemExplorer. | |
Static Public Member Functions | |
static UOperatingSystemFile * | CreateFile (TScriptInterface< IOperatingSystemExplorerInterface > ExplorerInterface, const TSoftClassPtr< UOperatingSystemFile > &FileSoftClass, FGenericError &OutError) |
Creates a new file in the operating system. | |
static UOperatingSystemFile * | CreateRuntimeFile (UOperatingSystemFile *ParentFile) |
Creates a runtime file based on the given parent file. | |
Protected Member Functions | |
virtual void | OnValidate (FGenericError &OutError) |
Execute custom validation logic for the operating system file. | |
UOperatingSystemFileIconWidget * | CreateIconWidget () |
void | K2_OnOpen () |
Protected Attributes | |
FText | Name |
FText | Extension |
TSoftObjectPtr< UObject > | IconObject |
float | SpaceRequiredInMB |
uint8 | bIsDeletable: 1 |
uint8 | bIsMovable: 1 |
TSoftClassPtr< UOperatingSystemBaseProgram > | TargetProgramClass |
TSoftClassPtr< UOperatingSystemFileIconWidget > | IconWidgetClass |
TSoftClassPtr< UOperatingSystemFileWidget > | WidgetClass |
TWeakObjectPtr< UOperatingSystemBaseProgram > | ParentProgram |
TObjectPtr< UOperatingSystemFileWidget > | FileWidget |
TScriptInterface< IOperatingSystemExplorerInterface > | ParentExplorerInterface |
bool | bHasBlueprintOnOpen |
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.
UOperatingSystemFile::UOperatingSystemFile | ( | ) |
void UOperatingSystemFile::CloseFile | ( | ) |
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.
|
static |
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. |
|
protected |
Creates an operating system file icon widget.
|
static |
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. |
|
inline |
This method returns the TScriptInterface of the IOperatingSystemExplorer.
|
inline |
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.
FText UOperatingSystemFile::GetFileName | ( | const bool | bWithExtension = true | ) | const |
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. |
|
inline |
GetIconObject is a method that returns the icon object associated with the operating system file.
bool UOperatingSystemFile::IsSameFile | ( | const UOperatingSystemFile * | OtherFile | ) | const |
Checks if the given file is the same as this file.
OtherFile | The file to compare with this file. |
|
protected |
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.
|
inlineprotectedvirtual |
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. |
Reimplemented in UOperatingSystemAudioFile, and UOperatingSystemVideoFile.
void UOperatingSystemFile::OpenFile | ( | FGenericError & | OutError | ) |
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. |
|
protected |
|
protected |
Is this file deletable?
|
protected |
Is this file movable?
|
protected |
Extension represents the file extension of an operating system file.
|
protected |
Widget spawned by this file.
|
protected |
Obvious right? C'mon its just an Icon. What you need a tooltip for ¯_(ツ)_/¯
|
protected |
Target icon class for this file.
|
protected |
Name of this file without extension.
|
protected |
|
protected |
Program instance that owns this file.
|
protected |
How much space does this file require on hard disk.
|
protected |
Target class for the program that can open this file.
|
protected |
Target widget class for this file.