Guest User

Untitled

a guest
Oct 17th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. #ifndef IRC_H
  2. #define IRC_H
  3. #include "socket.h"
  4.  
  5.  
  6. class IRC: public aaix::Socket
  7. {
  8.     public:
  9.         IRC();
  10.         // These commands are typed exactly as they are found in the IRC RFC. Caps and all xD.
  11.         int PASS(const std::string pass);
  12.         int NICK(const std::string nick);
  13.         int USER(const std::string username, int mode, const std::string realname);
  14.         virtual ~IRC();
  15.         aaix::Socket sock;
  16.     protected:
  17.     private:
  18. };
  19.  
  20. IRC::IRC()
  21. {
  22.     std::cout << "Init IRC component" << std::endl;
  23. }
  24.  
  25. int IRC::PASS(const std::string pass)
  26. {
  27.     sock << "PASS " << pass << aaix::sendl;
  28.     return 0;
  29. }
  30.  
  31. int IRC::NICK(const std::string nick)
  32. {
  33.     sock << "NICK " << nick << aaix::sendl;
  34.     return 0;
  35. }
  36.  
  37. int IRC::USER(const std::string username, int mode, const std::string realname)
  38. {
  39.     sock << "USER " << username << " " << mode << " * :" << realname << aaix::sendl;
  40.     return 0;
  41. }
  42.  
  43. IRC::~IRC()
  44. {
  45.     std::cout << "Exit IRC component" << std::endl;
  46. }
  47. #endif // IRC_H
Add Comment
Please, Sign In to add comment