Skip to content

Commit 0910409

Browse files
committed
Re-indent everything using latest Xcode
1 parent 056c30d commit 0910409

File tree

11 files changed

+483
-483
lines changed

11 files changed

+483
-483
lines changed

Sources/StreamReader/Conveniences/FileDescriptorReader.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
 * FileDescriptorReader.swift
3-
 * StreamReader
4-
 *
5-
 * Created by François Lamboley on 2021/3/27.
6-
 */
2+
* FileDescriptorReader.swift
3+
* StreamReader
4+
*
5+
* Created by François Lamboley on 2021/3/27.
6+
*/
77

88
import Foundation
99

Sources/StreamReader/Conveniences/FileHandleReader.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
 * FileHandleReader.swift
3-
 * StreamReader
4-
 *
5-
 * Created by François Lamboley on 20/08/2017.
6-
 */
2+
* FileHandleReader.swift
3+
* StreamReader
4+
*
5+
* Created by François Lamboley on 20/08/2017.
6+
*/
77

88
import Foundation
99

@@ -17,9 +17,9 @@ extension FileHandle : GenericReadStream {
1717
data = try read(upToCount: len) ?? Data()
1818
} else {
1919
/* This might throw (an ObjC exception). Sadly these exception are not
20-
 * catchable at all in “pure” Swift, so we’re not catching them… Anyway
21-
 * this is a deprecated API, and the more modern version is used when
22-
 * available. */
20+
* catchable at all in “pure” Swift, so we’re not catching them… Anyway
21+
* this is a deprecated API, and the more modern version is used when
22+
* available. */
2323
data = readData(ofLength: len)
2424
}
2525
let sizeRead = data.count

Sources/StreamReader/Conveniences/InputStreamReader.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
 * InputStreamReader.swift
3-
 * StreamReader
4-
 *
5-
 * Created by François Lamboley on 20/08/2017.
6-
 */
2+
* InputStreamReader.swift
3+
* StreamReader
4+
*
5+
* Created by François Lamboley on 20/08/2017.
6+
*/
77

88
import Foundation
99

Sources/StreamReader/Core/StreamReader.swift

Lines changed: 202 additions & 202 deletions
Large diffs are not rendered by default.

Sources/StreamReader/Core/StreamReaderError.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
 * StreamReaderError.swift
3-
 * StreamReader
4-
 *
5-
 * Created by François Lamboley on 20/08/2017.
6-
 */
2+
* StreamReaderError.swift
3+
* StreamReader
4+
*
5+
* Created by François Lamboley on 20/08/2017.
6+
*/
77

88
import Foundation
99

