blob: d3f788fec30e9f1fc98032a340558fa298dc25c6 [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
11#ifndef WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_IOS_H_
12#define WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_IOS_H_
13
14#if defined(WEBRTC_IOS)
15
16#include <string>
17
18namespace webrtc {
19namespace ios {
20
21bool CheckAndLogError(BOOL success, NSError* error);
22
23std::string StdStringFromNSString(NSString* nsString);
24
25// Return thread ID as a string.
26std::string GetThreadId();
27
28// Return thread ID as string suitable for debug logging.
29std::string GetThreadInfo();
30
31// Returns [NSThread currentThread] description as string.
32// Example: <NSThread: 0x170066d80>{number = 1, name = main}
33std::string GetCurrentThreadDescription();
34
35std::string GetAudioSessionCategory();
36
37// Returns the current name of the operating system.
38std::string GetSystemName();
39
40// Returns the current version of the operating system.
41std::string GetSystemVersion();
42
43// Returns the version of the operating system as a floating point value.
44float GetSystemVersionAsFloat();
45
46// Returns the device type.
47// Examples: ”iPhone” and ”iPod touch”.
48std::string GetDeviceType();
49
50// Returns a more detailed device name.
51// Examples: "iPhone 5s (GSM)" and "iPhone 6 Plus".
52std::string GetDeviceName();
53
henrika3e60bf02016-02-24 14:27:09 +010054// Returns the name of the process. Does not uniquely identify the process.
55std::string GetProcessName();
56
57// Returns the identifier of the process (often called process ID).
58int GetProcessID();
59
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
62// is appropriate for displaying to the user.
63std::string GetOSVersionString();
64
65// Returns the number of processing cores available on the device.
66int GetProcessorCount();
67
68// Indicates whether Low Power Mode is enabled on the iOS device.
69bool GetLowPowerModeEnabled();
70
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010071} // namespace ios
72} // namespace webrtc
73
74#endif // defined(WEBRTC_IOS)
75
76#endif // WEBRTC_MODULES_UTILITY_INCLUDE_HELPERS_IOS_H_