libircpp
Version: 0.0.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
irc::user Class Reference

#include <irc/user.hpp>

Detailed Description

The user class models and IRC user.

Public Member Functions

 user (std::string nick_)
 Constructor. More...
 
 user (std::string nick_, prefix pfx_)
 Constructor. More...
 
const std::string & get_nick () const
 returns the nick for this user More...
 
const prefixget_prefix () const
 returns the prefix for this user More...
 
mode_block & get_modes ()
 returns the mode block for this user More...
 
const mode_block & get_modes () const
 const version More...
 
template<typename F >
bsig::connection connect_on_channel_message (F &&f)
 connect to the on_channel_message signal More...
 
template<typename F >
bsig::connection connect_on_direct_message (F &&f)
 connect to the on_direct_message signal More...
 
template<typename F >
bsig::connection connect_on_nick_change (F &&f)
 connect to the on_nick_change signal More...
 
template<typename F >
bsig::connection connect_on_notice (F &&f)
 connect to the on_notice signal More...
 

Constructor & Destructor Documentation

irc::user::user ( std::string  nick_)

Constructor.

Parameters
nick_The user nickname.
irc::user::user ( std::string  nick_,
prefix  pfx_ 
)

Constructor.

Parameters
nick_The user nickname.
pfx_The user hostmask.

Member Function Documentation

template<typename F >
bsig::connection irc::user::connect_on_channel_message ( F &&  f)

connect to the on_channel_message signal

Parameters
fthe function to callback.

This signal is triggered when ever the user has sent a channel a private message, the format of the callback is:

void f(irc::channel&, irc::user&, const std::string& msg)
Returns
the connection object to disconnect from the signal
template<typename F >
bsig::connection irc::user::connect_on_direct_message ( F &&  f)

connect to the on_direct_message signal

Parameters
fthe function to callback.

this signal is triggered when ever the user has sent a private message directly to you

void f(irc::user&, const std::string& msg)
Returns
the connection object to disconnect from the signal
template<typename F >
bsig::connection irc::user::connect_on_nick_change ( F &&  f)

connect to the on_nick_change signal

Parameters
fthe function to callback.

this signal is triggered when ever this users nick has been changed

void f(irc::user&, const std::string& new_nick)
Returns
the connection object to disconnect from the signal
template<typename F >
bsig::connection irc::user::connect_on_notice ( F &&  f)

connect to the on_notice signal

Parameters
fthe function to callback.

this signal is triggered when ever this users nick has sent you a notice

void f(irc::user&, const std::string& notice)
Returns
the connection object to disconnect from the signal
mode_block& irc::user::get_modes ( )

returns the mode block for this user

Returns
the mode block
const mode_block& irc::user::get_modes ( ) const

const version

Returns
the mode block
See Also
get_modes
const std::string& irc::user::get_nick ( ) const

returns the nick for this user

Returns
the name
const prefix& irc::user::get_prefix ( ) const

returns the prefix for this user

Returns
the prefix