Add capability to dump class and connection information using gormtool

This commit is contained in:
Gregory John Casamento 2023-07-08 12:53:09 -04:00
parent b0b4c075fb
commit b35ce5e205
4 changed files with 45 additions and 1 deletions

View file

@ -120,6 +120,7 @@
- (BOOL) isAction: (NSString *)actionName onCategoryForClassNamed: (NSString *)className; - (BOOL) isAction: (NSString *)actionName onCategoryForClassNamed: (NSString *)className;
- (NSString *) classNameForObject: (id)object; - (NSString *) classNameForObject: (id)object;
- (NSString *) findClassByName: (NSString *)name; - (NSString *) findClassByName: (NSString *)name;
- (NSDictionary *) classInformation;
/* Parsing and creating classes */ /* Parsing and creating classes */
- (BOOL) makeSourceAndHeaderFilesForClass: (NSString *)className - (BOOL) makeSourceAndHeaderFilesForClass: (NSString *)className

View file

@ -2260,6 +2260,11 @@
return className; return className;
} }
- (NSDictionary *) classInformation
{
return classInformation;
}
- (NSString *) description - (NSString *) description
{ {
return [NSString stringWithFormat: @"<%s: %lx> = %@", return [NSString stringWithFormat: @"<%s: %lx> = %@",

View file

@ -299,6 +299,11 @@
/* Connections */ /* Connections */
/**
*
*/
- (NSMutableArray *) connections;
/** /**
* Build our reverse mapping information and other initialisation * Build our reverse mapping information and other initialisation
*/ */

View file

@ -122,6 +122,24 @@
[pair setArgument: obj]; [pair setArgument: obj];
parse_val = YES; parse_val = YES;
} }
if ([obj isEqualToString: @"--connections"])
{
[pair setArgument: obj];
parse_val = NO;
}
if ([obj isEqualToString: @"--classes"])
{
[pair setArgument: obj];
parse_val = NO;
}
// If there is no parameter for the argument, set it anyway...
if (parse_val == NO)
{
[result setObject: pair forKey: obj];
}
} }
} }
@ -136,7 +154,7 @@
if ([[pi arguments] count] > 1) if ([[pi arguments] count] > 1)
{ {
NSString *file = nil; // [[pi arguments] lastObject]; NSString *file = nil;
NSString *outputPath = @"./"; NSString *outputPath = @"./";
GormDocumentController *dc = [GormDocumentController sharedDocumentController]; GormDocumentController *dc = [GormDocumentController sharedDocumentController];
GormDocument *doc = nil; GormDocument *doc = nil;
@ -225,6 +243,21 @@
[cm parseHeader: classFile]; [cm parseHeader: classFile];
} }
opt = [args objectForKey: @"--connections"];
if (opt != nil)
{
NSArray *connections = [doc connections];
NSLog(@"connections = %@", connections);
}
opt = [args objectForKey: @"--classes"];
if (opt != nil)
{
NSDictionary *classes = [[doc classManager] classInformation];
NSLog(@"classes = %@", classes);
}
// These options sound always be processed last... // These options sound always be processed last...
opt = [args objectForKey: @"--write"]; opt = [args objectForKey: @"--write"];
if (opt != nil) if (opt != nil)