I.1 :: About IRC-TK
IRC-TK (IRC ToolKit) is a library written in C++ for C++ developers, that deals with all the secondary business an IRC application is supposed to do and allows the developer to focus on the main points of his application, thus making IRC programming easier and quicker.
Currently IRC-TK consists of:
I.2 :: Why use IRC-TK anyway?
To make things easier for you of course! Using IRC-TK prevents you from having to write all the socket handling code, writing all the IRC message handling code and way more things; not to mention that with IRC-TK you will not even have to spend time designing classes and such things that are going to handle the IRC connection. The following examples show the difference between a normal IRC program (with socket handling) and a program that uses IRC-TK:
And now a program that uses IRC-TK:
Please note that the above programs only connect to an IRC server; they do nothing more. The IRC-TK saves you from a lot more extra coding than shown above.
I.3 :: I need help on IRC-TK!
If you need some help on an IRC-TK matter, please feel free to e-mail someone from the development team.Development team:
I.4. :: I found a bug. What do I do now?
Aside from fixing it on your own for personal use, it would be great to sumbit the bug to the development team, so that it can be fixed in the next version. Please fetch the development team's e-mails from above.
II.1 :: IRC-TK Requirements
Below is a list of what IRC-TK is tested on. If you find find out that IRC-TK works on something else, please communicate with the development team:
Note that IRC-TK does not require extra libraries for the compiler.
II.2 :: IRC Replies section
The IRC replies are stored in the file irc_replies.h in the irctk directory, under the IRCTK namespace. All the IRC replies are of type "const int".
If you want to see a list of the replies, either look at the irc_replies.h file or take a look at the REPLIES section in RFC 1459.
II.3 :: IRC Lib section
The IRC lib is stored in the file irc_lib.h in the irctk directory, under the IRCTK namespace. The IRC lib contains functions that allow you to easily manipulate the IRC messages you get from an IRC server. It also contains the IRC_Socket class.
IRC_Socket is a class designed to make socket handling easier, for sockets connecting to an IRC server. The protocol type used for the socket creation is AF_INET (IPv4), the socket type is SOCK_STREAM and no parameters are passed. Then the class IRC_Socket establishes a connection with the given server at the given port using the previously created socket. Please note that in the current version (0.1 PreAlpha) the IRC_Socket class is not highly customizeable, as far as socket creation is concerned. In future versions IRC-TK is going to decide if AF_INET (IPv4) or AF_INET6 (IPv6) is going to be used. Last, IRC_Socket provides you with its own send() and recv() functions that make it more simple for you to communicate with the IRC server.
The rest of the IRC-TK IRC lib consists of functions. With the IRC-TK IRC Lib, you can deal with IRC messages in two ways:
The advantage of the 1st way is that once you parse the message, you have a vector containing the IRC message parameters and you can handle that vector in any way you can. In the current version (0.1 PreAlpha) you are provided with functions that help you deal with the vector, although it's not really needed. This might be removed in the next versions.
The disadvantage of the 1st way is that... It doesn't feel natural. The 2nd way would be the most logical way to treat an IRC message. I daresay that the 2nd way is close to mIRC scripts' parameter handling method.
The disadvantage of the 2nd way is that the message is kind of reparsed every time you try to do an operation on it; however with modern computers the time difference is insignificant.
You are also provided with a number of address handling functions. They allow you do grab only some stuff from the address of the sender of the IRC message:
And many other variations of the above.