2010-09-18 13:46:25 +02:00
|
|
|
#ifndef GAME_LIST_H_
|
|
|
|
#define GAME_LIST_H_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include "wstring.hpp"
|
|
|
|
#include "usbloader/disc.h"
|
|
|
|
|
|
|
|
class GameList
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GameList();
|
|
|
|
int ReadGameList();
|
2010-10-27 21:50:48 +02:00
|
|
|
int size() { return FilteredList.size(); };
|
|
|
|
int GameCount() { return FullGameList.size(); };
|
2010-09-24 02:48:03 +02:00
|
|
|
int FilterList(const wchar_t * gameFilter = NULL);
|
2010-09-18 13:46:25 +02:00
|
|
|
int LoadUnfiltered();
|
2010-09-24 02:48:03 +02:00
|
|
|
struct discHdr * at(int i);
|
2010-10-27 21:50:48 +02:00
|
|
|
struct discHdr * operator[](int i) { return at(i); };
|
|
|
|
struct discHdr * GetDiscHeader(const char * gameID);
|
|
|
|
const wchar_t * GetCurrentFilter() { return GameFilter.c_str(); };
|
|
|
|
const wchar_t * GetAvailableSearchChars() { return AvailableSearchChars.c_str(); };
|
2010-09-18 13:46:25 +02:00
|
|
|
void SortList();
|
|
|
|
void clear();
|
|
|
|
protected:
|
2010-09-24 02:48:03 +02:00
|
|
|
static bool NameSortCallback(const struct discHdr *a, const struct discHdr *b);
|
|
|
|
static bool PlaycountSortCallback(const struct discHdr *a, const struct discHdr *b);
|
|
|
|
static bool FavoriteSortCallback(const struct discHdr *a, const struct discHdr *b);
|
2010-09-18 13:46:25 +02:00
|
|
|
|
|
|
|
wString AvailableSearchChars;
|
|
|
|
wString GameFilter;
|
|
|
|
std::vector<struct discHdr *> FilteredList;
|
|
|
|
std::vector<struct discHdr> FullGameList;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern GameList gameList;
|
|
|
|
|
|
|
|
#endif
|