haiku/headers/private/storage/mime/MimeEntryProcessor.h
Ingo Weinhold 865ab2816d Pull class MimeInfoUpdater out of UpdateMimeInfoThread
* Pull out base class MimeEntryProcessor out of AppMetaMimeCreator.
* Pull class MimeInfoUpdater out of UpdateMimeInfoThread and derive it
  from MimeEntryProcessor.
* MimeInfoUpdater: Instead of BMimeType::GuessMimeType(), use
  Database::GuessMimeType() directly.
2013-05-09 01:48:36 +02:00

62 lines
1.0 KiB
C++

/*
* Copyright 2013, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold <ingo_weinhold@gmx.de>
*/
#ifndef _MIME_APP_META_MIME_CREATOR_H
#define _MIME_APP_META_MIME_CREATOR_H
#include <SupportDefs.h>
struct entry_ref;
namespace BPrivate {
namespace Storage {
namespace Mime {
class Database;
class MimeEntryProcessor {
public:
class DatabaseLocker;
public:
MimeEntryProcessor(Database* database,
DatabaseLocker* databaseLocker,
int32 force);
virtual ~MimeEntryProcessor();
virtual status_t Do(const entry_ref& entry, bool* _entryIsDir)
= 0;
protected:
Database* fDatabase;
DatabaseLocker* fDatabaseLocker;
int32 fForce;
};
class MimeEntryProcessor::DatabaseLocker {
public:
virtual ~DatabaseLocker();
virtual bool Lock() = 0;
virtual void Unlock() = 0;
};
} // namespace Mime
} // namespace Storage
} // namespace BPrivate
#endif // _MIME_APP_META_MIME_CREATOR_H