src/storage/fshost/inspect-manager.cc
// Reads the next set of dirents and loads them into `pending_entries_`.
Reads the next set of dirents and loads them into `pending_entries_`.
Reads the next set of dirents and loads them into ` pending_entries_ ` .
void DirectoryEntriesIterator::RefreshPendingEntries() {
  auto result = fio::Directory::Call::ReadDirents(zx::unowned_channel(directory_), fio::MAX_BUF);
  if (result.status() != ZX_OK) {
    return;
  }
  fio::Directory::ReadDirentsResponse* response = result.Unwrap();
  if (response->dirents.count() == 0) {
    return;
  }
  size_t offset = 0;
  auto data_ptr = response->dirents.data();
  while (sizeof(vdirent_t) < response->dirents.count() - offset) {
    const vdirent_t* entry = reinterpret_cast<const vdirent_t*>(data_ptr + offset);
    std::string entry_name(entry->name, entry->size);
    offset += sizeof(vdirent_t) + entry->size;
    if (entry_name == "." || entry_name == "..") {
      continue;
    }
    pending_entries_.push(std::move(entry_name));
  }
}
void DirectoryEntriesIterator :: RefreshPendingEntries ( ) { auto result = fio :: Directory :: Call :: ReadDirents ( zx :: unowned_channel ( directory_ ) , fio :: MAX_BUF ) ; if ( result . status ( ) != ZX_OK ) { return ; } fio :: Directory :: ReadDirentsResponse * response = result . Unwrap ( ) ; if ( response -> dirents . count ( ) == 0 ) { return ; } size_t offset = 0 ; auto data_ptr = response -> dirents . data ( ) ; while ( sizeof ( vdirent_t ) < response -> dirents . count ( ) - offset ) { const vdirent_t * entry = reinterpret_cast < const vdirent_t * > ( data_ptr + offset ) ; std :: string entry_name ( entry -> name , entry -> size ) ; offset += sizeof ( vdirent_t ) + entry -> size ; if ( entry_name == " " || entry_name == " " ) { continue ; } pending_entries_ . push ( std :: move ( entry_name ) ) ; } }
Reads the next set of dirents and loads them into `pending_entries_`.
Reads the next set of dirents and loads them into ` pending_entries_ ` .