LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::details::CaseInsensitiveComparer Struct Reference

#include "MultipleChoiceSelection.h"

Static Public Member Functions

static bool equal (std::string const &a, std::string const &b)
 Returns whether strings a and b are equal. More...
 
static bool less (std::string const &a, std::string const &b)
 Returns whether a is lexicographically smaller than b. More...
 

Static Private Member Functions

static bool cmp_lower (unsigned char a, unsigned char b)
 
static bool eq_lower (unsigned char a, unsigned char b)
 

Detailed Description

Definition at line 35 of file MultipleChoiceSelection.h.

Member Function Documentation

bool util::details::CaseInsensitiveComparer::cmp_lower ( unsigned char  a,
unsigned char  b 
)
inlinestaticprivate

Definition at line 504 of file MultipleChoiceSelection.h.

Referenced by less().

505 {
506  return std::tolower(a) < std::tolower(b);
507 }
bool util::details::CaseInsensitiveComparer::eq_lower ( unsigned char  a,
unsigned char  b 
)
inlinestaticprivate

Definition at line 510 of file MultipleChoiceSelection.h.

Referenced by equal().

511 {
512  return std::tolower(a) == std::tolower(b);
513 }
bool util::details::CaseInsensitiveComparer::equal ( std::string const &  a,
std::string const &  b 
)
inlinestatic

Returns whether strings a and b are equal.

Definition at line 491 of file MultipleChoiceSelection.h.

References eq_lower().

Referenced by util::details::MultipleChoiceSelectionOption_t< Choices >::operator!=(), and util::details::MultipleChoiceSelectionOption_t< Choices >::operator==().

493 {
494  return std::equal(a.begin(), a.end(), b.begin(), b.end(), eq_lower);
495 }
static bool eq_lower(unsigned char a, unsigned char b)
bool util::details::CaseInsensitiveComparer::less ( std::string const &  a,
std::string const &  b 
)
inlinestatic

Returns whether a is lexicographically smaller than b.

Definition at line 498 of file MultipleChoiceSelection.h.

References cmp_lower().

Referenced by my_lexicographical_compare().

499 {
500  return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end(), cmp_lower);
501 } // util::details::CaseInsensitiveComparer::less()
static bool cmp_lower(unsigned char a, unsigned char b)

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