-
The source
[UInt8]to parseDeclaration
Swift
var source: [UInt8] -
The type of encoding used
Warning
Only tested with.utf8use other encodings at your own riskDeclaration
Swift
var encoding: String.Encoding -
Current reader index
Declaration
Swift
var readerIndex: Int -
Initalize with source
Declaration
Swift
init(source: [UInt8])Parameters
sourceThe source to parse
-
Initalize with source and encoding
Declaration
Swift
init(source: [UInt8], encoding: String.Encoding)Parameters
sourceThe source to parse
encodingThe encoding to use
-
Parse the source
Declaration
Swift
mutating func parse() -> [Line]Return Value
[Line] -
Determines how to parse the next line
Declaration
Swift
private mutating func parseNext() -> Line?Return Value
Line? -
Skip a comment line
Declaration
Swift
private mutating func skipComment() -
Parse the line
Declaration
Swift
private mutating func parseLine() -> Line?Return Value
Line? -
Parse the
valueside of thekey=valuepairDeclaration
Swift
private mutating func parseLineValue() -> String?Return Value
String? -
Skip spaces until another character is found
Declaration
Swift
private mutating func skipSpaces() -
Take a look at the next character to read without moving the readerIndex
Declaration
Swift
private func peek() -> UInt8?Return Value
UInt8? -
Read the next character
Declaration
Swift
@discardableResult private mutating func pop() -> UInt8?Return Value
UInt8? -
Count the distance to the next occurrence of
byteDeclaration
Swift
private func countDistance(to byte: UInt8) -> Int?Return Value
Int? -
Read the input length from source moving readerIndex
Declaration
Swift
private mutating func reader(length: Int) -> ArraySlice<UInt8>?
View on GitHub
ByteArrayParser Structure Reference