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

hashcomp.h File Reference

#include <cstring>
#include "hash_map.h"

Include dependency graph for hashcomp.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  irc

Classes

struct  irc::StrHashComp
 This class returns true if two strings match. More...
struct  irc::irc_char_traits
 The irc_char_traits class is used for RFC-style comparison of strings. More...
class  irc::stringjoiner
 irc::stringjoiner joins string lists into a string, using the given seperator string. More...
class  irc::modestacker
 irc::modestacker stacks mode sequences into a list. More...
class  irc::tokenstream
 irc::tokenstream reads a string formatted as per RFC1459 and RFC2812. More...
class  irc::sepstream
 irc::sepstream allows for splitting token seperated lists. More...
class  irc::commasepstream
 A derived form of sepstream, which seperates on commas. More...
class  irc::spacesepstream
 A derived form of sepstream, which seperates on spaces. More...
class  irc::portparser
 The portparser class seperates out a port range into integers. More...
struct  hash< irc::string >
 Hashing function to hash irc::string. More...
struct  hash< std::string >

Typedefs

typedef std::basic_string<
char, irc_char_traits, std::allocator<
char > > 
irc::string
 This typedef declares irc::string based upon irc_char_traits.

Functions

std::string irc::hex (const unsigned char *raw, size_t rawsz)
 Compose a hex string from raw data.
CoreExport const char * irc::Spacify (const char *n)
 Turn _ characters in a string into spaces.
std::ostream & operator<< (std::ostream &os, const irc::string &str)
 Operator << for irc::string.
std::istream & operator>> (std::istream &is, irc::string &str)
 Operator >> for irc::string.
std::string operator+ (std::string &leftval, irc::string &rightval)
irc::string operator+ (irc::string &leftval, std::string &rightval)
bool operator== (const std::string &leftval, const irc::string &rightval)
bool operator== (const irc::string &leftval, const std::string &rightval)
bool operator!= (const irc::string &leftval, const std::string &rightval)
bool operator!= (const std::string &leftval, const irc::string &rightval)
std::string assign (const irc::string &other)
 Assign an irc::string to a std::string.
irc::string assign (const std::string &other)
 Assign a std::string to an irc::string.
std::stringtrim (std::string &str)
 Trim the leading and trailing spaces from a std::string.
void strlower (char *n)
 Convert a string to lower case respecting RFC1459.

Variables

unsigned const char rfc_case_insensitive_map [256]
 A mapping of uppercase to lowercase, including scandinavian 'oddities' as specified by RFC1459, e.g.
unsigned const char case_sensitive_map [256]
 Case sensitive map.


Function Documentation

irc::string assign const std::string other  )  [inline]
 

Assign a std::string to an irc::string.

Definition at line 562 of file hashcomp.h.

std::string assign const irc::string other  )  [inline]
 

Assign an irc::string to a std::string.

Definition at line 558 of file hashcomp.h.

Referenced by BanRedirect::BeforeMode(), ModuleSpanningTree::ConnectServer(), irc::tokenstream::GetToken(), CommandClones::Handle(), ModuleSpanningTree::HandleConnect(), ModuleSQLOper::OnRehash(), ModuleSpanningTree::OnUserPostNick(), ModuleServicesAccount::OnUserPostNick(), TreeSocket::Outbound_Reply_Server(), TreeSocket::ProcessLine(), ModuleHelpop::ReadConfig(), SpanningTreeUtilities::ReadConfiguration(), and TreeSocket::ServerMessage().

bool operator!= const std::string leftval,
const irc::string rightval
[inline]
 

Definition at line 536 of file hashcomp.h.

bool operator!= const irc::string leftval,
const std::string rightval
[inline]
 

Definition at line 529 of file hashcomp.h.

irc::string operator+ irc::string leftval,
std::string rightval
[inline]
 

Definition at line 502 of file hashcomp.h.

std::string operator+ std::string leftval,
irc::string rightval
[inline]
 

Definition at line 492 of file hashcomp.h.

std::ostream& operator<< std::ostream &  os,
const irc::string str
[inline]
 

Operator << for irc::string.

Definition at line 475 of file hashcomp.h.

bool operator== const irc::string leftval,
const std::string rightval
[inline]
 

Definition at line 522 of file hashcomp.h.

bool operator== const std::string leftval,
const irc::string rightval
[inline]
 

Definition at line 512 of file hashcomp.h.

std::istream& operator>> std::istream &  is,
irc::string str
[inline]
 

Operator >> for irc::string.

Definition at line 479 of file hashcomp.h.

void nspace::strlower char *  n  ) 
 

Convert a string to lower case respecting RFC1459.

Parameters:
n A string to lowercase

Definition at line 54 of file hashcomp.cpp.

References rfc_case_insensitive_map.

std::string& trim std::string str  )  [inline]
 

Trim the leading and trailing spaces from a std::string.

Definition at line 566 of file hashcomp.h.

Referenced by ModuleServicesAccount::OnDecodeMetaData(), and ModuleServicesAccount::OnSyncUserMetaData().


Variable Documentation

unsigned const char case_sensitive_map[256]
 

Initial value:

 {
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
        21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
        41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
        61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
        81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
        101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
        121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
        141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160,
        161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
        181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
        201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
        221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
        241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
}
Case sensitive map.

As per rfc_case_insensitive_map, but case sensitive. duh.

Definition at line 60 of file hashcomp.h.

Referenced by ModuleAlias::DoAlias().

unsigned const char rfc_case_insensitive_map[256]
 

Initial value:

 {
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,                                   
        20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,                         
        40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,                         
        60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,             
        112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 94, 95, 96, 97, 98, 99,           
        100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,     
        120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,     
        140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,     
        160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,     
        180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,     
        200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,     
        220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,     
        240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255                          
}
A mapping of uppercase to lowercase, including scandinavian 'oddities' as specified by RFC1459, e.g.

{ -> [, and | -> \

Definition at line 41 of file hashcomp.h.

Referenced by irc::irc_char_traits::compare(), irc::irc_char_traits::eq(), irc::irc_char_traits::find(), irc::irc_char_traits::lt(), match_internal(), irc::irc_char_traits::ne(), irc::StrHashComp::operator()(), and strlower().