Provides access to information on a drive.
Public Fields | |
| static const drive_info | empty |
| Represents the uninitialized xtd::io::drive_info object. This field is constant. | |
Public Constructors | |
| drive_info (const xtd::string &drive_name) | |
| Provides access to information on the specified drive. | |
Public Properties | |
| auto | available_free_space () const -> xtd::usize |
| Indicates the amount of available free space on a drive, in bytes. | |
| auto | drive_format () const -> xtd::string |
| Gets the name of the file system, such as NTFS or FAT32. | |
| auto | drive_type () const -> xtd::io::drive_type |
| Gets the drive type, such as CD-ROM, removable, network, or fixed. | |
| auto | is_ready () const noexcept -> bool |
| Gets a value that indicates whether a drive is ready. | |
| auto | name () const noexcept -> xtd::string |
| Gets the name of a drive, such as C:. | |
| auto | root_directory () const noexcept -> xtd::io::directory_info |
| Gets the root directory of a drive. | |
| auto | total_free_space () const -> xtd::usize |
| Gets the total amount of free space available on a drive, in bytes. | |
| auto | total_size () const -> xtd::usize |
| Gets the total size of storage space on a drive, in bytes. | |
| auto | volume_label () const -> xtd::string |
| Gets the volume label of a drive. | |
Public Methods | |
| auto | to_string () const noexcept -> xtd::string override |
| Returns a drive name as a string. | |
Public Static Methods | |
| static auto | get_drives () noexcept -> xtd::array< xtd::io::drive_info > |
| Retrieves the drive names of all logical drives on a computer. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | equals (const object &obj) const noexcept -> bool |
| Determines whether the specified object is equal to the current object. | |
| virtual auto | get_hash_code () const noexcept -> xtd::usize |
| Serves as a hash function for a particular type. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
|
explicit |
Provides access to information on the specified drive.
| drive_name | A valid drive path or drive letter. This can be either uppercase or lowercase, 'a' to 'z'. A null value is not valid. |
| xtd::argument_exception | drive_name does not refer to a valid drive. |
|
nodiscard |
Indicates the amount of available free space on a drive, in bytes.
| xtd::unauthorized_access_exception | Access to the drive information is denied. |
| xtd::io::drive_not_found | The drive does not exist or is not mapped. |
| xtd::io::io_exception | An I/O error occurred (for example, a disk error or a drive was not ready). |
|
nodiscard |
Gets the name of the file system, such as NTFS or FAT32.
| xtd::unauthorized_access_exception | Access to the drive information is denied. |
| xtd::io::drive_not_found | The drive does not exist or is not mapped. |
| xtd::io::io_exception | An I/O error occurred (for example, a disk error or a drive was not ready). |
|
nodiscard |
Gets the drive type, such as CD-ROM, removable, network, or fixed.
|
nodiscardnoexcept |
Gets a value that indicates whether a drive is ready.
|
nodiscardnoexcept |
Gets the name of a drive, such as C:.
|
nodiscardnoexcept |
Gets the root directory of a drive.
|
nodiscard |
Gets the total amount of free space available on a drive, in bytes.
| xtd::unauthorized_access_exception | Access to the drive information is denied. |
| xtd::io::drive_not_found | The drive does not exist or is not mapped. |
| xtd::io::io_exception | An I/O error occurred (for example, a disk error or a drive was not ready). |
|
nodiscard |
Gets the total size of storage space on a drive, in bytes.
| xtd::unauthorized_access_exception | Access to the drive information is denied. |
| xtd::io::drive_not_found | The drive does not exist or is not mapped. |
| xtd::io::io_exception | An I/O error occurred (for example, a disk error or a drive was not ready). |
|
nodiscard |
Gets the volume label of a drive.
| xtd::unauthorized_access_exception | Access to the drive information is denied. |
| xtd::io::drive_not_found | The drive does not exist or is not mapped. |
| xtd::io::io_exception | An I/O error occurred (for example, a disk error or a drive was not ready). |
|
nodiscardoverridevirtualnoexcept |
Returns a drive name as a string.
Reimplemented from xtd::object.
|
staticnodiscardnoexcept |
Retrieves the drive names of all logical drives on a computer.
| xtd::unauthorized_access_exception | Access to the drive information is denied. |
| xtd::io::io_exception | An I/O error occurred (for example, a disk error or a drive was not ready). |
|
static |
Represents the uninitialized xtd::io::drive_info object. This field is constant.