39 lines
662 B
C
39 lines
662 B
C
|
/*
|
||
|
* Copyright 2014 (c) Anna Schumaker.
|
||
|
*/
|
||
|
#ifndef OCARINA_INDEX_H
|
||
|
#define OCARINA_INDEX_H
|
||
|
|
||
|
#include <database.h>
|
||
|
|
||
|
#include <set>
|
||
|
#include <string>
|
||
|
|
||
|
|
||
|
class IndexEntry : public DatabaseEntry {
|
||
|
public:
|
||
|
std::string key;
|
||
|
std::set<unsigned int> values;
|
||
|
|
||
|
IndexEntry();
|
||
|
IndexEntry(const std::string &);
|
||
|
const std::string primary_key();
|
||
|
void insert(unsigned int);
|
||
|
void remove(unsigned int);
|
||
|
|
||
|
void write(File &);
|
||
|
void read(File &);
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
class Index : public Database<IndexEntry> {
|
||
|
public:
|
||
|
Index(const std::string &, bool);
|
||
|
|
||
|
void insert(const std::string &, unsigned int);
|
||
|
void remove(const std::string &, unsigned int);
|
||
|
};
|
||
|
|
||
|
#endif /* OCARINA_DATABASE_H */
|