1/* 2 * Copyright 2011 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Erik Jaesler, ejakowatz@users.sourceforge.net 7 * John Scipione, jscipione@gmail.com 8 * 9 * Corresponds to: 10 * headers/os/storage/EntryList.h rev 42794 11 * src/kits/storage/EntryList.cpp rev 42794 12 */ 13 14 15/*! 16 \file EntryList.h 17 \ingroup storage 18 \ingroup libbe 19 \brief Defines the BEntryList class. 20*/ 21 22 23/*! 24 \class BEntryList 25 \ingroup storage 26 \ingroup libbe 27 \brief Interface for iterating through a list of filesystem entries. 28 29 Defines a general interface for iterating through a list of entries 30 i.e. files in a folder. 31*/ 32 33 34/*! 35 \fn BEntryList::BEntryList() 36 \brief Creates a BEntryList object. 37 38 Does nothing at this time. 39*/ 40 41 42/*! 43 \fn BEntryList::~BEntryList() 44 \brief Frees all resources associated with the BEntryList object. 45 46 Does nothing at this time. 47*/ 48 49 50/*! 51 \fn status_t BEntryList::GetNextEntry(BEntry *entry, bool traverse) 52 \brief Returns the BEntryList's next entry as a BEntry. 53 54 Places the next entry in the list in \a entry, traversing symlinks if 55 \a traverse is \c true. 56 57 \param entry a pointer to a BEntry to be initialized with the found entry. 58 \param traverse specifies whether to follow it, if the found entry 59 is a symbolic link. 60 61 \note The iterator used by this method is the same one used by 62 GetNextRef(), GetNextDirents(), Rewind() and CountEntries(). 63 64 \retval B_OK if successful 65 \retval B_ENTRY_NOT_FOUND when at the end of the list 66 \retval B_ERROR or another error code (depending on the implementation 67 of the derived class). 68*/ 69 70 71/*! 72 \fn status_t BEntryList::GetNextRef(entry_ref *ref) 73 \brief Returns the BEntryList's next entry as an entry_ref. 74 75 Places an entry_ref to the next entry in the list into \a ref. 76 77 \param ref a pointer to an entry_ref to be filled in with the data of the 78 found entry. 79 80 \note The iterator used by this method is the same one used by 81 GetNextEntry(), GetNextDirents(), Rewind() and CountEntries(). 82 83 \retval B_OK if successful 84 \retval B_ENTRY_NOT_FOUND when at the end of the list 85 \retval B_ERROR or another error code (depending on the implementation 86 of the derived class). 87*/ 88 89 90/*! 91 \fn int32 BEntryList::GetNextDirents(struct dirent *buf, size_t length, 92 int32 count) 93 \brief Returns the BEntryList's next entries as dirent structures. 94 95 Reads a number of entries into the array of dirent structures pointed 96 to by \a buf. Reads as many but no more than \a count entries, as many 97 entries as remain, or as many entries as will fit into the array at 98 \a buf with given length \a length (in bytes), whichever is smallest. 99 100 \param buf A pointer to a buffer to be filled with dirent structures of 101 the found entries. 102 \param length The length of the \a buf array. 103 \param count the maximum number of entries to be read. 104 105 \note The iterator used by this method is the same one used by 106 GetNextEntry(), GetNextRef(), Rewind() and CountEntries(). 107 108 \returns 109 - The number of dirent structures stored in the buffer or 0 when 110 there are no more entries to be read. 111 - an error code (depending on the implementation of the derived class) 112 if an error occurred. 113*/ 114 115 116/*! 117 \fn status_t BEntryList::Rewind() 118 \brief Rewinds the list pointer to the beginning of the list. 119 120 \retval B_OK if successful 121 \retval B_ERROR or another error code (depending on the implementation 122 of the derived class). 123*/ 124 125 126/*! 127 \fn int32 BEntryList::CountEntries() 128 \brief Returns the number of entries in the list 129 130 \retval B_OK if successful 131 \retval B_ENTRY_NOT_FOUND when at the end of the list 132 \retval B_ERROR or another error code (depending on the implementation 133 of the derived class). 134*/