1 #include "test_file_accessor.h" 2 #include "test_file_opener.h" 3 4 #include <stdlib.h> 5 6 /* Support for providing access to files. */ 7 8 TestFileOpener::TestFileOpener(Pages *pages, offset_t file_size) 9 : OpenerResource(pages), _file_size(file_size) 10 { 11 } 12 13 /* Return a file identifier for the given 'path'. */ 14 15 fileid_t TestFileOpener::get_fileid(const char *path) 16 { 17 /* NOTE: Just convert the path to a number. */ 18 19 return atol(path); 20 } 21 22 /* Return a new accessor for 'fileid'. */ 23 24 Accessor *TestFileOpener::make_accessor(fileid_t fileid) 25 { 26 return new TestFileAccessor(fileid, _file_size); 27 } 28 29 // vim: tabstop=4 expandtab shiftwidth=4