b94857b322
* Add class DatabaseLocation. It contains a list of the MIME DB directory paths plus methods to access type files. * Move all low-level MIME DB access functions from database_{support,access} to DatabaseLocation. All code that formerly used those now requires a DatabaseLocation object. In BMimeType and in the registrar the default object is used, but the low-level classes can now be reused with different locations. * Move get_icon_data() from database_access to database_support and delete the former, which is now empty.
47 lines
885 B
C++
47 lines
885 B
C++
/*
|
|
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Ingo Weinhold <ingo_weinhold@gmx.de>
|
|
*/
|
|
#ifndef DATABASE_DIRECTORY_H
|
|
#define DATABASE_DIRECTORY_H
|
|
|
|
|
|
#include <MergedDirectory.h>
|
|
|
|
|
|
namespace BPrivate {
|
|
namespace Storage {
|
|
namespace Mime {
|
|
|
|
|
|
class DatabaseLocation;
|
|
|
|
|
|
class DatabaseDirectory : public BMergedDirectory {
|
|
public:
|
|
DatabaseDirectory();
|
|
virtual ~DatabaseDirectory();
|
|
|
|
status_t Init(DatabaseLocation* databaseLocation,
|
|
const char* superType = NULL);
|
|
|
|
protected:
|
|
virtual bool ShallPreferFirstEntry(const entry_ref& entry1,
|
|
int32 index1, const entry_ref& entry2,
|
|
int32 index2);
|
|
|
|
private:
|
|
bool _IsValidMimeTypeEntry(const entry_ref& entry);
|
|
};
|
|
|
|
|
|
} // namespace Mime
|
|
} // namespace Storage
|
|
} // namespace BPrivate
|
|
|
|
|
|
#endif // DATABASE_DIRECTORY_H
|