1 #pragma once 2 3 #include <map> 4 5 #include "opener_resource.h" 6 7 8 9 /* Collection types. */ 10 11 typedef std::map<fileid_t, const char *> FilePaths; 12 typedef std::pair<fileid_t, const char *> FilePathEntry; 13 14 15 16 /* Support for providing access to files. */ 17 18 class HostFileOpener : public OpenerResource 19 { 20 protected: 21 FilePaths _paths; 22 23 /* Configurable methods. */ 24 25 virtual fileid_t get_fileid(const char *path); 26 27 virtual Accessor *make_accessor(fileid_t fileid); 28 29 public: 30 explicit HostFileOpener(Accessing *accessing, Paging *paging, Pages *pages) 31 : OpenerResource(accessing, paging, pages) 32 { 33 } 34 }; 35 36 // vim: tabstop=4 expandtab shiftwidth=4