2012-01-19 16:40:39 +00:00
|
|
|
//
|
|
|
|
// OPElementGeneratedEntity.m
|
|
|
|
// OnePassword
|
|
|
|
//
|
|
|
|
// Created by Maarten Billemont on 16/01/12.
|
|
|
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "OPElementGeneratedEntity.h"
|
|
|
|
#import "OPAppDelegate.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation OPElementGeneratedEntity
|
|
|
|
|
|
|
|
@dynamic counter;
|
|
|
|
|
|
|
|
- (id)content {
|
|
|
|
|
2012-01-29 11:41:48 +00:00
|
|
|
assert(self.type & OPElementTypeClassCalculated);
|
|
|
|
|
2012-01-19 16:40:39 +00:00
|
|
|
if (![self.name length])
|
|
|
|
return nil;
|
|
|
|
|
2012-01-24 23:30:43 +00:00
|
|
|
if (self.type & OPElementTypeClassCalculated)
|
2012-01-19 16:40:39 +00:00
|
|
|
return OPCalculateContent(self.type, self.name, [OPAppDelegate get].keyPhrase, self.counter);
|
|
|
|
|
|
|
|
@throw [NSException exceptionWithName:NSInternalInconsistencyException
|
|
|
|
reason:[NSString stringWithFormat:@"Unsupported type: %d", self.type] userInfo:nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|