blob: 35a228f58c85e0d1296b335bdf78395b1b9d6f39 [file] [log] [blame]
Henrik Kjellanderff761fb2015-11-04 08:31:52 +01001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
kthelgasonbeafee32016-12-16 02:12:42 -080011#ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_HELPERS_H_
12#define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_HELPERS_H_
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010013
14#if defined(WEBRTC_IOS)
15
16#include <string>
17
18namespace webrtc {
19namespace ios {
20
21bool CheckAndLogError(BOOL success, NSError* error);
22
kthelgasonc1b661e2017-01-09 01:40:03 -080023NSString *NSStringFromStdString(const std::string& stdString);
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010024std::string StdStringFromNSString(NSString* nsString);
25
26// Return thread ID as a string.
27std::string GetThreadId();
28
29// Return thread ID as string suitable for debug logging.
30std::string GetThreadInfo();
31
32// Returns [NSThread currentThread] description as string.
33// Example: <NSThread: 0x170066d80>{number = 1, name = main}
34std::string GetCurrentThreadDescription();
35
36std::string GetAudioSessionCategory();
37
38// Returns the current name of the operating system.
39std::string GetSystemName();
40
henrikaab12c472016-03-03 16:59:50 +010041// Returns the current version of the operating system as a string.
42std::string GetSystemVersionAsString();
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010043
henrikaab12c472016-03-03 16:59:50 +010044// Returns the version of the operating system in double representation.
45// Uses a cached value of the system version.
46double GetSystemVersion();
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010047
48// Returns the device type.
49// Examples: ”iPhone” and ”iPod touch”.
50std::string GetDeviceType();
51
52// Returns a more detailed device name.
53// Examples: "iPhone 5s (GSM)" and "iPhone 6 Plus".
54std::string GetDeviceName();
55
henrika3e60bf02016-02-24 14:27:09 +010056// Returns the name of the process. Does not uniquely identify the process.
57std::string GetProcessName();
58
59// Returns the identifier of the process (often called process ID).
60int GetProcessID();
61
62// Returns a string containing the version of the operating system on which the
63// process is executing. The string is string is human readable, localized, and
64// is appropriate for displaying to the user.
65std::string GetOSVersionString();
66
67// Returns the number of processing cores available on the device.
68int GetProcessorCount();
69
70// Indicates whether Low Power Mode is enabled on the iOS device.
71bool GetLowPowerModeEnabled();
72
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010073} // namespace ios
74} // namespace webrtc
75
76#endif // defined(WEBRTC_IOS)
77
kthelgasonbeafee32016-12-16 02:12:42 -080078#endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_HELPERS_H_