csPathsUtilities Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions
csPathsUtilities Class Reference
Utilities

A helper class with path-related utilities. More...

`#include <csutil/syspath.h>`

List of all members.

## Static Public Member Functions
static csPathsList | ExpandAll (const csPathsList &paths)
| Expands all paths in a path list.
static char * | ExpandPath (const char *path)
| Expand a native path relative to the current directory.
static void | FilterInvalid (csPathsList &paths)
| Filter all non-existent items out of a paths list.
static csPathsList | LocateFile (const csPathsList &paths, const char *file, bool thorough=false)
| Determine which path(s) of a given set contains a given file.
static bool | PathsIdentical (const char *path1, const char *path2)
| Check whether two native paths actually point to the same location.

## Detailed Description

A helper class with path-related utilities.

Definition at line 215 of file syspath.h.

## Member Function Documentation

static csPathsList csPathsUtilities::ExpandAll | ( | const csPathsList & | paths | ) | `[static]`

Expands all paths in a path list.

static char* csPathsUtilities::ExpandPath | ( | const char * | path | ) | `[static]`

Expand a native path relative to the current directory.

Remarks:
  The specified path must refer to a directory, rather than a file.
  Caller is responsible to free the returned string with delete[] after using it.

static void csPathsUtilities::FilterInvalid | ( | csPathsList & | paths | ) | `[static]`

Filter all non-existent items out of a paths list.

static csPathsList csPathsUtilities::LocateFile | ( | const csPathsList & | paths,
|  | const char * | file,
|  | bool | thorough = `false`
| ) |  | `[static]`

Determine which path(s) of a given set contains a given file.

Parameters:

  paths | List of (native) paths to check.
  file | Filename to search.
  thorough | Whether all paths should be checked. If `false`, at most only a single path, the first containing the file, is returned.

static bool csPathsUtilities::PathsIdentical | ( | const char * | path1,
|  | const char * | path2
| ) |  | `[static]`

Check whether two native paths actually point to the same location.

Use this instead of strcmp() or the like, as it may not suffice in all cases (e.g. on Windows paths names are case-insensitive, but on Unix they aren't).

Remarks:
  Expects the paths to be fully qualified. Use csExpandPath() to ensure this.

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

- csutil/syspath.h