1 /* 2 * Copyright 2017, Chế Vũ Gia Hy, cvghy116@gmail.com. 3 * Copyright 2011, Jérôme Duval, korli@users.berlios.de. 4 * This file may be used under the terms of the MIT License. 5 */ 6 #ifndef DIRECTORYITERATOR_H 7 #define DIRECTORYITERATOR_H 8 9 10 #include "BTree.h" 11 #include "Inode.h" 12 13 14 class DirectoryIterator { 15 public: 16 DirectoryIterator(Inode* inode); 17 ~DirectoryIterator(); 18 19 status_t InitCheck(); 20 21 status_t GetNext(char* name, size_t* _nameLength, ino_t* _id); 22 status_t Lookup(const char* name, size_t nameLength, ino_t* _id); 23 status_t Rewind(); 24 private: 25 uint64 fOffset; 26 Inode* fInode; 27 TreeIterator* fIterator; 28 }; 29 30 31 #endif // DIRECTORYITERATOR_H 32