Update documentation

This commit is contained in:
achmizs 2015-12-24 16:22:04 -05:00
parent 702f7e9ab7
commit ba62ccdfc3

View File

@ -17,7 +17,9 @@
* License for more details. * License for more details.
*/ */
/********************************/
#pragma mark Defines and includes #pragma mark Defines and includes
/********************************/
#define IRCCLIENTVERSION "2.0a3" #define IRCCLIENTVERSION "2.0a3"
@ -26,7 +28,9 @@
#import "IRCClientChannel_Private.h" #import "IRCClientChannel_Private.h"
#import "NSData+SA_NSDataExtensions.h" #import "NSData+SA_NSDataExtensions.h"
/********************************************/
#pragma mark - Callback function declarations #pragma mark - Callback function declarations
/********************************************/
static void onConnect(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); static void onConnect(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count);
static void onNick(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); static void onNick(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count);
@ -50,7 +54,9 @@ static void onCtcpAction(irc_session_t *session, const char *event, const char *
static void onUnknownEvent(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count); static void onUnknownEvent(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned int count);
static void onNumericEvent(irc_session_t *session, unsigned int event, const char *origin, const char **params, unsigned int count); static void onNumericEvent(irc_session_t *session, unsigned int event, const char *origin, const char **params, unsigned int count);
/***********************************************************/
#pragma mark - IRCClientSession private category declaration #pragma mark - IRCClientSession private category declaration
/***********************************************************/
static NSDictionary* ircNumericCodeList; static NSDictionary* ircNumericCodeList;
@ -69,11 +75,15 @@ static NSDictionary* ircNumericCodeList;
@end @end
/***************************************************/
#pragma mark - IRCClientSession class implementation #pragma mark - IRCClientSession class implementation
/***************************************************/
@implementation IRCClientSession @implementation IRCClientSession
/********************************/
#pragma mark - Property synthesis #pragma mark - Property synthesis
/********************************/
@synthesize delegate = _delegate; @synthesize delegate = _delegate;
@synthesize sessionID = _sessionID; @synthesize sessionID = _sessionID;
@ -89,15 +99,17 @@ static NSDictionary* ircNumericCodeList;
@synthesize encoding = _encoding; @synthesize encoding = _encoding;
/******************************/
#pragma mark - Custom accessors #pragma mark - Custom accessors
/******************************/
-(NSDictionary*)channels - (NSDictionary*)channels
{ {
NSDictionary* channelsCopy = [_channels copy]; NSDictionary* channelsCopy = [_channels copy];
return channelsCopy; return channelsCopy;
} }
-(void)setChannels:(NSDictionary *)channels - (void)setChannels:(NSDictionary *)channels
{ {
_channels = [channels mutableCopy]; _channels = [channels mutableCopy];
} }
@ -107,13 +119,14 @@ static NSDictionary* ircNumericCodeList;
return irc_is_connected(_irc_session); return irc_is_connected(_irc_session);
} }
/************************************/ /***************************/
#pragma mark - Class methods #pragma mark - Class methods
/************************************/ /***************************/
-(instancetype)init - (instancetype)init
{ {
if ((self = [super init])) { if ((self = [super init]))
{
_callbacks.event_connect = onConnect; _callbacks.event_connect = onConnect;
_callbacks.event_nick = onNick; _callbacks.event_nick = onNick;
_callbacks.event_quit = onQuit; _callbacks.event_quit = onQuit;
@ -165,15 +178,17 @@ static NSDictionary* ircNumericCodeList;
return self; return self;
} }
-(void)dealloc - (void)dealloc
{ {
if (irc_is_connected(_irc_session)) if (irc_is_connected(_irc_session))
{
NSLog(@"Warning: IRC Session is not disconnected on dealloc"); NSLog(@"Warning: IRC Session is not disconnected on dealloc");
}
irc_destroy_session(_irc_session); irc_destroy_session(_irc_session);
} }
+(NSDictionary *)ircNumericCodes + (NSDictionary *)ircNumericCodes
{ {
if(ircNumericCodeList == nil) if(ircNumericCodeList == nil)
{ {
@ -183,7 +198,7 @@ static NSDictionary* ircNumericCodeList;
return ircNumericCodeList; return ircNumericCodeList;
} }
+(void)loadNumericCodes + (void)loadNumericCodes
{ {
NSString* numericCodeListPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IRC_Numerics" ofType:@"plist"]; NSString* numericCodeListPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IRC_Numerics" ofType:@"plist"];
ircNumericCodeList = [NSDictionary dictionaryWithContentsOfFile:numericCodeListPath]; ircNumericCodeList = [NSDictionary dictionaryWithContentsOfFile:numericCodeListPath];
@ -226,7 +241,7 @@ static NSDictionary* ircNumericCodeList;
[_thread start]; [_thread start];
} }
-(int)setNickname:(NSData *)nickname username:(NSData *)username realname:(NSData *)realname - (int)setNickname:(NSData *)nickname username:(NSData *)username realname:(NSData *)realname
{ {
if(self.isConnected) if(self.isConnected)
{ {