1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/host_file_accessor.h Wed Feb 03 00:15:16 2021 +0100
1.3 @@ -0,0 +1,30 @@
1.4 +#pragma once
1.5 +
1.6 +#include <stdio.h>
1.7 +
1.8 +#include "accessor.h"
1.9 +
1.10 +/* A host filesystem file accessor, providing flexpages corresponding to file
1.11 + regions. */
1.12 +
1.13 +class HostFileAccessor : public Accessor
1.14 +{
1.15 +protected:
1.16 + const char *_path;
1.17 + FILE *_fp;
1.18 +
1.19 +public:
1.20 + explicit HostFileAccessor(const char *path, fileid_t fileid);
1.21 +
1.22 + virtual void close();
1.23 +
1.24 + virtual void open();
1.25 +
1.26 + /* Data transfer methods. */
1.27 +
1.28 + virtual void fill(Flexpage *flexpage);
1.29 +
1.30 + virtual void flush(Flexpage *flexpage);
1.31 +};
1.32 +
1.33 +// vim: tabstop=4 expandtab shiftwidth=4