@@ -12,21 +12,21 @@ import Foundation
1212
public enum StreamReaderError : Error {
1313

1414
/**
15-
The stream would reach the end before the required data size could be read.
16-
17-
If `wouldReachReadSizeLimit` is `true`, there might be more data in the
18-
stream which would allow to read the required size, but the stream
19-
configuration does not allow it. */
15+
The stream would reach the end before the required data size could be read.
16+
17+
If `wouldReachReadSizeLimit` is `true`, there might be more data in the
18+
stream which would allow to read the required size, but the stream
19+
configuration does not allow it. */
2020
case notEnoughData(wouldReachReadSizeLimit: Bool)
2121

2222
/** Cannot find any of the delimiters in the stream when using the
23-
`readData(upToDelimiters:...)` method. */
23+
`readData(upToDelimiters:...)` method. */
2424
case delimitersNotFound
2525

2626
/**
27-
When a read operation is done in a `GenericStreamReader` that would require
28-
reading from the underlying stream (not enough data in the buffer), but the
29-
`underlyingStreamReadSizeLimit` is 0, this error is thrown. */
27+
When a read operation is done in a `GenericStreamReader` that would require
28+
reading from the underlying stream (not enough data in the buffer), but the
29+
`underlyingStreamReadSizeLimit` is 0, this error is thrown. */
3030
case streamReadForbidden
3131

3232
/** An error occurred reading the stream. */

Sources/StreamReader/Implementations/DataReader.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
 * DataReader.swift
3-
 * StreamReader
4-
 *
5-
 * Created by François Lamboley on 20/08/2017.
6-
 */
2+
* DataReader.swift
3+
* StreamReader
4+
*
5+
* Created by François Lamboley on 20/08/2017.
6+
*/
77

88
import Foundation
99

@@ -17,8 +17,8 @@ public final class DataReader : StreamReader {
1717
public private(set) var currentReadPosition = 0
1818

1919
/**
20-
The whole data is in memory: the “underlying stream” (the `sourceData`) is
21-
_always_ read to `EOF`. */
20+
The whole data is in memory: the “underlying stream” (the `sourceData`) is
21+
_always_ read to `EOF`. */
2222
public let streamHasReachedEOF = true
2323
/** Always the size of the source data. */
2424
public let currentStreamReadPosition: Int
@@ -34,7 +34,7 @@ public final class DataReader : StreamReader {
3434

3535
public func clearStreamHasReachedEOF() {
3636
/* nop: the data reader has always reached EOF because all of the data is
37-
 * in memory at all time. */
37+
* in memory at all time. */
3838
}
3939

4040
public func readData<T>(size: Int, allowReadingLess: Bool, updateReadPosition: Bool, _ handler: (UnsafeRawBufferPointer) throws -> T) throws -> T {
@@ -55,10 +55,10 @@ public final class DataReader : StreamReader {
5555
return try sourceData.withUnsafeBytes{ bytes in
5656
let sizeToRead = sizeConstrainedToRemainingAllowedSizeToRead(size)
5757
/* Only possibility for bytes.baseAddress to be nil is if data is empty
58-
 * which makes currentReadPosition and size to read being different
59-
 * than 0 theoratically impossible.
60-
 * This assert validates the flatMap we have in the raw buffer pointer
61-
 * creation on next line. */
58+
* which makes currentReadPosition and size to read being different
59+
* than 0 theoratically impossible.
60+
* This assert validates the flatMap we have in the raw buffer pointer
61+
* creation on next line. */
6262
assert(bytes.baseAddress != nil || (currentReadPosition == 0 && sizeToRead == 0), "INTERNAL LOGIC ERROR")
6363
let ret = UnsafeRawBufferPointer(start: bytes.baseAddress.flatMap{ $0 + currentReadPosition }, count: sizeToRead)
6464
if updateReadPosition {currentReadPosition += sizeToRead}
@@ -71,9 +71,9 @@ public final class DataReader : StreamReader {
7171

7272
if delimiters.count == 0 || (!failIfNotFound && delimiters.count == 1 && delimiters[0] == Data()) {
7373
/* When there are no delimiters or if there is only one delimiter which
74-
 * is empty and we do not fail if we do not find the delimiter, we
75-
 * simply read the stream to the end.
76-
 * There may be more optimization possible, but we don’t care for now. */
74+
* is empty and we do not fail if we do not find the delimiter, we
75+
* simply read the stream to the end.
76+
* There may be more optimization possible, but we don’t care for now. */
7777
return try readData(size: sizeToEnd, allowReadingLess: false, updateReadPosition: updateReadPosition, { ret in try handler(ret, Data()) })
7878
}
7979

@@ -88,8 +88,8 @@ public final class DataReader : StreamReader {
8888
return try readData(size: match.length, allowReadingLess: false, updateReadPosition: updateReadPosition, { ret in try handler(ret, delimiters[match.delimiterIdx]) })
8989
}
9090
/* matchDelimiters did not find an indisputable match. However, we have
91-
 * fed all the data we have to it. We cannot find more matches! We
92-
 * simply return the best match we got. */
91+
* fed all the data we have to it. We cannot find more matches! We
92+
* simply return the best match we got. */
9393
if let match = findBestMatch(fromMatchedDatas: matchedDatas, usingMatchingMode: matchingMode) {
9494
return try readData(size: match.length, allowReadingLess: false, updateReadPosition: updateReadPosition, { ret in try handler(ret, delimiters[match.delimiterIdx]) })
9595
}

0 commit comments

Comments
 (0)