#include <virtual_directory.h>
Public Member Functions | |
Construction | |
| CL_VirtualDirectory () | |
| Constructs a virtual directory. | |
| CL_VirtualDirectory (const CL_VirtualFileSystem &file_system, const CL_String &base_path) | |
| Constructs a virtual directory. | |
| ~CL_VirtualDirectory () | |
Attributes | |
| CL_VirtualFileSystem | get_file_system () |
| Returns the file system the directory belongs to. | |
| const CL_String & | get_path () const |
| Returns the absolute path of the virtual directory. | |
| CL_VirtualDirectoryListing | get_directory_listing () |
| List contents of directory. | |
| CL_String | get_identifier () const |
| Get the identifier of this directory. | |
Operations | |
| CL_VirtualDirectory | open_directory (const CL_String &path) |
| Open a directory relatively to this one. | |
| 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) |
| Open a file relatively to this directory. | |
| CL_IODevice | open_file_read (const CL_String &filename) const |
| Open a file read only, avoiding potential "const" problems. | |
| CL_String | make_path_absolute (const CL_String &relative_path) const |
| Convert a relative path to an absolute one. | |
| CL_String | make_path_relative (const CL_String &absolute_path) const |
| Convert an absolute path to a relative one. | |
| void | mount (const CL_String &mount_point, CL_VirtualFileSystem &fs) |
| Mount a file system. | |
| void | mount (const CL_String &mount_point, const CL_String &path) |
| Mount a file system. | |
| void | unmount (const CL_String &mount_point) |
| Unmount a file system. | |
|
|
Constructs a virtual directory. File system is treated as CL_File The base path is set the current working directory |
|
||||||||||||
|
Constructs a virtual directory. param: file_system = File system to use param: base_path = Base path of the directory |
|
|
|
|
|
List contents of directory. This is only available if CL_VirtualFileSystem was set. If not, use CL_DirectoryScanner() instead. |
|
|
Returns the file system the directory belongs to.
|
|
|
Get the identifier of this directory. The exact format of this identifier depends on the implementation of the underlying filesystem and mounts
|
|
|
Returns the absolute path of the virtual directory. If CL_VirtualFileSystem was not set, it is is a full path. Else, it is the path specified to the constructor
|
|
|
Convert a relative path to an absolute one. If CL_VirtualFileSystem was not set, this function uses CL_PathHelp::path_type_file If CL_VirtualFileSystem is set, this function uses CL_PathHelp::path_type_virtual param: relative_path = The relative path
|
|
|
Convert an absolute path to a relative one. If CL_VirtualFileSystem was not set, this function uses CL_PathHelp::path_type_file If CL_VirtualFileSystem is set, this function uses CL_PathHelp::path_type_virtual param: absolute_path = The absolute path
|
|
||||||||||||
|
Mount a file system. This is only available if CL_VirtualFileSystem was set 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 |
|
||||||||||||
|
Mount a file system. 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"))); dir.mount(cl_text("ABC"), new_vfs); param: mount_point = Mount alias name to use param: fs = Filesystem to use |
|
|
Open a directory relatively to this one. This function uses make_path_absolute() path: Relative path to use |
|
||||||||||||||||||||||||
|
Open a file relatively to this directory. This function uses make_path_absolute() A CL_Exception is thrown if the file could not be opened param: filename = File to open (may be a path) param: mode = CL_File::OpenMode modes param: access = CL_File::AccessFlags flags param: share = CL_File::ShareFlags flags param: flags = CL_File::Flags flags
|
|
|
Open a file read only, avoiding potential "const" problems.
|
|
|
Unmount a file system. This is only available if CL_VirtualFileSystem was set param: mount_point = The mount point to unmount |
1.4.6