PixelLightAPI
.
|
Provides access to system and platform functions. More...
#include <System.h>
Public Member Functions | |
PLCORE_API String | GetInfo () const |
Returns relevant system information in one string. | |
PLCORE_API bool | IsLittleEndian () const |
Detects the current machine's endian ("byte order") | |
String | GetPlatform () const |
Returns the name of the platform. | |
PLCORE_API String | GetPlatformArchitecture () const |
Returns the platform architecture. | |
PLCORE_API uint32 | GetPlatformBitArchitecture () const |
Returns the platform bit architecture. | |
String | GetOS () const |
Returns the name and version of the operating system. | |
char | GetSeparator () const |
Returns the directory separator used by the operation system. | |
String | GetSharedLibraryPrefix () const |
Returns the shared library filename prefix used by the operation system. | |
String | GetSharedLibraryExtension () const |
Returns the shared library file extension used by the operation system. | |
uint32 | GetCPUMhz () const |
Get the CPU MHz. | |
String | GetComputerName () const |
Returns the name of the computer. | |
String | GetUserName () const |
Returns the current user name. | |
String | GetUserHomeDir () const |
Get home directory of the current user. | |
String | GetUserDataDir () const |
Get data directory of the current user. | |
String | GetDataDirName (const String &sName) const |
Get name of data directory for given application name. | |
String | GetExecutableFilename () const |
Get absolute path of application executable. | |
String | GetEnvironmentVariable (const String &sName) const |
Reads an environment variable. | |
bool | SetEnvironmentVariable (const String &sName, const String &sValue) const |
Writes an environment variable. | |
void | DeleteEnvironmentVariable (const String &sName) const |
Deletes an environment variable. | |
bool | Execute (const String &sCommand, const String &sParameters, const String &sWorkingDir="") const |
Executes a system command (create a new process) | |
String | GetLocaleLanguage () const |
Returns the current program locale language information. | |
String | GetCurrentDir () const |
Returns the current directory. | |
bool | SetCurrentDir (const String &sPath) |
Sets the current directory. | |
Thread * | GetMainThread () const |
Returns a pointer to the main thread. | |
Thread * | GetCurrentThread () const |
Returns a pointer to the current thread. | |
void | Exit (int nReturn) |
Exit the application immediately. | |
const Console & | GetConsole () const |
Returns the console instance. | |
void | UrgentMessage (const String &sMessage) const |
Primitive way (e.g. by using a message box) to be able to tell the user that something went terrible wrong. | |
Time | GetTime () const |
Returns the current date and time. | |
uint64 | GetMilliseconds () const |
Returns the number of milliseconds since the system was started. | |
uint64 | GetMicroseconds () const |
Retrieves the number of microseconds since the system was started. | |
void | Sleep (uint64 nMilliseconds) const |
Suspend the current thread for a specified time period. | |
void | Yield () const |
Yields the rest of the current threads time slice. | |
float | GetPercentageOfUsedPhysicalMemory () const |
Returns an approximation of the percentage of used physical memory (0.0-100.0) | |
uint64 | GetTotalPhysicalMemory () const |
Returns the total physical memory in bytes. | |
uint64 | GetFreePhysicalMemory () const |
Returns the current free physical memory in bytes. | |
uint64 | GetTotalVirtualMemory () const |
Returns the total virtual memory in bytes. | |
uint64 | GetFreeVirtualMemory () const |
Returns the current free virtual memory in bytes. | |
Static Public Member Functions | |
static PLCORE_API System * | GetInstance () |
static PLCORE_API bool | HasInstance () |
Provides access to system and platform functions.
static PLCORE_API System* PLCore::System::GetInstance | ( | ) | [static] |
static PLCORE_API bool PLCore::System::HasInstance | ( | ) | [static] |
PLCORE_API String PLCore::System::GetInfo | ( | ) | const |
PLCORE_API bool PLCore::System::IsLittleEndian | ( | ) | const |
Detects the current machine's endian ("byte order")
String PLCore::System::GetPlatform | ( | ) | const [inline] |
Returns the name of the platform.
PLCORE_API String PLCore::System::GetPlatformArchitecture | ( | ) | const |
Returns the platform architecture.
PLCORE_API uint32 PLCore::System::GetPlatformBitArchitecture | ( | ) | const |
Returns the platform bit architecture.
String PLCore::System::GetOS | ( | ) | const [inline] |
Returns the name and version of the operating system.
char PLCore::System::GetSeparator | ( | ) | const [inline] |
Returns the directory separator used by the operation system.
String PLCore::System::GetSharedLibraryPrefix | ( | ) | const [inline] |
Returns the shared library filename prefix used by the operation system.
String PLCore::System::GetSharedLibraryExtension | ( | ) | const [inline] |
Returns the shared library file extension used by the operation system.
uint32 PLCore::System::GetCPUMhz | ( | ) | const [inline] |
Get the CPU MHz.
String PLCore::System::GetComputerName | ( | ) | const [inline] |
Returns the name of the computer.
String PLCore::System::GetUserName | ( | ) | const [inline] |
Returns the current user name.
String PLCore::System::GetUserHomeDir | ( | ) | const [inline] |
Get home directory of the current user.
String PLCore::System::GetUserDataDir | ( | ) | const [inline] |
Get data directory of the current user.
String PLCore::System::GetDataDirName | ( | const String & | sName | ) | const [inline] |
Get name of data directory for given application name.
[in] | sName | Application name |
String PLCore::System::GetExecutableFilename | ( | ) | const [inline] |
Get absolute path of application executable.
String PLCore::System::GetEnvironmentVariable | ( | const String & | sName | ) | const [inline] |
Reads an environment variable.
[in] | sName | Name of the environment variable to read |
bool PLCore::System::SetEnvironmentVariable | ( | const String & | sName, |
const String & | sValue | ||
) | const [inline] |
Writes an environment variable.
[in] | sName | Name of the environment variable to write |
[in] | sValue | Value to write into the variable |
void PLCore::System::DeleteEnvironmentVariable | ( | const String & | sName | ) | const [inline] |
Deletes an environment variable.
[in] | sName | Name of the environment variable to delete |
bool PLCore::System::Execute | ( | const String & | sCommand, |
const String & | sParameters, | ||
const String & | sWorkingDir = "" |
||
) | const [inline] |
Executes a system command (create a new process)
[in] | sCommand | Command to execute |
[in] | sParameters | Parameters to pass to the command |
[in] | sWorkingDir | Working directory in which to execute the command |
String PLCore::System::GetLocaleLanguage | ( | ) | const [inline] |
Returns the current program locale language information.
String PLCore::System::GetCurrentDir | ( | ) | const [inline] |
Returns the current directory.
bool PLCore::System::SetCurrentDir | ( | const String & | sPath | ) | [inline] |
Sets the current directory.
[in] | sPath | Path to the current directory |
Thread * PLCore::System::GetMainThread | ( | ) | const [inline] |
Returns a pointer to the main thread.
Thread * PLCore::System::GetCurrentThread | ( | ) | const [inline] |
Returns a pointer to the current thread.
void PLCore::System::Exit | ( | int | nReturn | ) | [inline] |
Exit the application immediately.
[in] | nReturn | Return value |
const Console & PLCore::System::GetConsole | ( | ) | const [inline] |
Returns the console instance.
void PLCore::System::UrgentMessage | ( | const String & | sMessage | ) | const [inline] |
Primitive way (e.g. by using a message box) to be able to tell the user that something went terrible wrong.
[in] | sMessage | Message to show |
Time PLCore::System::GetTime | ( | ) | const [inline] |
Returns the current date and time.
uint64 PLCore::System::GetMilliseconds | ( | ) | const [inline] |
Returns the number of milliseconds since the system was started.
uint64 PLCore::System::GetMicroseconds | ( | ) | const [inline] |
Retrieves the number of microseconds since the system was started.
void PLCore::System::Sleep | ( | uint64 | nMilliseconds | ) | const [inline] |
Suspend the current thread for a specified time period.
[in] | nMilliseconds | Number of milliseconds to sleep, should not be 0 because the behavior is implementation dependent (use 'Yield()' instead) |
void PLCore::System::Yield | ( | ) | const [inline] |
Yields the rest of the current threads time slice.
float PLCore::System::GetPercentageOfUsedPhysicalMemory | ( | ) | const [inline] |
Returns an approximation of the percentage of used physical memory (0.0-100.0)
uint64 PLCore::System::GetTotalPhysicalMemory | ( | ) | const [inline] |
Returns the total physical memory in bytes.
uint64 PLCore::System::GetFreePhysicalMemory | ( | ) | const [inline] |
Returns the current free physical memory in bytes.
uint64 PLCore::System::GetTotalVirtualMemory | ( | ) | const [inline] |
Returns the total virtual memory in bytes.
uint64 PLCore::System::GetFreeVirtualMemory | ( | ) | const [inline] |
Returns the current free virtual memory in bytes.
|