libcommonc++
0.7
|
Various system-level utility functions. More...
#include <System.h++>
Static Public Member Functions | |
static time_s_t | currentTime () |
Get the system time, in seconds since the epoch. More... | |
static time_ms_t | currentTimeMillis () |
Get the system time, in milliseconds since the epoch. More... | |
static void | setSystemTime (const time_ms_t &time) |
Set the system time. More... | |
static String | getEnvVariable (const String &name) |
Get the value of an environment variable. More... | |
static bool | setEnvVariable (const String &name, const String &value) |
Set the value of an environment variable. More... | |
static bool | delEnvVariable (const String &name) |
Delete (unset) an environment variable. More... | |
static String | getUserName () |
Get the username of the current user. More... | |
static String | getOSName () |
Get the name of the host OS. More... | |
static String | getOSVersion () |
Get the version of the host OS. More... | |
static String | getArchitecture () |
Get the name of the host system architecture. More... | |
static String | getHostName () |
Get the host name. More... | |
static String | getHomeDir () |
Get the current user's home directory. More... | |
static String | getTempDir () |
Get the system temporary directory. More... | |
static String | getErrorString (const String &text=String::null) |
Get the system error message string for the most recent error. More... | |
static size_t | getPageSize () |
Get the system page size. More... | |
static void | roundToPageSize (size_t &size) |
Round a value up to a multiple of the system page size. More... | |
static void | printStackTrace (uint_t maxFrames=20) |
Print a stack trace to standard error. More... | |
static bool | isPOSIX () |
Test if the host OS is a POSIX OS. More... | |
static bool | isMacOSX () |
Test if the host OS is Mac OS X. More... | |
static bool | isWindows () |
Test if the host OS is Microsoft Windows. More... | |
Various system-level utility functions.
|
static |
Get the system time, in seconds since the epoch.
|
static |
Get the system time, in milliseconds since the epoch.
|
static |
Delete (unset) an environment variable.
name | The name of the variable. |
|
static |
Get the name of the host system architecture.
Get the value of an environment variable.
name | The name of the variable. |
|
static |
Get the system error message string for the most recent error.
text | Optional text to prepend to the resulting message. |
|
static |
Get the current user's home directory.
|
static |
Get the host name.
|
static |
Get the name of the host OS.
|
static |
Get the version of the host OS.
|
static |
Get the system page size.
|
static |
Get the system temporary directory.
|
static |
Get the username of the current user.
|
static |
Test if the host OS is Mac OS X.
|
static |
Test if the host OS is a POSIX OS.
|
static |
Test if the host OS is Microsoft Windows.
|
static |
Print a stack trace to standard error.
|
static |
Round a value up to a multiple of the system page size.
Set the value of an environment variable.
name | The name of the variable. |
value | The vaule for the variable. |
|
static |
Set the system time.
On most platforms, superuser or administrator privileges are required to set the system time.
time | The new time. |
SystemException | If an error occurs. |