OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_SYS_INFO_H_ | 5 #ifndef BASE_SYS_INFO_H_ |
6 #define BASE_SYS_INFO_H_ | 6 #define BASE_SYS_INFO_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Return the number of megabytes of physical memory on the current machine. | 22 // Return the number of megabytes of physical memory on the current machine. |
23 static int AmountOfPhysicalMemoryMB() { | 23 static int AmountOfPhysicalMemoryMB() { |
24 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); | 24 return static_cast<int>(AmountOfPhysicalMemory() / 1024 / 1024); |
25 } | 25 } |
26 | 26 |
27 // Return the available disk space in bytes on the volume containing |path|, | 27 // Return the available disk space in bytes on the volume containing |path|, |
28 // or -1 on failure. | 28 // or -1 on failure. |
29 static int64 AmountOfFreeDiskSpace(const std::wstring& path); | 29 static int64 AmountOfFreeDiskSpace(const std::wstring& path); |
30 | 30 |
| 31 // Return true if the given environment variable is defined. |
| 32 // TODO: find a better place for HasEnvironmentVariable. |
| 33 static bool HasEnvironmentVariable(const char* var); |
| 34 |
| 35 // Return the value of the given environment variable |
| 36 // or an empty string if not defined. |
| 37 // TODO: find a better place for GetEnvironmentVariable. |
| 38 static std::wstring GetEnvironmentVariable(const char* var); |
| 39 |
| 40 // Returns the name of the host operating system. |
| 41 static std::string OperatingSystemName(); |
| 42 |
| 43 // Returns the version of the host operating system. |
| 44 static std::string OperatingSystemVersion(); |
| 45 |
| 46 // Returns the CPU architecture of the system. Exact return value may differ |
| 47 // across platforms. |
| 48 static std::string CPUArchitecture(); |
| 49 |
| 50 // Returns the pixel dimensions of the primary display via the |
| 51 // width and height parameters. |
| 52 static void GetPrimaryDisplayDimensions(int* width, int* height); |
| 53 |
| 54 // Return the number of displays. |
| 55 static int DisplayCount(); |
31 }; | 56 }; |
32 | 57 |
33 } // namespace base | 58 } // namespace base |
34 | 59 |
35 #endif // BASE_SYS_INFO_H_ | 60 #endif // BASE_SYS_INFO_H_ |
OLD | NEW |