Skip to content

Commit

Permalink
Pushing latest progress
Browse files Browse the repository at this point in the history
  • Loading branch information
atg committed Aug 25, 2010
1 parent ce70246 commit 66a3760
Show file tree
Hide file tree
Showing 9 changed files with 235 additions and 129 deletions.
273 changes: 145 additions & 128 deletions CHDocumentationBrowser.xib

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CHSymbolButtonImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ typedef enum _CHSymbolButtonImageType
CHSymbolButtonObjcClass = 1<<16,
CHSymbolButtonObjcProtocol = 1<<17,
CHSymbolButtonObjcCategory = 1<<18, //For example: ObjcCategory | ObjcInterface
CHSymbolButtonFunctionContainer = 1<<19,

CHSymbolButtonVariable = 1<<20,
CHSymbolButtonObjcMethod = 1<<21,
Expand Down
8 changes: 8 additions & 0 deletions CHSymbolButtonImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ + (NSArray *)symbolImageWithTypeString:(NSString *)typeString drawBorder:(BOOL)d
else if ([typeString isEqual:@"@"])
m |= CHSymbolButtonObjcClass | CHSymbolButtonObjcInterface;

else if ([typeString isEqual:@"FF"])
m |= CHSymbolButtonFunctionContainer;

else if ([typeString isEqual:@"@p"])
m |= CHSymbolButtonObjcProtocol | CHSymbolButtonObjcInterface;

Expand Down Expand Up @@ -100,6 +103,11 @@ + (NSArray *)symbolImageWithMask:(CHSymbolButtonImageMask)mask
offset = 209.0;
str = [NSString stringWithFormat:@"%C", 0x0192];
}
else if (mask & CHSymbolButtonFunctionContainer)
{
offset = 209.0;
str = @"F";
}
else if (mask & CHSymbolButtonObjcMethod)
{
if (mask & CHSymbolButtonStaticScope)
Expand Down
3 changes: 2 additions & 1 deletion IGKDocRecordManagedObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ typedef enum {
CHPriorityBindings = 3,
CHPriorityCategory = 4,
CHPriorityProtocol = 5,
CHPriorityClass = 6,
CHPriorityFunctionContainer = 6,
CHPriorityClass = 7,

CHPriorityMaximum, //DON'T USE THIS! DON'T PUT ANY ENUM CONSTANTS AFTER IT. This is a placeholder element so that I can work out the maximum priority by doing CHPriorityMaximum - 1.
} CHRecordPriority;
Expand Down
10 changes: 10 additions & 0 deletions IGKDocRecordManagedObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ + (NSString *)entityNameFromURLComponentExtension:(NSString *)ext
{
if ([ext isEqual:@"class"])
return @"ObjCClass";
else if ([ext isEqual:@"functions"])
return @"FunctionContainer";
else if ([ext isEqual:@"category"])
return @"ObjCCategory";
else if ([ext isEqual:@"protocol"])
Expand Down Expand Up @@ -311,6 +313,8 @@ - (NSString *)URLComponentExtension
NSString *entityName = [[self entity] name];
if ([entityName isEqual:@"ObjCClass"])
return @"class";
if ([entityName isEqual:@"FunctionContainer"])
return @"functions";
else if ([entityName isEqual:@"ObjCCategory"])
return @"category";
else if([entityName isEqual:@"ObjCProtocol"])
Expand Down Expand Up @@ -459,6 +463,9 @@ - (CHRecordPriority)priorityval
else if([entityName isEqual:@"ObjCClass"])
return CHPriorityClass;

else if([entityName isEqual:@"FunctionContainer"])
return CHPriorityFunctionContainer;

else if([entityName isEqual:@"ObjCProtocol"])
return CHPriorityProtocol;

Expand Down Expand Up @@ -542,6 +549,9 @@ + (CHSymbolButtonImageMask)iconMaskForEntity:(NSString *)entityName isInstanceMe
if([entityName isEqual:@"ObjCClass"])
return CHSymbolButtonObjcClass;

if([entityName isEqual:@"FunctionContainer"])
return CHSymbolButtonFunctionContainer;

else if([entityName isEqual:@"ObjCCategory"])
return CHSymbolButtonObjcCategory;

Expand Down
4 changes: 4 additions & 0 deletions IGKPredicateEditor.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ - (NSPredicate *)predicateWithEntityNamed:(NSString **)outEntityName
{
requestedEntityName = @"ObjCClass";
}
else if([requestedEntityName isEqual:@"Function Group"])
{
requestedEntityName = @"FunctionContainer";
}
else if([requestedEntityName isEqual:@"Category"])
{
requestedEntityName = @"ObjCCategory";
Expand Down
Binary file modified Ingredients_DataModel.xcdatamodel/elements
Binary file not shown.
Binary file modified Ingredients_DataModel.xcdatamodel/layout
Binary file not shown.
65 changes: 65 additions & 0 deletions sqlite migration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* We use core data for three things:
Persistence
Querying
A persistent object graph of the light-index
A throwaway object graph between full-index and html-generation

We can switch to basic sqlite for persistence. All that is required is modifying IGKScraper to execute SQL rather than create NSManagedObjects.

Likewise we can switch over querying to sqlite by rewriting all NSPredicates as SQL.

To replace the object graph, we can write a generalised NSObject graph library based on KVC. This would be a KVC-based and entirely in-memory multi-key object graph.
*/

@interface GGNode : NSObject
{
NSDictionary *keyvalues;
}

- (id)valueForKey:(id)key;
- (id)setValue:(id)value forKey:(id)key;

@end

@implementation GGNode

- (id)valueForKey:(id)key
{
id value = [keyvalues objectForKey:key];

if (value)
return value;
else
return [self valueForUndefinedKey:key];
}
- (id)setValue:(id)value forKey:(id)key
{
if (value && key)
[keyvalues setValue:value forKey:key];
}

@end


@interface IGKRecord : GGNode
{
NSString *tableName;
uint64_t ident;
}

+ (id)reverseKeyForToMany:(id)key;

@end

@implementation IGKRecord

- (id)valueForUndefinedKey:(id)undef
{
NSString *reverseKey = [IGKRecord reverseKeyForToMany:key];
if (!reverseKey)
return nil;

NSString *query = [NSString stringWithFormat:@"SELECT id FROM %@ WHERE %@=%llu", tableName, reverseKey, ident];
}

@end

0 comments on commit 66a3760

Please sign in to comment.