xtd 0.2.0
Loading...
Searching...
No Matches
operating_system.h
Go to the documentation of this file.
1
4#pragma once
5#include "optional.h"
6#include "distribution.h"
7#include "object.h"
8#include "platform_id.h"
9#include "ustring.h"
10#include "version.h"
11#include <map>
12#include <vector>
13
15namespace xtd {
25 class operating_system final : public object {
26 public:
28
82
84 operating_system() = default;
85 operating_system(const operating_system&) = default;
86 operating_system& operator =(const operating_system&) = default;
88
90
98
104 xtd::ustring desktop_theme() const noexcept;
105
108 xtd::distribution distribution() const noexcept;
109
112 xtd::ustring name() const noexcept;
113
116 xtd::platform_id platform() const noexcept;
117
122 xtd::ustring service_pack() const noexcept;
123
127 const xtd::version& version() const noexcept;
128
132 xtd::ustring version_string() const noexcept;
134
136
140 bool is_64_bit() const noexcept;
141
144 bool is_android() const noexcept;
145
148 bool is_free_bsd() const noexcept;
149
152 bool is_ios() const noexcept;
153
156 bool is_linux() const noexcept;
157
160 bool is_macos() const noexcept;
161
164 bool is_macos_platform() const noexcept;
165
168 bool is_mingw() const noexcept;
169
172 bool is_msys() const noexcept;
173
176 bool is_posix() const noexcept;
177
180 bool is_posix_platform() const noexcept;
181
184 bool is_unix_platform() const noexcept;
185
188 bool is_tvos() const noexcept;
189
192 bool is_watchos() const noexcept;
193
196 bool is_windows() const noexcept;
197
200 bool is_windows_ce() const noexcept;
201
204 bool is_windows_platform() const noexcept;
205
208 bool is_xbox() const noexcept;
209
212 xtd::ustring to_string() const noexcept override;
214
215 private:
216 xtd::platform_id platform_ = xtd::platform_id::unknown;
217 xtd::version version_;
218 xtd::ustring service_pack_;
219 xtd::ustring desktop_environment_;
220 xtd::ustring desktop_theme_;
221 bool is_64_bit_ = false;
222 xtd::distribution distribution_;
223 mutable xtd::ustring version_string_;
224 };
225}
Represents information about an operating system distribution, such as the version and name....
Definition distribution.h:27
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents information about an operating system, such as the version and platform identifier....
Definition operating_system.h:25
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::ustring &service_pack)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
bool is_windows_ce() const noexcept
Determines whether the current platform is Windows CE.
bool is_macos() const noexcept
Determines whether the current platform is macOS.
bool is_msys() const noexcept
Determines whether the current platform is MSYS.
xtd::ustring desktop_theme() const noexcept
Gets the desktop theme.
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::ustring &service_pack, const xtd::ustring &desktop_environment, const xtd::ustring &desktop_theme)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
bool is_posix_platform() const noexcept
Determines whether the current platform is Posix family.
bool is_mingw() const noexcept
Determines whether the current platform is MINGW.
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::ustring &service_pack, const xtd::ustring &desktop_environment, const xtd::ustring &desktop_theme, bool is_64_bit, const xtd::distribution &distribution)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
bool is_linux() const noexcept
Determines whether the current platform is Linux.
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::ustring &service_pack, const xtd::ustring &desktop_environment, const xtd::ustring &desktop_theme, bool is_64_bit)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
bool is_xbox() const noexcept
Determines whether the current platform is xbox.
operating_system(xtd::platform_id platform, const xtd::version &version)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::ustring &service_pack, const xtd::ustring &desktop_environment)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
xtd::ustring version_string() const noexcept
Gets the concatenated string representation of the platform identifier, version, and service pack tha...
bool is_macos_platform() const noexcept
Determines whether the current platform is macOS family.
bool is_tvos() const noexcept
Determines whether the current platform is tvOS family.
bool is_posix() const noexcept
Determines whether the current platform is Posix.
bool is_ios() const noexcept
Determines whether the current platform is iOS.
bool is_unix_platform() const noexcept
Determines whether the current platform is Unix family.
bool is_windows_platform() const noexcept
Determines whether the current platform is Windows family.
bool is_windows() const noexcept
Determines whether the current platform is Windows.
bool is_android() const noexcept
Determines whether the current platform is Android.
bool is_free_bsd() const noexcept
Determines whether the current platform is FreeBSD.
xtd::ustring to_string() const noexcept override
Converts the value of this operating_system object to its equivalent string representation.
bool is_64_bit() const noexcept
Determines whether the current operating system is a 64-bit operating system.
xtd::platform_id platform() const noexcept
Gets a xtd::platform_id enumeration value that identifies the operating system platform.
bool is_watchos() const noexcept
Determines whether the current platform is watchOS.
xtd::ustring name() const noexcept
Gets the concatenated string representation of the platform identifier.
xtd::ustring desktop_environment() const noexcept
Gets the desktop environment.
xtd::ustring service_pack() const noexcept
Gets the service pack version represented by this operating_system object.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.h:110
Contains xtd::distribution class.
platform_id
Identifies the operating system, or platform, supported by an assembly.
Definition platform_id.h:18
@ unknown
The processor architecture is unknown.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::object class.
Contains std::optional type and std::bad_optional_access exception.
Contains xtd::platform_id enum class.
Contains xtd::ustring class.
Contains xtd::version class.