Skip to content

Commit

Permalink
Reflect @rentzsch's preferred style for pointer stars
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyarnold committed Apr 17, 2012
1 parent 3c5fd87 commit 8d4c609
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
38 changes: 19 additions & 19 deletions templates/machine.h.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
@end

@interface _<$managedObjectClassName$> : <$customSuperentity$> {}
+ (id)insertInManagedObjectContext:(NSManagedObjectContext *)moc_;
+ (NSString *)entityName;
+ (NSEntityDescription *)entityInManagedObjectContext:(NSManagedObjectContext *)moc_;
- (<$managedObjectClassName$>ID *)objectID;
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
+ (NSString*)entityName;
+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
- (<$managedObjectClassName$>ID*)objectID;

<$foreach Attribute noninheritedAttributes do$>
<$if Attribute.hasDefinedAttributeType$>
Expand All @@ -41,7 +41,7 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
- (<$Attribute.scalarAttributeType$>)<$Attribute.name$>Value;
- (void)set<$Attribute.name.initialCapitalString$>Value:(<$Attribute.scalarAttributeType$>)value_;
<$endif$>
//- (BOOL)validate<$Attribute.name.initialCapitalString$>:(id)value_ error:(NSError **)error_;
//- (BOOL)validate<$Attribute.name.initialCapitalString$>:(id*)value_ error:(NSError**)error_;
<$endif$>
<$endforeach do$>
<$foreach Relationship noninheritedRelationships do$>
Expand All @@ -51,23 +51,23 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
<$else$>
@property (nonatomic, retain) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
<$endif$>
- (<$Relationship.mutableCollectionClassName$> *)<$Relationship.name$>Set;
- (<$Relationship.mutableCollectionClassName$>*)<$Relationship.name$>Set;
<$else$>
<$if TemplateVar.arc$>
@property (nonatomic, strong) <$Relationship.destinationEntity.managedObjectClassName$> *<$Relationship.name$>;
<$else$>
@property (nonatomic, retain) <$Relationship.destinationEntity.managedObjectClassName$> *<$Relationship.name$>;
<$endif$>
//- (BOOL)validate<$Relationship.name.initialCapitalString$>:(id)value_ error:(NSError **)error_;
//- (BOOL)validate<$Relationship.name.initialCapitalString$>:(id*)value_ error:(NSError**)error_;
<$endif$>
<$endforeach do$>
<$foreach FetchRequest prettyFetchRequests do$>
<$if FetchRequest.singleResult$>
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>;
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError **)error_;
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>;
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_;
<$else$>
+ (NSArray *)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>;
+ (NSArray *)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError **)error_;
+ (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>;
+ (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_;
<$endif$>
<$endforeach do$>
<$foreach FetchedProperty noninheritedFetchedProperties do$>
Expand All @@ -77,7 +77,7 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
#if TARGET_OS_IPHONE
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
- (NSFetchedResultsController *)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray *)sortDescriptors;
- (NSFetchedResultsController*)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray*)sortDescriptors;
<$endif$>
<$endforeach do$>
#endif
Expand All @@ -86,10 +86,10 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch

@interface _<$managedObjectClassName$> (CoreDataGeneratedAccessors)
<$foreach Relationship noninheritedRelationships do$><$if Relationship.isToMany$>
- (void)add<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$> *)value_;
- (void)remove<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$> *)value_;
- (void)add<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$> *)value_;
- (void)remove<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$> *)value_;
- (void)add<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$>*)value_;
- (void)remove<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$>*)value_;
- (void)add<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_;
- (void)remove<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_;
<$endif$><$endforeach do$>
@end

Expand All @@ -106,11 +106,11 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
<$endforeach do$>
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
- (<$Relationship.mutableCollectionClassName$> *)primitive<$Relationship.name.initialCapitalString$>;
- (<$Relationship.mutableCollectionClassName$>*)primitive<$Relationship.name.initialCapitalString$>;
- (void)setPrimitive<$Relationship.name.initialCapitalString$>:(<$Relationship.mutableCollectionClassName$>*)value;
<$else$>
- (<$Relationship.destinationEntity.managedObjectClassName$> *)primitive<$Relationship.name.initialCapitalString$>;
- (void)setPrimitive<$Relationship.name.initialCapitalString$>:(<$Relationship.destinationEntity.managedObjectClassName$> *)value;
- (<$Relationship.destinationEntity.managedObjectClassName$>*)primitive<$Relationship.name.initialCapitalString$>;
- (void)setPrimitive<$Relationship.name.initialCapitalString$>:(<$Relationship.destinationEntity.managedObjectClassName$>*)value;
<$endif$>
<$endforeach do$>
@end
28 changes: 14 additions & 14 deletions templates/machine.m.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam

