//
//  keyInfo.m
//  DictionaryViewer
//
//  Created by Allanon on 18/08/06.
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//

#import "keyInfo.h"


@implementation KeyInfo

-(NSString *)key {
    return key;
}
-(NSString *)val {
    return val;
}
-(CPhidgetDictionary_keyChangeReason)reason {
    return reason;
}

- (id)initWithKeyValReason:(const char *)keyVal:(const char *)valVal:(CPhidgetDictionary_keyChangeReason)reasonVal
{
	if(self = [super init])
	{
		key = [[NSString stringWithCString:keyVal] retain];
		val = [[NSString stringWithCString:valVal encoding:NSUTF8StringEncoding] retain];
		reason = reasonVal;
	}
	return self;
}
- (BOOL)isEqual:(id)anObject{
	if ([key isEqual:[anObject key]]) return true;
	return false;
}
- (NSComparisonResult)compareKey:(KeyInfo *)aKeyInfo
{
    return [key compare:[aKeyInfo key]];
}
- (void) dealloc
{
    [key release];
    [val release];
    [super dealloc];
}

@end
