DP3
Public Types | Public Member Functions | List of all members
dp3::common::stringtools::Compare Class Reference

Functor to compare two strings. Strings can be compared case sensitive (NORMAL) and case insensitive (NOCASE). More...

#include <StringTools.h>

Public Types

enum  Mode { NORMAL , NOCASE }
 String comparison mode. More...
 

Public Member Functions

 Compare (Mode mode=NORMAL)
 
bool operator() (const std::string &s1, const std::string &s2) const
 The comparison operator. More...
 

Detailed Description

Functor to compare two strings. Strings can be compared case sensitive (NORMAL) and case insensitive (NOCASE).

Attention
This class does not handle locales properly. It does string comparison the way strcmp and strcasecmp (or stricmp for that matter) do it.

Member Enumeration Documentation

◆ Mode

String comparison mode.

Enumerator
NORMAL 
NOCASE 

Constructor & Destructor Documentation

◆ Compare()

dp3::common::stringtools::Compare::Compare ( Mode  mode = NORMAL)
inline

Constructor. Initialize the comparison criterion. Default is "normal" case sensitive comparison.

Member Function Documentation

◆ operator()()

bool dp3::common::stringtools::Compare::operator() ( const std::string &  s1,
const std::string &  s2 
) const
inline

The comparison operator.


The documentation for this class was generated from the following file: