File: empty_element.go

package info (click to toggle)
golang-github-yosssi-ace 0.0.4%2Bgit20160102.51.71afeb7-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 468 kB
  • ctags: 249
  • sloc: makefile: 3; sh: 1
file content (25 lines) | stat: -rw-r--r-- 550 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package ace

import "io"

// emptyElement represents an empty element.
type emptyElement struct {
	elementBase
}

// Do nothing.
func (e *emptyElement) WriteTo(w io.Writer) (int64, error) {
	return 0, nil
}

// CanHaveChildren returns false.
func (e *emptyElement) CanHaveChildren() bool {
	return false
}

// newEmpty creates and returns an empty element.
func newEmptyElement(ln *line, rslt *result, src *source, parent element, opts *Options) *emptyElement {
	return &emptyElement{
		elementBase: newElementBase(ln, rslt, src, parent, opts),
	}
}