Deduplicate case-insensitive functors (#2697)
This commit is contained in:
@ -23,20 +23,14 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <strings.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// headers_t
|
// headers_t
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
struct header_nocase_cmp
|
typedef std::map<std::string, std::string, case_insensitive_compare_func> headers_t;
|
||||||
{
|
|
||||||
bool operator()(const std::string &strleft, const std::string &strright) const
|
|
||||||
{
|
|
||||||
return (strcasecmp(strleft.c_str(), strright.c_str()) < 0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
typedef std::map<std::string, std::string, header_nocase_cmp> headers_t;
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Functions
|
// Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user