2006-06-10 00:48:50 +04:00
|
|
|
/*
|
2013-11-22 14:14:19 +04:00
|
|
|
* Copyright 2006-2013, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
2006-06-10 00:48:50 +04:00
|
|
|
*/
|
2013-11-22 14:14:19 +04:00
|
|
|
#ifndef _MIME_TEXT_SNIFFER_ADDON_H
|
|
|
|
#define _MIME_TEXT_SNIFFER_ADDON_H
|
|
|
|
|
2006-06-10 00:48:50 +04:00
|
|
|
|
|
|
|
#include <MimeSnifferAddon.h>
|
|
|
|
|
2013-11-22 14:14:19 +04:00
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
namespace Storage {
|
|
|
|
namespace Mime {
|
|
|
|
|
|
|
|
|
2013-11-22 15:14:34 +04:00
|
|
|
class DatabaseLocation;
|
|
|
|
|
|
|
|
|
2006-06-10 00:48:50 +04:00
|
|
|
class TextSnifferAddon : public BMimeSnifferAddon {
|
|
|
|
public:
|
2013-11-22 15:14:34 +04:00
|
|
|
TextSnifferAddon(
|
|
|
|
DatabaseLocation* databaseLocation);
|
2006-06-10 00:48:50 +04:00
|
|
|
virtual ~TextSnifferAddon();
|
|
|
|
|
|
|
|
virtual size_t MinimalBufferSize();
|
|
|
|
|
|
|
|
virtual float GuessMimeType(const char* fileName,
|
|
|
|
BMimeType* type);
|
|
|
|
virtual float GuessMimeType(BFile* file,
|
|
|
|
const void* buffer, int32 length,
|
|
|
|
BMimeType* type);
|
2013-11-22 15:14:34 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
DatabaseLocation* fDatabaseLocation;
|
2006-06-10 00:48:50 +04:00
|
|
|
};
|
|
|
|
|
2013-11-22 14:14:19 +04:00
|
|
|
|
|
|
|
} // namespace Mime
|
|
|
|
} // namespace Storage
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _MIME_TEXT_SNIFFER_ADDON_H
|