Ocean
Loading...
Searching...
No Matches
OperatingSystem.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_SYSTEM_OPERATING_SYSTEM_H
9#define META_OCEAN_SYSTEM_OPERATING_SYSTEM_H
10
11#include "ocean/system/System.h"
12
13namespace Ocean
14{
15
16namespace System
17{
18
19/**
20 * This class implements functions for the operating system.
21 * @ingroup system
22 */
23class OCEAN_SYSTEM_EXPORT OperatingSystem
24{
25 public:
26
27 /**
28 * Definition of individual operating systems.
29 */
31 {
32 /// Unknown operating system.
34
35 /// Windows operating system without specific version.
37 /// Windows client operating system without specific version.
39 /// Windows server operating system without specific version.
41
42 /// Windows 2000 with any kind of service pack.
44 /// Windows XP with any kind of service pack.
46 /// Windows Vista with any kind of service pack.
48 /// Windows 7 with any kind of service pack.
50 /// Windows 8 with any kind of service pack.
52 /// Windows 8.1 with any kind of service pack.
54 /// Windows 10 with any kind of service pack.
56
57 /// Windows Server 2003 with any kind of service pack.
59 /// Windows Server 2008 with any kind of service pack.
61 /// Windows Server 2012 with any kind of service pack.
63 /// Windows Server 2016 with any kind of service pack.
65
66 /// Apple MacOS operating system without specific version.
67 OSID_APPLE_MACOS = 0x00010000,
68
69 /// Apple iOS operating system without specific version.
70 OSID_APPLE_IOS = 0x00100000,
71
72 /// Android operating system without specific version.
73 OSID_ANDROID = 0x01000000,
74
75 // Linux without any specific version.
76 OSID_LINUX = 0x10000000
77 };
78
79 public:
80
81 /**
82 * Returns the id of the current operating system.
83 * @param version Optional resulting (detailed) version of the operating system
84 * @return The OS's id
85 */
86 static OperatingSystemId id(std::string* version = nullptr);
87
88 /**
89 * Returns the name of the current operating system.
90 * @param addVersion True, to add the version of the operating system
91 * @return The OS's name
92 */
93 static std::string name(const bool addVersion = true);
94};
95
96}
97
98}
99
100#endif // META_OCEAN_SYSTEM_OPERATING_SYSTEM_H
This class implements functions for the operating system.
Definition OperatingSystem.h:24
static OperatingSystemId id(std::string *version=nullptr)
Returns the id of the current operating system.
static std::string name(const bool addVersion=true)
Returns the name of the current operating system.
OperatingSystemId
Definition of individual operating systems.
Definition OperatingSystem.h:31
@ OSID_MICROSOFT_WINDOWS_CLIENT
Windows client operating system without specific version.
Definition OperatingSystem.h:38
@ OSID_ANDROID
Android operating system without specific version.
Definition OperatingSystem.h:73
@ OSID_MICROSOFT_WINDOWS
Windows operating system without specific version.
Definition OperatingSystem.h:36
@ OSID_APPLE_MACOS
Apple MacOS operating system without specific version.
Definition OperatingSystem.h:67
@ OSID_MICROSOFT_WINDOWS_8_1
Windows 8.1 with any kind of service pack.
Definition OperatingSystem.h:53
@ OSID_UNKNOWN
Unknown operating system.
Definition OperatingSystem.h:33
@ OSID_MICROSOFT_WINDOWS_VISTA
Windows Vista with any kind of service pack.
Definition OperatingSystem.h:47
@ OSID_LINUX
Definition OperatingSystem.h:76
@ OSID_MICROSOFT_WINDOWS_8
Windows 8 with any kind of service pack.
Definition OperatingSystem.h:51
@ OSID_MICROSOFT_WINDOWS_SERVER_2012
Windows Server 2012 with any kind of service pack.
Definition OperatingSystem.h:62
@ OSID_MICROSOFT_WINDOWS_SERVER_2003
Windows Server 2003 with any kind of service pack.
Definition OperatingSystem.h:58
@ OSID_APPLE_IOS
Apple iOS operating system without specific version.
Definition OperatingSystem.h:70
@ OSID_MICROSOFT_WINDOWS_2000
Windows 2000 with any kind of service pack.
Definition OperatingSystem.h:43
@ OSID_MICROSOFT_WINDOWS_SERVER
Windows server operating system without specific version.
Definition OperatingSystem.h:40
@ OSID_MICROSOFT_WINDOWS_SERVER_2016
Windows Server 2016 with any kind of service pack.
Definition OperatingSystem.h:64
@ OSID_MICROSOFT_WINDOWS_7
Windows 7 with any kind of service pack.
Definition OperatingSystem.h:49
@ OSID_MICROSOFT_WINDOWS_SERVER_2008
Windows Server 2008 with any kind of service pack.
Definition OperatingSystem.h:60
@ OSID_MICROSOFT_WINDOWS_XP
Windows XP with any kind of service pack.
Definition OperatingSystem.h:45
@ OSID_MICROSOFT_WINDOWS_10
Windows 10 with any kind of service pack.
Definition OperatingSystem.h:55
Namespace of the System library.
Definition system/Memory.h:19
The namespace covering the entire Ocean framework.
Definition Accessor.h:15