#include <user.h>
Public Member Functions | |
bool | is_user () const |
Determine if this entity is a user object. | |
bool | is_channel () const |
Determine if this entity is a channel object. | |
const std::string & | username () const |
Returns the user's username (ident), if known. | |
const std::string & | hostname () const |
Returns the user's hostname, if known. | |
const std::string & | realname () const |
Returns the user's realname (gecos), if known. | |
const std::string & | nuh () const |
Returns the user's nick!user string. | |
const unsigned long | signon_time () const |
Returns the user's signon time, if known. | |
void | ptr (void *p) const |
Sets the user-defined pointer. | |
void * | ptr () const |
Returns the user-defined pointer. | |
const std::string & | nick () const |
Returns the nick (name) of the entity. | |
const std::string & | name () const |
Returns the name of the entity. | |
const session & | parent () const |
Returns the parent session. | |
const user & | to_user () const |
Convert an entity object to a user object. | |
const channel & | to_channel () const |
Convert an entity object to a channel object. | |
bool | is_temporary () const |
Determine whether the entity is temporary or not. | |
bool | cmd_privmsg (const std::string &text) const |
Send a message to the entity. | |
bool | cmd_notice (const std::string &text) const |
Send a notice to the entity. | |
bool | cmd_mode (const std::string &modestring) const |
Send a mode command to the entity. | |
bool | cmd_ctcp (const std::string &command, const std::string &text="") const |
Send a CTCP message to the entity. | |
bool | cmd_action (const std::string &text) const |
Send a CTCP ACTION message to the entity. | |
Public Attributes | |
boost::signal1< void, const message & > | sig_nick_msg |
Emitted when the user's nick changes. | |
boost::signal1< void, entity & > | sig_deletable |
Emitted when an entity may be safely deleted. | |
boost::signal1< void, entity & > | sig_deleting |
Emitted when an entity is about to be deleted. | |
boost::signal1< void, const message & > | sig_privmsg_msg |
Emitted when the entity receives a PRIVMSG. | |
boost::signal1< void, const message & > | sig_notice_msg |
Emitted when the entity receives a NOTICE. | |
boost::signal1< void, const message & > | sig_ctcp_msg |
Emitted when the entity receives a CTCP message. |
bool ircpp::user::is_user | ( | ) | const [virtual] |
bool ircpp::user::is_channel | ( | ) | const [virtual] |
Determine if this entity is a channel object.
An entity may represent either a user or a channel. If it represents a channel, this function will return true. You may then use to_channel() to return a correctly-typed reference to a channel object
Implements ircpp::entity.
const std::string & ircpp::user::username | ( | ) | const |
const std::string & ircpp::user::hostname | ( | ) | const |
Returns the user's hostname, if known.
const std::string & ircpp::user::realname | ( | ) | const |
Returns the user's realname (gecos), if known.
The realname may not be known if you have not done a WHO or WHOIS on the user. If this function returns blank, try again after a WHOIS.
const std::string & ircpp::user::nuh | ( | ) | const |
Returns the user's nick!user string.
Often the nick, username, and hostname are presented in the form nick!user. This function returns the nick, username, and hostname in that format.
If the user or hostname are not known, this function will return the nick.
const unsigned long ircpp::user::signon_time | ( | ) | const |
Returns the user's signon time, if known.
This is the time the user signed on to IRC, in standard unix time format (seconds since 1 January 1970
If not known, 0 will be returned.
void ircpp::user::ptr | ( | void * | p | ) | const |
Sets the user-defined pointer.
To help keep track of users, you can save a user-defined pointer inside the user object.
The user-defined pointer is of type void *, and you can set it to anything you like
p | The user-defined pointer to set |
void * ircpp::user::ptr | ( | ) | const |
Returns the user-defined pointer.
If the user-defined pointer has not yet been set, it will be NULL
const string & ircpp::entity::nick | ( | ) | const [inherited] |
const string & ircpp::entity::name | ( | ) | const [inherited] |
const session & ircpp::entity::parent | ( | ) | const [inherited] |
const user & ircpp::entity::to_user | ( | ) | const [inherited] |
Convert an entity object to a user object.
An entity object may be either a user or a channel. If it is a user, this function can be used to convert an entity reference to a user reference.
This function is included for convenience. It has the same effect as dynamic_cast<const user&>, but will not throw an exception if the entity is not a user. Instead it will return the null user object.
You can use is_user() to determine whether the entity is actually a user or not before using this function.
const channel & ircpp::entity::to_channel | ( | ) | const [inherited] |
Convert an entity object to a channel object.
An entity object may be either a user or a channel. If it is a channel, this function can be used to convert an entity reference to a channel reference.
This function is included for convenience. It has the same effect as dynamic_cast<const channel&>, but will not throw an exception if the entity is not a channel. Instead it will return the null channel object.
You can use is_channel() to determine whether the entity is actually a channel or not before using this function.
bool ircpp::entity::is_temporary | ( | ) | const [inherited] |
Determine whether the entity is temporary or not.
Entities may be temporary (destroyed after the message they are attached to has been processed) or permanent (stored in a list and accessible until they are deleted). This function determines whether an entity is temporary or permanent.
bool ircpp::entity::cmd_privmsg | ( | const std::string & | text | ) | const [inherited] |
bool ircpp::entity::cmd_notice | ( | const std::string & | text | ) | const [inherited] |
bool ircpp::entity::cmd_mode | ( | const std::string & | modestring | ) | const [inherited] |
bool ircpp::entity::cmd_ctcp | ( | const std::string & | command, | |
const std::string & | text = "" | |||
) | const [inherited] |
bool ircpp::entity::cmd_action | ( | const std::string & | text | ) | const [inherited] |
boost::signal1<void, const message &> ircpp::user::sig_nick_msg [mutable] |
boost::signal1<void, entity&> ircpp::entity::sig_deletable [mutable, inherited] |
Emitted when an entity may be safely deleted.
When the session has its lists set to manual mode, it is your responsibility to delete user and channel objects when finished with them. This signal indicates that libircpp has finshed with this entity , and you may safely delete it when you no longer need it. For more information, see the manual section on lists Note that this signal is specific to one entity. If you wish to be notified when any user/channel becomes deletable, you should use session::user_deletable and session::channel_deletable
boost::signal1<void, entity&> ircpp::entity::sig_deleting [mutable, inherited] |
boost::signal1<void, const message&> ircpp::entity::sig_privmsg_msg [mutable, inherited] |
boost::signal1<void, const message&> ircpp::entity::sig_notice_msg [mutable, inherited] |
boost::signal1<void, const message&> ircpp::entity::sig_ctcp_msg [mutable, inherited] |