ignorecase_traits Struct Reference

#include <ci_traits.hpp>

List of all members.


Detailed Description

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.

Static Public Member Functions

static bool eq (const char &c1, const char &c2)
 Member function eq return true is c1 and c2 are equal.
static bool lt (const char &c1, const char &c2)
 Member function lt return true is c1 less than c2.
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.
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.


Member Function Documentation

static bool ignorecase_traits::eq ( const char &  c1,
const char &  c2 
) [inline, static]

Member function eq return true is c1 and c2 are equal.

Parameters:
c1 a char const reference to character to compare.
c2 a char const reference to character to compare.
Returns:
a bool of true if c1 and c2 are equal

Definition at line 33 of file ci_traits.hpp.

static bool ignorecase_traits::lt ( const char &  c1,
const char &  c2 
) [inline, static]

Member function lt return true is c1 less than c2.

Parameters:
c1 a char const ...
c2 a char const ...
Returns:
a bool ...

Definition at line 46 of file ci_traits.hpp.

int ignorecase_traits::compare ( const char *  s1,
const char *  s2,
std::size_t  n 
) [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.

Parameters:
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.
Returns:
an int value of -1 if s1 is less then s2, 0 if they are equal, and 1 if s1 is greater than s2.

Definition at line 12 of file ci_traits.cpp.

const char * ignorecase_traits::find ( const char *  s,
std::size_t  n,
const char &  c 
) [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.

Parameters:
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.
Returns:
a char pointer to first occurrence or 0 is not found.

Definition at line 25 of file ci_traits.cpp.


The documentation for this struct was generated from the following files:
Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7