xtd 1.0.0
Loading...
Searching...
No Matches
operating_system.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "optional.hpp"
6#include "distribution.hpp"
7#include "object.hpp"
8#include "platform_id.hpp"
9#include "string.hpp"
10#include "version.hpp"
11#include <map>
12#include <vector>
13
15namespace xtd {
25 class operating_system final : public object {
26 public:
28
76
78 operating_system() = default;
80
82
89 [[nodiscard]] auto desktop_environment() const noexcept -> xtd::string;
90
96 [[nodiscard]] auto desktop_theme() const noexcept -> xtd::string;
97
100 [[nodiscard]] auto distribution() const noexcept -> xtd::distribution;
101
104 [[nodiscard]] auto name() const noexcept -> xtd::string;
105
108 [[nodiscard]] auto platform() const noexcept -> xtd::platform_id;
109
114 [[nodiscard]] auto service_pack() const noexcept -> xtd::string;
115
119 [[nodiscard]] auto version() const noexcept -> const xtd::version&;
120
124 [[nodiscard]] auto version_string() const noexcept -> xtd::string;
126
128
132 [[nodiscard]] auto is_64_bit() const noexcept -> bool;
133
136 [[nodiscard]] auto is_aix() const noexcept -> bool;
137
140 [[nodiscard]] auto is_android() const noexcept -> bool;
141
145 [[nodiscard]] auto is_apple_platform() const noexcept -> bool;
146
149 [[nodiscard]] auto is_bsd_platform() const noexcept -> bool;
150
153 [[nodiscard]] auto is_darwin() const noexcept -> bool;
154
157 [[nodiscard]] auto is_free_bsd() const noexcept -> bool;
158
161 [[nodiscard]] auto is_haiku() const noexcept -> bool;
162
165 [[nodiscard]] auto is_serenityos() const noexcept -> bool;
166
169 [[nodiscard]] auto is_ios() const noexcept -> bool;
170
173 [[nodiscard]] auto is_linux() const noexcept -> bool;
174
177 [[nodiscard]] auto is_macos() const noexcept -> bool;
178
182 [[nodiscard]] auto is_macos_platform() const noexcept -> bool;
183
186 [[nodiscard]] auto is_mingw() const noexcept -> bool;
187
190 [[nodiscard]] auto is_msys() const noexcept -> bool;
191
194 [[nodiscard]] auto is_posix() const noexcept -> bool;
195
202 [[nodiscard]] auto is_posix_platform() const noexcept -> bool;
203
210 [[nodiscard]] auto is_unix_platform() const noexcept -> bool;
211
214 [[nodiscard]] auto is_tvos() const noexcept -> bool;
215
218 [[nodiscard]] auto is_watchos() const noexcept -> bool;
219
222 [[nodiscard]] auto is_windows() const noexcept -> bool;
223
226 [[nodiscard]] auto is_windows_ce() const noexcept -> bool;
227
230 [[nodiscard]] auto is_windows_platform() const noexcept -> bool;
231
234 [[nodiscard]] auto is_xbox() const noexcept -> bool;
235
238 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
239
242 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
244
245 private:
246 xtd::platform_id platform_ = xtd::platform_id::unknown;
247 xtd::version version_;
248 xtd::string service_pack_;
249 xtd::string desktop_environment_;
250 xtd::string desktop_theme_;
251 bool is_64_bit_ = false;
252 xtd::distribution distribution_;
253 mutable xtd::string version_string_;
254 };
255}
Represents information about an operating system distribution, such as the version and name....
Definition distribution.hpp:28
object()=default
Create a new instance of the ultimate base class object.
auto is_free_bsd() const noexcept -> bool
Determines whether the current platform is FreeBSD.
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
auto desktop_environment() const noexcept -> xtd::string
Gets the desktop environment.
auto service_pack() const noexcept -> xtd::string
Gets the service pack version represented by this operating_system object.
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::string &service_pack, const xtd::string &desktop_environment, const xtd::string &desktop_theme)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
auto is_mingw() const noexcept -> bool
Determines whether the current platform is MINGW.
auto platform() const noexcept -> xtd::platform_id
Gets a xtd::platform_id enumeration value that identifies the operating system platform.
auto is_serenityos() const noexcept -> bool
Determines whether the current platform is SerenityOS.
auto is_android() const noexcept -> bool
Determines whether the current platform is Android.
auto desktop_theme() const noexcept -> xtd::string
Gets the desktop theme.
auto is_xbox() const noexcept -> bool
Determines whether the current platform is xbox.
auto is_posix() const noexcept -> bool
Determines whether the current platform is Posix.
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::string &service_pack)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
auto is_unix_platform() const noexcept -> bool
Determines whether the current platform is Unix family.
auto is_windows_ce() const noexcept -> bool
Determines whether the current platform is Windows CE.
auto is_macos() const noexcept -> bool
Determines whether the current platform is macOS.
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...
auto is_windows() const noexcept -> bool
Determines whether the current platform is Windows.
auto is_haiku() const noexcept -> bool
Determines whether the current platform is Haiku.
auto is_darwin() const noexcept -> bool
Determines whether the current platform is Darwin (macOS, iOS, tvOS, or watchOS).
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::string &service_pack, const xtd::string &desktop_environment, const xtd::string &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...
auto is_watchos() const noexcept -> bool
Determines whether the current platform is watchOS.
auto is_apple_platform() const noexcept -> bool
Determines whether the current platform belongs to the Apple ecosystem (macOS, iOS,...
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::string &service_pack, const xtd::string &desktop_environment, const xtd::string &desktop_theme, bool is_64_bit)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
auto is_posix_platform() const noexcept -> bool
Determines whether the current platform is Posix family.
operating_system(xtd::platform_id platform, const xtd::version &version, const xtd::string &service_pack, const xtd::string &desktop_environment)
Initializes a new instance of the operating_system class, using the specified platform identifier val...
auto is_tvos() const noexcept -> bool
Determines whether the current platform is tvOS family.
auto to_string() const noexcept -> xtd::string override
Converts the value of this operating_system object to its equivalent string representation.
auto is_ios() const noexcept -> bool
Determines whether the current platform is iOS.
auto is_macos_platform() const noexcept -> bool
Determines whether the current platform is part of the macOS family (including macOS,...
auto is_linux() const noexcept -> bool
Determines whether the current platform is Linux.
auto is_64_bit() const noexcept -> bool
Determines whether the current operating system is a 64-bit operating system.
auto is_windows_platform() const noexcept -> bool
Determines whether the current platform is Windows family.
auto is_aix() const noexcept -> bool
Determines whether the current platform is AIX.
auto name() const noexcept -> xtd::string
Gets the concatenated string representation of the platform identifier.
auto distribution() const noexcept -> xtd::distribution
Gets the distribution.
auto version_string() const noexcept -> xtd::string
Gets the concatenated string representation of the platform identifier, version, and service pack tha...
auto is_msys() const noexcept -> bool
Determines whether the current platform is MSYS.
auto version() const noexcept -> const xtd::version &
Gets a xtd::version object that identifies the operating system.
auto is_bsd_platform() const noexcept -> bool
Determines whether the current platform is BSD (FreeBSD, or Darwin).
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.hpp:115
Contains xtd::distribution class.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
platform_id
Identifies the operating system, or platform, supported by an assembly.
Definition platform_id.hpp:18
@ unknown
The processor architecture is unknown.
Definition architecture_id.hpp:22
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Contains xtd::optional type.
Contains xtd::platform_id enum class.
Contains xtd::string alias.
Contains xtd::version class.