OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2008 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_BASE_LINUX_H_ | 11 #ifndef WEBRTC_BASE_LINUX_H_ |
12 #define WEBRTC_BASE_LINUX_H_ | 12 #define WEBRTC_BASE_LINUX_H_ |
13 | 13 |
14 #if defined(WEBRTC_LINUX) | 14 #if defined(WEBRTC_LINUX) |
15 #include <string> | 15 #include <string> |
16 #include <map> | 16 #include <map> |
| 17 #include <memory> |
17 #include <vector> | 18 #include <vector> |
18 | 19 |
19 #include "webrtc/base/scoped_ptr.h" | |
20 #include "webrtc/base/stream.h" | 20 #include "webrtc/base/stream.h" |
21 | 21 |
22 namespace rtc { | 22 namespace rtc { |
23 | 23 |
24 ////////////////////////////////////////////////////////////////////////////// | 24 ////////////////////////////////////////////////////////////////////////////// |
25 // ConfigParser parses a FileStream of an ".ini."-type format into a map. | 25 // ConfigParser parses a FileStream of an ".ini."-type format into a map. |
26 ////////////////////////////////////////////////////////////////////////////// | 26 ////////////////////////////////////////////////////////////////////////////// |
27 | 27 |
28 // Sample Usage: | 28 // Sample Usage: |
29 // ConfigParser parser; | 29 // ConfigParser parser; |
(...skipping 14 matching lines...) Expand all Loading... |
44 ConfigParser(); | 44 ConfigParser(); |
45 virtual ~ConfigParser(); | 45 virtual ~ConfigParser(); |
46 | 46 |
47 virtual bool Open(const std::string& filename); | 47 virtual bool Open(const std::string& filename); |
48 virtual void Attach(StreamInterface* stream); | 48 virtual void Attach(StreamInterface* stream); |
49 virtual bool Parse(MapVector* key_val_pairs); | 49 virtual bool Parse(MapVector* key_val_pairs); |
50 virtual bool ParseSection(SimpleMap* key_val_pair); | 50 virtual bool ParseSection(SimpleMap* key_val_pair); |
51 virtual bool ParseLine(std::string* key, std::string* value); | 51 virtual bool ParseLine(std::string* key, std::string* value); |
52 | 52 |
53 private: | 53 private: |
54 scoped_ptr<StreamInterface> instream_; | 54 std::unique_ptr<StreamInterface> instream_; |
55 }; | 55 }; |
56 | 56 |
57 ////////////////////////////////////////////////////////////////////////////// | 57 ////////////////////////////////////////////////////////////////////////////// |
58 // ProcCpuInfo reads CPU info from the /proc subsystem on any *NIX platform. | 58 // ProcCpuInfo reads CPU info from the /proc subsystem on any *NIX platform. |
59 ////////////////////////////////////////////////////////////////////////////// | 59 ////////////////////////////////////////////////////////////////////////////// |
60 | 60 |
61 // Sample Usage: | 61 // Sample Usage: |
62 // ProcCpuInfo proc_info; | 62 // ProcCpuInfo proc_info; |
63 // int no_of_cpu; | 63 // int no_of_cpu; |
64 // if (proc_info.LoadFromSystem()) { | 64 // if (proc_info.LoadFromSystem()) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 // Returns the content (int) of | 110 // Returns the content (int) of |
111 // /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq | 111 // /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq |
112 // Returns -1 on error. | 112 // Returns -1 on error. |
113 int ReadCpuMaxFreq(); | 113 int ReadCpuMaxFreq(); |
114 | 114 |
115 } // namespace rtc | 115 } // namespace rtc |
116 | 116 |
117 #endif // defined(WEBRTC_LINUX) | 117 #endif // defined(WEBRTC_LINUX) |
118 #endif // WEBRTC_BASE_LINUX_H_ | 118 #endif // WEBRTC_BASE_LINUX_H_ |
OLD | NEW |