|
Sierra Toolkit
Version of the Day
|
00001 /*------------------------------------------------------------------------*/ 00002 /* Copyright 2010 Sandia Corporation. */ 00003 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ 00004 /* license for use of this work by or on behalf of the U.S. Government. */ 00005 /* Export of this program may require a license from the */ 00006 /* United States Government. */ 00007 /*------------------------------------------------------------------------*/ 00008 00009 #ifndef STK_UTIL_UTIL_CI_TRAITS_H 00010 #define STK_UTIL_UTIL_CI_TRAITS_H 00011 00012 #include <cctype> 00013 #include <string> 00014 00022 struct ignorecase_traits : public std::char_traits<char> 00023 { 00033 static bool eq(const char &c1, const char &c2) { 00034 return std::toupper(c1) == std::toupper(c2); 00035 } 00036 00046 static bool lt(const char &c1, const char &c2) { 00047 return std::toupper(c1) < std::toupper(c2); 00048 } 00049 00063 static int compare(const char *s1, const char *s2, std::size_t n); 00064 00078 static const char *find(const char *s, std::size_t n, const char &c); 00079 }; 00080 00081 #endif // STK_UTIL_UTIL_CI_TRAITS_H