CL_VirtualFileSystem Class Reference
[clanCore I/O Data]

Virtual File System (VFS). More...

#include <virtual_file_system.h>

List of all members.

Implementation

class CL_VirtualDirectory_Impl

Public Member Functions

Construction
 CL_VirtualFileSystem ()
 Constructs a file system.
 CL_VirtualFileSystem (CL_VirtualFileSource *provider)
 Constructs a VirtualFileSystem.
 CL_VirtualFileSystem (const CL_String &path, bool is_zip_file=false)
 Constructs a VirtualFileSystem.
 ~CL_VirtualFileSystem ()
Attributes
bool is_null () const
 Returns true if the file system is null.
CL_VirtualDirectory get_root_directory ()
 Returns the root directory for the file system.
bool is_mount (const CL_String &mount_point)
 Returns true if a path is a mount point.
CL_VirtualDirectoryListing get_directory_listing (const CL_String &path_rel)
 Return directory listing for path.
bool has_file (const CL_String &filename)
 Return true if the root of the filesystem contains the specified file.
bool has_directory (const CL_String &directory)
 Return true if the root of the filesystem contains the specified directory.
CL_VirtualFileSourceget_provider ()
 Returns the file source for this file system.
CL_String get_identifier () const
 Get the identifier of this file source.
Operations
CL_VirtualDirectory open_directory (const CL_String &path)
 Opens a virtual directory.
CL_IODevice open_file (const CL_String &filename, CL_File::OpenMode mode=CL_File::open_existing, unsigned int access=CL_File::access_read|CL_File::access_write, unsigned int share=CL_File::share_all, unsigned int flags=0) const
 Opens a file.
void mount (const CL_String &mount_point, CL_VirtualFileSystem fs)
 Mounts a file system at mount point.
void mount (const CL_String &mount_point, const CL_String &path, bool is_zip_file)
 Mounts a file system at mount point.
void unmount (const CL_String &mount_point)
 Unmount a file system.

Classes

class  CL_NullVFS


Detailed Description

Virtual File System (VFS).


Constructor & Destructor Documentation

CL_VirtualFileSystem::CL_VirtualFileSystem  ) 
 

Constructs a file system.

CL_VirtualFileSystem::CL_VirtualFileSystem CL_VirtualFileSource provider  ) 
 

Constructs a VirtualFileSystem.

Parameters:
provider = Virtual File Source

CL_VirtualFileSystem::CL_VirtualFileSystem const CL_String path,
bool  is_zip_file = false
 

Constructs a VirtualFileSystem.

Parameters:
path = String
is_zip_file = bool

CL_VirtualFileSystem::~CL_VirtualFileSystem  ) 
 


Member Function Documentation

CL_VirtualDirectoryListing CL_VirtualFileSystem::get_directory_listing const CL_String path_rel  ) 
 

Return directory listing for path.

CL_String CL_VirtualFileSystem::get_identifier  )  const
 

Get the identifier of this file source.

The exact format of this identifier depends on the implementation of the underlying filesystem and mounts

Returns:
the identifier

CL_VirtualFileSource* CL_VirtualFileSystem::get_provider  ) 
 

Returns the file source for this file system.

CL_VirtualDirectory CL_VirtualFileSystem::get_root_directory  ) 
 

Returns the root directory for the file system.

bool CL_VirtualFileSystem::has_directory const CL_String directory  ) 
 

Return true if the root of the filesystem contains the specified directory.

bool CL_VirtualFileSystem::has_file const CL_String filename  ) 
 

Return true if the root of the filesystem contains the specified file.

bool CL_VirtualFileSystem::is_mount const CL_String mount_point  ) 
 

Returns true if a path is a mount point.

bool CL_VirtualFileSystem::is_null  )  const [inline]
 

Returns true if the file system is null.

void CL_VirtualFileSystem::mount const CL_String mount_point,
const CL_String path,
bool  is_zip_file
 

Mounts a file system at mount point.

Filenames starting with "mount_point" at the start will be replaced by the path specified by "path" (ie the the base_path is ignored) param: mount_point = Mount alias name to use param: path = Path which "mount_point" should point to param: is_zip_file = false, create as a CL_VirtualFileSource_File, else create as a CL_VirtualFileSource_Zip

void CL_VirtualFileSystem::mount const CL_String mount_point,
CL_VirtualFileSystem  fs
 

Mounts a file system at mount point.

This is only available if CL_VirtualFileSystem was set Filenames starting with "mount_point" at the start will be replaced by the filesystem specified by "fs" (ie the the base_path is ignored) For example: CL_VirtualFileSystem new_vfs(new MyFileSource(cl_text("Hello"))); vfs.mount(cl_text("ABC"), new_vfs); param: mount_point = Mount alias name to use param: fs = Filesystem to use

CL_VirtualDirectory CL_VirtualFileSystem::open_directory const CL_String path  ) 
 

Opens a virtual directory.

CL_IODevice CL_VirtualFileSystem::open_file const CL_String filename,
CL_File::OpenMode  mode = CL_File::open_existing,
unsigned int  access = CL_File::access_read|CL_File::access_write,
unsigned int  share = CL_File::share_all,
unsigned int  flags = 0
const
 

Opens a file.

param: mode = CL_File::OpenMode modes param: access = CL_File::AccessFlags flags param: share = CL_File::ShareFlags flags param: flags = CL_File::Flags flags

Returns:
The CL_IODevice

void CL_VirtualFileSystem::unmount const CL_String mount_point  ) 
 

Unmount a file system.

param: mount_point = The mount point to unmount


Friends And Related Function Documentation

friend class CL_VirtualDirectory_Impl [friend]
 


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:43 2009 for ClanLib by  doxygen 1.4.6