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:
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
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:23
This file implemented 3 utility functions:
Definition Autofire.cc:9