-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathXCDProjectCoordinator.h
More file actions
83 lines (65 loc) · 4.25 KB
/
XCDProjectCoordinator.h
File metadata and controls
83 lines (65 loc) · 4.25 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// XCDProjectCoordinator.h - XcodeProjReader
// Created by Joshua Garnham on 20/06/2011. Edited by Alec Gray 10/7/13
#import <Cocoa/Cocoa.h>
@class XcodeObject;
@interface XCDProjectCoordinator : NSObject
// The root object which has references to the main group, configuration list's and targets
@property NSDictionary * rootObject;
// The main group is the highest group, it has the name of you proj. itself and contains all the subfold, e.g Classes, Other Sources, Resrcs etc.
@property (weak) NSDictionary * mainGroup;
@property NSMutableDictionary * sourceData; // The original dictionary of the data from the xcode project
@property NSMutableString * dataString; // The orgiginal data string of the data from the xcode project
@property int waitTime, i; // Internal
@property BOOL isDropbox; // Tells the project that it is accessing dropbox
// An array of nested dictionaries with value of parent, children, name and uuid.
// Used generally only in conjunction with NSOutlineView which requires nested dictionaries with a weak reference to the parent object
@property NSMutableArray * files;
@property NSString * filePath; // The location of the xcode project
@property NSString * originalDropboxPath;
@property (weak) NSString * rootObjectUUID; // The UUID of the root object
@property (weak) NSString * mainGroupUUID; // The UUID of the main group
@property (nonatomic,unsafe_unretained) id exportDelegate; // Delegate keeps track when exp. the proj.
- (void) parseXcodeProject;
- (id) initWithProjectAtPath:(NSString *)path;
- (void) removeItemWithUUID:(NSString*)uuid;
- (BOOL) addGroupWithTitle:(NSString*)title toItemWithUUID:(NSString*)parentUUID;
- (BOOL) addFileWithRelativePath:(NSString*)relPath asChildToItemWithUUID:(NSString*)parentItemUUID;
- (BOOL) newProjectAtPath:(NSString*)path withFrameworks:(NSArray*)frameworks
sourceFiles:(NSArray*)sourceFiles
supportingFiles:(NSArray*)supportingFiles oniOSVersion:(NSString*)iOSVersion; // iOS only
- (NSArray*) uuidsOfChildrenOfItemWithUUID:(NSString*)uuid;
- (NSUInteger) numberOfChildrenOfItemWithUUID:(NSString*)uuid;
- (XcodeObject*) itemWithUUID:(NSString*)uuid;
// Created this because it appears that itemWithUUID is still returning an NSDictionary
- (NSDictionary*) itemWithUUIDAsNSDictionary:(NSString *)uuid;
- (NSString*) nameOfItemWithUUID:(NSString*)uuid;
- (XcodeObject*) parentOfItemWithUUID:(NSString*)uuid;
- (BOOL) exportFilesFromProjectIntoFolderAtPath:(NSString*)destinationPath;
@end
typedef NS_ENUM (NSInteger, XCDBuildPhase) { XCDSourceBuildPhase,
XCDFrameworksBuildPhase };
typedef NS_ENUM (NSInteger, XCDExportStatus) { XCDExportStatusBegun,
XCDExportStatusPreProcessing,
XCDExportStatusProcessing,
XCDExportStatusComplete,
XCDExportStatusFailure };
NS_INLINE NSUInteger numberOfOccurrencesOfStringInString (NSString *needle, NSString *haystack) {
const char * rawNeedle = needle.UTF8String, * rawHaystack = haystack.UTF8String;
NSUInteger needleLen = strlen(rawNeedle), haystackLen = strlen(rawHaystack), needleCt = 0, needleIdx = 0, idx;
for (idx = 0; idx < haystackLen; ++idx) { const char thisChar = rawHaystack[idx];
if (thisChar != rawNeedle[needleIdx]) needleIdx = 0; // they don't match; reset the needle index
if (thisChar == rawNeedle[needleIdx]) { needleIdx++; // resetting the needle might be the beginning of another match // char match
if (needleIdx >= needleLen) { needleCt++; needleIdx = 0; } // we completed finding the needle
} } return needleCt; }
@interface NSObject (XCDProjectCoordinatorExportStatusDelegate)
- (void) statusChangedTo:(XCDExportStatus)status withFile:(NSString*)filePath;
@end
//<XCDProjectCoordinatorExportStatusDelegate> exportDelegate;
//@protocol XCDProjectCoordinatorExportStatusDelegate <NSObject>
//- (void) statusChangedTo:(XCDExportStatus)status withFile:(NSString*)filePath;
//@end
//@property NSString *originalDropboxPath; // The dropbox location of the xcode project
// NSString *filePath;
//@property (weak) NSString * rootObjectUUID;
//@property (weak) NSString * mainGroupUUID;
// NSMutableArray *files;