From 05f9b688e319fcb092be0e06f7b72d39dd3113b3 Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Mon, 29 Sep 2008 22:18:01 +0000 Subject: Refactoring for portability: - Move chrome/common/env_util to base/sys_info - Move chrome/common/rand_util to base/rand_util (new), simplify its public interface, and fix its implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Paweł Hajdan, Jr. http://codereview.chromium.org/4079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2697 0039d316-1c4b-4281-b951-d872f2087c98 --- base/sys_info.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'base/sys_info.h') diff --git a/base/sys_info.h b/base/sys_info.h index 3d6a16a6..a70f5b6 100644 --- a/base/sys_info.h +++ b/base/sys_info.h @@ -28,6 +28,31 @@ class SysInfo { // or -1 on failure. static int64 AmountOfFreeDiskSpace(const std::wstring& path); + // Return true if the given environment variable is defined. + // TODO: find a better place for HasEnvVar. + static bool HasEnvVar(const wchar_t* var); + + // Return the value of the given environment variable + // or an empty string if not defined. + // TODO: find a better place for GetEnvVar. + static std::wstring GetEnvVar(const wchar_t* var); + + // Returns the name of the host operating system. + static std::string OperatingSystemName(); + + // Returns the version of the host operating system. + static std::string OperatingSystemVersion(); + + // Returns the CPU architecture of the system. Exact return value may differ + // across platforms. + static std::string CPUArchitecture(); + + // Returns the pixel dimensions of the primary display via the + // width and height parameters. + static void GetPrimaryDisplayDimensions(int* width, int* height); + + // Return the number of displays. + static int DisplayCount(); }; } // namespace base -- cgit v1.1