1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-27 05:32:04 +00:00
r65emu/filer.h

37 lines
689 B
C
Raw Normal View History

2019-02-10 13:58:52 +00:00
#ifndef __FILER_H__
#define __FILER_H__
2019-02-11 18:28:38 +00:00
class filer: public serialio {
2019-02-10 13:58:52 +00:00
public:
virtual const char *advance() =0;
virtual const char *rewind() =0;
2019-02-12 18:17:46 +00:00
virtual const char *checkpoint() =0;
virtual void restore(const char *) = 0;
2019-02-10 13:58:52 +00:00
virtual bool start(const char *) =0;
virtual void stop() =0;
};
2019-02-11 18:28:38 +00:00
// split into sd_filer and fs_filer
// implement write to new file (like checkpoint)
2019-02-10 13:58:52 +00:00
class flash_filer: public filer {
public:
const char *advance();
const char *rewind();
2019-02-12 18:17:46 +00:00
const char *checkpoint();
void restore(const char *);
2019-02-10 13:58:52 +00:00
bool start(const char *);
void stop();
uint8_t read() { return _buf[_pos++]; }
bool more();
private:
unsigned _pos, _len;
uint8_t _buf[128];
};
#endif