Posts

Showing posts from September, 2007

Filesystem

Image
Access to files is made with FileManager class. FileManager is responsible for operations made with all files. File class is interface to file. Each File has member FileHandle , which is responsible for all file operations such as reading data from file (so far). "True" file management is made by VirtualFileSystem class (VFS) (which is actually member of FileManager clas) which stores all resources of games (images, cursor, videos, ...). First, configuration files are read, and data paths or library files paths are obtained from it (Library is container (of files) for resources, something like ZIP file). Each path is iterated and resources are added to resource map. Resource map is map container of pair resource name, VFSEntry . VFSEntry is abstract class which can represent file ( VFSEntryFile ) or directory ( VFSEntryDirectory ). File can be real file on filesystem, or file inside library (If it is real file, FileHandle uses std::ifstream of that file for operati...