this is cool and all but the tables don't render properly
This commit is contained in:
113
cmd/subnetter/funcs_tblsizers.go
Normal file
113
cmd/subnetter/funcs_tblsizers.go
Normal file
@@ -0,0 +1,113 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
`reflect`
|
||||
)
|
||||
|
||||
/*
|
||||
Hdr prints the header for a tableAddrSizer corresponding to a slice of tableAddr.
|
||||
|
||||
indent will be printed before the string.
|
||||
|
||||
If plain is true, only ASCII chars will be used; otherwise fancy-schmancy Unicode.
|
||||
*/
|
||||
func (t *tableAddrSizer) Hdr(indent string, plain bool) (out string) {
|
||||
|
||||
var val reflect.Value
|
||||
|
||||
if t == nil {
|
||||
return
|
||||
}
|
||||
val = reflect.ValueOf(*t)
|
||||
|
||||
out = hdrRender(val, indent, plain)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Line either prints the *last line* (the border) or a *row separator* (if allowed in the format).
|
||||
func (t *tableAddrSizer) Line(indent string, plain bool, rowIdx, numRows int) (out string) {
|
||||
|
||||
var val reflect.Value
|
||||
|
||||
if t == nil {
|
||||
return
|
||||
}
|
||||
val = reflect.ValueOf(*t)
|
||||
|
||||
out = hdrLineRender(val, indent, plain, rowIdx, numRows)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Hdr prints the header for a tableLegacy4Sizer corresponding to a slice of tableLegacy4.
|
||||
|
||||
indent will be printed before the string.
|
||||
|
||||
If plain is true, only ASCII chars will be used; otherwise fancy-schmancy Unicode.
|
||||
*/
|
||||
func (t *tableLegacy4Sizer) Hdr(indent string, plain bool) (out string) {
|
||||
|
||||
var val reflect.Value
|
||||
|
||||
if t == nil {
|
||||
return
|
||||
}
|
||||
val = reflect.ValueOf(*t)
|
||||
|
||||
out = hdrRender(val, indent, plain)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Line either prints the *last line* (the border) or a *row separator* (if allowed in the format).
|
||||
func (t *tableLegacy4Sizer) Line(indent string, plain bool, rowIdx, numRows int) (out string) {
|
||||
|
||||
var val reflect.Value
|
||||
|
||||
if t == nil {
|
||||
return
|
||||
}
|
||||
val = reflect.ValueOf(*t)
|
||||
|
||||
out = hdrLineRender(val, indent, plain, rowIdx, numRows)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Hdr prints the header for a tableMask4Sizer corresponding to a slice of tableMask4.
|
||||
|
||||
indent will be printed before the string.
|
||||
|
||||
If plain is true, only ASCII chars will be used; otherwise fancy-schmancy Unicode.
|
||||
*/
|
||||
func (t *tableMask4Sizer) Hdr(indent string, plain bool) (out string) {
|
||||
|
||||
var val reflect.Value
|
||||
|
||||
if t == nil {
|
||||
return
|
||||
}
|
||||
val = reflect.ValueOf(*t)
|
||||
|
||||
out = hdrRender(val, indent, plain)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Line either prints the *last line* (the border) or a *row separator* (if allowed in the format).
|
||||
func (t *tableMask4Sizer) Line(indent string, plain bool, rowIdx, numRows int) (out string) {
|
||||
|
||||
var val reflect.Value
|
||||
|
||||
if t == nil {
|
||||
return
|
||||
}
|
||||
val = reflect.ValueOf(*t)
|
||||
|
||||
out = hdrLineRender(val, indent, plain, rowIdx, numRows)
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user