CrystalSpace

Public API Reference

CS::Utility Namespace Reference

Assorted utility functions and classes that doesn't belong anywhere else. More...


Classes

class  ImportKit
 Crystal Space Import Kit. More...
class  PriorityQueue
 An implementation of a priority queue. More...
class  ScopedDelete
 Helper class to delete a pointer when exiting a scope. More...
class  WeakReferenced
 This is a class which provides basic weak reference-counting semantics. More...

Namespaces

namespace  BitOps
 Bit operations.
namespace  Implementation

Functions

csPtr< iFileSmartFileOpen (iVFS *vfs, const char *path, const char *defaultFilename=0, const char **actualFilename=0)
 "Smartly" try to locate a file given a path that could be: a plain file name, directory, name of a level in /lev/, or .zip file.


Detailed Description

Assorted utility functions and classes that doesn't belong anywhere else.

Function Documentation

csPtr<iFile> CS::Utility::SmartFileOpen ( iVFS vfs,
const char *  path,
const char *  defaultFilename = 0,
const char **  actualFilename = 0 
)

"Smartly" try to locate a file given a path that could be: a plain file name, directory, name of a level in /lev/, or .zip file.

Try to open a file given a path that could be any of a VFS path, a plain file name or directory in the real file system, name of a level in /lev/, or .zip file.

This is for example useful for tool applications which want to let the user specify paths and file locations in a variety of ways.

Parameters:
vfs The VFS interface to use to open the file.
path The path that is attempted to be opened.
defaultFilename Default filename, used when the provided path is a directory or .zip file.
actualFilename Can return the actual filename opened. (Note: is either defaultFilename or a pointer into path.
Returns:
The file if opening succeeded.


Generated for Crystal Space 1.2.1 by doxygen 1.5.3