ItemIterator Connection::GetDirectory(const std::string &directory) { prechecksNoCommandsList(); mpd_send_list_meta(m_connection.get(), directory.c_str()); checkErrors(); return ItemIterator(m_connection.get(), defaultFetcher<Item>(mpd_recv_entity)); }
MenuItem* Menu::FindMarked() { MenuItemIterator iterator = ItemIterator(); while (MenuItem* item = iterator.Next()) { if (item->IsMarked()) return item; } return NULL; }
MenuItem* Menu::FindItem(const char* label) { MenuItemIterator iterator = ItemIterator(); while (MenuItem* item = iterator.Next()) { if (item->Label() != NULL && !strcmp(item->Label(), label)) return item; } return NULL; }
MenuItem* Menu::FindItemByShortcut(char key) { if (key == 0) return NULL; MenuItemList::Iterator iterator = ItemIterator(); while (MenuItem* item = iterator.Next()) { if (item->Shortcut() == key) return item; } return NULL; }
int32 Menu::IndexOf(MenuItem* searchedItem) { int32 index = 0; MenuItemIterator iterator = ItemIterator(); while (MenuItem* item = iterator.Next()) { if (item == searchedItem) return index; index++; } return -1; }
MenuItem * Menu::ItemAt(int32 index) { if (index < 0 || index >= fCount) return NULL; MenuItemIterator iterator = ItemIterator(); MenuItem *item; while ((item = iterator.Next()) != NULL) { if (index-- == 0) return item; } return NULL; }
MenuItem* Menu::RemoveItemAt(int32 index) { if (index < 0 || index >= fCount) return NULL; MenuItemIterator iterator = ItemIterator(); while (MenuItem* item = iterator.Next()) { if (index-- == 0) { RemoveItem(item); return item; } } return NULL; }
MenuItem* Menu::FindSelected(int32* _index) { int32 index = 0; MenuItemIterator iterator = ItemIterator(); while (MenuItem* item = iterator.Next()) { if (item->IsSelected()) { if (_index != NULL) *_index = index; return item; } index++; } return NULL; }
MenuItem* Menu::FindItemByShortcut(char key) { if (key == 0) return NULL; MenuItemList::Iterator iterator = ItemIterator(); while (MenuItem* item = iterator.Next()) { if (item->Shortcut() == key) return item; } Menu *superMenu = Supermenu(); if (superMenu != NULL) return superMenu->FindItemByShortcut(key); return NULL; }
ItemIterator Invoice::create_iterator() { return ItemIterator(items); }