openModeller  Version 1.5.0
ignorecase_traits.cpp
Go to the documentation of this file.
1 #ifdef WIN32
2 // avoid warnings caused by problems in VC headers
3 #define _SCL_SECURE_NO_DEPRECATE
4 #endif
5 
7 
8 using std::size_t;
9 
10 int
11 ignorecase_traits::compare(const char* s1, const char* s2, size_t n)
12 {
13  for( size_t i=0; i<n; ++i ) {
14  if (!eq(s1[i],s2[i])) {
15  return lt(s1[i],s2[i])?-1:1;
16  }
17  }
18  return 0;
19 }
20 
21 const char*
22 ignorecase_traits::find( const char* s, size_t n, const char& c )
23 {
24  for ( size_t i=0; i<n; ++i ) {
25  if (eq(s[i],c)) {
26  return &(s[i]);
27  }
28  }
29  return 0;
30 }
31 
static bool lt(const char &c1, const char &c2)
static const char * find(const char *s, std::size_t n, const char &c)
static int compare(const char *s1, const char *s2, std::size_t n)
static bool eq(const char &c1, const char &c2)