xtd 0.2.0
drive_info.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../array.hpp"
6#include "../core_export.hpp"
7#include "../object.hpp"
8#include "directory_info.hpp"
9#include "drive_type.hpp"
10
12namespace xtd {
14 namespace io {
35 public:
37
40 static const drive_info empty;
42
44
50 explicit drive_info(const xtd::string& drive_name);
52
54 drive_info() = default;
56
58
69 size_t available_free_space() const;
70
81
89
97 bool is_ready() const noexcept;
98
105 xtd::string name() const noexcept;
106
110
120 size_t total_free_space() const;
121
131 size_t total_size() const;
132
142 xtd::string volume_label() const;
144
146
151 xtd::string to_string() const noexcept override;
153
155
165 static xtd::array<xtd::io::drive_info> get_drives() noexcept;
167
168 private:
169 xtd::string drive_name_;
170 };
171 }
172}
Contains xtd::array class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Exposes instance methods for creating, moving, and enumerating through directories and subdirectories...
Definition directory_info.hpp:130
xtd::io::drive_type drive_type() const
Gets the drive type, such as CD-ROM, removable, network, or fixed.
xtd::string drive_format() const
Gets the name of the file system, such as NTFS or FAT32.
xtd::string name() const noexcept
Gets the name of a drive, such as C:.
xtd::string volume_label() const
Gets the volume label of a drive.
drive_info(const xtd::string &drive_name)
Provides access to information on the specified drive.
size_t available_free_space() const
Indicates the amount of available free space on a drive, in bytes.
bool is_ready() const noexcept
Gets a value that indicates whether a drive is ready.
xtd::io::directory_info root_directory() const noexcept
Gets the root directory of a drive.
size_t total_free_space() const
Gets the total amount of free space available on a drive, in bytes.
static const drive_info empty
Represents the uninitialized xtd::io::drive_info object. This field is constant.
Definition drive_info.hpp:40
size_t total_size() const
Gets the total size of storage space on a drive, in bytes.
xtd::string to_string() const noexcept override
Returns a drive name as a string.
static xtd::array< xtd::io::drive_info > get_drives() noexcept
Retrieves the drive names of all logical drives on a computer.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Contains core_export_ keyword.
Contains xtd::io::directory_info class.
Contains xtd::io::drive_type enum class.
drive_type
Defines constants for drive types, including CDRom, Fixed, Network, NoRootDirectory,...
Definition drive_type.hpp:26
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.