mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
Add capability to dump class and connection information using gormtool
This commit is contained in:
parent
b0b4c075fb
commit
b35ce5e205
4 changed files with 45 additions and 1 deletions
|
@ -120,6 +120,7 @@
|
|||
- (BOOL) isAction: (NSString *)actionName onCategoryForClassNamed: (NSString *)className;
|
||||
- (NSString *) classNameForObject: (id)object;
|
||||
- (NSString *) findClassByName: (NSString *)name;
|
||||
- (NSDictionary *) classInformation;
|
||||
|
||||
/* Parsing and creating classes */
|
||||
- (BOOL) makeSourceAndHeaderFilesForClass: (NSString *)className
|
||||
|
|
|
@ -2260,6 +2260,11 @@
|
|||
return className;
|
||||
}
|
||||
|
||||
- (NSDictionary *) classInformation
|
||||
{
|
||||
return classInformation;
|
||||
}
|
||||
|
||||
- (NSString *) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s: %lx> = %@",
|
||||
|
|
|
@ -299,6 +299,11 @@
|
|||
|
||||
/* Connections */
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
- (NSMutableArray *) connections;
|
||||
|
||||
/**
|
||||
* Build our reverse mapping information and other initialisation
|
||||
*/
|
||||
|
|
|
@ -122,6 +122,24 @@
|
|||
[pair setArgument: obj];
|
||||
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)
|
||||
{
|
||||
NSString *file = nil; // [[pi arguments] lastObject];
|
||||
NSString *file = nil;
|
||||
NSString *outputPath = @"./";
|
||||
GormDocumentController *dc = [GormDocumentController sharedDocumentController];
|
||||
GormDocument *doc = nil;
|
||||
|
@ -225,6 +243,21 @@
|
|||
[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...
|
||||
opt = [args objectForKey: @"--write"];
|
||||
if (opt != nil)
|
||||
|
|
Loading…
Reference in a new issue