lsnes/include/library/recentfiles.hpp

28 lines
515 B
C++
Raw Normal View History

2012-11-13 22:01:12 +02:00
#ifndef _library__recentfiles__hpp__included__
#define _library__recentfiles__hpp__included__
2012-09-25 23:05:57 +03:00
#include <string>
#include <cstdlib>
#include <list>
class recent_files
{
public:
struct hook
{
virtual ~hook();
virtual void operator()() = 0;
};
recent_files(const std::string& cfgfile, size_t maxcount);
void add(const std::string& file);
void add_hook(hook& h);
void remove_hook(hook& h);
std::list<std::string> get();
private:
std::string cfgfile;
size_t maxcount;
std::list<hook*> hooks;
};
#endif