FUFileManager Class Reference

Handles most file system related operations. More...

#include <FUFileManager.h>

List of all members.

Public Member Functions

 FUFileManager ()
 Constructor.
 ~FUFileManager ()
 Destructor.
const FUUriGetCurrentUri () const
 Retrieves the current file path.
void PushRootPath (const fstring &path)
 Sets a new current file path.
void PushRootFile (const fstring &filename)
 Sets a new current file path using a document filename.
void PopRootPath ()
 Removes the current file path from the stack.
void PopRootFile ()
 See above.
FUFileOpenFile (const fstring &filename, bool write=false, SchemeOnCompleteCallback *onComplete=NULL, size_t userData=0)
 Opens a file.
bool FileExists (const fstring &filename)
 Determines whether a file exists or not.
void SetForceAbsoluteFlag (bool _forceAbsolute)
 Sets an internal flag that will force all returned file paths and URIs to be absolute, rather than relative to the current file path.
fstring CleanUri (const FUUri &uri)
 Prepares a URI for export.
void SetSchemeCallbacks (FUUri::Scheme scheme, SchemeCallbacks *callbacks)
 Sets the callbacks overriding the actions of a specified scheme.
void RemoveSchemeCallbacks (FUUri::Scheme scheme)
 Removes the callbacks that override actions of a specified scheme.
void RemoveAllSchemeCallbacks ()
 Removes all the scheme callbacks registered on this file manager.
void CloneSchemeCallbacks (const FUFileManager *srcFileManager)
 [INTERNAL] Clone the scheme callbacks off the passed in file manager

Static Public Member Functions

static bool MakeDirectory (const fstring &directory)
 Makes the directory.
static fstring StripFileFromPath (const fstring &filename)
 Strips the filename from the full file path.
static fstring GetFileExtension (const fstring &filename)
 Retrieves the extension of a filename.
static fstring ExtractNetworkHostname (fstring &filename)
 Extracts the network hostname for a URI and returns it.
static fstring GetApplicationFolderName ()
 Retrieves the absolute folder name where the application resides.
static fstring GetModuleFolderName ()
 Retrieves the absolute folder name where the FCollada library resides.
static void GetFolderFromPath (const fstring &folder, fstring &path)
 Retrieves the folder name from a full path name.


Detailed Description

Handles most file system related operations.

Is useful mostly for platform-abstraction and to handle the relative paths within COLLADA documents.


Constructor & Destructor Documentation

FUFileManager::FUFileManager  ) 
 

Constructor.

When creating a new file manager, the file system's current file path is retrieved and placed on the file path stack.


Member Function Documentation

fstring FUFileManager::CleanUri const FUUri uri  ) 
 

Prepares a URI for export.

Parameters:
uri A file URI.
Returns:
The patched URI string.

void FUFileManager::CloneSchemeCallbacks const FUFileManager srcFileManager  ) 
 

[INTERNAL] Clone the scheme callbacks off the passed in file manager

Parameters:
srcFileManager The File manager to clone our schemes off

static fstring FUFileManager::ExtractNetworkHostname fstring filename  )  [static]
 

Extracts the network hostname for a URI and returns it.

Parameters:
filename A file URI.
Returns:
The network hostname.

bool FUFileManager::FileExists const fstring filename  ) 
 

Determines whether a file exists or not.

Parameters:
filename A file path.
Returns:
True if the file exists, false otherwise.

static fstring FUFileManager::GetApplicationFolderName  )  [static]
 

Retrieves the absolute folder name where the application resides.

Returns:
The absolute folder name of the application.

const FUUri& FUFileManager::GetCurrentUri  )  const [inline]
 

Retrieves the current file path.

This is the file path used when creating all relative paths.

Returns:
The current file path.

static fstring FUFileManager::GetFileExtension const fstring filename  )  [static]
 

Retrieves the extension of a filename.

Parameters:
filename A filename, may include a file path.
Returns:
The extension of the filename.

static void FUFileManager::GetFolderFromPath const fstring folder,
fstring path
[static]
 

Retrieves the folder name from a full path name.

For example, C:/dirname/file.ext will return C:/dirname

Parameters:
folder The folder name.
path The path name will be returned to this parameter.

static fstring FUFileManager::GetModuleFolderName  )  [static]
 

Retrieves the absolute folder name where the FCollada library resides.

Returns:
The absolute folder name of the FCollada library.

static bool FUFileManager::MakeDirectory const fstring directory  )  [static]
 

Makes the directory.

Currently, the directory must be one level from a directory that exists

Parameters:
directory The path to the directory.
Returns:
True if the directory exists after this call, whether it was created here or not. False if the directory does not exist.

FUFile* FUFileManager::OpenFile const fstring filename,
bool  write = false,
SchemeOnCompleteCallback onComplete = NULL,
size_t  userData = 0
 

Opens a file.

See also:
FUFile.
Parameters:
filename A file path with a filename.
write Whether to open the file for writing as opposed to opening the file for reading.
Returns:
The file handle.

void FUFileManager::PushRootFile const fstring filename  ) 
 

Sets a new current file path using a document filename.

Files paths are placed on a stack in order to easily return to previous file paths.

Parameters:
filename A document filename.

void FUFileManager::PushRootPath const fstring path  ) 
 

Sets a new current file path.

Files paths are placed on a stack in order to easily return to previous file paths.

Parameters:
path The new file path.

void FUFileManager::RemoveSchemeCallbacks FUUri::Scheme  scheme  ) 
 

Removes the callbacks that override actions of a specified scheme.

Parameters:
scheme The scheme to remove the callback.
Returns:
The callback, if any, that was associated to this scheme.

void FUFileManager::SetForceAbsoluteFlag bool  _forceAbsolute  )  [inline]
 

Sets an internal flag that will force all returned file paths and URIs to be absolute, rather than relative to the current file path.

Parameters:
_forceAbsolute Whether all file paths should be absolute.

void FUFileManager::SetSchemeCallbacks FUUri::Scheme  scheme,
SchemeCallbacks callbacks
 

Sets the callbacks overriding the actions of a specified scheme.

The provided callbacks are owned by the FUFileManager, and thus deleted if modified or released.

See also:
NewSchemeCallbacks.
Parameters:
scheme The scheme to override.
callbacks The callbacks structure.

static fstring FUFileManager::StripFileFromPath const fstring filename  )  [static]
 

Strips the filename from the full file path.

Parameters:
filename The full file path, including the filename.
Returns:
The file path without the filename.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:40 2008 for FCollada by  doxygen 1.4.6-NO