1. Graham Booker
  2. ObjectiveCAnnotate

Commits

dylanbruzenak  committed b7dc983

Replaced block start and end syntax with a shorter version. The idea is to lower the foot print of the generated code.

  • Participants
  • Parent commits 540f767
  • Branches default

Comments (0)

Files changed (3)

File Classes/AnnotatedClass.m

View file
 #import "AnnotationHandler.h"
 
 static NSString *AnnotationFlag = @"//@generate";
-static NSString *BlockStart = @"//GENERATE START generated block - this block is automatically generated by ObjcAnnotate and will be automatically overwritten.";
-static NSString *BlockEnd = @"//END GENERATE";
+static NSString *BlockStart = @"//generated block";
+static NSString *BlockEnd = @"//end generated block";
 static NSString *DeallocString = @"- (void) dealloc";
 
 @implementation AnnotatedClass
 		NSMutableArray *headerBlockLines = [NSMutableArray array];
 		
 		[headerBlockLines addObject: BlockStart];
-		[headerBlockLines addObject: @""];
 		[headerBlockLines addObjectsFromArray:generatedHeaderLines];
-		[headerBlockLines addObject: @""];
 		[headerBlockLines addObject: BlockEnd];
 		
 		return [headerBlockLines componentsJoinedByString:@"\n"];
 		NSMutableArray *implementationBlockLines = [NSMutableArray array];
 		
 		[implementationBlockLines addObject: BlockStart];
-		[implementationBlockLines addObject: @""];
-		[implementationBlockLines addObject: @"#pragma mark -"];
-		[implementationBlockLines addObject: @"#pragma mark Generated"];
-		[implementationBlockLines addObject: @""];
 		[implementationBlockLines addObjectsFromArray:generatedImplementationLines];
 		[implementationBlockLines addObject: @""];
 		
 		[implementationBlockLines addObject: @"{"];
 		[implementationBlockLines addObjectsFromArray:generatedDeallocLines];
 		[implementationBlockLines addObject: @"}"];
-		[implementationBlockLines addObject: @""];
 		
 		[implementationBlockLines addObject: BlockEnd];
 		

File Examples/AnnotateDemo/Classes/Person.h

View file
 
 #import <Cocoa/Cocoa.h>
 
+//Note that this class has been built to show off all of the capabilities of the annotation framework and
+//therefore the code is more cluttered than the usual implementation.
 
 @interface Person : NSObject {
 	
 	NSString *notAProperty;
 }
 
-//GENERATE START generated block - this block is automatically generated by ObjcAnnotate and will be automatically overwritten.
-
+//generated block
 @property (nonatomic, retain) NSString *name;
 @property (nonatomic) BOOL rememberedToPayTaxes;
 @property (assign) id delegate;
 @property (nonatomic, retain) NSString *generatedAtRuntime;
 - (void) canDoSomethingAwesomeWith: (NSString *) aName andAThing: (id) thing;
+//end generated block
 
-//END GENERATE
 @end

File Examples/AnnotateDemo/Classes/Person.m

View file
 	
 }
 
-//GENERATE START generated block - this block is automatically generated by ObjcAnnotate and will be automatically overwritten.
-
-#pragma mark -
-#pragma mark Generated
-
+//generated block
 @synthesize name;
 @synthesize rememberedToPayTaxes;
 @synthesize delegate;
 	[generatedAtRuntime release];
 	[privateName release];
 }
-
-//END GENERATE
+//end generated block
 
 - (void) dealloc
 {