|
rapidyaml 0.15.2
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. | |
| 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 | |
| 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. | |
| 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. | |
| template<class CharOwningContainer, class... Args> | |
| csubstr | c4::formatrs_append (CharOwningContainer *cont, csubstr fmt, Args const &...args) |
| format+resize+append: like c4::format(), but receives a container, and appends the arguments, resizing the container as needed to contain the result. | |
| 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 "{}". This pair does not take any interior sequence numbers or extra formatting arguments inside it (contrary to eg the C++20 std::format implementation or the Python formatting facilities). To enable argument customization, use the formatting facilities in Format specifiers wrapping the arguments passed to this function.
For example:
Using Format specifiers enables control of the result. For example:
Definition at line 936 of file format.hpp.
Referenced by format(), format_sub(), formatrs(), formatrs_append(), sample_formatting(), to_chars(), to_chars(), to_chars(), to_chars(), to_chars(), and to_chars().
like c4::format() but return a substr instead of a size
Definition at line 956 of file format.hpp.
Referenced by 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 c4::formatrs_append().
Definition at line 1263 of file format.hpp.
Referenced by formatrs(), and sample_formatting().
|
inline |
format+resize: like c4::format(), but create a new container with the result.
Definition at line 1298 of file format.hpp.
|
inline |
format+resize+append: like c4::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 1330 of file format.hpp.
Referenced by sample_formatting().