ircproxy  The Ultimate Cyborg

UserMode Class Reference

#include <UserMode.h>

List of all members.


Detailed Description

A class representing a user mode.

Definition at line 143 of file UserMode.h.


Public Member Functions

 UserMode (void)
 Default constructor.
WatchedExpression< UserModeMaskoperator* (void)
 Dereference operator. Returns the underlying UserModeMask as WatchedExpression.
void new_server_message_received (ServerMessageIn const &msg)
 Decode the MODE message msg and store the user mode.

Private Attributes

Watched< UserModeMaskM_mask
 Watchable UserModeMask.

Constructor & Destructor Documentation

UserMode::UserMode ( void   )  [inline]

Default constructor.

Definition at line 149 of file UserMode.h.

00149 : M_mask("UserMode::M_mask") { }


Member Function Documentation

WatchedExpression<UserModeMask> UserMode::operator* ( void   )  [inline]

Dereference operator. Returns the underlying UserModeMask as WatchedExpression.

Definition at line 153 of file UserMode.h.

References M_mask.

00153 { return *M_mask; }

void UserMode::new_server_message_received ( ServerMessageIn const &  msg  ) 

Decode the MODE message msg and store the user mode.

Definition at line 25 of file UserMode.cc.

References DoutEntering, M_mask, and MessageIn::param().

Referenced by ServerSession::new_message_received().

00026 {
00027   DoutEntering(dc::notice, "UserMode::new_server_message_received(" << msg << ")"); 
00028   std::string mode_string = msg.param(1);
00029   bool add = true;
00030   for (std::string::iterator iter = mode_string.begin(); iter != mode_string.end(); ++iter)
00031   {
00032     if (*iter == '+')
00033       add = true;
00034     else if (*iter == '-')
00035       add = false;
00036     else if (add)
00037       M_mask |= *iter; 
00038     else
00039       M_mask &= ~*iter;
00040   }
00041   Dout(dc::notice, "M_mask is now " << M_mask);
00042 }


Member Data Documentation

Watchable UserModeMask.

Definition at line 145 of file UserMode.h.

Referenced by new_server_message_received(), and operator*().


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

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