forked from preemptive/PPiOS-Rename
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CDCoreDataModelParser.m
41 lines (31 loc) · 1.26 KB
/
CDCoreDataModelParser.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/********************************************
Copyright 2016 PreEmptive Solutions, LLC
See LICENSE.txt for licensing information
********************************************/
#import "CDCoreDataModelParser.h"
#import "GDataXMLNode.h"
@implementation CDCoreDataModelParser
- (void)addSymbolsFromNode:(GDataXMLElement *)element toArray:(NSMutableArray *)symbolsArray {
NSArray *childNodes = element.children;
// Get the class name
GDataXMLNode *className = [element attributeForName:@"representedClassName"];
if (className) {
[symbolsArray addObject:[NSString stringWithFormat:@"!%@", className.stringValue]];
}
// Get the class name
GDataXMLNode *parentClassName = [element attributeForName:@"parentEntity"];
if (parentClassName) {
[symbolsArray addObject:[NSString stringWithFormat:@"!%@", parentClassName.stringValue]];
}
// Recursively process rest of the elements
for (GDataXMLElement *childNode in childNodes) {
// Skip comments
if ([childNode isKindOfClass:[GDataXMLElement class]]) {
[self addSymbolsFromNode:childNode toArray:symbolsArray];
}
}
}
- (void)obfuscateElement:(GDataXMLElement *)element usingSymbols:(NSDictionary *)symbols {
// TODO implement later
}
@end