The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

irc::irc_char_traits Struct Reference

The irc_char_traits class is used for RFC-style comparison of strings. More...

#include <hashcomp.h>

Inheritance diagram for irc::irc_char_traits:

Inheritance graph
[legend]
Collaboration diagram for irc::irc_char_traits:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static bool eq (char c1st, char c2nd)
 Check if two chars match.
static bool ne (char c1st, char c2nd)
 Check if two chars do NOT match.
static bool lt (char c1st, char c2nd)
 Check if one char is less than another.
static CoreExport int compare (const char *str1, const char *str2, size_t n)
 Compare two strings of size n.
static CoreExport const char * find (const char *s1, int n, char c)
 Find a char within a string up to position n.

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.

Definition at line 100 of file hashcomp.h.


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:
str1 First string
str2 Second string
n Length 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.

Definition at line 134 of file hashcomp.cpp.

References rfc_case_insensitive_map.

bool irc::irc_char_traits::eq char  c1st,
char  c2nd
[static]
 

Check if two chars match.

Parameters:
c1st First character
c2nd Second character
Returns:
true if the characters are equal

Definition at line 119 of file hashcomp.cpp.

References rfc_case_insensitive_map.

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:
s1 String to find in
n Position to search up to
c Character to search for
Returns:
Pointer to the first occurance of c in s1

Definition at line 153 of file hashcomp.cpp.

References rfc_case_insensitive_map.

bool irc::irc_char_traits::lt char  c1st,
char  c2nd
[static]
 

Check if one char is less than another.

Parameters:
c1st First character
c2nd Second character
Returns:
true if c1st is less than c2nd

Definition at line 129 of file hashcomp.cpp.

References rfc_case_insensitive_map.

bool irc::irc_char_traits::ne char  c1st,
char  c2nd
[static]
 

Check if two chars do NOT match.

Parameters:
c1st First character
c2nd Second character
Returns:
true if the characters are unequal

Definition at line 124 of file hashcomp.cpp.

References rfc_case_insensitive_map.


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