Colobot
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
CSystemUtils Class Referenceabstract

Platform-specific utils. More...

#include <src/common/system/system.h>

Inheritance diagram for CSystemUtils:
Inheritance graph
[legend]

Public Member Functions

virtual void Init ()=0
 Performs platform-specific initialization.
 
virtual SystemDialogResult SystemDialog (SystemDialogType, const std::string &title, const std::string &message)=0
 Displays a system dialog.
 
TEST_VIRTUAL SystemDialogResult ConsoleSystemDialog (SystemDialogType type, const std::string &title, const std::string &message)
 Displays a fallback system dialog using console.
 
TEST_VIRTUAL TimeUtils::TimeStamp GetCurrentTimeStamp ()
 Returns a time stamp associated with current time.
 
virtual std::string GetBasePath ()
 Returns the path where the executable binary is located (ends with the path separator)
 
virtual std::string GetDataPath ()
 Returns the data path (containing textures, levels, helpfiles, etc)
 
virtual std::string GetLangPath ()
 Returns the translations path.
 
virtual std::string GetSaveDir ()
 Returns the save dir location.
 
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.
 
virtual bool OpenPath (const std::string &path)
 Opens a path with default file browser.
 
virtual bool OpenWebsite (const std::string &url)
 Opens a website with default web browser.
 
void Usleep (int usecs)
 Sleep for given amount of microseconds.
 

Static Public Member Functions

static std::unique_ptr< CSystemUtilsCreate ()
 Creates system utils for specific platform.
 

Detailed Description

Platform-specific utils.

This class provides system-specific utilities like displaying user dialogs and querying system timers for exact timestamps.

Member Function Documentation

◆ Create()

std::unique_ptr< CSystemUtils > CSystemUtils::Create ( )
static

Creates system utils for specific platform.

◆ Init()

virtual void CSystemUtils::Init ( )
pure virtual

Performs platform-specific initialization.

Implemented in CSystemUtilsLinux, CSystemUtilsMacOSX, CSystemUtilsOther, and CSystemUtilsWindows.

◆ SystemDialog()

virtual SystemDialogResult CSystemUtils::SystemDialog ( SystemDialogType  ,
const std::string &  title,
const std::string &  message 
)
pure virtual

Displays a system dialog.

Implemented in CSystemUtilsLinux, CSystemUtilsOther, and CSystemUtilsWindows.

◆ ConsoleSystemDialog()

SystemDialogResult CSystemUtils::ConsoleSystemDialog ( SystemDialogType  type,
const std::string &  title,
const std::string &  message 
)

Displays a fallback system dialog using console.

◆ GetCurrentTimeStamp()

TimeUtils::TimeStamp CSystemUtils::GetCurrentTimeStamp ( )

Returns a time stamp associated with current time.

◆ GetBasePath()

std::string CSystemUtils::GetBasePath ( )
virtual

Returns the path where the executable binary is located (ends with the path separator)

◆ GetDataPath()

std::string CSystemUtils::GetDataPath ( )
virtual

Returns the data path (containing textures, levels, helpfiles, etc)

Reimplemented in CSystemUtilsMacOSX.

◆ GetLangPath()

std::string CSystemUtils::GetLangPath ( )
virtual

Returns the translations path.

Reimplemented in CSystemUtilsMacOSX.

◆ GetSaveDir()

std::string CSystemUtils::GetSaveDir ( )
virtual

Returns the save dir location.

Reimplemented in CSystemUtilsLinux, CSystemUtilsMacOSX, and CSystemUtilsWindows.

◆ GetEnvVar()

std::string CSystemUtils::GetEnvVar ( const std::string &  name)
virtual

Returns the environment variable with the given name or an empty string if it does not exist.

Reimplemented in CSystemUtilsLinux, CSystemUtilsMacOSX, and CSystemUtilsWindows.

◆ OpenPath()

bool CSystemUtils::OpenPath ( const std::string &  path)
virtual

Opens a path with default file browser.

Returns
true if successful

Reimplemented in CSystemUtilsLinux, CSystemUtilsMacOSX, and CSystemUtilsWindows.

◆ OpenWebsite()

bool CSystemUtils::OpenWebsite ( const std::string &  url)
virtual

Opens a website with default web browser.

Returns
true if successful

Reimplemented in CSystemUtilsLinux, CSystemUtilsMacOSX, and CSystemUtilsWindows.

◆ Usleep()

void CSystemUtils::Usleep ( int  usecs)

Sleep for given amount of microseconds.


The documentation for this class was generated from the following files: