├── Podfile ├── Podfile.lock ├── Pods ├── .DS_Store ├── ArgumentParserKit │ ├── ArgumentParserKit │ │ └── Classes │ │ │ ├── ArgumentParser.swift │ │ │ ├── OutputByteStream.swift │ │ │ └── internal │ │ │ ├── Basic │ │ │ ├── ByteString.swift │ │ │ ├── CollectionAlgorithms.swift │ │ │ ├── CollectionExtensions+only.swift │ │ │ ├── Condition.swift │ │ │ ├── DictionaryExtensions.swift │ │ │ ├── FileSystem.swift │ │ │ ├── Path.swift │ │ │ └── Thread.swift │ │ │ └── Utility │ │ │ ├── CollectionExtensions+split.swift │ │ │ ├── StringExtensions.swift │ │ │ └── URL.swift │ ├── LICENSE │ └── README.md ├── Headers │ └── Public │ │ ├── ArgumentParserKit │ │ ├── ArgumentParserKit-umbrella.h │ │ └── ArgumentParserKit.modulemap │ │ └── ScreenCapture │ │ ├── ScreenCapture-umbrella.h │ │ └── ScreenCapture.modulemap ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── admin.xcuserdatad │ │ └── xcschemes │ │ ├── ArgumentParserKit.xcscheme │ │ ├── Pods-ocr.xcscheme │ │ ├── ScreenCapture.xcscheme │ │ └── xcschememanagement.plist ├── ScreenCapture │ ├── LICENSE │ ├── README.md │ └── ScreenCapture │ │ ├── ScreenCapture.swift │ │ └── ScreenRecorder.swift └── Target Support Files │ ├── ArgumentParserKit │ ├── ArgumentParserKit-dummy.m │ ├── ArgumentParserKit-prefix.pch │ ├── ArgumentParserKit-umbrella.h │ ├── ArgumentParserKit.debug.xcconfig │ ├── ArgumentParserKit.modulemap │ └── ArgumentParserKit.release.xcconfig │ ├── Pods-ocr │ ├── Pods-ocr-acknowledgements.markdown │ ├── Pods-ocr-acknowledgements.plist │ ├── Pods-ocr-dummy.m │ ├── Pods-ocr-umbrella.h │ ├── Pods-ocr.debug.xcconfig │ ├── Pods-ocr.modulemap │ └── Pods-ocr.release.xcconfig │ └── ScreenCapture │ ├── ScreenCapture-dummy.m │ ├── ScreenCapture-prefix.pch │ ├── ScreenCapture-umbrella.h │ ├── ScreenCapture.debug.xcconfig │ ├── ScreenCapture.modulemap │ └── ScreenCapture.release.xcconfig ├── README.md ├── ocr.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── admin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── admin.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── ocr.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── admin.xcuserdatad │ └── UserInterfaceState.xcuserstate └── ocr └── main.swift /Podfile: -------------------------------------------------------------------------------- 1 | target 'ocr' do 2 | pod 'ScreenCapture' 3 | pod 'ArgumentParserKit' 4 | end 5 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ArgumentParserKit (1.0.0) 3 | - ScreenCapture (0.1.0) 4 | 5 | DEPENDENCIES: 6 | - ArgumentParserKit 7 | - ScreenCapture 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - ArgumentParserKit 12 | - ScreenCapture 13 | 14 | SPEC CHECKSUMS: 15 | ArgumentParserKit: 99ceb746098d9f478a6cb9b01b38ce9ecab3122d 16 | ScreenCapture: 832436bf58779a3faefb3c48222b641b80a7d851 17 | 18 | PODFILE CHECKSUM: 423eff66e097c4eb0fa56bb905ce9252e335b771 19 | 20 | COCOAPODS: 1.10.1 21 | -------------------------------------------------------------------------------- /Pods/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schappim/macOCR/161913fa9ea4263451c3b1912c7c08c9c53bf835/Pods/.DS_Store -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/OutputByteStream.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | /// Convert an integer in 0..<16 to its hexadecimal ASCII character. 12 | private func hexdigit(_ value: UInt8) -> UInt8 { 13 | return value < 10 ? (0x30 + value) : (0x41 + value - 10) 14 | } 15 | 16 | /// Describes a type which can be written to a byte stream. 17 | protocol ByteStreamable { 18 | func write(to stream: OutputByteStream) 19 | } 20 | 21 | /// An output byte stream. 22 | /// 23 | /// This class is designed to be able to support efficient streaming to 24 | /// different output destinations, e.g., a file or an in memory buffer. This is 25 | /// loosely modeled on LLVM's llvm::raw_ostream class. 26 | /// 27 | /// The stream is generally used in conjunction with the custom streaming 28 | /// operator '<<<'. For example: 29 | /// 30 | /// let stream = OutputByteStream() 31 | /// stream <<< "Hello, world!" 32 | /// 33 | /// would write the UTF8 encoding of "Hello, world!" to the stream. 34 | /// 35 | /// The stream accepts a number of custom formatting operators which are defined 36 | /// in the `Format` struct (used for namespacing purposes). For example: 37 | /// 38 | /// let items = ["hello", "world"] 39 | /// stream <<< Format.asSeparatedList(items, separator: " ") 40 | /// 41 | /// would write each item in the list to the stream, separating them with a 42 | /// space. 43 | public class OutputByteStream: TextOutputStream { 44 | /// The data buffer. 45 | /// Note: Minimum Buffer size should be one. 46 | private var buffer: [UInt8] 47 | 48 | /// Default buffer size of the data buffer. 49 | private static let bufferSize = 1024 50 | 51 | /// Queue to protect mutating operation. 52 | private let queue = DispatchQueue(label: "org.swift.swiftpm.basic.stream") 53 | 54 | init() { 55 | self.buffer = [] 56 | self.buffer.reserveCapacity(OutputByteStream.bufferSize) 57 | } 58 | 59 | // MARK: Data Access API 60 | 61 | /// The current offset within the output stream. 62 | final var position: Int { 63 | return queue.sync { 64 | return buffer.count 65 | } 66 | } 67 | 68 | /// Currently available buffer size. 69 | private var availableBufferSize: Int { 70 | return buffer.capacity - buffer.count 71 | } 72 | 73 | /// Clears the buffer maintaining current capacity. 74 | private func clearBuffer() { 75 | buffer.removeAll(keepingCapacity: true) 76 | } 77 | 78 | // MARK: Data Output API 79 | 80 | final func flush() { 81 | queue.sync { 82 | writeImpl(buffer) 83 | clearBuffer() 84 | flushImpl() 85 | } 86 | } 87 | 88 | func flushImpl() { 89 | // Do nothing. 90 | } 91 | 92 | func writeImpl(_ bytes: C) where C.Iterator.Element == UInt8 { 93 | fatalError("Subclasses must implement this") 94 | } 95 | 96 | /// Write an individual byte to the buffer. 97 | final func write(_ byte: UInt8) { 98 | queue.sync { 99 | writeUnsafe(byte) 100 | } 101 | } 102 | private final func writeUnsafe(_ byte: UInt8) { 103 | // If buffer is full, write and clear it. 104 | if availableBufferSize == 0 { 105 | writeImpl(buffer) 106 | clearBuffer() 107 | } 108 | 109 | // This will need to change change if we ever have unbuffered stream. 110 | precondition(availableBufferSize > 0) 111 | buffer.append(byte) 112 | } 113 | 114 | #if swift(>=4.1) 115 | /// Write a collection of bytes to the buffer. 116 | final func write(collection bytes: C) 117 | where C.Element == UInt8 { 118 | queue.sync { 119 | // This is based on LLVM's raw_ostream. 120 | let availableBufferSize = self.availableBufferSize 121 | let byteCount = Int(bytes.count) 122 | 123 | // If we have to insert more than the available space in buffer. 124 | if byteCount > availableBufferSize { 125 | // If buffer is empty, start writing and keep the last chunk in buffer. 126 | if buffer.isEmpty { 127 | let bytesToWrite = byteCount - (byteCount % availableBufferSize) 128 | let writeUptoIndex = bytes.index(bytes.startIndex, offsetBy: numericCast(bytesToWrite)) 129 | writeImpl(bytes.prefix(upTo: writeUptoIndex)) 130 | 131 | // If remaining bytes is more than buffer size write everything. 132 | let bytesRemaining = byteCount - bytesToWrite 133 | if bytesRemaining > availableBufferSize { 134 | writeImpl(bytes.suffix(from: writeUptoIndex)) 135 | return 136 | } 137 | // Otherwise keep remaining in buffer. 138 | buffer += bytes.suffix(from: writeUptoIndex) 139 | return 140 | } 141 | 142 | let writeUptoIndex = bytes.index(bytes.startIndex, offsetBy: numericCast(availableBufferSize)) 143 | // Append whatever we can accommodate. 144 | buffer += bytes.prefix(upTo: writeUptoIndex) 145 | 146 | writeImpl(buffer) 147 | clearBuffer() 148 | 149 | // FIXME: We should start again with remaining chunk but this doesn't work. Write everything for now. 150 | //write(collection: bytes.suffix(from: writeUptoIndex)) 151 | writeImpl(bytes.suffix(from: writeUptoIndex)) 152 | return 153 | } 154 | buffer += bytes 155 | } 156 | } 157 | #else 158 | /// Write a collection of bytes to the buffer. 159 | final func write(collection bytes: C) where 160 | C.Iterator.Element == UInt8, 161 | C.SubSequence: Collection { 162 | queue.sync { 163 | // This is based on LLVM's raw_ostream. 164 | let availableBufferSize = self.availableBufferSize 165 | let byteCount = Int(bytes.count) 166 | 167 | // If we have to insert more than the available space in buffer. 168 | if byteCount > availableBufferSize { 169 | // If buffer is empty, start writing and keep the last chunk in buffer. 170 | if buffer.isEmpty { 171 | let bytesToWrite = byteCount - (byteCount % availableBufferSize) 172 | let writeUptoIndex = bytes.index(bytes.startIndex, offsetBy: numericCast(bytesToWrite)) 173 | writeImpl(bytes.prefix(upTo: writeUptoIndex)) 174 | 175 | // If remaining bytes is more than buffer size write everything. 176 | let bytesRemaining = byteCount - bytesToWrite 177 | if bytesRemaining > availableBufferSize { 178 | writeImpl(bytes.suffix(from: writeUptoIndex)) 179 | return 180 | } 181 | // Otherwise keep remaining in buffer. 182 | buffer += bytes.suffix(from: writeUptoIndex) 183 | return 184 | } 185 | 186 | let writeUptoIndex = bytes.index(bytes.startIndex, offsetBy: numericCast(availableBufferSize)) 187 | // Append whatever we can accommodate. 188 | buffer += bytes.prefix(upTo: writeUptoIndex) 189 | 190 | writeImpl(buffer) 191 | clearBuffer() 192 | 193 | // FIXME: We should start again with remaining chunk but this doesn't work. Write everything for now. 194 | //write(collection: bytes.suffix(from: writeUptoIndex)) 195 | writeImpl(bytes.suffix(from: writeUptoIndex)) 196 | return 197 | } 198 | buffer += bytes 199 | } 200 | } 201 | #endif 202 | 203 | /// Write the contents of a UnsafeBufferPointer. 204 | final func write(_ ptr: UnsafeBufferPointer) { 205 | write(collection: ptr) 206 | } 207 | 208 | /// Write a sequence of bytes to the buffer. 209 | final func write(_ bytes: ArraySlice) { 210 | write(collection: bytes) 211 | } 212 | 213 | /// Write a sequence of bytes to the buffer. 214 | final func write(_ bytes: [UInt8]) { 215 | write(collection: bytes) 216 | } 217 | 218 | /// Write a sequence of bytes to the buffer. 219 | final func write(sequence: S) where S.Iterator.Element == UInt8 { 220 | queue.sync { 221 | // Iterate the sequence and append byte by byte since sequence's append 222 | // is not performant anyway. 223 | for byte in sequence { 224 | writeUnsafe(byte) 225 | } 226 | } 227 | } 228 | 229 | /// Write a string to the buffer (as UTF8). 230 | public final func write(_ string: String) { 231 | // FIXME(performance): Use `string.utf8._copyContents(initializing:)`. 232 | write(sequence: string.utf8) 233 | } 234 | 235 | /// Write a character to the buffer (as UTF8). 236 | final func write(_ character: Character) { 237 | write(String(character)) 238 | } 239 | 240 | /// Write an arbitrary byte streamable to the buffer. 241 | final func write(_ value: ByteStreamable) { 242 | value.write(to: self) 243 | } 244 | 245 | /// Write an arbitrary streamable to the buffer. 246 | final func write(_ value: TextOutputStreamable) { 247 | // Get a mutable reference. 248 | var stream: OutputByteStream = self 249 | value.write(to: &stream) 250 | } 251 | 252 | /// Write a string (as UTF8) to the buffer, with escaping appropriate for 253 | /// embedding within a JSON document. 254 | /// 255 | /// NOTE: This writes the literal data applying JSON string escaping, but 256 | /// does not write any other characters (like the quotes that would surround 257 | /// a JSON string). 258 | final func writeJSONEscaped(_ string: String) { 259 | queue.sync { 260 | // See RFC7159 for reference: https://tools.ietf.org/html/rfc7159 261 | for character in string.utf8 { 262 | // Handle string escapes; we use constants here to directly match the RFC. 263 | switch character { 264 | // Literal characters. 265 | case 0x20...0x21, 0x23...0x5B, 0x5D...0xFF: 266 | writeUnsafe(character) 267 | 268 | // Single-character escaped characters. 269 | case 0x22: // '"' 270 | writeUnsafe(0x5C) // '\' 271 | writeUnsafe(0x22) // '"' 272 | case 0x5C: // '\\' 273 | writeUnsafe(0x5C) // '\' 274 | writeUnsafe(0x5C) // '\' 275 | case 0x08: // '\b' 276 | writeUnsafe(0x5C) // '\' 277 | writeUnsafe(0x62) // 'b' 278 | case 0x0C: // '\f' 279 | writeUnsafe(0x5C) // '\' 280 | writeUnsafe(0x66) // 'b' 281 | case 0x0A: // '\n' 282 | writeUnsafe(0x5C) // '\' 283 | writeUnsafe(0x6E) // 'n' 284 | case 0x0D: // '\r' 285 | writeUnsafe(0x5C) // '\' 286 | writeUnsafe(0x72) // 'r' 287 | case 0x09: // '\t' 288 | writeUnsafe(0x5C) // '\' 289 | writeUnsafe(0x74) // 't' 290 | 291 | // Multi-character escaped characters. 292 | default: 293 | writeUnsafe(0x5C) // '\' 294 | writeUnsafe(0x75) // 'u' 295 | writeUnsafe(hexdigit(0)) 296 | writeUnsafe(hexdigit(0)) 297 | writeUnsafe(hexdigit(character >> 4)) 298 | writeUnsafe(hexdigit(character & 0xF)) 299 | } 300 | } 301 | } 302 | } 303 | } 304 | 305 | /// Define an output stream operator. We need it to be left associative, so we 306 | /// use `<<<`. 307 | infix operator <<< : StreamingPrecedence 308 | precedencegroup StreamingPrecedence { 309 | associativity: left 310 | } 311 | 312 | // MARK: Output Operator Implementations 313 | // 314 | // NOTE: It would be nice to use a protocol here and the adopt it by all the 315 | // things we can efficiently stream out. However, that doesn't work because we 316 | // ultimately need to provide a manual overload sometimes, e.g., TextOutputStreamable, but 317 | // that will then cause ambiguous lookup versus the implementation just using 318 | // the defined protocol. 319 | 320 | @discardableResult 321 | func <<< (stream: OutputByteStream, value: UInt8) -> OutputByteStream { 322 | stream.write(value) 323 | return stream 324 | } 325 | 326 | @discardableResult 327 | func <<< (stream: OutputByteStream, value: [UInt8]) -> OutputByteStream { 328 | stream.write(value) 329 | return stream 330 | } 331 | 332 | @discardableResult 333 | func <<< (stream: OutputByteStream, value: ArraySlice) -> OutputByteStream { 334 | stream.write(value) 335 | return stream 336 | } 337 | 338 | #if swift(>=4.1) 339 | @discardableResult 340 | func <<< (stream: OutputByteStream, value: C) 341 | -> OutputByteStream where C.Element == UInt8 { 342 | stream.write(collection: value) 343 | return stream 344 | } 345 | #else 346 | @discardableResult 347 | func <<< (stream: OutputByteStream, value: C) -> OutputByteStream where 348 | C.Iterator.Element == UInt8, 349 | C.SubSequence: Collection { 350 | stream.write(collection: value) 351 | return stream 352 | } 353 | #endif 354 | 355 | @discardableResult 356 | func <<< ( 357 | stream: OutputByteStream, 358 | value: S 359 | ) -> OutputByteStream where S.Iterator.Element == UInt8 { 360 | stream.write(sequence: value) 361 | return stream 362 | } 363 | 364 | @discardableResult 365 | func <<< (stream: OutputByteStream, value: String) -> OutputByteStream { 366 | stream.write(value) 367 | return stream 368 | } 369 | 370 | @discardableResult 371 | func <<< (stream: OutputByteStream, value: Character) -> OutputByteStream { 372 | stream.write(value) 373 | return stream 374 | } 375 | 376 | @discardableResult 377 | func <<< (stream: OutputByteStream, value: ByteStreamable) -> OutputByteStream { 378 | stream.write(value) 379 | return stream 380 | } 381 | 382 | @discardableResult 383 | func <<< (stream: OutputByteStream, value: TextOutputStreamable) -> OutputByteStream { 384 | stream.write(value) 385 | return stream 386 | } 387 | 388 | extension UInt8: ByteStreamable { 389 | func write(to stream: OutputByteStream) { 390 | stream.write(self) 391 | } 392 | } 393 | 394 | extension Character: ByteStreamable { 395 | func write(to stream: OutputByteStream) { 396 | stream.write(self) 397 | } 398 | } 399 | 400 | extension String: ByteStreamable { 401 | func write(to stream: OutputByteStream) { 402 | stream.write(self) 403 | } 404 | } 405 | 406 | // MARK: Formatted Streaming Output 407 | 408 | /// Provides operations for returning derived streamable objects to implement various forms of formatted output. 409 | struct Format { 410 | /// Write the input boolean encoded as a JSON object. 411 | static func asJSON(_ value: Bool) -> ByteStreamable { 412 | return JSONEscapedBoolStreamable(value: value) 413 | } 414 | private struct JSONEscapedBoolStreamable: ByteStreamable { 415 | let value: Bool 416 | 417 | func write(to stream: OutputByteStream) { 418 | stream <<< (value ? "true" : "false") 419 | } 420 | } 421 | 422 | /// Write the input integer encoded as a JSON object. 423 | static func asJSON(_ value: Int) -> ByteStreamable { 424 | return JSONEscapedIntStreamable(value: value) 425 | } 426 | private struct JSONEscapedIntStreamable: ByteStreamable { 427 | let value: Int 428 | 429 | func write(to stream: OutputByteStream) { 430 | // FIXME: Diagnose integers which cannot be represented in JSON. 431 | stream <<< value.description 432 | } 433 | } 434 | 435 | /// Write the input double encoded as a JSON object. 436 | static func asJSON(_ value: Double) -> ByteStreamable { 437 | return JSONEscapedDoubleStreamable(value: value) 438 | } 439 | private struct JSONEscapedDoubleStreamable: ByteStreamable { 440 | let value: Double 441 | 442 | func write(to stream: OutputByteStream) { 443 | // FIXME: What should we do about NaN, etc.? 444 | // 445 | // FIXME: Is Double.debugDescription the best representation? 446 | stream <<< value.debugDescription 447 | } 448 | } 449 | 450 | /// Write the input string encoded as a JSON object. 451 | static func asJSON(_ string: String) -> ByteStreamable { 452 | return JSONEscapedStringStreamable(value: string) 453 | } 454 | private struct JSONEscapedStringStreamable: ByteStreamable { 455 | let value: String 456 | 457 | func write(to stream: OutputByteStream) { 458 | stream <<< UInt8(ascii: "\"") 459 | stream.writeJSONEscaped(value) 460 | stream <<< UInt8(ascii: "\"") 461 | } 462 | } 463 | 464 | /// Write the input string list encoded as a JSON object. 465 | // 466 | // FIXME: We might be able to make this more generic through the use of a "JSONEncodable" protocol. 467 | static func asJSON(_ items: [String]) -> ByteStreamable { 468 | return JSONEscapedStringListStreamable(items: items) 469 | } 470 | private struct JSONEscapedStringListStreamable: ByteStreamable { 471 | let items: [String] 472 | 473 | func write(to stream: OutputByteStream) { 474 | stream <<< UInt8(ascii: "[") 475 | for (i, item) in items.enumerated() { 476 | if i != 0 { stream <<< "," } 477 | stream <<< Format.asJSON(item) 478 | } 479 | stream <<< UInt8(ascii: "]") 480 | } 481 | } 482 | 483 | /// Write the input dictionary encoded as a JSON object. 484 | static func asJSON(_ items: [String: String]) -> ByteStreamable { 485 | return JSONEscapedDictionaryStreamable(items: items) 486 | } 487 | private struct JSONEscapedDictionaryStreamable: ByteStreamable { 488 | let items: [String: String] 489 | 490 | func write(to stream: OutputByteStream) { 491 | stream <<< UInt8(ascii: "{") 492 | for (offset: i, element: (key: key, value: value)) in items.enumerated() { 493 | if i != 0 { stream <<< "," } 494 | stream <<< Format.asJSON(key) <<< ":" <<< Format.asJSON(value) 495 | } 496 | stream <<< UInt8(ascii: "}") 497 | } 498 | } 499 | 500 | /// Write the input list (after applying a transform to each item) encoded as a JSON object. 501 | // 502 | // FIXME: We might be able to make this more generic through the use of a "JSONEncodable" protocol. 503 | static func asJSON(_ items: [T], transform: @escaping (T) -> String) -> ByteStreamable { 504 | return JSONEscapedTransformedStringListStreamable(items: items, transform: transform) 505 | } 506 | private struct JSONEscapedTransformedStringListStreamable: ByteStreamable { 507 | let items: [T] 508 | let transform: (T) -> String 509 | 510 | func write(to stream: OutputByteStream) { 511 | stream <<< UInt8(ascii: "[") 512 | for (i, item) in items.enumerated() { 513 | if i != 0 { stream <<< "," } 514 | stream <<< Format.asJSON(transform(item)) 515 | } 516 | stream <<< UInt8(ascii: "]") 517 | } 518 | } 519 | 520 | /// Write the input list to the stream with the given separator between items. 521 | static func asSeparatedList(_ items: [T], separator: String) -> ByteStreamable { 522 | return SeparatedListStreamable(items: items, separator: separator) 523 | } 524 | private struct SeparatedListStreamable: ByteStreamable { 525 | let items: [T] 526 | let separator: String 527 | 528 | func write(to stream: OutputByteStream) { 529 | for (i, item) in items.enumerated() { 530 | // Add the separator, if necessary. 531 | if i != 0 { 532 | stream <<< separator 533 | } 534 | 535 | stream <<< item 536 | } 537 | } 538 | } 539 | 540 | /// Write the input list to the stream (after applying a transform to each item) with the given separator between 541 | /// items. 542 | static func asSeparatedList( 543 | _ items: [T], 544 | transform: @escaping (T) -> ByteStreamable, 545 | separator: String 546 | ) -> ByteStreamable { 547 | return TransformedSeparatedListStreamable(items: items, transform: transform, separator: separator) 548 | } 549 | private struct TransformedSeparatedListStreamable: ByteStreamable { 550 | let items: [T] 551 | let transform: (T) -> ByteStreamable 552 | let separator: String 553 | 554 | func write(to stream: OutputByteStream) { 555 | for (i, item) in items.enumerated() { 556 | if i != 0 { stream <<< separator } 557 | stream <<< transform(item) 558 | } 559 | } 560 | } 561 | 562 | static func asRepeating(string: String, count: Int) -> ByteStreamable { 563 | return RepeatingStringStreamable(string: string, count: count) 564 | } 565 | private struct RepeatingStringStreamable: ByteStreamable { 566 | let string: String 567 | let count: Int 568 | 569 | init(string: String, count: Int) { 570 | precondition(count >= 0, "Count should be >= zero") 571 | self.string = string 572 | self.count = count 573 | } 574 | 575 | func write(to stream: OutputByteStream) { 576 | for _ in 0..(_ bytes: C) where C.Iterator.Element == UInt8 { 608 | contents += bytes 609 | } 610 | } 611 | 612 | /// Represents a stream which is backed to a file. Not for instantiating. 613 | class FileOutputByteStream: OutputByteStream { 614 | 615 | /// Closes the file flushing any buffered data. 616 | final func close() throws { 617 | flush() 618 | try closeImpl() 619 | } 620 | 621 | func closeImpl() throws { 622 | fatalError("closeImpl() should be implemented by a subclass") 623 | } 624 | } 625 | 626 | /// Implements file output stream for local file system. 627 | final class LocalFileOutputByteStream: FileOutputByteStream { 628 | 629 | /// The pointer to the file. 630 | let filePointer: UnsafeMutablePointer 631 | 632 | /// True if there were any IO error during writing. 633 | private var error: Bool = false 634 | 635 | /// Closes the file on deinit if true. 636 | private var closeOnDeinit: Bool 637 | 638 | /// Instantiate using the file pointer. 639 | init(filePointer: UnsafeMutablePointer, closeOnDeinit: Bool = true) throws { 640 | self.filePointer = filePointer 641 | self.closeOnDeinit = closeOnDeinit 642 | super.init() 643 | } 644 | 645 | /// Opens the file for writing at the provided path. 646 | /// 647 | /// - Parameters: 648 | /// - path: Path to the file this stream should operate on. 649 | /// - closeOnDeinit: If true closes the file on deinit. clients can use close() if they 650 | /// want to close themselves or catch errors encountered during writing 651 | /// to the file. Default value is true. 652 | /// 653 | /// - Throws: FileSystemError 654 | init(_ path: AbsolutePath, closeOnDeinit: Bool = true) throws { 655 | guard let filePointer = fopen(path.asString, "wb") else { 656 | throw FileSystemError(errno: errno) 657 | } 658 | self.filePointer = filePointer 659 | self.closeOnDeinit = closeOnDeinit 660 | super.init() 661 | } 662 | 663 | deinit { 664 | if closeOnDeinit { 665 | fclose(filePointer) 666 | } 667 | } 668 | 669 | func errorDetected() { 670 | error = true 671 | } 672 | 673 | override final func writeImpl(_ bytes: C) where C.Iterator.Element == UInt8 { 674 | // FIXME: This will be copying bytes but we don't have option currently. 675 | var contents = [UInt8](bytes) 676 | while true { 677 | let n = fwrite(&contents, 1, contents.count, filePointer) 678 | if n < 0 { 679 | if errno == EINTR { continue } 680 | errorDetected() 681 | } else if n != contents.count { 682 | errorDetected() 683 | } 684 | break 685 | } 686 | } 687 | 688 | override final func flushImpl() { 689 | fflush(filePointer) 690 | } 691 | 692 | override final func closeImpl() throws { 693 | defer { 694 | fclose(filePointer) 695 | // If clients called close we shouldn't call fclose again in deinit. 696 | closeOnDeinit = false 697 | } 698 | // Throw if errors were found during writing. 699 | if error { 700 | throw FileSystemError.ioError 701 | } 702 | } 703 | } 704 | 705 | /// stdout stream instance. 706 | var stdoutStream: FileOutputByteStream = try! LocalFileOutputByteStream( 707 | filePointer: stdout, 708 | closeOnDeinit: false) 709 | 710 | /// stderr stream instance. 711 | var stderrStream: FileOutputByteStream = try! LocalFileOutputByteStream( 712 | filePointer: stderr, 713 | closeOnDeinit: false) 714 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/ByteString.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | /// A `ByteString` represents a sequence of bytes. 12 | /// 13 | /// This struct provides useful operations for working with buffers of 14 | /// bytes. Conceptually it is just a contiguous array of bytes (UInt8), but it 15 | /// contains methods and default behavor suitable for common operations done 16 | /// using bytes strings. 17 | /// 18 | /// This struct *is not* intended to be used for significant mutation of byte 19 | /// strings, we wish to retain the flexibility to micro-optimize the memory 20 | /// allocation of the storage (for example, by inlining the storage for small 21 | /// strings or and by eliminating wasted space in growable arrays). For 22 | /// construction of byte arrays, clients should use the `OutputByteStream` class 23 | /// and then convert to a `ByteString` when complete. 24 | struct ByteString: ExpressibleByArrayLiteral, Hashable { 25 | /// The buffer contents. 26 | fileprivate var _bytes: [UInt8] 27 | 28 | /// Create an empty byte string. 29 | init() { 30 | _bytes = [] 31 | } 32 | 33 | /// Create a byte string from a byte array literal. 34 | init(arrayLiteral contents: UInt8...) { 35 | _bytes = contents 36 | } 37 | 38 | /// Create a byte string from an array of bytes. 39 | init(_ contents: [UInt8]) { 40 | _bytes = contents 41 | } 42 | 43 | /// Create a byte string from an byte buffer. 44 | init (_ contents: S) where S.Iterator.Element == UInt8 { 45 | _bytes = [UInt8](contents) 46 | } 47 | 48 | /// Create a byte string from the UTF8 encoding of a string. 49 | init(encodingAsUTF8 string: String) { 50 | _bytes = [UInt8](string.utf8) 51 | } 52 | 53 | /// Access the byte string contents as an array. 54 | var contents: [UInt8] { 55 | return _bytes 56 | } 57 | 58 | /// Return the byte string size. 59 | var count: Int { 60 | return _bytes.count 61 | } 62 | 63 | /// Return the string decoded as a UTF8 sequence, if possible. 64 | var asString: String? { 65 | // FIXME: This is very inefficient, we need a way to pass a buffer. It 66 | // is also wrong if the string contains embedded '\0' characters. 67 | let tmp = _bytes + [UInt8(0)] 68 | return tmp.withUnsafeBufferPointer { ptr in 69 | return String(validatingUTF8: unsafeBitCast(ptr.baseAddress, to: UnsafePointer.self)) 70 | } 71 | } 72 | 73 | /// Return the string decoded as a UTF8 sequence, substituting replacement 74 | /// characters for ill-formed UTF8 sequences. 75 | var asReadableString: String { 76 | // FIXME: This is very inefficient, we need a way to pass a buffer. It 77 | // is also wrong if the string contains embedded '\0' characters. 78 | let tmp = _bytes + [UInt8(0)] 79 | return tmp.withUnsafeBufferPointer { ptr in 80 | return String(cString: unsafeBitCast(ptr.baseAddress, to: UnsafePointer.self)) 81 | } 82 | } 83 | } 84 | 85 | /// Conform to CustomStringConvertible. 86 | extension ByteString: CustomStringConvertible { 87 | var description: String { 88 | // For now, default to the "readable string" representation. 89 | return "" 90 | } 91 | } 92 | 93 | #if !swift(>=4.2) 94 | extension ByteString { 95 | var hashValue: Int { 96 | var result = contents.count 97 | for byte in contents { 98 | result = result &* 31 &+ Int(byte) 99 | } 100 | return result 101 | } 102 | } 103 | #endif 104 | 105 | #if !swift(>=4.1) 106 | extension ByteString { 107 | static func == (lhs: ByteString, rhs: ByteString) -> Bool { 108 | return lhs.contents == rhs.contents 109 | } 110 | } 111 | #endif 112 | 113 | /// ByteStreamable conformance for a ByteString. 114 | extension ByteString: ByteStreamable { 115 | func write(to stream: OutputByteStream) { 116 | stream.write(_bytes) 117 | } 118 | } 119 | 120 | /// StringLiteralConvertable conformance for a ByteString. 121 | extension ByteString: ExpressibleByStringLiteral { 122 | typealias UnicodeScalarLiteralType = StringLiteralType 123 | typealias ExtendedGraphemeClusterLiteralType = StringLiteralType 124 | 125 | init(unicodeScalarLiteral value: UnicodeScalarLiteralType) { 126 | _bytes = [UInt8](value.utf8) 127 | } 128 | init(extendedGraphemeClusterLiteral value: ExtendedGraphemeClusterLiteralType) { 129 | _bytes = [UInt8](value.utf8) 130 | } 131 | init(stringLiteral value: StringLiteralType) { 132 | _bytes = [UInt8](value.utf8) 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/CollectionAlgorithms.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | extension BidirectionalCollection where Iterator.Element : Comparable { 12 | /// Returns the index of the last occurrence of `element` or nil if none. 13 | /// 14 | /// - Parameters: 15 | /// - start: If provided, the `start` index limits the search to a suffix of the collection. 16 | // 17 | // FIXME: This probably shouldn't take the `from` parameter, the pattern in 18 | // the standard library is to use slices for that. 19 | func rindex(of element: Iterator.Element, from start: Index? = nil) -> Index? { 20 | let firstIdx = start ?? startIndex 21 | var i = endIndex 22 | while i > firstIdx { 23 | self.formIndex(before: &i) 24 | if self[i] == element { 25 | return i 26 | } 27 | } 28 | return nil 29 | } 30 | } 31 | 32 | extension Sequence where Iterator.Element: Hashable { 33 | 34 | /// Finds duplicates in given sequence of Hashables. 35 | /// - Returns: duplicated elements in the invoking sequence. 36 | func findDuplicates() -> [Iterator.Element] { 37 | var unique = Set() 38 | var duplicate = Array() 39 | 40 | for element in self { 41 | guard !unique.contains(element) else { 42 | duplicate.append(element) 43 | continue 44 | } 45 | unique.insert(element) 46 | } 47 | 48 | return duplicate 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/CollectionExtensions+only.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | extension Collection { 12 | /// Returns the only element of the collection or nil. 13 | var only: Element? { 14 | return count == 1 ? self[startIndex] : nil 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/Condition.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | import Foundation 12 | 13 | /// A simple condition wrapper. 14 | struct Condition { 15 | private let _condition = NSCondition() 16 | 17 | /// Create a new condition. 18 | init() {} 19 | 20 | /// Wait for the condition to become available. 21 | func wait() { 22 | _condition.wait() 23 | } 24 | 25 | /// Blocks the current thread until the condition is signaled or the specified time limit is reached. 26 | /// 27 | /// - Returns: true if the condition was signaled; otherwise, false if the time limit was reached. 28 | func wait(until limit: Date) -> Bool { 29 | return _condition.wait(until: limit) 30 | } 31 | 32 | /// Signal the availability of the condition (awake one thread waiting on 33 | /// the condition). 34 | func signal() { 35 | _condition.signal() 36 | } 37 | 38 | /// Broadcast the availability of the condition (awake all threads waiting 39 | /// on the condition). 40 | func broadcast() { 41 | _condition.broadcast() 42 | } 43 | 44 | /// A helper method to execute the given body while condition is locked. 45 | func whileLocked(_ body: () throws -> T) rethrows -> T { 46 | _condition.lock() 47 | defer { _condition.unlock() } 48 | return try body() 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/DictionaryExtensions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | extension Dictionary { 12 | /// Convenience initializer to create dictionary from tuples. 13 | init(items: S) where S.Iterator.Element == (Key, Value) { 14 | self.init(minimumCapacity: items.underestimatedCount) 15 | for (key, value) in items { 16 | self[key] = value 17 | } 18 | } 19 | 20 | /// Convenience initializer to create dictionary from tuples. 21 | init(items: S) where S.Iterator.Element == (Key, Optional) { 22 | self.init(minimumCapacity: items.underestimatedCount) 23 | for (key, value) in items { 24 | self[key] = value 25 | } 26 | } 27 | 28 | /// Returns a new dictionary containing the keys of this dictionary with the 29 | /// values transformed by the given closure, if transformed is not nil. 30 | func flatMapValues(_ transform: (Value) throws -> T?) rethrows -> [Key: T] { 31 | var transformed: [Key: T] = [:] 32 | for (key, value) in self { 33 | if let value = try transform(value) { 34 | transformed[key] = value 35 | } 36 | } 37 | return transformed 38 | } 39 | } 40 | 41 | extension Array { 42 | /// Create a dictionary with given sequence of elements. 43 | func createDictionary( 44 | _ uniqueKeysWithValues: (Element) -> (Key, Value) 45 | ) -> [Key: Value] { 46 | return Dictionary(uniqueKeysWithValues: self.map(uniqueKeysWithValues)) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/FileSystem.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | import Foundation 12 | 13 | enum FileSystemError: Swift.Error { 14 | /// Access to the path is denied. 15 | /// 16 | /// This is used when an operation cannot be completed because a component of 17 | /// the path cannot be accessed. 18 | /// 19 | /// Used in situations that correspond to the POSIX EACCES error code. 20 | case invalidAccess 21 | 22 | /// Invalid encoding 23 | /// 24 | /// This is used when an operation cannot be completed because a path could 25 | /// not be decoded correctly. 26 | case invalidEncoding 27 | 28 | /// IO Error encoding 29 | /// 30 | /// This is used when an operation cannot be completed due to an otherwise 31 | /// unspecified IO error. 32 | case ioError 33 | 34 | /// Is a directory 35 | /// 36 | /// This is used when an operation cannot be completed because a component 37 | /// of the path which was expected to be a file was not. 38 | /// 39 | /// Used in situations that correspond to the POSIX EISDIR error code. 40 | case isDirectory 41 | 42 | /// No such path exists. 43 | /// 44 | /// This is used when a path specified does not exist, but it was expected 45 | /// to. 46 | /// 47 | /// Used in situations that correspond to the POSIX ENOENT error code. 48 | case noEntry 49 | 50 | /// Not a directory 51 | /// 52 | /// This is used when an operation cannot be completed because a component 53 | /// of the path which was expected to be a directory was not. 54 | /// 55 | /// Used in situations that correspond to the POSIX ENOTDIR error code. 56 | case notDirectory 57 | 58 | /// Unsupported operation 59 | /// 60 | /// This is used when an operation is not supported by the concrete file 61 | /// system implementation. 62 | case unsupported 63 | 64 | /// An unspecific operating system error. 65 | case unknownOSError 66 | } 67 | 68 | extension FileSystemError { 69 | init(errno: Int32) { 70 | switch errno { 71 | case EACCES: 72 | self = .invalidAccess 73 | case EISDIR: 74 | self = .isDirectory 75 | case ENOENT: 76 | self = .noEntry 77 | case ENOTDIR: 78 | self = .notDirectory 79 | default: 80 | self = .unknownOSError 81 | } 82 | } 83 | } 84 | 85 | /// Defines the file modes. 86 | enum FileMode { 87 | 88 | enum Option: Int { 89 | case recursive 90 | case onlyFiles 91 | } 92 | 93 | case userUnWritable 94 | case userWritable 95 | 96 | var cliArgument: String { 97 | switch self { 98 | case .userUnWritable: 99 | return "u-w" 100 | case .userWritable: 101 | return "u+w" 102 | } 103 | } 104 | } 105 | 106 | /// Abstracted access to file system operations. 107 | /// 108 | /// This protocol is used to allow most of the codebase to interact with a 109 | /// natural filesystem interface, while still allowing clients to transparently 110 | /// substitute a virtual file system or redirect file system operations. 111 | /// 112 | /// NOTE: All of these APIs are synchronous and can block. 113 | // 114 | // FIXME: Design an asynchronous story? 115 | protocol FileSystem: class { 116 | /// Check whether the given path exists and is accessible. 117 | func exists(_ path: AbsolutePath, followSymlink: Bool) -> Bool 118 | 119 | /// Check whether the given path is accessible and a directory. 120 | func isDirectory(_ path: AbsolutePath) -> Bool 121 | 122 | /// Check whether the given path is accessible and a file. 123 | func isFile(_ path: AbsolutePath) -> Bool 124 | 125 | /// Check whether the given path is accessible and is a symbolic link. 126 | func isSymlink(_ path: AbsolutePath) -> Bool 127 | 128 | /// Get the current working directory (similar to `getcwd(3)`), which can be 129 | /// different for different (virtualized) implementations of a FileSystem. 130 | /// The current working directory can be empty if e.g. the directory became 131 | /// unavailable while the current process was still working in it. 132 | /// This follows the POSIX `getcwd(3)` semantics. 133 | var currentWorkingDirectory: AbsolutePath? { get } 134 | } 135 | 136 | /// Convenience implementations (default arguments aren't permitted in protocol 137 | /// methods). 138 | extension FileSystem { 139 | /// exists override with default value. 140 | func exists(_ path: AbsolutePath) -> Bool { 141 | return exists(path, followSymlink: true) 142 | } 143 | } 144 | 145 | /// Concrete FileSystem implementation which communicates with the local file system. 146 | private class LocalFileSystem: FileSystem { 147 | func exists(_ path: AbsolutePath, followSymlink: Bool) -> Bool { 148 | return exists(path, followSymlink: followSymlink) 149 | } 150 | 151 | func isDirectory(_ path: AbsolutePath) -> Bool { 152 | return isDirectory(path) 153 | } 154 | 155 | func isFile(_ path: AbsolutePath) -> Bool { 156 | return isFile(path) 157 | } 158 | 159 | func isSymlink(_ path: AbsolutePath) -> Bool { 160 | return isSymlink(path) 161 | } 162 | 163 | var currentWorkingDirectory: AbsolutePath? { 164 | let cwdStr = FileManager.default.currentDirectoryPath 165 | return try? AbsolutePath(validating: cwdStr) 166 | } 167 | } 168 | 169 | /// access to the local FS proxy. 170 | var localFileSystem: FileSystem = LocalFileSystem() 171 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/Path.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | /// Represents an absolute file system path, independently of what (or whether 12 | /// anything at all) exists at that path in the file system at any given time. 13 | /// An absolute path always starts with a `/` character, and holds a normalized 14 | /// string representation. This normalization is strictly syntactic, and does 15 | /// not access the file system in any way. 16 | /// 17 | /// The absolute path string is normalized by: 18 | /// - Collapsing `..` path components 19 | /// - Removing `.` path components 20 | /// - Removing any trailing path separator 21 | /// - Removing any redundant path separators 22 | /// 23 | /// This string manipulation may change the meaning of a path if any of the 24 | /// path components are symbolic links on disk. However, the file system is 25 | /// never accessed in any way when initializing an AbsolutePath. 26 | /// 27 | /// Note that `~` (home directory resolution) is *not* done as part of path 28 | /// normalization, because it is normally the responsibility of the shell and 29 | /// not the program being invoked (e.g. when invoking `cd ~`, it is the shell 30 | /// that evaluates the tilde; the `cd` command receives an absolute path). 31 | struct AbsolutePath: Hashable { 32 | /// Check if the given name is a valid individual path component. 33 | /// 34 | /// This only checks with regard to the semantics enforced by `AbsolutePath` 35 | /// and `RelativePath`; particular file systems may have their own 36 | /// additional requirements. 37 | static func isValidComponent(_ name: String) -> Bool { 38 | return name != "" && name != "." && name != ".." && !name.contains("/") 39 | } 40 | 41 | /// Private implementation details, shared with the RelativePath struct. 42 | private let _impl: PathImpl 43 | 44 | /// Private initializer when the backing storage is known. 45 | private init(_ impl: PathImpl) { 46 | _impl = impl 47 | } 48 | 49 | /// Initializes the AbsolutePath from `absStr`, which must be an absolute 50 | /// path (i.e. it must begin with a path separator; this initializer does 51 | /// not interpret leading `~` characters as home directory specifiers). 52 | /// The input string will be normalized if needed, as described in the 53 | /// documentation for AbsolutePath. 54 | init(_ absStr: String) { 55 | // Normalize the absolute string. 56 | self.init(PathImpl(string: normalize(absolute: absStr))) 57 | } 58 | 59 | /// Initializes an AbsolutePath from a string that may be either absolute 60 | /// or relative; if relative, `basePath` is used as the anchor; if absolute, 61 | /// it is used as is, and in this case `basePath` is ignored. 62 | init(_ str: String, relativeTo basePath: AbsolutePath) { 63 | if str.hasPrefix("/") { 64 | self.init(str) 65 | } else { 66 | self.init(basePath, RelativePath(str)) 67 | } 68 | } 69 | 70 | /// Initializes the AbsolutePath by concatenating a relative path to an 71 | /// existing absolute path, and renormalizing if necessary. 72 | init(_ absPath: AbsolutePath, _ relPath: RelativePath) { 73 | // Both paths are already normalized. The only case in which we have 74 | // to renormalize their concatenation is if the relative path starts 75 | // with a `..` path component. 76 | let relStr = relPath._impl.string 77 | var absStr = absPath._impl.string 78 | if absStr != "/" { 79 | absStr.append("/") 80 | } 81 | absStr.append(relStr) 82 | 83 | // If the relative string starts with `.` or `..`, we need to normalize 84 | // the resulting string. 85 | // FIXME: We can actually optimize that case, since we know that the 86 | // normalization of a relative path can leave `..` path components at 87 | // the beginning of the path only. 88 | if relStr.hasPrefix(".") { 89 | absStr = normalize(absolute: absStr) 90 | } 91 | 92 | // Finally, store the result as our PathImpl. 93 | self.init(PathImpl(string: absStr)) 94 | } 95 | 96 | /// Convenience initializer that appends a string to a relative path. 97 | init(_ absPath: AbsolutePath, _ relStr: String) { 98 | self.init(absPath, RelativePath(relStr)) 99 | } 100 | 101 | /// Convenience initializer that verifies that the path is absolute. 102 | init(validating path: String) throws { 103 | switch path.first { 104 | case "/": 105 | self.init(path) 106 | case "~": 107 | throw PathValidationError.startsWithTilde(path) 108 | default: 109 | throw PathValidationError.invalidAbsolutePath(path) 110 | } 111 | } 112 | 113 | /// Directory component. An absolute path always has a non-empty directory 114 | /// component (the directory component of the root path is the root itself). 115 | var dirname: String { 116 | return _impl.dirname 117 | } 118 | 119 | /// Last path component (including the suffix, if any). it is never empty. 120 | var basename: String { 121 | return _impl.basename 122 | } 123 | 124 | /// Suffix (including leading `.` character) if any. Note that a basename 125 | /// that starts with a `.` character is not considered a suffix, nor is a 126 | /// trailing `.` character. 127 | var suffix: String? { 128 | return _impl.suffix 129 | } 130 | 131 | /// Extension of the give path's basename. This follow same rules as 132 | /// suffix except that it doesn't include leading `.` character. 133 | var `extension`: String? { 134 | return _impl.extension 135 | } 136 | 137 | /// Absolute path of parent directory. This always returns a path, because 138 | /// every directory has a parent (the parent directory of the root directory 139 | /// is considered to be the root directory itself). 140 | var parentDirectory: AbsolutePath { 141 | return isRoot ? self : AbsolutePath(_impl.dirname) 142 | } 143 | 144 | /// True if the path is the root directory. 145 | var isRoot: Bool { 146 | return _impl.string.only == "/" 147 | } 148 | 149 | /// Returns the absolute path with the relative path applied. 150 | func appending(_ subpath: RelativePath) -> AbsolutePath { 151 | return AbsolutePath(self, subpath) 152 | } 153 | 154 | /// Returns the absolute path with an additional literal component appended. 155 | /// 156 | /// This method accepts pseudo-path like '.' or '..', but should not contain "/". 157 | func appending(component name: String) -> AbsolutePath { 158 | assert(!name.contains("/"), "\(name) is invalid path component") 159 | 160 | // Handle pseudo paths. 161 | switch name { 162 | case "", ".": 163 | return self 164 | case "..": 165 | return self.parentDirectory 166 | default: break 167 | } 168 | 169 | if self == AbsolutePath.root { 170 | return AbsolutePath(PathImpl(string: "/" + name)) 171 | } else { 172 | return AbsolutePath(PathImpl(string: _impl.string + "/" + name)) 173 | } 174 | } 175 | 176 | /// Returns the absolute path with additional literal components appended. 177 | /// 178 | /// This method should only be used in cases where the input is guaranteed 179 | /// to be a valid path component (i.e., it cannot be empty, contain a path 180 | /// separator, or be a pseudo-path like '.' or '..'). 181 | func appending(components names: String...) -> AbsolutePath { 182 | // FIXME: This doesn't seem a particularly efficient way to do this. 183 | return names.reduce(self, { path, name in 184 | path.appending(component: name) 185 | }) 186 | } 187 | 188 | /// NOTE: We will most likely want to add other `appending()` methods, such 189 | /// as `appending(suffix:)`, and also perhaps `replacing()` methods, 190 | /// such as `replacing(suffix:)` or `replacing(basename:)` for some 191 | /// of the more common path operations. 192 | 193 | /// NOTE: We may want to consider adding operators such as `+` for appending 194 | /// a path component. 195 | 196 | /// NOTE: We will want to add a method to return the lowest common ancestor 197 | /// path. 198 | 199 | /// Root directory (whose string representation is just a path separator). 200 | static let root = AbsolutePath("/") 201 | 202 | /// Normalized string representation (the normalization rules are described 203 | /// in the documentation of the initializer). This string is never empty. 204 | var asString: String { 205 | return _impl.string 206 | } 207 | 208 | /// Returns an array of strings that make up the path components of the 209 | /// absolute path. This is the same sequence of strings as the basenames 210 | /// of each successive path component, starting from the root. Therefore 211 | /// the first path component of an absolute path is always `/`. 212 | // FIXME: We should investigate if it would be more efficient to instead 213 | // return a path component iterator that does all its work lazily, moving 214 | // from one path separator to the next on-demand. 215 | var components: [String] { 216 | // FIXME: This isn't particularly efficient; needs optimization, and 217 | // in fact, it might well be best to return a custom iterator so we 218 | // don't have to allocate everything up-front. It would be backed by 219 | // the path string and just return a slice at a time. 220 | return ["/"] + _impl.string.components(separatedBy: "/").filter({ 221 | !$0.isEmpty 222 | }) 223 | } 224 | } 225 | 226 | /// Represents a relative file system path. A relative path never starts with 227 | /// a `/` character, and holds a normalized string representation. As with 228 | /// AbsolutePath, the normalization is strictly syntactic, and does not access 229 | /// the file system in any way. 230 | /// 231 | /// The relative path string is normalized by: 232 | /// - Collapsing `..` path components that aren't at the beginning 233 | /// - Removing extraneous `.` path components 234 | /// - Removing any trailing path separator 235 | /// - Removing any redundant path separators 236 | /// - Replacing a completely empty path with a `.` 237 | /// 238 | /// This string manipulation may change the meaning of a path if any of the 239 | /// path components are symbolic links on disk. However, the file system is 240 | /// never accessed in any way when initializing a RelativePath. 241 | struct RelativePath: Hashable { 242 | /// Private implementation details, shared with the AbsolutePath struct. 243 | fileprivate let _impl: PathImpl 244 | 245 | /// Initializes the RelativePath from `str`, which must be a relative path 246 | /// (which means that it must not begin with a path separator or a tilde). 247 | /// An empty input path is allowed, but will be normalized to a single `.` 248 | /// character. The input string will be normalized if needed, as described 249 | /// in the documentation for RelativePath. 250 | init(_ string: String) { 251 | // Normalize the relative string and store it as our PathImpl. 252 | _impl = PathImpl(string: normalize(relative: string)) 253 | } 254 | 255 | /// Directory component. For a relative path without any path separators, 256 | /// this is the `.` string instead of the empty string. 257 | var dirname: String { 258 | return _impl.dirname 259 | } 260 | 261 | /// Last path component (including the suffix, if any). It is never empty. 262 | var basename: String { 263 | return _impl.basename 264 | } 265 | 266 | /// Suffix (including leading `.` character) if any. Note that a basename 267 | /// that starts with a `.` character is not considered a suffix, nor is a 268 | /// trailing `.` character. 269 | var suffix: String? { 270 | return _impl.suffix 271 | } 272 | 273 | /// Extension of the give path's basename. This follow same rules as 274 | /// suffix except that it doesn't include leading `.` character. 275 | var `extension`: String? { 276 | return _impl.extension 277 | } 278 | 279 | /// Normalized string representation (the normalization rules are described 280 | /// in the documentation of the initializer). This string is never empty. 281 | var asString: String { 282 | return _impl.string 283 | } 284 | 285 | /// Returns an array of strings that make up the path components of the 286 | /// relative path. This is the same sequence of strings as the basenames 287 | /// of each successive path component. Therefore the returned array of 288 | /// path components is never empty; even an empty path has a single path 289 | /// component: the `.` string. 290 | // FIXME: We should investigate if it would be more efficient to instead 291 | // return a path component iterator that does all its work lazily, moving 292 | // from one path separator to the next on-demand. 293 | var components: [String] { 294 | // FIXME: This isn't particularly efficient; needs optimization, and 295 | // in fact, it might well be best to return a custom iterator so we 296 | // don't have to allocate everything up-front. It would be backed by 297 | // the path string and just return a slice at a time. 298 | return _impl.string.components(separatedBy: "/").filter({ !$0.isEmpty }) 299 | } 300 | } 301 | 302 | #if !swift(>=4.1) 303 | // Make absolute paths Hashable. 304 | extension AbsolutePath { 305 | static func == (lhs: AbsolutePath, rhs: AbsolutePath) -> Bool { 306 | return lhs.asString == rhs.asString 307 | } 308 | 309 | var hashValue: Int { 310 | return _impl.hashValue 311 | } 312 | } 313 | #endif 314 | 315 | // Make absolute paths Comparable. 316 | extension AbsolutePath : Comparable { 317 | static func < (lhs: AbsolutePath, rhs: AbsolutePath) -> Bool { 318 | return lhs.asString < rhs.asString 319 | } 320 | static func <= (lhs: AbsolutePath, rhs: AbsolutePath) -> Bool { 321 | return lhs.asString <= rhs.asString 322 | } 323 | static func >= (lhs: AbsolutePath, rhs: AbsolutePath) -> Bool { 324 | return lhs.asString >= rhs.asString 325 | } 326 | static func > (lhs: AbsolutePath, rhs: AbsolutePath) -> Bool { 327 | return lhs.asString > rhs.asString 328 | } 329 | } 330 | 331 | /// Make absolute paths CustomStringConvertible. 332 | extension AbsolutePath : CustomStringConvertible { 333 | var description: String { 334 | // FIXME: We should really be escaping backslashes and quotes here. 335 | return "" 336 | } 337 | } 338 | 339 | #if !swift(>=4.1) 340 | // Make relative paths Equatable. 341 | extension RelativePath: Equatable { 342 | static func == (lhs: RelativePath, rhs: RelativePath) -> Bool { 343 | return lhs.asString == rhs.asString 344 | } 345 | 346 | var hashValue: Int { 347 | return _impl.hashValue 348 | } 349 | } 350 | #endif 351 | 352 | /// Make relative paths CustomStringConvertible. 353 | extension RelativePath : CustomStringConvertible { 354 | var description: String { 355 | // FIXME: We should really be escaping backslashes and quotes here. 356 | return "" 357 | } 358 | } 359 | 360 | /// Private implementation shared between AbsolutePath and RelativePath. It is 361 | /// a little unfortunate that there needs to be duplication at all between the 362 | /// AbsolutePath and RelativePath struct, but PathImpl helps mitigate it. From 363 | /// a type safety perspective, absolute paths and relative paths are genuinely 364 | /// different. 365 | // FIXME: This is internal due to this bug: https://bugs.swift.org/browse/SR-3009 366 | // but otherwise should be private. 367 | struct PathImpl: Hashable { 368 | /// Normalized string of the (absolute or relative) path. Never empty. 369 | fileprivate let string: String 370 | 371 | /// Private function that returns the directory part of the stored path 372 | /// string (relying on the fact that it has been normalized). Returns a 373 | /// string consisting of just `.` if there is no directory part (which is 374 | /// the case if and only if there is no path separator). 375 | fileprivate var dirname: String { 376 | // FIXME: This method seems too complicated; it should be simplified, 377 | // if possible, and certainly optimized (using UTF8View). 378 | // Find the last path separator. 379 | guard let idx = string.rindex(of: "/") else { 380 | // No path separators, so the directory name is `.`. 381 | return "." 382 | } 383 | // Check if it's the only one in the string. 384 | if idx == string.startIndex { 385 | // Just one path separator, so the directory name is `/`. 386 | return "/" 387 | } 388 | // Otherwise, it's the string up to (but not including) the last path 389 | // separator. 390 | return String(string.prefix(upTo: idx)) 391 | } 392 | 393 | fileprivate var basename: String { 394 | // FIXME: This method seems too complicated; it should be simplified, 395 | // if possible, and certainly optimized (using UTF8View). 396 | // Check for a special case of the root directory. 397 | if string.only == "/" { 398 | // Root directory, so the basename is a single path separator (the 399 | // root directory is special in this regard). 400 | return "/" 401 | } 402 | // Find the last path separator. 403 | guard let idx = string.rindex(of: "/") else { 404 | // No path separators, so the basename is the whole string. 405 | return string 406 | } 407 | // Otherwise, it's the string from (but not including) the last path 408 | // separator. 409 | return String(string.suffix(from: string.index(after: idx))) 410 | } 411 | 412 | fileprivate var suffix: String? { 413 | return suffix(withDot: true) 414 | } 415 | 416 | fileprivate var `extension`: String? { 417 | return suffix(withDot: false) 418 | } 419 | 420 | /// Returns suffix with leading `.` if withDot is true otherwise without it. 421 | private func suffix(withDot: Bool) -> String? { 422 | // FIXME: This method seems too complicated; it should be simplified, 423 | // if possible, and certainly optimized (using UTF8View). 424 | // Find the last path separator, if any. 425 | let sIdx = string.rindex(of: "/") 426 | // Find the start of the basename. 427 | let bIdx = (sIdx != nil) ? string.index(after: sIdx!) : string.startIndex 428 | // Find the last `.` (if any), starting from the second character of 429 | // the basename (a leading `.` does not make the whole path component 430 | // a suffix). 431 | let fIdx = string.index(bIdx, offsetBy: 1, limitedBy: string.endIndex) 432 | if let idx = string.rindex(of: ".", from: fIdx) { 433 | // Unless it's just a `.` at the end, we have found a suffix. 434 | if string.distance(from: idx, to: string.endIndex) > 1 { 435 | let fromIndex = withDot ? idx : string.index(idx, offsetBy: 1) 436 | return String(string.suffix(from: fromIndex)) 437 | } else { 438 | return nil 439 | } 440 | } 441 | // If we get this far, there is no suffix. 442 | return nil 443 | } 444 | } 445 | 446 | #if !swift(>=4.1) 447 | extension PathImpl { 448 | var hashValue: Int { 449 | return string.hashValue 450 | } 451 | } 452 | #endif 453 | 454 | /// Describes the way in which a path is invalid. 455 | enum PathValidationError: Error { 456 | case startsWithTilde(String) 457 | case invalidAbsolutePath(String) 458 | } 459 | 460 | extension PathValidationError: CustomStringConvertible { 461 | var description: String { 462 | switch self { 463 | case .startsWithTilde(let path): 464 | return "invalid absolute path '\(path)'; absolute path must begin with /" 465 | case .invalidAbsolutePath(let path): 466 | return "invalid absolute path '\(path)'" 467 | } 468 | } 469 | } 470 | 471 | extension AbsolutePath { 472 | /// Returns a relative path that, when concatenated to `base`, yields the 473 | /// callee path itself. If `base` is not an ancestor of the callee, the 474 | /// returned path will begin with one or more `..` path components. 475 | /// 476 | /// Because both paths are absolute, they always have a common ancestor 477 | /// (the root path, if nothing else). Therefore, any path can be made 478 | /// relative to any other path by using a sufficient number of `..` path 479 | /// components. 480 | /// 481 | /// This method is strictly syntactic and does not access the file system 482 | /// in any way. Therefore, it does not take symbolic links into account. 483 | func relative(to base: AbsolutePath) -> RelativePath { 484 | let result: RelativePath 485 | // Split the two paths into their components. 486 | // FIXME: The is needs to be optimized to avoid unncessary copying. 487 | let pathComps = self.components 488 | let baseComps = base.components 489 | 490 | // It's common for the base to be an ancestor, so try that first. 491 | if pathComps.starts(with: baseComps) { 492 | // Special case, which is a plain path without `..` components. It 493 | // might be an empty path (when self and the base are equal). 494 | let relComps = pathComps.dropFirst(baseComps.count) 495 | result = RelativePath(relComps.joined(separator: "/")) 496 | } else { 497 | // General case, in which we might well need `..` components to go 498 | // "up" before we can go "down" the directory tree. 499 | var newPathComps = ArraySlice(pathComps) 500 | var newBaseComps = ArraySlice(baseComps) 501 | while newPathComps.prefix(1) == newBaseComps.prefix(1) { 502 | // First component matches, so drop it. 503 | newPathComps = newPathComps.dropFirst() 504 | newBaseComps = newBaseComps.dropFirst() 505 | } 506 | // Now construct a path consisting of as many `..`s as are in the 507 | // `newBaseComps` followed by what remains in `newPathComps`. 508 | var relComps = Array(repeating: "..", count: newBaseComps.count) 509 | relComps.append(contentsOf: newPathComps) 510 | result = RelativePath(relComps.joined(separator: "/")) 511 | } 512 | assert(base.appending(result) == self) 513 | return result 514 | } 515 | 516 | /// Returns true if the path contains the given path. 517 | /// 518 | /// This method is strictly syntactic and does not access the file system 519 | /// in any way. 520 | func contains(_ other: AbsolutePath) -> Bool { 521 | return self.components.starts(with: other.components) 522 | } 523 | 524 | } 525 | 526 | // FIXME: We should consider whether to merge the two `normalize()` functions. 527 | // The argument for doing so is that some of the code is repeated; the argument 528 | // against doing so is that some of the details are different, and since any 529 | // given path is either absolute or relative, it's wasteful to keep checking 530 | // for whether it's relative or absolute. Possibly we can do both by clever 531 | // use of generics that abstract away the differences. 532 | 533 | /// Private function that normalizes and returns an absolute string. Asserts 534 | /// that `string` starts with a path separator. 535 | /// 536 | /// The normalization rules are as described for the AbsolutePath struct. 537 | private func normalize(absolute string: String) -> String { 538 | precondition(string.first == "/", "Failure normalizing \(string), absolute paths should start with '/'") 539 | 540 | // At this point we expect to have a path separator as first character. 541 | assert(string.first == "/") 542 | 543 | // FIXME: Here we should also keep track of whether anything actually has 544 | // to be changed in the string, and if not, just return the existing one. 545 | 546 | // Split the character array into parts, folding components as we go. 547 | // As we do so, we count the number of characters we'll end up with in 548 | // the normalized string representation. 549 | var parts: [String] = [] 550 | var capacity = 0 551 | for part in string.split(separator: "/") { 552 | switch part.count { 553 | case 0: 554 | // Ignore empty path components. 555 | continue 556 | case 1 where part.first == ".": 557 | // Ignore `.` path components. 558 | continue 559 | case 2 where part.first == "." && part.last == ".": 560 | // If there's a previous part, drop it; otherwise, do nothing. 561 | if let prev = parts.last { 562 | parts.removeLast() 563 | capacity -= prev.count 564 | } 565 | default: 566 | // Any other component gets appended. 567 | parts.append(String(part)) 568 | capacity += part.count 569 | } 570 | } 571 | capacity += max(parts.count, 1) 572 | 573 | // Create an output buffer using the capacity we've calculated. 574 | // FIXME: Determine the most efficient way to reassemble a string. 575 | var result = "" 576 | result.reserveCapacity(capacity) 577 | 578 | // Put the normalized parts back together again. 579 | var iter = parts.makeIterator() 580 | result.append("/") 581 | if let first = iter.next() { 582 | result.append(contentsOf: first) 583 | while let next = iter.next() { 584 | result.append("/") 585 | result.append(contentsOf: next) 586 | } 587 | } 588 | 589 | // Sanity-check the result (including the capacity we reserved). 590 | assert(!result.isEmpty, "unexpected empty string") 591 | assert(result.count == capacity, "count: " + 592 | "\(result.count), cap: \(capacity)") 593 | 594 | // Use the result as our stored string. 595 | return result 596 | } 597 | 598 | /// Private function that normalizes and returns a relative string. Asserts 599 | /// that `string` does not start with a path separator. 600 | /// 601 | /// The normalization rules are as described for the AbsolutePath struct. 602 | private func normalize(relative string: String) -> String { 603 | precondition(string.first != "/") 604 | 605 | // FIXME: Here we should also keep track of whether anything actually has 606 | // to be changed in the string, and if not, just return the existing one. 607 | 608 | // Split the character array into parts, folding components as we go. 609 | // As we do so, we count the number of characters we'll end up with in 610 | // the normalized string representation. 611 | var parts: [String] = [] 612 | var capacity = 0 613 | for part in string.split(separator: "/") { 614 | switch part.count { 615 | case 0: 616 | // Ignore empty path components. 617 | continue 618 | case 1 where part.first == ".": 619 | // Ignore `.` path components. 620 | continue 621 | case 2 where part.first == "." && part.last == ".": 622 | // If at beginning, fall through to treat the `..` literally. 623 | guard let prev = parts.last else { 624 | fallthrough 625 | } 626 | // If previous component is anything other than `..`, drop it. 627 | if !(prev.count == 2 && prev.first == "." && prev.last == ".") { 628 | parts.removeLast() 629 | capacity -= prev.count 630 | continue 631 | } 632 | // Otherwise, fall through to treat the `..` literally. 633 | fallthrough 634 | default: 635 | // Any other component gets appended. 636 | parts.append(String(part)) 637 | capacity += part.count 638 | } 639 | } 640 | capacity += max(parts.count - 1, 0) 641 | 642 | // Create an output buffer using the capacity we've calculated. 643 | // FIXME: Determine the most efficient way to reassemble a string. 644 | var result = "" 645 | result.reserveCapacity(capacity) 646 | 647 | // Put the normalized parts back together again. 648 | var iter = parts.makeIterator() 649 | if let first = iter.next() { 650 | result.append(contentsOf: first) 651 | while let next = iter.next() { 652 | result.append("/") 653 | result.append(contentsOf: next) 654 | } 655 | } 656 | 657 | // Sanity-check the result (including the capacity we reserved). 658 | assert(result.count == capacity, "count: " + 659 | "\(result.count), cap: \(capacity)") 660 | 661 | // If the result is empty, return `.`, otherwise we return it as a string. 662 | return result.isEmpty ? "." : result 663 | } 664 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Basic/Thread.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | import Foundation 12 | 13 | /// This class bridges the gap between OSX and Linux Foundation Threading API. 14 | /// It provides closure based execution and a join method to block the calling thread 15 | /// until the thread is finished executing. 16 | final class Thread { 17 | 18 | /// The thread implementation which is Foundation.Thread on Linux and 19 | /// a Thread subclass which provides closure support on OSX. 20 | private var thread: ThreadImpl! 21 | 22 | /// Condition variable to support blocking other threads using join when this thread has not finished executing. 23 | private var finishedCondition: Condition 24 | 25 | /// A boolean variable to track if this thread has finished executing its task. 26 | private var isFinished: Bool 27 | 28 | /// Creates an instance of thread class with closure to be executed when start() is called. 29 | init(task: @escaping () -> Void) { 30 | isFinished = false 31 | finishedCondition = Condition() 32 | 33 | // Wrap the task with condition notifying any other threads blocked due to this thread. 34 | // Capture self weakly to avoid reference cycle. In case Thread is deinited before the task 35 | // runs, skip the use of finishedCondition. 36 | let theTask = { [weak self] in 37 | if let strongSelf = self { 38 | precondition(!strongSelf.isFinished) 39 | strongSelf.finishedCondition.whileLocked { 40 | task() 41 | strongSelf.isFinished = true 42 | strongSelf.finishedCondition.broadcast() 43 | } 44 | } else { 45 | // If the containing thread has been destroyed, we can ignore the finished condition and just run the 46 | // task. 47 | task() 48 | } 49 | } 50 | 51 | self.thread = ThreadImpl(block: theTask) 52 | } 53 | 54 | /// Starts the thread execution. 55 | func start() { 56 | thread.start() 57 | } 58 | 59 | /// Blocks the calling thread until this thread is finished execution. 60 | func join() { 61 | finishedCondition.whileLocked { 62 | while !isFinished { 63 | finishedCondition.wait() 64 | } 65 | } 66 | } 67 | } 68 | 69 | #if os(macOS) 70 | /// A helper subclass of Foundation's Thread with closure support. 71 | final private class ThreadImpl: Foundation.Thread { 72 | 73 | /// The task to be executed. 74 | private let task: () -> Void 75 | 76 | override func main() { 77 | task() 78 | } 79 | 80 | init(block task: @escaping () -> Void) { 81 | self.task = task 82 | } 83 | } 84 | #else 85 | // Thread on Linux supports closure so just use it directly. 86 | typealias ThreadImpl = Foundation.Thread 87 | #endif 88 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Utility/CollectionExtensions+split.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | extension Collection where Iterator.Element : Equatable { 12 | /// Split around a delimiting subsequence with maximum number of splits == 2 13 | func split(around delimiter: [Iterator.Element]) -> ([Iterator.Element], [Iterator.Element]?) { 14 | 15 | let orig = Array(self) 16 | let end = orig.endIndex 17 | let delimCount = delimiter.count 18 | 19 | var index = orig.startIndex 20 | while index+delimCount <= end { 21 | let cur = Array(orig[index.. String { 18 | func scrub(_ separator: String) -> String { 19 | var E = endIndex 20 | while String(self[startIndex.. startIndex { 21 | E = index(before: E) 22 | } 23 | return String(self[startIndex.. String? { 47 | var cc = self 48 | 49 | loop: while true { 50 | switch cc.first { 51 | case nil: 52 | return nil 53 | case "\n"?, "\r"?, " "?, "\t"?, "\r\n"?: 54 | cc = String(cc.dropFirst()) 55 | default: 56 | break loop 57 | } 58 | } 59 | 60 | loop: while true { 61 | switch cc.last { 62 | case nil: 63 | return nil 64 | case "\n"?, "\r"?, " "?, "\t"?, "\r\n"?: 65 | cc = String(cc.dropLast()) 66 | default: 67 | break loop 68 | } 69 | } 70 | 71 | return String(cc) 72 | } 73 | 74 | /// Splits string around a delimiter string into up to two substrings 75 | /// If delimiter is not found, the second returned substring is nil 76 | func split(around delimiter: String) -> (String, String?) { 77 | let comps = self.split(around: Array(delimiter)) 78 | let head = String(comps.0) 79 | if let tail = comps.1 { 80 | return (head, String(tail)) 81 | } else { 82 | return (head, nil) 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/ArgumentParserKit/Classes/internal/Utility/URL.swift: -------------------------------------------------------------------------------- 1 | /* 2 | This source file is part of the Swift.org open source project 3 | 4 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 5 | Licensed under Apache License v2.0 with Runtime Library Exception 6 | 7 | See http://swift.org/LICENSE.txt for license information 8 | See http://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | 11 | struct URL { 12 | 13 | /// Parses the URL type of a git repository 14 | /// e.g. https://github.com/apple/swift returns "https" 15 | /// e.g. git@github.com:apple/swift returns "git" 16 | /// 17 | /// This is *not* a generic URI scheme parser! 18 | static func scheme(_ url: String) -> String? { 19 | 20 | func prefixOfSplitBy(_ delimiter: String) -> String? { 21 | let (head, tail) = url.split(around: delimiter) 22 | if tail == nil { 23 | //not found 24 | return nil 25 | } else { 26 | //found, return head 27 | //lowercase the "scheme", as specified by the URI RFC (just in case) 28 | return head.lowercased() 29 | } 30 | } 31 | 32 | for delim in ["://", "@"] { 33 | if let found = prefixOfSplitBy(delim) { 34 | return found 35 | } 36 | } 37 | 38 | return nil 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 2 | 3 | Apache License 4 | Version 2.0, January 2004 5 | http://www.apache.org/licenses/ 6 | 7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | 9 | 1. Definitions. 10 | 11 | "License" shall mean the terms and conditions for use, reproduction, 12 | and distribution as defined by Sections 1 through 9 of this document. 13 | 14 | "Licensor" shall mean the copyright owner or entity authorized by 15 | the copyright owner that is granting the License. 16 | 17 | "Legal Entity" shall mean the union of the acting entity and all 18 | other entities that control, are controlled by, or are under common 19 | control with that entity. For the purposes of this definition, 20 | "control" means (i) the power, direct or indirect, to cause the 21 | direction or management of such entity, whether by contract or 22 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 23 | outstanding shares, or (iii) beneficial ownership of such entity. 24 | 25 | "You" (or "Your") shall mean an individual or Legal Entity 26 | exercising permissions granted by this License. 27 | 28 | "Source" form shall mean the preferred form for making modifications, 29 | including but not limited to software source code, documentation 30 | source, and configuration files. 31 | 32 | "Object" form shall mean any form resulting from mechanical 33 | transformation or translation of a Source form, including but 34 | not limited to compiled object code, generated documentation, 35 | and conversions to other media types. 36 | 37 | "Work" shall mean the work of authorship, whether in Source or 38 | Object form, made available under the License, as indicated by a 39 | copyright notice that is included in or attached to the work 40 | (an example is provided in the Appendix below). 41 | 42 | "Derivative Works" shall mean any work, whether in Source or Object 43 | form, that is based on (or derived from) the Work and for which the 44 | editorial revisions, annotations, elaborations, or other modifications 45 | represent, as a whole, an original work of authorship. For the purposes 46 | of this License, Derivative Works shall not include works that remain 47 | separable from, or merely link (or bind by name) to the interfaces of, 48 | the Work and Derivative Works thereof. 49 | 50 | "Contribution" shall mean any work of authorship, including 51 | the original version of the Work and any modifications or additions 52 | to that Work or Derivative Works thereof, that is intentionally 53 | submitted to Licensor for inclusion in the Work by the copyright owner 54 | or by an individual or Legal Entity authorized to submit on behalf of 55 | the copyright owner. For the purposes of this definition, "submitted" 56 | means any form of electronic, verbal, or written communication sent 57 | to the Licensor or its representatives, including but not limited to 58 | communication on electronic mailing lists, source code control systems, 59 | and issue tracking systems that are managed by, or on behalf of, the 60 | Licensor for the purpose of discussing and improving the Work, but 61 | excluding communication that is conspicuously marked or otherwise 62 | designated in writing by the copyright owner as "Not a Contribution." 63 | 64 | "Contributor" shall mean Licensor and any individual or Legal Entity 65 | on behalf of whom a Contribution has been received by Licensor and 66 | subsequently incorporated within the Work. 67 | 68 | 2. Grant of Copyright License. Subject to the terms and conditions of 69 | this License, each Contributor hereby grants to You a perpetual, 70 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 71 | copyright license to reproduce, prepare Derivative Works of, 72 | publicly display, publicly perform, sublicense, and distribute the 73 | Work and such Derivative Works in Source or Object form. 74 | 75 | 3. Grant of Patent License. Subject to the terms and conditions of 76 | this License, each Contributor hereby grants to You a perpetual, 77 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 78 | (except as stated in this section) patent license to make, have made, 79 | use, offer to sell, sell, import, and otherwise transfer the Work, 80 | where such license applies only to those patent claims licensable 81 | by such Contributor that are necessarily infringed by their 82 | Contribution(s) alone or by combination of their Contribution(s) 83 | with the Work to which such Contribution(s) was submitted. If You 84 | institute patent litigation against any entity (including a 85 | cross-claim or counterclaim in a lawsuit) alleging that the Work 86 | or a Contribution incorporated within the Work constitutes direct 87 | or contributory patent infringement, then any patent licenses 88 | granted to You under this License for that Work shall terminate 89 | as of the date such litigation is filed. 90 | 91 | 4. Redistribution. You may reproduce and distribute copies of the 92 | Work or Derivative Works thereof in any medium, with or without 93 | modifications, and in Source or Object form, provided that You 94 | meet the following conditions: 95 | 96 | (a) You must give any other recipients of the Work or 97 | Derivative Works a copy of this License; and 98 | 99 | (b) You must cause any modified files to carry prominent notices 100 | stating that You changed the files; and 101 | 102 | (c) You must retain, in the Source form of any Derivative Works 103 | that You distribute, all copyright, patent, trademark, and 104 | attribution notices from the Source form of the Work, 105 | excluding those notices that do not pertain to any part of 106 | the Derivative Works; and 107 | 108 | (d) If the Work includes a "NOTICE" text file as part of its 109 | distribution, then any Derivative Works that You distribute must 110 | include a readable copy of the attribution notices contained 111 | within such NOTICE file, excluding those notices that do not 112 | pertain to any part of the Derivative Works, in at least one 113 | of the following places: within a NOTICE text file distributed 114 | as part of the Derivative Works; within the Source form or 115 | documentation, if provided along with the Derivative Works; or, 116 | within a display generated by the Derivative Works, if and 117 | wherever such third-party notices normally appear. The contents 118 | of the NOTICE file are for informational purposes only and 119 | do not modify the License. You may add Your own attribution 120 | notices within Derivative Works that You distribute, alongside 121 | or as an addendum to the NOTICE text from the Work, provided 122 | that such additional attribution notices cannot be construed 123 | as modifying the License. 124 | 125 | You may add Your own copyright statement to Your modifications and 126 | may provide additional or different license terms and conditions 127 | for use, reproduction, or distribution of Your modifications, or 128 | for any such Derivative Works as a whole, provided Your use, 129 | reproduction, and distribution of the Work otherwise complies with 130 | the conditions stated in this License. 131 | 132 | 5. Submission of Contributions. Unless You explicitly state otherwise, 133 | any Contribution intentionally submitted for inclusion in the Work 134 | by You to the Licensor shall be under the terms and conditions of 135 | this License, without any additional terms or conditions. 136 | Notwithstanding the above, nothing herein shall supersede or modify 137 | the terms of any separate license agreement you may have executed 138 | with Licensor regarding such Contributions. 139 | 140 | 6. Trademarks. This License does not grant permission to use the trade 141 | names, trademarks, service marks, or product names of the Licensor, 142 | except as required for reasonable and customary use in describing the 143 | origin of the Work and reproducing the content of the NOTICE file. 144 | 145 | 7. Disclaimer of Warranty. Unless required by applicable law or 146 | agreed to in writing, Licensor provides the Work (and each 147 | Contributor provides its Contributions) on an "AS IS" BASIS, 148 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 149 | implied, including, without limitation, any warranties or conditions 150 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 151 | PARTICULAR PURPOSE. You are solely responsible for determining the 152 | appropriateness of using or redistributing the Work and assume any 153 | risks associated with Your exercise of permissions under this License. 154 | 155 | 8. Limitation of Liability. In no event and under no legal theory, 156 | whether in tort (including negligence), contract, or otherwise, 157 | unless required by applicable law (such as deliberate and grossly 158 | negligent acts) or agreed to in writing, shall any Contributor be 159 | liable to You for damages, including any direct, indirect, special, 160 | incidental, or consequential damages of any character arising as a 161 | result of this License or out of the use or inability to use the 162 | Work (including but not limited to damages for loss of goodwill, 163 | work stoppage, computer failure or malfunction, or any and all 164 | other commercial damages or losses), even if such Contributor 165 | has been advised of the possibility of such damages. 166 | 167 | 9. Accepting Warranty or Additional Liability. While redistributing 168 | the Work or Derivative Works thereof, You may choose to offer, 169 | and charge a fee for, acceptance of support, warranty, indemnity, 170 | or other liability obligations and/or rights consistent with this 171 | License. However, in accepting such obligations, You may act only 172 | on Your own behalf and on Your sole responsibility, not on behalf 173 | of any other Contributor, and only if You agree to indemnify, 174 | defend, and hold each Contributor harmless for any liability 175 | incurred by, or claims asserted against, such Contributor by reason 176 | of your accepting any such warranty or additional liability. 177 | 178 | END OF TERMS AND CONDITIONS 179 | 180 | APPENDIX: How to apply the Apache License to your work. 181 | 182 | To apply the Apache License to your work, attach the following 183 | boilerplate notice, with the fields enclosed by brackets "[]" 184 | replaced with your own identifying information. (Don't include 185 | the brackets!) The text should be enclosed in the appropriate 186 | comment syntax for the file format. We also recommend that a 187 | file or class name and description of purpose be included on the 188 | same "printed page" as the copyright notice for easier 189 | identification within third-party archives. 190 | 191 | Copyright [yyyy] [name of copyright owner] 192 | 193 | Licensed under the Apache License, Version 2.0 (the "License"); 194 | you may not use this file except in compliance with the License. 195 | You may obtain a copy of the License at 196 | 197 | http://www.apache.org/licenses/LICENSE-2.0 198 | 199 | Unless required by applicable law or agreed to in writing, software 200 | distributed under the License is distributed on an "AS IS" BASIS, 201 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 202 | See the License for the specific language governing permissions and 203 | limitations under the License. 204 | 205 | 206 | 207 | ### Runtime Library Exception to the Apache 2.0 License: ### 208 | 209 | 210 | As an exception, if you use this Software to compile your source code and 211 | portions of this Software are embedded into the binary product as a result, 212 | you may redistribute such product without providing attribution as would 213 | otherwise be required by Sections 4(a), 4(b) and 4(d) of the License. 214 | -------------------------------------------------------------------------------- /Pods/ArgumentParserKit/README.md: -------------------------------------------------------------------------------- 1 | # ArgumentParserKit 2 | 3 | Type-safe and easy way for parsing command line arguments in your macOS command line tools 4 | 5 | [![Version](https://img.shields.io/cocoapods/v/ArgumentParserKit.svg?longCache=true&style=flat-square)](http://cocoapods.org/pods/ArgumentParserKit) 6 | [![Swift4](https://img.shields.io/badge/swift4-compatible-orange.svg?longCache=true&style=flat-square)](https://developer.apple.com/swift) 7 | [![Platform](https://img.shields.io/badge/platform-macOS-lightgrey.svg?longCache=true&style=flat-square)](https://www.apple.com/de/macos) 8 | [![License](https://img.shields.io/badge/license-Apache%20License%20v2.0-lightgrey.svg?longCache=true&style=flat-square)](https://en.wikipedia.org/wiki/Apache_License) 9 | 10 | The `ArgumentParser` has out of the box support for the `--help` or `-h` argument. He prints out a beautiful overview of your command line tool usage. 11 | 12 | ``` 13 | 👻 Welcome to this awesome Command Line Tool 😊 14 | OVERVIEW: Does amazing things for you 15 | 16 | USAGE: CommandLineTool 17 | 18 | OPTIONS: 19 | --name, -n A name 20 | --help, -h Display available options 21 | ``` 22 | 23 | ## Example 24 | 25 | ```swift 26 | do { 27 | // The first argument is always the executable, drop it 28 | let arguments = Array(CommandLine.arguments.dropFirst()) 29 | 30 | let parser = ArgumentParser(usage: "", overview: "A description") 31 | let nameOption = parser.add(option: "--name", shortName: "-n", kind: String.self, usage: "A name") 32 | 33 | let parsedArguments = try parser.parse(arguments) 34 | let name = parsedArguments.get(nameOption) 35 | print(name) 36 | } catch { 37 | // handle parsing error 38 | } 39 | ``` 40 | 41 | ## How to use 42 | 43 | The parsed argument values are only four steps away from you if you use the `ArgumentParser`. 44 | 45 | ### 1. Create a parser ### 46 | 47 | Use the initializer of the `ArgumentParser` class. 48 | 49 | ```swift 50 | /// Create an argument parser. 51 | /// 52 | /// - Parameters: 53 | /// - commandName: If provided, this will be substitued in "usage" line of the generated usage text. 54 | /// Otherwise, first command line argument will be used. 55 | /// - usage: The "usage" line of the generated usage text. 56 | /// - overview: The "overview" line of the generated usage text. 57 | /// - seeAlso: The "see also" line of generated usage text. 58 | /// 59 | init(commandName: String? = nil, usage: String, overview: String, seeAlso: String? = nil) 60 | ``` 61 | 62 | ### 2. Tell the parser about the arguments to parse ### 63 | 64 | Tell the parser which arguments (for the `ArgumentParser` an argument is an instance of `OptionArgument`) your command line tool offers via the `add`-method. 65 | 66 | ```swift 67 | /// Add an argument to a parser. 68 | /// 69 | /// - Parameters: 70 | /// - option: The name of the argument, for example "--name". 71 | /// - shortName: The shortened name of the argument, e.g. "-n". 72 | /// - kind: The concrete type of the argument. 73 | /// - usage: The description of the argument. 74 | /// 75 | func add(option: String, shortName: String? = nil, kind: T.Type, usage: String? = nil) 76 | ``` 77 | 78 | ### 3. Parse arguments passed to your command line tool ### 79 | 80 | Pass your arguments array to the `parse`-method of your parser instance. 81 | 82 | ```swift 83 | /// Parses the provided array and returns the result. 84 | /// 85 | func parse(_ arguments: [String] = []) throws -> Result 86 | ``` 87 | 88 | ### 4. Get the values of the passed arguments ### 89 | 90 | After parsing you can access the argument values calling the `get`-method on the `Result` type returned by the `parse`-method of the `ArgumentParser`. Simply pass in the `OptionArgument` returned by the `add`-method of the `ArgumentParser`. 91 | 92 | ```swift 93 | /// Get an option argument's value from the results. 94 | /// 95 | /// Since the options are optional, their result may or may not be present. 96 | /// 97 | func get(_ argument: OptionArgument) -> T? 98 | ``` 99 | 100 | ## Requirements 101 | 102 | Deployment target has to be greater than or equal to 10.10. 103 | 104 | ## Installation 105 | 106 | ArgumentParserKit is available through [CocoaPods](https://cocoapods.org). To install 107 | it, simply add the following line to your Podfile: 108 | 109 | ```ruby 110 | pod 'ArgumentParserKit' 111 | ``` 112 | 113 | ## Further resources 114 | 115 | Take a look at [Parsing Command Line Arguments using the internal `ArgumentParser` inside of the `Swift Package Manager`](https://www.enekoalonso.com/articles/parsing-command-line-arguments-with-swift-package-manager-argument-parser) 116 | 117 | ## Author 118 | 119 | Apple Inc. and the Swift project authors 120 | 121 | ## License 122 | 123 | ArgumentParserKit is available under the Apache License v2.0 with Runtime Library Exception. See the LICENSE file for more info. 124 | -------------------------------------------------------------------------------- /Pods/Headers/Public/ArgumentParserKit/ArgumentParserKit-umbrella.h: -------------------------------------------------------------------------------- 1 | ../../../Target Support Files/ArgumentParserKit/ArgumentParserKit-umbrella.h -------------------------------------------------------------------------------- /Pods/Headers/Public/ArgumentParserKit/ArgumentParserKit.modulemap: -------------------------------------------------------------------------------- 1 | ../../../Target Support Files/ArgumentParserKit/ArgumentParserKit.modulemap -------------------------------------------------------------------------------- /Pods/Headers/Public/ScreenCapture/ScreenCapture-umbrella.h: -------------------------------------------------------------------------------- 1 | ../../../Target Support Files/ScreenCapture/ScreenCapture-umbrella.h -------------------------------------------------------------------------------- /Pods/Headers/Public/ScreenCapture/ScreenCapture.modulemap: -------------------------------------------------------------------------------- 1 | ../../../Target Support Files/ScreenCapture/ScreenCapture.modulemap -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ArgumentParserKit (1.0.0) 3 | - ScreenCapture (0.1.0) 4 | 5 | DEPENDENCIES: 6 | - ArgumentParserKit 7 | - ScreenCapture 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - ArgumentParserKit 12 | - ScreenCapture 13 | 14 | SPEC CHECKSUMS: 15 | ArgumentParserKit: 99ceb746098d9f478a6cb9b01b38ce9ecab3122d 16 | ScreenCapture: 832436bf58779a3faefb3c48222b641b80a7d851 17 | 18 | PODFILE CHECKSUM: 423eff66e097c4eb0fa56bb905ce9252e335b771 19 | 20 | COCOAPODS: 1.10.1 21 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 229969D3D207A021476BFA67CC8AC653 /* Condition.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71D80CF0079883E0FC4AC5A93B8E67B /* Condition.swift */; }; 11 | 37E33D1013AF4E10E0CE8BDD3DA20C1A /* Thread.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3197DE3B8DDC52195CF536200BFEDEB0 /* Thread.swift */; }; 12 | 4E57B002B73531F31B14D525BEE312E7 /* StringExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67FB565F97A770920D91F6D6BA26D76D /* StringExtensions.swift */; }; 13 | 61C7DCCA4AA0691CF33D5E4F1D1CCDD8 /* ByteString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74DB4E983A1C74A2D9F3D2AA440BA946 /* ByteString.swift */; }; 14 | 6FC6F3561823DE00F2027E4C7132B221 /* FileSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3243C430CFC2DC32DB660DE282544EE3 /* FileSystem.swift */; }; 15 | 8155EE12C7DFFF0B486A8C4AD787A38B /* URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = A119982DF0952E7C97B39842261F1A40 /* URL.swift */; }; 16 | 831A81EF9379AC87F150F1B881D9A2E9 /* ArgumentParserKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 771243F01982C4779CD1CF68A95704C9 /* ArgumentParserKit-dummy.m */; }; 17 | 9391C5F77390FF9BFC616C78888BF843 /* CollectionAlgorithms.swift in Sources */ = {isa = PBXBuildFile; fileRef = C94447564C9641C9DD367D36F7595C22 /* CollectionAlgorithms.swift */; }; 18 | 96DBACC260683E5EECCADFDF2CC4A7CE /* ArgumentParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECF6BA5E3D61482AFE3DC70BC388F0D0 /* ArgumentParser.swift */; }; 19 | 9D8F5FD727B32865EE80BA6ACDA12AF4 /* ScreenCapture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00828986C6867998A9D7244E8C1DBDA9 /* ScreenCapture.swift */; }; 20 | A43E72AE21250D8ACA3BE54706BB67A3 /* DictionaryExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFCDF39986B4E081D24D21DCD11131A /* DictionaryExtensions.swift */; }; 21 | AC8C4224C366FAD03EFFDC427D793373 /* ScreenCapture-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = BD7C2D9C960ADA8320C6FE926648537A /* ScreenCapture-dummy.m */; }; 22 | BE8E791706F107976678CAA1DE681FA6 /* ScreenCapture-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 59BFEECBFD836C7FD1A5704F21C4CBF6 /* ScreenCapture-umbrella.h */; settings = {ATTRIBUTES = (Project, ); }; }; 23 | C9C42C2F5FC2A300929192B51631E429 /* Pods-ocr-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E52F12A9CD9DA185DB6C7CFAF9971233 /* Pods-ocr-umbrella.h */; settings = {ATTRIBUTES = (Project, ); }; }; 24 | CA9117D8B1C22828347BFE8326E2F7D2 /* ScreenRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DDB6410E2B7BEA2254424EC160D3270 /* ScreenRecorder.swift */; }; 25 | CA935AABC34292332237F470749703F7 /* CollectionExtensions+only.swift in Sources */ = {isa = PBXBuildFile; fileRef = F084D8130594BBE768DE8511D29F71A0 /* CollectionExtensions+only.swift */; }; 26 | CBCAEC2ADF2EDE6C1AE3C0C62F6417B3 /* Pods-ocr-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 812D67335813B22DFC54237ACEB07CC8 /* Pods-ocr-dummy.m */; }; 27 | D0F21E38179D95E813036E38831EE9CB /* Path.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAAAF213AA58F9FEE2F8C2D0EDC3301 /* Path.swift */; }; 28 | DDB453CE0C134E1F5502A9E025D3AD1A /* CollectionExtensions+split.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1E451AE1693126E2928A80724F63F09 /* CollectionExtensions+split.swift */; }; 29 | E272EC25EE9D9CD59E5A45E11F1122E8 /* OutputByteStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69A900BBE3F1B41EE365FDBDA17AF4BA /* OutputByteStream.swift */; }; 30 | E4012065B7FFF36FA943AF8670B291EA /* ArgumentParserKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F6568A4209D586004BDB9F8CA3D60EEE /* ArgumentParserKit-umbrella.h */; settings = {ATTRIBUTES = (Project, ); }; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXContainerItemProxy section */ 34 | 4BAF0F99F6703FE996C98545A9FABE1A /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = ACC90F9D64F5B2E66D26F066189E7EF2; 39 | remoteInfo = ArgumentParserKit; 40 | }; 41 | 5D0F04D91CA229C3E17EF397634690E5 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 44 | proxyType = 1; 45 | remoteGlobalIDString = 706E9EACB7B8DD7922DB3D1391FEB188; 46 | remoteInfo = ScreenCapture; 47 | }; 48 | /* End PBXContainerItemProxy section */ 49 | 50 | /* Begin PBXFileReference section */ 51 | 00828986C6867998A9D7244E8C1DBDA9 /* ScreenCapture.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScreenCapture.swift; path = ScreenCapture/ScreenCapture.swift; sourceTree = ""; }; 52 | 07AAD2F442A712B014BCBFA30331B58D /* ScreenCapture.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ScreenCapture.debug.xcconfig; sourceTree = ""; }; 53 | 13B7350B4278542D6CD46B5A25481FCE /* Pods-ocr-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ocr-acknowledgements.plist"; sourceTree = ""; }; 54 | 16BE6F1F7C5E57F898C82E7A234BB378 /* Pods-ocr-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ocr-acknowledgements.markdown"; sourceTree = ""; }; 55 | 3197DE3B8DDC52195CF536200BFEDEB0 /* Thread.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Thread.swift; path = ArgumentParserKit/Classes/internal/Basic/Thread.swift; sourceTree = ""; }; 56 | 31F661B27BA2CA3D2D9B88B526E31869 /* libArgumentParserKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libArgumentParserKit.a; path = libArgumentParserKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 3243C430CFC2DC32DB660DE282544EE3 /* FileSystem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FileSystem.swift; path = ArgumentParserKit/Classes/internal/Basic/FileSystem.swift; sourceTree = ""; }; 58 | 351FF3E601C335A850B50DC190EB171C /* ScreenCapture.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = ScreenCapture.modulemap; sourceTree = ""; }; 59 | 3AC9A3198C5A4A77DFFD2CE596EF6358 /* ArgumentParserKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ArgumentParserKit.release.xcconfig; sourceTree = ""; }; 60 | 42317219338E654B3A697A80548DA1F2 /* ArgumentParserKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ArgumentParserKit-prefix.pch"; sourceTree = ""; }; 61 | 58D3223147FB9AA2A93601A3BE987B82 /* Pods-ocr.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ocr.debug.xcconfig"; sourceTree = ""; }; 62 | 59BFEECBFD836C7FD1A5704F21C4CBF6 /* ScreenCapture-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ScreenCapture-umbrella.h"; sourceTree = ""; }; 63 | 66CF8858112F5CC91F77CEA6FBBB3BF6 /* libScreenCapture.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libScreenCapture.a; path = libScreenCapture.a; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 67FB565F97A770920D91F6D6BA26D76D /* StringExtensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StringExtensions.swift; path = ArgumentParserKit/Classes/internal/Utility/StringExtensions.swift; sourceTree = ""; }; 65 | 69A900BBE3F1B41EE365FDBDA17AF4BA /* OutputByteStream.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OutputByteStream.swift; path = ArgumentParserKit/Classes/OutputByteStream.swift; sourceTree = ""; }; 66 | 7246410ADCEF4F430E62B4636A55C047 /* Pods-ocr.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ocr.release.xcconfig"; sourceTree = ""; }; 67 | 74DB4E983A1C74A2D9F3D2AA440BA946 /* ByteString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ByteString.swift; path = ArgumentParserKit/Classes/internal/Basic/ByteString.swift; sourceTree = ""; }; 68 | 766AC0797F54EAD4FE530833CDADBA93 /* ScreenCapture-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ScreenCapture-prefix.pch"; sourceTree = ""; }; 69 | 771243F01982C4779CD1CF68A95704C9 /* ArgumentParserKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ArgumentParserKit-dummy.m"; sourceTree = ""; }; 70 | 812D67335813B22DFC54237ACEB07CC8 /* Pods-ocr-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ocr-dummy.m"; sourceTree = ""; }; 71 | 9AFCDF39986B4E081D24D21DCD11131A /* DictionaryExtensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DictionaryExtensions.swift; path = ArgumentParserKit/Classes/internal/Basic/DictionaryExtensions.swift; sourceTree = ""; }; 72 | 9BAAAF213AA58F9FEE2F8C2D0EDC3301 /* Path.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Path.swift; path = ArgumentParserKit/Classes/internal/Basic/Path.swift; sourceTree = ""; }; 73 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 74 | 9DDB6410E2B7BEA2254424EC160D3270 /* ScreenRecorder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScreenRecorder.swift; path = ScreenCapture/ScreenRecorder.swift; sourceTree = ""; }; 75 | A119982DF0952E7C97B39842261F1A40 /* URL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URL.swift; path = ArgumentParserKit/Classes/internal/Utility/URL.swift; sourceTree = ""; }; 76 | A71D80CF0079883E0FC4AC5A93B8E67B /* Condition.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Condition.swift; path = ArgumentParserKit/Classes/internal/Basic/Condition.swift; sourceTree = ""; }; 77 | B1E451AE1693126E2928A80724F63F09 /* CollectionExtensions+split.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CollectionExtensions+split.swift"; path = "ArgumentParserKit/Classes/internal/Utility/CollectionExtensions+split.swift"; sourceTree = ""; }; 78 | B3E2D93EBAD32F2BDAA7E34D81388F39 /* ScreenCapture.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ScreenCapture.release.xcconfig; sourceTree = ""; }; 79 | BC45A62DE7886B6399441BE773EA847E /* libPods-ocr.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-ocr.a"; path = "libPods-ocr.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | BD7C2D9C960ADA8320C6FE926648537A /* ScreenCapture-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ScreenCapture-dummy.m"; sourceTree = ""; }; 81 | C9233EDEE68EAFCD2BF2B4571904D2AE /* ArgumentParserKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ArgumentParserKit.debug.xcconfig; sourceTree = ""; }; 82 | C94447564C9641C9DD367D36F7595C22 /* CollectionAlgorithms.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CollectionAlgorithms.swift; path = ArgumentParserKit/Classes/internal/Basic/CollectionAlgorithms.swift; sourceTree = ""; }; 83 | D5264BACAFB00EB660DFC88A5A3601A0 /* ArgumentParserKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = ArgumentParserKit.modulemap; sourceTree = ""; }; 84 | DBE2324F7D5B3E8D4F60D036A165993A /* Pods-ocr.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-ocr.modulemap"; sourceTree = ""; }; 85 | E52F12A9CD9DA185DB6C7CFAF9971233 /* Pods-ocr-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-ocr-umbrella.h"; sourceTree = ""; }; 86 | ECF6BA5E3D61482AFE3DC70BC388F0D0 /* ArgumentParser.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ArgumentParser.swift; path = ArgumentParserKit/Classes/ArgumentParser.swift; sourceTree = ""; }; 87 | F084D8130594BBE768DE8511D29F71A0 /* CollectionExtensions+only.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CollectionExtensions+only.swift"; path = "ArgumentParserKit/Classes/internal/Basic/CollectionExtensions+only.swift"; sourceTree = ""; }; 88 | F6568A4209D586004BDB9F8CA3D60EEE /* ArgumentParserKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ArgumentParserKit-umbrella.h"; sourceTree = ""; }; 89 | /* End PBXFileReference section */ 90 | 91 | /* Begin PBXFrameworksBuildPhase section */ 92 | 0C27BCF0932A708F990C00476A493AD9 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | 1310DBD53F546097A0E57788A1817DEB /* Frameworks */ = { 100 | isa = PBXFrameworksBuildPhase; 101 | buildActionMask = 2147483647; 102 | files = ( 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | B50C96DE33C530F719E375B5A42D2762 /* Frameworks */ = { 107 | isa = PBXFrameworksBuildPhase; 108 | buildActionMask = 2147483647; 109 | files = ( 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | /* End PBXFrameworksBuildPhase section */ 114 | 115 | /* Begin PBXGroup section */ 116 | 1751AFA4030B30DC712109B7CB89A20A /* ScreenCapture */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 00828986C6867998A9D7244E8C1DBDA9 /* ScreenCapture.swift */, 120 | 9DDB6410E2B7BEA2254424EC160D3270 /* ScreenRecorder.swift */, 121 | D7752515C051AC4219203DEFCA96B2D4 /* Support Files */, 122 | ); 123 | name = ScreenCapture; 124 | path = ScreenCapture; 125 | sourceTree = ""; 126 | }; 127 | 2FA0577DD40D557B9327133F8DB93796 /* Pods-ocr */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | DBE2324F7D5B3E8D4F60D036A165993A /* Pods-ocr.modulemap */, 131 | 16BE6F1F7C5E57F898C82E7A234BB378 /* Pods-ocr-acknowledgements.markdown */, 132 | 13B7350B4278542D6CD46B5A25481FCE /* Pods-ocr-acknowledgements.plist */, 133 | 812D67335813B22DFC54237ACEB07CC8 /* Pods-ocr-dummy.m */, 134 | E52F12A9CD9DA185DB6C7CFAF9971233 /* Pods-ocr-umbrella.h */, 135 | 58D3223147FB9AA2A93601A3BE987B82 /* Pods-ocr.debug.xcconfig */, 136 | 7246410ADCEF4F430E62B4636A55C047 /* Pods-ocr.release.xcconfig */, 137 | ); 138 | name = "Pods-ocr"; 139 | path = "Target Support Files/Pods-ocr"; 140 | sourceTree = ""; 141 | }; 142 | 90759FE72E86FF388EE4F93BD2CDBBF7 /* Products */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 31F661B27BA2CA3D2D9B88B526E31869 /* libArgumentParserKit.a */, 146 | BC45A62DE7886B6399441BE773EA847E /* libPods-ocr.a */, 147 | 66CF8858112F5CC91F77CEA6FBBB3BF6 /* libScreenCapture.a */, 148 | ); 149 | name = Products; 150 | sourceTree = ""; 151 | }; 152 | 9E3FF6B02D31FD7919D198A158056C15 /* Pods */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | ABB6F3AEFFEDFCEDBDAE0BD0CFC2CF45 /* ArgumentParserKit */, 156 | 1751AFA4030B30DC712109B7CB89A20A /* ScreenCapture */, 157 | ); 158 | name = Pods; 159 | sourceTree = ""; 160 | }; 161 | ABB6F3AEFFEDFCEDBDAE0BD0CFC2CF45 /* ArgumentParserKit */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | ECF6BA5E3D61482AFE3DC70BC388F0D0 /* ArgumentParser.swift */, 165 | 74DB4E983A1C74A2D9F3D2AA440BA946 /* ByteString.swift */, 166 | C94447564C9641C9DD367D36F7595C22 /* CollectionAlgorithms.swift */, 167 | F084D8130594BBE768DE8511D29F71A0 /* CollectionExtensions+only.swift */, 168 | B1E451AE1693126E2928A80724F63F09 /* CollectionExtensions+split.swift */, 169 | A71D80CF0079883E0FC4AC5A93B8E67B /* Condition.swift */, 170 | 9AFCDF39986B4E081D24D21DCD11131A /* DictionaryExtensions.swift */, 171 | 3243C430CFC2DC32DB660DE282544EE3 /* FileSystem.swift */, 172 | 69A900BBE3F1B41EE365FDBDA17AF4BA /* OutputByteStream.swift */, 173 | 9BAAAF213AA58F9FEE2F8C2D0EDC3301 /* Path.swift */, 174 | 67FB565F97A770920D91F6D6BA26D76D /* StringExtensions.swift */, 175 | 3197DE3B8DDC52195CF536200BFEDEB0 /* Thread.swift */, 176 | A119982DF0952E7C97B39842261F1A40 /* URL.swift */, 177 | C0C2158C61D1B52F122B5256904257AF /* Support Files */, 178 | ); 179 | name = ArgumentParserKit; 180 | path = ArgumentParserKit; 181 | sourceTree = ""; 182 | }; 183 | B7F27A24D29A0A1B32792968F5774D2F /* Targets Support Files */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 2FA0577DD40D557B9327133F8DB93796 /* Pods-ocr */, 187 | ); 188 | name = "Targets Support Files"; 189 | sourceTree = ""; 190 | }; 191 | C0C2158C61D1B52F122B5256904257AF /* Support Files */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | D5264BACAFB00EB660DFC88A5A3601A0 /* ArgumentParserKit.modulemap */, 195 | 771243F01982C4779CD1CF68A95704C9 /* ArgumentParserKit-dummy.m */, 196 | 42317219338E654B3A697A80548DA1F2 /* ArgumentParserKit-prefix.pch */, 197 | F6568A4209D586004BDB9F8CA3D60EEE /* ArgumentParserKit-umbrella.h */, 198 | C9233EDEE68EAFCD2BF2B4571904D2AE /* ArgumentParserKit.debug.xcconfig */, 199 | 3AC9A3198C5A4A77DFFD2CE596EF6358 /* ArgumentParserKit.release.xcconfig */, 200 | ); 201 | name = "Support Files"; 202 | path = "../Target Support Files/ArgumentParserKit"; 203 | sourceTree = ""; 204 | }; 205 | CF1408CF629C7361332E53B88F7BD30C = { 206 | isa = PBXGroup; 207 | children = ( 208 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, 209 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */, 210 | 9E3FF6B02D31FD7919D198A158056C15 /* Pods */, 211 | 90759FE72E86FF388EE4F93BD2CDBBF7 /* Products */, 212 | B7F27A24D29A0A1B32792968F5774D2F /* Targets Support Files */, 213 | ); 214 | sourceTree = ""; 215 | }; 216 | D7752515C051AC4219203DEFCA96B2D4 /* Support Files */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 351FF3E601C335A850B50DC190EB171C /* ScreenCapture.modulemap */, 220 | BD7C2D9C960ADA8320C6FE926648537A /* ScreenCapture-dummy.m */, 221 | 766AC0797F54EAD4FE530833CDADBA93 /* ScreenCapture-prefix.pch */, 222 | 59BFEECBFD836C7FD1A5704F21C4CBF6 /* ScreenCapture-umbrella.h */, 223 | 07AAD2F442A712B014BCBFA30331B58D /* ScreenCapture.debug.xcconfig */, 224 | B3E2D93EBAD32F2BDAA7E34D81388F39 /* ScreenCapture.release.xcconfig */, 225 | ); 226 | name = "Support Files"; 227 | path = "../Target Support Files/ScreenCapture"; 228 | sourceTree = ""; 229 | }; 230 | D89477F20FB1DE18A04690586D7808C4 /* Frameworks */ = { 231 | isa = PBXGroup; 232 | children = ( 233 | ); 234 | name = Frameworks; 235 | sourceTree = ""; 236 | }; 237 | /* End PBXGroup section */ 238 | 239 | /* Begin PBXHeadersBuildPhase section */ 240 | 200A3C60B1CB7603BA3E91E3633E46AE /* Headers */ = { 241 | isa = PBXHeadersBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | C9C42C2F5FC2A300929192B51631E429 /* Pods-ocr-umbrella.h in Headers */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | 6441C2E372CDFDFB17EB09D776AA09B1 /* Headers */ = { 249 | isa = PBXHeadersBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | BE8E791706F107976678CAA1DE681FA6 /* ScreenCapture-umbrella.h in Headers */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | EEA68A5A5809C3B6AEC1BDE2821D9EFC /* Headers */ = { 257 | isa = PBXHeadersBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | E4012065B7FFF36FA943AF8670B291EA /* ArgumentParserKit-umbrella.h in Headers */, 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | }; 264 | /* End PBXHeadersBuildPhase section */ 265 | 266 | /* Begin PBXNativeTarget section */ 267 | 706E9EACB7B8DD7922DB3D1391FEB188 /* ScreenCapture */ = { 268 | isa = PBXNativeTarget; 269 | buildConfigurationList = 52AAA7F0A542CC9DAD2DFC0C313AB43E /* Build configuration list for PBXNativeTarget "ScreenCapture" */; 270 | buildPhases = ( 271 | 6441C2E372CDFDFB17EB09D776AA09B1 /* Headers */, 272 | 90BD4B496C3FA228FD56CB7A9F962F71 /* Sources */, 273 | B50C96DE33C530F719E375B5A42D2762 /* Frameworks */, 274 | 8F089EF798AE74AFC971D1C0678203EB /* Copy generated compatibility header */, 275 | ); 276 | buildRules = ( 277 | ); 278 | dependencies = ( 279 | ); 280 | name = ScreenCapture; 281 | productName = ScreenCapture; 282 | productReference = 66CF8858112F5CC91F77CEA6FBBB3BF6 /* libScreenCapture.a */; 283 | productType = "com.apple.product-type.library.static"; 284 | }; 285 | ACC90F9D64F5B2E66D26F066189E7EF2 /* ArgumentParserKit */ = { 286 | isa = PBXNativeTarget; 287 | buildConfigurationList = F44E9B3DFA5910603330A4192987D524 /* Build configuration list for PBXNativeTarget "ArgumentParserKit" */; 288 | buildPhases = ( 289 | EEA68A5A5809C3B6AEC1BDE2821D9EFC /* Headers */, 290 | CC1A448947B54017CDD978852C464E6E /* Sources */, 291 | 0C27BCF0932A708F990C00476A493AD9 /* Frameworks */, 292 | 3BA302D618C8B10C71A97B0AF102B4CF /* Copy generated compatibility header */, 293 | ); 294 | buildRules = ( 295 | ); 296 | dependencies = ( 297 | ); 298 | name = ArgumentParserKit; 299 | productName = ArgumentParserKit; 300 | productReference = 31F661B27BA2CA3D2D9B88B526E31869 /* libArgumentParserKit.a */; 301 | productType = "com.apple.product-type.library.static"; 302 | }; 303 | D43AA22BB17EE4E803FEB373D0EB2023 /* Pods-ocr */ = { 304 | isa = PBXNativeTarget; 305 | buildConfigurationList = 2C3510E27E6B7BFAB2A9EBE7D8DA36A5 /* Build configuration list for PBXNativeTarget "Pods-ocr" */; 306 | buildPhases = ( 307 | 200A3C60B1CB7603BA3E91E3633E46AE /* Headers */, 308 | E35B2DD054B8B433F1F35BC45A0BA040 /* Sources */, 309 | 1310DBD53F546097A0E57788A1817DEB /* Frameworks */, 310 | ); 311 | buildRules = ( 312 | ); 313 | dependencies = ( 314 | B2CD6C43E8D8C7D46564DA8D2F83B1DC /* PBXTargetDependency */, 315 | BE4F5CE17D42829541FB9821D29FECE0 /* PBXTargetDependency */, 316 | ); 317 | name = "Pods-ocr"; 318 | productName = "Pods-ocr"; 319 | productReference = BC45A62DE7886B6399441BE773EA847E /* libPods-ocr.a */; 320 | productType = "com.apple.product-type.library.static"; 321 | }; 322 | /* End PBXNativeTarget section */ 323 | 324 | /* Begin PBXProject section */ 325 | BFDFE7DC352907FC980B868725387E98 /* Project object */ = { 326 | isa = PBXProject; 327 | attributes = { 328 | LastSwiftUpdateCheck = 1100; 329 | LastUpgradeCheck = 1100; 330 | }; 331 | buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; 332 | compatibilityVersion = "Xcode 9.3"; 333 | developmentRegion = en; 334 | hasScannedForEncodings = 0; 335 | knownRegions = ( 336 | en, 337 | Base, 338 | ); 339 | mainGroup = CF1408CF629C7361332E53B88F7BD30C; 340 | productRefGroup = 90759FE72E86FF388EE4F93BD2CDBBF7 /* Products */; 341 | projectDirPath = ""; 342 | projectRoot = ""; 343 | targets = ( 344 | ACC90F9D64F5B2E66D26F066189E7EF2 /* ArgumentParserKit */, 345 | D43AA22BB17EE4E803FEB373D0EB2023 /* Pods-ocr */, 346 | 706E9EACB7B8DD7922DB3D1391FEB188 /* ScreenCapture */, 347 | ); 348 | }; 349 | /* End PBXProject section */ 350 | 351 | /* Begin PBXShellScriptBuildPhase section */ 352 | 3BA302D618C8B10C71A97B0AF102B4CF /* Copy generated compatibility header */ = { 353 | isa = PBXShellScriptBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | ); 357 | inputFileListPaths = ( 358 | ); 359 | inputPaths = ( 360 | "${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h", 361 | "${PODS_ROOT}/Headers/Public/ArgumentParserKit/ArgumentParserKit.modulemap", 362 | "${PODS_ROOT}/Headers/Public/ArgumentParserKit/ArgumentParserKit-umbrella.h", 363 | ); 364 | name = "Copy generated compatibility header"; 365 | outputFileListPaths = ( 366 | ); 367 | outputPaths = ( 368 | "${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap", 369 | "${BUILT_PRODUCTS_DIR}/ArgumentParserKit-umbrella.h", 370 | "${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h", 371 | ); 372 | runOnlyForDeploymentPostprocessing = 0; 373 | shellPath = /bin/sh; 374 | shellScript = "COMPATIBILITY_HEADER_PATH=\"${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h\"\nMODULE_MAP_PATH=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap\"\n\nditto \"${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h\" \"${COMPATIBILITY_HEADER_PATH}\"\nditto \"${PODS_ROOT}/Headers/Public/ArgumentParserKit/ArgumentParserKit.modulemap\" \"${MODULE_MAP_PATH}\"\nditto \"${PODS_ROOT}/Headers/Public/ArgumentParserKit/ArgumentParserKit-umbrella.h\" \"${BUILT_PRODUCTS_DIR}\"\nprintf \"\\n\\nmodule ${PRODUCT_MODULE_NAME}.Swift {\\n header \\\"${COMPATIBILITY_HEADER_PATH}\\\"\\n requires objc\\n}\\n\" >> \"${MODULE_MAP_PATH}\"\n"; 375 | }; 376 | 8F089EF798AE74AFC971D1C0678203EB /* Copy generated compatibility header */ = { 377 | isa = PBXShellScriptBuildPhase; 378 | buildActionMask = 2147483647; 379 | files = ( 380 | ); 381 | inputFileListPaths = ( 382 | ); 383 | inputPaths = ( 384 | "${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h", 385 | "${PODS_ROOT}/Headers/Public/ScreenCapture/ScreenCapture.modulemap", 386 | "${PODS_ROOT}/Headers/Public/ScreenCapture/ScreenCapture-umbrella.h", 387 | ); 388 | name = "Copy generated compatibility header"; 389 | outputFileListPaths = ( 390 | ); 391 | outputPaths = ( 392 | "${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap", 393 | "${BUILT_PRODUCTS_DIR}/ScreenCapture-umbrella.h", 394 | "${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h", 395 | ); 396 | runOnlyForDeploymentPostprocessing = 0; 397 | shellPath = /bin/sh; 398 | shellScript = "COMPATIBILITY_HEADER_PATH=\"${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h\"\nMODULE_MAP_PATH=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap\"\n\nditto \"${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h\" \"${COMPATIBILITY_HEADER_PATH}\"\nditto \"${PODS_ROOT}/Headers/Public/ScreenCapture/ScreenCapture.modulemap\" \"${MODULE_MAP_PATH}\"\nditto \"${PODS_ROOT}/Headers/Public/ScreenCapture/ScreenCapture-umbrella.h\" \"${BUILT_PRODUCTS_DIR}\"\nprintf \"\\n\\nmodule ${PRODUCT_MODULE_NAME}.Swift {\\n header \\\"${COMPATIBILITY_HEADER_PATH}\\\"\\n requires objc\\n}\\n\" >> \"${MODULE_MAP_PATH}\"\n"; 399 | }; 400 | /* End PBXShellScriptBuildPhase section */ 401 | 402 | /* Begin PBXSourcesBuildPhase section */ 403 | 90BD4B496C3FA228FD56CB7A9F962F71 /* Sources */ = { 404 | isa = PBXSourcesBuildPhase; 405 | buildActionMask = 2147483647; 406 | files = ( 407 | AC8C4224C366FAD03EFFDC427D793373 /* ScreenCapture-dummy.m in Sources */, 408 | 9D8F5FD727B32865EE80BA6ACDA12AF4 /* ScreenCapture.swift in Sources */, 409 | CA9117D8B1C22828347BFE8326E2F7D2 /* ScreenRecorder.swift in Sources */, 410 | ); 411 | runOnlyForDeploymentPostprocessing = 0; 412 | }; 413 | CC1A448947B54017CDD978852C464E6E /* Sources */ = { 414 | isa = PBXSourcesBuildPhase; 415 | buildActionMask = 2147483647; 416 | files = ( 417 | 96DBACC260683E5EECCADFDF2CC4A7CE /* ArgumentParser.swift in Sources */, 418 | 831A81EF9379AC87F150F1B881D9A2E9 /* ArgumentParserKit-dummy.m in Sources */, 419 | 61C7DCCA4AA0691CF33D5E4F1D1CCDD8 /* ByteString.swift in Sources */, 420 | 9391C5F77390FF9BFC616C78888BF843 /* CollectionAlgorithms.swift in Sources */, 421 | CA935AABC34292332237F470749703F7 /* CollectionExtensions+only.swift in Sources */, 422 | DDB453CE0C134E1F5502A9E025D3AD1A /* CollectionExtensions+split.swift in Sources */, 423 | 229969D3D207A021476BFA67CC8AC653 /* Condition.swift in Sources */, 424 | A43E72AE21250D8ACA3BE54706BB67A3 /* DictionaryExtensions.swift in Sources */, 425 | 6FC6F3561823DE00F2027E4C7132B221 /* FileSystem.swift in Sources */, 426 | E272EC25EE9D9CD59E5A45E11F1122E8 /* OutputByteStream.swift in Sources */, 427 | D0F21E38179D95E813036E38831EE9CB /* Path.swift in Sources */, 428 | 4E57B002B73531F31B14D525BEE312E7 /* StringExtensions.swift in Sources */, 429 | 37E33D1013AF4E10E0CE8BDD3DA20C1A /* Thread.swift in Sources */, 430 | 8155EE12C7DFFF0B486A8C4AD787A38B /* URL.swift in Sources */, 431 | ); 432 | runOnlyForDeploymentPostprocessing = 0; 433 | }; 434 | E35B2DD054B8B433F1F35BC45A0BA040 /* Sources */ = { 435 | isa = PBXSourcesBuildPhase; 436 | buildActionMask = 2147483647; 437 | files = ( 438 | CBCAEC2ADF2EDE6C1AE3C0C62F6417B3 /* Pods-ocr-dummy.m in Sources */, 439 | ); 440 | runOnlyForDeploymentPostprocessing = 0; 441 | }; 442 | /* End PBXSourcesBuildPhase section */ 443 | 444 | /* Begin PBXTargetDependency section */ 445 | B2CD6C43E8D8C7D46564DA8D2F83B1DC /* PBXTargetDependency */ = { 446 | isa = PBXTargetDependency; 447 | name = ArgumentParserKit; 448 | target = ACC90F9D64F5B2E66D26F066189E7EF2 /* ArgumentParserKit */; 449 | targetProxy = 4BAF0F99F6703FE996C98545A9FABE1A /* PBXContainerItemProxy */; 450 | }; 451 | BE4F5CE17D42829541FB9821D29FECE0 /* PBXTargetDependency */ = { 452 | isa = PBXTargetDependency; 453 | name = ScreenCapture; 454 | target = 706E9EACB7B8DD7922DB3D1391FEB188 /* ScreenCapture */; 455 | targetProxy = 5D0F04D91CA229C3E17EF397634690E5 /* PBXContainerItemProxy */; 456 | }; 457 | /* End PBXTargetDependency section */ 458 | 459 | /* Begin XCBuildConfiguration section */ 460 | 0AE172D8F2A4843BFACAD21A0ED26541 /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | ALWAYS_SEARCH_USER_PATHS = NO; 464 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 465 | CLANG_ANALYZER_NONNULL = YES; 466 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 467 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 468 | CLANG_CXX_LIBRARY = "libc++"; 469 | CLANG_ENABLE_MODULES = YES; 470 | CLANG_ENABLE_OBJC_ARC = YES; 471 | CLANG_ENABLE_OBJC_WEAK = YES; 472 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 473 | CLANG_WARN_BOOL_CONVERSION = YES; 474 | CLANG_WARN_COMMA = YES; 475 | CLANG_WARN_CONSTANT_CONVERSION = YES; 476 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 477 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 478 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 479 | CLANG_WARN_EMPTY_BODY = YES; 480 | CLANG_WARN_ENUM_CONVERSION = YES; 481 | CLANG_WARN_INFINITE_RECURSION = YES; 482 | CLANG_WARN_INT_CONVERSION = YES; 483 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 484 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 485 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 486 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 487 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 488 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 489 | CLANG_WARN_STRICT_PROTOTYPES = YES; 490 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 491 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 492 | CLANG_WARN_UNREACHABLE_CODE = YES; 493 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 494 | COPY_PHASE_STRIP = NO; 495 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 496 | ENABLE_NS_ASSERTIONS = NO; 497 | ENABLE_STRICT_OBJC_MSGSEND = YES; 498 | GCC_C_LANGUAGE_STANDARD = gnu11; 499 | GCC_NO_COMMON_BLOCKS = YES; 500 | GCC_PREPROCESSOR_DEFINITIONS = ( 501 | "POD_CONFIGURATION_RELEASE=1", 502 | "$(inherited)", 503 | ); 504 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 505 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 506 | GCC_WARN_UNDECLARED_SELECTOR = YES; 507 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 508 | GCC_WARN_UNUSED_FUNCTION = YES; 509 | GCC_WARN_UNUSED_VARIABLE = YES; 510 | MACOSX_DEPLOYMENT_TARGET = 10.15; 511 | MTL_ENABLE_DEBUG_INFO = NO; 512 | MTL_FAST_MATH = YES; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | STRIP_INSTALLED_PRODUCT = NO; 515 | SWIFT_COMPILATION_MODE = wholemodule; 516 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 517 | SWIFT_VERSION = 5.0; 518 | SYMROOT = "${SRCROOT}/../build"; 519 | }; 520 | name = Release; 521 | }; 522 | 21A83192748C69EE508AD2F68E08D1E5 /* Release */ = { 523 | isa = XCBuildConfiguration; 524 | baseConfigurationReference = 3AC9A3198C5A4A77DFFD2CE596EF6358 /* ArgumentParserKit.release.xcconfig */; 525 | buildSettings = { 526 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 527 | CLANG_ENABLE_OBJC_WEAK = NO; 528 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 529 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 530 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 531 | EXECUTABLE_PREFIX = lib; 532 | GCC_PREFIX_HEADER = "Target Support Files/ArgumentParserKit/ArgumentParserKit-prefix.pch"; 533 | MACOSX_DEPLOYMENT_TARGET = 10.10; 534 | MODULEMAP_FILE = Headers/Public/ArgumentParserKit/ArgumentParserKit.modulemap; 535 | OTHER_LDFLAGS = ""; 536 | OTHER_LIBTOOLFLAGS = ""; 537 | PRIVATE_HEADERS_FOLDER_PATH = ""; 538 | PRODUCT_MODULE_NAME = ArgumentParserKit; 539 | PRODUCT_NAME = ArgumentParserKit; 540 | PUBLIC_HEADERS_FOLDER_PATH = ""; 541 | SDKROOT = macosx; 542 | SKIP_INSTALL = YES; 543 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 544 | SWIFT_VERSION = 4.0; 545 | }; 546 | name = Release; 547 | }; 548 | 808E544862838153672EA12FCC127D9A /* Debug */ = { 549 | isa = XCBuildConfiguration; 550 | buildSettings = { 551 | ALWAYS_SEARCH_USER_PATHS = NO; 552 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 553 | CLANG_ANALYZER_NONNULL = YES; 554 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 555 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 556 | CLANG_CXX_LIBRARY = "libc++"; 557 | CLANG_ENABLE_MODULES = YES; 558 | CLANG_ENABLE_OBJC_ARC = YES; 559 | CLANG_ENABLE_OBJC_WEAK = YES; 560 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 561 | CLANG_WARN_BOOL_CONVERSION = YES; 562 | CLANG_WARN_COMMA = YES; 563 | CLANG_WARN_CONSTANT_CONVERSION = YES; 564 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 565 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 566 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 567 | CLANG_WARN_EMPTY_BODY = YES; 568 | CLANG_WARN_ENUM_CONVERSION = YES; 569 | CLANG_WARN_INFINITE_RECURSION = YES; 570 | CLANG_WARN_INT_CONVERSION = YES; 571 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 572 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 573 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 574 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 575 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 576 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 577 | CLANG_WARN_STRICT_PROTOTYPES = YES; 578 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 579 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 580 | CLANG_WARN_UNREACHABLE_CODE = YES; 581 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 582 | COPY_PHASE_STRIP = NO; 583 | DEBUG_INFORMATION_FORMAT = dwarf; 584 | ENABLE_STRICT_OBJC_MSGSEND = YES; 585 | ENABLE_TESTABILITY = YES; 586 | GCC_C_LANGUAGE_STANDARD = gnu11; 587 | GCC_DYNAMIC_NO_PIC = NO; 588 | GCC_NO_COMMON_BLOCKS = YES; 589 | GCC_OPTIMIZATION_LEVEL = 0; 590 | GCC_PREPROCESSOR_DEFINITIONS = ( 591 | "POD_CONFIGURATION_DEBUG=1", 592 | "DEBUG=1", 593 | "$(inherited)", 594 | ); 595 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 596 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 597 | GCC_WARN_UNDECLARED_SELECTOR = YES; 598 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 599 | GCC_WARN_UNUSED_FUNCTION = YES; 600 | GCC_WARN_UNUSED_VARIABLE = YES; 601 | MACOSX_DEPLOYMENT_TARGET = 10.15; 602 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 603 | MTL_FAST_MATH = YES; 604 | ONLY_ACTIVE_ARCH = YES; 605 | PRODUCT_NAME = "$(TARGET_NAME)"; 606 | STRIP_INSTALLED_PRODUCT = NO; 607 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 608 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 609 | SWIFT_VERSION = 5.0; 610 | SYMROOT = "${SRCROOT}/../build"; 611 | }; 612 | name = Debug; 613 | }; 614 | 9E1637F72489FD0DBA1DDE9DEC8D52E3 /* Debug */ = { 615 | isa = XCBuildConfiguration; 616 | baseConfigurationReference = 07AAD2F442A712B014BCBFA30331B58D /* ScreenCapture.debug.xcconfig */; 617 | buildSettings = { 618 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 619 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 620 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 621 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 622 | EXECUTABLE_PREFIX = lib; 623 | GCC_PREFIX_HEADER = "Target Support Files/ScreenCapture/ScreenCapture-prefix.pch"; 624 | MACOSX_DEPLOYMENT_TARGET = 10.9; 625 | MODULEMAP_FILE = Headers/Public/ScreenCapture/ScreenCapture.modulemap; 626 | OTHER_LDFLAGS = ""; 627 | OTHER_LIBTOOLFLAGS = ""; 628 | PRIVATE_HEADERS_FOLDER_PATH = ""; 629 | PRODUCT_MODULE_NAME = ScreenCapture; 630 | PRODUCT_NAME = ScreenCapture; 631 | PUBLIC_HEADERS_FOLDER_PATH = ""; 632 | SDKROOT = macosx; 633 | SKIP_INSTALL = YES; 634 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 635 | SWIFT_VERSION = 5.0; 636 | }; 637 | name = Debug; 638 | }; 639 | B4CFAC4DF16D3CC899A6D898F3D8335A /* Release */ = { 640 | isa = XCBuildConfiguration; 641 | baseConfigurationReference = B3E2D93EBAD32F2BDAA7E34D81388F39 /* ScreenCapture.release.xcconfig */; 642 | buildSettings = { 643 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 644 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 645 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 646 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 647 | EXECUTABLE_PREFIX = lib; 648 | GCC_PREFIX_HEADER = "Target Support Files/ScreenCapture/ScreenCapture-prefix.pch"; 649 | MACOSX_DEPLOYMENT_TARGET = 10.9; 650 | MODULEMAP_FILE = Headers/Public/ScreenCapture/ScreenCapture.modulemap; 651 | OTHER_LDFLAGS = ""; 652 | OTHER_LIBTOOLFLAGS = ""; 653 | PRIVATE_HEADERS_FOLDER_PATH = ""; 654 | PRODUCT_MODULE_NAME = ScreenCapture; 655 | PRODUCT_NAME = ScreenCapture; 656 | PUBLIC_HEADERS_FOLDER_PATH = ""; 657 | SDKROOT = macosx; 658 | SKIP_INSTALL = YES; 659 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 660 | SWIFT_VERSION = 5.0; 661 | }; 662 | name = Release; 663 | }; 664 | B6DD05C4387BA6B28C5CA968BB61634A /* Debug */ = { 665 | isa = XCBuildConfiguration; 666 | baseConfigurationReference = C9233EDEE68EAFCD2BF2B4571904D2AE /* ArgumentParserKit.debug.xcconfig */; 667 | buildSettings = { 668 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 669 | CLANG_ENABLE_OBJC_WEAK = NO; 670 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 671 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 672 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 673 | EXECUTABLE_PREFIX = lib; 674 | GCC_PREFIX_HEADER = "Target Support Files/ArgumentParserKit/ArgumentParserKit-prefix.pch"; 675 | MACOSX_DEPLOYMENT_TARGET = 10.10; 676 | MODULEMAP_FILE = Headers/Public/ArgumentParserKit/ArgumentParserKit.modulemap; 677 | OTHER_LDFLAGS = ""; 678 | OTHER_LIBTOOLFLAGS = ""; 679 | PRIVATE_HEADERS_FOLDER_PATH = ""; 680 | PRODUCT_MODULE_NAME = ArgumentParserKit; 681 | PRODUCT_NAME = ArgumentParserKit; 682 | PUBLIC_HEADERS_FOLDER_PATH = ""; 683 | SDKROOT = macosx; 684 | SKIP_INSTALL = YES; 685 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 686 | SWIFT_VERSION = 4.0; 687 | }; 688 | name = Debug; 689 | }; 690 | DC0733EA7D93C544871366574063ED5B /* Debug */ = { 691 | isa = XCBuildConfiguration; 692 | baseConfigurationReference = 58D3223147FB9AA2A93601A3BE987B82 /* Pods-ocr.debug.xcconfig */; 693 | buildSettings = { 694 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 695 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 696 | CLANG_ENABLE_OBJC_WEAK = NO; 697 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 698 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 699 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 700 | EXECUTABLE_PREFIX = lib; 701 | MACH_O_TYPE = staticlib; 702 | MACOSX_DEPLOYMENT_TARGET = 10.15; 703 | MODULEMAP_FILE = "Target Support Files/Pods-ocr/Pods-ocr.modulemap"; 704 | OTHER_LDFLAGS = ""; 705 | OTHER_LIBTOOLFLAGS = ""; 706 | PODS_ROOT = "$(SRCROOT)"; 707 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 708 | SDKROOT = macosx; 709 | SKIP_INSTALL = YES; 710 | }; 711 | name = Debug; 712 | }; 713 | E1E5B1C67ABC63F69A8C30E696E164A5 /* Release */ = { 714 | isa = XCBuildConfiguration; 715 | baseConfigurationReference = 7246410ADCEF4F430E62B4636A55C047 /* Pods-ocr.release.xcconfig */; 716 | buildSettings = { 717 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 718 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 719 | CLANG_ENABLE_OBJC_WEAK = NO; 720 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 721 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 722 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 723 | EXECUTABLE_PREFIX = lib; 724 | MACH_O_TYPE = staticlib; 725 | MACOSX_DEPLOYMENT_TARGET = 10.15; 726 | MODULEMAP_FILE = "Target Support Files/Pods-ocr/Pods-ocr.modulemap"; 727 | OTHER_LDFLAGS = ""; 728 | OTHER_LIBTOOLFLAGS = ""; 729 | PODS_ROOT = "$(SRCROOT)"; 730 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 731 | SDKROOT = macosx; 732 | SKIP_INSTALL = YES; 733 | }; 734 | name = Release; 735 | }; 736 | /* End XCBuildConfiguration section */ 737 | 738 | /* Begin XCConfigurationList section */ 739 | 2C3510E27E6B7BFAB2A9EBE7D8DA36A5 /* Build configuration list for PBXNativeTarget "Pods-ocr" */ = { 740 | isa = XCConfigurationList; 741 | buildConfigurations = ( 742 | DC0733EA7D93C544871366574063ED5B /* Debug */, 743 | E1E5B1C67ABC63F69A8C30E696E164A5 /* Release */, 744 | ); 745 | defaultConfigurationIsVisible = 0; 746 | defaultConfigurationName = Release; 747 | }; 748 | 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { 749 | isa = XCConfigurationList; 750 | buildConfigurations = ( 751 | 808E544862838153672EA12FCC127D9A /* Debug */, 752 | 0AE172D8F2A4843BFACAD21A0ED26541 /* Release */, 753 | ); 754 | defaultConfigurationIsVisible = 0; 755 | defaultConfigurationName = Release; 756 | }; 757 | 52AAA7F0A542CC9DAD2DFC0C313AB43E /* Build configuration list for PBXNativeTarget "ScreenCapture" */ = { 758 | isa = XCConfigurationList; 759 | buildConfigurations = ( 760 | 9E1637F72489FD0DBA1DDE9DEC8D52E3 /* Debug */, 761 | B4CFAC4DF16D3CC899A6D898F3D8335A /* Release */, 762 | ); 763 | defaultConfigurationIsVisible = 0; 764 | defaultConfigurationName = Release; 765 | }; 766 | F44E9B3DFA5910603330A4192987D524 /* Build configuration list for PBXNativeTarget "ArgumentParserKit" */ = { 767 | isa = XCConfigurationList; 768 | buildConfigurations = ( 769 | B6DD05C4387BA6B28C5CA968BB61634A /* Debug */, 770 | 21A83192748C69EE508AD2F68E08D1E5 /* Release */, 771 | ); 772 | defaultConfigurationIsVisible = 0; 773 | defaultConfigurationName = Release; 774 | }; 775 | /* End XCConfigurationList section */ 776 | }; 777 | rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; 778 | } 779 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ArgumentParserKit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/Pods-ocr.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/ScreenCapture.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ArgumentParserKit.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | Pods-ocr.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | ScreenCapture.xcscheme 22 | 23 | isShown 24 | 25 | orderHint 26 | 2 27 | 28 | 29 | SuppressBuildableAutocreation 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/ScreenCapture/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Jack P. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/ScreenCapture/README.md: -------------------------------------------------------------------------------- 1 | # ScreenCapture 2 | 3 | This framework makes capturing screenshots within OS X easy. 4 | 5 | To capture a region of the screen, it makes use of `NSTask` to call `/usr/sbin/screencapture`. 6 | 7 | ## Carthage 8 | 9 | `github "nirix/swift-screencapture"` 10 | 11 | ## How to use it 12 | 13 | An example application can be found in the `Example` directory. 14 | 15 | ### Screenshots 16 | 17 | ```swift 18 | import ScreenCapture 19 | 20 | // Capture part of the screen 21 | let regionUrl = ScreenCapture.captureRegion("/path/to/save/to.png") 22 | 23 | // Capture the entire screen 24 | let screenUrl = ScreenCapture.captureScreen("/path/to/save/to.png") 25 | ``` 26 | 27 | ### Record screen 28 | 29 | ```swift 30 | import ScreenCapture 31 | 32 | let recorder = ScreenCapture.recordScreen("/path/to/save/to.mp4") 33 | 34 | recorder.start() 35 | ... 36 | recorder.stop() 37 | 38 | let movieUrl = recorder.destination 39 | ``` 40 | 41 | ## License 42 | 43 | This framework and it's code is released under the MIT license. 44 | -------------------------------------------------------------------------------- /Pods/ScreenCapture/ScreenCapture/ScreenCapture.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScreenCapture.swift 3 | // ScreenCapture 4 | // 5 | // Created by Jack P. on 11/12/2015. 6 | // Copyright © 2015 Jack P. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // ------------------------------------------------------------------- 12 | // Allow passing of strings, just convert them to an NSURL. 13 | 14 | public func captureRegion(destination: String) -> NSURL { 15 | return captureRegion(destination: NSURL(fileURLWithPath: destination)) 16 | } 17 | 18 | public func captureScreen(destination: String) -> NSURL { 19 | return captureScreen(destination: NSURL(fileURLWithPath: destination)) 20 | } 21 | 22 | public func recordScreen(destination: String) -> ScreenRecorder { 23 | return recordScreen(destination: NSURL(fileURLWithPath: destination)) 24 | } 25 | 26 | // ------------------------------------------------------------------- 27 | 28 | public func captureRegion(destination: NSURL) -> NSURL { 29 | let destinationPath = destination.path! as String 30 | 31 | let task = Process() 32 | task.launchPath = "/usr/sbin/screencapture" 33 | task.arguments = ["-i", "-r", destinationPath] 34 | task.launch() 35 | task.waitUntilExit() 36 | 37 | return destination 38 | } 39 | 40 | public func captureScreen(destination: NSURL) -> NSURL { 41 | let img = CGDisplayCreateImage(CGMainDisplayID()) 42 | let dest = CGImageDestinationCreateWithURL(destination, kUTTypePNG, 1, nil) 43 | CGImageDestinationAddImage(dest!, img!, nil) 44 | CGImageDestinationFinalize(dest!) 45 | 46 | return destination 47 | } 48 | 49 | public func recordScreen(destination: NSURL) -> ScreenRecorder { 50 | return ScreenRecorder(destination: destination) 51 | } 52 | -------------------------------------------------------------------------------- /Pods/ScreenCapture/ScreenCapture/ScreenRecorder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScreenRecorder.swift 3 | // ScreenCapture 4 | // 5 | // Created by Jack P. on 11/12/2015. 6 | // Copyright © 2015 Jack P. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import AVFoundation 11 | 12 | public class ScreenRecorder: NSObject, AVCaptureFileOutputRecordingDelegate { 13 | public func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) { 14 | 15 | } 16 | 17 | var destinationUrl: NSURL 18 | var session: AVCaptureSession? 19 | var movieFileOutput: AVCaptureMovieFileOutput? 20 | 21 | public var destination: NSURL { 22 | get { 23 | return self.destinationUrl 24 | } 25 | } 26 | 27 | public init(destination: NSURL) { 28 | self.destinationUrl = destination 29 | 30 | self.session = AVCaptureSession() 31 | self.session?.sessionPreset = AVCaptureSession.Preset.high 32 | 33 | let displayId: CGDirectDisplayID = CGDirectDisplayID(CGMainDisplayID()) 34 | 35 | guard let input: AVCaptureScreenInput = AVCaptureScreenInput(displayID: displayId) else { 36 | return 37 | } 38 | 39 | // if (input != false) { 40 | // self.session = nil 41 | // return 42 | // } 43 | 44 | if ((self.session?.canAddInput(input)) != nil) { 45 | self.session?.addInput(input) 46 | } 47 | 48 | self.movieFileOutput = AVCaptureMovieFileOutput() 49 | 50 | 51 | if ((self.session?.canAddOutput(self.movieFileOutput!)) != nil) { 52 | self.session?.addOutput(self.movieFileOutput!) 53 | } 54 | } 55 | 56 | public func start() { 57 | self.session?.startRunning() 58 | self.movieFileOutput?.startRecording(to: self.destinationUrl as URL, recordingDelegate: self) 59 | } 60 | 61 | public func stop() { 62 | self.movieFileOutput?.stopRecording() 63 | } 64 | 65 | public func captureOutput( 66 | captureOutput: AVCaptureFileOutput!, 67 | didFinishRecordingToOutputFileAtURL outputFileURL: NSURL!, 68 | fromConnections connections: [AnyObject]!, 69 | error: NSError! 70 | ) { 71 | self.session?.stopRunning() 72 | self.session = nil 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ArgumentParserKit/ArgumentParserKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ArgumentParserKit : NSObject 3 | @end 4 | @implementation PodsDummy_ArgumentParserKit 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ArgumentParserKit/ArgumentParserKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ArgumentParserKit/ArgumentParserKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double ArgumentParserKitVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ArgumentParserKitVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ArgumentParserKit/ArgumentParserKit.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/ArgumentParserKit 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ArgumentParserKit/ArgumentParserKit.modulemap: -------------------------------------------------------------------------------- 1 | module ArgumentParserKit { 2 | umbrella header "ArgumentParserKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ArgumentParserKit/ArgumentParserKit.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/ArgumentParserKit 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ocr/Pods-ocr-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## ArgumentParserKit 5 | 6 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 7 | 8 | Apache License 9 | Version 2.0, January 2004 10 | http://www.apache.org/licenses/ 11 | 12 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 13 | 14 | 1. Definitions. 15 | 16 | "License" shall mean the terms and conditions for use, reproduction, 17 | and distribution as defined by Sections 1 through 9 of this document. 18 | 19 | "Licensor" shall mean the copyright owner or entity authorized by 20 | the copyright owner that is granting the License. 21 | 22 | "Legal Entity" shall mean the union of the acting entity and all 23 | other entities that control, are controlled by, or are under common 24 | control with that entity. For the purposes of this definition, 25 | "control" means (i) the power, direct or indirect, to cause the 26 | direction or management of such entity, whether by contract or 27 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 28 | outstanding shares, or (iii) beneficial ownership of such entity. 29 | 30 | "You" (or "Your") shall mean an individual or Legal Entity 31 | exercising permissions granted by this License. 32 | 33 | "Source" form shall mean the preferred form for making modifications, 34 | including but not limited to software source code, documentation 35 | source, and configuration files. 36 | 37 | "Object" form shall mean any form resulting from mechanical 38 | transformation or translation of a Source form, including but 39 | not limited to compiled object code, generated documentation, 40 | and conversions to other media types. 41 | 42 | "Work" shall mean the work of authorship, whether in Source or 43 | Object form, made available under the License, as indicated by a 44 | copyright notice that is included in or attached to the work 45 | (an example is provided in the Appendix below). 46 | 47 | "Derivative Works" shall mean any work, whether in Source or Object 48 | form, that is based on (or derived from) the Work and for which the 49 | editorial revisions, annotations, elaborations, or other modifications 50 | represent, as a whole, an original work of authorship. For the purposes 51 | of this License, Derivative Works shall not include works that remain 52 | separable from, or merely link (or bind by name) to the interfaces of, 53 | the Work and Derivative Works thereof. 54 | 55 | "Contribution" shall mean any work of authorship, including 56 | the original version of the Work and any modifications or additions 57 | to that Work or Derivative Works thereof, that is intentionally 58 | submitted to Licensor for inclusion in the Work by the copyright owner 59 | or by an individual or Legal Entity authorized to submit on behalf of 60 | the copyright owner. For the purposes of this definition, "submitted" 61 | means any form of electronic, verbal, or written communication sent 62 | to the Licensor or its representatives, including but not limited to 63 | communication on electronic mailing lists, source code control systems, 64 | and issue tracking systems that are managed by, or on behalf of, the 65 | Licensor for the purpose of discussing and improving the Work, but 66 | excluding communication that is conspicuously marked or otherwise 67 | designated in writing by the copyright owner as "Not a Contribution." 68 | 69 | "Contributor" shall mean Licensor and any individual or Legal Entity 70 | on behalf of whom a Contribution has been received by Licensor and 71 | subsequently incorporated within the Work. 72 | 73 | 2. Grant of Copyright License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | copyright license to reproduce, prepare Derivative Works of, 77 | publicly display, publicly perform, sublicense, and distribute the 78 | Work and such Derivative Works in Source or Object form. 79 | 80 | 3. Grant of Patent License. Subject to the terms and conditions of 81 | this License, each Contributor hereby grants to You a perpetual, 82 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 83 | (except as stated in this section) patent license to make, have made, 84 | use, offer to sell, sell, import, and otherwise transfer the Work, 85 | where such license applies only to those patent claims licensable 86 | by such Contributor that are necessarily infringed by their 87 | Contribution(s) alone or by combination of their Contribution(s) 88 | with the Work to which such Contribution(s) was submitted. If You 89 | institute patent litigation against any entity (including a 90 | cross-claim or counterclaim in a lawsuit) alleging that the Work 91 | or a Contribution incorporated within the Work constitutes direct 92 | or contributory patent infringement, then any patent licenses 93 | granted to You under this License for that Work shall terminate 94 | as of the date such litigation is filed. 95 | 96 | 4. Redistribution. You may reproduce and distribute copies of the 97 | Work or Derivative Works thereof in any medium, with or without 98 | modifications, and in Source or Object form, provided that You 99 | meet the following conditions: 100 | 101 | (a) You must give any other recipients of the Work or 102 | Derivative Works a copy of this License; and 103 | 104 | (b) You must cause any modified files to carry prominent notices 105 | stating that You changed the files; and 106 | 107 | (c) You must retain, in the Source form of any Derivative Works 108 | that You distribute, all copyright, patent, trademark, and 109 | attribution notices from the Source form of the Work, 110 | excluding those notices that do not pertain to any part of 111 | the Derivative Works; and 112 | 113 | (d) If the Work includes a "NOTICE" text file as part of its 114 | distribution, then any Derivative Works that You distribute must 115 | include a readable copy of the attribution notices contained 116 | within such NOTICE file, excluding those notices that do not 117 | pertain to any part of the Derivative Works, in at least one 118 | of the following places: within a NOTICE text file distributed 119 | as part of the Derivative Works; within the Source form or 120 | documentation, if provided along with the Derivative Works; or, 121 | within a display generated by the Derivative Works, if and 122 | wherever such third-party notices normally appear. The contents 123 | of the NOTICE file are for informational purposes only and 124 | do not modify the License. You may add Your own attribution 125 | notices within Derivative Works that You distribute, alongside 126 | or as an addendum to the NOTICE text from the Work, provided 127 | that such additional attribution notices cannot be construed 128 | as modifying the License. 129 | 130 | You may add Your own copyright statement to Your modifications and 131 | may provide additional or different license terms and conditions 132 | for use, reproduction, or distribution of Your modifications, or 133 | for any such Derivative Works as a whole, provided Your use, 134 | reproduction, and distribution of the Work otherwise complies with 135 | the conditions stated in this License. 136 | 137 | 5. Submission of Contributions. Unless You explicitly state otherwise, 138 | any Contribution intentionally submitted for inclusion in the Work 139 | by You to the Licensor shall be under the terms and conditions of 140 | this License, without any additional terms or conditions. 141 | Notwithstanding the above, nothing herein shall supersede or modify 142 | the terms of any separate license agreement you may have executed 143 | with Licensor regarding such Contributions. 144 | 145 | 6. Trademarks. This License does not grant permission to use the trade 146 | names, trademarks, service marks, or product names of the Licensor, 147 | except as required for reasonable and customary use in describing the 148 | origin of the Work and reproducing the content of the NOTICE file. 149 | 150 | 7. Disclaimer of Warranty. Unless required by applicable law or 151 | agreed to in writing, Licensor provides the Work (and each 152 | Contributor provides its Contributions) on an "AS IS" BASIS, 153 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 154 | implied, including, without limitation, any warranties or conditions 155 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 156 | PARTICULAR PURPOSE. You are solely responsible for determining the 157 | appropriateness of using or redistributing the Work and assume any 158 | risks associated with Your exercise of permissions under this License. 159 | 160 | 8. Limitation of Liability. In no event and under no legal theory, 161 | whether in tort (including negligence), contract, or otherwise, 162 | unless required by applicable law (such as deliberate and grossly 163 | negligent acts) or agreed to in writing, shall any Contributor be 164 | liable to You for damages, including any direct, indirect, special, 165 | incidental, or consequential damages of any character arising as a 166 | result of this License or out of the use or inability to use the 167 | Work (including but not limited to damages for loss of goodwill, 168 | work stoppage, computer failure or malfunction, or any and all 169 | other commercial damages or losses), even if such Contributor 170 | has been advised of the possibility of such damages. 171 | 172 | 9. Accepting Warranty or Additional Liability. While redistributing 173 | the Work or Derivative Works thereof, You may choose to offer, 174 | and charge a fee for, acceptance of support, warranty, indemnity, 175 | or other liability obligations and/or rights consistent with this 176 | License. However, in accepting such obligations, You may act only 177 | on Your own behalf and on Your sole responsibility, not on behalf 178 | of any other Contributor, and only if You agree to indemnify, 179 | defend, and hold each Contributor harmless for any liability 180 | incurred by, or claims asserted against, such Contributor by reason 181 | of your accepting any such warranty or additional liability. 182 | 183 | END OF TERMS AND CONDITIONS 184 | 185 | APPENDIX: How to apply the Apache License to your work. 186 | 187 | To apply the Apache License to your work, attach the following 188 | boilerplate notice, with the fields enclosed by brackets "[]" 189 | replaced with your own identifying information. (Don't include 190 | the brackets!) The text should be enclosed in the appropriate 191 | comment syntax for the file format. We also recommend that a 192 | file or class name and description of purpose be included on the 193 | same "printed page" as the copyright notice for easier 194 | identification within third-party archives. 195 | 196 | Copyright [yyyy] [name of copyright owner] 197 | 198 | Licensed under the Apache License, Version 2.0 (the "License"); 199 | you may not use this file except in compliance with the License. 200 | You may obtain a copy of the License at 201 | 202 | http://www.apache.org/licenses/LICENSE-2.0 203 | 204 | Unless required by applicable law or agreed to in writing, software 205 | distributed under the License is distributed on an "AS IS" BASIS, 206 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 207 | See the License for the specific language governing permissions and 208 | limitations under the License. 209 | 210 | 211 | 212 | ### Runtime Library Exception to the Apache 2.0 License: ### 213 | 214 | 215 | As an exception, if you use this Software to compile your source code and 216 | portions of this Software are embedded into the binary product as a result, 217 | you may redistribute such product without providing attribution as would 218 | otherwise be required by Sections 4(a), 4(b) and 4(d) of the License. 219 | 220 | 221 | ## ScreenCapture 222 | 223 | Copyright (c) 2015 Jack P. 224 | 225 | Permission is hereby granted, free of charge, to any person obtaining a copy 226 | of this software and associated documentation files (the "Software"), to deal 227 | in the Software without restriction, including without limitation the rights 228 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 229 | copies of the Software, and to permit persons to whom the Software is 230 | furnished to do so, subject to the following conditions: 231 | 232 | The above copyright notice and this permission notice shall be included in 233 | all copies or substantial portions of the Software. 234 | 235 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 236 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 237 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 238 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 239 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 240 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 241 | THE SOFTWARE. 242 | 243 | Generated by CocoaPods - https://cocoapods.org 244 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ocr/Pods-ocr-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors 18 | 19 | Apache License 20 | Version 2.0, January 2004 21 | http://www.apache.org/licenses/ 22 | 23 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 24 | 25 | 1. Definitions. 26 | 27 | "License" shall mean the terms and conditions for use, reproduction, 28 | and distribution as defined by Sections 1 through 9 of this document. 29 | 30 | "Licensor" shall mean the copyright owner or entity authorized by 31 | the copyright owner that is granting the License. 32 | 33 | "Legal Entity" shall mean the union of the acting entity and all 34 | other entities that control, are controlled by, or are under common 35 | control with that entity. For the purposes of this definition, 36 | "control" means (i) the power, direct or indirect, to cause the 37 | direction or management of such entity, whether by contract or 38 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 39 | outstanding shares, or (iii) beneficial ownership of such entity. 40 | 41 | "You" (or "Your") shall mean an individual or Legal Entity 42 | exercising permissions granted by this License. 43 | 44 | "Source" form shall mean the preferred form for making modifications, 45 | including but not limited to software source code, documentation 46 | source, and configuration files. 47 | 48 | "Object" form shall mean any form resulting from mechanical 49 | transformation or translation of a Source form, including but 50 | not limited to compiled object code, generated documentation, 51 | and conversions to other media types. 52 | 53 | "Work" shall mean the work of authorship, whether in Source or 54 | Object form, made available under the License, as indicated by a 55 | copyright notice that is included in or attached to the work 56 | (an example is provided in the Appendix below). 57 | 58 | "Derivative Works" shall mean any work, whether in Source or Object 59 | form, that is based on (or derived from) the Work and for which the 60 | editorial revisions, annotations, elaborations, or other modifications 61 | represent, as a whole, an original work of authorship. For the purposes 62 | of this License, Derivative Works shall not include works that remain 63 | separable from, or merely link (or bind by name) to the interfaces of, 64 | the Work and Derivative Works thereof. 65 | 66 | "Contribution" shall mean any work of authorship, including 67 | the original version of the Work and any modifications or additions 68 | to that Work or Derivative Works thereof, that is intentionally 69 | submitted to Licensor for inclusion in the Work by the copyright owner 70 | or by an individual or Legal Entity authorized to submit on behalf of 71 | the copyright owner. For the purposes of this definition, "submitted" 72 | means any form of electronic, verbal, or written communication sent 73 | to the Licensor or its representatives, including but not limited to 74 | communication on electronic mailing lists, source code control systems, 75 | and issue tracking systems that are managed by, or on behalf of, the 76 | Licensor for the purpose of discussing and improving the Work, but 77 | excluding communication that is conspicuously marked or otherwise 78 | designated in writing by the copyright owner as "Not a Contribution." 79 | 80 | "Contributor" shall mean Licensor and any individual or Legal Entity 81 | on behalf of whom a Contribution has been received by Licensor and 82 | subsequently incorporated within the Work. 83 | 84 | 2. Grant of Copyright License. Subject to the terms and conditions of 85 | this License, each Contributor hereby grants to You a perpetual, 86 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 87 | copyright license to reproduce, prepare Derivative Works of, 88 | publicly display, publicly perform, sublicense, and distribute the 89 | Work and such Derivative Works in Source or Object form. 90 | 91 | 3. Grant of Patent License. Subject to the terms and conditions of 92 | this License, each Contributor hereby grants to You a perpetual, 93 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 94 | (except as stated in this section) patent license to make, have made, 95 | use, offer to sell, sell, import, and otherwise transfer the Work, 96 | where such license applies only to those patent claims licensable 97 | by such Contributor that are necessarily infringed by their 98 | Contribution(s) alone or by combination of their Contribution(s) 99 | with the Work to which such Contribution(s) was submitted. If You 100 | institute patent litigation against any entity (including a 101 | cross-claim or counterclaim in a lawsuit) alleging that the Work 102 | or a Contribution incorporated within the Work constitutes direct 103 | or contributory patent infringement, then any patent licenses 104 | granted to You under this License for that Work shall terminate 105 | as of the date such litigation is filed. 106 | 107 | 4. Redistribution. You may reproduce and distribute copies of the 108 | Work or Derivative Works thereof in any medium, with or without 109 | modifications, and in Source or Object form, provided that You 110 | meet the following conditions: 111 | 112 | (a) You must give any other recipients of the Work or 113 | Derivative Works a copy of this License; and 114 | 115 | (b) You must cause any modified files to carry prominent notices 116 | stating that You changed the files; and 117 | 118 | (c) You must retain, in the Source form of any Derivative Works 119 | that You distribute, all copyright, patent, trademark, and 120 | attribution notices from the Source form of the Work, 121 | excluding those notices that do not pertain to any part of 122 | the Derivative Works; and 123 | 124 | (d) If the Work includes a "NOTICE" text file as part of its 125 | distribution, then any Derivative Works that You distribute must 126 | include a readable copy of the attribution notices contained 127 | within such NOTICE file, excluding those notices that do not 128 | pertain to any part of the Derivative Works, in at least one 129 | of the following places: within a NOTICE text file distributed 130 | as part of the Derivative Works; within the Source form or 131 | documentation, if provided along with the Derivative Works; or, 132 | within a display generated by the Derivative Works, if and 133 | wherever such third-party notices normally appear. The contents 134 | of the NOTICE file are for informational purposes only and 135 | do not modify the License. You may add Your own attribution 136 | notices within Derivative Works that You distribute, alongside 137 | or as an addendum to the NOTICE text from the Work, provided 138 | that such additional attribution notices cannot be construed 139 | as modifying the License. 140 | 141 | You may add Your own copyright statement to Your modifications and 142 | may provide additional or different license terms and conditions 143 | for use, reproduction, or distribution of Your modifications, or 144 | for any such Derivative Works as a whole, provided Your use, 145 | reproduction, and distribution of the Work otherwise complies with 146 | the conditions stated in this License. 147 | 148 | 5. Submission of Contributions. Unless You explicitly state otherwise, 149 | any Contribution intentionally submitted for inclusion in the Work 150 | by You to the Licensor shall be under the terms and conditions of 151 | this License, without any additional terms or conditions. 152 | Notwithstanding the above, nothing herein shall supersede or modify 153 | the terms of any separate license agreement you may have executed 154 | with Licensor regarding such Contributions. 155 | 156 | 6. Trademarks. This License does not grant permission to use the trade 157 | names, trademarks, service marks, or product names of the Licensor, 158 | except as required for reasonable and customary use in describing the 159 | origin of the Work and reproducing the content of the NOTICE file. 160 | 161 | 7. Disclaimer of Warranty. Unless required by applicable law or 162 | agreed to in writing, Licensor provides the Work (and each 163 | Contributor provides its Contributions) on an "AS IS" BASIS, 164 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 165 | implied, including, without limitation, any warranties or conditions 166 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 167 | PARTICULAR PURPOSE. You are solely responsible for determining the 168 | appropriateness of using or redistributing the Work and assume any 169 | risks associated with Your exercise of permissions under this License. 170 | 171 | 8. Limitation of Liability. In no event and under no legal theory, 172 | whether in tort (including negligence), contract, or otherwise, 173 | unless required by applicable law (such as deliberate and grossly 174 | negligent acts) or agreed to in writing, shall any Contributor be 175 | liable to You for damages, including any direct, indirect, special, 176 | incidental, or consequential damages of any character arising as a 177 | result of this License or out of the use or inability to use the 178 | Work (including but not limited to damages for loss of goodwill, 179 | work stoppage, computer failure or malfunction, or any and all 180 | other commercial damages or losses), even if such Contributor 181 | has been advised of the possibility of such damages. 182 | 183 | 9. Accepting Warranty or Additional Liability. While redistributing 184 | the Work or Derivative Works thereof, You may choose to offer, 185 | and charge a fee for, acceptance of support, warranty, indemnity, 186 | or other liability obligations and/or rights consistent with this 187 | License. However, in accepting such obligations, You may act only 188 | on Your own behalf and on Your sole responsibility, not on behalf 189 | of any other Contributor, and only if You agree to indemnify, 190 | defend, and hold each Contributor harmless for any liability 191 | incurred by, or claims asserted against, such Contributor by reason 192 | of your accepting any such warranty or additional liability. 193 | 194 | END OF TERMS AND CONDITIONS 195 | 196 | APPENDIX: How to apply the Apache License to your work. 197 | 198 | To apply the Apache License to your work, attach the following 199 | boilerplate notice, with the fields enclosed by brackets "[]" 200 | replaced with your own identifying information. (Don't include 201 | the brackets!) The text should be enclosed in the appropriate 202 | comment syntax for the file format. We also recommend that a 203 | file or class name and description of purpose be included on the 204 | same "printed page" as the copyright notice for easier 205 | identification within third-party archives. 206 | 207 | Copyright [yyyy] [name of copyright owner] 208 | 209 | Licensed under the Apache License, Version 2.0 (the "License"); 210 | you may not use this file except in compliance with the License. 211 | You may obtain a copy of the License at 212 | 213 | http://www.apache.org/licenses/LICENSE-2.0 214 | 215 | Unless required by applicable law or agreed to in writing, software 216 | distributed under the License is distributed on an "AS IS" BASIS, 217 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 218 | See the License for the specific language governing permissions and 219 | limitations under the License. 220 | 221 | 222 | 223 | ### Runtime Library Exception to the Apache 2.0 License: ### 224 | 225 | 226 | As an exception, if you use this Software to compile your source code and 227 | portions of this Software are embedded into the binary product as a result, 228 | you may redistribute such product without providing attribution as would 229 | otherwise be required by Sections 4(a), 4(b) and 4(d) of the License. 230 | 231 | License 232 | Apache License v2.0 with Runtime Library Exception 233 | Title 234 | ArgumentParserKit 235 | Type 236 | PSGroupSpecifier 237 | 238 | 239 | FooterText 240 | Copyright (c) 2015 Jack P. 241 | 242 | Permission is hereby granted, free of charge, to any person obtaining a copy 243 | of this software and associated documentation files (the "Software"), to deal 244 | in the Software without restriction, including without limitation the rights 245 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 246 | copies of the Software, and to permit persons to whom the Software is 247 | furnished to do so, subject to the following conditions: 248 | 249 | The above copyright notice and this permission notice shall be included in 250 | all copies or substantial portions of the Software. 251 | 252 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 253 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 254 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 255 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 256 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 257 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 258 | THE SOFTWARE. 259 | 260 | License 261 | MIT 262 | Title 263 | ScreenCapture 264 | Type 265 | PSGroupSpecifier 266 | 267 | 268 | FooterText 269 | Generated by CocoaPods - https://cocoapods.org 270 | Title 271 | 272 | Type 273 | PSGroupSpecifier 274 | 275 | 276 | StringsTable 277 | Acknowledgements 278 | Title 279 | Acknowledgements 280 | 281 | 282 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ocr/Pods-ocr-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ocr : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ocr 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ocr/Pods-ocr-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ocrVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ocrVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ocr/Pods-ocr.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit" "${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture" 5 | OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit/ArgumentParserKit.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture/ScreenCapture.modulemap" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"ArgumentParserKit" -l"ScreenCapture" -framework "Foundation" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit/ArgumentParserKit.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture/ScreenCapture.modulemap" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit" "${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture" 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ocr/Pods-ocr.modulemap: -------------------------------------------------------------------------------- 1 | module Pods_ocr { 2 | umbrella header "Pods-ocr-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ocr/Pods-ocr.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit" "${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture" 5 | OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit/ArgumentParserKit.modulemap" -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture/ScreenCapture.modulemap" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"ArgumentParserKit" -l"ScreenCapture" -framework "Foundation" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit/ArgumentParserKit.modulemap" -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture/ScreenCapture.modulemap" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ArgumentParserKit" "${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture" 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ScreenCapture/ScreenCapture-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ScreenCapture : NSObject 3 | @end 4 | @implementation PodsDummy_ScreenCapture 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ScreenCapture/ScreenCapture-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ScreenCapture/ScreenCapture-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double ScreenCaptureVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ScreenCaptureVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ScreenCapture/ScreenCapture.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/ScreenCapture 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ScreenCapture/ScreenCapture.modulemap: -------------------------------------------------------------------------------- 1 | module ScreenCapture { 2 | umbrella header "ScreenCapture-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ScreenCapture/ScreenCapture.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ScreenCapture 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/ScreenCapture 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # macOCR 2 | 3 | macOCR is a command line app that enables you to turn any text on your screen into text on your clipboard. 4 | When you envoke the `ocr` command, a "screen capture" like cursor is shown. 5 | Any text within the bounds will be converted to text. 6 | 7 | You could invoke the app using the likes of [Alfred.app](https://www.alfredapp.com/), [LaunchBar](https://obdev.at/products/launchbar/index.html), [Hammerspoon](http://www.hammerspoon.org/), [Quicksilver](https://qsapp.com/), [Raycast](https://raycast.com/) etc. 8 | 9 | Examples: 10 | - [macOS Shortcut Workflow](https://www.icloud.com/shortcuts/fa91687e481849d6a27ff873ec71599b) 11 | - [Alfred.app Workflow](https://files.littlebird.com.au/OCR2-ONrTkn.zip) 12 | - [Raycast Script](https://gist.github.com/cheeaun/1405816e5ceb397cbc9028204f82dc98) 13 | - [LaunchBar Aciton](https://github.com/jsmjsm/macOCR-LaunchBar-Action) 14 | 15 | An example Alfred.app workflow is [available here](https://files.littlebird.com.au/OCR2-ONrTkn.zip). 16 | 17 | If you're still wondering "how does this work ?", I always find the .gif is the best way to clarify things: 18 | 19 | ![How it works](https://files.littlebird.com.au/Screen-Recording-2021-05-21-13-27-27-FEPQtcuk6FFweb4QEk7Y1mXhsv8B.gif) 20 | 21 | 22 | ## Installation 23 | 24 | Compile the code in this repo, or download a prebuilt binary ([Apple Silicon](https://files.littlebird.com.au/ocr.zip), [Intel](https://files.littlebird.com.au/ocr-EPiReQzFJ5Xw9wElWMqbiBayYLVp.zip)) and put it on your path. 25 | 26 | Apple Silicon Install (via Homebrew): 27 | 28 | ``` 29 | brew install schappim/ocr/ocr 30 | ``` 31 | 32 | Once installed, you can then use the [macOS Shortcut Workflow](https://www.icloud.com/shortcuts/fa91687e481849d6a27ff873ec71599b) (see below for details) 33 | 34 | Apple Silicon Install (via Curl): 35 | 36 | ``` 37 | curl -O https://files.littlebird.com.au/ocr2.zip; 38 | unzip ocr.zip; 39 | sudo cp ocr /usr/local/bin; 40 | ``` 41 | 42 | Intel Install: 43 | 44 | ``` 45 | curl -O https://files.littlebird.com.au/ocr-EPiReQzFJ5Xw9wElWMqbiBayYLVp.zip; 46 | unzip ocr-EPiReQzFJ5Xw9wElWMqbiBayYLVp.zip; 47 | sudo cp ocr /usr/local/bin; 48 | ``` 49 | 50 | 51 | When running the app the first time, you will likely be asked to allow the app access to your screen. 52 | 53 | ![Enabling access to screen](https://files.littlebird.com.au/Shared-Image-2021-05-20-08-58-38.png) 54 | 55 | ## Add as Shortcut Workflow (Mac Montery 12+) 56 | 1. Open up [MacOS Shortcuts](https://www.icloud.com/shortcuts/fa91687e481849d6a27ff873ec71599b) available on MacOS 12+. 57 | 2. Create new `Shortcut` 58 | 3. Add `Run Shell script` 59 | 4. Set input as `/usr/local/bin/ocr` (runs this app) 60 | 5. Goto `Shorcut Details` 61 | 62 | settings 63 | 64 | 7. Set `Pin in menubar` as true ☑️ 65 | 66 | ![Kapture 2022-04-22 at 19 09 40](https://user-images.githubusercontent.com/11782590/164675564-e4e03c3c-7065-4083-9978-7fd316251b0e.gif) 67 | 68 | ## OS Support 69 | 70 | This should run on Catalina and above. 71 | 72 | ## Who made this? 73 | 74 | macOCR was made by [Marcus Schappi](https://twitter.com/schappi). I create software ([and even hardware](https://chickcom.com/hardware)) to automate ecommerce, including: 75 | 76 | * [USDZ.app](https://usdz.app). [Create Augmented Reality Object Captures with USDZ.app](https://usdz.app). 77 | * [Chick Commerce](https://chickcom.com/). 78 | * This [free Australia Post app on Shopify](https://apps.shopify.com/auspost-shipping). 79 | * [Script Ninja](https://apps.shopify.com/cockatoo) which enables you to create powerful scripts and tools to automate your Shopify store. 80 | 81 | ## Thoughts on Sherlocking? 82 | 83 | Apple, please sherlock this software! 84 | 85 | ## MIT License 86 | 87 | Copyright 2021 Marcus Schappi 88 | 89 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 90 | 91 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 92 | 93 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 94 | 95 | -------------------------------------------------------------------------------- /ocr.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 84E9354E2651EEE400F03D17 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E9354D2651EEE400F03D17 /* main.swift */; }; 11 | EB9A74F33E242DD28FE898F3 /* libPods-ocr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E154BE8F115995C78B97232 /* libPods-ocr.a */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 84E935482651EEE400F03D17 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = /usr/share/man/man1/; 19 | dstSubfolderSpec = 0; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 1; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 19E4CACBB64156983BF4B2A0 /* Pods-ocr.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ocr.release.xcconfig"; path = "Target Support Files/Pods-ocr/Pods-ocr.release.xcconfig"; sourceTree = ""; }; 28 | 84E9354A2651EEE400F03D17 /* ocr */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ocr; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 84E9354D2651EEE400F03D17 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 30 | 8E154BE8F115995C78B97232 /* libPods-ocr.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ocr.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | CD7F1100A36C37937382E516 /* Pods-ocr.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ocr.debug.xcconfig"; path = "Target Support Files/Pods-ocr/Pods-ocr.debug.xcconfig"; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 84E935472651EEE400F03D17 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | EB9A74F33E242DD28FE898F3 /* libPods-ocr.a in Frameworks */, 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 53165E4C5B9A4E767F57E18A /* Pods */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | CD7F1100A36C37937382E516 /* Pods-ocr.debug.xcconfig */, 50 | 19E4CACBB64156983BF4B2A0 /* Pods-ocr.release.xcconfig */, 51 | ); 52 | name = Pods; 53 | path = Pods; 54 | sourceTree = ""; 55 | }; 56 | 84E935412651EEE400F03D17 = { 57 | isa = PBXGroup; 58 | children = ( 59 | 84E9354C2651EEE400F03D17 /* ocr */, 60 | 84E9354B2651EEE400F03D17 /* Products */, 61 | 53165E4C5B9A4E767F57E18A /* Pods */, 62 | B67C4D1AE1E95741D9FFFB85 /* Frameworks */, 63 | ); 64 | sourceTree = ""; 65 | }; 66 | 84E9354B2651EEE400F03D17 /* Products */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 84E9354A2651EEE400F03D17 /* ocr */, 70 | ); 71 | name = Products; 72 | sourceTree = ""; 73 | }; 74 | 84E9354C2651EEE400F03D17 /* ocr */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 84E9354D2651EEE400F03D17 /* main.swift */, 78 | ); 79 | path = ocr; 80 | sourceTree = ""; 81 | }; 82 | B67C4D1AE1E95741D9FFFB85 /* Frameworks */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 8E154BE8F115995C78B97232 /* libPods-ocr.a */, 86 | ); 87 | name = Frameworks; 88 | sourceTree = ""; 89 | }; 90 | /* End PBXGroup section */ 91 | 92 | /* Begin PBXNativeTarget section */ 93 | 84E935492651EEE400F03D17 /* ocr */ = { 94 | isa = PBXNativeTarget; 95 | buildConfigurationList = 84E935512651EEE400F03D17 /* Build configuration list for PBXNativeTarget "ocr" */; 96 | buildPhases = ( 97 | 4BE8CF36EDCF69593D71FB05 /* [CP] Check Pods Manifest.lock */, 98 | 84E935462651EEE400F03D17 /* Sources */, 99 | 84E935472651EEE400F03D17 /* Frameworks */, 100 | 84E935482651EEE400F03D17 /* CopyFiles */, 101 | ); 102 | buildRules = ( 103 | ); 104 | dependencies = ( 105 | ); 106 | name = ocr; 107 | productName = ocr; 108 | productReference = 84E9354A2651EEE400F03D17 /* ocr */; 109 | productType = "com.apple.product-type.tool"; 110 | }; 111 | /* End PBXNativeTarget section */ 112 | 113 | /* Begin PBXProject section */ 114 | 84E935422651EEE400F03D17 /* Project object */ = { 115 | isa = PBXProject; 116 | attributes = { 117 | LastSwiftUpdateCheck = 1240; 118 | LastUpgradeCheck = 1240; 119 | TargetAttributes = { 120 | 84E935492651EEE400F03D17 = { 121 | CreatedOnToolsVersion = 12.4; 122 | }; 123 | }; 124 | }; 125 | buildConfigurationList = 84E935452651EEE400F03D17 /* Build configuration list for PBXProject "ocr" */; 126 | compatibilityVersion = "Xcode 9.3"; 127 | developmentRegion = en; 128 | hasScannedForEncodings = 0; 129 | knownRegions = ( 130 | en, 131 | Base, 132 | ); 133 | mainGroup = 84E935412651EEE400F03D17; 134 | productRefGroup = 84E9354B2651EEE400F03D17 /* Products */; 135 | projectDirPath = ""; 136 | projectRoot = ""; 137 | targets = ( 138 | 84E935492651EEE400F03D17 /* ocr */, 139 | ); 140 | }; 141 | /* End PBXProject section */ 142 | 143 | /* Begin PBXShellScriptBuildPhase section */ 144 | 4BE8CF36EDCF69593D71FB05 /* [CP] Check Pods Manifest.lock */ = { 145 | isa = PBXShellScriptBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | ); 149 | inputFileListPaths = ( 150 | ); 151 | inputPaths = ( 152 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 153 | "${PODS_ROOT}/Manifest.lock", 154 | ); 155 | name = "[CP] Check Pods Manifest.lock"; 156 | outputFileListPaths = ( 157 | ); 158 | outputPaths = ( 159 | "$(DERIVED_FILE_DIR)/Pods-ocr-checkManifestLockResult.txt", 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | shellPath = /bin/sh; 163 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 164 | showEnvVarsInLog = 0; 165 | }; 166 | /* End PBXShellScriptBuildPhase section */ 167 | 168 | /* Begin PBXSourcesBuildPhase section */ 169 | 84E935462651EEE400F03D17 /* Sources */ = { 170 | isa = PBXSourcesBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | 84E9354E2651EEE400F03D17 /* main.swift in Sources */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | /* End PBXSourcesBuildPhase section */ 178 | 179 | /* Begin XCBuildConfiguration section */ 180 | 84E9354F2651EEE400F03D17 /* Debug */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_ANALYZER_NONNULL = YES; 185 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 186 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 187 | CLANG_CXX_LIBRARY = "libc++"; 188 | CLANG_ENABLE_MODULES = YES; 189 | CLANG_ENABLE_OBJC_ARC = YES; 190 | CLANG_ENABLE_OBJC_WEAK = YES; 191 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 192 | CLANG_WARN_BOOL_CONVERSION = YES; 193 | CLANG_WARN_COMMA = YES; 194 | CLANG_WARN_CONSTANT_CONVERSION = YES; 195 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 196 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 197 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 198 | CLANG_WARN_EMPTY_BODY = YES; 199 | CLANG_WARN_ENUM_CONVERSION = YES; 200 | CLANG_WARN_INFINITE_RECURSION = YES; 201 | CLANG_WARN_INT_CONVERSION = YES; 202 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 203 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 204 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 205 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 206 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 207 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 208 | CLANG_WARN_STRICT_PROTOTYPES = YES; 209 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 210 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 211 | CLANG_WARN_UNREACHABLE_CODE = YES; 212 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 213 | COPY_PHASE_STRIP = NO; 214 | DEBUG_INFORMATION_FORMAT = dwarf; 215 | ENABLE_STRICT_OBJC_MSGSEND = YES; 216 | ENABLE_TESTABILITY = YES; 217 | GCC_C_LANGUAGE_STANDARD = gnu11; 218 | GCC_DYNAMIC_NO_PIC = NO; 219 | GCC_NO_COMMON_BLOCKS = YES; 220 | GCC_OPTIMIZATION_LEVEL = 0; 221 | GCC_PREPROCESSOR_DEFINITIONS = ( 222 | "DEBUG=1", 223 | "$(inherited)", 224 | ); 225 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 226 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 227 | GCC_WARN_UNDECLARED_SELECTOR = YES; 228 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 229 | GCC_WARN_UNUSED_FUNCTION = YES; 230 | GCC_WARN_UNUSED_VARIABLE = YES; 231 | MACOSX_DEPLOYMENT_TARGET = 10.15; 232 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 233 | MTL_FAST_MATH = YES; 234 | ONLY_ACTIVE_ARCH = YES; 235 | SDKROOT = macosx; 236 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 237 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 238 | }; 239 | name = Debug; 240 | }; 241 | 84E935502651EEE400F03D17 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_ANALYZER_NONNULL = YES; 246 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 248 | CLANG_CXX_LIBRARY = "libc++"; 249 | CLANG_ENABLE_MODULES = YES; 250 | CLANG_ENABLE_OBJC_ARC = YES; 251 | CLANG_ENABLE_OBJC_WEAK = YES; 252 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_COMMA = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 258 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 259 | CLANG_WARN_EMPTY_BODY = YES; 260 | CLANG_WARN_ENUM_CONVERSION = YES; 261 | CLANG_WARN_INFINITE_RECURSION = YES; 262 | CLANG_WARN_INT_CONVERSION = YES; 263 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 264 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 265 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 266 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 267 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 268 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 269 | CLANG_WARN_STRICT_PROTOTYPES = YES; 270 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 271 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 272 | CLANG_WARN_UNREACHABLE_CODE = YES; 273 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 274 | COPY_PHASE_STRIP = NO; 275 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 276 | ENABLE_NS_ASSERTIONS = NO; 277 | ENABLE_STRICT_OBJC_MSGSEND = YES; 278 | GCC_C_LANGUAGE_STANDARD = gnu11; 279 | GCC_NO_COMMON_BLOCKS = YES; 280 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 281 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 282 | GCC_WARN_UNDECLARED_SELECTOR = YES; 283 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 284 | GCC_WARN_UNUSED_FUNCTION = YES; 285 | GCC_WARN_UNUSED_VARIABLE = YES; 286 | MACOSX_DEPLOYMENT_TARGET = 10.15; 287 | MTL_ENABLE_DEBUG_INFO = NO; 288 | MTL_FAST_MATH = YES; 289 | SDKROOT = macosx; 290 | SWIFT_COMPILATION_MODE = wholemodule; 291 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 292 | }; 293 | name = Release; 294 | }; 295 | 84E935522651EEE400F03D17 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | baseConfigurationReference = CD7F1100A36C37937382E516 /* Pods-ocr.debug.xcconfig */; 298 | buildSettings = { 299 | CODE_SIGN_STYLE = Automatic; 300 | DEVELOPMENT_TEAM = RWFD69KX56; 301 | ENABLE_HARDENED_RUNTIME = YES; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | SWIFT_VERSION = 5.0; 304 | }; 305 | name = Debug; 306 | }; 307 | 84E935532651EEE400F03D17 /* Release */ = { 308 | isa = XCBuildConfiguration; 309 | baseConfigurationReference = 19E4CACBB64156983BF4B2A0 /* Pods-ocr.release.xcconfig */; 310 | buildSettings = { 311 | CODE_SIGN_STYLE = Automatic; 312 | DEVELOPMENT_TEAM = RWFD69KX56; 313 | ENABLE_HARDENED_RUNTIME = YES; 314 | PRODUCT_NAME = "$(TARGET_NAME)"; 315 | SWIFT_VERSION = 5.0; 316 | }; 317 | name = Release; 318 | }; 319 | /* End XCBuildConfiguration section */ 320 | 321 | /* Begin XCConfigurationList section */ 322 | 84E935452651EEE400F03D17 /* Build configuration list for PBXProject "ocr" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | 84E9354F2651EEE400F03D17 /* Debug */, 326 | 84E935502651EEE400F03D17 /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | 84E935512651EEE400F03D17 /* Build configuration list for PBXNativeTarget "ocr" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | 84E935522651EEE400F03D17 /* Debug */, 335 | 84E935532651EEE400F03D17 /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | /* End XCConfigurationList section */ 341 | }; 342 | rootObject = 84E935422651EEE400F03D17 /* Project object */; 343 | } 344 | -------------------------------------------------------------------------------- /ocr.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ocr.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ocr.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schappim/macOCR/161913fa9ea4263451c3b1912c7c08c9c53bf835/ocr.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ocr.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ocr.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 3 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ocr.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ocr.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ocr.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schappim/macOCR/161913fa9ea4263451c3b1912c7c08c9c53bf835/ocr.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ocr/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // OCR 4 | // 5 | // Created by Marcus Schappi on 17/5/21, 11:36 am 6 | // 7 | 8 | import Foundation 9 | import CoreImage 10 | import Cocoa 11 | import Vision 12 | import ScreenCapture 13 | import ArgumentParserKit 14 | 15 | 16 | var joiner = " " 17 | var bigSur = false; 18 | 19 | if #available(OSX 11, *) { 20 | bigSur = true; 21 | } 22 | 23 | func convertCIImageToCGImage(inputImage: CIImage) -> CGImage? { 24 | let context = CIContext(options: nil) 25 | if let cgImage = context.createCGImage(inputImage, from: inputImage.extent) { 26 | return cgImage 27 | } 28 | return nil 29 | } 30 | 31 | func recognizeTextHandler(request: VNRequest, error: Error?) { 32 | guard let observations = 33 | request.results as? [VNRecognizedTextObservation] else { 34 | return 35 | } 36 | let recognizedStrings = observations.compactMap { observation in 37 | // Return the string of the top VNRecognizedText instance. 38 | return observation.topCandidates(1).first?.string 39 | } 40 | 41 | // Process the recognized strings. 42 | let joined = recognizedStrings.joined(separator: joiner) 43 | print(joined) 44 | 45 | let pasteboard = NSPasteboard.general 46 | pasteboard.declareTypes([.string], owner: nil) 47 | pasteboard.setString(joined, forType: .string) 48 | 49 | } 50 | 51 | func detectText(fileName : URL) -> [CIFeature]? { 52 | if let ciImage = CIImage(contentsOf: fileName){ 53 | guard let img = convertCIImageToCGImage(inputImage: ciImage) else { return nil} 54 | 55 | let requestHandler = VNImageRequestHandler(cgImage: img) 56 | 57 | // Create a new request to recognize text. 58 | let request = VNRecognizeTextRequest(completionHandler: recognizeTextHandler) 59 | request.recognitionLanguages = recognitionLanguages 60 | 61 | 62 | do { 63 | // Perform the text-recognition request. 64 | try requestHandler.perform([request]) 65 | } catch { 66 | print("Unable to perform the requests: \(error).") 67 | } 68 | } 69 | return nil 70 | } 71 | 72 | 73 | 74 | let inputURL = URL(fileURLWithPath: "/tmp/ocr.png") 75 | var recognitionLanguages = ["en-US"] 76 | 77 | do { 78 | 79 | 80 | let arguments = Array(CommandLine.arguments.dropFirst()) 81 | 82 | let parser = ArgumentParser(usage: "", overview: "macOCR is a command line app that enables you to turn any text on your screen into text on your clipboard") 83 | 84 | if(bigSur){ 85 | let languageOption = parser.add(option: "--language", shortName: "-l", kind: String.self, usage: "Set Language (Supports Big Sur and Above)") 86 | 87 | 88 | let parsedArguments = try parser.parse(arguments) 89 | let language = parsedArguments.get(languageOption) 90 | 91 | if (language ?? "").isEmpty{ 92 | 93 | }else{ 94 | recognitionLanguages.insert(language!, at: 0) 95 | } 96 | } 97 | 98 | let _ = ScreenCapture.captureRegion(destination: "/tmp/ocr.png") 99 | 100 | if let features = detectText(fileName : inputURL), !features.isEmpty{} 101 | 102 | } catch { 103 | // handle parsing error 104 | } 105 | 106 | exit(EXIT_SUCCESS) 107 | --------------------------------------------------------------------------------