xtd 0.2.0
drive_info.h
Go to the documentation of this file.
1 #pragma once
5 #include "../core_export.h"
6 #include "../object.h"
7 #include "directory_info.h"
8 #include "drive_type.h"
9 
11 namespace xtd {
13  namespace io {
31  class core_export_ drive_info : public xtd::object {
32  public:
34 
37  static const drive_info empty;
39 
41 
47  explicit drive_info(const xtd::ustring& drive_name);
49 
51 
62  size_t available_free_space() const;
63 
73  xtd::ustring drive_format() const;
74 
82 
90  bool is_ready() const noexcept;
91 
98  xtd::ustring name() const noexcept;
99 
102  xtd::io::directory_info root_directory() const noexcept;
103 
113  size_t total_free_space() const;
114 
124  size_t total_size() const;
125 
135  xtd::ustring volume_label() const;
137 
139 
149  static std::vector<xtd::io::drive_info> get_drives() noexcept;
150 
154  xtd::ustring to_string() const noexcept override;
156 
157  private:
158  drive_info() = default;
159 
160  xtd::ustring drive_name_;
161  };
162  }
163 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
Exposes instance methods for creating, moving, and enumerating through directories and subdirectories...
Definition: directory_info.h:125
Contains xtd::io::drive_type enum class.
static const drive_info empty
Represents the uninitialized xtd::io::drive_info object. This field is constant.
Definition: drive_info.h:37
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
Provides access to information on a drive.
Definition: drive_info.h:31
Contains xtd::io::directory_info class.
drive_type
Defines constants for drive types, including CDRom, Fixed, Network, NoRootDirectory, Ram, Removable, and Unknown.
Definition: drive_type.h:24