@implementation _<$managedObjectClassName$>

+ (id)insertInManagedObjectContext:(NSManagedObjectContext *)moc_ {
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_ {
NSParameterAssert(moc_);
return [NSEntityDescription insertNewObjectForEntityForName:@"<$name$>" inManagedObjectContext:moc_];
}

+ (NSString *)entityName {
+ (NSString*)entityName {
return @"<$name$>";
}

+ (NSEntityDescription *)entityInManagedObjectContext:(NSManagedObjectContext *)moc_ {
+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
NSParameterAssert(moc_);
return [NSEntityDescription entityForName:@"<$name$>" inManagedObjectContext:moc_];
}

- (<$managedObjectClassName$>ID *)objectID {
return (<$managedObjectClassName$>ID *)[super objectID];
- (<$managedObjectClassName$>ID*)objectID {
return (<$managedObjectClassName$>ID*)[super objectID];
}

+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+ (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasDefinedAttributeType$><$if Attribute.hasScalarAttributeType$>
if ([key isEqualToString:@"<$Attribute.name$>Value"]) {
Expand Down Expand Up @@ -81,12 +81,12 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
@dynamic <$Relationship.name$>;

<$if Relationship.isToMany$>
- (<$Relationship.mutableCollectionClassName$> *)<$Relationship.name$>Set {
- (<$Relationship.mutableCollectionClassName$>*)<$Relationship.name$>Set {
[self willAccessValueForKey:@"<$Relationship.name$>"];
<$if Relationship.jr_isOrdered$>
<$Relationship.mutableCollectionClassName$> *result = (<$Relationship.mutableCollectionClassName$> *)[self mutableOrderedSetValueForKey:@"<$Relationship.name$>"];
<$Relationship.mutableCollectionClassName$> *result = (<$Relationship.mutableCollectionClassName$>*)[self mutableOrderedSetValueForKey:@"<$Relationship.name$>"];
<$else$>
<$Relationship.mutableCollectionClassName$> *result = (<$Relationship.mutableCollectionClassName$> *)[self mutableSetValueForKey:@"<$Relationship.name$>"];
<$Relationship.mutableCollectionClassName$> *result = (<$Relationship.mutableCollectionClassName$>*)[self mutableSetValueForKey:@"<$Relationship.name$>"];
<$endif$>
[self didAccessValueForKey:@"<$Relationship.name$>"];
return result;
Expand All @@ -100,7 +100,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam

<$foreach FetchRequest prettyFetchRequests do$>
<$if FetchRequest.singleResult$>
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>{
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>{
NSError *error = nil;
id result = [self fetch<$FetchRequest.name.initialCapitalString$>:moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:<$Binding.name$>_ <$endforeach do2$>error:&error];
if (error) {
Expand All @@ -112,7 +112,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
}
return result;
}
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError **)error_ {
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

Expand Down Expand Up @@ -153,7 +153,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
return result;
}
<$else$>
+ (NSArray *)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>{
+ (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>{
NSError *error = nil;
NSArray *result = [self fetch<$FetchRequest.name.initialCapitalString$>:moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:<$Binding.name$>_ <$endforeach do2$>error:&error];
if (error) {
Expand All @@ -165,7 +165,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
}
return result;
}
+ (NSArray *)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError **)error_ {
+ (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;

Expand Down Expand Up @@ -193,7 +193,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
#if TARGET_OS_IPHONE
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
- (NSFetchedResultsController *)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray *)sortDescriptors {
- (NSFetchedResultsController*)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray*)sortDescriptors {
NSFetchRequest *fetchRequest = [NSFetchRequest new];
<$if !TemplateVar.arc$>[fetchRequest autorelease];<$endif$>
fetchRequest.entity = [NSEntityDescription entityForName:@"<$Relationship.destinationEntity.name$>" inManagedObjectContext:self.managedObjectContext];
Expand Down

0 comments on commit 8d4c609

Please sign in to comment.