vfs: check userland buffers before reading them.
[haiku.git] / src / servers / package / PackageFileManager.h
blobe8a035808bbb4193afcee87018902b8b31a8ddea
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
9 #include "PackageFile.h"
12 class BLocker;
14 class Package;
17 class PackageFileManager {
18 public:
19 PackageFileManager(BLocker& lock);
20 ~PackageFileManager();
22 status_t Init();
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);
30 void PackageFileMoved(PackageFile* file,
31 const node_ref& newDirectory);
33 // conceptually private
34 void RemovePackageFile(PackageFile* file);
36 private:
37 typedef PackageFileEntryRefHashTable EntryRefTable;
39 private:
40 BLocker& fLock;
41 EntryRefTable fFilesByEntryRef;
45 #endif // PACKAGE_FILE_MANAGER_H