1 /* 2 * Copyright 2013, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold <ingo_weinhold@gmx.de> 7 */ 8 #ifndef _MIME_APP_META_MIME_CREATOR_H 9 #define _MIME_APP_META_MIME_CREATOR_H 10 11 12 #include <SupportDefs.h> 13 14 15 struct entry_ref; 16 17 18 namespace BPrivate { 19 namespace Storage { 20 namespace Mime { 21 22 23 class Database; 24 25 26 class MimeEntryProcessor { 27 public: 28 class DatabaseLocker; 29 30 public: 31 MimeEntryProcessor(Database* database, 32 DatabaseLocker* databaseLocker, 33 int32 force); 34 virtual ~MimeEntryProcessor(); 35 36 virtual status_t Do(const entry_ref& entry, bool* _entryIsDir) 37 = 0; 38 39 status_t DoRecursively(const entry_ref& entry); 40 41 protected: 42 Database* fDatabase; 43 DatabaseLocker* fDatabaseLocker; 44 int32 fForce; 45 46 }; 47 48 49 class MimeEntryProcessor::DatabaseLocker { 50 public: 51 virtual ~DatabaseLocker(); 52 53 virtual bool Lock() = 0; 54 virtual void Unlock() = 0; 55 }; 56 57 58 } // namespace Mime 59 } // namespace Storage 60 } // namespace BPrivate 61 62 63 #endif // _MIME_APP_META_MIME_CREATOR_H 64