Switch to unified view

a/src/internfile/mimehandler.cpp b/src/internfile/mimehandler.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.20 2006-12-15 12:40:02 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.21 2006-12-19 08:40:50 dockes Exp $ (C) 2004 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
36
#include "mh_unknown.h"
36
#include "mh_unknown.h"
37
  
37
  
38
/** Create internal handler object appropriate for given mime type */
38
/** Create internal handler object appropriate for given mime type */
39
static Dijon::Filter *mhFactory(const string &mime)
39
static Dijon::Filter *mhFactory(const string &mime)
40
{
40
{
41
    if (!stringlowercmp("text/plain", mime))
41
    string lmime(mime);
42
    stringtolower(lmime);
43
    if ("text/plain" == lmime)
42
    return new MimeHandlerText("text/plain");
44
    return new MimeHandlerText(lmime);
43
    else if (!stringlowercmp("text/html", mime))
45
    else if ("text/html" == lmime)
44
    return new MimeHandlerHtml("text/html");
46
    return new MimeHandlerHtml(lmime);
45
    else if (!stringlowercmp("text/x-mail", mime))
47
    else if ("text/x-mail" == lmime)
46
    return new MimeHandlerMbox("text/x-mail");
48
    return new MimeHandlerMbox(lmime);
47
    else if (!stringlowercmp("message/rfc822", mime))
49
    else if ("message/rfc822" == lmime)
48
    return new MimeHandlerMail("message/rfc822");
50
    return new MimeHandlerMail(lmime);
49
    else 
51
    else 
50
  return new MimeHandlerUnknown("application/octet-stream");
52
  return new MimeHandlerUnknown(lmime);
51
}
53
}
52
54
53
/**
55
/**
54
 * Return handler object for given mime type:
56
 * Return handler object for given mime type:
55
 */
57
 */