e4f35acf7c
representing the interface for, well, MIME sniffer add-ons. * Implemented the respective add-on manager and make use of it in the MIME database code. Unfortunately the MIME DB code completely lives in libbe.so and hence I had to put my code there too. IMHO we should (one day) remove the direct (read-only) MIME DB access from libbe and move everything into the registrar. Currently the add-on manager supports built-in add-ons only; it doesn't really load anything from disk ATM. * Added a built-in text sniffer add-on to the registrar. It's based upon the BSD file tool code. This closes bug #250 (plain text files are identified as such, now). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17784 a95241bf-73f2-0310-859d-f6bbb57e9c96
33 lines
747 B
C++
33 lines
747 B
C++
/* MIME Sniffer Add-On Protocol
|
|
*
|
|
* Copyright 2006, Haiku Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _MIME_SNIFFER_ADDON_H
|
|
#define _MIME_SNIFFER_ADDON_H
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
class BFile;
|
|
class BMimeType;
|
|
|
|
// **********************************
|
|
// *** WARNING: EXPERIMENTAL API! ***
|
|
// **********************************
|
|
|
|
class BMimeSnifferAddon {
|
|
public:
|
|
BMimeSnifferAddon();
|
|
virtual ~BMimeSnifferAddon();
|
|
|
|
virtual size_t MinimalBufferSize();
|
|
|
|
virtual float GuessMimeType(const char* fileName,
|
|
BMimeType* type);
|
|
virtual float GuessMimeType(BFile* file,
|
|
const void* buffer, int32 length,
|
|
BMimeType* type);
|
|
};
|
|
|
|
#endif // _MIME_SNIFFER_ADDON_H
|