Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Static Public Member Functions | List of all members
CSystemUtils Class Reference

Platform-specific utils. More...

#include <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 SystemTimeStampCreateTimeStamp ()
 Creates a new time stamp object.
TEST_VIRTUAL void DestroyTimeStamp (SystemTimeStamp *stamp)
 Destroys a time stamp object.
TEST_VIRTUAL void CopyTimeStamp (SystemTimeStamp *dst, SystemTimeStamp *src)
 Copies the time stamp from src to dst.
virtual void GetCurrentTimeStamp (SystemTimeStamp *stamp)=0
 Returns a time stamp associated with current time.
TEST_VIRTUAL float GetTimeStampResolution (SystemTimeUnit unit=STU_SEC)
 Returns the platform's expected time stamp resolution.
virtual long long GetTimeStampExactResolution ()=0
 Returns the platform's exact (in nanosecond units) expected time stamp resolution.
TEST_VIRTUAL float TimeStampDiff (SystemTimeStamp *before, SystemTimeStamp *after, SystemTimeUnit unit=STU_SEC)
 Returns a difference between two timestamps in given time unit.
virtual long long TimeStampExactDiff (SystemTimeStamp *before, SystemTimeStamp *after)=0
 Returns the exact (in nanosecond units) difference between two timestamps.
virtual std::string GetDataPath ()
 Returns the data path (containing textures, levels, helpfiles, etc)
virtual std::string GetLangPath ()
 Returns the translations path.
virtual std::string GetProfileFileLocation ()
 Returns the profile (colobot.ini) file location.
virtual std::string GetSavegameDirectoryLocation ()
 Returns the savegame directory location.

Static Public Member Functions

static CSystemUtilsCreate ()
 Creates system utils for specific platform.
- Static Public Member Functions inherited from CSingleton< CSystemUtils >
static CSystemUtilsGetInstance ()
static CSystemUtilsGetInstancePointer ()
static bool IsCreated ()

Additional Inherited Members

- Static Protected Attributes inherited from CSingleton< CSystemUtils >
static CSystemUtilsm_instance = nullptr

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

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.

virtual long long CSystemUtils::TimeStampExactDiff ( SystemTimeStamp before,
SystemTimeStamp after 
)
pure virtual

Returns the exact (in nanosecond units) difference between two timestamps.

The difference is after - before.

Implemented in CSystemUtilsOther, CSystemUtilsLinux, and CSystemUtilsWindows.


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