Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::CaseInsensitiveCharTraits Struct Reference

Type traits for case-insensitive string comparison, usable with algorithms that accept an STL std::char_traits. More...

#include "donner/base/StringUtils.h"

Inheritance diagram for donner::CaseInsensitiveCharTraits:
[legend]
Collaboration diagram for donner::CaseInsensitiveCharTraits:
[legend]

Static Public Member Functions

static bool eq (char lhs, char rhs)
 Compare two characters for equality.
 
static bool ne (char lhs, char rhs)
 Compare two characters for inequality.
 
static bool lt (char lhs, char rhs)
 Compare two characters for less-than.
 
static int compare (const char *lhs, const char *rhs, size_t sizeToCompare)
 Compare two strings for equality, returning -1 if lhs is less than rhs, 0 if they are equal, or 1 if lhs is greater than rhs.
 
static const char * find (const char *str, size_t size, char ch)
 Find the first occurrence of a character in a string using a case-insensitive match.
 

Detailed Description

Type traits for case-insensitive string comparison, usable with algorithms that accept an STL std::char_traits.

Member Function Documentation

◆ compare()

static int donner::CaseInsensitiveCharTraits::compare ( const char * lhs,
const char * rhs,
size_t sizeToCompare )
inlinestatic

Compare two strings for equality, returning -1 if lhs is less than rhs, 0 if they are equal, or 1 if lhs is greater than rhs.

Parameters
lhsLeft-hand side string.
rhsRight-hand side string.
sizeToCompareThe number of characters to compare.

◆ eq()

static bool donner::CaseInsensitiveCharTraits::eq ( char lhs,
char rhs )
inlinestatic

Compare two characters for equality.

Parameters
lhsLeft-hand side character.
rhsRight-hand side character.

◆ find()

static const char * donner::CaseInsensitiveCharTraits::find ( const char * str,
size_t size,
char ch )
inlinestatic

Find the first occurrence of a character in a string using a case-insensitive match.

Parameters
strThe string to search.
sizeThe size of the string.
chThe character to search for.

◆ lt()

static bool donner::CaseInsensitiveCharTraits::lt ( char lhs,
char rhs )
inlinestatic

Compare two characters for less-than.

Parameters
lhsLeft-hand side character.
rhsRight-hand side character.

◆ ne()

static bool donner::CaseInsensitiveCharTraits::ne ( char lhs,
char rhs )
inlinestatic

Compare two characters for inequality.

Parameters
lhsLeft-hand side character.
rhsRight-hand side character.

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