Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 638 | |
| 639 | // Format implements the NodeFormatter interface. |
| 640 | func (d *DBitArray) Format(ctx *FmtCtx) { |
| 641 | f := ctx.flags |
| 642 | if f.HasFlags(fmtPgwireFormat) { |
| 643 | d.BitArray.Format(&ctx.Buffer) |
| 644 | } else { |
| 645 | withQuotes := !f.HasFlags(FmtFlags(lexbase.EncBareStrings)) |
| 646 | if withQuotes { |
| 647 | ctx.WriteString("B'") |
| 648 | } |
| 649 | d.BitArray.Format(&ctx.Buffer) |
| 650 | if withQuotes { |
| 651 | ctx.WriteByte('\'') |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | // Size implements the Datum interface. |
| 657 | func (d *DBitArray) Size() uintptr { |