diff options
Diffstat (limited to 'libmail/mimetypes.C')
| -rw-r--r-- | libmail/mimetypes.C | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/libmail/mimetypes.C b/libmail/mimetypes.C deleted file mode 100644 index 0654343..0000000 --- a/libmail/mimetypes.C +++ /dev/null @@ -1,86 +0,0 @@ -/* -** Copyright 2002-2008, Double Precision Inc. -** -** See COPYING for distribution information. -*/ -#include "libmail_config.h" -#include "mimetypes.H" -#include "namespace.H" -#include "unicode/courier-unicode.h" -#include <fstream> -#include <cctype> -#include <cstring> - -using namespace std; - -LIBMAIL_START - -#include "mimetypefiles.h" - -LIBMAIL_END - -mail::mimetypes::mimetypes(string searchKey) -{ - size_t i; - - for (i=0; mimetypefiles[i]; i++) - { - ifstream f( mimetypefiles[i]); - - while (!f.bad() && !f.eof()) - { - string line; - - getline(f, line); - - size_t p; - - p=line.find('#'); - - if (p != std::string::npos) - line=line.substr(0, p); - - string::iterator b, e, c; - - vector<string> words; - - b=line.begin(); - e=line.end(); - - bool found=false; - - while (b != e) - { - if (unicode_isspace((unsigned char)*b)) - { - b++; - continue; - } - c=b; - while (b != e && !unicode_isspace((unsigned char) - *b)) - b++; - - string w=string(c, b); - - if (strcasecmp(w.c_str(), searchKey.c_str()) - == 0) - found=true; - words.push_back(w); - } - - if (found) - { - type=words[0]; - extensions.insert(extensions.end(), - words.begin()+1, - words.end()); - return; - } - } - } -} - -mail::mimetypes::~mimetypes() -{ -} |
