CrystalSpace

Public API Reference

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 231 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.

Referenced by csExpandPath().

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.

Referenced by csPathsIdentical().


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.4.7