#include "OperatingSystemHDD.h"
UOperatingSystemHDD is a class representing a hard disk drive in an operating system.
This class inherits from UOperatingSystemBaseHardware and provides functionality to manage the hard disk drive.
◆ UOperatingSystemHDD()
UOperatingSystemHDD::UOperatingSystemHDD |
( |
| ) |
|
◆ AllocatePartition()
Allocates a partition on the hard disk drive.
This method is used to allocate a new partition on the hard disk drive. The partition to be allocated is specified by the NewPartition
parameter. The allocation process updates the OutError
parameter with any error that occurred during the allocation.
- Parameters
-
NewPartition | The partition to be allocated. |
OutError | The error that occurred during the allocation process, if any. |
◆ AllocatePartitionFromLoadGame()
◆ ConsumeSpaceInGB()
ConsumeSpaceInGB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in gigabytes.
- Parameters
-
NewSizeInGB | [in] The size of the space to consume in gigabytes. |
Partition | [in] The UOperatingSystemPartition object representing the partition in which to consume space. |
OutError | [out] The FGenericError object used to store any error messages. |
◆ ConsumeSpaceInMB()
ConsumeSpaceInMB is a method in the UOperatingSystemHDD class that consumes space in the specified partition in megabytes.
- Parameters
-
NewSizeInMB | [in] The size of the space to consume in megabytes. |
Partition | [in] The UOperatingSystemPartition object representing the partition in which to consume space. |
OutError | [out] The FGenericError object used to store any error messages. |
◆ CreateHDD()
CreateHDD is a method in the UOperatingSystemHDD class that creates a new hard disk drive object.
- Parameters
-
- Returns
- A pointer to the newly created UOperatingSystemHDD object, or nullptr if an error occurred.
◆ FindPartitionByID()
Finds a partition in the hard disk drive with the given unique ID.
This method searches for a partition in the hard disk drive with the specified unique ID. If a partition with the ID is found, it is returned. If no partition with the ID is found, nullptr is returned.
Note that the partition must be a part of the operating system's hard disk drive for it to be found by this method.
- Parameters
-
TestID | The unique ID to search for. |
- Returns
- A pointer to the partition with the unique ID, or nullptr if not found.
◆ GetHardDiskSize()
GetHardDiskSize is a method in the UOperatingSystemHDD class that returns the size of the hard disk drive.
- Parameters
-
SizeMethod | - The method to use for determining the size of the hard disk drive. It can be one of the following values:
|
- Returns
- The size of the hard disk drive based on the specified SizeMethod. The returned size is a double value.
◆ GetPartitions()
GetPartitions is a method that returns the array of partitions associated with the hard disk drive.
- Returns
- A constant reference to an array of TObjectPtr<UOperatingSystemPartition> representing the disk partitions. The caller should not modify this array.
◆ GetSizeAsText()
GetSizeAsText is a method in the UOperatingSystemHDD class that returns the size of the specified partition as text.
- Parameters
-
SizeMethod | [in] The method used to represent the size (bytes, megabytes or gigabytes). |
Partition | [in] The UOperatingSystemPartition object representing the partition for which to get the size. |
OutError | [out] The FGenericError object used to store any error messages. |
- Returns
- The size of the partition as text.
◆ GetStoragePercentage()
GetStoragePercentage is a method in the UOperatingSystemHDD class that retrieves the storage percentage of a partition.
- Parameters
-
Partition | [in] The UOperatingSystemPartition object representing the partition for which to retrieve the storage percentage. |
OutError | [out] The FGenericError object used to store any error messages. |
- Returns
- The storage percentage of the partition.
◆ HasPartitionWithID()
Checks if a hard disk drive has a partition with the given ID.
- Parameters
-
TestID | The ID of the partition to check for. |
- Returns
- True if a partition with the given ID exists, false otherwise.
◆ OnValidate()
bool UOperatingSystemHDD::OnValidate |
( |
FGenericError & | OutError | ) |
const |
|
overrideprotectedvirtual |
OnValidate is a method in the UOperatingSystemHDD class that performs validation on the hard disk drive.
- Parameters
-
OutError | A reference to an FGenericError object used to store an error message if the validation fails. |
- Returns
- Returns a boolean value indicating whether the validation was successful (true) or not (false).
Reimplemented from UOperatingSystemBaseHardware.
◆ RefreshPartitions()
void UOperatingSystemHDD::RefreshPartitions |
( |
| ) |
|
◆ RemovePartition()
Removes a partition from the hard disk drive.
This method removes the specified partition from the hard disk drive. If the partition is not valid (null or not valid), an error message will be set in the provided OutError object
- Parameters
-
Partition | The partition to be removed. |
OutError | The error object used to store error information if necessary. |
- Note
- This method updates the allocated disk space of the hard disk drive by adding the size of the removed partition to the total allocated space.
-
If the specified partition is found and successfully removed, it will no longer be present in the DiskPartitions collection.
◆ DiskPartitions
Key is the drive letter. Like C, D, E etc. In Unix this can be /dev/sda, /dev/sda1 etc.
◆ PostDiskAllocatedSpaceInBytes
double UOperatingSystemHDD::PostDiskAllocatedSpaceInBytes |
|
protected |
Space remaining to allocate new partitions.
◆ SizeInGB
float UOperatingSystemHDD::SizeInGB |
|
protected |
The documentation for this class was generated from the following files: