ircproxy  The Ultimate Cyborg

UserMode.h File Reference


Detailed Description

This file contains the declaration of class UserMode.

Definition in file UserMode.h.

#include <cctype>
#include "Watched.h"
#include "MessageIn.h"

Go to the source code of this file.

Classes

struct  UserModeMask
class  UserMode
 A class representing a user mode. More...

Functions

uint32_t make_uppercase_usermode_mask (char c)
uint32_t make_lowercase_usermode_mask (char c)
UserModeMask operator| (UserModeMask const &um, char c)
 Return UserModeMask um but with usermode c set.
UserModeMask operator| (UserModeMask const &um1, UserModeMask const &um2)
 Return a bitwise OR-ed UserModeMask of um1 and um2.
UserModeMask operator & (UserModeMask const &um, char c)
 Return a UserModeMask with only usermode c set, provided it is also set in UserModeMask um.
UserModeMask operator & (UserModeMask const &um1, UserModeMask const &um2)
 Return a bitwise AND-ed UserModeMask of um1 and um2.
UserModeMask operator^ (UserModeMask const &um, char c)
 Return UserModeMask um with usermode c toggled.
UserModeMask operator^ (UserModeMask const &um1, UserModeMask const &um2)
 Return a bitwise XOR-ed UserModeMask of um1 and um2.


Function Documentation

uint32_t make_uppercase_usermode_mask ( char  c  )  [inline]

For internal use only.

Definition at line 28 of file UserMode.h.

References ASSERT.

Referenced by UserModeMask::operator &=(), UserModeMask::operator=(), UserModeMask::operator^=(), and UserModeMask::operator|=().

00029 {
00030   ASSERT(std::isupper(c));
00031   return 1 << (c - 'A');
00032 }

uint32_t make_lowercase_usermode_mask ( char  c  )  [inline]

For internal use only.

Definition at line 36 of file UserMode.h.

References ASSERT.

Referenced by UserModeMask::operator &=(), UserModeMask::operator=(), UserModeMask::operator^=(), and UserModeMask::operator|=().

00037 {
00038   ASSERT(std::islower(c));
00039   return 1 << (c - 'a');
00040 }

UserModeMask operator| ( UserModeMask const &  um,
char  c 
) [inline]

Return UserModeMask um but with usermode c set.

Definition at line 101 of file UserMode.h.

00102 {
00103   UserModeMask result(um);
00104   return result |= c;
00105 }

UserModeMask operator| ( UserModeMask const &  um1,
UserModeMask const &  um2 
) [inline]

Return a bitwise OR-ed UserModeMask of um1 and um2.

Definition at line 108 of file UserMode.h.

00109 {
00110   UserModeMask result(um1);
00111   return result |= um2;
00112 }

UserModeMask operator & ( UserModeMask const &  um,
char  c 
) [inline]

Return a UserModeMask with only usermode c set, provided it is also set in UserModeMask um.

Definition at line 115 of file UserMode.h.

00116 {
00117   UserModeMask result(um);
00118   return result &= c;
00119 }

UserModeMask operator & ( UserModeMask const &  um1,
UserModeMask const &  um2 
) [inline]

Return a bitwise AND-ed UserModeMask of um1 and um2.

Definition at line 122 of file UserMode.h.

00123 {
00124   UserModeMask result(um1);
00125   return result &= um2;
00126 }

UserModeMask operator^ ( UserModeMask const &  um,
char  c 
) [inline]

Return UserModeMask um with usermode c toggled.

Definition at line 129 of file UserMode.h.

00130 {
00131   UserModeMask result(um);
00132   return result ^= c;
00133 }

UserModeMask operator^ ( UserModeMask const &  um1,
UserModeMask const &  um2 
) [inline]

Return a bitwise XOR-ed UserModeMask of um1 and um2.

Definition at line 136 of file UserMode.h.

00137 {
00138   UserModeMask result(um1);
00139   return result ^= um2;
00140 }


Copyright © 2005-2007 Carlo Wood.  All rights reserved.