Files
openmethod/doc/restricted_output_stream.adoc
2025-09-05 15:28:45 -04:00

36 lines
1.1 KiB
Plaintext

## LightweightOutputStream
### Description
LightweightOutputStream is a concept describing a `std::ostream`-like class with
a reduced set of operations.
While convenient, `std::ostream` and its implementations constitute a sizeable
piece of code, which may make it unsuitable for certain applications. OpenMethod
uses a small subset of the operations supported by `std::ostream`. By default,
the library uses a lightweight implementation based on the C stream functions.
Implementations of `LightweightOutputStream` provide the following functions:
[cols="a,a", options="header"]
|===
| Name
| Description
| LightweightOutputStream& operator<<(LightweightOutputStream& os, const char* str)
| Write a null-terminated string `str` to `os`
| LightweightOutputStream& operator<<(LightweightOutputStream& os, const std::string_view& view)
| Write a view to `os
| LightweightOutputStream& operator<<(LightweightOutputStream& os, const void* value)
| Write a representation of a pointer to `os`
| LightweightOutputStream& operator<<(LightweightOutputStream& os, std::size_t value)
| Write an unsigned integer to `os`
|===