blob: 7802812c04ccf37801ee598412714aec6b4ac02f [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
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
henrikaab12c472016-03-03 16:59:50 +010040// Returns the current version of the operating system as a string.
41std::string GetSystemVersionAsString();
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010042
henrikaab12c472016-03-03 16:59:50 +010043// Returns the version of the operating system in double representation.
44// Uses a cached value of the system version.
45double GetSystemVersion();
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010046
47// Returns the device type.
48// Examples: ”iPhone” and ”iPod touch”.
49std::string GetDeviceType();
50
51// Returns a more detailed device name.
52// Examples: "iPhone 5s (GSM)" and "iPhone 6 Plus".
53std::string GetDeviceName();
54
henrika3e60bf02016-02-24 14:27:09 +010055// Returns the name of the process. Does not uniquely identify the process.
56std::string GetProcessName();
57
58// Returns the identifier of the process (often called process ID).
59int GetProcessID();
60
61// Returns a string containing the version of the operating system on which the
62// process is executing. The string is string is human readable, localized, and
63// is appropriate for displaying to the user.
64std::string GetOSVersionString();
65
66// Returns the number of processing cores available on the device.
67int GetProcessorCount();
68
69// Indicates whether Low Power Mode is enabled on the iOS device.
70bool GetLowPowerModeEnabled();
71
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010072} // namespace ios
73} // namespace webrtc
74
75#endif // defined(WEBRTC_IOS)
76
kthelgasonbeafee32016-12-16 02:12:42 -080077#endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_HELPERS_H_