NewTextApplier creates a TextApplier that reads data from src and writes modified data to dst. If src implements LineReaderAt, it is used directly.
(dst io.Writer, src io.ReaderAt)
| 24 | // NewTextApplier creates a TextApplier that reads data from src and writes |
| 25 | // modified data to dst. If src implements LineReaderAt, it is used directly. |
| 26 | func NewTextApplier(dst io.Writer, src io.ReaderAt) *TextApplier { |
| 27 | a := TextApplier{ |
| 28 | dst: dst, |
| 29 | src: src, |
| 30 | } |
| 31 | |
| 32 | if lineSrc, ok := src.(LineReaderAt); ok { |
| 33 | a.lineSrc = lineSrc |
| 34 | } else { |
| 35 | a.lineSrc = &lineReaderAt{r: src} |
| 36 | } |
| 37 | |
| 38 | return &a |
| 39 | } |
| 40 | |
| 41 | // ApplyFragment applies the changes in the fragment f, writing unwritten data |
| 42 | // before the start of the fragment and any changes from the fragment. If |
no outgoing calls