OSB_LIB::StrCmp< S > Struct Template Reference

Inheritance diagram for OSB_LIB::StrCmp< S >:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::StrCmp< S >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename S = std::string>
struct OSB_LIB::StrCmp< S >

Template to compare 2 strings, optionally case-insensitive.

Parameters:
S String type to compare.
Usage example
      int foo(
          const std::string& lhs,
          const std::string& rhs
      )
      {
          // case-insensitive comparison
          return StrCmp<>(true)(lhs, rhs);
      }

Definition at line 277 of file stringutil.h.

Public Member Functions

Private Attributes


Constructor & Destructor Documentation

template<typename S = std::string>
OSB_LIB::StrCmp< S >::StrCmp ( bool  ignoreCase = false  )  [inline, explicit]

Constructor with flag to ignore the case.

Definition at line 279 of file stringutil.h.


Member Function Documentation

template<typename S>
int OSB_LIB::StrCmp< S >::operator() ( const S &  lhs,
const S &  rhs 
) const

The comparison function.

Parameters:
lhs Left-side string to compare.
rhs Right-side string to compare.
Returns:
<0 if lhs < rhs
0 if lhs == rhs
>0 if lhs > rhs.

Definition at line 658 of file stringutil.h.

References OSB_LIB::StrCmp< S >::ignoreCase_.


Member Data Documentation

template<typename S = std::string>
bool OSB_LIB::StrCmp< S >::ignoreCase_ [private]

Flag to ignore the case when comparing strings.

Definition at line 300 of file stringutil.h.

Referenced by OSB_LIB::StrCmp< S >::operator()().


The documentation for this struct was generated from the following file:
Generated on Sat Sep 2 14:13:16 2006 for OSB Library by  doxygen 1.4.7