blob: 3d6a16a60a7254fa1d04cf6cefcebdfdc3706c6f [file] [log] [blame]
[email protected]2a758d612008-09-17 10:09:391// 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]d632798e2008-09-17 13:10:458#include "base/basictypes.h"
9
[email protected]0e91dd22008-09-18 12:34:2410#include <string>
11
[email protected]2a758d612008-09-17 10:09:3912namespace base {
13
14class SysInfo {
15 public:
16 // Return the number of logical processors/cores on the current machine.
17 static int NumberOfProcessors();
[email protected]d632798e2008-09-17 13:10:4518
19 // Return the number of bytes of physical memory on the current machine.
20 static int64 AmountOfPhysicalMemory();
[email protected]fadf97f2008-09-18 12:18:1421
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]0e91dd22008-09-18 12:34:2426
[email protected]02ee34a2008-09-20 01:16:2327 // Return the available disk space in bytes on the volume containing |path|,
28 // or -1 on failure.
[email protected]0e91dd22008-09-18 12:34:2429 static int64 AmountOfFreeDiskSpace(const std::wstring& path);
30
[email protected]2a758d612008-09-17 10:09:3931};
32
33} // namespace base
34
35#endif // BASE_SYS_INFO_H_