## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csInstallationPathsHelper Class Reference
[Utilities]

A helper class containing a number of functions to deal with Crystal Space installation paths. More...

`#include <csutil/syspath.h>`

List of all members.

## Static Public Member Functions

static csRef< iStringArray > | FindSystemRoots ()
| Get the list of root directories.
static csString | GetAppDir (const char *argv0)
| Return the directory in which the application executable resides.
static csString | GetAppFilename (const char *basename)
| Constructs an executable filename given a basename.
static csString | GetAppPath (const char *argv0)
| Return the absolute path of the executable.
static csPathsList * | GetPlatformInstallationPaths ()
| Return one or more paths which themselves or whose subdirectories can contain CrystalSpace-related resources, plugins as well as common data and configuration.
static csPathsList * | GetPluginPaths (const char *argv0)
| Get a list of directories where plugins are installed.
static csString | GetResourceDir (const char *argv0)
| Return the directory in which the application's resources reside.

## Detailed Description

A helper class containing a number of functions to deal with Crystal Space installation paths.

Definition at line 265 of file syspath.h.

## Member Function Documentation

static csRef<iStringArray> csInstallationPathsHelper::FindSystemRoots | ( |  | ) | `[static]`

| Get the list of root directories. For instance in Unix it simply returns '/' but for Windows it may return a list of available drive letters. Referenced by csFindSystemRoots().

static csString csInstallationPathsHelper::GetAppDir | ( | const char * | argv0 | ) | `[static]`

Return the directory in which the application executable resides.

For MacOS/X, returns the directory in which the Cocoa application wrapper resides.

Remarks:
  May return the empty string if some problem prevents determination of the application's directory.

  This function is primarily intended for very low-level use before or during the initialization of CS core components. After initialization, it is often more convenient to invoke iCommandLineParser::GetAppDir().

Parameters:

  | argv0 | The first element of the argv[] array passed to main(). On many platforms, this is the only way to determine the actual location of the executable.

Referenced by csGetAppDir().

static csString csInstallationPathsHelper::GetAppFilename | ( | const char * | basename | ) | `[static]`

| Constructs an executable filename given a basename.

static csString csInstallationPathsHelper::GetAppPath | ( | const char * | argv0 | ) | `[static]`

Return the absolute path of the executable.

For MacOS/X, returns the absolute path of the executable within the Cocoa application wrapper.

Remarks:
  May return the empty string if some problem prevents determination of the application's path.

  This function is primarily intended for very low-level use before or during the initialization of CS core components. After initialization, it is often more convenient to invoke iCommandLineParser::GetAppPath().

Parameters:

  | argv0 | The first element of the argv[] array passed to main(). On many platforms, this is the only way to determine the actual location of the executable.

Referenced by csGetAppPath().

static csPathsList* csInstallationPathsHelper::GetPlatformInstallationPaths | ( |  | ) | `[static]`

Return one or more paths which themselves or whose subdirectories can contain CrystalSpace-related resources, plugins as well as common data and configuration.

There's no guarantee that any entry actually contains some useable resource; it's up to the caller to check what resources are available and to pick the appropriate entries for some purpose.

Remarks:
  Caller is responsible to free the list with delete after using it.

static csPathsList* csInstallationPathsHelper::GetPluginPaths | ( | const char * | argv0 | ) | `[static]`

Get a list of directories where plugins are installed.

Remarks:
  Caller is responsible to free the list with delete after using it.

static csString csInstallationPathsHelper::GetResourceDir | ( | const char * | argv0 | ) | `[static]`

Return the directory in which the application's resources reside.

On many platforms, resources (such as plugin modules) reside in the same directory as the application itself. The default implementation returns the same value as csGetAppPath(), however platforms may want to override the default implementation if this behavior is unsuitable. For example, on MacOS/X, for GUI applications, resources reside in the "Resources" directory within the Cocoa application wrapper.

Remarks:
  May return the empty string if some problem prevents determination of the resource path.

  This function is primarily intended for very low-level use before or during the initialization of CS core components. After initialization, it is often more convenient to invoke iCommandLineParser::GetResourceDir().

Parameters:

  | argv0 | The first element of the argv[] array passed to main(). On many platforms, this is the only way to determine the actual location of the resources.

Referenced by csGetResourceDir().

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

- csutil/syspath.h