39 lines
751 B
C++
39 lines
751 B
C++
/*
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_INDEX_H
|
|
#define OCARINA_INDEX_H
|
|
|
|
#include <file.h>
|
|
#include <print.h>
|
|
|
|
#include <map>
|
|
#include <set>
|
|
#include <string>
|
|
|
|
class Index {
|
|
private:
|
|
std::map<std::string, std::set<unsigned int> > index;
|
|
std::set<std::string> keys;
|
|
File file;
|
|
|
|
public:
|
|
Index(std::string);
|
|
void save();
|
|
void load();
|
|
#ifdef CONFIG_DEBUG
|
|
void print();
|
|
void print_keys();
|
|
#endif /* CONFIG_DEBUG */
|
|
|
|
void insert(std::string, unsigned int);
|
|
void remove(std::string);
|
|
void remove(std::string, unsigned int);
|
|
|
|
const std::set<std::string>::iterator keys_begin();
|
|
const std::set<std::string>::iterator keys_end();
|
|
const std::set<unsigned int> &operator[](const std::string &);
|
|
};
|
|
|
|
#endif /* OCARINA_INDEX_H */
|