|
rapidyaml
0.9.0
parse and emit YAML, and do it fast
|
Functions | |
| template<class Arg , class... Args> | |
| size_t | c4::format (substr buf, csubstr fmt, Arg const &a, Args const &...more) |
| using a format string, serialize the arguments into the given fixed-size buffer. More... | |
| template<class... Args> | |
| substr | c4::format_sub (substr buf, csubstr fmt, Args const &...args) |
| like c4::format() but return a substr instead of a size More... | |
| template<class CharOwningContainer , class... Args> | |
| void | c4::formatrs (CharOwningContainer *cont, csubstr fmt, Args const &...args) |
| format+resize: like c4::format(), but receives a container, and resizes it as needed to contain the result. More... | |
| template<class CharOwningContainer , class... Args> | |
| CharOwningContainer | c4::formatrs (csubstr fmt, Args const &...args) |
| format+resize: like c4::format(), but create a new container with the result. More... | |
| template<class CharOwningContainer , class... Args> | |
| csubstr | c4::formatrs_append (CharOwningContainer *cont, csubstr fmt, Args const &...args) |
| format+resize+append: like format(), but receives a container, and appends the arguments, resizing the container as needed to contain the result. More... | |
| size_t c4::format | ( | substr | buf, |
| csubstr | fmt, | ||
| Arg const & | a, | ||
| Args const &... | more | ||
| ) |
using a format string, serialize the arguments into the given fixed-size buffer.
The buffer size is strictly respected: no writes will occur beyond its end. In the format string, each argument is marked with a compact curly-bracket pair: {}. Arguments beyond the last curly bracket pair are silently ignored. For example:
Definition at line 816 of file format.hpp.
References c4::yml::npos, and c4::to_chars().
Referenced by c4::format_sub(), c4::formatrs(), c4::formatrs_append(), sample::sample_formatting(), and sample::to_chars().
| substr c4::format_sub | ( | substr | buf, |
| csubstr | fmt, | ||
| Args const &... | args | ||
| ) |
like c4::format() but return a substr instead of a size
Definition at line 836 of file format.hpp.
References c4::format().
Referenced by sample::sample_formatting().
|
inline |
format+resize: like c4::format(), but receives a container, and resizes it as needed to contain the result.
The container is overwritten. To append to the container use the append overload.
Definition at line 1004 of file format.hpp.
References c4::format(), and c4::to_substr().
Referenced by c4::formatrs(), and sample::sample_formatting().
|
inline |
format+resize: like c4::format(), but create a new container with the result.
Definition at line 1020 of file format.hpp.
References c4::formatrs().
|
inline |
format+resize+append: like format(), but receives a container, and appends the arguments, resizing the container as needed to contain the result.
The buffer is appended to.
Definition at line 1033 of file format.hpp.
References c4::format(), c4::to_csubstr(), and c4::to_substr().
Referenced by sample::sample_formatting().