From 8d4c609ef67dd69dd709a84f3ccb24b493a25622 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Tue, 17 Apr 2012 11:29:14 +1000 Subject: [PATCH] Reflect @rentzsch's preferred style for pointer stars --- templates/machine.h.motemplate | 38 +++++++++++++++++----------------- templates/machine.m.motemplate | 28 ++++++++++++------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/templates/machine.h.motemplate b/templates/machine.h.motemplate index 00992a5b..c544b399 100644 --- a/templates/machine.h.motemplate +++ b/templates/machine.h.motemplate @@ -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$> @@ -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$> @@ -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$> @@ -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 @@ -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 @@ -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 diff --git a/templates/machine.m.motemplate b/templates/machine.m.motemplate index a6cdbe40..4427c034 100644 --- a/templates/machine.m.motemplate +++ b/templates/machine.m.motemplate @@ -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"]) { @@ -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; @@ -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) { @@ -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; @@ -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) { @@ -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; @@ -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];