compare mime types w/strcasecmp

git-svn-id: http://s3fs.googlecode.com/svn/trunk@166 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
rrizun 2008-05-19 17:24:25 +00:00
parent 66887436b5
commit a2d7ad4225

View File

@ -44,6 +44,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <strings.h>
using namespace std; using namespace std;
@ -859,7 +860,13 @@ s3fs_readlink(const char *path, char *buf, size_t size) {
return 0; return 0;
} }
typedef map<string, string> mimes_t; struct case_insensitive_compare_func {
bool operator ()(const string &a, const string &b) {
return strcasecmp(a.c_str(), b.c_str()) < 0;
}
};
typedef map<string, string, case_insensitive_compare_func> mimes_t;
static mimes_t mimeTypes; static mimes_t mimeTypes;