Formatting utilities.
More...
#include <fmt/format.h>
#include <limits>
#include <string>
#include <sstream>
#include <iomanip>
Go to the source code of this file.
|
class | ArrayFormatter |
| format array as text, wrapped to a given maximum text width. Uses high precision to render floating-point values. More...
|
|
|
std::string | IndentMultiLineString (const std::string &str, size_t indent=2) |
| apply indentation to a multi-line string by inserting spaces at the beginning of each line More...
|
|
template<typename T > |
std::string | ToStringHighPrecision (T value) |
| obtain a string representation of floating-point value, expressed in high precision More...
|
|
Formatting utilities.
Copyright (c) by 2020 Contributors
- Author
- Hyunsu Cho
Definition in file format_util.h.
◆ IndentMultiLineString()
std::string treelite::compiler::common_util::IndentMultiLineString |
( |
const std::string & |
str, |
|
|
size_t |
indent = 2 |
|
) |
| |
|
inline |
apply indentation to a multi-line string by inserting spaces at the beginning of each line
- Parameters
-
str | multi-line string |
indent | indent level to be applied (in number of spaces) |
- Returns
- indented string
Definition at line 26 of file format_util.h.
◆ ToStringHighPrecision()
std::string treelite::compiler::common_util::ToStringHighPrecision |
( |
T |
value | ) |
|
|
inline |
obtain a string representation of floating-point value, expressed in high precision
- Parameters
-
value | a value of primitive type |
- Returns
- string representation
Definition at line 53 of file format_util.h.