|
template<typename T, WriterImpl WI, typename Err = typename io::Writer<WI>::ErrType, typename FuncType = std::function<Result<size_t, Err>(io::Writer<WI> &, Slice<std::add_const_t<T>>)>> |
io::Writer< impl::WriteTransformer< T, WI, Err, FuncType > > | mtcore::io::write_transformer (io::Writer< WI > &writer, FuncType mapper) |
| A specialized writer that will transform input data before passing it through to another writer Useful for things like adding an extra encoding step or for transforming between endianness.
|
|
template<typename T> |
io::Writer< impl::SliceWriterImpl< T > > | mtcore::io::slice_writer (Slice< T > out) |
| Creates a writer to write to a Slice.
|
|
template<typename T> |
io::Writer< impl::VoidWriterImpl< T > > | mtcore::io::void_writer () |
| Creates a writer which discards what's written (think of it as writer to /dev/null) Useful for doing a dry-run of a complicated write pass to get the size of the final content.
|
|
template<Formattable T> |
auto | mtcore::io::ostream_writer (std::ostream &os) |
| Creates a writer which passes its output to an ostream Useful for compatibility with the C++ standard library.
|
|
template<WriterImpl WI, typename Arg> |
Result< size_t, typename Writer< WI >::ErrType > | mtcore::io::format (Writer< WI > &writer, const FormatOptions &opts, Arg arg) |
| Generic format function which takes a bunch of arguments (of the same type) and formatting options and then outputs the formatted version of those arguments into the writer.
|
|
template<WriterImpl WI, typename... Args> |
Result< size_t, typename Writer< WI >::ErrType > | mtcore::io::print (Writer< WI > &writer, const char *fmt, const Args &...args) |
| Prints arguments using a format string Element insert points are designated by a pair of curly braces {} Format parameters can be between the curly braces (e.g.
|
|
template<WriterImpl WI, typename... Args> |
Result< size_t, typename Writer< WI >::ErrType > | mtcore::io::print (Writer< WI > &writer, const Slice< const char > &fmt, const Args &...args) |
| Prints arguments using a format string Element insert points are designated by a pair of curly braces {} Format parameters can be between the curly braces (e.g.
|
|