| 1 |
#ifndef ROMDATABASE_HH |
| 2 |
#define ROMDATABASE_HH |
| 3 |
|
| 4 |
#include "RomInfo.hh" |
| 5 |
|
| 6 |
#include "MemBuffer.hh" |
| 7 |
#include "sha1.hh" |
| 8 |
|
| 9 |
#include <vector> |
| 10 |
|
| 11 |
namespace openmsx { |
| 12 |
|
| 13 |
class CliComm; |
| 14 |
|
| 15 |
class RomDatabase |
| 16 |
{ |
| 17 |
public: |
| 18 |
struct Entry { |
| 19 |
Sha1Sum sha1; |
| 20 |
RomInfo romInfo; |
| 21 |
}; |
| 22 |
using RomDB = std::vector<Entry>; |
| 23 |
|
| 24 |
explicit RomDatabase(CliComm& cliComm); |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
[[nodiscard]] const RomInfo* fetchRomInfo(const Sha1Sum& sha1sum) const; |
| 30 |
|
| 31 |
[[nodiscard]] const RomDB& getFullDB() const { return db; } |
| 32 |
[[nodiscard]] const char* getBufferStart() const { return buffer.data(); } |
| 33 |
|
| 34 |
private: |
| 35 |
RomDB db; |
| 36 |
MemBuffer<char> buffer; |
| 37 |
}; |
| 38 |
|
| 39 |
} |
| 40 |
|
| 41 |
#endif |