├── MKDataScanner.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── marcinkrzyzanowski.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── MKDataScanner.xcscheme
└── project.pbxproj
├── .gitignore
├── MKDataScanner
├── MKDataScannerDataProvider.h
├── MKDataScannerStreamFileProvider.h
├── MKDataScannerDispatchIOFileProvider.h
├── MKDataProvider.h
├── MKDataScannerDataProvider.m
├── MKDataScanner.h
├── MKDataScannerDispatchIOFileProvider.m
├── MKDataScannerStreamFileProvider.m
└── MKDataScanner.m
├── MKDataScannerTests
├── Info.plist
└── MKFileScannerTest.m
├── MKDataScanner.podspec
├── README.md
└── LICENSE.txt
/MKDataScanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io
2 |
3 | ### Xcode ###
4 | build/
5 | *.pbxuser
6 | !default.pbxuser
7 | *.mode1v3
8 | !default.mode1v3
9 | *.mode2v3
10 | !default.mode2v3
11 | *.perspectivev3
12 | !default.perspectivev3
13 | xcuserdata
14 | *.xccheckout
15 | *.moved-aside
16 | DerivedData
17 | *.xcuserstate
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScannerDataProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScannerDataProvider.h
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 10/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MKDataProvider.h"
11 |
12 | @interface MKDataScannerDataProvider : NSObject
13 | - (instancetype)initWithData:(NSData *)data;
14 | @end
15 |
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScannerStreamFileProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScannerFileProvider.h
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 09/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MKDataProvider.h"
11 |
12 | @interface MKDataScannerStreamFileProvider : NSObject
13 | - (instancetype) initWithFileURL:(NSURL *)fileURL;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScannerDispatchIOFileProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScannerFileProvider.h
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 09/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MKDataProvider.h"
11 |
12 | @interface MKDataScannerDispatchIOFileProvider : NSObject
13 | - (instancetype) initWithFileURL:(NSURL *)fileURL;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/MKDataScanner/MKDataProvider.h:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataProvider.h
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 10/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol MKDataProvider
12 |
13 | - (NSInteger) offset;
14 | - (void) setOffset:(NSInteger)offset;
15 | - (NSData *) dataForRange:(NSRange)range;
16 | - (BOOL) isAtEnd;
17 | - (NSUInteger) size;
18 | @end
19 |
--------------------------------------------------------------------------------
/MKDataScanner.xcodeproj/xcuserdata/marcinkrzyzanowski.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MKDataScanner.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 7559316F1A6093DF000C5F8A
16 |
17 | primary
18 |
19 |
20 | 7559317A1A6093DF000C5F8A
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/MKDataScannerTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.hakore.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScannerDataProvider.m:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScannerDataProvider.m
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 10/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import "MKDataScannerDataProvider.h"
10 |
11 | @interface MKDataScannerDataProvider ()
12 | @property (copy) NSData *data;
13 | @property (assign) NSUInteger offset;
14 | @end
15 |
16 | @implementation MKDataScannerDataProvider
17 |
18 | - (instancetype)initWithData:(NSData *)data
19 | {
20 | if (self = [self init]) {
21 | _data = data;
22 | }
23 | return self;
24 | }
25 |
26 | #pragma mark - MKDataProvider
27 |
28 | - (NSData *)dataForRange:(NSRange)range
29 | {
30 | return [self.data subdataWithRange:range];
31 | }
32 |
33 | - (BOOL)isAtEnd
34 | {
35 | // return (self.offset < self.data.length);
36 | return (self.offset >= self.data.length);
37 | }
38 |
39 | - (NSUInteger)size
40 | {
41 | return self.data.length;
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/MKDataScanner.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "MKDataScanner"
3 | s.version = "0.2"
4 | s.summary = "NSScanner for NSData and files."
5 | s.description = "MKDataScanner is for raw data, what NSScanner is for NSString."
6 | s.homepage = "https://github.com/krzyzanowskim/MKDataScanner"
7 | s.license = { :type => 'BSD', :file => 'LICENSE.txt' }
8 | s.source = { :git => "https://github.com/krzyzanowskim/MKDataScanner.git", :tag => "#{s.version}" }
9 |
10 | s.authors = {'Marcin Krzyżanowski' => 'marcin.krzyzanowski@hakore.com'}
11 | s.social_media_url = "https://twitter.com/krzyzanowskim"
12 |
13 | s.ios.platform = :ios, '6.0'
14 | s.ios.deployment_target = '6.0'
15 | s.ios.header_dir = 'MKDataScanner'
16 |
17 | s.osx.platform = :osx, '10.9'
18 | s.osx.deployment_target = '10.9'
19 | s.osx.header_dir = 'MKDataScanner'
20 |
21 | s.source_files = 'MKDataScanner/*.{h,m}'
22 | s.public_header_files = 'MKDataScanner/*.h'
23 |
24 | s.requires_arc = true
25 | end
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #NSScanner for NSData and files
2 |
3 | MKDataScanner is for raw data, what NSScanner is for NSString. Because files are scanned as streams, large files can be scanned with minimum memory usage. Dedicated data providers for files and NSData.
4 |
5 | ##Features
6 |
7 | * NSScanner like interface.
8 | * Scan stream of file data for low memory usage.
9 |
10 | ##Installation
11 |
12 | CocoaPods
13 |
14 | `pod 'MKDataScanner'`
15 |
16 | ##Usage
17 |
18 | Scan file for sequence of bytes {0...8}
19 |
20 | UInt8 bytes[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
21 | NSData *searchData = [NSData dataWithBytes:bytes length:sizeof(bytes)]
22 |
23 | MKDataScanner *scanner = [MKDataScanner scannerWithFileURL:@"/path/file.dat"];
24 | NSData *scannedData = nil;
25 | if ([scanner scanUpToData:searchData intoData:&scannedData]) {
26 | NSLog(@"scanned data: %@",scannedData);
27 | }
28 |
29 | With convenience function scanUpToBytes
30 |
31 | UInt8 bytes[] = {0x03, 0x04, 0x05, 0x06};
32 | [dataScanner scanUpToBytes:&bytes length:sizeof(bytes) intoData:nil];
33 |
34 |
35 | Scan for integer
36 |
37 | NSInteger integer;
38 | if ([scanner scanInteger:&integer]) {
39 | NSLog(@"integer: %@",integer);
40 | ]
41 |
42 | ##Contact
43 |
44 | Marcin Krzyżanowski [@krzyzanowskim](http://twitter.com/krzyzanowskim)
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (C) 2015, Marcin Krzyżanowski All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are met:
5 |
6 | - Redistributions of source code must retain the above copyright notice, this
7 | list of conditions and the following disclaimer.
8 |
9 | - Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScanner.h:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScanner.h
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 09/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSInteger, MKDataFileHandlerType) {
12 | MKDataFileDefaultProvider = 0,
13 | MKDataFileDispatchIOProvider,
14 | MKDataFileStreamProvider
15 | };
16 |
17 | @interface MKDataScanner : NSObject
18 | @property NSUInteger scanLocation;
19 | @property (getter=isAtEnd, readonly) BOOL atEnd;
20 |
21 | - (instancetype) initWithFileURL:(NSURL *)fileURL provider:(MKDataFileHandlerType)providerType;
22 | - (instancetype) initWithFileURL:(NSURL *)fileURL;
23 | - (instancetype) initWithData:(NSData *)data;
24 | + (instancetype) scannerWithFileURL:(NSURL *)fileURL;
25 | + (instancetype) scannerWithData:(NSData *)data;
26 |
27 | - (BOOL)scanUpToBytes:(const void *)bytes length:(int)length intoData:(NSData * __autoreleasing *)dataValue;
28 | - (BOOL)scanUpToBytesFromSet:(NSSet *)stopSet intoData:(NSData * __autoreleasing *)dataValue;
29 | - (BOOL)scanUpToData:(NSData *)stopData intoData:(NSData **)dataValue;
30 | - (BOOL)scanData:(NSData *)data intoData:(NSData **)dataValue;
31 | - (BOOL)scanInteger:(NSInteger *)value;
32 | - (BOOL)scanByte:(Byte *)value;
33 | - (BOOL)scanBytes:(Byte *)buffer length:(int)length;
34 | - (BOOL)scanHexFloat:(Float32 *)value;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScannerDispatchIOFileProvider.m:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScannerFileProvider.m
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 09/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import "MKDataScannerDispatchIOFileProvider.h"
10 |
11 | @interface MKDataScannerDispatchIOFileProvider ()
12 | @property (copy) NSURL *fileURL;
13 | @property (assign) NSInteger fileSize;
14 | @property (strong) dispatch_io_t dispatchIO;
15 | @property (strong) dispatch_queue_t queue;
16 | @property (assign) NSInteger localOffset;
17 | @end
18 |
19 | @implementation MKDataScannerDispatchIOFileProvider
20 |
21 | - (instancetype) initWithFileURL:(NSURL *)fileURL
22 | {
23 | NSParameterAssert(fileURL.fileURL);
24 | if (self = [self init]) {
25 | _fileURL = fileURL;
26 |
27 | NSNumber* theSize = nil;
28 | [self.fileURL getResourceValue:&theSize forKey:NSURLFileSizeKey error:nil];
29 | _fileSize = [theSize integerValue];
30 |
31 | _queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
32 | _dispatchIO = dispatch_io_create_with_path (DISPATCH_IO_RANDOM, [fileURL.path UTF8String], 0, O_RDONLY, _queue, nil);
33 | }
34 | return self;
35 | }
36 |
37 | - (void)dealloc
38 | {
39 | dispatch_io_close(self.dispatchIO, 0);
40 | }
41 |
42 | #pragma mark - MKDataProvider
43 |
44 | - (NSData *)dataForRange:(NSRange)range
45 | {
46 | __block NSMutableData *totalData = [NSMutableData data];
47 | dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
48 | dispatch_io_read(self.dispatchIO, range.location, range.length, self.queue, ^(bool done, dispatch_data_t data, int error) {
49 | if (data) {
50 | [totalData appendData:(NSData *)data];
51 | }
52 |
53 | if (done) {
54 | dispatch_semaphore_signal(semaphore);
55 | }
56 | });
57 |
58 | dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
59 | return totalData.length > 0 ? [totalData copy] : nil;
60 | }
61 |
62 | - (NSInteger)offset
63 | {
64 | return self.localOffset;
65 | }
66 |
67 | - (void)setOffset:(NSInteger)offset
68 | {
69 | NSParameterAssert(offset >= 0);
70 | self.localOffset = offset;
71 | }
72 |
73 | - (BOOL)isAtEnd
74 | {
75 | if (self.offset >= self.fileSize) {
76 | return YES;
77 | }
78 | return NO;
79 | }
80 |
81 | - (NSUInteger)size
82 | {
83 | return self.fileSize;
84 | }
85 |
86 | @end
87 |
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScannerStreamFileProvider.m:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScannerFileProvider.m
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 09/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import "MKDataScannerStreamFileProvider.h"
10 |
11 | @interface MKDataScannerStreamFileProvider ()
12 | @property (copy) NSURL *fileURL;
13 | @property (strong) NSInputStream *inputStream;
14 | @property (assign) BOOL endReached;
15 | @end
16 |
17 | @implementation MKDataScannerStreamFileProvider
18 |
19 | - (instancetype) initWithFileURL:(NSURL *)fileURL
20 | {
21 | NSParameterAssert(fileURL.fileURL);
22 | if (self = [self init]) {
23 | _fileURL = fileURL;
24 | [self resetStream];
25 | }
26 | return self;
27 | }
28 |
29 | - (void)dealloc
30 | {
31 | [_inputStream close];
32 | }
33 |
34 | - (void) resetStream
35 | {
36 | [self.inputStream close];
37 | self.inputStream = [NSInputStream inputStreamWithURL:self.fileURL];
38 | [self.inputStream open];
39 | }
40 |
41 | #pragma mark - MKDataProvider
42 |
43 | // random access to stream data is unefficient because stream is reset after every access
44 | - (NSData *)dataForRange:(NSRange)range
45 | {
46 | NSUInteger initialOffset = self.offset;
47 | [self setOffset:range.location];
48 |
49 | uint8_t buffer[range.length];
50 | NSInteger result = [self.inputStream read:buffer maxLength:range.length];
51 | if (result < 0) {
52 | return nil;
53 | } else if (result == 0) {
54 | self.endReached = YES;
55 | } else if (result > 0) {
56 | NSData *readData = [NSData dataWithBytes:buffer length:result];
57 | [self setOffset:initialOffset];
58 | return readData;
59 | }
60 |
61 | return nil;
62 | }
63 |
64 | - (NSInteger)offset
65 | {
66 | NSNumber *value = [self.inputStream propertyForKey:NSStreamFileCurrentOffsetKey];
67 | NSAssert([value isKindOfClass:[NSNumber class]], @"Invalid class");
68 | return value.integerValue;
69 | }
70 |
71 | - (void)setOffset:(NSInteger)offset
72 | {
73 | NSParameterAssert(offset >= 0);
74 |
75 | if (offset == [self offset]) {
76 | return;
77 | }
78 |
79 | if (offset < [self offset]) {
80 | [self resetStream];
81 | }
82 |
83 | BOOL ret = [self.inputStream setProperty:@(offset) forKey:NSStreamFileCurrentOffsetKey];
84 | NSAssert(ret, @"Can't set offset");
85 | if (ret) {
86 | self.endReached = NO;
87 | }
88 | }
89 |
90 | - (BOOL)isAtEnd
91 | {
92 | return self.endReached;
93 | }
94 |
95 | - (NSUInteger)size
96 | {
97 | NSNumber* theSize = nil;
98 | [self.fileURL getResourceValue:&theSize forKey:NSURLFileSizeKey error:nil];
99 | return [theSize unsignedIntegerValue];
100 | }
101 |
102 | @end
103 |
--------------------------------------------------------------------------------
/MKDataScanner.xcodeproj/xcuserdata/marcinkrzyzanowski.xcuserdatad/xcschemes/MKDataScanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
94 |
100 |
101 |
102 |
103 |
105 |
106 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/MKDataScannerTests/MKFileScannerTest.m:
--------------------------------------------------------------------------------
1 | //
2 | // MKFileScannerTest.m
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 10/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "MKDataScanner.h"
11 |
12 | @interface MKFileScannerTest : XCTestCase
13 | @end
14 |
15 | @implementation MKFileScannerTest
16 |
17 | - (id)initWithInvocation:(NSInvocation *)invocation
18 | {
19 | if (self = [super initWithInvocation:invocation]) {
20 | }
21 | return self;
22 | }
23 |
24 | - (NSString *)tmpFilePath
25 | {
26 | return [NSTemporaryDirectory() stringByAppendingPathComponent:@"test.file.data"];
27 | }
28 |
29 |
30 | - (void)setUp {
31 | [super setUp];
32 |
33 | uint8_t bytes[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
34 | [[NSData dataWithBytes:bytes length:sizeof(bytes)] writeToFile:[self tmpFilePath] atomically:YES];
35 | }
36 |
37 | - (void)tearDown {
38 | [super tearDown];
39 | [[NSFileManager defaultManager] removeItemAtPath:[self tmpFilePath] error:nil];
40 | }
41 |
42 | - (void) testScanUpToBytes
43 | {
44 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
45 | UInt8 searchBytes[] = {0x01};
46 | XCTAssertTrue([dataScanner scanUpToBytes:&searchBytes length:sizeof(searchBytes) intoData:nil]);
47 | XCTAssertEqual(dataScanner.scanLocation, 1);
48 | }
49 |
50 | - (void) testScanUpToBytes2
51 | {
52 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
53 | UInt8 searchBytes[] = {0x03, 0x04, 0x05, 0x06};
54 | XCTAssertTrue([dataScanner scanUpToBytes:&searchBytes length:sizeof(searchBytes) intoData:nil]);
55 | XCTAssertEqual(dataScanner.scanLocation, 3);
56 | }
57 |
58 | - (void) testScanUpTo1
59 | {
60 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
61 | uint8_t searchBytes[] = {0x04, 0x05};
62 | XCTAssertTrue([dataScanner scanUpToData:[NSData dataWithBytes:searchBytes length:sizeof(searchBytes)] intoData:nil]);
63 | XCTAssertEqual(dataScanner.scanLocation, 4);
64 | }
65 |
66 | - (void) testScanUpTo2
67 | {
68 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
69 |
70 | NSData *scanned = nil;
71 | uint8_t bytes1[] = {0x01};
72 | uint8_t expectedBytes1[] = {0x00};
73 | XCTAssertTrue([dataScanner scanUpToData:[NSData dataWithBytes:bytes1 length:sizeof(bytes1)] intoData:&scanned]);
74 | XCTAssert([[NSData dataWithBytes:expectedBytes1 length:sizeof(expectedBytes1)] isEqualToData:scanned], @"Invalid scanned value");
75 | XCTAssertEqual(dataScanner.scanLocation, 1);
76 |
77 | uint8_t bytes2[] = {0x04};
78 | uint8_t expectedBytes2[] = {0x01, 0x02, 0x03};
79 | XCTAssertTrue([dataScanner scanUpToData:[NSData dataWithBytes:bytes2 length:sizeof(bytes2)] intoData:&scanned]);
80 | XCTAssert([[NSData dataWithBytes:expectedBytes2 length:sizeof(expectedBytes2)] isEqualToData:scanned], @"Invalid scanned value");
81 | XCTAssertEqual(dataScanner.scanLocation, 4);
82 | }
83 |
84 | - (void) testScanUpTo3
85 | {
86 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
87 |
88 | uint8_t bytes1[] = {0x05};
89 | XCTAssertTrue([dataScanner scanUpToData:[NSData dataWithBytes:bytes1 length:sizeof(bytes1)] intoData:nil]);
90 | uint8_t bytes2[] = {0x06};
91 | XCTAssertTrue([dataScanner scanUpToData:[NSData dataWithBytes:bytes2 length:sizeof(bytes2)] intoData:nil]);
92 | }
93 |
94 | - (void) testScanUpTo4
95 | {
96 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
97 | uint8_t bytes1[] = {0x06};
98 | XCTAssertTrue([dataScanner scanUpToData:[NSData dataWithBytes:bytes1 length:sizeof(bytes1)] intoData:nil]);
99 | uint8_t bytes2[] = {0x05};
100 | XCTAssertFalse([dataScanner scanUpToData:[NSData dataWithBytes:bytes2 length:sizeof(bytes2)] intoData:nil]);
101 | }
102 |
103 | - (void) testSetScanLocation
104 | {
105 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
106 | uint8_t bytes1[] = {0x06};
107 | [dataScanner setScanLocation:7];
108 | XCTAssertFalse([dataScanner scanUpToData:[NSData dataWithBytes:bytes1 length:sizeof(bytes1)] intoData:nil]);
109 | [dataScanner setScanLocation:1];
110 | XCTAssertTrue([dataScanner scanUpToData:[NSData dataWithBytes:bytes1 length:sizeof(bytes1)] intoData:nil]);
111 | }
112 |
113 | - (void) testScanUpToNotExists
114 | {
115 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
116 |
117 | uint8_t bytes[] = {0x08, 0x09};
118 | XCTAssertFalse([dataScanner scanUpToData:[NSData dataWithBytes:bytes length:sizeof(bytes)] intoData:nil]);
119 | }
120 |
121 | - (void) testScanData1
122 | {
123 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
124 |
125 | NSData *scanned = nil;
126 | uint8_t bytes[] = {0x00, 0x01};
127 | NSUInteger beforeLocation = dataScanner.scanLocation;
128 | XCTAssertTrue([dataScanner scanData:[NSData dataWithBytes:bytes length:sizeof(bytes)] intoData:&scanned]);
129 | XCTAssertEqual(dataScanner.scanLocation, beforeLocation + sizeof(bytes));
130 |
131 | [dataScanner setScanLocation:1];
132 | XCTAssertFalse([dataScanner scanData:[NSData dataWithBytes:bytes length:sizeof(bytes)] intoData:&scanned]);
133 | }
134 |
135 | - (void) testScanInteger
136 | {
137 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
138 | [dataScanner setScanLocation:0];
139 | NSInteger scannedInteger;
140 | XCTAssertTrue([dataScanner scanInteger:&scannedInteger]);
141 | XCTAssertEqual(scannedInteger, 506097522914230528);
142 | }
143 |
144 | - (void) testScanByte
145 | {
146 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
147 | [dataScanner setScanLocation:3];
148 | Byte scannedByte;
149 | XCTAssertTrue([dataScanner scanByte:&scannedByte]);
150 | XCTAssertEqual(scannedByte, 0x03);
151 | }
152 |
153 | - (void) testScanBytes
154 | {
155 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
156 | [dataScanner setScanLocation:3];
157 | Byte scannedBytes[6];
158 | XCTAssertTrue([dataScanner scanBytes:scannedBytes length:6]);
159 | XCTAssertFalse([dataScanner scanBytes:scannedBytes length:9]);
160 | XCTAssertEqual(scannedBytes[0], 0x03);
161 | }
162 |
163 | - (void) testscanUpToBytesFromSet
164 | {
165 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithFileURL:[NSURL fileURLWithPath:[self tmpFilePath]]];
166 | NSData *scanned;
167 | [dataScanner scanUpToBytesFromSet:[NSSet setWithArray:@[@(0x02),@(0x02),@(0x03),@(0x04)]] intoData:&scanned];
168 | XCTAssertEqual(dataScanner.scanLocation, 2);
169 | [dataScanner scanUpToBytesFromSet:[NSSet setWithArray:@[@(0x08),@(0x07)]] intoData:&scanned];
170 | XCTAssertEqual(dataScanner.scanLocation, 7);
171 | }
172 |
173 | - (void) testScanFloat32FromDataSet
174 | {
175 | // write a well known float32 to NSData
176 | Float32 wellKnownValue = 12345678.0f;
177 | Float32 wellKnownValue2 = 98765432.0;
178 | NSUInteger float32Size = sizeof(Float32);
179 |
180 | NSMutableData * prefabFloatData = [NSMutableData dataWithCapacity:0];
181 | [prefabFloatData appendBytes:&wellKnownValue length:float32Size];
182 | [prefabFloatData appendBytes:&wellKnownValue2 length:float32Size];
183 |
184 | // initialise the scanner with the Data
185 | MKDataScanner *dataScanner = [[MKDataScanner alloc] initWithData:prefabFloatData];
186 |
187 | Float32 checkWellKnownFloatValue = 0.0f, checkWellKnownFloatValue2 = 0.0f;
188 | // retrieve the first one
189 | [dataScanner scanHexFloat:&checkWellKnownFloatValue];
190 | XCTAssertEqual(checkWellKnownFloatValue, wellKnownValue);
191 | // retrieve the first one
192 | [dataScanner scanHexFloat:&checkWellKnownFloatValue2];
193 | XCTAssertEqual(checkWellKnownFloatValue2, wellKnownValue2);
194 | }
195 |
196 | @end
197 |
--------------------------------------------------------------------------------
/MKDataScanner/MKDataScanner.m:
--------------------------------------------------------------------------------
1 | //
2 | // MKDataScanner.m
3 | // MKDataScanner
4 | //
5 | // Created by Marcin Krzyzanowski on 09/01/15.
6 | // Copyright (c) 2015 Marcin Krzyżanowski. All rights reserved.
7 | //
8 |
9 | #import "MKDataScanner.h"
10 | #import "MKDataProvider.h"
11 | #import "MKDataScannerStreamFileProvider.h"
12 | #import "MKDataScannerDispatchIOFileProvider.h"
13 | #import "MKDataScannerDataProvider.h"
14 |
15 | @interface MKDataScanner ()
16 | @property (strong) id provider;
17 | @end
18 |
19 | @implementation MKDataScanner
20 |
21 | - (instancetype) initWithFileURL:(NSURL *)fileURL provider:(MKDataFileHandlerType)providerType;
22 | {
23 | NSParameterAssert(fileURL.fileURL);
24 | if (!fileURL) {
25 | return nil;
26 | }
27 |
28 | if (self = [self init]) {
29 | switch (providerType) {
30 | case MKDataFileDispatchIOProvider:
31 | _provider = [[MKDataScannerDispatchIOFileProvider alloc] initWithFileURL:fileURL];
32 | break;
33 | case MKDataFileStreamProvider:
34 | _provider = [[MKDataScannerStreamFileProvider alloc] initWithFileURL:fileURL];
35 | break;
36 | default:
37 | _provider = [[MKDataScannerDispatchIOFileProvider alloc] initWithFileURL:fileURL];
38 | break;
39 | }
40 | }
41 | return self;
42 | }
43 |
44 | - (instancetype) initWithFileURL:(NSURL *)fileURL
45 | {
46 | if (self = [self initWithFileURL:fileURL provider:MKDataFileDefaultProvider]) {
47 |
48 | }
49 | return self;
50 | }
51 |
52 | - (instancetype) initWithData:(NSData *)data
53 | {
54 | NSParameterAssert(data);
55 | if (!data) {
56 | return nil;
57 | }
58 |
59 | if (self = [self init]) {
60 | _provider = [[MKDataScannerDataProvider alloc] initWithData:data];
61 | }
62 | return self;
63 | }
64 |
65 | - (NSUInteger)scanLocation
66 | {
67 | return [self.provider offset];
68 | }
69 |
70 | - (void)setScanLocation:(NSUInteger)scanLocation
71 | {
72 | [self.provider setOffset:scanLocation];
73 | }
74 |
75 | - (BOOL)isAtEnd
76 | {
77 | return [self.provider isAtEnd];
78 | }
79 |
80 |
81 | /**
82 | * Scans the data until a byte from a given set is encountered, accumulating bytes into a data that’s returned by reference.
83 | *
84 | * @param stopSet The set of bytes up to which to scan.
85 | * @param dataValue Upon return, contains the bytes scanned.
86 | *
87 | * @return YES if the receiver scanned any bytes, otherwise NO.
88 | */
89 | - (BOOL) scanUpToBytesFromSet:(NSSet *)stopSet intoData:(NSData * __autoreleasing *)dataValue
90 | {
91 | NSParameterAssert(stopSet);
92 | NSMutableData *scannedData = [NSMutableData data];
93 |
94 | NSUInteger location = self.scanLocation;
95 | NSData *currentBlock = nil;
96 | while ((currentBlock = [self.provider dataForRange:(NSRange){location,sizeof(Byte)}])) {
97 | for (NSNumber *stopByteNumber in stopSet) {
98 | NSAssert(stopByteNumber.unsignedIntValue <= 255, @"Invalid set");
99 | Byte stopByte = stopByteNumber.unsignedShortValue;
100 | Byte blockByte = 0;
101 | [currentBlock getBytes:&blockByte length:sizeof(Byte)];
102 | if (blockByte == stopByte) {
103 | [scannedData appendData:currentBlock];
104 | if (dataValue) {
105 | *dataValue = [scannedData copy];
106 | }
107 | self.scanLocation = location;
108 | return YES;
109 | }
110 | }
111 | location += currentBlock.length;
112 | [scannedData appendData:currentBlock];
113 | }
114 | return NO;
115 | }
116 |
117 | - (BOOL)scanUpToBytes:(const void *)bytes length:(int)length intoData:(NSData * __autoreleasing *)dataValue
118 | {
119 | NSData *data = [NSData dataWithBytes:bytes length:length];
120 | return [self scanUpToData:data intoData:dataValue];
121 | }
122 |
123 | - (BOOL)scanUpToData:(NSData *)stopData intoData:(NSData * __autoreleasing *)dataValue
124 | {
125 | NSParameterAssert(stopData);
126 | NSMutableData *scannedData = [NSMutableData data];
127 |
128 | NSUInteger location = self.scanLocation;
129 | NSData *currentBlock = nil;
130 | while ((currentBlock = [self.provider dataForRange:(NSRange){location,stopData.length * 2}])) {
131 | NSRange searchRange = [currentBlock rangeOfData:stopData options:0 range:(NSRange){0,currentBlock.length}];
132 | if (searchRange.location != NSNotFound) {
133 | if (dataValue) {
134 | [scannedData appendData:[currentBlock subdataWithRange:(NSRange){0,searchRange.location}]];
135 | *dataValue = [scannedData copy];
136 | }
137 | self.scanLocation = location + searchRange.location;
138 | return YES;
139 | }
140 | location += currentBlock.length;
141 | [scannedData appendData:currentBlock];
142 | }
143 | return NO;
144 | }
145 |
146 | - (BOOL)scanData:(NSData *)data intoData:(NSData **)dataValue
147 | {
148 | NSData *scannedBlock = nil;
149 | if (![self.provider isAtEnd] && (scannedBlock = [self.provider dataForRange:(NSRange){self.scanLocation,data.length}])) {
150 | if ([scannedBlock isEqualToData:data]) {
151 | if (dataValue) {
152 | *dataValue = scannedBlock;
153 | }
154 | self.scanLocation += scannedBlock.length;
155 | return YES;
156 | }
157 | }
158 |
159 | return NO;
160 | }
161 |
162 | - (BOOL)scanInteger:(NSInteger *)value
163 | {
164 | NSData *scannedBlock = nil;
165 | if (![self.provider isAtEnd] && (scannedBlock = [self.provider dataForRange:(NSRange){self.scanLocation,sizeof(NSInteger)}])) {
166 | if (scannedBlock.length != sizeof(NSInteger)) {
167 | if (value) {
168 | *value = scannedBlock.length > sizeof(NSInteger) ? INT_MAX : INT_MIN;
169 | }
170 | return NO;
171 | }
172 | NSInteger scannedValue;
173 | [scannedBlock getBytes:&scannedValue length:scannedBlock.length];
174 | if (value) {
175 | *value = scannedValue;
176 | }
177 | self.scanLocation = self.scanLocation + scannedBlock.length;
178 | return YES;
179 | }
180 | return NO;
181 | }
182 |
183 | - (BOOL)scanByte:(Byte *)value
184 | {
185 | NSData *scannedBlock = nil;
186 | if (![self.provider isAtEnd] && (scannedBlock = [self.provider dataForRange:(NSRange){self.scanLocation,sizeof(UInt8)}])) {
187 | if (scannedBlock.length < sizeof(UInt8)) {
188 | return NO;
189 | }
190 | NSInteger scannedValue;
191 | [scannedBlock getBytes:&scannedValue length:scannedBlock.length];
192 | if (value) {
193 | *value = scannedValue;
194 | }
195 | self.scanLocation = self.scanLocation + scannedBlock.length;
196 | return YES;
197 | }
198 | return NO;
199 | }
200 |
201 | - (BOOL) scanBytes:(Byte *)buffer length:(int)length
202 | {
203 | int bytesCount = 0;
204 | while (bytesCount < length) {
205 |
206 | Byte byte;
207 | if (![self scanByte:&byte]) {
208 | return NO;
209 | }
210 |
211 | buffer[bytesCount] = byte;
212 | bytesCount++;
213 | }
214 | return YES;
215 | }
216 |
217 | - (BOOL)scanHexFloat:(Float32 *)value
218 | {
219 | NSData *scannedBlock = nil;
220 | if (![self.provider isAtEnd] && (scannedBlock = [self.provider dataForRange:(NSRange){self.scanLocation,sizeof(Float32)}])) {
221 | if (scannedBlock.length != sizeof(Float32)) {
222 | if (value) {
223 | *value = scannedBlock.length > sizeof(Float32) ? INT_MAX : INT_MIN;
224 | }
225 | return NO;
226 | }
227 | Float32 scannedValue = 0.0f;
228 | [scannedBlock getBytes:&scannedValue length:scannedBlock.length];
229 | if (value) {
230 | *value = scannedValue;
231 | }
232 | self.scanLocation = self.scanLocation + scannedBlock.length;
233 | return YES;
234 | }
235 | return NO;
236 | }
237 |
238 | + (instancetype) scannerWithFileURL:(NSURL *)fileURL
239 | {
240 | return [[MKDataScanner alloc] initWithFileURL:fileURL];
241 | }
242 |
243 | + (instancetype) scannerWithData:(NSData *)data
244 | {
245 | return [[MKDataScanner alloc] initWithData:data];
246 | }
247 |
248 | @end
249 |
--------------------------------------------------------------------------------
/MKDataScanner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 4A127D231ADEBD0E004EFE3A /* libMKDataScanner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A127D181ADEBD0E004EFE3A /* libMKDataScanner.a */; };
11 | 4A127D2F1ADEBE22004EFE3A /* MKDataScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 755931751A6093DF000C5F8A /* MKDataScanner.m */; };
12 | 4A127D301ADEBE27004EFE3A /* MKDataScannerStreamFileProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 7559318B1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.m */; };
13 | 4A127D311ADEBE2A004EFE3A /* MKDataScannerDispatchIOFileProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 753220061A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.m */; };
14 | 4A127D321ADEBE2D004EFE3A /* MKDataScannerDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 753052B61A60BF30003A2746 /* MKDataScannerDataProvider.m */; };
15 | 4A127D331ADEBFD7004EFE3A /* MKFileScannerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7559318E1A609D1D000C5F8A /* MKFileScannerTest.m */; };
16 | 4A127D341ADEC05C004EFE3A /* MKDataScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 755931731A6093DF000C5F8A /* MKDataScanner.h */; settings = {ATTRIBUTES = (Public, ); }; };
17 | 4A127D361ADEC1E8004EFE3A /* MKDataScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 755931731A6093DF000C5F8A /* MKDataScanner.h */; settings = {ATTRIBUTES = (Public, ); }; };
18 | 753052B71A60BF30003A2746 /* MKDataScannerDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 753052B61A60BF30003A2746 /* MKDataScannerDataProvider.m */; };
19 | 753220071A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 753220061A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.m */; };
20 | 755931761A6093DF000C5F8A /* MKDataScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 755931751A6093DF000C5F8A /* MKDataScanner.m */; };
21 | 7559317C1A6093DF000C5F8A /* libMKDataScanner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 755931701A6093DF000C5F8A /* libMKDataScanner.a */; };
22 | 7559318C1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 7559318B1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.m */; };
23 | 7559318F1A609D1D000C5F8A /* MKFileScannerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7559318E1A609D1D000C5F8A /* MKFileScannerTest.m */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXContainerItemProxy section */
27 | 4A127D241ADEBD0E004EFE3A /* PBXContainerItemProxy */ = {
28 | isa = PBXContainerItemProxy;
29 | containerPortal = 755931681A6093DF000C5F8A /* Project object */;
30 | proxyType = 1;
31 | remoteGlobalIDString = 4A127D171ADEBD0E004EFE3A;
32 | remoteInfo = "MKDataScanner-Mac";
33 | };
34 | 7559317D1A6093DF000C5F8A /* PBXContainerItemProxy */ = {
35 | isa = PBXContainerItemProxy;
36 | containerPortal = 755931681A6093DF000C5F8A /* Project object */;
37 | proxyType = 1;
38 | remoteGlobalIDString = 7559316F1A6093DF000C5F8A;
39 | remoteInfo = MKDataScanner;
40 | };
41 | /* End PBXContainerItemProxy section */
42 |
43 | /* Begin PBXFileReference section */
44 | 4A127D181ADEBD0E004EFE3A /* libMKDataScanner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMKDataScanner.a; sourceTree = BUILT_PRODUCTS_DIR; };
45 | 4A127D221ADEBD0E004EFE3A /* MKDataScanner-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MKDataScanner-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
46 | 753052B51A60BF30003A2746 /* MKDataScannerDataProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MKDataScannerDataProvider.h; sourceTree = ""; };
47 | 753052B61A60BF30003A2746 /* MKDataScannerDataProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MKDataScannerDataProvider.m; sourceTree = ""; };
48 | 753220051A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MKDataScannerDispatchIOFileProvider.h; sourceTree = ""; };
49 | 753220061A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MKDataScannerDispatchIOFileProvider.m; sourceTree = ""; };
50 | 755931701A6093DF000C5F8A /* libMKDataScanner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMKDataScanner.a; sourceTree = BUILT_PRODUCTS_DIR; };
51 | 755931731A6093DF000C5F8A /* MKDataScanner.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = MKDataScanner.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
52 | 755931751A6093DF000C5F8A /* MKDataScanner.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MKDataScanner.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
53 | 7559317B1A6093DF000C5F8A /* MKDataScanner-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MKDataScanner-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 755931811A6093DF000C5F8A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | 7559318A1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MKDataScannerStreamFileProvider.h; sourceTree = ""; };
56 | 7559318B1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MKDataScannerStreamFileProvider.m; sourceTree = ""; };
57 | 7559318D1A60963A000C5F8A /* MKDataProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MKDataProvider.h; sourceTree = ""; };
58 | 7559318E1A609D1D000C5F8A /* MKFileScannerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MKFileScannerTest.m; sourceTree = ""; };
59 | /* End PBXFileReference section */
60 |
61 | /* Begin PBXFrameworksBuildPhase section */
62 | 4A127D151ADEBD0E004EFE3A /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | 4A127D1F1ADEBD0E004EFE3A /* Frameworks */ = {
70 | isa = PBXFrameworksBuildPhase;
71 | buildActionMask = 2147483647;
72 | files = (
73 | 4A127D231ADEBD0E004EFE3A /* libMKDataScanner.a in Frameworks */,
74 | );
75 | runOnlyForDeploymentPostprocessing = 0;
76 | };
77 | 7559316D1A6093DF000C5F8A /* Frameworks */ = {
78 | isa = PBXFrameworksBuildPhase;
79 | buildActionMask = 2147483647;
80 | files = (
81 | );
82 | runOnlyForDeploymentPostprocessing = 0;
83 | };
84 | 755931781A6093DF000C5F8A /* Frameworks */ = {
85 | isa = PBXFrameworksBuildPhase;
86 | buildActionMask = 2147483647;
87 | files = (
88 | 7559317C1A6093DF000C5F8A /* libMKDataScanner.a in Frameworks */,
89 | );
90 | runOnlyForDeploymentPostprocessing = 0;
91 | };
92 | /* End PBXFrameworksBuildPhase section */
93 |
94 | /* Begin PBXGroup section */
95 | 755931671A6093DF000C5F8A = {
96 | isa = PBXGroup;
97 | children = (
98 | 755931721A6093DF000C5F8A /* MKDataScanner */,
99 | 7559317F1A6093DF000C5F8A /* MKDataScannerTests */,
100 | 755931711A6093DF000C5F8A /* Products */,
101 | );
102 | sourceTree = "";
103 | };
104 | 755931711A6093DF000C5F8A /* Products */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 755931701A6093DF000C5F8A /* libMKDataScanner.a */,
108 | 7559317B1A6093DF000C5F8A /* MKDataScanner-iOSTests.xctest */,
109 | 4A127D181ADEBD0E004EFE3A /* libMKDataScanner.a */,
110 | 4A127D221ADEBD0E004EFE3A /* MKDataScanner-MacTests.xctest */,
111 | );
112 | name = Products;
113 | sourceTree = "";
114 | };
115 | 755931721A6093DF000C5F8A /* MKDataScanner */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 755931731A6093DF000C5F8A /* MKDataScanner.h */,
119 | 755931751A6093DF000C5F8A /* MKDataScanner.m */,
120 | 7559318D1A60963A000C5F8A /* MKDataProvider.h */,
121 | 7559318A1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.h */,
122 | 7559318B1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.m */,
123 | 753220051A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.h */,
124 | 753220061A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.m */,
125 | 753052B51A60BF30003A2746 /* MKDataScannerDataProvider.h */,
126 | 753052B61A60BF30003A2746 /* MKDataScannerDataProvider.m */,
127 | );
128 | path = MKDataScanner;
129 | sourceTree = "";
130 | };
131 | 7559317F1A6093DF000C5F8A /* MKDataScannerTests */ = {
132 | isa = PBXGroup;
133 | children = (
134 | 755931801A6093DF000C5F8A /* Supporting Files */,
135 | 7559318E1A609D1D000C5F8A /* MKFileScannerTest.m */,
136 | );
137 | path = MKDataScannerTests;
138 | sourceTree = "";
139 | };
140 | 755931801A6093DF000C5F8A /* Supporting Files */ = {
141 | isa = PBXGroup;
142 | children = (
143 | 755931811A6093DF000C5F8A /* Info.plist */,
144 | );
145 | name = "Supporting Files";
146 | sourceTree = "";
147 | };
148 | /* End PBXGroup section */
149 |
150 | /* Begin PBXHeadersBuildPhase section */
151 | 4A127D161ADEBD0E004EFE3A /* Headers */ = {
152 | isa = PBXHeadersBuildPhase;
153 | buildActionMask = 2147483647;
154 | files = (
155 | 4A127D341ADEC05C004EFE3A /* MKDataScanner.h in Headers */,
156 | );
157 | runOnlyForDeploymentPostprocessing = 0;
158 | };
159 | 4A127D351ADEC1DC004EFE3A /* Headers */ = {
160 | isa = PBXHeadersBuildPhase;
161 | buildActionMask = 2147483647;
162 | files = (
163 | 4A127D361ADEC1E8004EFE3A /* MKDataScanner.h in Headers */,
164 | );
165 | runOnlyForDeploymentPostprocessing = 0;
166 | };
167 | /* End PBXHeadersBuildPhase section */
168 |
169 | /* Begin PBXNativeTarget section */
170 | 4A127D171ADEBD0E004EFE3A /* MKDataScanner-Mac */ = {
171 | isa = PBXNativeTarget;
172 | buildConfigurationList = 4A127D2D1ADEBD0E004EFE3A /* Build configuration list for PBXNativeTarget "MKDataScanner-Mac" */;
173 | buildPhases = (
174 | 4A127D141ADEBD0E004EFE3A /* Sources */,
175 | 4A127D151ADEBD0E004EFE3A /* Frameworks */,
176 | 4A127D161ADEBD0E004EFE3A /* Headers */,
177 | );
178 | buildRules = (
179 | );
180 | dependencies = (
181 | );
182 | name = "MKDataScanner-Mac";
183 | productName = "MKDataScanner-Mac";
184 | productReference = 4A127D181ADEBD0E004EFE3A /* libMKDataScanner.a */;
185 | productType = "com.apple.product-type.library.static";
186 | };
187 | 4A127D211ADEBD0E004EFE3A /* MKDataScanner-MacTests */ = {
188 | isa = PBXNativeTarget;
189 | buildConfigurationList = 4A127D2E1ADEBD0E004EFE3A /* Build configuration list for PBXNativeTarget "MKDataScanner-MacTests" */;
190 | buildPhases = (
191 | 4A127D1E1ADEBD0E004EFE3A /* Sources */,
192 | 4A127D1F1ADEBD0E004EFE3A /* Frameworks */,
193 | 4A127D201ADEBD0E004EFE3A /* Resources */,
194 | );
195 | buildRules = (
196 | );
197 | dependencies = (
198 | 4A127D251ADEBD0E004EFE3A /* PBXTargetDependency */,
199 | );
200 | name = "MKDataScanner-MacTests";
201 | productName = "MKDataScanner-MacTests";
202 | productReference = 4A127D221ADEBD0E004EFE3A /* MKDataScanner-MacTests.xctest */;
203 | productType = "com.apple.product-type.bundle.unit-test";
204 | };
205 | 7559316F1A6093DF000C5F8A /* MKDataScanner-iOS */ = {
206 | isa = PBXNativeTarget;
207 | buildConfigurationList = 755931841A6093DF000C5F8A /* Build configuration list for PBXNativeTarget "MKDataScanner-iOS" */;
208 | buildPhases = (
209 | 7559316C1A6093DF000C5F8A /* Sources */,
210 | 7559316D1A6093DF000C5F8A /* Frameworks */,
211 | 4A127D351ADEC1DC004EFE3A /* Headers */,
212 | );
213 | buildRules = (
214 | );
215 | dependencies = (
216 | );
217 | name = "MKDataScanner-iOS";
218 | productName = MKDataScanner;
219 | productReference = 755931701A6093DF000C5F8A /* libMKDataScanner.a */;
220 | productType = "com.apple.product-type.library.static";
221 | };
222 | 7559317A1A6093DF000C5F8A /* MKDataScanner-iOSTests */ = {
223 | isa = PBXNativeTarget;
224 | buildConfigurationList = 755931871A6093DF000C5F8A /* Build configuration list for PBXNativeTarget "MKDataScanner-iOSTests" */;
225 | buildPhases = (
226 | 755931771A6093DF000C5F8A /* Sources */,
227 | 755931781A6093DF000C5F8A /* Frameworks */,
228 | 755931791A6093DF000C5F8A /* Resources */,
229 | );
230 | buildRules = (
231 | );
232 | dependencies = (
233 | 7559317E1A6093DF000C5F8A /* PBXTargetDependency */,
234 | );
235 | name = "MKDataScanner-iOSTests";
236 | productName = MKDataScannerTests;
237 | productReference = 7559317B1A6093DF000C5F8A /* MKDataScanner-iOSTests.xctest */;
238 | productType = "com.apple.product-type.bundle.unit-test";
239 | };
240 | /* End PBXNativeTarget section */
241 |
242 | /* Begin PBXProject section */
243 | 755931681A6093DF000C5F8A /* Project object */ = {
244 | isa = PBXProject;
245 | attributes = {
246 | LastUpgradeCheck = 0630;
247 | ORGANIZATIONNAME = "Marcin Krzyżanowski";
248 | TargetAttributes = {
249 | 4A127D171ADEBD0E004EFE3A = {
250 | CreatedOnToolsVersion = 6.3;
251 | };
252 | 4A127D211ADEBD0E004EFE3A = {
253 | CreatedOnToolsVersion = 6.3;
254 | };
255 | 7559316F1A6093DF000C5F8A = {
256 | CreatedOnToolsVersion = 6.1.1;
257 | };
258 | 7559317A1A6093DF000C5F8A = {
259 | CreatedOnToolsVersion = 6.1.1;
260 | };
261 | };
262 | };
263 | buildConfigurationList = 7559316B1A6093DF000C5F8A /* Build configuration list for PBXProject "MKDataScanner" */;
264 | compatibilityVersion = "Xcode 3.2";
265 | developmentRegion = English;
266 | hasScannedForEncodings = 0;
267 | knownRegions = (
268 | en,
269 | );
270 | mainGroup = 755931671A6093DF000C5F8A;
271 | productRefGroup = 755931711A6093DF000C5F8A /* Products */;
272 | projectDirPath = "";
273 | projectRoot = "";
274 | targets = (
275 | 7559316F1A6093DF000C5F8A /* MKDataScanner-iOS */,
276 | 7559317A1A6093DF000C5F8A /* MKDataScanner-iOSTests */,
277 | 4A127D171ADEBD0E004EFE3A /* MKDataScanner-Mac */,
278 | 4A127D211ADEBD0E004EFE3A /* MKDataScanner-MacTests */,
279 | );
280 | };
281 | /* End PBXProject section */
282 |
283 | /* Begin PBXResourcesBuildPhase section */
284 | 4A127D201ADEBD0E004EFE3A /* Resources */ = {
285 | isa = PBXResourcesBuildPhase;
286 | buildActionMask = 2147483647;
287 | files = (
288 | );
289 | runOnlyForDeploymentPostprocessing = 0;
290 | };
291 | 755931791A6093DF000C5F8A /* Resources */ = {
292 | isa = PBXResourcesBuildPhase;
293 | buildActionMask = 2147483647;
294 | files = (
295 | );
296 | runOnlyForDeploymentPostprocessing = 0;
297 | };
298 | /* End PBXResourcesBuildPhase section */
299 |
300 | /* Begin PBXSourcesBuildPhase section */
301 | 4A127D141ADEBD0E004EFE3A /* Sources */ = {
302 | isa = PBXSourcesBuildPhase;
303 | buildActionMask = 2147483647;
304 | files = (
305 | 4A127D2F1ADEBE22004EFE3A /* MKDataScanner.m in Sources */,
306 | 4A127D301ADEBE27004EFE3A /* MKDataScannerStreamFileProvider.m in Sources */,
307 | 4A127D311ADEBE2A004EFE3A /* MKDataScannerDispatchIOFileProvider.m in Sources */,
308 | 4A127D321ADEBE2D004EFE3A /* MKDataScannerDataProvider.m in Sources */,
309 | );
310 | runOnlyForDeploymentPostprocessing = 0;
311 | };
312 | 4A127D1E1ADEBD0E004EFE3A /* Sources */ = {
313 | isa = PBXSourcesBuildPhase;
314 | buildActionMask = 2147483647;
315 | files = (
316 | 4A127D331ADEBFD7004EFE3A /* MKFileScannerTest.m in Sources */,
317 | );
318 | runOnlyForDeploymentPostprocessing = 0;
319 | };
320 | 7559316C1A6093DF000C5F8A /* Sources */ = {
321 | isa = PBXSourcesBuildPhase;
322 | buildActionMask = 2147483647;
323 | files = (
324 | 755931761A6093DF000C5F8A /* MKDataScanner.m in Sources */,
325 | 7559318C1A6094E7000C5F8A /* MKDataScannerStreamFileProvider.m in Sources */,
326 | 753220071A60DC930065E39D /* MKDataScannerDispatchIOFileProvider.m in Sources */,
327 | 753052B71A60BF30003A2746 /* MKDataScannerDataProvider.m in Sources */,
328 | );
329 | runOnlyForDeploymentPostprocessing = 0;
330 | };
331 | 755931771A6093DF000C5F8A /* Sources */ = {
332 | isa = PBXSourcesBuildPhase;
333 | buildActionMask = 2147483647;
334 | files = (
335 | 7559318F1A609D1D000C5F8A /* MKFileScannerTest.m in Sources */,
336 | );
337 | runOnlyForDeploymentPostprocessing = 0;
338 | };
339 | /* End PBXSourcesBuildPhase section */
340 |
341 | /* Begin PBXTargetDependency section */
342 | 4A127D251ADEBD0E004EFE3A /* PBXTargetDependency */ = {
343 | isa = PBXTargetDependency;
344 | target = 4A127D171ADEBD0E004EFE3A /* MKDataScanner-Mac */;
345 | targetProxy = 4A127D241ADEBD0E004EFE3A /* PBXContainerItemProxy */;
346 | };
347 | 7559317E1A6093DF000C5F8A /* PBXTargetDependency */ = {
348 | isa = PBXTargetDependency;
349 | target = 7559316F1A6093DF000C5F8A /* MKDataScanner-iOS */;
350 | targetProxy = 7559317D1A6093DF000C5F8A /* PBXContainerItemProxy */;
351 | };
352 | /* End PBXTargetDependency section */
353 |
354 | /* Begin XCBuildConfiguration section */
355 | 4A127D291ADEBD0E004EFE3A /* Debug */ = {
356 | isa = XCBuildConfiguration;
357 | buildSettings = {
358 | COMBINE_HIDPI_IMAGES = YES;
359 | DEBUG_INFORMATION_FORMAT = dwarf;
360 | EXECUTABLE_PREFIX = lib;
361 | GCC_NO_COMMON_BLOCKS = YES;
362 | GCC_PREPROCESSOR_DEFINITIONS = (
363 | "DEBUG=1",
364 | "$(inherited)",
365 | );
366 | PRIVATE_HEADERS_FOLDER_PATH = "$(PUBLIC_HEADERS_FOLDER_PATH)/Private";
367 | PRODUCT_NAME = MKDataScanner;
368 | PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
369 | SDKROOT = macosx;
370 | SKIP_INSTALL = YES;
371 | };
372 | name = Debug;
373 | };
374 | 4A127D2A1ADEBD0E004EFE3A /* Release */ = {
375 | isa = XCBuildConfiguration;
376 | buildSettings = {
377 | COMBINE_HIDPI_IMAGES = YES;
378 | COPY_PHASE_STRIP = NO;
379 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
380 | EXECUTABLE_PREFIX = lib;
381 | GCC_NO_COMMON_BLOCKS = YES;
382 | PRIVATE_HEADERS_FOLDER_PATH = "$(PUBLIC_HEADERS_FOLDER_PATH)/Private";
383 | PRODUCT_NAME = MKDataScanner;
384 | PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
385 | SDKROOT = macosx;
386 | SKIP_INSTALL = YES;
387 | };
388 | name = Release;
389 | };
390 | 4A127D2B1ADEBD0E004EFE3A /* Debug */ = {
391 | isa = XCBuildConfiguration;
392 | buildSettings = {
393 | COMBINE_HIDPI_IMAGES = YES;
394 | DEBUG_INFORMATION_FORMAT = dwarf;
395 | FRAMEWORK_SEARCH_PATHS = (
396 | "$(DEVELOPER_FRAMEWORKS_DIR)",
397 | "$(inherited)",
398 | );
399 | GCC_NO_COMMON_BLOCKS = YES;
400 | GCC_PREPROCESSOR_DEFINITIONS = (
401 | "DEBUG=1",
402 | "$(inherited)",
403 | );
404 | INFOPLIST_FILE = MKDataScannerTests/Info.plist;
405 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
406 | PRODUCT_NAME = "$(TARGET_NAME)";
407 | SDKROOT = macosx;
408 | };
409 | name = Debug;
410 | };
411 | 4A127D2C1ADEBD0E004EFE3A /* Release */ = {
412 | isa = XCBuildConfiguration;
413 | buildSettings = {
414 | COMBINE_HIDPI_IMAGES = YES;
415 | COPY_PHASE_STRIP = NO;
416 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
417 | FRAMEWORK_SEARCH_PATHS = (
418 | "$(DEVELOPER_FRAMEWORKS_DIR)",
419 | "$(inherited)",
420 | );
421 | GCC_NO_COMMON_BLOCKS = YES;
422 | INFOPLIST_FILE = MKDataScannerTests/Info.plist;
423 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
424 | PRODUCT_NAME = "$(TARGET_NAME)";
425 | SDKROOT = macosx;
426 | };
427 | name = Release;
428 | };
429 | 755931821A6093DF000C5F8A /* Debug */ = {
430 | isa = XCBuildConfiguration;
431 | buildSettings = {
432 | ALWAYS_SEARCH_USER_PATHS = NO;
433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
434 | CLANG_CXX_LIBRARY = "libc++";
435 | CLANG_ENABLE_MODULES = YES;
436 | CLANG_ENABLE_OBJC_ARC = YES;
437 | CLANG_WARN_BOOL_CONVERSION = YES;
438 | CLANG_WARN_CONSTANT_CONVERSION = YES;
439 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
440 | CLANG_WARN_EMPTY_BODY = YES;
441 | CLANG_WARN_ENUM_CONVERSION = YES;
442 | CLANG_WARN_INT_CONVERSION = YES;
443 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
444 | CLANG_WARN_UNREACHABLE_CODE = YES;
445 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
446 | COPY_PHASE_STRIP = NO;
447 | ENABLE_STRICT_OBJC_MSGSEND = YES;
448 | GCC_C_LANGUAGE_STANDARD = gnu99;
449 | GCC_DYNAMIC_NO_PIC = NO;
450 | GCC_OPTIMIZATION_LEVEL = 0;
451 | GCC_PREPROCESSOR_DEFINITIONS = (
452 | "DEBUG=1",
453 | "$(inherited)",
454 | );
455 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
456 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
457 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
458 | GCC_WARN_UNDECLARED_SELECTOR = YES;
459 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
460 | GCC_WARN_UNUSED_FUNCTION = YES;
461 | GCC_WARN_UNUSED_VARIABLE = YES;
462 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
463 | MACOSX_DEPLOYMENT_TARGET = 10.9;
464 | MTL_ENABLE_DEBUG_INFO = YES;
465 | ONLY_ACTIVE_ARCH = YES;
466 | };
467 | name = Debug;
468 | };
469 | 755931831A6093DF000C5F8A /* Release */ = {
470 | isa = XCBuildConfiguration;
471 | buildSettings = {
472 | ALWAYS_SEARCH_USER_PATHS = NO;
473 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
474 | CLANG_CXX_LIBRARY = "libc++";
475 | CLANG_ENABLE_MODULES = YES;
476 | CLANG_ENABLE_OBJC_ARC = YES;
477 | CLANG_WARN_BOOL_CONVERSION = YES;
478 | CLANG_WARN_CONSTANT_CONVERSION = YES;
479 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
480 | CLANG_WARN_EMPTY_BODY = YES;
481 | CLANG_WARN_ENUM_CONVERSION = YES;
482 | CLANG_WARN_INT_CONVERSION = YES;
483 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
484 | CLANG_WARN_UNREACHABLE_CODE = YES;
485 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
486 | COPY_PHASE_STRIP = YES;
487 | ENABLE_NS_ASSERTIONS = NO;
488 | ENABLE_STRICT_OBJC_MSGSEND = YES;
489 | GCC_C_LANGUAGE_STANDARD = gnu99;
490 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
491 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
492 | GCC_WARN_UNDECLARED_SELECTOR = YES;
493 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
494 | GCC_WARN_UNUSED_FUNCTION = YES;
495 | GCC_WARN_UNUSED_VARIABLE = YES;
496 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
497 | MACOSX_DEPLOYMENT_TARGET = 10.9;
498 | MTL_ENABLE_DEBUG_INFO = NO;
499 | VALIDATE_PRODUCT = YES;
500 | };
501 | name = Release;
502 | };
503 | 755931851A6093DF000C5F8A /* Debug */ = {
504 | isa = XCBuildConfiguration;
505 | buildSettings = {
506 | OTHER_LDFLAGS = "-ObjC";
507 | PRIVATE_HEADERS_FOLDER_PATH = "$(PUBLIC_HEADERS_FOLDER_PATH)/Private";
508 | PRODUCT_NAME = MKDataScanner;
509 | PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
510 | SDKROOT = iphoneos;
511 | SKIP_INSTALL = YES;
512 | };
513 | name = Debug;
514 | };
515 | 755931861A6093DF000C5F8A /* Release */ = {
516 | isa = XCBuildConfiguration;
517 | buildSettings = {
518 | OTHER_LDFLAGS = "-ObjC";
519 | PRIVATE_HEADERS_FOLDER_PATH = "$(PUBLIC_HEADERS_FOLDER_PATH)/Private";
520 | PRODUCT_NAME = MKDataScanner;
521 | PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
522 | SDKROOT = iphoneos;
523 | SKIP_INSTALL = YES;
524 | };
525 | name = Release;
526 | };
527 | 755931881A6093DF000C5F8A /* Debug */ = {
528 | isa = XCBuildConfiguration;
529 | buildSettings = {
530 | FRAMEWORK_SEARCH_PATHS = (
531 | "$(SDKROOT)/Developer/Library/Frameworks",
532 | "$(inherited)",
533 | );
534 | GCC_PREPROCESSOR_DEFINITIONS = (
535 | "DEBUG=1",
536 | "$(inherited)",
537 | );
538 | INFOPLIST_FILE = MKDataScannerTests/Info.plist;
539 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
540 | PRODUCT_NAME = "$(TARGET_NAME)";
541 | SDKROOT = iphoneos;
542 | };
543 | name = Debug;
544 | };
545 | 755931891A6093DF000C5F8A /* Release */ = {
546 | isa = XCBuildConfiguration;
547 | buildSettings = {
548 | FRAMEWORK_SEARCH_PATHS = (
549 | "$(SDKROOT)/Developer/Library/Frameworks",
550 | "$(inherited)",
551 | );
552 | INFOPLIST_FILE = MKDataScannerTests/Info.plist;
553 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
554 | PRODUCT_NAME = "$(TARGET_NAME)";
555 | SDKROOT = iphoneos;
556 | };
557 | name = Release;
558 | };
559 | /* End XCBuildConfiguration section */
560 |
561 | /* Begin XCConfigurationList section */
562 | 4A127D2D1ADEBD0E004EFE3A /* Build configuration list for PBXNativeTarget "MKDataScanner-Mac" */ = {
563 | isa = XCConfigurationList;
564 | buildConfigurations = (
565 | 4A127D291ADEBD0E004EFE3A /* Debug */,
566 | 4A127D2A1ADEBD0E004EFE3A /* Release */,
567 | );
568 | defaultConfigurationIsVisible = 0;
569 | defaultConfigurationName = Release;
570 | };
571 | 4A127D2E1ADEBD0E004EFE3A /* Build configuration list for PBXNativeTarget "MKDataScanner-MacTests" */ = {
572 | isa = XCConfigurationList;
573 | buildConfigurations = (
574 | 4A127D2B1ADEBD0E004EFE3A /* Debug */,
575 | 4A127D2C1ADEBD0E004EFE3A /* Release */,
576 | );
577 | defaultConfigurationIsVisible = 0;
578 | defaultConfigurationName = Release;
579 | };
580 | 7559316B1A6093DF000C5F8A /* Build configuration list for PBXProject "MKDataScanner" */ = {
581 | isa = XCConfigurationList;
582 | buildConfigurations = (
583 | 755931821A6093DF000C5F8A /* Debug */,
584 | 755931831A6093DF000C5F8A /* Release */,
585 | );
586 | defaultConfigurationIsVisible = 0;
587 | defaultConfigurationName = Release;
588 | };
589 | 755931841A6093DF000C5F8A /* Build configuration list for PBXNativeTarget "MKDataScanner-iOS" */ = {
590 | isa = XCConfigurationList;
591 | buildConfigurations = (
592 | 755931851A6093DF000C5F8A /* Debug */,
593 | 755931861A6093DF000C5F8A /* Release */,
594 | );
595 | defaultConfigurationIsVisible = 0;
596 | defaultConfigurationName = Release;
597 | };
598 | 755931871A6093DF000C5F8A /* Build configuration list for PBXNativeTarget "MKDataScanner-iOSTests" */ = {
599 | isa = XCConfigurationList;
600 | buildConfigurations = (
601 | 755931881A6093DF000C5F8A /* Debug */,
602 | 755931891A6093DF000C5F8A /* Release */,
603 | );
604 | defaultConfigurationIsVisible = 0;
605 | defaultConfigurationName = Release;
606 | };
607 | /* End XCConfigurationList section */
608 | };
609 | rootObject = 755931681A6093DF000C5F8A /* Project object */;
610 | }
611 |
--------------------------------------------------------------------------------