2021-01-24 | Paul Boddie | raw annotate files changeset graph | Introduced usage of an opener to obtain a file pager. |
1 #include "opener.h" 2 #include "opener_context.h" 3 4 /* Support for providing access to files. */ 5 6 OpenerContext::OpenerContext(Opener *opener, Memory *memory) 7 : SimplePager(memory), _opener(opener) 8 { 9 } 10 11 FilePager *OpenerContext::open() 12 { 13 return _opener->open(get_path()); 14 } 15 16 char *OpenerContext::get_path() 17 { 18 return _region->read(); 19 } 20 21 // vim: tabstop=4 expandtab shiftwidth=4