further tweaks to stringreader
This commit is contained in:
parent
e84acb1471
commit
60e0142955
@ -43,10 +43,10 @@ struct SocketStringReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mutating func read(readLength: Int) -> String {
|
mutating func read(readLength: Int) -> String {
|
||||||
let range = Range<String.Index>(start: currentIndex, end: currentIndex.advancedBy(readLength))
|
let readString = message[currentIndex..<currentIndex.advancedBy(readLength)]
|
||||||
advanceIndexBy(readLength)
|
advanceIndexBy(readLength)
|
||||||
|
|
||||||
return message.substringWithRange(range)
|
return readString
|
||||||
}
|
}
|
||||||
|
|
||||||
mutating func readUntilStringOccurence(string: String) -> String {
|
mutating func readUntilStringOccurence(string: String) -> String {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user