Loading...
Searching...
No Matches
Encapsulates all platform specific calls of the API.
More...
#include <gamsplatform.h>
|
static std::string | findGams (LogId logId=0) |
|
static void | ensureEnvPathContains (const char *dirName) |
|
static bool | interrupt (long pid) |
|
static int | runProcess (const std::string where, const std::string what, const std::string args, std::string &output) |
|
static std::thread | runProcessParallel (const std::string executable, const std::string args) |
|
Encapsulates all platform specific calls of the API.
Definition at line 44 of file gamsplatform.h.
◆ ensureEnvPathContains()
static void gams::GAMSPlatform::ensureEnvPathContains |
( |
const char * |
dirName | ) |
|
|
static |
Ensures that the directory name is contained in the environment path.
- Parameters
-
◆ findGams()
static std::string gams::GAMSPlatform::findGams |
( |
LogId |
logId = 0 | ) |
|
|
static |
find GAMS system directory from related environment.
- on windows : first search "PATH" if not found then search windows registry "gams.location",
- on Unix : first search "PATH" if not found then "LD_LIBRARAY_PATH".
- on Mac : first use Unix search strategy if not found then "DYLD_LIBRARAY_PATH", After two attempts of search and GAMS directory is still not found, returns null String.
- Returns
- GAMS directory if found, null otherwise.
◆ interrupt()
static bool gams::GAMSPlatform::interrupt |
( |
long |
pid | ) |
|
|
static |
Interrupt GAMS during processing.
- Parameters
-
- Returns
- Returns
true
if the interrupt was called successfully; otherwise false
.
◆ runProcess()
static int gams::GAMSPlatform::runProcess |
( |
const std::string |
where, |
|
|
const std::string |
what, |
|
|
const std::string |
args, |
|
|
std::string & |
output |
|
) |
| |
|
static |
Runs a process in a specified location.
- Parameters
-
where | Directory of execution. |
what | Name of process to run. |
args | Process arguments. |
output | Process output as string. |
- Returns
- Exit code.
◆ runProcessParallel()
static std::thread gams::GAMSPlatform::runProcessParallel |
( |
const std::string |
executable, |
|
|
const std::string |
args |
|
) |
| |
|
static |
Runs a process without waiting for it to end. Returns std::thread of started process.
- Parameters
-
executable | Filepath of process to run. |
args | Process arguments. |
- Returns
- thread