//---------------------------------------------------------------------------------------
//	HeaderFieldBody.m created by erik on Mon 04-May-1998
//	This code is part of the Alexandra Newsreader Project. For copyright details see
//	GNU public license version 2 or above. No warranties implied. Use at own risk.
//	More information can be found at <http://www.object-factory.com/Alexandra>.
//	@(#)$Id: HeaderFieldBody.m,v 1.1 1998/05/05 15:29:37 erik Exp $
//---------------------------------------------------------------------------------------

#import "Utilities.h"
#import "Message.h"
#import "HeaderFieldBody.h"


//-------------------------------------------------------------------------------------------
    @implementation HeaderFieldBody
//-------------------------------------------------------------------------------------------

- initWithString:(NSString *)string;
{
    [super init];
    stringRep = [string copyWithZone:[self zone]];
    return self;
}


- (NSString *)stringRepresentation;
{
    return stringRep;
}


- (void)invalidateStringRep;
{
    [stringRep release];
    stringRep = nil;
}


//-------------------------------------------------------------------------------------------
//	TRANSFER REPRESENTATIONS
//-------------------------------------------------------------------------------------------

- initFromTransferRepresentation:(NSData *)data;
{
    NSString *string;

    string = [[[NSString alloc] initWithMIMEHeaderFieldData:data] autorelease];
    [self initWithString:string];

    return self;
}
    

- (NSData *)transferRepresentation;
{
    return [[self stringRepresentation] dataForMIMEHeaderField];
}


//---------------------------------------------------------------------------------------
//	NSObject Stuff
//---------------------------------------------------------------------------------------

- (NSString *)description;
{
    return [NSString stringWithFormat:@"<%@ 0x%x: %@>", NSStringFromClass(isa), (void *)self, [self stringRepresentation]];
}


- (void)dealloc
{
    [stringRep release];
    [super dealloc];
}



//-------------------------------------------------------------------------------------------
    @end
//-------------------------------------------------------------------------------------------
