├── StreamScannerTests ├── samples │ ├── test.types_out │ ├── test.delimiters_out │ ├── test.delimiters_in │ ├── test.types_in │ ├── test.generator_out │ └── test.generator_in ├── Info.plist └── StreamScannerTests.swift ├── StreamScanner.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── StreamScanner ├── StreamScanner.h ├── Info.plist └── StreamScanner.swift ├── StreamScannerTest ├── Info.plist └── main.swift ├── .gitignore └── README.md /StreamScannerTests/samples/test.types_out: -------------------------------------------------------------------------------- 1 | 42 st_ring! -0.987654321 12345678900 0.42 -------------------------------------------------------------------------------- /StreamScannerTests/samples/test.delimiters_out: -------------------------------------------------------------------------------- 1 | a string 123.456 42 another string -0.5 0 -------------------------------------------------------------------------------- /StreamScannerTests/samples/test.delimiters_in: -------------------------------------------------------------------------------- 1 | a string:123.456:+42 2 | another string:-.5:-0 -------------------------------------------------------------------------------- /StreamScannerTests/samples/test.types_in: -------------------------------------------------------------------------------- 1 | +42 st_ring! 2 | -0.987654321 12345678900 3 | .42 4 | -------------------------------------------------------------------------------- /StreamScannerTests/samples/test.generator_out: -------------------------------------------------------------------------------- 1 | Abigail, Alexander, Ava, Charlotte, Daniel, Emily, Emma, Ethan, Isabella, Jacob, James, Liam, Madison, Mason, Mia, Michael, Noah, Olivia, Sophia, William -------------------------------------------------------------------------------- /StreamScannerTests/samples/test.generator_in: -------------------------------------------------------------------------------- 1 | Noah, Emma 2 | Liam, Olivia 3 | Mason, Sophia 4 | Jacob, Isabella 5 | William, Ava 6 | Ethan, Mia 7 | Michael, Emily 8 | Alexander, Abigail 9 | James, Madison 10 | Daniel, Charlotte -------------------------------------------------------------------------------- /StreamScanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /StreamScanner/StreamScanner.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Anthony Shoumikhin on 6/25/15. 3 | // Copyright © 2015 shoumikh.in. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | //! Project version number for StreamScanner. 9 | FOUNDATION_EXPORT double StreamScannerVersionNumber; 10 | 11 | //! Project version string for StreamScanner. 12 | FOUNDATION_EXPORT const unsigned char StreamScannerVersionString[]; 13 | -------------------------------------------------------------------------------- /StreamScannerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /StreamScanner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 shoumikh.in. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /StreamScannerTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015 shoumikh.in. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Project specific 2 | 3 | # Build products 4 | 5 | *.[oa] 6 | DerivedData/ 7 | [Bb]uild/ 8 | [Pp]re-[Bb]uild/ 9 | [Dd]eliverables/ 10 | [Dd]istribution/ 11 | [Dd]ocumentation/ 12 | 13 | # Backup files 14 | 15 | *~ 16 | *~.nib 17 | *.swp 18 | *(Autosaved).rtfd/ 19 | Backup[ ]of[ ]*.pages/ 20 | Backup[ ]of[ ]*.key/ 21 | Backup[ ]of[ ]*.numbers/ 22 | 23 | # Other VCS 24 | 25 | .hg 26 | .svn 27 | *.prej 28 | *.mine 29 | CVS 30 | 31 | # MacOSX Finder 32 | 33 | .DS_Store 34 | .DS_Store? 35 | ._* 36 | .~* 37 | ~$* 38 | *.lock 39 | .Spotlight-V100 40 | .Trashes 41 | ehthumbs.db 42 | Thumbs.db 43 | 44 | # Xcode 45 | 46 | xcuserdata/ 47 | *.xccheckout 48 | *.moved-aside 49 | *.hmap 50 | *.ipa 51 | *.xcuserstate 52 | *.mode1 53 | !default.mode1 54 | *.mode1v3 55 | !default.mode1v3 56 | *.mode2v3 57 | !default.mode2v3 58 | *.perspective 59 | !default.perspective 60 | *.perspectivev3 61 | !default.perspectivev3 62 | *.pbxuser 63 | !default.pbxuser 64 | 65 | # JetBrains 66 | 67 | .idea/workspace.xml 68 | .idea/tasks.xml 69 | 70 | # Qt 71 | 72 | *.pro.user 73 | *.autosave 74 | moc_* 75 | qrc_* 76 | ui_* 77 | 78 | # CocoaPods 79 | 80 | Pods/ 81 | #Pods/Documentation 82 | #!Pods/Manifest.lock 83 | 84 | # Gems 85 | 86 | !Gemfile.lock 87 | 88 | # VersionX 89 | 90 | VersionX-revision.h 91 | -------------------------------------------------------------------------------- /StreamScannerTest/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Anthony Shoumikhin on 6/25/15. 3 | // Copyright © 2015 shoumikh.in. All rights reserved. 4 | // 5 | 6 | import Foundation 7 | import StreamScanner 8 | 9 | let stdin = StreamScanner.standardInput 10 | 11 | // Read some arbitrary values of different type from the standard input. 12 | if let int: Int = stdin.read(), 13 | let string: String = stdin.read(), 14 | let double: Double = stdin.read(), 15 | let int64: Int64 = stdin.read(), 16 | let float: Float = stdin.read() { 17 | print("\(int) \(string) \(double) \(int64) \(float)") 18 | } 19 | 20 | // Read an array of Int64 of predefined size. 21 | if var count: Int = stdin.read() { 22 | var array: [Int64] = [] 23 | for _ in 0.. String? { 28 | return read() 29 | } 30 | 31 | public func makeIterator() -> StreamScanner.Iterator { 32 | return self 33 | } 34 | 35 | public func ready() -> Bool { 36 | if buffer?.isAtEnd ?? true { 37 | // Init or append the buffer. 38 | let availableData = source.availableData 39 | if availableData.count > 0, 40 | let nextInput = String(data: availableData, encoding: .utf8) { 41 | buffer = Scanner(string: nextInput) 42 | } 43 | } 44 | return !(buffer?.isAtEnd ?? true) 45 | } 46 | 47 | public func read() -> T? { 48 | if ready() { 49 | var token: NSString? 50 | // Grab the next valid characters into token. 51 | if buffer?.scanUpToCharacters(from: delimiters, into: &token) ?? false, 52 | let token = token as String? { 53 | // Skip delimiters for the next invocation. 54 | buffer?.scanCharacters(from: delimiters, into: nil) 55 | // Convert the token into an instance of type T and return it. 56 | return convert(token) 57 | } 58 | } 59 | return nil 60 | } 61 | 62 | // MARK: - Private 63 | 64 | fileprivate let source: FileHandle 65 | fileprivate let delimiters: CharacterSet 66 | fileprivate var buffer: Scanner? 67 | 68 | fileprivate func convert(_ token: String) -> T? { 69 | let scanner = Scanner(string: token) 70 | switch T.self { 71 | case is String.Type: 72 | return token as? T 73 | case is Int.Type: 74 | var value: Int = 0 75 | if scanner.scanInt(&value) { 76 | return value as? T 77 | } 78 | case is Int32.Type: 79 | var value: Int32 = 0 80 | if scanner.scanInt32(&value) { 81 | return value as? T 82 | } 83 | case is Int64.Type: 84 | var value: Int64 = 0 85 | if scanner.scanInt64(&value) { 86 | return value as? T 87 | } 88 | case is UInt64.Type: 89 | var value: UInt64 = 0 90 | if scanner.scanUnsignedLongLong(&value) { 91 | return value as? T 92 | } 93 | case is Float.Type: 94 | var value: Float = 0 95 | if scanner.scanFloat(&value) { 96 | return value as? T 97 | } 98 | case is Double.Type: 99 | var value: Double = 0 100 | if scanner.scanDouble(&value) { 101 | return value as? T 102 | } 103 | default: 104 | break 105 | } 106 | return nil 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /StreamScannerTests/StreamScannerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Anthony Shoumikhin on 6/25/15. 3 | // Copyright © 2015 shoumikh.in. All rights reserved. 4 | // 5 | 6 | import XCTest 7 | import StreamScanner 8 | 9 | class StreamScannerTests: XCTestCase { 10 | let bundle = Bundle(for: StreamScannerTests.self) 11 | let filename = "samples/test" 12 | 13 | func testTypes() { 14 | let test = "types" 15 | if let inputFilename = bundle.path(forResource: filename, ofType: test+"_in"), 16 | let outputFilename = bundle.path(forResource: filename, ofType: test+"_out") { 17 | if let input = FileHandle(forReadingAtPath: inputFilename), 18 | let output = FileHandle(forReadingAtPath: outputFilename), 19 | let expected = String(data: output.readDataToEndOfFile(), encoding: .utf8) { 20 | let scanner = StreamScanner(source: input) 21 | if let int: Int = scanner.read(), 22 | let string: String = scanner.read(), 23 | let double: Double = scanner.read(), 24 | let int64: Int64 = scanner.read(), 25 | let float: Float = scanner.read() { 26 | let actual = "\(int) \(string) \(double) \(int64) \(float)" 27 | XCTAssertEqual(actual, expected as String) 28 | return 29 | } 30 | } 31 | } 32 | XCTFail() 33 | } 34 | 35 | func testDelimiters() { 36 | let test = "delimiters" 37 | if let inputFilename = bundle.path(forResource: filename, ofType: test+"_in"), 38 | let outputFilename = bundle.path(forResource: filename, ofType: test+"_out") { 39 | if let input = FileHandle(forReadingAtPath: inputFilename), 40 | let output = FileHandle(forReadingAtPath: outputFilename), 41 | let expected = String(data: output.readDataToEndOfFile(), encoding: .utf8) { 42 | let scanner = StreamScanner(source: input, delimiters: CharacterSet(charactersIn: ":\n")) 43 | if let string: String = scanner.read(), 44 | let double: Double = scanner.read(), 45 | let int: Int64 = scanner.read(), 46 | let string2: String = scanner.read(), 47 | let double2: Double = scanner.read(), 48 | let int2: Int64 = scanner.read() { 49 | let actual = "\(string) \(double) \(int) \(string2) \(double2) \(int2)" 50 | XCTAssertEqual(actual, expected as String) 51 | return 52 | } 53 | } 54 | } 55 | XCTFail() 56 | } 57 | 58 | func testGenerator() { 59 | let test = "generator" 60 | if let inputFilename = bundle.path(forResource: filename, ofType: test+"_in"), 61 | let outputFilename = bundle.path(forResource: filename, ofType: test+"_out") { 62 | if let input = FileHandle(forReadingAtPath: inputFilename), 63 | let output = FileHandle(forReadingAtPath: outputFilename), 64 | let expected = String(data: output.readDataToEndOfFile(), encoding: .utf8) { 65 | var delimiters = CharacterSet.whitespacesAndNewlines 66 | delimiters.formUnion(CharacterSet(charactersIn: ",")) 67 | let scanner = StreamScanner(source: input, delimiters: delimiters) 68 | var names: [String] = [] 69 | for name in scanner { 70 | names.append(name) 71 | } 72 | if !scanner.ready() { 73 | // If we really finished reading all the names from a file in the above for-in loop. 74 | names.sort() { $0 < $1 } 75 | let actual = names.joined(separator: ", ") 76 | XCTAssertEqual(actual, expected) 77 | return 78 | } 79 | } 80 | } 81 | XCTFail() 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Input Stream Scanner 2 | A simple scanner for any kind of file input streams with arbitrary delimiters. Made with Swift, based on `NSScanner`. 3 | 4 | Originally appeared as a necessity to parse the standard input for competitive programming challenges on [HackerRank](https://www.hackerrank.com/).
5 | 6 | ## Installation 7 | 8 | #### For competitive programming 9 | 10 | Copy-paste the contents of this [tiny sample](https://github.com/shoumikhin/sample/blob/master/ACC.swift) and enjoy. For more general use cases check out the full version of [StreamScanner.swift](StreamScanner/StreamScanner.swift) and see the [usage](#usage) and [examples](#more-examples) sections below. 11 | 12 | #### As a framework 13 | 14 | Compile, link against and don't forget to: 15 | 16 | ```swift 17 | import StreamScanner 18 | ``` 19 | 20 | #### As a built-in class 21 | 22 | Add [StreamScanner.swift](StreamScanner/StreamScanner.swift) file to your project. 23 | 24 | ## Usage 25 | 26 | For convenience you can declare: 27 | 28 | ```swift 29 | let stdin = StreamScanner.standardInput 30 | ``` 31 | and use `stdin` later on. *Spaces and new lines are considered delimiters by default.* 32 | 33 | Or make your custom stream with: 34 | 35 | ```swift 36 | let stream = StreamScanner(source: FileHandle(forReadingAtPath: "/path/to/file"), 37 | delimiters: CharacterSet(charactersIn: "-.:\n")) 38 | ``` 39 | 40 | Now call `read() -> Optional` to get the next value from a stream, where `T` is a type of a variable where you want to `read()` the stream. 41 | 42 | You may call `ready() -> Bool` to check whether the stream currently contains any data it can parse. *Note: the stream may try to grab some data from its source during this check.* 43 | 44 | ## Example 45 | 46 | Imagine there's a file at `/path/to/file` with the following contents: 47 | 48 | ``` 49 | 42.times show:not_a_double 50 | ``` 51 | 52 | And here's one of the ways to scan it with the `stream` just declared above: 53 | 54 | ```swift 55 | var number: Int? = stream.read() //parse an integer at the current position in the stream 56 | var string: String? = stream.read() //now skip a delimiting dot and parse a string 57 | var double: Double? = stream.read() //now skip a delimiting colon and try to parse a double 58 | 59 | print("\(number) \(string) \(double)") //Optional(42) Optional("times show") nil 60 | ``` 61 | 62 | ## More Examples 63 | 64 | #### Read some arbitrary values of different types from the standard input 65 | 66 | ```swift 67 | if 68 | let int: Int = stdin.read(), 69 | let string: String = stdin.read(), 70 | let double: Double = stdin.read(), 71 | let int64: Int64 = stdin.read(), 72 | let float: Float = stdin.read() 73 | { 74 | print("\(int) \(string) \(double) \(int64) \(float)") 75 | } 76 | ``` 77 | *Input:* 78 | ``` 79 | +42 st_ring! 80 | -0.987654321 12345678900 81 | .42 82 | ``` 83 | *Output:* 84 | ``` 85 | 42 st_ring! -0.987654321 12345678900 0.42 86 | ``` 87 | 88 | #### Read an array of `Int64` of an arbitrary size from the standard input 89 | 90 | ```swift 91 | if var count: Int = stdin.read() 92 | { 93 | var array: [Int64] = [] 94 | 95 | for _ in 0..](http://creativecommons.org) 197 | -------------------------------------------------------------------------------- /StreamScanner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 927704B11B3D071800631755 /* StreamScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 927704B01B3D071800631755 /* StreamScanner.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 927704B81B3D071800631755 /* StreamScanner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 927704AD1B3D071800631755 /* StreamScanner.framework */; }; 12 | 927704BD1B3D071800631755 /* StreamScannerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 927704BC1B3D071800631755 /* StreamScannerTests.swift */; }; 13 | 927704C81B3D0AD100631755 /* StreamScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 927704C71B3D0AD100631755 /* StreamScanner.swift */; }; 14 | 92EF7A6D1B40A063007CEEA1 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92AD6AA31B40622A0038DAF6 /* main.swift */; }; 15 | 92EF7A6F1B40A096007CEEA1 /* StreamScanner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 927704AD1B3D071800631755 /* StreamScanner.framework */; }; 16 | 92FE591E1B405D6A008E467F /* samples in Resources */ = {isa = PBXBuildFile; fileRef = 92FE591D1B405D6A008E467F /* samples */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 927704B91B3D071800631755 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 927704A41B3D071800631755 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 927704AC1B3D071800631755; 25 | remoteInfo = StandardInputScanner; 26 | }; 27 | 92EF7A6B1B40A058007CEEA1 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 927704A41B3D071800631755 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 927704AC1B3D071800631755; 32 | remoteInfo = StreamScanner; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 927704AD1B3D071800631755 /* StreamScanner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = StreamScanner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 927704B01B3D071800631755 /* StreamScanner.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StreamScanner.h; sourceTree = ""; }; 39 | 927704B21B3D071800631755 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | 927704B71B3D071800631755 /* StreamScannerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StreamScannerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 927704BC1B3D071800631755 /* StreamScannerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StreamScannerTests.swift; sourceTree = ""; }; 42 | 927704BE1B3D071800631755 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 927704C71B3D0AD100631755 /* StreamScanner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StreamScanner.swift; sourceTree = ""; }; 44 | 92AD6AA31B40622A0038DAF6 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 45 | 92EF7A5E1B409FC1007CEEA1 /* StreamScannerTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StreamScannerTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 92EF7A671B409FC1007CEEA1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 92FE591D1B405D6A008E467F /* samples */ = {isa = PBXFileReference; lastKnownFileType = folder; path = samples; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | 927704A91B3D071800631755 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 927704B41B3D071800631755 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 927704B81B3D071800631755 /* StreamScanner.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | 92EF7A5B1B409FC1007CEEA1 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 92EF7A6F1B40A096007CEEA1 /* StreamScanner.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 927704A31B3D071800631755 = { 78 | isa = PBXGroup; 79 | children = ( 80 | 927704AF1B3D071800631755 /* StreamScanner */, 81 | 927704BB1B3D071800631755 /* StreamScannerTests */, 82 | 92EF7A5F1B409FC1007CEEA1 /* StreamScannerTest */, 83 | 927704AE1B3D071800631755 /* Products */, 84 | ); 85 | sourceTree = ""; 86 | }; 87 | 927704AE1B3D071800631755 /* Products */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 927704AD1B3D071800631755 /* StreamScanner.framework */, 91 | 927704B71B3D071800631755 /* StreamScannerTests.xctest */, 92 | 92EF7A5E1B409FC1007CEEA1 /* StreamScannerTest.app */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | 927704AF1B3D071800631755 /* StreamScanner */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 927704B21B3D071800631755 /* Info.plist */, 101 | 927704B01B3D071800631755 /* StreamScanner.h */, 102 | 927704C71B3D0AD100631755 /* StreamScanner.swift */, 103 | ); 104 | path = StreamScanner; 105 | sourceTree = ""; 106 | }; 107 | 927704BB1B3D071800631755 /* StreamScannerTests */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 927704BE1B3D071800631755 /* Info.plist */, 111 | 927704BC1B3D071800631755 /* StreamScannerTests.swift */, 112 | 92FE591D1B405D6A008E467F /* samples */, 113 | ); 114 | path = StreamScannerTests; 115 | sourceTree = ""; 116 | }; 117 | 92EF7A5F1B409FC1007CEEA1 /* StreamScannerTest */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 92AD6AA31B40622A0038DAF6 /* main.swift */, 121 | 92EF7A671B409FC1007CEEA1 /* Info.plist */, 122 | ); 123 | path = StreamScannerTest; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXHeadersBuildPhase section */ 129 | 927704AA1B3D071800631755 /* Headers */ = { 130 | isa = PBXHeadersBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | 927704B11B3D071800631755 /* StreamScanner.h in Headers */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXHeadersBuildPhase section */ 138 | 139 | /* Begin PBXNativeTarget section */ 140 | 927704AC1B3D071800631755 /* StreamScanner */ = { 141 | isa = PBXNativeTarget; 142 | buildConfigurationList = 927704C11B3D071800631755 /* Build configuration list for PBXNativeTarget "StreamScanner" */; 143 | buildPhases = ( 144 | 927704A81B3D071800631755 /* Sources */, 145 | 927704A91B3D071800631755 /* Frameworks */, 146 | 927704AA1B3D071800631755 /* Headers */, 147 | 927704AB1B3D071800631755 /* Resources */, 148 | ); 149 | buildRules = ( 150 | ); 151 | dependencies = ( 152 | ); 153 | name = StreamScanner; 154 | productName = StandardInputScanner; 155 | productReference = 927704AD1B3D071800631755 /* StreamScanner.framework */; 156 | productType = "com.apple.product-type.framework"; 157 | }; 158 | 927704B61B3D071800631755 /* StreamScannerTests */ = { 159 | isa = PBXNativeTarget; 160 | buildConfigurationList = 927704C41B3D071800631755 /* Build configuration list for PBXNativeTarget "StreamScannerTests" */; 161 | buildPhases = ( 162 | 927704B31B3D071800631755 /* Sources */, 163 | 927704B41B3D071800631755 /* Frameworks */, 164 | 927704B51B3D071800631755 /* Resources */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | 927704BA1B3D071800631755 /* PBXTargetDependency */, 170 | ); 171 | name = StreamScannerTests; 172 | productName = StandardInputScannerTests; 173 | productReference = 927704B71B3D071800631755 /* StreamScannerTests.xctest */; 174 | productType = "com.apple.product-type.bundle.unit-test"; 175 | }; 176 | 92EF7A5D1B409FC1007CEEA1 /* StreamScannerTest */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 92EF7A681B409FC1007CEEA1 /* Build configuration list for PBXNativeTarget "StreamScannerTest" */; 179 | buildPhases = ( 180 | 92EF7A5A1B409FC1007CEEA1 /* Sources */, 181 | 92EF7A5B1B409FC1007CEEA1 /* Frameworks */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | 92EF7A6C1B40A058007CEEA1 /* PBXTargetDependency */, 187 | ); 188 | name = StreamScannerTest; 189 | productName = StreamScannerTest; 190 | productReference = 92EF7A5E1B409FC1007CEEA1 /* StreamScannerTest.app */; 191 | productType = "com.apple.product-type.application"; 192 | }; 193 | /* End PBXNativeTarget section */ 194 | 195 | /* Begin PBXProject section */ 196 | 927704A41B3D071800631755 /* Project object */ = { 197 | isa = PBXProject; 198 | attributes = { 199 | LastSwiftUpdateCheck = 0700; 200 | LastUpgradeCheck = 1010; 201 | TargetAttributes = { 202 | 927704AC1B3D071800631755 = { 203 | CreatedOnToolsVersion = 7.0; 204 | LastSwiftMigration = 1010; 205 | }; 206 | 927704B61B3D071800631755 = { 207 | CreatedOnToolsVersion = 7.0; 208 | LastSwiftMigration = 0820; 209 | }; 210 | 92EF7A5D1B409FC1007CEEA1 = { 211 | CreatedOnToolsVersion = 7.0; 212 | LastSwiftMigration = 1010; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 927704A71B3D071800631755 /* Build configuration list for PBXProject "StreamScanner" */; 217 | compatibilityVersion = "Xcode 3.2"; 218 | developmentRegion = English; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = 927704A31B3D071800631755; 225 | productRefGroup = 927704AE1B3D071800631755 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | 927704AC1B3D071800631755 /* StreamScanner */, 230 | 927704B61B3D071800631755 /* StreamScannerTests */, 231 | 92EF7A5D1B409FC1007CEEA1 /* StreamScannerTest */, 232 | ); 233 | }; 234 | /* End PBXProject section */ 235 | 236 | /* Begin PBXResourcesBuildPhase section */ 237 | 927704AB1B3D071800631755 /* Resources */ = { 238 | isa = PBXResourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | 927704B51B3D071800631755 /* Resources */ = { 245 | isa = PBXResourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 92FE591E1B405D6A008E467F /* samples in Resources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXResourcesBuildPhase section */ 253 | 254 | /* Begin PBXSourcesBuildPhase section */ 255 | 927704A81B3D071800631755 /* Sources */ = { 256 | isa = PBXSourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | 927704C81B3D0AD100631755 /* StreamScanner.swift in Sources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | 927704B31B3D071800631755 /* Sources */ = { 264 | isa = PBXSourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | 927704BD1B3D071800631755 /* StreamScannerTests.swift in Sources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | 92EF7A5A1B409FC1007CEEA1 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 92EF7A6D1B40A063007CEEA1 /* main.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXSourcesBuildPhase section */ 280 | 281 | /* Begin PBXTargetDependency section */ 282 | 927704BA1B3D071800631755 /* PBXTargetDependency */ = { 283 | isa = PBXTargetDependency; 284 | target = 927704AC1B3D071800631755 /* StreamScanner */; 285 | targetProxy = 927704B91B3D071800631755 /* PBXContainerItemProxy */; 286 | }; 287 | 92EF7A6C1B40A058007CEEA1 /* PBXTargetDependency */ = { 288 | isa = PBXTargetDependency; 289 | target = 927704AC1B3D071800631755 /* StreamScanner */; 290 | targetProxy = 92EF7A6B1B40A058007CEEA1 /* PBXContainerItemProxy */; 291 | }; 292 | /* End PBXTargetDependency section */ 293 | 294 | /* Begin XCBuildConfiguration section */ 295 | 927704BF1B3D071800631755 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | ALWAYS_SEARCH_USER_PATHS = NO; 299 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 300 | CLANG_CXX_LIBRARY = "libc++"; 301 | CLANG_ENABLE_MODULES = YES; 302 | CLANG_ENABLE_OBJC_ARC = YES; 303 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 304 | CLANG_WARN_BOOL_CONVERSION = YES; 305 | CLANG_WARN_COMMA = YES; 306 | CLANG_WARN_CONSTANT_CONVERSION = YES; 307 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 308 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 309 | CLANG_WARN_EMPTY_BODY = YES; 310 | CLANG_WARN_ENUM_CONVERSION = YES; 311 | CLANG_WARN_INFINITE_RECURSION = YES; 312 | CLANG_WARN_INT_CONVERSION = YES; 313 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 314 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 315 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 316 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 317 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 318 | CLANG_WARN_STRICT_PROTOTYPES = YES; 319 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 320 | CLANG_WARN_UNREACHABLE_CODE = YES; 321 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 322 | COPY_PHASE_STRIP = NO; 323 | CURRENT_PROJECT_VERSION = 1; 324 | DEBUG_INFORMATION_FORMAT = dwarf; 325 | ENABLE_STRICT_OBJC_MSGSEND = YES; 326 | ENABLE_TESTABILITY = YES; 327 | GCC_C_LANGUAGE_STANDARD = gnu99; 328 | GCC_DYNAMIC_NO_PIC = NO; 329 | GCC_NO_COMMON_BLOCKS = YES; 330 | GCC_OPTIMIZATION_LEVEL = 0; 331 | GCC_PREPROCESSOR_DEFINITIONS = ( 332 | "DEBUG=1", 333 | "$(inherited)", 334 | ); 335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 337 | GCC_WARN_UNDECLARED_SELECTOR = YES; 338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 339 | GCC_WARN_UNUSED_FUNCTION = YES; 340 | GCC_WARN_UNUSED_VARIABLE = YES; 341 | MACOSX_DEPLOYMENT_TARGET = 10.10; 342 | MTL_ENABLE_DEBUG_INFO = YES; 343 | ONLY_ACTIVE_ARCH = YES; 344 | SDKROOT = macosx; 345 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 346 | VERSIONING_SYSTEM = "apple-generic"; 347 | VERSION_INFO_PREFIX = ""; 348 | }; 349 | name = Debug; 350 | }; 351 | 927704C01B3D071800631755 /* Release */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | ALWAYS_SEARCH_USER_PATHS = NO; 355 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 356 | CLANG_CXX_LIBRARY = "libc++"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 360 | CLANG_WARN_BOOL_CONVERSION = YES; 361 | CLANG_WARN_COMMA = YES; 362 | CLANG_WARN_CONSTANT_CONVERSION = YES; 363 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 364 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 365 | CLANG_WARN_EMPTY_BODY = YES; 366 | CLANG_WARN_ENUM_CONVERSION = YES; 367 | CLANG_WARN_INFINITE_RECURSION = YES; 368 | CLANG_WARN_INT_CONVERSION = YES; 369 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 370 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 371 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 372 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 373 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 374 | CLANG_WARN_STRICT_PROTOTYPES = YES; 375 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 376 | CLANG_WARN_UNREACHABLE_CODE = YES; 377 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 378 | COPY_PHASE_STRIP = NO; 379 | CURRENT_PROJECT_VERSION = 1; 380 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 381 | ENABLE_NS_ASSERTIONS = NO; 382 | ENABLE_STRICT_OBJC_MSGSEND = YES; 383 | GCC_C_LANGUAGE_STANDARD = gnu99; 384 | GCC_NO_COMMON_BLOCKS = YES; 385 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 386 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 387 | GCC_WARN_UNDECLARED_SELECTOR = YES; 388 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 389 | GCC_WARN_UNUSED_FUNCTION = YES; 390 | GCC_WARN_UNUSED_VARIABLE = YES; 391 | MACOSX_DEPLOYMENT_TARGET = 10.10; 392 | MTL_ENABLE_DEBUG_INFO = NO; 393 | SDKROOT = macosx; 394 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 395 | VERSIONING_SYSTEM = "apple-generic"; 396 | VERSION_INFO_PREFIX = ""; 397 | }; 398 | name = Release; 399 | }; 400 | 927704C21B3D071800631755 /* Debug */ = { 401 | isa = XCBuildConfiguration; 402 | buildSettings = { 403 | CLANG_ENABLE_MODULES = YES; 404 | COMBINE_HIDPI_IMAGES = YES; 405 | DEFINES_MODULE = YES; 406 | DYLIB_COMPATIBILITY_VERSION = 1; 407 | DYLIB_CURRENT_VERSION = 1; 408 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 409 | FRAMEWORK_VERSION = A; 410 | INFOPLIST_FILE = StreamScanner/Info.plist; 411 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 413 | PRODUCT_BUNDLE_IDENTIFIER = in.shoumikh.StreamScanner; 414 | PRODUCT_NAME = StreamScanner; 415 | SKIP_INSTALL = YES; 416 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 417 | SWIFT_SWIFT3_OBJC_INFERENCE = Off; 418 | SWIFT_VERSION = 4.2; 419 | }; 420 | name = Debug; 421 | }; 422 | 927704C31B3D071800631755 /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | CLANG_ENABLE_MODULES = YES; 426 | COMBINE_HIDPI_IMAGES = YES; 427 | DEFINES_MODULE = YES; 428 | DYLIB_COMPATIBILITY_VERSION = 1; 429 | DYLIB_CURRENT_VERSION = 1; 430 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 431 | FRAMEWORK_VERSION = A; 432 | INFOPLIST_FILE = StreamScanner/Info.plist; 433 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 434 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 435 | PRODUCT_BUNDLE_IDENTIFIER = in.shoumikh.StreamScanner; 436 | PRODUCT_NAME = StreamScanner; 437 | SKIP_INSTALL = YES; 438 | SWIFT_SWIFT3_OBJC_INFERENCE = Off; 439 | SWIFT_VERSION = 4.2; 440 | }; 441 | name = Release; 442 | }; 443 | 927704C51B3D071800631755 /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | COMBINE_HIDPI_IMAGES = YES; 447 | INFOPLIST_FILE = StreamScannerTests/Info.plist; 448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 449 | PRODUCT_BUNDLE_IDENTIFIER = in.shoumikh.StreamScannerTests; 450 | PRODUCT_NAME = StreamScannerTests; 451 | SWIFT_VERSION = 3.0; 452 | }; 453 | name = Debug; 454 | }; 455 | 927704C61B3D071800631755 /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | COMBINE_HIDPI_IMAGES = YES; 459 | INFOPLIST_FILE = StreamScannerTests/Info.plist; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 461 | PRODUCT_BUNDLE_IDENTIFIER = in.shoumikh.StreamScannerTests; 462 | PRODUCT_NAME = StreamScannerTests; 463 | SWIFT_VERSION = 3.0; 464 | }; 465 | name = Release; 466 | }; 467 | 92EF7A691B409FC1007CEEA1 /* Debug */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CODE_SIGN_IDENTITY = "-"; 472 | COMBINE_HIDPI_IMAGES = YES; 473 | INFOPLIST_FILE = StreamScannerTest/Info.plist; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 475 | PRODUCT_BUNDLE_IDENTIFIER = in.shoumikh.StreamScannerTest; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | SWIFT_SWIFT3_OBJC_INFERENCE = Off; 478 | SWIFT_VERSION = 4.2; 479 | }; 480 | name = Debug; 481 | }; 482 | 92EF7A6A1B409FC1007CEEA1 /* Release */ = { 483 | isa = XCBuildConfiguration; 484 | buildSettings = { 485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 486 | CODE_SIGN_IDENTITY = "-"; 487 | COMBINE_HIDPI_IMAGES = YES; 488 | INFOPLIST_FILE = StreamScannerTest/Info.plist; 489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 490 | PRODUCT_BUNDLE_IDENTIFIER = in.shoumikh.StreamScannerTest; 491 | PRODUCT_NAME = "$(TARGET_NAME)"; 492 | SWIFT_SWIFT3_OBJC_INFERENCE = Off; 493 | SWIFT_VERSION = 4.2; 494 | }; 495 | name = Release; 496 | }; 497 | /* End XCBuildConfiguration section */ 498 | 499 | /* Begin XCConfigurationList section */ 500 | 927704A71B3D071800631755 /* Build configuration list for PBXProject "StreamScanner" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | 927704BF1B3D071800631755 /* Debug */, 504 | 927704C01B3D071800631755 /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | 927704C11B3D071800631755 /* Build configuration list for PBXNativeTarget "StreamScanner" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | 927704C21B3D071800631755 /* Debug */, 513 | 927704C31B3D071800631755 /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | 927704C41B3D071800631755 /* Build configuration list for PBXNativeTarget "StreamScannerTests" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | 927704C51B3D071800631755 /* Debug */, 522 | 927704C61B3D071800631755 /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | 92EF7A681B409FC1007CEEA1 /* Build configuration list for PBXNativeTarget "StreamScannerTest" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 92EF7A691B409FC1007CEEA1 /* Debug */, 531 | 92EF7A6A1B409FC1007CEEA1 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = 927704A41B3D071800631755 /* Project object */; 539 | } 540 | --------------------------------------------------------------------------------