You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pEpObjCAdapter/pEpObjCAdapter/PEPAttachment.m

44 lines
822 B
Objective-C

//
// PEPAttachment.m
// pEpObjCAdapter
//
// Created by Dirk Zimmermann on 16.04.18.
// Copyright © 2018 p≡p. All rights reserved.
//
#import "PEPAttachment.h"
#import "bloblist.h"
@implementation PEPAttachment
- (instancetype)initWithData:(NSData *)data
{
if (self = [super init]) {
self.data = data;
self.size = data.length;
}
return self;
}
- (NSString *)description
{
NSMutableString *str =
[NSMutableString
stringWithFormat:@"<PEPAttachment 0x%u %ld bytes, contentDisposition %d",
(uint) self, (long) self.size, self.contentDisposition];
if (self.mimeType) {
[str appendFormat:@", %@", self.mimeType];
}
if (self.filename) {
[str appendFormat:@", %@", self.filename];
}
[str appendString:@">"];
return str;
}
@end