35 lines
739 B
Objective-C
35 lines
739 B
Objective-C
//
|
|
// FileInfo.m
|
|
// file_picker
|
|
//
|
|
// Created by Miguel Ruivo on 11/09/2020.
|
|
//
|
|
|
|
#import "FileInfo.h"
|
|
|
|
@implementation FileInfo
|
|
|
|
- (instancetype) initWithPath: (NSString *)path andName: (NSString *)name andSize: (NSNumber *) size andData:(NSData*) data {
|
|
|
|
self = [super init];
|
|
|
|
if (self) {
|
|
self.path = path;
|
|
self.name = name;
|
|
self.size = size;
|
|
self.bytes = data;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (NSDictionary *)toData {
|
|
NSMutableDictionary * data = [[NSMutableDictionary alloc] init];
|
|
[data setValue:self.path forKey:@"path"];
|
|
[data setValue:self.name forKey:@"name"];
|
|
[data setValue:self.size forKey:@"size"];
|
|
[data setValue:self.bytes forKey:@"bytes"];
|
|
return data;
|
|
}
|
|
|
|
@end
|