Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · tabwriter

Docs

std/tabwriter

On this page

Index

Constants

FILTER_HTML

const FILTER_HTML: Int = 1

Flags (Go’s FilterHTML, StripEscape, AlignRight, DiscardEmptyColumns, TabIndent, Debug), added together.

Source: std/tabwriter.xo:8

STRIP_ESCAPE

const STRIP_ESCAPE: Int = 2

Source: std/tabwriter.xo:9

ALIGN_RIGHT

const ALIGN_RIGHT: Int = 4

Source: std/tabwriter.xo:10

DISCARD_EMPTY_COLUMNS

const DISCARD_EMPTY_COLUMNS: Int = 8

Source: std/tabwriter.xo:11

TAB_INDENT

const TAB_INDENT: Int = 16

Source: std/tabwriter.xo:12

DEBUG

const DEBUG: Int = 32

Source: std/tabwriter.xo:13

ESCAPE

const ESCAPE: Int = 255

The byte that starts and ends an escaped text (Go’s Escape): its bytes pass through as one piece of the cell, tabs and all.

Source: std/tabwriter.xo:17

Types

TabWriter

struct TabWriter {}

A tab writer: text written to it is split into cells at its tabs (\t, or \v; a line ends at \n or \f), and flush returns the text with every column padded to the widest cell of its block of lines, as Go’s tabwriter.Writer does. write takes bytes in any pieces; the output it has formatted so far is held until flush returns it (Go writes it to the io.Writer as lines complete). @move_only

Source: std/tabwriter.xo:26

TabWriter.write

fn (var w: TabWriter) write(data: Bytes)

Source: std/tabwriter.xo:35

TabWriter.flush

fn (var w: TabWriter) flush() -> Bytes

The formatted output since the last flush; the writer is empty again.

Source: std/tabwriter.xo:37

Functions

writer

fn writer(min_width: Int, tab_width: Int, padding: Int, pad_char: Int = 32, flags: Int = 0) -> TabWriter

Go’s NewWriter(output, minwidth, tabwidth, padding, padchar, flags): min_width is the minimal cell width including padding, tab_width the width of a tab (when pad_char is a tab), padding the cell padding added to the text’s width, pad_char the byte padded with (a space by default, 9 for tabs), and flags the flags added together. A negative number faults.

Source: std/tabwriter.xo:34

↑ index