aseprite/src/app/recent_files.h

50 lines
1.1 KiB
C
Raw Normal View History

2015-02-12 23:16:25 +08:00
// Aseprite
// Copyright (C) 2001-2015 David Capello
//
2016-08-27 04:02:58 +08:00
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
2007-09-19 07:57:02 +08:00
#ifndef APP_RECENT_FILES_H_INCLUDED
#define APP_RECENT_FILES_H_INCLUDED
2014-03-30 06:40:17 +08:00
#pragma once
2007-09-19 07:57:02 +08:00
#include "base/recent_items.h"
#include "base/signal.h"
#include <string>
2007-09-19 07:57:02 +08:00
namespace app {
2015-02-12 23:16:25 +08:00
class RecentFiles {
public:
typedef base::RecentItems<std::string> List;
typedef List::iterator iterator;
typedef List::const_iterator const_iterator;
// Iterate through recent files.
const_iterator files_begin() { return m_files.begin(); }
const_iterator files_end() { return m_files.end(); }
2007-09-19 07:57:02 +08:00
// Iterate through recent paths.
const_iterator paths_begin() { return m_paths.begin(); }
const_iterator paths_end() { return m_paths.end(); }
2007-09-19 07:57:02 +08:00
RecentFiles();
~RecentFiles();
void addRecentFile(const char* filename);
void removeRecentFile(const char* filename);
base::Signal0<void> Changed;
private:
std::string normalizePath(std::string fn);
List m_files;
List m_paths;
};
} // namespace app
2007-09-19 07:57:02 +08:00
2009-08-18 05:38:00 +08:00
#endif