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 <common.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 125 of file common.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 133 of file common.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 143 of file common.h.

◆ str()

std::string str ( )
inline

obtain formatted text containing the rendered array

Returns
string representing the rendered array

Definition at line 165 of file common.h.


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