Source File
writer.go
Belonging Package
mime/quotedprintable
package quotedprintable
import
const lineMaxLen = 76
func ( *Writer) () error {
if := .checkLastByte(); != nil {
return
}
return .flush()
}
if .cr && == '\n' {
.cr = false
continue
}
if == '\r' {
.cr = true
}
if := .checkLastByte(); != nil {
return
}
if := .insertCRLF(); != nil {
return
}
continue
}
if .i == lineMaxLen-1 {
if := .insertSoftLineBreak(); != nil {
return
}
}
.line[.i] =
.i++
.cr = false
}
return nil
}
func ( *Writer) ( byte) error {
if lineMaxLen-1-.i < 3 {
if := .insertSoftLineBreak(); != nil {
return
}
}
.line[.i] = '='
.line[.i+1] = upperhex[>>4]
.line[.i+2] = upperhex[&0x0f]
.i += 3
return nil
}
const upperhex = "0123456789ABCDEF"
func ( *Writer) () error {
if .i == 0 {
return nil
}
:= .line[.i-1]
if isWhitespace() {
.i--
if := .encode(); != nil {
return
}
}
return nil
}
func ( *Writer) () error {
.line[.i] = '='
.i++
return .insertCRLF()
}
func ( *Writer) () error {
.line[.i] = '\r'
.line[.i+1] = '\n'
.i += 2
return .flush()
}
func ( *Writer) () error {
if , := .w.Write(.line[:.i]); != nil {
return
}
.i = 0
return nil
}
func ( byte) bool {
return == ' ' || == '\t'
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |