Treelite
Public Member Functions | List of all members
ArrayFormatter Class Reference

format array as text, wrapped to a given maximum text width. Uses high precision to render floating-point values. More...

#include <format_util.h>

Public Member Functions

 ArrayFormatter (size_t text_width, size_t indent, char delimiter=',')
 constructor More...
 
template<typename T >
ArrayFormatteroperator<< (const T &e)
 add an entry (will use high precision for floating-point values) More...
 
std::string str ()
 obtain formatted text containing the rendered array More...
 

Detailed Description

format array as text, wrapped to a given maximum text width. Uses high precision to render floating-point values.

Definition at line 59 of file format_util.h.

Constructor & Destructor Documentation

◆ ArrayFormatter()

ArrayFormatter ( size_t  text_width,
size_t  indent,
char  delimiter = ',' 
)
inline

constructor

Parameters
text_widthmaximum text width
indentindentation level
delimiterdelimiter between elements

Definition at line 67 of file format_util.h.

Member Function Documentation

◆ operator<<()

ArrayFormatter& operator<< ( const T &  e)
inline

add an entry (will use high precision for floating-point values)

Parameters
eentry to be added

Definition at line 77 of file format_util.h.

◆ str()

std::string str ( )
inline

obtain formatted text containing the rendered array

Returns
string representing the rendered array

Definition at line 99 of file format_util.h.


The documentation for this class was generated from the following file: