#include "menu.hpp" #include "gecko.h" #include // Returns a list of games which starts with the specified (partial) gameId // We can enhance the code in this file later on to support more search features // Using a search class as argument or something like that vector CMenu::_searchGamesByID(const char *gameId) { vector retval; for (vector::iterator itr = m_gameList.begin(); itr != m_gameList.end(); itr++) if (strncmp((const char *) (*itr).hdr.id, gameId, strlen(gameId)) == 0) retval.push_back(*itr); return retval; } /* vector CMenu::_searchGamesByTitle(wchar_t letter) { vector retval; for (vector::iterator itr = m_gameList.begin(); itr != m_gameList.end(); itr++) if ((*itr).title[0] == letter) retval.push_back(*itr); return retval; } vector CMenu::_searchGamesByType(const char type) { vector retval; for (vector::iterator itr = m_gameList.begin(); itr != m_gameList.end(); itr++) if ((*itr).id[0] == type) retval.push_back(*itr); return retval; } vector CMenu::_searchGamesByRegion(const char region) { vector retval; for (vector::iterator itr = m_gameList.begin(); itr != m_gameList.end(); itr++) if ((*itr).id[3] == region) retval.push_back(*itr); return retval; } */