ClanLib
2.3.7
|
Virtual File System (VFS). More...
#include <virtual_file_system.h>
Public Member Functions | |
Construction | |
CL_VirtualFileSystem () | |
Constructs a file system. More... | |
CL_VirtualFileSystem (CL_VirtualFileSource *provider) | |
Constructs a VirtualFileSystem. More... | |
CL_VirtualFileSystem (const CL_String &path, bool is_zip_file=false) | |
Constructs a VirtualFileSystem. More... | |
~CL_VirtualFileSystem () | |
Attributes | |
bool | is_null () const |
Returns true if the file system is null. More... | |
CL_VirtualDirectory | get_root_directory () |
Returns the root directory for the file system. More... | |
bool | is_mount (const CL_String &mount_point) |
Returns true if a path is a mount point. More... | |
CL_VirtualDirectoryListing | get_directory_listing (const CL_String &path_rel) |
Return directory listing for path. More... | |
bool | has_file (const CL_String &filename) |
Return true if the root of the filesystem contains the specified file. More... | |
bool | has_directory (const CL_String &directory) |
Return true if the root of the filesystem contains the specified directory. More... | |
CL_VirtualFileSource * | get_provider () |
Returns the file source for this file system. More... | |
CL_String | get_path () const |
Returns a path to the file source for this file system. More... | |
CL_String | get_identifier () const |
Get the identifier of this file source. More... | |
Operations | |
CL_VirtualDirectory | open_directory (const CL_String &path) |
Opens a virtual directory. More... | |
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. More... | |
void | mount (const CL_String &mount_point, CL_VirtualFileSystem fs) |
Mounts a file system at mount point. More... | |
void | mount (const CL_String &mount_point, const CL_String &path, bool is_zip_file) |
Mounts a file system at mount point. More... | |
void | unmount (const CL_String &mount_point) |
Unmount a file system. More... | |
Implementation | |
class | CL_VirtualDirectory_Impl |
Virtual File System (VFS).
CL_VirtualFileSystem::CL_VirtualFileSystem | ( | ) |
Constructs a file system.
CL_VirtualFileSystem::CL_VirtualFileSystem | ( | CL_VirtualFileSource * | provider) |
Constructs a VirtualFileSystem.
provider | = Virtual File Source |
CL_VirtualFileSystem::CL_VirtualFileSystem | ( | const CL_String & | path, |
bool | is_zip_file = false |
||
) |
Constructs a VirtualFileSystem.
path | = String |
is_zip_file | = bool |
CL_VirtualFileSystem::~CL_VirtualFileSystem | ( | ) |
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
CL_String CL_VirtualFileSystem::get_path | ( | ) | const |
Returns a path to the file source for this file system.
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.
|
inline |
Returns true if the file system is null.
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("Hello")); vfs.mount("ABC", new_vfs); param: mount_point = Mount alias name to use param: fs = Filesystem to use
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
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
void CL_VirtualFileSystem::unmount | ( | const CL_String & | mount_point) |
Unmount a file system.
param: mount_point = The mount point to unmount
|
friend |