InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
Static Public Member Functions | List of all members
irc::irc_char_traits Struct Reference

#include <hashcomp.h>

Inheritance diagram for irc::irc_char_traits:

Static Public Member Functions

static bool eq (char c1st, char c2nd)
 
static bool ne (char c1st, char c2nd)
 
static bool lt (char c1st, char c2nd)
 
static CoreExport int compare (const char *str1, const char *str2, size_t n)
 
static CoreExport const char * find (const char *s1, int n, char c)
 

Detailed Description

The irc_char_traits class is used for RFC-style comparison of strings. This class is used to implement irc::string, a case-insensitive, RFC- comparing string class.

Member Function Documentation

int irc::irc_char_traits::compare ( const char *  str1,
const char *  str2,
size_t  n 
)
static

Compare two strings of size n.

Parameters
str1First string
str2Second string
nLength to compare to
Returns
similar to strcmp, zero for equal, less than zero for str1 being less and greater than zero for str1 being greater than str2.
bool irc::irc_char_traits::eq ( char  c1st,
char  c2nd 
)
static

Check if two chars match.

Parameters
c1stFirst character
c2ndSecond character
Returns
true if the characters are equal
const char * irc::irc_char_traits::find ( const char *  s1,
int  n,
char  c 
)
static

Find a char within a string up to position n.

Parameters
s1String to find in
nPosition to search up to
cCharacter to search for
Returns
Pointer to the first occurance of c in s1
bool irc::irc_char_traits::lt ( char  c1st,
char  c2nd 
)
static

Check if one char is less than another.

Parameters
c1stFirst character
c2ndSecond character
Returns
true if c1st is less than c2nd
bool irc::irc_char_traits::ne ( char  c1st,
char  c2nd 
)
static

Check if two chars do NOT match.

Parameters
c1stFirst character
c2ndSecond character
Returns
true if the characters are unequal

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