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 "sha1.hh"
6 #include <utility>
7 #include <vector>
8 
9 namespace openmsx {
10 
11 class CliComm;
12 class RomInfo;
13 
15 {
16 public:
17  using RomDB = std::vector<std::pair<Sha1Sum, RomInfo>>;
18 
19  RomDatabase(CliComm& cliComm);
20 
24  const RomInfo* fetchRomInfo(const Sha1Sum& sha1sum) const;
25 
26  const char* getBufferStart() const { return buffer.data(); }
27 
28 private:
29  RomDB db;
30  MemBuffer<char> buffer;
31 };
32 
33 } // namespace openmsx
34 
35 #endif
This class represents the result of a sha1 calculation (a 160-bit value).
Definition: sha1.hh:19
const T * data() const
Returns pointer to the start of the memory buffer.
Definition: MemBuffer.hh:90
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
const RomInfo * fetchRomInfo(const Sha1Sum &sha1sum) const
Lookup an entry in the database by sha1sum.
Definition: RomDatabase.cc:615
RomDatabase(CliComm &cliComm)
Definition: RomDatabase.cc:563
const char * getBufferStart() const
Definition: RomDatabase.hh:26
std::vector< std::pair< Sha1Sum, RomInfo > > RomDB
Definition: RomDatabase.hh:17