openMSX
RomDatabase.hh
Go to the documentation of this file.
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
11namespace openmsx {
12
13class CliComm;
14
16{
17public:
22 using RomDB = std::vector<Entry>; // sorted on sha1
23
24 explicit RomDatabase(CliComm& cliComm);
25
29 [[nodiscard]] const RomInfo* fetchRomInfo(const Sha1Sum& sha1sum) const;
30
31 [[nodiscard]] const char* getBufferStart() const { return buffer.data(); }
32
33private:
34 RomDB db;
35 MemBuffer<char> buffer;
36};
37
38} // namespace openmsx
39
40#endif
This class manages the lifetime of a block of memory.
Definition MemBuffer.hh:29
const T * data() const
Returns pointer to the start of the memory buffer.
Definition MemBuffer.hh:81
const char * getBufferStart() const
std::vector< Entry > RomDB
const RomInfo * fetchRomInfo(const Sha1Sum &sha1sum) const
Lookup an entry in the database by sha1sum.
This class represents the result of a sha1 calculation (a 160-bit value).
Definition sha1.hh:24
This file implemented 3 utility functions:
Definition Autofire.cc:11