Sierra Toolkit
Version of the Day
|
Class ignorecase_traits is a character traits class that ignores case during compares. More...
#include <ci_traits.hpp>
Inherits char_traits< char >.
Static Public Member Functions | |
static bool | eq (const char &c1, const char &c2) |
Member function eq return true is c1 and c2 are equal. More... | |
static bool | lt (const char &c1, const char &c2) |
Member function lt return true is c1 less than c2. More... | |
static int | compare (const char *s1, const char *s2, std::size_t n) |
Member function compare compares up to n characters of s1 and s2 and returns -1 if s1 is less then s2, 0 if they are equal, and 1 if s1 is greater than s2. More... | |
static const char * | find (const char *s, std::size_t n, const char &c) |
Member function find returns char pointer to first occurrence of character c in first n characters of string s or 0 if not found. More... | |
Class ignorecase_traits is a character traits class that ignores case during compares.
Replace functions of the standard char_traits<char> so that strings behave in a case-insensitive way.
Definition at line 22 of file ci_traits.hpp.
|
inlinestatic |
Member function eq return true is c1 and c2 are equal.
c1 | a char const reference to character to compare. |
c2 | a char const reference to character to compare. |
Definition at line 33 of file ci_traits.hpp.
|
inlinestatic |
Member function lt return true is c1 less than c2.
c1 | a char const ... |
c2 | a char const ... |
Definition at line 46 of file ci_traits.hpp.
|
static |
Member function compare compares up to n characters of s1 and s2 and returns -1 if s1 is less then s2, 0 if they are equal, and 1 if s1 is greater than s2.
s1 | a char const pointer to string to compare. |
s2 | a char const pointer to string to compare. |
n | a std::size_t maxiumum number of character to compare. |
Definition at line 12 of file ci_traits.cpp.
|
static |
Member function find returns char pointer to first occurrence of character c in first n characters of string s or 0 if not found.
s | a char const pointer to string to search in. |
n | a std::size_t value of the maximum number of characters to compare. |
c | a char const reference to the character to search. |
Definition at line 25 of file ci_traits.cpp.