mirror of
https://github.com/libretro/Play-.git
synced 2024-11-27 18:50:28 +00:00
45 lines
798 B
C++
45 lines
798 B
C++
#ifndef _MIPSFUNCTIONPATTERNDB_H_
|
|
#define _MIPSFUNCTIONPATTERNDB_H_
|
|
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
#include "Types.h"
|
|
#include "xml/Node.h"
|
|
|
|
class CMipsFunctionPatternDb
|
|
{
|
|
public:
|
|
struct PATTERNITEM
|
|
{
|
|
uint32 value;
|
|
uint32 mask;
|
|
};
|
|
|
|
class Pattern
|
|
{
|
|
public:
|
|
typedef std::vector<PATTERNITEM> ItemArray;
|
|
|
|
bool Matches(uint32*, uint32) const;
|
|
|
|
std::string name;
|
|
ItemArray items;
|
|
};
|
|
|
|
typedef std::vector<Pattern> PatternArray;
|
|
|
|
CMipsFunctionPatternDb(Framework::Xml::CNode*);
|
|
virtual ~CMipsFunctionPatternDb();
|
|
|
|
const PatternArray& GetPatterns() const;
|
|
|
|
private:
|
|
void Read(Framework::Xml::CNode*);
|
|
Pattern ParsePattern(const char*);
|
|
bool ParsePatternItem(const char*, PATTERNITEM&);
|
|
|
|
PatternArray m_patterns;
|
|
};
|
|
|
|
#endif
|