merged
This commit is contained in:
parent
18a14d204c
commit
717568b6d0
30 changed files with 4093 additions and 209 deletions
21
simulator_SIC_XE/include/reader.h
Normal file
21
simulator_SIC_XE/include/reader.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef READER_H
|
||||
#define READER_H
|
||||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
// Abstract Reader class: read bytes/strings from a source (file, string, etc.)
|
||||
class Reader {
|
||||
public:
|
||||
virtual ~Reader() = default;
|
||||
// return 0..255 on success, -1 on EOF/error
|
||||
virtual int readByte() = 0;
|
||||
// read exactly len bytes into buf; return true on success
|
||||
virtual bool readBytes(uint8_t* buf, size_t len) = 0;
|
||||
// read up to len bytes into a std::string; may return shorter string on EOF
|
||||
virtual std::string readString(size_t len) = 0;
|
||||
// read a line (up to newline), return empty string on EOF
|
||||
virtual std::string readLine() = 0;
|
||||
};
|
||||
|
||||
#endif // READER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue