Documentation
¶
Index ¶
- func IsEOL(r rune) bool
- func ReadCR(runescanner io.RuneScanner) (size int, err error)
- func ReadCRLF(runescanner io.RuneScanner) (size int, err error)
- func ReadEOL(runescanner io.RuneScanner) (endofline string, size int, err error)
- func ReadFF(runescanner io.RuneScanner) (size int, err error)
- func ReadLF(runescanner io.RuneScanner) (size int, err error)
- func ReadLFCR(runescanner io.RuneScanner) (size int, err error)
- func ReadLS(runescanner io.RuneScanner) (size int, err error)
- func ReadNEL(runescanner io.RuneScanner) (size int, err error)
- func ReadPS(runescanner io.RuneScanner) (size int, err error)
- func ReadThisEOL(runescanner io.RuneScanner, endofline string) (size int, err error)
- func ReadVT(runescanner io.RuneScanner) (size int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadCR ¶
func ReadCR(runescanner io.RuneScanner) (size int, err error)
ReadCR tries to read the "\r" (i.e., carriage-return) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\r").
If the character read is not a '\r', then ReadCR will try to unread the character.
Example usage:
size, err := eol.ReadCR(runescanner)
func ReadCRLF ¶
func ReadCRLF(runescanner io.RuneScanner) (size int, err error)
ReadCRLF tries to read the "\r\n" (i.e., carriage-return line-feed) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\r\n").
If the first character read is not a '\r', then ReadCRLF will try to unread the character. If the second character read is not a '\n', then ReadCRLF will also try to unread the second character, but will not be able to unread the first character (i.e., '\r') it already read.
Example usage:
size, err := eol.ReadCRLF(runescanner)
func ReadEOL ¶
func ReadEOL(runescanner io.RuneScanner) (endofline string, size int, err error)
ReadEOL tries to read an end-of-line sequence.
The end-of-line sequences it supports are:
line-feed (LF) (U+000A) ('\n') line-feed, carriage-return ("\n\r") vertical-tab (VT) (U+000B) ('\v') vertical-tab (VT) (U+000B) ('\f') carriage-return (CR) (U+000D) ('\r') carriage-return, line-feed ("\r\n") next-line (NEL) (U+0085) line-separator (LS) (U+2028) line-separator (LS) (U+2029)
If successful, ReadEOL return the end-of-line sequence it found and the number-of-bytes read (to read in end-of-line sequence it found).
Example usage: /
eolSequence, size, err := eol.ReadEOL(runescanner)
func ReadFF ¶
func ReadFF(runescanner io.RuneScanner) (size int, err error)
ReadFF tries to read the "\f" (i.e., form-feed) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\f").
If the character read is not a '\f', then ReadFF will try to unread the character.
Example usage:
size, err := eol.ReadFF(runescanner)
func ReadLF ¶
func ReadLF(runescanner io.RuneScanner) (size int, err error)
ReadLF tries to read the "\n" (i.e., line-feed) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\n").
If the character read is not a '\n', then ReadLF will try to unread the character.
Example usage:
size, err := eol.ReadLF(runescanner)
func ReadLFCR ¶
func ReadLFCR(runescanner io.RuneScanner) (size int, err error)
ReadLFCR tries to read the "\r\n" (i.e., carriage-return line-feed) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\r\n").
If the first character read is not a '\n', then ReadLFCR will try to unread the character. If the second character read is not a '\r', then ReadLFCR will also try to unread the second character, but will not be able to unread the first character (i.e., '\n') it already read.
Example usage:
size, err := eol.ReadLFCR(runescanner)
func ReadLS ¶
func ReadLS(runescanner io.RuneScanner) (size int, err error)
ReadLS tries to read the "\u2028" (i.e., line-separator) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\u2028").
If the character read is not a '\u2028', then ReadLS will try to unread the character.
Example usage:
size, err := eol.ReadLS(runescanner)
func ReadNEL ¶
func ReadNEL(runescanner io.RuneScanner) (size int, err error)
ReadNEL tries to read the "\u0085" (i.e., next-line) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\u0085").
If the character read is not a '\u0085', then ReadNEL will try to unread the character.
Example usage:
size, err := eol.ReadNEL(runescanner)
func ReadPS ¶
func ReadPS(runescanner io.RuneScanner) (size int, err error)
ReadPS tries to read the "\r" (i.e., carriage-return) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\r").
If the character read is not a '\r', then ReadPS will try to unread the character.
Example usage:
size, err := eol.ReadPS(runescanner)
func ReadThisEOL ¶
func ReadThisEOL(runescanner io.RuneScanner, endofline string) (size int, err error)
ReadThisEOL tries to read the specified end-of-line sequence.
The end-of-line sequences it supports are:
line-feed (LF) (U+000A) ('\n') carriage-return (CR) (U+000D) ('\r') carriage-return, line-feed ("\r\n") next-line (NEL) (U+0085) line-separator (LS) (U+2028)
If successful, ReadThisEOL return the number-of-bytes read (to read in the specified end-of-line sequence).
Example usage: /
size, err := eol.ReadThisEOL(runescanner, eol.CRLF)
func ReadVT ¶
func ReadVT(runescanner io.RuneScanner) (size int, err error)
ReadVT tries to read the "\v" (i.e., carriage-return) end-of-line sequence.
If successful, it returns the number-of-bytes read (to read in end-of-line sequence "\v").
If the character read is not a '\v', then ReadVT will try to unread the character.
Example usage:
size, err := eol.ReadVT(runescanner)
Types ¶
This section is empty.