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

hashcomp.h File Reference

#include "inspircd_config.h"
#include "socket.h"
#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
namespace  nspace

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...
class  irc::dynamicbitmask
 The irc::dynamicbitmask class is used to maintain a bitmap of boolean values, which can grow to any reasonable size no matter how many bitfields are in it. More...
struct  nspace::hash< irc::string >
 Hashing function to hash irc::string. More...
struct  nspace::hash< std::string >

Typedefs

typedef basic_string< char,
irc_char_traits, allocator<
char > > 
irc::string
 This typedef declares irc::string based upon irc_char_traits.
typedef std::pair< size_t,
unsigned char > 
irc::bitfield
 Used to hold a bitfield definition in dynamicbitmask.

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)
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 nspace::strlower (char *n)
 Convert a string to lower case respecting RFC1459.

Variables

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


Function Documentation

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

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

Definition at line 623 of file hashcomp.h.

00623 { return other.c_str(); }

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

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

Definition at line 619 of file hashcomp.h.

Referenced by ListModeBase::DoSyncChannel(), ModuleSVSHold::ExpireBans(), irc::tokenstream::GetToken(), cmd_svshold::Handle(), cmd_clones::Handle(), ModuleSVSHold::OnDecodeMetaData(), ListModeBase::OnModeChange(), Modulewatch::OnUserPostNick(), ModuleSVSHold::OnUserPreNick(), TreeSocket::ProcessLine(), ModuleHelpop::ReadConfig(), and ListModeBase::RemoveMode().

00619 { return other.c_str(); }

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

Definition at line 592 of file hashcomp.h.

00593 {
00594         return leftval + irc::string(rightval.c_str());
00595 }

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

Definition at line 582 of file hashcomp.h.

00583 {
00584         return leftval + std::string(rightval.c_str());
00585 }

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

Operator << for irc::string.

Definition at line 565 of file hashcomp.h.

00565 { return os << str.c_str(); }

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

Definition at line 612 of file hashcomp.h.

00613 {
00614         return (leftval == rightval.c_str());
00615 }

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

Definition at line 602 of file hashcomp.h.

00603 {
00604         return (leftval.c_str() == rightval);
00605 }

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

Operator >> for irc::string.

Definition at line 569 of file hashcomp.h.

00570 {
00571         std::string tmp;
00572         is >> tmp;
00573         str = tmp.c_str();
00574         return is;
00575 }

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

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

Definition at line 627 of file hashcomp.h.

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

00628 {
00629         std::string::size_type start = str.find_first_not_of(" ");
00630         std::string::size_type end = str.find_last_not_of(" ");
00631         if (start == std::string::npos || end == std::string::npos)
00632                 str = "";
00633         else
00634                 str = str.substr(start, end-start+1);
00635 
00636         return str;
00637 }


Variable Documentation

unsigned const char lowermap[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 50 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(), irc::irc_char_traits::ne(), irc::StrHashComp::operator()(), nspace::hash< irc::string >::operator()(), and nspace::strlower().