Permalink
Browse files

Regenerated the Xcode project for the command line tool

  • Loading branch information...
1 parent a2d072c commit cde9b9e8804a93c297681fd1aeed0c56719493f4 Adrian Kosmaczewski committed Nov 7, 2011
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,54 +0,0 @@
-#include <stdio.h>
-#import <Foundation/Foundation.h>
-#include "NibProcessor.h"
-
-// Call this program using "build/Debug/nib2objc TestViewController.xib" during development.
-int main (int argc, const char * argv[])
-{
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-
- // Verify that we have the required number of parameters in the command line
- if (argc < 2)
- {
- printf("This utility requires a valid NIB file path as parameter.\n");
- [pool drain];
- return 0;
- }
-
- // Test that the input file exists, and that it is not a directory
- NSString *nibFile = [NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding];
- NSFileManager *manager = [NSFileManager defaultManager];
- BOOL isDirectory = NO;
- BOOL fileExists = [manager fileExistsAtPath:nibFile isDirectory:&isDirectory];
- if (!fileExists || isDirectory)
- {
- printf("This utility requires a valid NIB file path as parameter.\n");
- [pool drain];
- return 0;
- }
-
- // As an optional second parameter, specify whether to use properties or setters
- NibProcessorCodeStyle codeStyle = NibProcessorCodeStyleProperties;
-
- if (argc > 2)
- {
- int value = atoi(argv[2]);
-
- if (value == 1 || value == 2)
- {
- codeStyle = (NibProcessorCodeStyle)value;
- }
- }
-
- // Use a Processor instance to generate the source code file
- // and redirect the output to the standard output stream
- NibProcessor *processor = [[NibProcessor alloc] init];
- processor.codeStyle = codeStyle;
- processor.input = nibFile;
- [processor process];
- printf([processor.output UTF8String], NULL);
- [processor release];
-
- [pool drain];
- return 0;
-}
@@ -0,0 +1,61 @@
+//
+// main.m
+// nib2objc
+//
+// Created by Adrian Kosmaczewski on 11/7/11.
+// Copyright (c) 2011 akosma software. All rights reserved.
+//
+
+#include <stdio.h>
+#import <Foundation/Foundation.h>
+#include "NibProcessor.h"
+
+int main (int argc, const char * argv[])
+{
+
+ @autoreleasepool {
+
+ // Verify that we have the required number of parameters in the command line
+ if (argc < 2)
+ {
+ printf("This utility requires a valid NIB file path as parameter.\n");
+ return 0;
+ }
+
+ // Test that the input file exists, and that it is not a directory
+ NSString *nibFile = [NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding];
+ NSFileManager *manager = [NSFileManager defaultManager];
+ BOOL isDirectory = NO;
+ BOOL fileExists = [manager fileExistsAtPath:nibFile isDirectory:&isDirectory];
+ if (!fileExists || isDirectory)
+ {
+ printf("This utility requires a valid NIB file path as parameter.\n");
+ return 0;
+ }
+
+ // As an optional second parameter, specify whether to use properties or setters
+ NibProcessorCodeStyle codeStyle = NibProcessorCodeStyleProperties;
+
+ if (argc > 2)
+ {
+ int value = atoi(argv[2]);
+
+ if (value == 1 || value == 2)
+ {
+ codeStyle = (NibProcessorCodeStyle)value;
+ }
+ }
+
+ // Use a Processor instance to generate the source code file
+ // and redirect the output to the standard output stream
+ NibProcessor *processor = [[NibProcessor alloc] init];
+ processor.codeStyle = codeStyle;
+ processor.input = nibFile;
+ [processor process];
+ printf([processor.output UTF8String], NULL);
+ [processor release];
+
+ }
+ return 0;
+}
+
@@ -1,5 +1,5 @@
//
-// Prefix header for all source files of the 'nib2objc' target in the 'nib2objc' project.
+// Prefix header for all source files of the 'nib2objc' target in the 'nib2objc' project
//
#ifdef __OBJC__

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit cde9b9e

Please sign in to comment.