OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_ | 11 #ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_ |
12 #define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_ | 12 #define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_ |
13 | 13 |
14 #if defined(WEBRTC_IOS) | |
15 | |
16 #include <string> | 14 #include <string> |
17 | 15 |
18 namespace webrtc { | 16 namespace webrtc { |
19 namespace ios { | 17 namespace ios { |
20 | 18 |
21 bool CheckAndLogError(BOOL success, NSError* error); | 19 bool CheckAndLogError(BOOL success, NSError* error); |
22 | 20 |
23 NSString *NSStringFromStdString(const std::string& stdString); | 21 NSString *NSStringFromStdString(const std::string& stdString); |
24 std::string StdStringFromNSString(NSString* nsString); | 22 std::string StdStringFromNSString(NSString* nsString); |
25 | 23 |
26 // Return thread ID as a string. | 24 // Return thread ID as a string. |
27 std::string GetThreadId(); | 25 std::string GetThreadId(); |
28 | 26 |
29 // Return thread ID as string suitable for debug logging. | 27 // Return thread ID as string suitable for debug logging. |
30 std::string GetThreadInfo(); | 28 std::string GetThreadInfo(); |
31 | 29 |
32 // Returns [NSThread currentThread] description as string. | 30 // Returns [NSThread currentThread] description as string. |
33 // Example: <NSThread: 0x170066d80>{number = 1, name = main} | 31 // Example: <NSThread: 0x170066d80>{number = 1, name = main} |
34 std::string GetCurrentThreadDescription(); | 32 std::string GetCurrentThreadDescription(); |
35 | 33 |
| 34 #if defined(WEBRTC_IOS) |
36 // Returns the current name of the operating system. | 35 // Returns the current name of the operating system. |
37 std::string GetSystemName(); | 36 std::string GetSystemName(); |
38 | 37 |
39 // Returns the current version of the operating system as a string. | 38 // Returns the current version of the operating system as a string. |
40 std::string GetSystemVersionAsString(); | 39 std::string GetSystemVersionAsString(); |
41 | 40 |
42 // Returns the version of the operating system in double representation. | 41 // Returns the version of the operating system in double representation. |
43 // Uses a cached value of the system version. | 42 // Uses a cached value of the system version. |
44 double GetSystemVersion(); | 43 double GetSystemVersion(); |
45 | 44 |
46 // Returns the device type. | 45 // Returns the device type. |
47 // Examples: ”iPhone” and ”iPod touch”. | 46 // Examples: ”iPhone” and ”iPod touch”. |
48 std::string GetDeviceType(); | 47 std::string GetDeviceType(); |
| 48 #endif // defined(WEBRTC_IOS) |
49 | 49 |
50 // Returns a more detailed device name. | 50 // Returns a more detailed device name. |
51 // Examples: "iPhone 5s (GSM)" and "iPhone 6 Plus". | 51 // Examples: "iPhone 5s (GSM)" and "iPhone 6 Plus". |
52 std::string GetDeviceName(); | 52 std::string GetDeviceName(); |
53 | 53 |
54 // Returns the name of the process. Does not uniquely identify the process. | 54 // Returns the name of the process. Does not uniquely identify the process. |
55 std::string GetProcessName(); | 55 std::string GetProcessName(); |
56 | 56 |
57 // Returns the identifier of the process (often called process ID). | 57 // Returns the identifier of the process (often called process ID). |
58 int GetProcessID(); | 58 int GetProcessID(); |
59 | 59 |
60 // Returns a string containing the version of the operating system on which the | 60 // Returns a string containing the version of the operating system on which the |
61 // process is executing. The string is string is human readable, localized, and | 61 // process is executing. The string is string is human readable, localized, and |
62 // is appropriate for displaying to the user. | 62 // is appropriate for displaying to the user. |
63 std::string GetOSVersionString(); | 63 std::string GetOSVersionString(); |
64 | 64 |
65 // Returns the number of processing cores available on the device. | 65 // Returns the number of processing cores available on the device. |
66 int GetProcessorCount(); | 66 int GetProcessorCount(); |
67 | 67 |
| 68 #if defined(WEBRTC_IOS) |
68 // Indicates whether Low Power Mode is enabled on the iOS device. | 69 // Indicates whether Low Power Mode is enabled on the iOS device. |
69 bool GetLowPowerModeEnabled(); | 70 bool GetLowPowerModeEnabled(); |
| 71 #endif |
70 | 72 |
71 } // namespace ios | 73 } // namespace ios |
72 } // namespace webrtc | 74 } // namespace webrtc |
73 | 75 |
74 #endif // defined(WEBRTC_IOS) | |
75 | |
76 #endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_ | 76 #endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_ |
OLD | NEW |