indexedmimetypes

This commit is contained in:
dockes
2007-11-16 14:28:52 +00:00
parent 5aaa3032d9
commit 57b6f22901
5 changed files with 61 additions and 23 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.36 2007-10-27 08:40:07 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.37 2007-11-16 14:28:52 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -145,7 +145,7 @@ FileInterner::FileInterner(const std::string &f, const struct stat *stp,
// Look for appropriate handler (might still return empty)
m_mimetype = l_mime;
Dijon::Filter *df = getMimeHandler(l_mime, m_cfg);
Dijon::Filter *df = getMimeHandler(l_mime, m_cfg, !m_forPreview);
if (!df) {
// No handler for this type, for now :( if indexallfilenames
+5 -4
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.21 2006-12-19 08:40:50 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.22 2007-11-16 14:28:52 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -52,15 +52,16 @@ static Dijon::Filter *mhFactory(const string &mime)
return new MimeHandlerUnknown(lmime);
}
/**
/*
* Return handler object for given mime type:
*/
Dijon::Filter *getMimeHandler(const string &mtype, RclConfig *cfg)
Dijon::Filter *getMimeHandler(const string &mtype, RclConfig *cfg,
bool filtertypes)
{
// Get handler definition for mime type
string hs;
if (!mtype.empty())
hs = cfg->getMimeHandlerDef(mtype);
hs = cfg->getMimeHandlerDef(mtype, filtertypes);
if (!hs.empty()) {
// Break definition into type and name
+7 -2
View File
@@ -16,7 +16,7 @@
*/
#ifndef _MIMEHANDLER_H_INCLUDED_
#define _MIMEHANDLER_H_INCLUDED_
/* @(#$Id: mimehandler.h,v 1.14 2006-12-16 15:39:54 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: mimehandler.h,v 1.15 2007-11-16 14:28:52 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
#include <list>
@@ -86,8 +86,13 @@ protected:
/**
* Return indexing handler object for the given mime type
* returned pointer should be deleted by caller
* @param mtyp input mime type, ie text/plain
* @param cfg the recoll config object to be used
* @param filtertypes decide if we should restrict to types in
* indexedmimetypes (if this is set at all).
*/
extern Dijon::Filter *getMimeHandler(const std::string &mtyp, RclConfig *cfg);
extern Dijon::Filter *getMimeHandler(const std::string &mtyp, RclConfig *cfg,
bool filtertypes=false);
/// Can this mime type be interned ?
extern bool canIntern(const std::string mimetype, RclConfig *cfg);