RawString returns a raw (bibtex) representation of the composite string.
()
| 84 | |
| 85 | // RawString returns a raw (bibtex) representation of the composite string. |
| 86 | func (c *BibComposite) RawString() string { |
| 87 | var buf bytes.Buffer |
| 88 | for i, comp := range *c { |
| 89 | if i > 0 { |
| 90 | buf.WriteString(" # ") |
| 91 | } |
| 92 | switch comp := comp.(type) { |
| 93 | case *BibConst: |
| 94 | buf.WriteString(comp.RawString()) |
| 95 | case *BibVar: |
| 96 | buf.WriteString(comp.RawString()) |
| 97 | case *BibComposite: |
| 98 | buf.WriteString(comp.RawString()) |
| 99 | } |
| 100 | } |
| 101 | return buf.String() |
| 102 | } |
| 103 | |
| 104 | // BibEntry is a record of BibTeX record. |
| 105 | type BibEntry struct { |
nothing calls this directly
no test coverage detected