CLI tool to search unicode data backed by SQLite3
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package format // import "eriol.xyz/piken/format"
|
|
|
|
|
|
|
|
import "eriol.xyz/piken/sql"
|
|
|
|
|
|
|
|
type Formatter interface {
|
|
|
|
Format(*sql.UnicodeData) (string, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type baseFormatter struct {
|
|
|
|
fields []string
|
|
|
|
showGlyph bool
|
|
|
|
}
|
|
|
|
|
|
|
|
func (bf *baseFormatter) SetFields(fields []string) {
|
|
|
|
for _, field := range fields {
|
|
|
|
bf.fields = append(bf.fields, field)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (bf baseFormatter) Fields() []string {
|
|
|
|
return bf.fields
|
|
|
|
}
|
|
|
|
|
|
|
|
func (bf *baseFormatter) SetShowGlyph(value bool) {
|
|
|
|
bf.showGlyph = value
|
|
|
|
}
|
|
|
|
|
|
|
|
func (bf baseFormatter) ShowGlyph() bool {
|
|
|
|
return bf.showGlyph
|
|
|
|
}
|