Ocean
Ocean::Platform::Apple::System Class Reference

This class implements system functions on Apple platforms. More...

Static Public Member Functions

static std::string environmentVariable (const std::string &variable, const bool removeQuotes=true)
 Returns a defined environment variable. More...
 
static bool setEnvironmentVariable (const std::string &variable, const std::string &value)
 Sets an environment variable. More...
 
static double version (unsigned int *major=nullptr, unsigned int *minor=nullptr)
 Returns the current Apple-platform version. More...
 
static bool isMinimalVersion (const unsigned int minimalMajor, const unsigned int minimalMinor)
 Returns whether the current Apple-platform version is equal or larger than a specified (minimal required version number). More...
 
static std::string homeDirectory ()
 Returns the path of the home directory of the calling process. More...
 
static void runMainLoop (const double interval)
 Explicitly runs the main loop for a specified time interval. More...
 
static bool isBundleApp ()
 Returns whether the process ia a bundle-based app or a command line app. More...
 

Detailed Description

This class implements system functions on Apple platforms.

Member Function Documentation

◆ environmentVariable()

static std::string Ocean::Platform::Apple::System::environmentVariable ( const std::string &  variable,
const bool  removeQuotes = true 
)
static

Returns a defined environment variable.

Parameters
variableEnvironment variable to return, must be valid
removeQuotesDetermines whether all beginning and ending quotes are removed from the environment variable, if existent
Returns
Specified environment variable

◆ homeDirectory()

static std::string Ocean::Platform::Apple::System::homeDirectory ( )
static

Returns the path of the home directory of the calling process.

The home directory can be the application's sandbox directory or the current user's home directory (depending on the application and platform).

Returns
The path of the home directory

◆ isBundleApp()

static bool Ocean::Platform::Apple::System::isBundleApp ( )
static

Returns whether the process ia a bundle-based app or a command line app.

Returns
True, if the app is a bundle-based app

◆ isMinimalVersion()

static bool Ocean::Platform::Apple::System::isMinimalVersion ( const unsigned int  minimalMajor,
const unsigned int  minimalMinor 
)
static

Returns whether the current Apple-platform version is equal or larger than a specified (minimal required version number).

Parameters
minimalMajorThe minimal major version number the current Apple-platform must have, with range [10, infinity)
minimalMinorTHe minimal minor version number the current Apple-platform must have, with range [0, infinity)
Returns
True, if succeeded

◆ runMainLoop()

static void Ocean::Platform::Apple::System::runMainLoop ( const double  interval)
static

Explicitly runs the main loop for a specified time interval.

This function can be used to force event handling which is done in the main loop e.g., in a console application in macOS.

Parameters
intervalThe time interval the main loop will be executed, in seconds, with range (0, infinity)

◆ setEnvironmentVariable()

static bool Ocean::Platform::Apple::System::setEnvironmentVariable ( const std::string &  variable,
const std::string &  value 
)
static

Sets an environment variable.

Parameters
variableEnvironment variable to set, must be valid
valueThe new value of the specified variable, an empty value remove the environment variable
Returns
True, if succeeded

◆ version()

static double Ocean::Platform::Apple::System::version ( unsigned int *  major = nullptr,
unsigned int *  minor = nullptr 
)
static

Returns the current Apple-platform version.

Parameters
majorOptional resulting major version number
minorOptional resulting minor version number
Returns
The Apple-platform version determined by major + minor / 100

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