Skip to content

Instantly share code, notes, and snippets.

@yageek
Created June 9, 2013 15:23
Show Gist options
  • Save yageek/5743919 to your computer and use it in GitHub Desktop.
Save yageek/5743919 to your computer and use it in GitHub Desktop.
{
"repo_token": "SsMwWVXBSQ3OA1ryIc1uAsIqtcVqXZ2rO",
"service_name": "travis-ci",
"sources_files": [
{
"name": "main.m",
"source": "//\n// main.m\n// Peeler\n//\n// Created by HEINRICH Yannick on 24/05/13.\n// Copyright (c) 2013 YaGeek's Company. All rights reserved.\n//\n\n#import <Cocoa/Cocoa.h>\n\nint main(int argc, char *argv[])\n{\n return NSApplicationMain(argc, (const char **)argv);\n}\n",
"coverage": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
0,
null
]
},
{
"name": "YGExecutable.m",
"source": "//\n// YGExecutable.m\n// Peeler\n//\n// Created by HEINRICH Yannick on 24/05/13.\n// Copyright (c) 2013 YaGeek's Company. All rights reserved.\n//\n\n#import \"YGExecutable.h\"\n#import \"YGFatBinary.h\"\n\nstatic YGExecutable * _executablePlaceHolder;\n\n@implementation YGExecutable\n\n+ (void) initialize\n{\n if( self == [YGExecutable class])\n {\n _executablePlaceHolder = [self alloc];\n }\n\n}\n\n+ (id) allocWithZone{\n if(self == [YGExecutable class])\n {\n if(!_executablePlaceHolder)\n {\n _executablePlaceHolder = [super allocWithZone }\n\n return _executablePlaceHolder;\n\n }\n return [super allocWithZone}\n\n\n- (id) init {\n if(self = [super init])\n {\n \n }\n return self;\n}\n- (id) initWithData{\n \n id executable = nil;\n \n YGFatBinary * fatBinary;\n if((fatBinary = [[YGFatBinary alloc] initWithData {\n \n \n \n [fatBinary release];\n }\n// else if(){\n// \n// }\n// else if (){\n// \n// }\n// \n// if([YGFatBinary isFatBinary// {\n// YGFatBinary * fatBinary = [[YGFatBinary alloc] initWithData// \n// //TODO// \n// \n// executable = fatBinary;\n// }\n//// executable = [[YGFatBinary alloc] initWithData// if(!executable){\n// [self release];\n// return nil;\n// } \n// \n return executable;\n \n}\n@end\n",
"coverage": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
3,
null,
3,
null,
1,
1,
null,
3,
null,
1,
null,
1,
null,
1,
null,
1,
1,
null,
1,
null,
null,
0,
1,
null,
null,
0,
0,
null,
null,
0,
0,
null,
0,
null,
null,
0,
null,
0,
0,
null,
null,
null,
null,
0,
0,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
null,
null
]
},
{
"name": "YGExecutableDocument.m",
"source": "//\n// YGExecutable.m\n// Peeler\n//\n// Created by HEINRICH Yannick on 24/05/13.\n// Copyright (c) 2013 YaGeek's Company. All rights reserved.\n//\n\n#import \"YGExecutableDocument.h\"\n\n@implementation YGExecutableDocument\n\n- (id) init\n{\n if(self = [super init])\n {\n _name = @\"Untitled\";\n _executable = nil;\n }\n\n return self;\n}\n\n- (NSString*) windowNibName\n{\n return @\"YGExecutableDocument\";\n}\n\n- (NSData *)dataOfType{\n // Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil.\n // You can also choose to override -fileWrapperOfType NSException *exception = [NSException exceptionWithName @throw exception;\n return nil;\n}\n\n- (BOOL)readFromData{\n // Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning NO.\n // You can also choose to override -readFromFileWrapper // If you override either of these, you should also override -isEntireFileLoaded to return NO if the contents are lazily loaded.\n NSException *exception = [NSException exceptionWithName @throw exception;\n return YES;\n}\n- (IBAction)openExecutableTriggered{\n\n NSOpenPanel * oPanel = [NSOpenPanel openPanel];\n oPanel.canChooseFiles = YES;\n oPanel.canChooseDirectories = NO;\n oPanel.allowsMultipleSelection = NO;\n oPanel.showsHiddenFiles = YES;\n oPanel.treatsFilePackagesAsDirectories = YES;\n \n [oPanel beginSheetModalForWindow\n if(result == NSFileHandlingPanelOKButton)\n {\n NSString * path = [[oPanel URL] path];\n NSLog(@\"Selected path \n _executable = [[YGExecutable alloc] initWithData if(!_executable)\n {\n [[NSAlert alertWithMessageText }\n \n \n }\n \n\n }];\n}\n@end\n",
"coverage": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
0,
null,
0,
0,
0,
null,
0,
null,
null,
0,
null,
0,
null,
null,
0,
null,
null,
null,
0,
0,
null,
0,
null,
0,
null,
null,
null,
null,
0,
0,
null,
0,
0,
null,
null,
0,
0,
0,
0,
0,
0,
null,
0,
null,
0,
null,
0,
0,
null,
0,
0,
null,
0,
0,
null,
null,
0,
null,
null,
0,
0,
null
]
},
{
"name": "YGFatBinary.m",
"source": "//\n// YGFatBinary.m\n// Peeler\n//\n// Created by HEINRICH Yannick on 24/05/13.\n// Copyright (c) 2013 YaGeek's Company. All rights reserved.\n//\n\n#import <mach-o/fat.h>\n#import \"YGFatBinary.h\"\n\n@implementation YGFatBinary\n\n- (id) initWithData{\n if(![YGFatBinary isFatBinary {\n [self release];\n return nil;\n \n }\n \n if(self = [super init])\n {\n [data getBytes \n _archesNumber = CFSwapInt32BigToHost(_header.nfat_arch);\n \n for(uint32_t index = 0; index < _archesNumber; ++index)\n {\n NSRange range = NSMakeRange(sizeof(struct fat_header) + index*sizeof(struct fat_arch), sizeof(struct fat_arch));\n struct fat_arch arch;\n [data getBytes _arches[index] = arch;\n }\n \n }\n return self;\n}\n\n+ (BOOL) isFatBinary{\n uint32_t magicNumber;\n [data getBytes return CFSwapInt32HostToBig(magicNumber) == FAT_MAGIC;\n}\n\n- (NSDictionary*) infosDict\n{\n \n return nil;\n}\n@end\n",
"coverage": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
0,
null,
0,
null,
0,
0,
null,
null,
null,
0,
null,
0,
null,
0,
null,
0,
null,
0,
0,
0,
0,
0,
null,
0,
0,
0,
null,
0,
null,
0,
0,
0,
null,
null,
0,
null,
null,
0,
null,
null
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment