1 /* 2 * Copyright 2014, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef PACKAGE_FILE_MANAGER_H 6 #define PACKAGE_FILE_MANAGER_H 7 8 9 #include "PackageFile.h" 10 11 12 class BLocker; 13 14 class Package; 15 16 17 class PackageFileManager { 18 public: 19 PackageFileManager(BLocker& lock); 20 ~PackageFileManager(); 21 22 status_t Init(); 23 24 status_t GetPackageFile(const entry_ref& entryRef, 25 PackageFile*& _file); 26 // returns a reference 27 status_t CreatePackage(const entry_ref& entryRef, 28 Package*& _package); 29 30 void PackageFileMoved(PackageFile* file, 31 const node_ref& newDirectory); 32 33 // conceptually private 34 void RemovePackageFile(PackageFile* file); 35 36 private: 37 typedef PackageFileEntryRefHashTable EntryRefTable; 38 39 private: 40 BLocker& fLock; 41 EntryRefTable fFilesByEntryRef; 42 }; 43 44 45 #endif // PACKAGE_FILE_MANAGER_H 46