Skip to content

Print

Spice
import "std/text/print";

Functions

Spice
public inline p print<StrTy>(StrTy text)

Print the given string to the console

Parameters

Name Type Description
text StrTy Text to print

println

Spice
public inline p println<StrTy>(StrTy text)

Print the given string to the console, followed by a trailing line break

Parameters

Name Type Description
text StrTy Text to print

lineBreak

Spice
public inline p lineBreak(unsigned int number = 1)

Print one or several line breaks to the console

Parameters

Name Type Description
number unsigned int Number of line breaks to print (default: 1)

beep

Spice
public inline p beep()

Emit the terminal bell (beep) character

printColumn

Spice
public p printColumn(string text, unsigned int width)

Print the given text wrapped into a column of the given width, breaking on whitespace

Parameters

Name Type Description
text string Text to print
width unsigned int Column width in characters

printColumn

Spice
public p printColumn(const String& text, unsigned int width)

Print the given text wrapped into a column of the given width, breaking on whitespace

Parameters

Name Type Description
text const String& Text to print
width unsigned int Column width in characters

printFixedWidth

Spice
public p printFixedWidth(string text, unsigned int width, bool ellipsis = false)

Print the given text padded or truncated to exactly the given width

Parameters

Name Type Description
text string Text to print
width unsigned int Target width in characters
ellipsis bool If true, truncated text ends with an ellipsis ("...") (default: false)

printFixedWidth

Spice
public p printFixedWidth(const String& text, unsigned int width, bool ellipsis = false)

Print the given text padded or truncated to exactly the given width

Parameters

Name Type Description
text const String& Text to print
width unsigned int Target width in characters
ellipsis bool If true, truncated text ends with an ellipsis ("...") (default: false)