filter

package
v0.0.0-...-4c6a4f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DropChar rune = -1

DropChar is simple negative value to indicate removing a char from a RuneMap

View Source
var SpaceChar rune = 0x20

SpaceChar is a code for a simple space

View Source
var XML10Charset = func(r rune) (inrange bool) {
	return r == 0x09 ||
		r == 0x0A ||
		r == 0x0D ||
		r >= 0x20 && r <= 0xDF77 ||
		r >= 0xE000 && r <= 0xFFFD ||
		r >= 0x10000 && r <= 0x10FFFF
}

IsInCharacterXML10 Decides whether the given rune is in the XML Character Range, per the Char production of http://www.xml.com/axml/testaxml.htm, Section 2.2 Characters. (lifted from https://golang.org/src/encoding/xml/xml.go)

Functions

func NewReadCloser

func NewReadCloser(rc io.ReadCloser, f RuneMap) io.ReadCloser

NewReadCloser ...

func NewReader

func NewReader(r io.Reader, f RuneMap) io.Reader

NewReader ...

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader uses bytes.Map to transform the input from an io.Reader to alter an inbound stream

func (*Reader) Close

func (f *Reader) Close() error

Close meets the io.Closer interface

func (*Reader) Read

func (f *Reader) Read(p []byte) (int, error)

Read checks for changes to the slice, then rewrites the slice if any are found

type RuneMap

type RuneMap func(r rune) rune

RuneMap drops unwanted runes by returning false. This

func XML10Filter

func XML10Filter(replacement rune) RuneMap

XML10Filter drops runes outside of the XML 1.0 charset

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL