summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorMJacred <loesch.benny92@gmx.de>2022-09-16 11:14:14 +0200
committerMJacred <loesch.benny92@gmx.de>2022-09-16 11:17:36 +0200
commitac9786c52534cc98c107edf568656f33a81fa2a0 (patch)
treeb4aea71462783d2165283f37f4476db950058854 /platform/ios
parentd1b2a191ab752ebd8236e3547e07b6eb3bb1f260 (diff)
Add get_distribution_name() and get_version() to OS
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP Co-authored-by: bruvzg
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/os_ios.h2
-rw-r--r--platform/ios/os_ios.mm9
2 files changed, 11 insertions, 0 deletions
diff --git a/platform/ios/os_ios.h b/platform/ios/os_ios.h
index 3b88f53b6a..00d91da771 100644
--- a/platform/ios/os_ios.h
+++ b/platform/ios/os_ios.h
@@ -100,6 +100,8 @@ public:
virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) override;
virtual String get_name() const override;
+ virtual String get_distribution_name() const override;
+ virtual String get_version() const override;
virtual String get_model_name() const override;
virtual Error shell_open(String p_uri) override;
diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm
index b9d186f355..a674498620 100644
--- a/platform/ios/os_ios.mm
+++ b/platform/ios/os_ios.mm
@@ -240,6 +240,15 @@ String OS_IOS::get_name() const {
return "iOS";
}
+String OS_IOS::get_distribution_name() const {
+ return get_name();
+}
+
+String OS_IOS::get_version() const {
+ NSOperatingSystemVersion ver = [NSProcessInfo processInfo].operatingSystemVersion;
+ return vformat("%d.%d.%d", (int64_t)ver.majorVersion, (int64_t)ver.minorVersion, (int64_t)ver.patchVersion);
+}
+
String OS_IOS::get_model_name() const {
String model = ios->get_model();
if (model != "") {