Colobot
|
Platform-specific utils. More...
#include <system.h>
Public Member Functions | |
virtual void | Init ()=0 |
Performs platform-specific initialization. More... | |
virtual SystemDialogResult | SystemDialog (SystemDialogType, const std::string &title, const std::string &message)=0 |
Displays a system dialog. More... | |
TEST_VIRTUAL SystemDialogResult | ConsoleSystemDialog (SystemDialogType type, const std::string &title, const std::string &message) |
Displays a fallback system dialog using console. More... | |
TEST_VIRTUAL SystemTimeStamp * | CreateTimeStamp () |
Creates a new time stamp object. More... | |
TEST_VIRTUAL void | DestroyTimeStamp (SystemTimeStamp *stamp) |
Destroys a time stamp object. More... | |
TEST_VIRTUAL void | CopyTimeStamp (SystemTimeStamp *dst, SystemTimeStamp *src) |
Copies the time stamp from src to dst. More... | |
virtual void | GetCurrentTimeStamp (SystemTimeStamp *stamp)=0 |
Returns a time stamp associated with current time. More... | |
TEST_VIRTUAL float | TimeStampDiff (SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit=STU_SEC) |
Returns a difference between two timestamps in given time unit. More... | |
virtual long long | TimeStampExactDiff (SystemTimeStamp *before, SystemTimeStamp *after)=0 |
Returns the exact (in nanosecond units) difference between two timestamps. More... | |
virtual std::string | GetDataPath () |
Returns the data path (containing textures, levels, helpfiles, etc) More... | |
virtual std::string | GetLangPath () |
Returns the translations path. More... | |
virtual std::string | GetSaveDir () |
Returns the save dir location. More... | |
virtual void | Usleep (int usecs)=0 |
Sleep for given amount of microseconds. More... | |
Static Public Member Functions | |
static std::unique_ptr< CSystemUtils > | Create () |
Creates system utils for specific platform. More... | |
Platform-specific utils.
This class provides system-specific utilities like displaying user dialogs and querying system timers for exact timestamps.
|
static |
Creates system utils for specific platform.
|
pure virtual |
Performs platform-specific initialization.
Implemented in CSystemUtilsOther, CSystemUtilsLinux, CSystemUtilsWindows, and CSystemUtilsMacOSX.
|
pure virtual |
Displays a system dialog.
Implemented in CSystemUtilsOther, CSystemUtilsLinux, and CSystemUtilsWindows.
SystemDialogResult CSystemUtils::ConsoleSystemDialog | ( | SystemDialogType | type, |
const std::string & | title, | ||
const std::string & | message | ||
) |
Displays a fallback system dialog using console.
SystemTimeStamp * CSystemUtils::CreateTimeStamp | ( | ) |
Creates a new time stamp object.
void CSystemUtils::DestroyTimeStamp | ( | SystemTimeStamp * | stamp | ) |
Destroys a time stamp object.
void CSystemUtils::CopyTimeStamp | ( | SystemTimeStamp * | dst, |
SystemTimeStamp * | src | ||
) |
Copies the time stamp from src to dst.
|
pure virtual |
Returns a time stamp associated with current time.
Implemented in CSystemUtilsOther, CSystemUtilsLinux, and CSystemUtilsWindows.
float CSystemUtils::TimeStampDiff | ( | SystemTimeStamp * | before, |
SystemTimeStamp * | after, | ||
SystemTimeUnit | unit = STU_SEC |
||
) |
Returns a difference between two timestamps in given time unit.
The difference is after - before.
|
pure virtual |
Returns the exact (in nanosecond units) difference between two timestamps.
The difference is after - before.
Implemented in CSystemUtilsOther, CSystemUtilsLinux, and CSystemUtilsWindows.
|
virtual |
Returns the data path (containing textures, levels, helpfiles, etc)
Reimplemented in CSystemUtilsMacOSX.
|
virtual |
Returns the translations path.
Reimplemented in CSystemUtilsMacOSX.
|
virtual |
Returns the save dir location.
Reimplemented in CSystemUtilsLinux, CSystemUtilsWindows, and CSystemUtilsMacOSX.
|
pure virtual |
Sleep for given amount of microseconds.
Implemented in CSystemUtilsOther, CSystemUtilsLinux, CSystemUtilsWindows, and CSystemUtilsMacOSX.