cockroach: Index | Files

package stringencoding

import ""


Package Files



var (
    // DontEscape is a sentinel value for characters that don't need to be escaped.
    DontEscape = byte(255)
    // EncodeMap specifies how to escape binary data with '\'.
    EncodeMap [256]byte
    // HexMap is a mapping from each byte to the `\x%%` hex form as a []byte.
    HexMap [256][]byte
    // RawHexMap is a mapping from each byte to the `%%` hex form as a []byte.
    RawHexMap [256][]byte

func EncodeEscapedChar Uses

func EncodeEscapedChar(
    buf *bytes.Buffer,
    entireString string,
    currentRune rune,
    currentByte byte,
    currentIdx int,
    quoteChar byte,

EncodeEscapedChar is used internally to write out a character from a larger string that needs to be escaped to a buffer.

func NeedEscape Uses

func NeedEscape(ch byte) bool

NeedEscape returns whether the given byte needs to be escaped.

Package stringencoding imports 3 packages (graph) and is imported by 6 packages. Updated 2019-07-20. Refresh now. Tools for package owners.