DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
CppUtils::Strings::ci_char_traits Struct Reference

#include <ciString.hpp>

Inheritance diagram for CppUtils::Strings::ci_char_traits:

Static Public Member Functions

static constexpr char ct_toupper (char ch_) noexcept
 
static constexpr int compare (const char *s1_, const char *s2_, std::size_t count_) noexcept
 
static constexpr const char * find (const char *p_, std::size_t count_, const char &ch_) noexcept
 
static constexpr bool eq (char a, char b) noexcept
 
static constexpr bool lt (char a, char b) noexcept
 

Detailed Description

A character traits structure allowing for case-insensitive string comparisons. Overloads the functions it needs and inherits the rest from std::char_traits<char>.

Member Function Documentation

◆ ct_toupper()

static constexpr char CppUtils::Strings::ci_char_traits::ct_toupper ( char ch_)
inlinestaticconstexprnoexcept

Convert a character, ch_, to uppercase at compile-time.

Parameters
ch_- The character to convert to uppercase
Returns
The uppercase version of ch_ if ch_ falls between 'a' and 'z' inclusive

Referenced by compare(), eq(), find(), and lt().

◆ compare()

static constexpr int CppUtils::Strings::ci_char_traits::compare ( const char * s1_,
const char * s2_,
std::size_t count_ )
inlinestaticconstexprnoexcept

Lexicographically, and without regard to case, compares the first count_ characters of the character strings s1_ and s2_.

Parameters
s1_- A pointer to the first character string to compare
s2_- A pointer to the second character string to compare
count_- The number of characters to compare from each character string
Returns
Zero if the two strings are equal or count is zero

References ct_toupper().

◆ find()

static constexpr const char * CppUtils::Strings::ci_char_traits::find ( const char * p_,
std::size_t count_,
const char & ch_ )
inlinestaticconstexprnoexcept

Searches for character ch_ within the first count_ characters of the sequence pointed to by p_.

Parameters
p_- A pointer to a character string to search
count_- The number of characters to analyze
ch_- The character to search for
Returns
nullptr if ch is not found in the string or count is 0

References ct_toupper().

◆ eq()

static constexpr bool CppUtils::Strings::ci_char_traits::eq ( char a,
char b )
inlinestaticconstexprnoexcept

References ct_toupper().

◆ lt()

static constexpr bool CppUtils::Strings::ci_char_traits::lt ( char a,
char b )
inlinestaticconstexprnoexcept

References ct_toupper().


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