Pyrogenesis  trunk
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
vfs.h File Reference
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs_path.h"
Include dependency graph for vfs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IVFS
 

Namespaces

 ERR
 

Introduction


 

Typedefs

typedef shared_ptr< IVFSPIVFS
 

Enumerations

enum  VfsMountFlags {
  VFS_MOUNT_WATCH = 1, VFS_MOUNT_ARCHIVABLE = 2, VFS_MOUNT_MUST_EXIST = 4, VFS_MOUNT_KEEP_DELETED = 8,
  VFS_MOUNT_REPLACEABLE = 16
}
 

Functions

LIB_API PIVFS CreateVfs (size_t cacheSize)
 create an instance of a Virtual File System. More...
 

Variables

const Status ERR::VFS_DIR_NOT_FOUND = -110100
 
const Status ERR::VFS_FILE_NOT_FOUND = -110101
 
const Status ERR::VFS_ALREADY_MOUNTED = -110102
 

Typedef Documentation

typedef shared_ptr<IVFS> PIVFS

Enumeration Type Documentation

Enumerator
VFS_MOUNT_WATCH 

all real directories mounted during this operation will be watched for changes.

this flag is provided to avoid watches in output-only directories, e.g. screenshots/ (only causes unnecessary overhead).

VFS_MOUNT_ARCHIVABLE 

anything mounted from here should be included when building archives.

VFS_MOUNT_MUST_EXIST 

return ERR::VFS_DIR_NOT_FOUND if the given real path doesn't exist.

(the default behavior is to create all real directories in the path)

VFS_MOUNT_KEEP_DELETED 

keep the files named "*.DELETED" visible in the VFS directories.

the standard behavior of hiding the file with the same name minus the ".DELETED" suffix will still apply. (the default behavior is to hide both the suffixed and unsuffixed files)

VFS_MOUNT_REPLACEABLE 

mark a directory replaceable, so that when writing a file to this path new real directories will be created instead of reusing already existing ones mounted at a subpath of the VFS path.

(the default behaviour is to write to the real directory associated with the VFS directory that was last mounted to this path (or subpath))

Function Documentation

LIB_API PIVFS CreateVfs ( size_t  cacheSize)

create an instance of a Virtual File System.

Parameters
cacheSizesize [bytes] of memory to reserve for a file cache, or zero to disable it. if small enough to fit, file contents are stored here until no references remain and they are evicted.

note: there is no limitation to a single instance, it may make sense to create and destroy VFS instances during each unit test.