2021-03-13 | Paul Boddie | raw annotate files changeset graph | Renamed file_open to file_context_open, providing file_open as a convenience function that creates a context, sets the filename, opens the file, and closes the context. Changed the string-setting function to be more immediately useful, if more complicated in operation, for this application. |
1 #pragma once 2 3 #include "flexpage.h" 4 5 /* A file accessor, providing flexpages corresponding to file regions. */ 6 7 class Accessor 8 { 9 protected: 10 offset_t _size; 11 12 public: 13 fileid_t fileid; 14 15 explicit Accessor(fileid_t fileid, offset_t size=0); 16 17 virtual offset_t get_size(); 18 19 virtual void close(); 20 21 virtual void open(); 22 23 /* Data transfer methods. */ 24 25 virtual void fill(Flexpage *flexpage) = 0; 26 27 virtual void flush(Flexpage *flexpage) = 0; 28 }; 29 30 // vim: tabstop=4 expandtab shiftwidth=4