1 /* 2 * Copyright 2020, Shubham Bhagat, shubhambhagat111@yahoo.com 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef _DIRECTORY_H_ 6 #define _DIRECTORY_H_ 7 8 9 #include "Extent.h" 10 #include "Inode.h" 11 #include "ShortDirectory.h" 12 13 14 /* 15 * This class should act as a layer between any kind of directory 16 * and the kernel interface 17 */ 18 class DirectoryIterator { 19 public: 20 DirectoryIterator(Inode* inode); 21 ~DirectoryIterator(); 22 status_t Init(); 23 bool IsLocalDir() { return fInode->IsLocal(); } 24 status_t GetNext(char* name, size_t* length, 25 xfs_ino_t* ino); 26 status_t Lookup(const char* name, size_t length, 27 xfs_ino_t* id); 28 29 private: 30 Inode* fInode; 31 ShortDirectory* fShortDir; 32 // Short form Directory type 33 Extent* fExtentDir; 34 // Extent form Directory type 35 }; 36 37 38 #endif 39