irccd  3.0.3
Public Member Functions | List of all members
irccd::test::debug_server Class Reference

Server which prints everything in the console. More...

#include <debug_server.hpp>

Inheritance diagram for irccd::test::debug_server:
irccd::daemon::server

Public Member Functions

void connect (connect_handler handler) noexcept override
 
void disconnect () noexcept override
 
void invite (std::string_view target, std::string_view channel) override
 
void join (std::string_view channel, std::string_view password="") override
 
void kick (std::string_view target, std::string_view channel, std::string_view reason="") override
 
void me (std::string_view target, std::string_view message) override
 
void message (std::string_view target, std::string_view message) override
 
void mode (std::string_view channel, std::string_view mode, std::string_view limit="", std::string_view user="", std::string_view mask="") override
 
void names (std::string_view channel) override
 
void notice (std::string_view target, std::string_view message) override
 
void part (std::string_view channel, std::string_view reason="") override
 
void send (std::string_view raw) override
 
void topic (std::string_view channel, std::string_view topic) override
 
void whois (std::string_view target) override
 
- Public Member Functions inherited from irccd::daemon::server
 server (boost::asio::io_service &service, std::string id, std::string hostname="localhost")
 
virtual ~server ()
 
auto get_state () const noexcept -> state
 
auto get_id () const noexcept -> const std::string &
 
auto get_hostname () const noexcept -> const std::string &
 
auto get_password () const noexcept -> const std::string &
 
void set_password (std::string password) noexcept
 
auto get_port () const noexcept -> std::uint16_t
 
void set_port (std::uint16_t port) noexcept
 
auto get_options () const noexcept -> options
 
void set_options (options flags) noexcept
 
auto get_nickname () const noexcept -> const std::string &
 
void set_nickname (std::string nickname)
 
auto get_username () const noexcept -> const std::string &
 
void set_username (std::string name) noexcept
 
auto get_realname () const noexcept -> const std::string &
 
void set_realname (std::string realname) noexcept
 
auto get_ctcp_version () const noexcept -> const std::string &
 
void set_ctcp_version (std::string ctcpversion)
 
auto get_command_char () const noexcept -> const std::string &
 
void set_command_char (std::string command_char) noexcept
 
auto get_reconnect_delay () const noexcept -> std::uint16_t
 
void set_reconnect_delay (std::uint16_t reconnect_delay) noexcept
 
auto get_ping_timeout () const noexcept -> std::uint16_t
 
void set_ping_timeout (std::uint16_t ping_timeout) noexcept
 
auto get_channels () const noexcept -> const std::set< std::string > &
 
auto is_self (std::string_view nick) const noexcept -> bool
 
virtual void wait (connect_handler handler)
 
virtual void recv (recv_handler handler) noexcept
 

Additional Inherited Members

- Public Types inherited from irccd::daemon::server
enum  options : std::uint8_t {
  options::none = 0, options::ipv4 = (1 << 0), options::ipv6 = (1 << 1), options::ssl = (1 << 2),
  options::auto_rejoin = (1 << 3), options::auto_reconnect = (1 << 4), options::join_invite = (1 << 5)
}
 Various options for server. More...
 
enum  state : std::uint8_t { state::disconnected, state::connecting, state::identifying, state::connected }
 Describe current server state. More...
 
using connect_handler = std::function< void(std::error_code)>
 
using recv_handler = std::function< void(std::error_code, event)>
 
- Protected Attributes inherited from irccd::daemon::server
state state_ {state::disconnected}
 Server state. More...
 

Detailed Description

Server which prints everything in the console.

Member Function Documentation

◆ connect()

void irccd::test::debug_server::connect ( connect_handler  handler)
overridevirtualnoexcept

Start connecting.

This only initiate TCP connection and/or SSL handshaking, the identifying process may take some time and you must repeatedly call recv() to wait for connect_event.

Precondition
handler != nullptr
Parameters
handlerthe completion handler
Note
the server must be kept alive until completion

Reimplemented from irccd::daemon::server.

◆ disconnect()

void irccd::test::debug_server::disconnect ( )
overridevirtualnoexcept

Force disconnection.

Reimplemented from irccd::daemon::server.

◆ invite()

void irccd::test::debug_server::invite ( std::string_view  target,
std::string_view  channel 
)
overridevirtual

Invite a user to a channel.

Parameters
targetthe target nickname
channelthe channel

Reimplemented from irccd::daemon::server.

◆ join()

void irccd::test::debug_server::join ( std::string_view  channel,
std::string_view  password = "" 
)
overridevirtual

Join a channel, the password is optional and can be kept empty.

Parameters
channelthe channel to join
passwordthe optional password

Reimplemented from irccd::daemon::server.

◆ kick()

void irccd::test::debug_server::kick ( std::string_view  target,
std::string_view  channel,
std::string_view  reason = "" 
)
overridevirtual

Kick someone from the channel. Please be sure to have the rights on that channel because errors won't be reported.

Parameters
targetthe target to kick
channelfrom which channel
reasonthe optional reason

Reimplemented from irccd::daemon::server.

◆ me()

void irccd::test::debug_server::me ( std::string_view  target,
std::string_view  message 
)
overridevirtual

Send a CTCP Action as known as /me. The target may be either a channel or a nickname.

Parameters
targetthe nickname or the channel
messagethe message

Reimplemented from irccd::daemon::server.

◆ message()

void irccd::test::debug_server::message ( std::string_view  target,
std::string_view  message 
)
overridevirtual

Send a message to the specified target or channel.

Parameters
targetthe target
messagethe message

Reimplemented from irccd::daemon::server.

◆ mode()

void irccd::test::debug_server::mode ( std::string_view  channel,
std::string_view  mode,
std::string_view  limit = "",
std::string_view  user = "",
std::string_view  mask = "" 
)
overridevirtual

Change channel/user mode.

Parameters
channelthe channel or nickname
modethe mode
limitthe optional limit
userthe optional user
maskthe optional ban mask

Reimplemented from irccd::daemon::server.

◆ names()

void irccd::test::debug_server::names ( std::string_view  channel)
overridevirtual

Request the list of names.

Parameters
channelthe channel

Reimplemented from irccd::daemon::server.

◆ notice()

void irccd::test::debug_server::notice ( std::string_view  target,
std::string_view  message 
)
overridevirtual

Send a private notice.

Parameters
targetthe target
messagethe notice message

Reimplemented from irccd::daemon::server.

◆ part()

void irccd::test::debug_server::part ( std::string_view  channel,
std::string_view  reason = "" 
)
overridevirtual

Part from a channel.

Please note that the reason is not supported on all servers so if you want portability, don't provide it.

Parameters
channelthe channel to leave
reasonthe optional reason

Reimplemented from irccd::daemon::server.

◆ send()

void irccd::test::debug_server::send ( std::string_view  raw)
overridevirtual

Send a raw message to the IRC server. You don't need to add message terminators.

If the server is not yet connected, the command is postponed and will be ran when ready.

Parameters
rawthe raw message (without \r\n\r\n)

Reimplemented from irccd::daemon::server.

◆ topic()

void irccd::test::debug_server::topic ( std::string_view  channel,
std::string_view  topic 
)
overridevirtual

Change the channel topic.

Parameters
channelthe channel
topicthe desired topic

Reimplemented from irccd::daemon::server.

◆ whois()

void irccd::test::debug_server::whois ( std::string_view  target)
overridevirtual

Request for whois information.

Parameters
targetthe target nickname

Reimplemented from irccd::daemon::server.


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