Colobot
|
Platform-specific utils. More...
#include <src/common/system/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 TimeUtils::TimeStamp | GetCurrentTimeStamp () |
Returns a time stamp associated with current time. More... | |
virtual std::string | GetBasePath () |
Returns the path where the executable binary is located (ends with the path separator) 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 std::string | GetEnvVar (const std::string &name) |
Returns the environment variable with the given name or an empty string if it does not exist. More... | |
virtual bool | OpenPath (const std::string &path) |
Opens a path with default file browser. More... | |
virtual bool | OpenWebsite (const std::string &url) |
Opens a website with default web browser. More... | |
void | Usleep (int usecs) |
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 CSystemUtilsLinux, CSystemUtilsMacOSX, CSystemUtilsOther, and CSystemUtilsWindows.
|
pure virtual |
Displays a system dialog.
Implemented in CSystemUtilsLinux, CSystemUtilsOther, and CSystemUtilsWindows.
SystemDialogResult CSystemUtils::ConsoleSystemDialog | ( | SystemDialogType | type, |
const std::string & | title, | ||
const std::string & | message | ||
) |
Displays a fallback system dialog using console.
TimeUtils::TimeStamp CSystemUtils::GetCurrentTimeStamp | ( | ) |
Returns a time stamp associated with current time.
|
virtual |
Returns the path where the executable binary is located (ends with the path separator)
|
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, CSystemUtilsMacOSX, and CSystemUtilsWindows.
|
virtual |
Returns the environment variable with the given name or an empty string if it does not exist.
Reimplemented in CSystemUtilsLinux, CSystemUtilsMacOSX, and CSystemUtilsWindows.
|
virtual |
Opens a path with default file browser.
Reimplemented in CSystemUtilsLinux, CSystemUtilsMacOSX, and CSystemUtilsWindows.
|
virtual |
Opens a website with default web browser.
Reimplemented in CSystemUtilsLinux, CSystemUtilsMacOSX, and CSystemUtilsWindows.
void CSystemUtils::Usleep | ( | int | usecs | ) |
Sleep for given amount of microseconds.