openMSX
RomDatabase.hh
Go to the documentation of this file.
1#ifndef ROMDATABASE_HH
2#define ROMDATABASE_HH
3
4#include "MemBuffer.hh"
5#include "RomInfo.hh"
6#include "sha1.hh"
7#include <vector>
8
9namespace openmsx {
10
11class CliComm;
12
14{
15public:
16 struct Entry {
19 };
20 using RomDB = std::vector<Entry>; // sorted on sha1
21
22 RomDatabase(CliComm& cliComm);
23
27 [[nodiscard]] const RomInfo* fetchRomInfo(const Sha1Sum& sha1sum) const;
28
29 [[nodiscard]] const char* getBufferStart() const { return buffer.data(); }
30
31private:
32 RomDB db;
33 MemBuffer<char> buffer;
34};
35
36} // namespace openmsx
37
38#endif
const T * data() const
Returns pointer to the start of the memory buffer.
Definition: MemBuffer.hh:81
const char * getBufferStart() const
Definition: RomDatabase.hh:29
RomDatabase(CliComm &cliComm)
Definition: RomDatabase.cc:566
std::vector< Entry > RomDB
Definition: RomDatabase.hh:20
const RomInfo * fetchRomInfo(const Sha1Sum &sha1sum) const
Lookup an entry in the database by sha1sum.
Definition: RomDatabase.cc:617
This class represents the result of a sha1 calculation (a 160-bit value).
Definition: sha1.hh:22
This file implemented 3 utility functions:
Definition: Autofire.cc:9