## class System

> Encapsulates some O.S. specific functions.

### Public Fields

  static const char | TOOLKIT_HOME_DEFAULT [] default toolkit home directory.
  static const char | TOOLKIT_STAT_HEADER [] Statistics message subject for logging.
  static const char | TOOLKIT_BUG_HEADER [] Bug report message subject.
  static const char | TOOLKIT_HOME_VAR_NAME [] Variable name that contains the tool home directory.
  static const char* | STD_SEARCH_DIRS [] most common Unix directories for system wide available binaries.
  static bool | sendBugEmail send an email after crash
  static char | emailAddress [] email address to send to.
  static char | currentProgram [] the command name of the current program (argv[0]).

### Public Methods

  static void | SetSignalHandler () set unix signal handler.
  static bool | GetHostName (char* host) copies into host the hostname of the machine.
  static bool | GetHostName (string* host)
  static bool | GetLoginName (char* login) copies into login the loginname of the user.
  static bool | GetLoginName (string* login)
  static bool | GetTime (char* time) copies in time the current machine time as a string.
  static bool | GetTime (string* time)
  static unsigned long | GenerateId (unsigned long) returns a random number based on the time and the given number.
  static bool | GetPrinter (char* printer) copies into printer the PRINTER environment variable.
  static bool | GetPrinter (string* printer)
  static bool | GetCwd (char* dir) retrieve current working directory.
  static bool | GetCwd (string* dir)
  static bool | GetHome (char* home) retrieve home directory.
  static bool | GetHome (string* home)
  static void | GetToolkitHome (char* home) copies in home the tool home directory variable.
  static void | GetToolkitHome (string* home)
  static void | GiveFile (const char* path, char* dir, char* file) copies in dir and file the directory and file in the name 'path'.
  static void | GiveFile (const string* path, string* dir, string* file)
  static void | GiveFile (const char* path, char* file) copies in file the file in the name 'path'.
  static void | GiveFile (const string* path, string* file)
  static bool | FileRegular (const char* file) returns if file is regular (not directory, named pipe etc).
  static bool | FileExists (const char* file) returns whether file exists
  static bool | FileExecutable (const char* file) returns whether executable file exists
  static bool | DirExists (const char* dir) returns whether directory exists
  static bool | FindProgram (char* program, const char* command) returns if there is command in a std dir, program becomes the path.
  static bool | FindProgram (string* program, const char* command)
  static bool | NxnParse (const char* desc, int &num1, int &num2) return true if desc is a 'num1'x'num2' string.
  static bool | FindArg (char** argv, int argc, const char* arg, int &index) return if argv contains arg. Index will be the position in argv.
  static void | SendEmail (const char* recipient, const char* subject, const char* program, const char* version, const char* text) send an email message (for instance for stats or bug reports).

### Protected Methods

  static void | SignalHandler (int s) called when signal occurs.

## Documentation

> Encapsulates some O.S. specific functions.

`static void SetSignalHandler()`
  set unix signal handler.

`static bool GetHostName(char* host)`
  copies into host the hostname of the machine.

`static bool GetHostName(string* host)`

`static bool GetLoginName(char* login)`
  copies into login the loginname of the user.

`static bool GetLoginName(string* login)`

`static bool GetTime(char* time)`
  copies in time the current machine time as a string.

`static bool GetTime(string* time)`

`static unsigned long GenerateId(unsigned long)`
  returns a random number based on the time and the given number.

`static bool GetPrinter(char* printer)`
  copies into printer the PRINTER environment variable.

`static bool GetPrinter(string* printer)`

`static bool GetCwd(char* dir)`
  retrieve current working directory.

`static bool GetCwd(string* dir)`

`static bool GetHome(char* home)`
  retrieve home directory.

`static bool GetHome(string* home)`

`static void GetToolkitHome(char* home)`
  copies in home the tool home directory variable.

`static void GetToolkitHome(string* home)`

`static void GiveFile(const char* path, char* dir, char* file)`
  copies in dir and file the directory and file in the name 'path'.

`static void GiveFile(const string* path, string* dir, string* file)`

`static void GiveFile(const char* path, char* file)`
  copies in file the file in the name 'path'.

`static void GiveFile(const string* path, string* file)`

`static bool FileRegular(const char* file)`
  returns if file is regular (not directory, named pipe etc).

`static bool FileExists(const char* file)`
  returns whether file exists

`static bool FileExecutable(const char* file)`
  returns whether executable file exists

`static bool DirExists(const char* dir)`
  returns whether directory exists

`static bool FindProgram(char* program, const char* command)`
  returns if there is command in a std dir, program becomes the path.

`static bool FindProgram(string* program, const char* command)`

`static bool NxnParse(const char* desc, int &num1, int &num2)`
  return true if desc is a 'num1'x'num2' string.

`static bool FindArg(char** argv, int argc, const char* arg, int &index)`
  return if argv contains arg. Index will be the position in argv.

`static void SendEmail(const char* recipient, const char* subject, const char* program, const char* version, const char* text)`
  send an email message (for instance for stats or bug reports).

`static const char TOOLKIT_HOME_DEFAULT[]`
  default toolkit home directory.

`static const char TOOLKIT_STAT_HEADER[]`
  Statistics message subject for logging.

`static const char TOOLKIT_BUG_HEADER[]`
  Bug report message subject.

`static const char TOOLKIT_HOME_VAR_NAME[]`
  Variable name that contains the tool home directory.

`static const char* STD_SEARCH_DIRS[]`
  most common Unix directories for system wide available binaries.

`static bool sendBugEmail`
  send an email after crash

`static char emailAddress[]`
  email address to send to.

`static char currentProgram[]`
  the command name of the current program (argv[0]).

`static void SignalHandler(int s)`
  called when signal occurs.

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de