27 lines
504 B
C++
27 lines
504 B
C++
#ifndef __DATABASE_H__
|
|
#define __DATABASE_H__
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct sqlite3;
|
|
|
|
class PalmFeature {
|
|
public:
|
|
int64_t id; // 对应本地数据库的id
|
|
std::string username;
|
|
std::vector<uint8_t> feature;
|
|
};
|
|
|
|
class Database{
|
|
public:
|
|
bool open(const std::string &path);
|
|
bool addPalmFeature(const PalmFeature &palm);
|
|
std::vector<PalmFeature> palmFeatures() const;
|
|
|
|
private:
|
|
void initializeTables();
|
|
sqlite3 *m_sqlite = nullptr;
|
|
};
|
|
#endif // __DATABASE_H__
|