[email protected] | 2a758d61 | 2008-09-17 10:09:39 | [diff] [blame] | 1 | // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef BASE_SYS_INFO_H_ | ||||
6 | #define BASE_SYS_INFO_H_ | ||||
7 | |||||
[email protected] | d632798e | 2008-09-17 13:10:45 | [diff] [blame] | 8 | #include "base/basictypes.h" |
9 | |||||
[email protected] | 0e91dd2 | 2008-09-18 12:34:24 | [diff] [blame] | 10 | #include <string> |
11 | |||||
[email protected] | 2a758d61 | 2008-09-17 10:09:39 | [diff] [blame] | 12 | namespace base { |
13 | |||||
14 | class SysInfo { | ||||
15 | public: | ||||
16 | // Return the number of logical processors/cores on the current machine. | ||||
17 | static int NumberOfProcessors(); | ||||
[email protected] | d632798e | 2008-09-17 13:10:45 | [diff] [blame] | 18 | |
19 | // Return the number of bytes of physical memory on the current machine. | ||||
20 | static int64 AmountOfPhysicalMemory(); | ||||
[email protected] | fadf97f | 2008-09-18 12:18:14 | [diff] [blame] | 21 | |
22 | // Return the number of megabytes of physical memory on the current machine. | ||||
23 | static int AmountOfPhysicalMemoryMB() { | ||||
24 | return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); | ||||
25 | } | ||||
[email protected] | 0e91dd2 | 2008-09-18 12:34:24 | [diff] [blame] | 26 | |
[email protected] | 02ee34a | 2008-09-20 01:16:23 | [diff] [blame^] | 27 | // Return the available disk space in bytes on the volume containing |path|, |
28 | // or -1 on failure. | ||||
[email protected] | 0e91dd2 | 2008-09-18 12:34:24 | [diff] [blame] | 29 | static int64 AmountOfFreeDiskSpace(const std::wstring& path); |
30 | |||||
[email protected] | 2a758d61 | 2008-09-17 10:09:39 | [diff] [blame] | 31 | }; |
32 | |||||
33 | } // namespace base | ||||
34 | |||||
35 | #endif // BASE_SYS_INFO_H_ |