UOperatingSystemPartition
#include <OperatingSystemSimulator/Public/Core/OperatingSystemPartition.h>class UOperatingSystemPartitionDefined in OperatingSystemPartition.h:40
Inherits:
UObject,IOperatingSystemExplorerInterface
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemPartition["UOperatingSystemPartition"]
class UObject["UObject"]
UObject <|-- UOperatingSystemPartition
class IOperatingSystemExplorerInterface["IOperatingSystemExplorerInterface"]
IOperatingSystemExplorerInterface <|-- UOperatingSystemPartition
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemPartition["UOperatingSystemPartition"]
class UOperatingSystemDirectory["UOperatingSystemDirectory"]
UOperatingSystemPartition *-- UOperatingSystemDirectory
class FOperatingSystemUniqueId["FOperatingSystemUniqueId"]
UOperatingSystemPartition *-- FOperatingSystemUniqueId
class UOperatingSystemFile["UOperatingSystemFile"]
UOperatingSystemPartition *-- UOperatingSystemFile
class UOperatingSystemHDD["UOperatingSystemHDD"]
UOperatingSystemPartition *-- UOperatingSystemHDD
class UOperatingSystem["UOperatingSystem"]
UOperatingSystemPartition *-- UOperatingSystem
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemPartition {
+SetDiskName(const FString &NewDiskName)
+SetSystemPartition(const bool bNewSystemPartition)
+SetOwningOperatingSystem(UOperatingSystem *OwningOS)
+AddDirectories(const TArray< UOperatingSystemDirectory * >
+AddDirectory(UOperatingSystemDirectory *NewDirectory)
+ConsumeSpace(const double &SizeInBytes, FGenericError &O
+FreeupSpace(const double &SizeInBytes)
+GetSizeAsText(const EOperatingSystemSizeMethod &SizeMetho FText
+GetChildDirectories() const override final TArray< UOperatingSystemDirectory() * >
+GetParentExplorerInterface(TScriptInterface< IOperatingSystemExplorerI
+IsPartition() const override final bool
+GetInterfaceDisplayName() const override final FText
+FindDirectoryByTag(const FGameplayTag DirectoryTag, const bool bool
+GetChildDirectory(const FString &TargetChildDirectoryName, co TScriptInterface< IOperatingSystemExplor
+GetAllFiles(const FString &WithExtension="*") const ove TArray< UOperatingSystemFile() * >
+CanCreateNewFile() const override final bool
+HasEnoughSpace(const FOperatingSystemSizeInMB &TestSpace) bool
+GetOperatingSystem() const override final UOperatingSystem() *
+GetFullPath() const override final TOptional< FString >
+GetInterfaceFromPath(const FString &NewPath) const override fina TScriptInterface< IOperatingSystemExplor
+SetDiskLetter(const FName &NewDiskLetter)
+GetPartitionPath() const FString
+IsValidPartition() const bool
+HasEnoughSpace(const double &TestSpaceInBytes) const bool
+GetStoragePercentage() const float
+GetTotalSizeBytes() const double
+GetFreeSizeBytes() const double
+IsSystemPartition() const bool
+GetPartitionID() const FOperatingSystemUniqueId()
+GetDiskLetter() const FName
+GetNewPartitionSaveLoad() const FOperatingSystemPartitionSaveLoad()
+GetChildDirectory(const FString &TargetChildDirectoryName, co T *
+CreateNewPartition(UOperatingSystemHDD *OwningHDD, const doubl UOperatingSystemPartition() *
+LoadNewPartition(UOperatingSystemHDD *OwningHDD, const FOper UOperatingSystemPartition() *
+DiskName : FText
+DiskDisplayName : FText
+TotalSizeInBytes : double
+FreeSpaceInBytes : double
+bIsSystemPartition : bool
+PartitionID : FOperatingSystemUniqueId()
+DiskLetter : FName
+Files : TArray< TObjectPtr< UOperatingSystemFile
+ParentHDD : TWeakObjectPtr< UOperatingSystemHDD() >
+ParentOS : TWeakObjectPtr< UOperatingSystem() >
+SetDiskDisplayName(const FText &NewName)
+Directories : TArray< TObjectPtr< UOperatingSystemDire
}
The UOperatingSystemPartition class represents an operating system partition. It inherits from UObject and implements the IOperatingSystemExplorerInterface. This class provides functionality to manage directories, disk information, and file operations.
Key Features:
-
Create and load new partitions
-
Set disk name and system partition flag
-
Add directories to the partition
-
Consume and free up space in the partition
-
Get information about partition size and disk letter
-
Retrieve child directories and files
-
Check if a partition is valid and has enough space
-
Get the storage percentage of the partition
-
Get the partition ID and disk letter
-
Set the disk display name
-
Get the partition path and new partition save/load data
-
Get a child directory of a specific type
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void | SetDiskName | Sets the display name of the disk. |
void | SetSystemPartition | Sets the system partition flag for the operating system partition. |
void | SetOwningOperatingSystem | Sets the owning operating system of the UOperatingSystemPartition. |
void | AddDirectories | Adds directories to the operating system partition. |
void | AddDirectory | Adds a directory to the operating system partition. |
void | ConsumeSpace | Consume space in the operating system partition. |
void | FreeupSpace | The FreeupSpace method allows you to free up space in the operating system partition. This method updates the FreeSpaceInBytes variable by adding the specified size in bytes. If the updated value of FreeSpaceInBytes exceeds the TotalSizeInBytes, it is set to TotalSizeInBytes to ensure the partition does not have more free space than the total size. |
FText | GetSizeAsText const | Converts the partition size to a human-readable text format. |
TArray< UOperatingSystemDirectory * > | GetChildDirectories virtual const inline override final | Retrieves the child directories of this operating system partition. |
void | GetParentExplorerInterface virtual const inline override final | This method retrieves the parent explorer interface associated with the operating system partition. |
bool | IsPartition virtual const inline override final | Check if the object is an operating system partition. |
FText | GetInterfaceDisplayName virtual const inline override final | Get the display name of the interface. This method returns the display name of the interface. |
bool | FindDirectoryByTag virtual const override final | Searches for a directory by tag in the operating system partition. |
TScriptInterface< IOperatingSystemExplorerInterface > | GetChildDirectory virtual const override final | Returns a child directory with the specified name. |
TArray< UOperatingSystemFile * > | GetAllFiles virtual const override final | Retrieves an array of all files in the partition with the specified extension. |
bool | CanCreateNewFile virtual const inline override final | Checks if a new file can be created in the operating system partition. |
bool | HasEnoughSpace virtual const override final | Checks if the operating system partition has enough space. |
UOperatingSystem * | GetOperatingSystem virtual const override final | Get the operating system of the partition. |
TOptional< FString > | GetFullPath virtual const inline override final | Returns the full path of the operating system partition. |
TScriptInterface< IOperatingSystemExplorerInterface > | GetInterfaceFromPath virtual const override final | Get the interface from a given path. |
void | SetDiskLetter | Sets the disk letter like C, D, E etc. Mostly used in Non-Unix Operating System |
FString | GetPartitionPath const | Returns the partition path. |
bool | IsValidPartition const inline | |
bool | HasEnoughSpace const inline | |
float | GetStoragePercentage const inline | |
double | GetTotalSizeBytes const inline | |
double | GetFreeSizeBytes const inline | |
bool | IsSystemPartition const inline | |
FOperatingSystemUniqueId | GetPartitionID const inline | |
FName | GetDiskLetter const inline | |
FOperatingSystemPartitionSaveLoad | GetNewPartitionSaveLoad const inline | |
T * | GetChildDirectory virtual const inline | Gets a child directory with the given name. |
SetDiskName
Section titled “SetDiskName”void SetDiskName(const FString & NewDiskName)Defined in OperatingSystemPartition.h:170 Sets the display name of the disk.
This method sets the display name of the disk to the provided string. The disk name is used to identify and label the disk in the operating system.
Parameters
Section titled “Parameters”NewDiskNameThe new display name of the disk.
Referenced by
Section titled “Referenced by”References
Section titled “References”SetSystemPartition
Section titled “SetSystemPartition”void SetSystemPartition(const bool bNewSystemPartition)Defined in OperatingSystemPartition.h:179 Sets the system partition flag for the operating system partition.
Parameters
Section titled “Parameters”-
bNewSystemPartitionThe new value to set for the system partition flag. -
true if the partition is a system partition
-
false if the partition is not a system partition
Referenced by
Section titled “Referenced by”References
Section titled “References”SetOwningOperatingSystem
Section titled “SetOwningOperatingSystem”void SetOwningOperatingSystem(UOperatingSystem * OwningOS)Defined in OperatingSystemPartition.h:189 Sets the owning operating system of the UOperatingSystemPartition.
This method is used to set the owning operating system of the UOperatingSystemPartition. The owning operating system is responsible for managing the partition and its associated operations.
Parameters
Section titled “Parameters”OwningOSThe owning operating system to set.
References
Section titled “References”AddDirectories
Section titled “AddDirectories”void AddDirectories(const TArray< UOperatingSystemDirectory * > & NewDirectories, const bool bAppend = false)Defined in OperatingSystemPartition.h:208 Adds directories to the operating system partition.
This method is used to add directories to the operating system partition. It takes an array of UOperatingSystemDirectory objects as input. By default, the added directories will replace the existing directories in the partition. However, if the ‘bAppend’ parameter is set to true, the new directories will be appended to the existing directories in the partition.
Parameters
Section titled “Parameters”-
NewDirectoriesAn array of UOperatingSystemDirectory objects representing the directories to be added to the partition. -
bAppendA flag indicating whether to replace the existing directories with the new directories or append them. Default value is false.
See also: UOperatingSystemDirectory
Referenced by
Section titled “Referenced by”References
Section titled “References”AddDirectory
Section titled “AddDirectory”void AddDirectory(UOperatingSystemDirectory * NewDirectory)Defined in OperatingSystemPartition.h:220 Adds a directory to the operating system partition.
This method adds a new directory to the operating system partition.
Parameters
Section titled “Parameters”NewDirectoryA pointer to the UOperatingSystemDirectory object representing the new directory to be added.
See also: UOperatingSystemDirectory
See also: AddDirectories()
References
Section titled “References”ConsumeSpace
Section titled “ConsumeSpace”void ConsumeSpace(const double & SizeInBytes, FGenericError & OutError)Defined in OperatingSystemPartition.h:234 Consume space in the operating system partition.
This method is used to consume a specified amount of space in the operating system partition.
Parameters
Section titled “Parameters”-
SizeInBytesThe size of space to consume in bytes. -
OutError(output) A reference to a FGenericError object to store any error occurred during the operation. If there is not enough space, the error message will be set to “Not enough space.”
Referenced by
Section titled “Referenced by”References
Section titled “References”FreeSpaceInBytesHasEnoughSpaceMAKE_ERROR
FreeupSpace
Section titled “FreeupSpace”void FreeupSpace(const double & SizeInBytes)Defined in OperatingSystemPartition.h:245 The FreeupSpace method allows you to free up space in the operating system partition. This method updates the FreeSpaceInBytes variable by adding the specified size in bytes. If the updated value of FreeSpaceInBytes exceeds the TotalSizeInBytes, it is set to TotalSizeInBytes to ensure the partition does not have more free space than the total size.
Parameters
Section titled “Parameters”SizeInBytesThe size in bytes to be freed up in the operating system partition.
References
Section titled “References”GetSizeAsText
Section titled “GetSizeAsText”const
FText GetSizeAsText(const EOperatingSystemSizeMethod & SizeMethod) constDefined in OperatingSystemPartition.h:255 Converts the partition size to a human-readable text format.
Parameters
Section titled “Parameters”SizeMethodThe size method used to calculate the partition size. Valid values are EOperatingSystemSizeMethod::MB and EOperatingSystemSizeMethod::GB.
Returns
Section titled “Returns”A text representation of the partition size in the specified size method. The size is returned as a formatted string in the form “{Size} {SizeString}”, where {Size} is the partition size and {SizeString} is the unit of measurement (e.g., “MB” or “GB”).
Referenced by
Section titled “Referenced by”References
Section titled “References”GetChildDirectories
Section titled “GetChildDirectories”virtual const inline override final
virtual inline TArray< UOperatingSystemDirectory * > GetChildDirectories() const override finalDefined in OperatingSystemPartition.h:275 Retrieves the child directories of this operating system partition.
This method returns an array of UOperatingSystemDirectory pointers, representing the child directories of this operating system partition. The returned array contains all the child directories, including subdirectories, that exist within this partition.
Returns
Section titled “Returns”An array of UOperatingSystemDirectory pointers representing the child directories of this partition. If there are no child directories, an empty array is returned.
See also: UOperatingSystemDirectory
Reimplements
Section titled “Reimplements”GetParentExplorerInterface
Section titled “GetParentExplorerInterface”virtual const inline override final
virtual inline void GetParentExplorerInterface(TScriptInterface< IOperatingSystemExplorerInterface > & OutInterface) const override finalDefined in OperatingSystemPartition.h:285 This method retrieves the parent explorer interface associated with the operating system partition.
This method sets the OutInterface parameter to nullptr, indicating that there is no parent explorer interface associated with the operating system partition.
Parameters
Section titled “Parameters”OutInterface[out] A reference to a TScriptInterface<IOperatingSystemExplorerInterface> object that will receive the parent explorer interface.
Reimplements
Section titled “Reimplements”IsPartition
Section titled “IsPartition”virtual const inline override final
virtual inline bool IsPartition() const override finalDefined in OperatingSystemPartition.h:294 Check if the object is an operating system partition.
Returns
Section titled “Returns”true if the object is an operating system partition, false otherwise.
Reimplements
Section titled “Reimplements”GetInterfaceDisplayName
Section titled “GetInterfaceDisplayName”virtual const inline override final
virtual inline FText GetInterfaceDisplayName() const override finalDefined in OperatingSystemPartition.h:304 Get the display name of the interface. This method returns the display name of the interface.
Returns
Section titled “Returns”The display name of the interface as a FText object.
Reimplements
Section titled “Reimplements”FindDirectoryByTag
Section titled “FindDirectoryByTag”virtual const override final
virtual bool FindDirectoryByTag(const FGameplayTag DirectoryTag, const bool bRecursive, UOperatingSystemDirectory *& OutDirectory) const override finalDefined in OperatingSystemPartition.h:320 Searches for a directory by tag in the operating system partition.
This function is used to search for a directory with a specific tag in the given operating system partition. If the directory with the tag is found, the function sets the OutDirectory parameter to the found directory.
Parameters
Section titled “Parameters”-
DirectoryTagThe tag of the directory to search for. -
bRecursiveSpecifies whether the search should be recursive or not. If set to true, the function will also search in the child directories. -
OutDirectoryA pointer to the found directory. Set to nullptr if the directory is not found.
Returns
Section titled “Returns”True if the directory with the tag is found, false otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”Reimplements
Section titled “Reimplements”GetChildDirectory
Section titled “GetChildDirectory”virtual const override final
virtual TScriptInterface< IOperatingSystemExplorerInterface > GetChildDirectory(const FString & TargetChildDirectoryName, const bool bRecursive = true) const override finalDefined in OperatingSystemPartition.h:339 Returns a child directory with the specified name.
This method searches for a child directory with the given name in the current partition. If the recursive flag is set to true, it also searches for the directory in the child directories of the child directories (grandchild directories) of the current partition.
Parameters
Section titled “Parameters”-
TargetChildDirectoryNameThe name of the child directory to search for. -
bRecursive(optional) If set to true, the method searches for the directory recursively in the child directories. Default is true.
Returns
Section titled “Returns”A pointer to the child directory if found, or nullptr if not found.
See also: UOperatingSystemPartition, UOperatingSystemPartition::GetChildDirectories
Referenced by
Section titled “Referenced by”References
Section titled “References”Reimplements
Section titled “Reimplements”GetAllFiles
Section titled “GetAllFiles”virtual const override final
virtual TArray< UOperatingSystemFile * > GetAllFiles(const FString & WithExtension = "*") const override finalDefined in OperatingSystemPartition.h:353 Retrieves an array of all files in the partition with the specified extension.
Parameters
Section titled “Parameters”WithExtensionThe extension of the files to retrieve. Default value is ”*”, which retrieves all files.
Returns
Section titled “Returns”An array of UOperatingSystemFile pointers that represents the files in the partition with the specified extension. If the specified extension is ”*”, or an empty or invalid extension, it returns all files in the partition. If no files match the specified extension, an empty array is returned.
References
Section titled “References”Reimplements
Section titled “Reimplements”CanCreateNewFile
Section titled “CanCreateNewFile”virtual const inline override final
virtual inline bool CanCreateNewFile() const override finalDefined in OperatingSystemPartition.h:363 Checks if a new file can be created in the operating system partition.
This method determines whether it is possible to create a new file in the current operating system partition. It returns true if a new file can be created and false otherwise.
Returns
Section titled “Returns”True if a new file can be created, false otherwise.
Reimplements
Section titled “Reimplements”HasEnoughSpace
Section titled “HasEnoughSpace”virtual const override final
virtual bool HasEnoughSpace(const FOperatingSystemSizeInMB & TestSpace) const override finalDefined in OperatingSystemPartition.h:373 Checks if the operating system partition has enough space.
Parameters
Section titled “Parameters”TestSpaceThe size in megabytes of the space to test.
Returns
Section titled “Returns”true if the partition has enough space, false otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”Reimplements
Section titled “Reimplements”GetOperatingSystem
Section titled “GetOperatingSystem”virtual const override final
virtual UOperatingSystem * GetOperatingSystem() const override finalDefined in OperatingSystemPartition.h:385 Get the operating system of the partition.
This method returns the operating system object associated with the partition. The returned operating system object represents the operating system installed on the partition.
Returns
Section titled “Returns”A pointer to the operating system object.
References
Section titled “References”Reimplements
Section titled “Reimplements”GetFullPath
Section titled “GetFullPath”virtual const inline override final
virtual inline TOptional< FString > GetFullPath() const override finalDefined in OperatingSystemPartition.h:397 Returns the full path of the operating system partition.
This method returns the full path of the operating system partition.
Returns
Section titled “Returns”An optional string representing the full path of the partition. If the partition path is not available, the optional value will be empty.
Reimplements
Section titled “Reimplements”GetInterfaceFromPath
Section titled “GetInterfaceFromPath”virtual const override final
virtual TScriptInterface< IOperatingSystemExplorerInterface > GetInterfaceFromPath(const FString & NewPath) const override finalDefined in OperatingSystemPartition.h:415 Get the interface from a given path.
This method searches for the interface corresponding to the provided path.
If the provided path matches the partition path of the current object, this method returns a writable interface of this object. If the provided path is ”..”, this method returns nullptr. If the provided path starts with a disk letter followed by a delimiter, this method searches for the corresponding partition and continues the search for the remaining path. If the provided path does not start with a disk letter, the search starts from the current object and continues for each directory specified in the path. If, at any stage, a directory in the path is not found, this method returns nullptr.
Parameters
Section titled “Parameters”NewPathThe path for which the interface is requested.
Returns
Section titled “Returns”The interface corresponding to the provided path, or nullptr if not found.
References
Section titled “References”Reimplements
Section titled “Reimplements”SetDiskLetter
Section titled “SetDiskLetter”void SetDiskLetter(const FName & NewDiskLetter)Defined in OperatingSystemPartition.h:419 Sets the disk letter like C, D, E etc. Mostly used in Non-Unix Operating System
References
Section titled “References”GetPartitionPath
Section titled “GetPartitionPath”const
FString GetPartitionPath() constDefined in OperatingSystemPartition.h:441 Returns the partition path.
This method returns a formatted string that includes the disk letter and the path delimiter.
Returns
Section titled “Returns”A formatted string representing the partition path in the format “{disk letter}:{path delimiter}”.
Referenced by
Section titled “Referenced by”References
Section titled “References”IsValidPartition
Section titled “IsValidPartition”const inline
inline bool IsValidPartition() constDefined in OperatingSystemPartition.h:443
Referenced by
Section titled “Referenced by”HasEnoughSpace
Section titled “HasEnoughSpace”const inline
inline bool HasEnoughSpace(const double & TestSpaceInBytes) constDefined in OperatingSystemPartition.h:444
Section titled “Defined in OperatingSystemPartition.h:444”GetStoragePercentage
Section titled “GetStoragePercentage”const inline
inline float GetStoragePercentage() constDefined in OperatingSystemPartition.h:445
Referenced by
Section titled “Referenced by”GetTotalSizeBytes
Section titled “GetTotalSizeBytes”const inline
inline double GetTotalSizeBytes() constDefined in OperatingSystemPartition.h:446
Referenced by
Section titled “Referenced by”GetFreeSizeBytes
Section titled “GetFreeSizeBytes”const inline
inline double GetFreeSizeBytes() constDefined in OperatingSystemPartition.h:447
Section titled “Defined in OperatingSystemPartition.h:447”IsSystemPartition
Section titled “IsSystemPartition”const inline
inline bool IsSystemPartition() constDefined in OperatingSystemPartition.h:448
Section titled “Defined in OperatingSystemPartition.h:448”GetPartitionID
Section titled “GetPartitionID”const inline
inline FOperatingSystemUniqueId GetPartitionID() constDefined in OperatingSystemPartition.h:449
Section titled “Defined in OperatingSystemPartition.h:449”GetDiskLetter
Section titled “GetDiskLetter”const inline
inline FName GetDiskLetter() constDefined in OperatingSystemPartition.h:450
Section titled “Defined in OperatingSystemPartition.h:450”GetNewPartitionSaveLoad
Section titled “GetNewPartitionSaveLoad”const inline
inline FOperatingSystemPartitionSaveLoad GetNewPartitionSaveLoad() constDefined in OperatingSystemPartition.h:451
References
Section titled “References”bSaveLoad_IsSystemPartitionSaveLoad_DiskLetterSaveLoad_DiskNameSaveLoad_FreeSpaceInBytesSaveLoad_PartitionIDSaveLoad_TotalSizeInBytes
GetChildDirectory
Section titled “GetChildDirectory”virtual const inline
template<class T> virtual inline T * GetChildDirectory(const FString & TargetChildDirectoryName, const bool bRecursive = true) constDefined in OperatingSystemPartition.h:484 Gets a child directory with the given name.
This method searches for a child directory with the specified name within the current directory. The search can be recursive, meaning it will also search within subdirectories.
Parameters
Section titled “Parameters”-
TargetChildDirectoryNameThe name of the child directory to search for. -
bRecursive(optional) Whether to perform a recursive search. Defaults to true, meaning it will search within subdirectories.
Returns
Section titled “Returns”A pointer to the child directory if it is found, nullptr otherwise.
See also: UOperatingSystemDirectory
Reimplements
Section titled “Reimplements”Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemPartition * | CreateNewPartition static | Creates a new operating system partition. |
UOperatingSystemPartition * | LoadNewPartition static | Loads a new operating system partition. |
CreateNewPartition
Section titled “CreateNewPartition”static
static UOperatingSystemPartition * CreateNewPartition(UOperatingSystemHDD * OwningHDD, const double & SizeInBytes, FGenericError & OutError)Defined in OperatingSystemPartition.h:140 Creates a new operating system partition.
This method creates a new operating system partition with the specified size.
Parameters
Section titled “Parameters”-
OwningHDDThe UOperatingSystemHDD that will own the new partition. -
SizeInBytesThe size of the new partition in bytes. -
OutErrorThe reference to a FGenericError object which will hold any potential error messages if the creation fails.
Returns
Section titled “Returns”A pointer to the created UOperatingSystemPartition object, or nullptr if the creation fails.
See also: UOperatingSystemHDD
See also: FGenericError
Referenced by
Section titled “Referenced by”References
Section titled “References”GenerateNewIdMAKE_ERRORNEW_OBJ
LoadNewPartition
Section titled “LoadNewPartition”static
static UOperatingSystemPartition * LoadNewPartition(UOperatingSystemHDD * OwningHDD, const FOperatingSystemPartitionSaveLoad & PartitionSaveLoad)Defined in OperatingSystemPartition.h:160 Loads a new operating system partition.
This method is used to load a new operating system partition from a save/load data structure. If a partition with the same ID already exists, it updates the existing partition instead of creating a new one, and updates its properties based on the given save/load data.
Parameters
Section titled “Parameters”-
OwningHDDThe UOperatingSystemHDD object that owns the partition. -
PartitionSaveLoadThe save/load data structure that contains the partition information.
Returns
Section titled “Returns”The loaded or updated UOperatingSystemPartition object.
See also: UOperatingSystemHDD, FOperatingSystemPartitionSaveLoad
Referenced by
Section titled “Referenced by”References
Section titled “References”bSaveLoad_IsSystemPartitionFindPartitionByIDNEW_OBJSaveLoad_DiskNameSaveLoad_FreeSpaceInBytesSaveLoad_PartitionIDSaveLoad_TotalSizeInBytes
Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
FText | DiskName | Specifies the name of the disk associated with an operating system partition. |
FText | DiskDisplayName | Represents the display name of the disk. The display name is a user-friendly string that can be shown to the user. It is typically used to identify the disk in UI elements such as dropdown menus or dialogs. |
double | TotalSizeInBytes | Total size of this partition |
double | FreeSpaceInBytes | Free space in this partition |
bool | bIsSystemPartition | Determines if this is a system partition. |
FOperatingSystemUniqueId | PartitionID | Unique ID of this partition. |
FName | DiskLetter | Represents the disk letter of a storage device. The disk letter is used to identify a specific storage device, typically a drive on the operating system. |
TArray< TObjectPtr< UOperatingSystemFile > > | Files | Array of files created under this partition. |
TWeakObjectPtr< UOperatingSystemHDD > | ParentHDD | The ParentHDD variable represents a weak reference to the parent UOperatingSystemHDD object that this UOperatingSystemPartition object belongs to. |
TWeakObjectPtr< UOperatingSystem > | ParentOS | Weak reference to the parent UOperatingSystem object that this UOperatingSystemPartition object belongs to. |
DiskName
Section titled “DiskName”FText DiskNameDefined in OperatingSystemPartition.h:53 Specifies the name of the disk associated with an operating system partition.
Referenced by
Section titled “Referenced by”DiskDisplayName
Section titled “DiskDisplayName”FText DiskDisplayNameDefined in OperatingSystemPartition.h:61 Represents the display name of the disk. The display name is a user-friendly string that can be shown to the user. It is typically used to identify the disk in UI elements such as dropdown menus or dialogs.
Referenced by
Section titled “Referenced by”TotalSizeInBytes
Section titled “TotalSizeInBytes”double TotalSizeInBytesDefined in OperatingSystemPartition.h:65 Total size of this partition
Referenced by
Section titled “Referenced by”FreeSpaceInBytes
Section titled “FreeSpaceInBytes”double FreeSpaceInBytesDefined in OperatingSystemPartition.h:69 Free space in this partition
Referenced by
Section titled “Referenced by”bIsSystemPartition
Section titled “bIsSystemPartition”bool bIsSystemPartitionDefined in OperatingSystemPartition.h:73 Determines if this is a system partition.
Referenced by
Section titled “Referenced by”PartitionID
Section titled “PartitionID”FOperatingSystemUniqueId PartitionIDDefined in OperatingSystemPartition.h:77 Unique ID of this partition.
DiskLetter
Section titled “DiskLetter”FName DiskLetterDefined in OperatingSystemPartition.h:86 Represents the disk letter of a storage device. The disk letter is used to identify a specific storage device, typically a drive on the operating system.
Referenced by
Section titled “Referenced by”TArray< TObjectPtr< UOperatingSystemFile > > FilesDefined in OperatingSystemPartition.h:94 Array of files created under this partition.
See also: UOperatingSystemFile
Referenced by
Section titled “Referenced by”ParentHDD
Section titled “ParentHDD”TWeakObjectPtr< UOperatingSystemHDD > ParentHDDDefined in OperatingSystemPartition.h:106 The ParentHDD variable represents a weak reference to the parent UOperatingSystemHDD object that this UOperatingSystemPartition object belongs to.
Usage:
-
This variable is used to establish a parent-child relationship between UOperatingSystemHDD and UOperatingSystemPartition objects.
-
It allows UOperatingSystemPartition to access properties and methods of its parent UOperatingSystemHDD object.
-
Weak references are used here to avoid creating strong references that could lead to memory leaks or circular dependencies.
See also: UOperatingSystemHDD
ParentOS
Section titled “ParentOS”TWeakObjectPtr< UOperatingSystem > ParentOSDefined in OperatingSystemPartition.h:118 Weak reference to the parent UOperatingSystem object that this UOperatingSystemPartition object belongs to.
The ParentOS variable is a weak reference to the parent UOperatingSystem object that this UOperatingSystemPartition object belongs to. It represents the parent-child relationship between UOperatingSystemPartition and UOperatingSystem objects. It allows UOperatingSystemPartition to access properties and methods of its parent UOperatingSystem object. Weak references are used here to avoid creating strong references that could lead to memory leaks or circular dependencies.
See also: UOperatingSystem
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
void | SetDiskDisplayName | Sets the display name of the disk. |
SetDiskDisplayName
Section titled “SetDiskDisplayName”void SetDiskDisplayName(const FText & NewName)Defined in OperatingSystemPartition.h:430 Sets the display name of the disk.
This method allows you to set the display name of the disk.
Parameters
Section titled “Parameters”NewNameThe new display name to set.
References
Section titled “References”Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
TArray< TObjectPtr< UOperatingSystemDirectory > > | Directories |
Directories
Section titled “Directories”TArray< TObjectPtr< UOperatingSystemDirectory > > DirectoriesDefined in OperatingSystemPartition.h:45