// // SoulSeekMessage.h // // Created by Marcelo Alves on 14/02/06. This code is GPL. // Portions of this code (zlib handling) are based on Message.h from original SolarSeek. // #import #import @interface SoulSeekMessage : NSObject { @private long pos; NSMutableData *data; // the data, DOH } -(id) init; -(id) initWithData: (NSData *)theData; -(id) initWithData:(NSData *)theData andMessageType:(uint32_t) messageType; -(id) dealloc; -(NSData*) data; -(SoulSeekMessage *) appendUInt32: (uint32_t) value; // append an int32 value on data, using the SoulSeek byte ordering. -(SoulSeekMessage *) appendString: (NSString *) value; -(void *) bytes; -(long) length; // TODO: make methods to decode the data, like readUInt32, readByte, readString and resetPos -(uint32_t) readUInt32; -(uint8_t) readByte; -(NSString *) readString; -(void) setPos:(long) newPos; -(long) pos; -(SoulSeekMessage *)compress; -(SoulSeekMessage *)uncompress; @end