1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 import "golang.org/x/text/transform"
9 // Transformer implements the transform.Transformer interface.
10 type Transformer struct {
11 t transform.Transformer
14 // Reset implements the transform.Transformer interface.
15 func (t Transformer) Reset() { t.t.Reset() }
17 // Transform implements the transform.Transformer interface.
18 func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
19 return t.t.Transform(dst, src, atEOF)
22 // Bytes returns a new byte slice with the result of applying t to b.
23 func (t Transformer) Bytes(b []byte) []byte {
24 b, _, _ = transform.Bytes(t, b)
28 // String returns a string with the result of applying t to s.
29 func (t Transformer) String(s string) string {
30 s, _, _ = transform.String(t, s)