CPAsciiTable

ASCII-based table with minimal styling support. Can be used for structured logging and provides output like this:

+------------------------------------------------------+
|   Name        |               Value                  |
+===============+======================================+
| Game ID       | 52050358-d7a1-4def-b53f-db2bee8aea33 |
| Game name     | My Cool Game                         |
| Game URL      | 'null'                               |
| Description   | 'null'                               |
+------------------------------------------------------+
Companion:
object
Source:
CPAsciiTable.scala
class Object
trait Matchable
class Any

Value members

Concrete methods

def #/(cells: (String, Any)*): CPAsciiTable

Adds styled header (one or more header cells).

Adds styled header (one or more header cells).

Value parameters:
cells

Header cells tuples (style, text). For multi-line cells - use Seq(...).

Source:
CPAsciiTable.scala
def #=(cells: Any*): CPAsciiTable

Adds header (one or more header cells).

Adds header (one or more header cells).

Value parameters:
cells

Header cells. For multi-line cells - use Seq(...).

Source:
CPAsciiTable.scala
def #=(cells: Seq[Any]): CPAsciiTable

Adds header (one or more header cells).

Adds header (one or more header cells).

Value parameters:
cells

Header cells. For multi-line cells - use Seq(...).

Source:
CPAsciiTable.scala
def +/(cells: (String, Any)*): CPAsciiTable

Adds row (one or more row cells) with a given style.

Adds row (one or more row cells) with a given style.

Value parameters:
cells

Row cells tuples (style, text). For multi-line cells - use Seq(...).

Source:
CPAsciiTable.scala
def +=(cells: Any*): CPAsciiTable

Adds row (one or more row cells).

Adds row (one or more row cells).

Value parameters:
cells

Row cells. For multi-line cells - use Seq(...).

Source:
CPAsciiTable.scala
def +=(cells: Seq[Any]): CPAsciiTable

Adds row (one or more row cells).

Adds row (one or more row cells).

Value parameters:
cells

Row cells. For multi-line cells - use Seq(...).

Source:
CPAsciiTable.scala
def addHeaderCell(lines: Any*): CPAsciiTable

Adds single header cell with the default style..

Adds single header cell with the default style..

Value parameters:
lines

One or more cell lines.

Source:
CPAsciiTable.scala
def addHeaders(cells: List[Any]): CPAsciiTable

Adds headers.

Adds headers.

Value parameters:
cells

Header cells.

Source:
CPAsciiTable.scala
def addRow(cells: List[Any]): CPAsciiTable

Adds row.

Adds row.

Value parameters:
cells

Row cells.

Source:
CPAsciiTable.scala
def addRowCell(lines: Any*): CPAsciiTable

Adds single row cell with the default style.

Adds single row cell with the default style.

Value parameters:
lines

One or more row cells. Multiple lines will be printed on separate lines.

Source:
CPAsciiTable.scala
def addStyledHeaderCell(style: String, lines: Any*): CPAsciiTable

Adds single header cell with the default style..

Adds single header cell with the default style..

Value parameters:
lines

One or more cell lines.

style

Style to use.

Source:
CPAsciiTable.scala
def addStyledHeaders(style: String, cells: List[Any]): CPAsciiTable

Adds headers with the given style.

Adds headers with the given style.

Value parameters:
cells

Header cells.

style

Style top use.

Source:
CPAsciiTable.scala
def addStyledRowCell(style: String, lines: Any*): CPAsciiTable

Adds single row cell with the default style.

Adds single row cell with the default style.

Value parameters:
lines

One or more row cells. Multiple lines will be printed on separate lines.

style

Style to use.

Source:
CPAsciiTable.scala
def debug(log: CPLog, header: Option[String]): Unit

Renders this table to log as debug.

Renders this table to log as debug.

Value parameters:
header

Optional header.

log

Logger.

Source:
CPAsciiTable.scala
def endRow(): Unit

Ends data row.

Ends data row.

Source:
CPAsciiTable.scala
def error(log: CPLog, header: Option[String]): Unit

Renders this table to log as error.

Renders this table to log as error.

Value parameters:
header

Optional header.

log

Logger.

Source:
CPAsciiTable.scala
def info(log: CPLog, header: Option[String]): Unit

Renders this table to log as info.

Renders this table to log as info.

Value parameters:
header

Optional header.

log

Logger.

Source:
CPAsciiTable.scala
def margin(top: Int, right: Int, bottom: Int, left: Int): CPAsciiTable

Sets table's margin.

Sets table's margin.

Value parameters:
bottom

Bottom margin.

left

Left margin.

right

Right margin.

top

Top margin.

Source:
CPAsciiTable.scala
def render(ps: PrintStream): Unit

Renders this table to output stream.

Renders this table to output stream.

Value parameters:
ps

Output stream.

Source:
CPAsciiTable.scala
def render(path: String): Unit

Renders this table to file.

Renders this table to file.

Value parameters:
path

File path.

Source:
CPAsciiTable.scala
def render(file: File): Unit

Renders this table to file.

Renders this table to file.

Value parameters:
file

File.

Source:
CPAsciiTable.scala
def startRow(): Unit

Starts data row.

Starts data row.

Source:
CPAsciiTable.scala
def toImage(skin: Char => CPPixel): CPImage

Renders this table as an image.

Renders this table as an image.

Value parameters:
skin

Skin function. The functions takes character and return a new pixel.

Source:
CPAsciiTable.scala
override def toString: String
Definition Classes
Any
Source:
CPAsciiTable.scala
def trace(log: CPLog, header: Option[String]): Unit

Renders this table to log as trace.

Renders this table to log as trace.

Value parameters:
header

Optional header.

log

Logger.

Source:
CPAsciiTable.scala
def warn(log: CPLog, header: Option[String]): Unit

Renders this table to log as warn.

Renders this table to log as warn.

Value parameters:
header

Optional header.

log

Logger.

Source:
CPAsciiTable.scala