System Class Reference

Various system-level utility functions. More...

#include <System.h++>

List of all members.

Static Public Member Functions

static time_s_t currentTime () throw ()
 Get the system time, in seconds since the epoch.
static time_ms_t currentTimeMillis () throw ()
 Get the system time, in milliseconds since the epoch.
static void setSystemTime (const time_ms_t &time) throw (SystemException)
 Set the system time.
static String getEnvVariable (const String &name)
 Get the value of an environment variable.
static bool setEnvVariable (const String &name, const String &value) throw ()
 Set the value of an environment variable.
static bool delEnvVariable (const String &name) throw ()
 Delete (unset) an environment variable.
static String getUserName ()
 Get the username of the current user.
static String getOSName ()
 Get the name of the host OS.
static String getOSVersion ()
 Get the version of the host OS.
static String getArchitecture ()
 Get the name of the host system architecture.
static String getHostName ()
 Get the host name.
static String getHomeDir ()
 Get the current user's home directory.
static String getTempDir ()
 Get the system temporary directory.
static String getErrorString (const String &text=String::null)
 Get the system error message string for the most recent error.
static size_t getPageSize () throw ()
 Get the system page size.
static void roundToPageSize (size_t &size) throw ()
 Round a value up to a multiple of the system page size.
static void printStackTrace (uint_t maxFrames=20)
 Print a stack trace to standard error.
static bool isPOSIX () throw ()
 Test if the host OS is a POSIX OS.
static bool isMacOSX () throw ()
 Test if the host OS is Mac OS X.
static bool isWindows () throw ()
 Test if the host OS is Microsoft Windows.

Detailed Description

Various system-level utility functions.

Author:
Mark Lindner

Member Function Documentation

time_s_t currentTime (  )  throw () [static]

Get the system time, in seconds since the epoch.

ccxx::time_ms_t currentTimeMillis (  )  throw () [static]

Get the system time, in milliseconds since the epoch.

bool delEnvVariable ( const String name  )  throw () [static]

Delete (unset) an environment variable.

Parameters:
name The name of the variable.
Returns:
true on success, false otherwise.
String getArchitecture (  )  [static]

Get the name of the host system architecture.

String getEnvVariable ( const String name  )  [static]

Get the value of an environment variable.

Parameters:
name The name of the variable.
Returns:
The value of the variable, or String::null if it is not defined.
String getErrorString ( const String text = String::null  )  [static]

Get the system error message string for the most recent error.

Parameters:
text Optional text to prepend to the resulting message.
Returns:
The error message.
String getHomeDir (  )  [static]

Get the current user's home directory.

String getHostName (  )  [static]

Get the host name.

String getOSName (  )  [static]

Get the name of the host OS.

String getOSVersion (  )  [static]

Get the version of the host OS.

size_t getPageSize (  )  throw () [static]

Get the system page size.

String getTempDir (  )  [static]

Get the system temporary directory.

String getUserName (  )  [static]

Get the username of the current user.

bool isMacOSX (  )  throw () [static]

Test if the host OS is Mac OS X.

bool isPOSIX (  )  throw () [static]

Test if the host OS is a POSIX OS.

bool isWindows (  )  throw () [static]

Test if the host OS is Microsoft Windows.

void printStackTrace ( uint_t  maxFrames = 20  )  [static]

Print a stack trace to standard error.

void roundToPageSize ( size_t &  size  )  throw () [static]

Round a value up to a multiple of the system page size.

bool setEnvVariable ( const String name,
const String value 
) throw () [static]

Set the value of an environment variable.

Parameters:
name The name of the variable.
value The vaule for the variable.
Returns:
true on success, false otherwise.
void setSystemTime ( const time_ms_t time  )  throw (SystemException) [static]

Set the system time.

On most platforms, superuser or administrator privileges are required to set the system time.

Parameters:
time The new time.
Exceptions:
SystemException If an error occurs.

The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:09 2011 for libcommonc++ by  doxygen 1.6.3